/* /app/css/app.css */
/* The app: warm paper, dark ink, one accent colour; the children's work is the colour.
 * Phone first, with a side rail on wide screens. Each screen scrolls by itself, so a keyboard cannot push the page about.
 * The colours come from /brand.css (the product's) and, once signed in, the school's own. */

:root {
  --brand: var(--brand-colour-primary, #cc4a22);
  --brand-ink: var(--brand-colour-primary-ink, #ffffff);
  --brand-soft: var(--brand-colour-primary-soft, #fdebe3);
  --bg: var(--brand-colour-paper, #fbf9f6);
  --ink: var(--brand-colour-ink, #1e2330);
  --surface: #ffffff;
  --ink-2: #4a5163;
  --muted: #6c7282;
  --line: #ece7df;
  --line-2: #f3efe9;
  --danger: #b42318;
  --ok: #2e7d4f;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 8px 30px rgba(30, 35, 48, 0.12);
  --card-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 6px 16px rgba(30, 35, 48, 0.05);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* The tab bar stands on the whole of the space the phone keeps at the bottom (the home indicator, Android's gesture bar), so its
   * labels never sit in it; where there is such a space, the labels need less room of their own under them. */
  --tab-pad: calc(8px - min(var(--safe-bottom), 6px));
  --tab-h: calc(52px + var(--tab-pad));
  --tab-total: calc(var(--tab-h) + var(--safe-bottom));
  /* How much bigger Android draws all text than asked (its font size setting; 1 elsewhere): set by fit.js. */
  --text-zoom: 1;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* In the phone apps a long press on a picture or a link offers no Copy Link, Share or Save: a picture's address carries the person's
 * picture pass (?a=), which must not leave the app. Files are saved through Download, which opens a link made for it. */
.is-app img, .is-app video, .is-app a { -webkit-touch-callout: none; -webkit-user-drag: none; }
/* Text is sized from the page's own size (1rem: 16px unless the phone asks for bigger, see fit.js), so Larger Text reaches it. */
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.45 var(--font); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
html { font-size: 100%; }
body { position: fixed; inset: 0; overflow: hidden; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 12px; }
a { color: var(--brand); }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
/* Never under 16px: a smaller field makes an iPhone zoom the page in when it is tapped. */
input, select, textarea { font: inherit; font-size: max(16px, 1rem); color: var(--ink); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.sheet:focus, .page:focus { outline: none; }
.muted, .form-hint { color: var(--muted); font-size: 0.92rem; }
.form-hint { margin: -4px 0 12px; }
.center { text-align: center; }
.small { font-size: 0.82rem; }
.is-bad { color: var(--danger) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }
.noscript { padding: 24px; text-align: center; }

svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic { display: inline-flex; flex: none; }
.ic svg { width: 20px; height: 20px; }

/* ---- screens ---- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.screen-center { position: absolute; inset: 0; overflow-y: auto; display: flex; padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px); }
.screen-center > * { margin: auto; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
.content { max-width: 1120px; margin: 0 auto; padding: 4px 18px 40px; }
.content.narrow { max-width: 680px; }
.boot { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; }
.centre-block { margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- buttons, fields ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 18px; font-weight: 650; line-height: 1.2; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.btn:active { transform: scale(0.98); }
.btn-primary { color: var(--brand-ink); background: var(--brand); border-color: var(--brand); }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-quiet-danger { color: var(--danger); background: transparent; border-color: transparent; }
.btn-block { display: flex; width: 100%; margin-top: 10px; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn.is-busy { position: relative; }
.btn.is-busy::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.icon-btn:active, .icon-btn:hover { background: var(--line-2); }
.link { padding: 6px 0; font-weight: 600; font-size: 0.94rem; color: var(--brand); background: none; border: 0; cursor: pointer; text-decoration: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 16px; }
.button-row.centre { justify-content: center; }
.form-error { color: var(--danger); font-size: 0.92rem; }

.field label, .field-label { display: block; margin-bottom: 14px; font-size: 0.88rem; font-weight: 600; color: var(--ink-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], input[type="number"], input[type="datetime-local"], input[type="url"], input[type="search"], select, textarea {
  display: block; width: 100%; min-height: 48px; padding: 12px 14px; font-weight: 400; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); appearance: none; -webkit-appearance: none;
}
/* An empty date or time box (fit.js marks it) says what it is for: on a phone or tablet it is otherwise an empty box (a computer's
 * browser writes dd/mm/yyyy in it itself). */
@media (pointer: coarse) {
input.is-empty[type="date"], input.is-empty[type="time"], input.is-empty[type="datetime-local"] { background-repeat: no-repeat; background-position: 14px center; background-size: auto 1.25em; }
input.is-empty[type="date"], input.is-empty[type="datetime-local"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='20'%3E%3Ctext x='0' y='15' font-family='-apple-system,system-ui,Roboto,sans-serif' font-size='16' fill='%236c7282'%3EChoose a date%3C/text%3E%3C/svg%3E"); }
input.is-empty[type="time"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='20'%3E%3Ctext x='0' y='15' font-family='-apple-system,system-ui,Roboto,sans-serif' font-size='16' fill='%236c7282'%3EChoose a time%3C/text%3E%3C/svg%3E"); }
input.is-empty[type="date"]:focus, input.is-empty[type="time"]:focus, input.is-empty[type="datetime-local"]:focus { background-image: none; }
input.is-empty:not(:focus)::-webkit-datetime-edit { opacity: 0; }
}
select { padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 17px center, right 12px center; background-size: 5px 5px; background-repeat: no-repeat; }
.field-label input, .field label input:not(.switch), .field label select, .field label textarea { margin-top: 6px; }
textarea { line-height: 1.45; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.emoji-input { max-width: 90px; text-align: center; font-size: 1.4rem !important; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 68px; }
.pw-toggle { position: absolute; right: 6px; bottom: 6px; height: 36px; padding: 0 10px; font-size: 0.82rem; font-weight: 700; color: var(--muted); background: none; border: 0; cursor: pointer; }

input.switch { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 51px; height: 31px; margin: 0; border-radius: 31px; background: #dcdce2; cursor: pointer; transition: background 0.2s; }
input.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28); transition: transform 0.2s; }
input.switch:checked { background: #2fb457; }
input.switch:checked::before { transform: translateX(20px); }
input.switch:disabled { opacity: 0.5; cursor: default; }
.field label.switch-row, .switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0; padding: 13px 0; font-weight: 400; color: var(--ink); border-bottom: 1px solid var(--line-2); cursor: pointer; }
.switch-row strong { display: block; font-size: 0.95rem; }
.switch-row small { display: block; color: var(--muted); font-size: 0.84rem; }

.banner { margin: 4px 0 12px; padding: 12px 14px; font-size: 0.92rem; background: var(--brand-soft); border-radius: var(--radius-sm); }
.banner.is-warn { background: #fff3cd; }
.banner.as-button { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; }
html[data-net] body::after { content: 'You’re offline. What you write is saved and will be sent when you are back online.'; position: fixed; z-index: 90; top: 0; left: 0; right: 0; padding: calc(var(--safe-top) + 5px) 12px 5px; text-align: center; font-size: 0.82rem; color: #5c4300; background: #fdf0c8; border-bottom: 1px solid #ecd58a; }
html[data-net='server'] body::after { content: 'We can’t reach the server just now. What you write is saved and will be sent. Trying again…'; }
html[data-net] { --safe-top: calc(env(safe-area-inset-top, 0px) + 28px); }
html[data-net] body:has(.net-screen)::after { display: none; }
.net-screen .net-logo { display: block; margin: 0 auto 16px; border-radius: 16px; }
.net-screen .empty { max-width: 28rem; }
.net-screen .btn { margin-top: 8px; }
.net-screen .form-hint { margin-top: 14px; }

/* ---- sign in ---- */
.auth-card { width: 100%; max-width: 380px; }
.auth-brand { text-align: center; }
.auth-brand img { width: 64px; height: 64px; object-fit: contain; margin-bottom: 8px; }
.auth-brand h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-tagline { text-align: center; color: var(--muted); margin: 0 0 22px; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.code-input { text-align: center; font-size: 1.6rem !important; letter-spacing: 0.3em; font-weight: 700 !important; }

/* ---- top bar, chips ---- */
.topbar { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-top) + 10px) 10px 8px 18px; background: var(--bg); }
.topbar h1 { margin: 0; font-size: min(1.4rem, calc(30px / var(--text-zoom))); font-weight: 800; }
.grow { flex: 1; min-width: 0; }
/* A phone: a screen's extra buttons (the Journal's printing and filters) go under one "More" (journal.js), and the bar is a little
 * tighter, so the school's name and the title are not squeezed to a letter. */
.topbar .topbar-more { display: none; }
@media (max-width: 479px) {
  .topbar:not(.page-bar) { gap: 6px; padding-left: 14px; padding-right: 6px; }
  .topbar .school-mark { width: 36px; height: 36px; border-radius: 11px; font-size: min(0.85rem, calc(14px / var(--text-zoom))); }
  .topbar .topbar-extra { display: none; }
  .topbar .topbar-more { display: inline-flex; }
}
.topbar .grow h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.school-mark { width: 42px; height: 42px; flex: none; display: inline-flex; align-items: center; justify-content: center; object-fit: contain; border-radius: 13px; font-weight: 800; font-size: min(0.95rem, calc(16px / var(--text-zoom))); color: var(--brand-ink); }
img.school-mark { background: var(--surface); border: 1px solid var(--line); padding: 3px; }
.me-btn { flex: none; display: inline-flex; padding: 2px; background: none; border: 0; border-radius: 50%; cursor: pointer; }
.me-btn .avatar { width: 36px; height: 36px; font-size: 0.95rem; }
.school-name { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 0; font-size: 0.82rem; color: var(--muted); background: none; border: 0; text-align: left; }
button.school-name { cursor: pointer; }
.school-name span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.school-name .ic svg { width: 15px; height: 15px; stroke-width: 2.4; }
.page-bar { padding-left: 6px; border-bottom: 1px solid var(--line-2); }
.page-bar h1 { font-size: 1.2rem !important; }
.chips { display: flex; gap: 8px; padding: 4px 18px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.flush { padding-left: 0; padding-right: 0; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 7px 14px; font-size: 0.9rem; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip.is-on { color: #fff; background: var(--ink); border-color: var(--ink); }
.chip.is-static { cursor: default; background: var(--brand-soft); border-color: transparent; color: var(--ink); }
.chip .ic svg { width: 15px; height: 15px; }
.searchbar { padding: 0 18px 8px; max-width: 700px; width: 100%; margin: 0 auto; }

/* ---- tabs ---- */
.panel { position: absolute; inset: 0 0 var(--tab-total) 0; display: flex; flex-direction: column; }
.tabbar { position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-start; height: var(--tab-total); padding-bottom: var(--safe-bottom); background: var(--bg); border-top: 1px solid var(--line); }
/* Labels grow with Larger Text only so far (as the phone's own tab bars do), and a label that still does not fit ends in "…" rather
 * than run into the next one. */
.tab { flex: 1; min-width: 0; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding: 0 2px var(--tab-pad); font-size: min(0.7rem, calc(13px / var(--text-zoom))); font-weight: 650; color: var(--muted); background: none; border: 0; cursor: pointer; }
.tab > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.is-active { color: var(--brand); }
.tab-icon { position: relative; display: inline-flex; }
.tab-icon .ic svg { width: 24px; height: 24px; }
.tab-count { position: absolute; top: -5px; left: 15px; min-width: 18px; height: 18px; padding: 0 5px; font-size: min(0.68rem, calc(12px / var(--text-zoom))); font-weight: 800; line-height: 18px; text-align: center; color: #fff; background: var(--danger); border-radius: 9px; border: 0; }
.tab-add { flex: none; width: 70px; display: flex; justify-content: center; align-items: flex-start; }
.add-btn { width: 58px; height: 58px; margin-top: -20px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--brand-ink); background: var(--brand); border: 4px solid var(--bg); border-radius: 999px; box-shadow: 0 6px 18px rgba(30, 35, 48, 0.28); cursor: pointer; }
.add-btn .ic svg { width: 28px; height: 28px; stroke-width: 2.4; }
.add-word, .rail-brand { display: none; }

/* ---- sheets, pages, menus ---- */
.layer { position: fixed; inset: 0; z-index: 40; }
.backdrop { position: absolute; inset: 0; background: rgba(20, 24, 33, 0.45); animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: calc(100% - var(--safe-top) - 16px); display: flex; flex-direction: column; background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: var(--shadow); animation: rise 0.22s ease-out; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-grab { width: 40px; height: 5px; margin: 8px auto -4px; border-radius: 3px; background: var(--line); flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 4px 20px; }
/* A long title with no spaces wraps rather than push Close off the screen. */
.sheet-head h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sheet-head .icon-btn { flex: none; }
.sheet-body { min-height: 0; overflow-y: auto; padding: 8px 20px calc(var(--safe-bottom) + 20px); -webkit-overflow-scrolling: touch; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }
.sheet-actions .btn { justify-content: flex-start; padding-left: 16px; min-height: 54px; font-size: 1.02rem; text-align: left; }
.sheet-actions .ic svg { width: 22px; height: 22px; }
.sheet-actions .btn:not(.btn-danger) .ic { color: var(--brand); }
.action-sub { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.page { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); animation: slide 0.2s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.vmenu-back { position: fixed; inset: 0; z-index: 70; }
.vmenu { position: fixed; min-width: 230px; max-width: calc(100% - 16px); overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 40px rgba(20, 24, 33, 0.22); animation: fade 0.12s ease-out; }
.vmenu-head { padding: 8px 12px 4px; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.vmenu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 9px 12px; text-align: left; font-weight: 600; background: none; border: 0; border-radius: 11px; cursor: pointer; }
.vmenu-item > span:not(.ic) { flex: 1; }
.vmenu-item small { display: block; font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.vmenu-item:hover, .vmenu-item:active { background: var(--line-2); }
.vmenu-item.is-danger { color: var(--danger); }
.vmenu-check { display: inline-flex; color: var(--brand); }

/* A page, sheet or menu being swiped back (ui.js), and the ring that shows while a screen is pulled down to bring it up to date. */
.is-swiped { box-shadow: -12px 0 32px rgba(20, 24, 33, 0.16); }
.ptr { position: absolute; z-index: 5; left: 0; right: 0; height: 0; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.ptr-ring { flex: none; width: 26px; height: 26px; margin-bottom: 13px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; opacity: 0; }
.ptr.is-ready .ptr-ring { border-right-color: var(--brand); }
.ptr.is-busy .ptr-ring { border-right-color: var(--line); animation: spin 0.8s linear infinite; }

.modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { position: relative; width: 100%; max-width: 380px; max-height: 100%; overflow-y: auto; padding: 22px; background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.app-toast { position: fixed; z-index: 10001; left: 50%; bottom: calc(var(--tab-total) + 22px); width: max-content; max-width: calc(100% - 32px); padding: 14px 22px; color: #fff; background: #1e2330; border-radius: 18px; font-weight: 600; line-height: 1.35; text-align: center; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.app-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.app-toast.is-tappable { cursor: pointer; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.45); text-underline-offset: 3px; }

/* ---- people ---- */
.avatar { --tone: #8a90a0; position: relative; display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; flex: none; overflow: hidden; font-size: 30px; line-height: 1; background: color-mix(in srgb, var(--tone) 22%, #fff); border: 3px solid var(--tone); border-radius: 50%; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* A child's picture stays inside its circle when Android draws all text bigger (--text-zoom, fit.js): it is a picture, not text. */
.avatar > span[aria-hidden] { font-size: calc(1em / var(--text-zoom)); }
.avatar-xs { width: 24px; height: 24px; font-size: 13px; border-width: 2px; }
.avatar-sm { width: 38px; height: 38px; font-size: 19px; border-width: 2px; }
.avatar-lg { width: 76px; height: 76px; font-size: 40px; }
.avatar-xl { width: 96px; height: 96px; font-size: 52px; border-width: 4px; }
/* Letters and counts in circles and badges of a set size grow with Larger Text only so far, so they stay inside them. */
span.avatar:not([style]) { font-size: min(1.05rem, calc(19px / var(--text-zoom))); font-weight: 800; color: var(--ink); background: var(--brand-soft); border-color: transparent; }
span.avatar-lg:not([style]) { font-size: min(1.8rem, calc(32px / var(--text-zoom))); }

/* ---- journal ---- */
.day { margin: 18px 2px 8px; font-size: 0.82rem; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; align-items: start; }
.post-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--card-shadow); cursor: pointer; }
.post-card:hover { box-shadow: var(--shadow); }
.cover { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--line-2); }
.cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cover-note { aspect-ratio: auto; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 8px; min-height: 110px; padding: 18px; background: var(--brand-soft); }
.cover-note p { margin: 0; font-size: 1.05rem; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow-wrap: anywhere; }
.cover-icon { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px; color: var(--ink-2); font-weight: 650; text-align: center; overflow-wrap: anywhere; }
.cover-icon .ic svg { width: 46px; height: 46px; stroke-width: 1.4; }
.cover-play { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(16, 19, 25, 0.6); border-radius: 50%; pointer-events: none; }
.cover-play svg { fill: currentColor; width: 26px; height: 26px; }
.cover-time, .cover-count { position: absolute; bottom: 8px; padding: 2px 9px; font-size: 0.78rem; font-weight: 700; color: #fff; background: rgba(16, 19, 25, 0.65); border-radius: 99px; }
.cover-time { left: 8px; }
.cover-count { right: 8px; }
.post-meta { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 13px; }
.post-meta:empty { display: none; }
.post-caption { margin: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow-wrap: anywhere; }
.post-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; font-size: 0.78rem; color: var(--muted); }
.kid-row { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.86rem; font-weight: 600; color: var(--ink-2); }
.kid-stack { display: flex; flex: none; }
.kid-stack .avatar + .avatar { margin-left: -6px; }
.kid-names { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 3px 10px; font-size: 0.74rem; font-weight: 700; background: var(--line-2); border-radius: 99px; }
.badge .ic svg { width: 13px; height: 13px; stroke-width: 2.2; }
.badge-wait { color: #7a4b00; background: #ffedc2; }
.badge-time { color: #12457a; background: #dcecff; }
.badge-staff { color: #4a2c86; background: #ece4fb; }
.empty { max-width: 440px; margin: 0 auto; padding: 48px 20px; text-align: center; color: var(--ink-2); }
.empty .big { font-size: 3rem; margin-bottom: 8px; }
.empty h2 { font-size: 1.3rem; color: var(--ink); }
.more { padding: 20px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.waiting-banner, .outbox-banner { display: flex; align-items: center; gap: 12px; width: 100%; margin: 4px 0 10px; padding: 12px 14px; text-align: left; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; }
.waiting-banner { background: #ffedc2; color: #4d3000; }
.outbox-banner { background: var(--surface); border-color: var(--line); }
.outbox-banner.is-bad { background: #fde8e6; border-color: #f5c2bd; }
.waiting-banner small, .outbox-banner small { display: block; font-size: 0.82rem; opacity: 0.75; }

/* ---- one post ---- */
.post-view { max-width: 820px; margin: 0 auto; padding-bottom: 40px; }
.gallery { position: relative; background: #101319; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; display: flex; align-items: center; justify-content: center; min-height: 220px; scroll-snap-align: center; }
.full-image, .full-video { display: block; max-width: 100%; max-height: 64vh; width: auto; height: auto; margin: 0 auto; }
.full-video { width: 100%; }
.full-audio, .full-doc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; width: 100%; padding: 36px 20px; color: #fff; text-align: center; overflow-wrap: anywhere; }
.full-audio audio { width: 100%; max-width: 420px; }
.audio-art { display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; color: var(--brand-ink); background: var(--brand); border-radius: 50%; }
.audio-art svg { width: 44px; height: 44px; }
.full-doc .ic svg { width: 56px; height: 56px; stroke-width: 1.3; }
.slide-nav { position: absolute; top: 50%; width: 44px; height: 60px; margin-top: -30px; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(0, 0, 0, 0.35); border: 0; border-radius: 12px; cursor: pointer; }
.slide-nav.prev { left: 6px; }
.slide-nav.next { right: 6px; }
.slide-nav:disabled { display: none; }
.slide-count { position: absolute; top: 10px; right: 10px; padding: 3px 10px; font-size: 0.76rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.5); border-radius: 99px; }
.post-details { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.post-details > p { margin: 0; }
.post-text { font-size: 1.08rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-link { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; font-weight: 600; }
.post-by { font-size: 0.84rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; font-size: 0.88rem; font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; }

/* ---- approving ---- */
.waiting-count { margin: 0 0 10px; }
.approve-list { display: flex; flex-direction: column; gap: 18px; }
.approve-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--card-shadow); transition: opacity 0.2s, transform 0.2s; }
.approve-card.leaving { opacity: 0; transform: translateX(40px); }
.approve-head { display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 14px; }
.approve-head small { display: block; color: var(--muted); font-size: 0.8rem; }
.approve-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 14px 16px; }
.approve-card .full-image, .approve-card .full-video { max-height: 46vh; }
.approve-actions .btn { flex: 1 1 auto; padding-left: 12px; padding-right: 12px; }
.approve-actions .btn-primary { flex-basis: 100%; min-height: 52px; font-size: 1.05rem; }
.approve-top:not(:empty) { margin: 0 0 14px; }

/* ---- composing ---- */
.compose { display: flex; flex-direction: column; gap: 14px; padding-top: 10px; }
.compose > * { flex: none; }
.compose h3 { margin: 4px 0 8px; }
.compose > .link { align-self: flex-start; }
.file-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.file-card { flex: none; width: 120px; }
.file-thumb { position: relative; display: flex; align-items: center; justify-content: center; width: 120px; height: 120px; overflow: hidden; background: var(--line-2); border-radius: 14px; }
.file-thumb img { width: 100%; height: 100%; object-fit: contain; }
.file-thumb .cover-play { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
.file-icon { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px; text-align: center; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.file-icon .ic svg { width: 34px; height: 34px; }
.file-tools { display: flex; justify-content: space-between; }
.file-add { flex: none; width: 120px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 700; color: var(--brand); background: transparent; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; }
.file-add .ic svg { width: 28px; height: 28px; }
.segmented { display: flex; flex-wrap: wrap; padding: 3px; background: var(--line-2); border-radius: 12px; }
/* Equal shares; a word too long for its share (Larger Text) is hyphenated where the phone can, and otherwise the choices go one under
 * the other, rather than run into each other. */
.segmented button { flex: 1 1 0; min-width: min-content; min-height: 40px; padding: 4px 6px; line-height: 1.2; -webkit-hyphens: auto; hyphens: auto; font-weight: 650; color: var(--ink-2); background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.segmented button.is-on { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
.picker-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; }
.picker-head h3 { margin: 0; flex: 1; }
/* At least 96px a child, wider with Larger Text (fewer to a row, more of each name). */
.child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(96px, 5rem)), 1fr)); gap: 8px; }
.child-chip { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; padding: 8px 2px; font-size: 0.8rem; font-weight: 600; line-height: 1.25; text-align: center; background: transparent; border: 2px solid transparent; border-radius: 16px; cursor: pointer; }
/* The first name and the surname (Posts.chipName): on one line where both fit, otherwise on two, each cut with "…" on its own, so the
 * surname's first letter is never lost. */
.chip-name { display: block; max-width: 100%; }
.chip-name > span { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
.child-chip small { font-size: 0.66rem; color: var(--muted); font-weight: 600; }
.child-chip.is-on { background: var(--brand-soft); border-color: var(--brand); }
.child-chip:disabled { cursor: default; color: inherit; }
.row-btn { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 8px; padding: 8px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; }
.row-btn .file-thumb { width: 62px; height: 62px; flex: none; }
.tag-sheet .file-thumb { margin: 0 auto 12px; }
.compose-actions { display: flex; flex-direction: column; }

/* ---- classes, lists ---- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; padding-top: 4px; }
.class-card { display: flex; align-items: center; gap: 14px; padding: 16px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--card-shadow); cursor: pointer; }
.class-card strong { display: block; font-size: 1.05rem; }
.class-card small { display: block; color: var(--muted); font-size: 0.84rem; }
.class-badge { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; flex: none; font-size: min(1.35rem, calc(24px / var(--text-zoom))); font-weight: 800; color: var(--brand-ink); background: var(--brand); border-radius: 16px; }
.class-card.is-club .class-badge { color: var(--ink); background: var(--brand-soft); border-radius: 50%; }
.count { min-width: 26px; height: 26px; padding: 0 8px; font-size: min(0.82rem, calc(15px / var(--text-zoom))); font-weight: 800; line-height: 26px; text-align: center; color: #fff; background: var(--danger); border-radius: 13px; }
/* Side by side where they fit, each on its own line where they do not (a small phone, Larger Text), never squeezed to three lines. */
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.action-row:empty { display: none; }
.action-row .btn { flex: 1 1 auto; }
.hand-over { display: flex; align-items: center; gap: 14px; width: 100%; margin: 10px 0; padding: 16px; text-align: left; color: #fff; background: var(--ink); border: 0; border-radius: 20px; cursor: pointer; }
.hand-over small { display: block; opacity: 0.75; font-size: 0.84rem; }
.hand-over-ic { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; flex: none; color: var(--brand-ink); background: var(--brand); border-radius: 15px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 8px; }
.section-head h2 { margin: 0; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-title { margin: 22px 2px 8px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; margin: 0; padding: 10px 14px; text-align: left; text-decoration: none; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--line-2); }
.field label.row, label.row { display: flex; margin: 0; color: var(--ink); }
.row:last-child { border-bottom: 0; }
button.row, a.row, label.row { cursor: pointer; }
button.row:hover, a.row:hover { background: var(--line-2); }
.row strong { display: block; font-weight: 650; font-size: 0.96rem; overflow-wrap: anywhere; }
.row small { display: block; font-weight: 400; color: var(--muted); font-size: 0.84rem; overflow-wrap: anywhere; text-wrap: pretty; }
.row > .ic { color: var(--muted); }
.row-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; color: var(--brand); background: var(--brand-soft); border-radius: 12px; }
.row-icon svg { width: 20px; height: 20px; }
.row-emoji { width: 38px; flex: none; text-align: center; font-size: 1.4rem; }
.profile { display: flex; align-items: center; gap: 16px; padding: 8px 2px; }
.profile strong { display: block; font-size: 1.2rem; }
.profile small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.face-preview { display: flex; justify-content: center; margin-bottom: 4px; }
.face-preview + .button-row { justify-content: center; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; max-height: 190px; overflow-y: auto; margin-bottom: 14px; }
.icon-grid button { height: 46px; padding: 0; font-size: 1.5rem; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.icon-grid button.is-on { border-color: var(--brand); background: var(--brand-soft); }
.colour-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.colour-row button { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; }
.colour-row button.is-on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--ink); }

/* ---- camera and voice ---- */
.page.camera { background: #000; color: #fff; }
.cam { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.cam-view { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cam-view.is-mirrored { transform: scaleX(-1); }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: flash 0.28s ease-out; }
@keyframes flash { from { opacity: 0.85; } to { opacity: 0; } }
.cam-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(var(--safe-top) + 10px) 12px 10px; background: linear-gradient(rgba(0, 0, 0, 0.55), transparent); }
.cam-status { font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px #000; }
.cam-btn { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; color: #fff; background: rgba(0, 0, 0, 0.45); border: 0; border-radius: 50%; cursor: pointer; }
.cam-fallback { position: relative; max-width: 360px; margin: auto; padding: 20px; text-align: center; }
.cam-bottom { position: relative; padding: 8px 12px calc(var(--safe-bottom) + 18px); background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); }
.cam-strip { display: flex; gap: 8px; min-height: 8px; overflow-x: auto; padding-bottom: 10px; }
.cam-shot { position: relative; flex: none; width: 64px; height: 64px; padding: 0; overflow: hidden; background: #222; border: 2px solid #fff; border-radius: 12px; cursor: pointer; }
.cam-shot img { width: 100%; height: 100%; object-fit: cover; }
.cam-shot span { position: absolute; top: 1px; right: 1px; display: flex; padding: 2px; background: rgba(0, 0, 0, 0.65); border-radius: 50%; }
.cam-shot span svg { width: 14px; height: 14px; stroke-width: 3; }
.cam-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.cam-side:last-child { justify-self: end; }
.shutter { width: 84px; height: 84px; padding: 0; background: #fff; border: 5px solid rgba(255, 255, 255, 0.4); background-clip: padding-box; border-radius: 50%; cursor: pointer; }
.shutter:active { transform: scale(0.94); }
.shutter:disabled { opacity: 0.4; }
.shutter.is-video { background-color: #e5352b; }
.shutter.is-recording { border-radius: 24px; border-width: 22px; }
.cam-done { min-height: 52px; }
.voice { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.voice-time { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.record-btn { display: flex; align-items: center; justify-content: center; width: 112px; height: 112px; color: #fff; background: #e5352b; border: 8px solid #fbd5d2; border-radius: 50%; cursor: pointer; }
.record-btn svg { width: 46px; height: 46px; }
.record-btn.is-recording { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(229, 53, 43, 0.18); } }
.voice-player { width: 100%; }
.voice .btn-block { margin-top: 0; }

/* ---- the class tablet ---- */
.kid-screen { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.kid-bar { display: flex; align-items: center; gap: 14px; padding: calc(var(--safe-top) + 12px) 16px 10px; }
.kid-bar h1 { margin: 0; font-size: 1.5rem; font-weight: 800; }
.kid-bar small { color: var(--muted); }
.kid-bar .school-mark { width: 52px; height: 52px; }
.kid-back { display: inline-flex; align-items: center; gap: 6px; min-height: 56px; padding: 0 22px 0 14px; font-size: 1.15rem; font-weight: 800; background: var(--surface); border: 2px solid var(--line); border-radius: 999px; cursor: pointer; }
.kid-back .ic svg { width: 28px; height: 28px; stroke-width: 3; }
.staff-door { color: var(--muted); }
.kid-body { max-width: 1000px; margin: 0 auto; padding: 4px 16px calc(var(--safe-bottom) + 28px); }
.kid-ask { margin: 8px 0 18px; font-size: 2rem; font-weight: 800; text-align: center; }
.kid-faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.kid-face { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; padding: 16px 4px 12px; font-size: 1.1rem; font-weight: 800; text-align: center; overflow-wrap: anywhere; background: var(--surface); border: 4px solid var(--line); border-radius: 28px; cursor: pointer; }
.kid-face:active { transform: scale(0.96); }
.kid-face.is-on { background: #e3f6e8; border-color: #2fb457; }
/* As many friends as one post can name are picked: the rest wait. */
.kid-face:disabled { opacity: 0.45; cursor: default; }
.kid-face:disabled:active { transform: none; }
.kid-tick { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; color: #fff; background: #2fb457; border-radius: 50%; }
.kid-tick svg { stroke-width: 3.5; }
.kid-hello { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin: 4px 0 22px; text-align: center; }
.kid-hello h2 { margin: 0; min-width: 0; font-size: 2rem; font-weight: 800; overflow-wrap: anywhere; }
.kid-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; max-width: 760px; margin: 0 auto; }
.kid-tile { --tile: #ffffff; --edge: var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 170px; padding: 18px 10px; background: var(--tile); border: 4px solid var(--edge); border-radius: 32px; box-shadow: 0 6px 0 var(--edge); cursor: pointer; }
.kid-tile:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--edge); }
.kid-tile-pic { font-size: 4.4rem; line-height: 1; }
.kid-tile-word { font-size: 1.5rem; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.tone-1 { --tile: #ffe8de; --edge: #ffc0a6; }
.tone-2 { --tile: #e1eeff; --edge: #b0cdf7; }
.tone-3 { --tile: #efe5fd; --edge: #cdb6f4; }
.tone-4 { --tile: #fff1c7; --edge: #f6d56b; }
.tone-5 { --tile: #ddf4e4; --edge: #a5dbb5; }
.tone-go { --tile: #2fb457; --edge: #1f8a40; color: #fff; min-height: 120px; }
.tone-go .kid-tile-pic { font-size: 3rem; }
.is-big .kid-tiles { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.is-big .kid-tile { min-height: 230px; }
.is-big .kid-tile-pic { font-size: 6rem; }
.is-big .kid-tile-word { font-size: 2rem; }
.kid-next { max-width: 360px; margin: 24px auto 0; display: grid; }
.kid-review { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.kid-review.is-one { grid-template-columns: minmax(0, 620px); justify-content: center; }
.kid-review figure { margin: 0; padding: 8px; background: var(--surface); border: 3px solid var(--line); border-radius: 24px; }
.kid-review img, .kid-review video { display: block; width: 100%; max-height: 52vh; object-fit: contain; border-radius: 16px; background: var(--line-2); }
.kid-review .full-audio { color: var(--ink); }
.kid-review figcaption { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.kid-review figcaption .btn { flex: 1; min-height: 56px; font-size: 1.1rem; }
.kid-sent { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 4vh; text-align: center; }
.kid-sent-pic { font-size: 6rem; line-height: 1; animation: pop 0.5s ease-out; }
@keyframes pop { 0% { transform: scale(0.3); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.kid-sent h2 { max-width: 100%; font-size: 2.2rem; font-weight: 800; overflow-wrap: anywhere; }
.kid-sent p { font-size: 1.3rem; }
.kid-undo { min-width: 260px; min-height: 76px; font-size: 1.5rem; border-width: 4px; border-radius: 999px; }
.kid-done { min-width: 260px; min-height: 64px; font-size: 1.3rem; border-radius: 999px; }
.kid-screen .segmented { max-width: 420px; margin: 0 auto 16px; }
.segmented.big button { min-height: 60px; font-size: 1.25rem; }
.kid-screen .post-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.post-text.big { font-size: 1.4rem; }
.page.kid-screen .post-details { padding-top: 18px; }

/* ---- family, comments and reactions ---- */
.bar-wrap { flex: none; }
.area-switch { margin: calc(var(--safe-top) + 8px) 16px 0; }
.area-switch button { min-height: 36px; font-size: 0.9rem; }
.area-switch + .topbar { padding-top: 6px; }
.school-mark.is-brand { background: transparent; border: 0; padding: 2px; }
.fam-feed { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.fam-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--card-shadow); }
.fam-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.fam-head small { display: block; color: var(--muted); font-size: 0.8rem; }
.fam-head strong { display: block; overflow-wrap: anywhere; }
.fam-words { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 4px; }
.fam-words p { margin: 0; }
.fam-waiting { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px 10px; }
.fam-held { padding: 0 14px 12px; }
.fam-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 0; }
.react-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 12px; }
.react { display: inline-flex; align-items: center; gap: 5px; min-width: 44px; min-height: 40px; justify-content: center; padding: 4px 11px; font-size: 1.15rem; line-height: 1; background: var(--bg); border: 2px solid var(--line); border-radius: 999px; cursor: pointer; }
.react b { font-size: 0.85rem; }
.react.is-on { background: var(--brand-soft); border-color: var(--brand); }
.react-row.is-big { justify-content: center; gap: 12px; }
.react-row.is-big .react { min-width: 76px; min-height: 68px; font-size: 2.1rem; border-width: 3px; }
.react-row.is-big .react b { font-size: 1.2rem; }
.fam-comments { padding: 8px 14px 10px; border-top: 1px solid var(--line-2); }
.fam-comment-line { margin: 0 0 4px; font-size: 0.92rem; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.post-view > .fam-head, .post-view > .fam-words, .post-view > .react-row { padding-left: 18px; padding-right: 18px; }
.comments { display: flex; flex-direction: column; gap: 10px; }
.post-view > .comments, .post-view > .comment-box { margin: 0 18px 12px; }
.comments-title { margin-left: 18px !important; }
.comment { padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.comment p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-to { display: block; color: var(--muted); font-size: 0.78rem; }
.comment.is-staff { background: var(--brand-soft); border-color: transparent; }
.comment.is-reply { margin-left: 26px; }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.comment-head small { color: var(--muted); font-size: 0.78rem; }
.comment-photo { display: inline-block; margin-top: 8px; }
.comment-photo img { display: block; max-width: 220px; max-height: 220px; border-radius: 12px; }
.comment-audience { display: flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--muted); font-size: 0.78rem; }
.comment-audience .ic svg { width: 14px; height: 14px; }
.comment-tools { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 2px; }
.comment-tools:empty { display: none; }
.comment-box { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.comment-box .form-hint, .comment-box .field-label { margin: 0; }
.comment-box .field-label select { margin-top: 6px; }
.comment-actions { display: flex; justify-content: flex-end; gap: 10px; }
.comment-actions .btn:first-child:not(:only-child) { margin-right: auto; }
.comment-chosen { display: flex; align-items: center; gap: 12px; }
.comment-chosen img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.responses { display: flex; flex-direction: column; gap: 10px; padding: 4px 18px 20px; border-top: 1px solid var(--line-2); }
.responses > .tag-list { padding-top: 12px; }
.responses .list-title { margin-bottom: 0; }
.seen-by { margin: 8px 0 0; font-size: 0.9rem; }
.seen-by .ic { vertical-align: -4px; margin-right: 6px; }
.seen-by summary { cursor: pointer; font-weight: 650; }
.seen-by ul { margin: 8px 0 0; padding-left: 20px; }
.post-counts { font-size: 0.8rem; font-weight: 650; color: var(--muted); }
.post-counts.is-waiting { color: #7a4b00; }
.sharing-note p { margin: 0; }
.sharing-note p + p { margin-top: 6px; }
.approve-card.is-comment { padding-bottom: 4px; }
.comment-on { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; text-align: left; background: var(--line-2); border: 0; cursor: pointer; }
.comment-on img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; flex: none; }
.comment-on strong, .comment-on small { display: block; }
.comment-on small { color: var(--muted); font-size: 0.82rem; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; }
.approve-comment { padding: 12px 14px; }
.comment-answers { margin: 0 0 8px; color: var(--muted); font-size: 0.9rem; }
.rules-text { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.problem-list { margin: 0 0 14px; padding-left: 20px; }
.problem-list li { margin-bottom: 6px; }
.no-photo { color: var(--danger) !important; }
.class-links { margin-top: 12px; }
.section-head h2 .avatar { vertical-align: -5px; margin-right: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.wrap .button-row { margin: 0; gap: 6px; }
.switch-choice { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.switch-choice:last-child { border-bottom: 0; }
.switch-choice strong { display: block; font-size: 0.96rem; }
.switch-choice small { display: block; color: var(--muted); font-size: 0.82rem; }
.switch-choice select { width: 132px; min-height: 40px; padding-top: 6px; padding-bottom: 6px; flex: none; }
.permit-all { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.permit-card { margin-bottom: 12px; padding: 12px 14px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.permit-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.permit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); column-gap: 20px; }
.field label.permit, .permit { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 9px 0; font-weight: 400; font-size: 0.92rem; cursor: pointer; }
.auth-extra { margin-top: 18px; }
.code-input.is-long { font-size: 1.3rem !important; letter-spacing: 0.08em; text-transform: uppercase; }
.auth-card .list { margin-bottom: 8px; text-align: left; }
.kid-responses { max-width: 640px; margin: 0 auto; padding: 0 16px 20px; }
.kid-responses .comment { font-size: 1.2rem; }
.kid-phrases { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kid-phrase { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 92px; justify-content: center; font-size: 1.1rem; font-weight: 800; background: var(--surface); border: 3px solid var(--line); border-radius: 22px; cursor: pointer; }
.kid-phrase span { font-size: 2.2rem; }
.kid-type { display: flex; gap: 10px; margin-top: 14px; }
.kid-type input { flex: 1; }

/* ---- messages, announcements and alerts ---- */
.message-switch { margin: 4px 0 12px; }
.content.field .segmented { margin: 4px 0 12px; }
.content .btn-block + .list { margin-top: 12px; }
.found { margin-top: 10px; }
.found .list { margin-bottom: 10px; }
.chat-earlier { align-self: center; }
.chat-chosen { flex-wrap: wrap; }
.chosen-note { flex-basis: 100%; color: var(--muted); font-size: 0.8rem; }
.message-switch button { display: flex; align-items: center; justify-content: center; gap: 8px; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; font-size: min(0.74rem, calc(14px / var(--text-zoom))); font-weight: 800; color: #fff; background: var(--danger); border-radius: 11px; }
.new-chat { margin: 0 0 14px; }
.chat-row { align-items: flex-start; }
.chat-row .grow { min-width: 0; }
.chat-row.is-unread strong, .chat-row.is-unread .chat-last { font-weight: 800; color: var(--ink); }
.chat-row .badges { margin-top: 5px; }
.chat-last { display: -webkit-box !important; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; }
.chat-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.chat-side small { white-space: nowrap; }
/* A phone: the day alone ("24 Nov", chats.js), and the name on one line, so the name, who they are and the message keep their room. */
@media (max-width: 479px) {
  .chat-time .chat-clock { display: none; }
  .chat-row .grow > strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.chat-side .chat-read, .chat-read-note { color: var(--brand); font-weight: 650; }
.chat-read-note { align-self: flex-end; margin: -4px 6px 10px; font-size: 0.75rem; }
.badge-bad { color: #8c1c13; background: #fde2df; }
.badge-ok { color: #1c5c38; background: #ddf4e4; }
.chat-privacy { margin: 8px 0 12px; font-size: 0.82rem; text-align: center; color: var(--muted); }
.chat-list { display: flex; flex-direction: column; gap: 8px; }
.chat-day { margin: 12px 0 2px; font-size: 0.76rem; text-align: center; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.chat-note { align-self: center; max-width: 90%; margin: 2px 0; padding: 6px 12px; font-size: 0.82rem; text-align: center; color: var(--ink-2); background: var(--line-2); border-radius: 12px; overflow-wrap: anywhere; }
.bubble { align-self: flex-start; max-width: 85%; padding: 9px 13px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 18px 5px; }
.bubble.is-own { align-self: flex-end; background: var(--brand-soft); border-color: transparent; border-radius: 18px 18px 5px 18px; }
.bubble.is-waiting { background: transparent; border: 1px dashed var(--muted); }
.bubble.is-bad { background: #fde8e6; border-color: #f5c2bd; }
.bubble strong { display: block; font-size: 0.82rem; }
.bubble p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-tag { display: block; font-size: 0.74rem; font-style: italic; color: var(--muted); }
.bubble-time { display: flex; justify-content: flex-end; gap: 10px; margin-top: 3px; font-size: 0.72rem; color: var(--muted); }
.bubble-photo img { display: block; max-width: 220px; max-height: 220px; margin-top: 6px; border-radius: 12px; }
.bubble-file { margin-top: 6px; max-width: 100%; }
.bubble-file span:last-child, .notice .btn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-foot { flex: none; padding: 0 12px calc(var(--safe-bottom) + 10px); background: var(--bg); border-top: 1px solid var(--line); }
.chat-foot:empty { display: none; }
.chat-form { max-width: 650px; margin: 0 auto; padding-top: 10px; }
.chat-line { display: flex; align-items: flex-end; gap: 4px; }
.chat-line textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; resize: none; }
.chat-send { color: var(--brand-ink) !important; background: var(--brand) !important; border-radius: 50%; }
/* A phone, where staff have three tools beside the box (attach, send later, writing help): they go in a row under it, so the box keeps
 * the width of the screen and a sentence is a line or two, not six. The box and Send stay side by side. */
@media (max-width: 479px) {
  .chat-line:has(> .icon-btn:not(.chat-send) + .icon-btn:not(.chat-send)) { flex-wrap: wrap; row-gap: 2px; }
  .chat-line:has(> .icon-btn:not(.chat-send) + .icon-btn:not(.chat-send)) > textarea { order: -1; flex-basis: calc(100% - 48px); }
  .chat-line:has(> .icon-btn:not(.chat-send) + .icon-btn:not(.chat-send)) > .chat-send { order: -1; }
}
.chat-later { margin: 0 0 8px; }
.chat-chosen { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.chat-closed { max-width: 650px; margin: 0 auto; padding: 14px 4px 4px; font-size: 0.92rem; text-align: center; color: var(--ink-2); }
.notice { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; margin: 0 0 12px; padding: 14px 16px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--card-shadow); }
.notice.as-button { cursor: pointer; }
.notice.is-emergency { border: 2px solid var(--danger); }
.notice h2, .notice strong { margin: 0; font-size: 1.08rem; overflow-wrap: anywhere; }
.notice .badges:empty { display: none; }
.notice-body { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice-photo img { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; }
.notice-count { font-size: 0.84rem; font-weight: 650; color: var(--ink-2); margin: 0; }
.notice-confirm { align-self: stretch; }
.pick-list { margin-bottom: 14px; max-height: 320px; overflow-y: auto; }
.field label.switch-row.pad, .switch-row.pad { padding: 11px 14px; }
.pad { padding: 12px 14px; }
.row .plain { display: block; padding: 0; text-align: left; background: none; border: 0; cursor: pointer; min-width: 0; }
.flag-row { border-bottom: 1px solid var(--line-2); }
.flag-row .btn { margin: 0 14px 12px; }
small.is-bad { color: var(--danger) !important; }
.alert-strips { flex: none; padding: 0 18px 6px; }
.alert-strip { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 644px; margin: 0 auto 4px; padding: 10px 14px; font-weight: 750; text-align: left; color: #fff; background: var(--danger); border: 0; border-radius: 14px; cursor: pointer; }
.alert-cover { position: fixed; inset: 0; z-index: 10002; display: flex; overflow-y: auto; padding: calc(var(--safe-top) + 20px) 18px calc(var(--safe-bottom) + 20px); background: #8c1c13; }
.alert-card { width: 100%; max-width: 520px; margin: auto; padding: 26px 22px; text-align: center; background: #fff; color: #1e2330; border-radius: 24px; }
.alert-card h2 { margin: 8px 0 12px; font-size: 1.6rem; overflow-wrap: anywhere; }
.alert-card p { font-size: 1.1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.alert-card .btn { color: #fff; background: #8c1c13; border-color: #8c1c13; min-height: 54px; font-size: 1.05rem; }
.alert-mark svg { width: 48px; height: 48px; fill: none; stroke: #8c1c13; stroke-width: 2; }

/* ---- wide screens: tabs down the side, sheets in the middle ---- */
@media (min-width: 900px) and (min-height: 540px) {
  .panel { inset: 0 0 0 236px; }
  .tabbar { top: 0; right: auto; width: 236px; height: auto; flex-direction: column; align-items: stretch; gap: 4px; padding: 18px 14px; border-top: 0; border-right: 1px solid var(--line); background: var(--surface); }
  .rail-brand { display: flex; align-items: center; gap: 10px; margin: 0 6px 18px; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
  .rail-brand img { width: 34px; height: 34px; object-fit: contain; }
  .tab { flex: none; height: 48px; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 0 12px; font-size: 0.98rem; border-radius: 13px; }
  .tab:hover { background: var(--line-2); }
  .tab.is-active { background: var(--brand-soft); color: var(--ink); }
  .tab.is-active .ic { color: var(--brand); }
  .tab-add { order: -1; width: auto; margin: 0 0 14px; }
  .rail-brand { order: -2; }
  .add-btn { width: 100%; height: 50px; margin: 0; border: 0; box-shadow: var(--card-shadow); font-weight: 750; }
  .add-btn .ic svg { width: 22px; height: 22px; }
  .add-word { display: inline; }
  /* The bar over a tab lines up with what the tab shows: the full width for the journal and classes, the narrower column of Today,
   * Messages and Account (.content.narrow). The rail already shows the app's logo, so the family's bar does not show it again. */
  .panel { --col: 1120px; }
  .panel:has(> .scroll > .content.narrow) { --col: 680px; }
  .topbar:not(.page-bar) { max-width: var(--col, 1120px); width: 100%; margin: 0 auto; padding-top: 22px; }
  .topbar .school-mark.is-brand { display: none; }
  .area-switch { max-width: 320px; margin-top: 18px; margin-left: max(18px, calc((100% - var(--col, 1120px)) / 2 + 18px)); }
  .area-switch + .topbar:not(.page-bar) { padding-top: 10px; }
  .chips:not(.flush) { max-width: var(--col, 1120px); width: 100%; margin: 0 auto; }
  .searchbar { max-width: var(--col, 1120px); }
  .sheet { bottom: auto; top: 50%; translate: 0 -50%; max-height: min(86%, 760px); border-radius: 24px; }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 14px; }
  .app-toast { bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .spinner, .ptr.is-busy .ptr-ring { animation: spin 1.6s linear infinite !important; }
}
/* /app/css/editor.css */
/* The photo editor (editor.js): dark around the picture, the tools under it, or beside it on a wide screen. */

.page.pe {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "stage" "side";
  overflow: hidden;
  color: #fff;
  background: #101319;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.page.pe:focus, .page.pe:focus-visible { outline: none; }
.pe *, .pe *::before, .pe *::after { box-sizing: border-box; }
.pe [hidden] { display: none !important; }
.pe .sr-only { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pe button {
  margin: 0; font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation;
  -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent;
}
.pe button:disabled { opacity: 0.38; cursor: default; }
.pe button:focus-visible, .pe .pe-sel:focus-visible { outline: 3px solid #ffd60a; outline-offset: 2px; }
.pe .ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pe .ic svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pe .pe-label { line-height: 1.15; text-align: center; }

/* ---- the bar at the top ---- */
.pe .pe-top { grid-area: top; min-width: 0; padding: calc(var(--safe-top, 0px) + 6px) calc(env(safe-area-inset-right, 0px) + 8px) 4px calc(env(safe-area-inset-left, 0px) + 8px); }
.pe .pe-bar { display: flex; align-items: center; gap: 6px; }
.pe .pe-mid { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 4px; }
.pe .pe-title { margin: 0; overflow: hidden; font-size: 0.9rem; font-weight: 650; line-height: 1.3; color: #cdd3df; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.pe .pe-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 56px; min-height: 48px; padding: 3px 8px; font-size: 0.76rem; font-weight: 650; white-space: nowrap; background: transparent; border-radius: 12px; }
.pe .pe-btn:active:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.pe .pe-btn .ic svg { width: 21px; height: 21px; }
.pe .pe-cancel { font-size: 0.98rem; }
.pe .pe-done { flex-direction: row; gap: 5px; padding: 0 16px 0 12px; font-size: 1rem; font-weight: 750; color: var(--brand-ink, #ffffff); background: var(--brand, #e4572e); border-radius: 999px; }
.pe .pe-done:active:not(:disabled) { background: var(--brand, #e4572e); filter: brightness(1.12); }

/* ---- the picture ---- */
.pe .pe-stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; overflow: hidden; touch-action: none; }
.pe .pe-canvas { position: absolute; display: block; touch-action: none; }
.pe .pe-stage.is-painting { cursor: crosshair; }
.pe.is-loading .pe-canvas { visibility: hidden; }
.pe .pe-wait { position: absolute; z-index: 8; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; font-weight: 600; text-align: center; color: #e4e8f0; }
.pe.is-busy .pe-wait { background: rgba(16, 19, 25, 0.6); }
.pe .pe-spin { width: 30px; height: 30px; border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; border-radius: 50%; animation: pe-spin 0.8s linear infinite; }
@keyframes pe-spin { to { transform: rotate(360deg); } }
.pe .pe-ring { position: absolute; z-index: 2; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(0, 0, 0, 0.7); pointer-events: none; transform: translate(-50%, -50%); }

/* ---- the chosen sticker or words ---- */
.pe .pe-sel { position: absolute; z-index: 3; border: 2px dashed #fff; border-radius: 8px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.55); pointer-events: none; }
.pe .pe-knob { position: absolute; z-index: 4; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; color: var(--ink, #1e2330); background: #fff; border-radius: 50%; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); touch-action: none; }
.pe .pe-knob .ic svg { width: 22px; height: 22px; stroke-width: 2.2; }
.pe .pe-grip { cursor: nwse-resize; }

/* ---- cropping ---- */
.pe .pe-crop { position: absolute; touch-action: none; }
.pe .pe-cropbox { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 200vmax rgba(8, 10, 14, 0.68); }
.pe .pe-cropbox::before { content: ""; position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(90deg, transparent calc(33.33% - 1px), rgba(255, 255, 255, 0.45) 33.33%, transparent calc(33.33% + 1px), transparent calc(66.66% - 1px), rgba(255, 255, 255, 0.45) 66.66%, transparent calc(66.66% + 1px)),
  linear-gradient(transparent calc(33.33% - 1px), rgba(255, 255, 255, 0.45) 33.33%, transparent calc(33.33% + 1px), transparent calc(66.66% - 1px), rgba(255, 255, 255, 0.45) 66.66%, transparent calc(66.66% + 1px)); }
.pe .pe-hold { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: transparent; cursor: move; touch-action: none; }
.pe .pe-hold:focus-visible { outline-offset: -6px; }
.pe .pe-h { position: absolute; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: transparent; border-radius: 8px; touch-action: none; }
.pe .pe-h i { display: block; pointer-events: none; }
.pe .pe-h.is-corner { z-index: 2; }
.pe .pe-h.is-corner i { width: 24px; height: 24px; border: 0 solid #fff; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.7)); }
.pe .pe-h-nw { left: -22px; top: -22px; cursor: nwse-resize; } .pe .pe-h-nw i { border-width: 5px 0 0 5px !important; transform: translate(8px, 8px); }
.pe .pe-h-ne { right: -22px; top: -22px; cursor: nesw-resize; } .pe .pe-h-ne i { border-width: 5px 5px 0 0 !important; transform: translate(-8px, 8px); }
.pe .pe-h-sw { left: -22px; bottom: -22px; cursor: nesw-resize; } .pe .pe-h-sw i { border-width: 0 0 5px 5px !important; transform: translate(8px, -8px); }
.pe .pe-h-se { right: -22px; bottom: -22px; cursor: nwse-resize; } .pe .pe-h-se i { border-width: 0 5px 5px 0 !important; transform: translate(-8px, -8px); }
.pe .pe-h-n, .pe .pe-h-s { left: 22px; right: 22px; width: auto; cursor: ns-resize; }
.pe .pe-h-w, .pe .pe-h-e { top: 22px; bottom: 22px; height: auto; cursor: ew-resize; }
.pe .pe-h-n { top: -22px; } .pe .pe-h-s { bottom: -22px; } .pe .pe-h-w { left: -22px; } .pe .pe-h-e { right: -22px; }
.pe .pe-h.is-edge i { background: #fff; border-radius: 3px; box-shadow: 0 0 3px rgba(0, 0, 0, 0.7); }
.pe .pe-h-n i, .pe .pe-h-s i { width: 30px; max-width: 100%; height: 5px; }
.pe .pe-h-w i, .pe .pe-h-e i { width: 5px; height: 30px; max-height: 100%; }
.pe.is-cropping .pe-bar, .pe.is-cropping .pe-tools { visibility: hidden; }

/* ---- the typing box (at the top, clear of the keyboard) ---- */
.pe .pe-words { position: absolute; z-index: 9; top: 8px; left: 50%; width: min(440px, calc(100% - 20px)); max-height: calc(100% - 12px); overflow-y: auto; padding: 10px; color: var(--ink, #1e2330); background: var(--surface, #ffffff); border-radius: 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); transform: translateX(-50%); }
.pe .pe-input { display: block; width: 100%; margin: 0 0 8px; padding: 10px 12px; font: inherit; font-size: 1.25rem; font-weight: 650; line-height: 1.3; color: var(--ink, #1e2330); background: #fff; border: 2px solid var(--line, #ece7df); border-radius: 12px; resize: none; -webkit-user-select: text; user-select: text; }
.pe .pe-input:focus { outline: 3px solid var(--brand, #e4572e); outline-offset: 0; }
.pe .pe-form-row { display: flex; gap: 8px; }
.pe .pe-form-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; font-size: 1.02rem; font-weight: 700; color: var(--ink, #1e2330); background: var(--bg, #fbf9f6); border: 1px solid var(--line, #ece7df); border-radius: 12px; }
.pe .pe-form-btn.is-main { color: var(--brand-ink, #ffffff); background: var(--brand, #e4572e); border-color: var(--brand, #e4572e); }

/* ---- the panel and the tools ---- */
.pe .pe-side { grid-area: side; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0 env(safe-area-inset-right, 0px) var(--safe-bottom, 0px) env(safe-area-inset-left, 0px); background: #171b24; }
.pe.is-loading .pe-side { opacity: 0.35; pointer-events: none; }
.pe.is-busy .pe-side, .pe.is-busy .pe-top { opacity: 0.55; pointer-events: none; }
.pe .pe-panel { display: flex; flex-direction: column; gap: 8px; height: 192px; padding: 8px 10px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.pe .pe-panel > * { flex: none; }
.pe .pe-panel > :first-child { margin-top: auto; }
.pe .pe-panel > :last-child { margin-bottom: auto; }
.pe .pe-hint { margin: 0; padding: 0 6px; font-size: 0.9rem; line-height: 1.35; color: #b7bfce; text-align: center; }
.pe .pe-hint.is-row { display: flex; align-items: center; justify-content: center; min-height: 52px; }
.pe .pe-row { display: flex; align-items: stretch; justify-content: center; gap: 6px; }
.pe .pe-act, .pe .pe-size { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; max-width: 128px; min-height: 52px; padding: 5px 3px; font-size: 0.8rem; font-weight: 650; background: rgba(255, 255, 255, 0.1); border-radius: 12px; }
.pe .pe-act:active:not(:disabled) { background: rgba(255, 255, 255, 0.22); }
.pe .pe-act.is-main { color: var(--brand-ink, #ffffff); background: var(--brand, #e4572e); }
.pe .pe-dot { display: flex; align-items: center; justify-content: center; height: 24px; }
.pe .pe-dot i { display: block; background: currentColor; border-radius: 50%; }
.pe .pe-size[aria-pressed="true"] { color: var(--ink, #1e2330); background: #fff; }
.pe .pe-seg { display: flex; gap: 3px; width: 100%; max-width: 400px; margin-left: auto; margin-right: auto; padding: 3px; background: rgba(255, 255, 255, 0.09); border-radius: 14px; }
.pe .pe-seg-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 42px; padding: 0 6px; font-size: 0.86rem; font-weight: 650; background: transparent; border-radius: 11px; }
.pe .pe-seg-btn .ic svg { width: 20px; height: 20px; }
.pe .pe-seg-btn[aria-pressed="true"] { color: var(--ink, #1e2330); background: #fff; }

.pe .pe-swatches { display: flex; justify-content: center; width: 100%; max-width: 440px; margin-left: auto; margin-right: auto; }
.pe .pe-swatch { flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-width: 0; height: 48px; padding: 0; background: transparent; border-radius: 12px; }
.pe .pe-swatch i { display: block; width: 78%; max-width: 34px; aspect-ratio: 1; border: 2px solid rgba(255, 255, 255, 0.45); border-radius: 50%; transition: transform 0.1s; }
.pe .pe-swatch[aria-pressed="true"] i { border: 4px solid #fff; box-shadow: 0 0 0 2px var(--brand, #e4572e); transform: scale(1.14); }

.pe .pe-strip { display: flex; gap: 6px; padding: 3px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.3) transparent; }
.pe .pe-emoji { flex: none; width: 52px; height: 52px; padding: 0; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 30px; line-height: 1; background: rgba(255, 255, 255, 0.09); border-radius: 12px; }
.pe .pe-emoji:active { background: rgba(255, 255, 255, 0.25); }
.pe .pe-emoji[aria-pressed="true"] { background: #fff; box-shadow: 0 0 0 3px var(--brand, #e4572e); }
.pe .pe-link { display: inline; padding: 0; font: inherit; color: #fff; text-decoration: underline; background: none; cursor: pointer; }
.pe .pe-slider { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 440px; margin: 0 auto; padding: 0 6px; }
.pe .pe-end { flex: none; font-size: 0.82rem; font-weight: 650; color: #b7bfce; }
.pe .pe-range { flex: 1 1 auto; min-width: 0; height: 44px; margin: 0; background: transparent; accent-color: var(--brand, #e4572e); }
/* The squares brush stacks four rows (mode, area, coarseness, hint): closer together, so they fit the panel without scrolling. */
.pe .pe-panel.pe-tight { gap: 5px; }
.pe .pe-panel.pe-tight .pe-seg-btn { min-height: 40px; }
.pe .pe-panel.pe-tight .pe-range { height: 40px; }

.pe .pe-tools { display: flex; gap: 4px; padding: 5px 6px; background: #0b0e13; }
.pe .pe-tool { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 58px; padding: 5px 2px; font-size: 0.78rem; font-weight: 650; color: #b7bfce; background: transparent; border-radius: 14px; }
.pe .pe-tool:active:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.pe .pe-tool[aria-pressed="true"] { color: #fff; background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 -3px 0 var(--brand, #e4572e); }

/* ---- for young children: everything big, a picture and a word ---- */
.pe.pe-simple .pe-btn { flex-direction: row; gap: 7px; min-width: 104px; min-height: 58px; padding: 0 18px 0 14px; font-size: 1.15rem; font-weight: 750; border-radius: 999px; }
.pe.pe-simple .pe-btn .ic svg { width: 28px; height: 28px; stroke-width: 2.6; }
.pe.pe-simple .pe-cancel { background: rgba(255, 255, 255, 0.14); }
.pe.pe-simple .pe-done { color: #fff; background: #23874a; }
.pe.pe-simple .pe-done:active:not(:disabled) { background: #23874a; }
.pe.pe-simple .pe-title { font-size: 1.15rem; color: #fff; }
.pe.pe-simple .pe-panel { height: 176px; }
.pe.pe-simple .pe-hint { font-size: 1.05rem; color: #dde2ec; }
.pe.pe-simple .pe-hint.is-row { min-height: 68px; }
.pe.pe-simple .pe-swatch { height: 56px; }
.pe.pe-simple .pe-swatch i { width: 88%; max-width: 46px; }
.pe.pe-simple .pe-act, .pe.pe-simple .pe-size { min-height: 68px; font-size: 0.95rem; }
.pe.pe-simple .pe-act .ic svg { width: 28px; height: 28px; stroke-width: 2.2; }
.pe.pe-simple .pe-dot { height: 28px; }
.pe.pe-simple .pe-emoji { width: 68px; height: 68px; font-size: 42px; border-radius: 16px; }
.pe.pe-simple .pe-knob { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
.pe.pe-simple .pe-knob .ic svg { width: 28px; height: 28px; }
.pe.pe-simple .pe-tools { gap: 6px; padding: 8px; }
.pe.pe-simple .pe-tool { gap: 5px; min-height: 90px; font-size: 1rem; font-weight: 750; color: #fff; background: rgba(255, 255, 255, 0.07); border-radius: 18px; }
.pe.pe-simple .pe-tool .ic { width: 48px; height: 48px; color: #fff; background: #1e6fe0; border-radius: 50%; }
.pe.pe-simple .pe-tool .ic svg { width: 30px; height: 30px; stroke-width: 2.2; }
.pe.pe-simple .pe-tool[data-tool="stickers"] .ic { background: #c2398a; }
.pe.pe-simple .pe-tool[data-tool="words"] .ic { background: #23874a; }
.pe.pe-simple .pe-tool[data-tool="undo"] .ic { background: #c75f00; }
.pe.pe-simple .pe-tool[aria-pressed="true"] { color: var(--ink, #1e2330); background: #fff; box-shadow: none; }

/* A short screen held upright: smaller rows, so the picture keeps its room. */
@media (orientation: portrait) and (max-height: 640px) {
  .pe .pe-panel, .pe.pe-simple .pe-panel { gap: 6px; height: 164px; padding-top: 6px; padding-bottom: 6px; }
  .pe .pe-seg-btn, .pe .pe-panel.pe-tight .pe-seg-btn { min-height: 36px; }
  .pe .pe-panel.pe-tight { gap: 4px; }
  .pe .pe-panel.pe-tight .pe-range { height: 36px; }
  .pe .pe-swatch, .pe.pe-simple .pe-swatch { height: 46px; }
  .pe .pe-act, .pe .pe-size { gap: 1px; min-height: 46px; padding-top: 2px; padding-bottom: 2px; }
  .pe .pe-act .ic svg { width: 20px; height: 20px; }
  .pe .pe-hint.is-row { min-height: 46px; }
  .pe.pe-simple .pe-hint.is-row { min-height: 58px; font-size: 0.98rem; }
  .pe .pe-emoji { width: 44px; height: 44px; font-size: 26px; }
  .pe.pe-simple .pe-act, .pe.pe-simple .pe-size { min-height: 58px; }
  .pe.pe-simple .pe-act .ic svg { width: 24px; height: 24px; }
  .pe.pe-simple .pe-emoji { width: 58px; height: 58px; font-size: 36px; }
  .pe.pe-simple .pe-tool { min-height: 74px; }
  .pe.pe-simple .pe-tool .ic { width: 38px; height: 38px; }
  .pe.pe-simple .pe-tool .ic svg { width: 26px; height: 26px; }
}

/* Wide screens (a phone or tablet on its side, a laptop): the tools go beside the picture. */
@media (orientation: landscape) and (min-width: 560px) {
  .page.pe { grid-template-columns: minmax(0, 1fr) 312px; grid-template-areas: "top top" "stage side"; grid-template-rows: auto minmax(0, 1fr); }
  .pe .pe-side { padding-left: 0; }
  .pe .pe-panel, .pe.pe-simple .pe-panel { flex: 1; height: auto; min-height: 0; }
  .pe .pe-mid { gap: 12px; }
  /* From the top, so nothing moves when more buttons appear underneath. */
  .pe .pe-panel > :first-child { margin-top: 0; }
  .pe .pe-swatches { flex-wrap: wrap; max-width: 260px; }
  .pe .pe-swatch { flex: 0 0 25%; }
  .pe .pe-row { flex-wrap: wrap; }
  .pe .pe-act { flex-basis: 28%; }
  /* The stickers take the room that is left and scroll inside it, so the buttons under them stay in sight. */
  .pe .pe-panel > .pe-strip { flex: 0 1 auto; flex-wrap: wrap; align-content: flex-start; justify-content: center; min-height: 62px; overflow-x: hidden; overflow-y: auto; }
  .pe.pe-simple .pe-panel > .pe-strip { min-height: 76px; }
}
@media (orientation: landscape) and (min-width: 560px) and (max-height: 500px) {
  .pe .pe-top { padding-bottom: 2px; }
  .pe .pe-title:not(.sr-only) { font-size: 0.8rem; }
  .pe .pe-panel, .pe.pe-simple .pe-panel { gap: 6px; padding-top: 6px; padding-bottom: 6px; }
  .pe .pe-swatches { flex-wrap: nowrap; max-width: none; }
  .pe .pe-swatch, .pe.pe-simple .pe-swatch { flex: 1 1 0; height: 44px; }
  .pe .pe-seg-btn, .pe .pe-panel.pe-tight .pe-seg-btn { min-height: 36px; }
  .pe .pe-panel.pe-tight .pe-range { height: 36px; }
  .pe.pe-simple .pe-btn { min-height: 48px; }
  .pe.pe-simple .pe-act, .pe.pe-simple .pe-size, .pe.pe-simple .pe-hint.is-row { min-height: 56px; }
  .pe.pe-simple .pe-act .ic svg { width: 22px; height: 22px; }
  .pe.pe-simple .pe-emoji { width: 60px; height: 60px; font-size: 38px; }
  .pe.pe-simple .pe-panel > .pe-strip { min-height: 66px; }
  .pe.pe-simple .pe-tool { min-height: 68px; font-size: 0.86rem; }
  .pe.pe-simple .pe-tool .ic { width: 34px; height: 34px; }
  .pe.pe-simple .pe-tool .ic svg { width: 22px; height: 22px; }
}
/* /app/css/life.css */
/* The day to day: the Today tab, telling the school about an absence, the calendar, care records and points.
 * Everything here uses the colours and spacing of app.css. */

.life-date { margin: 6px 2px 4px; }
.life-date h2 { margin: 0; font-size: 1.35rem; }
.life-date p { margin: 0; font-size: 0.9rem; }
.life-section { margin-top: 6px; }
.life-empty { margin: 0 2px 8px; }
.life-row, .life-link { text-align: left; }
.life-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.life-next { margin-top: 12px; }
.life-foot { margin: 22px 2px 0; }
.life-report + .life-report { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.life-note { padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--line-2); border-radius: var(--radius-sm); }
.life-link .count { flex: none; }

/* choosing what to tell the school */
.life-ask { margin: 10px 0 6px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.life-ask > strong { display: block; margin-bottom: 10px; font-size: 1.05rem; }
.life-ask-grid, .life-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.life-kind { display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 10px 12px; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.life-kind strong { font-size: 0.95rem; }
.life-kind small { color: var(--muted); font-size: 0.78rem; line-height: 1.25; }
.life-kind.is-small { min-height: 48px; justify-content: center; }
.life-kind:active { transform: scale(0.98); }
.life-kind.is-on { background: var(--brand-soft); border-color: var(--brand); }
.life-picker { max-height: 15em; margin: 8px 0 4px; padding: 6px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
.life-picker .child-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(96px, 5rem)), 1fr)); }
.life-picker .child-chip { padding: 6px 2px; font-size: 0.8rem; }
.life-fields { margin-top: 12px; }
.life-fields label { margin-bottom: 10px; }

.life-file { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 12px; background: var(--line-2); border-radius: var(--radius-sm); }
.life-file .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* care records */
.care-row.is-voided { opacity: 0.55; }
.care-row.is-voided strong { text-decoration: line-through; }
.care-icon { flex: none; width: 38px; text-align: center; font-size: 1.45rem; }
.care-days { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.care-days strong { font-size: 1.05rem; }
.care-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 8px; }
.care-child { display: flex; align-items: center; gap: 8px; margin: 18px 2px 6px; }
.care-class { margin: 2px 2px 0; }

/* points */
.points-pickers { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.points-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.points-chip { display: flex; flex-direction: column; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.points-chip.is-on { background: var(--brand-soft); border-color: var(--brand); }
.points-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 8px 4px 4px; background: none; border: 0; cursor: pointer; }
.points-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; font-weight: 650; }
.points-total { min-height: 38px; padding: 6px; font-size: 1rem; font-weight: 800; color: var(--ink); background: var(--line-2); border: 0; border-top: 1px solid var(--line); cursor: pointer; }
.points-flag { margin-left: 4px; }
.points-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.points-dot.is-big { width: 22px; height: 22px; margin: 0 8px; }
.points-bar { flex: none; display: flex; gap: 10px; padding: 10px 18px calc(var(--safe-bottom) + 12px); background: var(--bg); border-top: 1px solid var(--line); }
.points-give { flex: 1; min-height: 52px; font-size: 1.02rem; }
.points-amount { flex: none; font-weight: 800; color: var(--ok); }
.points-amount.is-negative { color: var(--danger); }
.points-amounts { display: flex; gap: 8px; margin-bottom: 12px; }
.points-amount-btn { flex: 1; min-height: 48px; font-size: 1.05rem; font-weight: 800; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.points-amount-btn.is-on { background: var(--brand-soft); border-color: var(--brand); }
.points-big { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 10px; }
.points-big strong { font-size: 2.4rem; line-height: 1; }
.points-big span { color: var(--muted); }
.points-card { margin-bottom: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.points-card p { margin: 0; }
.points-line.is-voided { opacity: 0.55; }
.points-line.is-voided strong { text-decoration: line-through; }

.kid-points { margin: -6px 0 14px; text-align: center; font-size: 1.5rem; font-weight: 800; }
.life-tell { margin: 6px 0 4px; }

/* calendar */
.cal-date { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 46px; min-height: 50px; padding: 4px; background: var(--brand-soft); border-radius: 12px; line-height: 1.1; }
.cal-date strong { display: block; font-size: 1.15rem; }
.cal-date small { display: block; margin: 0; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--ink-2); }
.cal-row strong { white-space: normal; }

/* six or more tabs on a phone */
@media (max-width: 620px) {
  .tabbar.is-crowded .tab { font-size: 0.62rem; letter-spacing: -0.01em; min-width: 0; }
  .tabbar.is-crowded .tab-add { width: 60px; }
  .tabbar.is-crowded .add-btn { width: 52px; height: 52px; }
}

/* choosing posts to print */
.post-card.is-picked { outline: 3px solid var(--brand); outline-offset: -3px; }
.post-card { position: relative; }
.pick-mark { position: absolute; top: 10px; right: 10px; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: var(--brand-ink); background: rgba(255, 255, 255, 0.92); border: 2px solid var(--brand); border-radius: 50%; }
.post-card.is-picked .pick-mark { background: var(--brand); }
.pick-mark .ic svg { width: 18px; height: 18px; stroke-width: 3; }

/* Translating and writing help. */
.translate { margin-top: 2px; }
.translated { margin-top: 4px; padding: 6px 10px; background: var(--line-2); border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; }
.translated-text { margin: 0 !important; white-space: pre-wrap; overflow-wrap: anywhere; }
.translated-note, .translated-by { display: block; margin-top: 3px; font-size: 0.74rem; color: var(--muted); }
.translated-by { font-style: italic; }
.writing-help { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 8px; }
.writing-help .ic svg { width: 18px; height: 18px; }
.ai-tasks { display: grid; gap: 8px; margin: 10px 0; }
.ai-result { margin-top: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.ai-result h3 { margin: 0 0 6px; font-size: 0.95rem; }
.ai-text { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.translated-note .link { font-size: inherit; }
