/* Homework Buddy: calm teal for parents, warm yellow for child mode. Phone-first. */
:root {
  --bg: #F3F6F5; --card: #FFFFFF; --ink: #14302B; --muted: #4F635E; --line: #E6ECEA; --line-2: #D5DFDC;
  --teal: #0E7C6B; --teal-dark: #0A5C50; --teal-soft: #DDF0EB;
  --yellow: #F4B13E; --yellow-dark: #D99418; --yellow-soft: #FDF0D2; --yellow-ink: #6B4700;
  --red-ink: #9A3412; --red-soft: #FDE7DA; --red-line: #F6C9B0;
  --kid-bg: #FFF4DC; --kid-line: #F2DDAE; --kid-ink: #6B5A33;
  --good: #0A5C50; --good-soft: #DDF0EB; --bad: #B4371F; --bad-soft: #FDE7DA;
  --radius: 22px;
  --font: Mukta, 'Noto Sans HK', system-ui, sans-serif;
  --display: 'Baloo 2', Mukta, system-ui, sans-serif;
  --zh: 'Noto Sans HK', 'PingFang HK', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--font); min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
body.kid { background: var(--kid-bg); }
body.dark { background: #0F1715; color: #FFFFFF; }
:lang(ur), [lang=ur] { font-family: 'Noto Naskh Arabic', var(--font); }
[dir=rtl] .flip { transform: scaleX(-1); }
[lang|=zh] { font-family: var(--zh); }
h1, h2, h3, p { margin: 0; }
h1:focus { outline: none; }
a { color: var(--teal); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: var(--ink); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- layout ---- */
.screen { max-width: 560px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 16px 32px; display: flex; flex-direction: column; gap: 16px; min-height: 100dvh; }
body.has-nav .screen { padding-bottom: 112px; }
.screen.has-cta { padding-bottom: 120px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 4px; }
.grow { flex-grow: 1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 12px; }
.row-center { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.center { text-align: center; }
.pad-top { height: 24px; }

/* ---- type ---- */
.h-xl { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.1; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { font-size: 17px; line-height: 1.7; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--teal); text-transform: uppercase; }
.card-title { font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.25; display: flex; align-items: center; gap: 8px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec-head h2, .sec-h { font-family: var(--display); font-weight: 700; font-size: 19px; }
.sec-head a { font-weight: 600; font-size: 15px; padding: 10px 0; }
.sec-h.caps { font-family: var(--font); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.count { font-size: 14px; font-weight: 700; background: var(--ink); color: #fff; min-width: 24px; height: 24px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; margin-inline-end: auto; }
.page-title { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.3; }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }
.status { min-height: 1.4em; color: var(--muted); }
.status.bad { color: var(--bad); }
.banner { background: var(--yellow-soft); color: var(--yellow-ink); border-radius: 14px; padding: 10px 14px; font-size: 15px; }
.banner.warn { background: #3A2A0C; color: #FCD58A; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 16px; border-radius: 14px; border: none; font-weight: 700; font-size: 16px; text-decoration: none; text-align: center; line-height: 1.2; background: var(--card); color: var(--ink); }
.btn.big { min-height: 58px; border-radius: 18px; font-family: var(--display); font-size: 20px; font-weight: 700; padding: 0 18px; }
.btn.sm { min-height: 44px; padding: 0 14px; border-radius: 12px; font-size: 15px; }
.btn.full { width: 100%; }
.btn.primary { background: var(--teal); color: #fff; }
.btn.accent { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: var(--card); border: 1.5px solid var(--line-2); color: var(--ink); }
.btn.outline { background: var(--card); border: 2px solid var(--teal); color: var(--teal); }
.btn.soft { background: var(--teal-soft); color: var(--teal-dark); }
.btn.soft-yellow { background: var(--yellow-soft); color: var(--yellow-ink); align-self: flex-start; }
.btn.text { background: transparent; color: var(--teal); font-weight: 600; }
.btn.danger-ghost { background: transparent; color: var(--bad); }
.btn.kid-ghost { background: var(--kid-line); color: var(--kid-ink); }
.btn.kid-outline { background: #fff; border: 2px solid #E3C98C; }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.iconbtn { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; border: none; background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.iconbtn.soft { border-radius: 14px; background: var(--teal-soft); color: var(--teal); }
.iconbtn.dark { background: #23302D; color: #fff; }

/* ---- top bars ---- */
.topbar { display: flex; align-items: center; gap: 10px; }
.tb-title { flex-grow: 1; min-width: 0; }
.tb-title h1 { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.15; overflow-wrap: anywhere; }
.tb-title p { font-size: 14px; color: var(--muted); }
.tb-space { width: 48px; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pill-stars { display: inline-flex; align-items: center; gap: 4px; background: #fff; padding: 6px 12px; border-radius: 20px; font-family: var(--display); font-weight: 700; font-size: 17px; color: #8A5A00; flex-shrink: 0; }

/* ---- cards and rows ---- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; }
.list-card { padding: 4px 16px; }
.link-card, a.card.item-main { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex-grow: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.item:last-child { border-bottom: 0; }
.item-main { display: flex; align-items: center; gap: 12px; flex-grow: 1; min-width: 0; text-decoration: none; color: inherit; min-height: 44px; }
.item-text { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.item-title { font-weight: 600; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.item-sub { font-size: 14px; color: var(--muted); }
.ic { width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.tone-red { background: var(--red-soft); color: var(--red-ink); }
.tone-teal { background: var(--teal-soft); color: var(--teal); }
.tone-yellow { background: var(--yellow-soft); color: #8A5A00; }
.tone-grey { background: var(--line); color: var(--muted); }
.zh-ic { font-weight: 700; font-size: 20px; }
.pill { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 10px; white-space: nowrap; background: var(--line); color: var(--muted); align-self: flex-start; }
.pill.urgent { background: var(--red-soft); color: var(--red-ink); }
.pill.soon { background: var(--yellow-soft); color: #8A5A00; }
.checkbtn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #9FB3AE; background: #fff; color: #9FB3AE; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.checkbtn:hover { border-color: var(--teal); color: var(--teal); }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > div { height: 100%; background: var(--teal); border-radius: 4px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--line-2); background: var(--card); font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.add { width: 44px; padding: 0; border-style: dashed; color: var(--muted); background: transparent; }
.chip.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.chip.sm.on { background: var(--teal); border-color: var(--teal); }

.scan-card { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: var(--radius); background: var(--teal); color: #fff; text-decoration: none; }
.scan-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--yellow); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.scan-title { display: block; font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.2; }
.scan-sub { display: block; font-size: 14px; color: #CFEDE6; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; font-size: 17px; }
.word-chips span { padding: 4px 10px; border-radius: 10px; background: var(--teal-soft); }
.word-chips .hard { background: var(--red-soft); }
.word-chips .more { background: var(--bg); color: var(--muted); }
.card.action.urgent { box-shadow: inset 0 0 0 2px var(--red-line); }
.card.action { display: flex; flex-direction: column; gap: 12px; }
.card.action.is-done .action-text { text-decoration: line-through; color: var(--muted); }
.action-text { font-size: 17px; font-weight: 600; line-height: 1.6; }
.hints { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 8px; }
.original { font-size: 16px; line-height: 1.8; background: var(--bg); border-radius: 12px; padding: 10px 14px; text-align: left; }

/* ---- bottom call-to-action and tab bar ---- */
.cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 12px 16px max(18px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.cta > * { width: 100%; max-width: 528px; margin: 0 auto; }
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(76px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.tab-ic { width: 56px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; }
.tab.on { color: var(--teal); font-weight: 700; }
.tab.on .tab-ic { background: var(--teal-soft); }
.tab-scan { justify-self: center; width: 64px; height: 64px; margin-top: -30px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(20, 48, 43, .22); border: 4px solid var(--bg); }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; font-weight: 600; }
.field input, .field textarea { min-height: 50px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: #fff; font-weight: 400; width: 100%; }
.field textarea { font-family: var(--zh); resize: vertical; }
.field legend { margin-bottom: 6px; }
.level-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.level { min-height: 50px; border-radius: 14px; border: 1.5px solid var(--line-2); background: #fff; font-weight: 700; font-size: 17px; }
.level.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.search { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px; border-radius: 16px; background: #fff; border: 1.5px solid var(--line-2); color: var(--muted); }
.search input { flex-grow: 1; border: none; outline: none; background: transparent; font-size: 16px; min-width: 0; }
code.link { display: block; word-break: break-all; font-size: 14px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }

/* ---- welcome ---- */
.welcome { gap: 24px; padding-top: 40px; }
.welcome h1 { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.15; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo { width: 56px; height: 56px; border-radius: 16px; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 30px; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.1; }
.brand-zh { color: var(--muted); font-size: 15px; }
.multi { margin-top: 6px; }
.lang-opt { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--line-2); border-radius: 18px; padding: 8px; }
.lang-opt.on { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.lang-pick { flex-grow: 1; display: flex; flex-direction: column; align-items: flex-start; background: none; border: none; padding: 6px 10px; text-align: start; min-height: 48px; justify-content: center; }
.lang-native { font-size: 23px; font-weight: 700; line-height: 1.3; }
.lang-en { font-size: 14px; color: var(--muted); }
.lang-btn { min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line-2); background: #fff; font-size: 19px; font-weight: 700; }
.lang-btn.on { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ---- scan (dark) ---- */
.scan .seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; background: #1B2623; border-radius: 16px; padding: 4px; }
.scan .seg button { min-height: 44px; border: none; border-radius: 12px; background: transparent; color: #C9D4D1; font-weight: 600; font-size: 14px; line-height: 1.1; padding: 2px; }
.scan .seg button.on { background: #fff; color: #0F1715; font-weight: 700; }
.viewfinder { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 52dvh; border-radius: 24px; border: none; background: #1B2623; display: flex; align-items: center; justify-content: center; }
.vf-page { width: 58%; height: 76%; background: #ECEFEA; border-radius: 4px; transform: rotate(-3deg); display: flex; flex-direction: column; gap: 12px; padding: 12% 9%; }
.vf-page i { display: block; height: 7px; background: #BAC3C0; border-radius: 2px; }
.vf-page i:first-child { height: 12px; width: 55%; background: #9AA6A2; }
.vf-page i:nth-child(3n) { width: 75%; }
.corner { position: absolute; width: 34px; height: 34px; border: 0 solid var(--yellow); }
.corner.tl { top: 9%; left: 14%; border-top-width: 5px; border-left-width: 5px; border-radius: 6px 0 0 0; }
.corner.tr { top: 9%; right: 14%; border-top-width: 5px; border-right-width: 5px; border-radius: 0 6px 0 0; }
.corner.bl { bottom: 9%; left: 14%; border-bottom-width: 5px; border-left-width: 5px; border-radius: 0 0 0 6px; }
.corner.br { bottom: 9%; right: 14%; border-bottom-width: 5px; border-right-width: 5px; border-radius: 0 0 6px 0; }
.tip { text-align: center; font-size: 14px; color: #A9B7B3; }
.shutter-row { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; }
.round-btn { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: none; background: transparent; color: #C9D4D1; font-size: 13px; }
.round-btn svg { width: 52px; height: 52px; padding: 14px; border-radius: 16px; background: #23302D; color: #fff; }
.round-btn.ghosted { visibility: hidden; }
.shutter { width: 84px; height: 84px; border-radius: 50%; border: 5px solid #fff; background: transparent; padding: 5px; display: flex; }
.shutter span { flex-grow: 1; border-radius: 50%; background: #fff; }
.thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.thumb { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: #1B2623; aspect-ratio: 3 / 4; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb figcaption { position: absolute; left: 8px; bottom: 8px; background: rgba(15, 23, 21, .8); padding: 2px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.thumb-x { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(15, 23, 21, .85); color: #fff; display: flex; align-items: center; justify-content: center; }
.blur-tag { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.thumb.add { border: 2px dashed #3A4A46; color: #C9D4D1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 600; }
.type-instead summary { color: #A9B7B3; font-size: 15px; cursor: pointer; padding: 8px 0; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.type-instead textarea { width: 100%; min-height: 110px; border-radius: 14px; border: none; padding: 12px; margin-top: 4px; font-family: var(--zh); }
.working { position: fixed; inset: 0; z-index: 20; background: rgba(15, 23, 21, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: #fff; }
.working .muted { color: #A9B7B3; }
.working-msg { font-family: var(--display); font-size: 22px; font-weight: 700; }
.working .btn.ghost { background: transparent; color: #fff; border-color: #3A4A46; margin-top: 12px; }
.spinner { width: 56px; height: 56px; border-radius: 50%; border: 5px solid rgba(244, 177, 62, .25); border-top-color: var(--yellow); animation: spin 1s linear infinite; }
.center-spin { margin: 40vh auto 0; border-color: var(--line); border-top-color: var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
body.dark .status.bad { color: #FCA48A; }

/* ---- Jyutping over characters ---- */
.ruby { display: inline-flex; flex-wrap: wrap; gap: 4px 2px; direction: ltr; }
.ruby .c { display: inline-flex; flex-direction: column; align-items: center; border-radius: 10px; padding: 2px 1px; transition: background .12s; }
.ruby .jp { font-family: Mukta, sans-serif; font-size: 12px; font-weight: 600; color: var(--teal); line-height: 1.3; white-space: nowrap; }
.ruby .ch { font-size: 24px; line-height: 1.25; }
.ruby.mid .ch { font-size: 30px; }
.ruby.big { justify-content: center; }
.ruby.big .c { min-width: 42px; }
.ruby.big .jp { font-size: 13px; }
.ruby.big .ch { font-size: 34px; font-weight: 500; }
.ruby .c.now { background: #FDE7A8; }
.no-jp .jp { visibility: hidden; }

/* ---- word cards ---- */
.word-card { background: #fff; border-radius: 18px; padding: 10px 10px 10px 12px; display: flex; align-items: center; gap: 12px; }
.word-body { display: flex; flex-direction: column; min-width: 0; }
.jp-line { font-size: 13px; font-weight: 600; color: var(--teal); line-height: 1.2; }
.word-zh { font-size: 26px; font-weight: 500; line-height: 1.25; }
.word-zh.sm { font-size: 20px; }
.study-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.study-row:last-child { border-bottom: 0; }
.num { color: var(--muted); font-weight: 600; min-width: 1.4em; }

/* ---- child mode ---- */
.kid-screen { gap: 14px; }
.kid-screen > #k { display: flex; flex-direction: column; gap: 14px; flex-grow: 1; }
.kid-top { display: flex; align-items: center; gap: 12px; }
.kid-prog { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kid-label { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.1; }
.kid-sub { font-size: 14px; color: var(--kid-ink); }
.kid-h { font-family: var(--display); font-weight: 800; font-size: 24px; text-align: center; }
.segs { display: grid; gap: 4px; }
.segs span { height: 8px; border-radius: 4px; background: var(--kid-line); }
.segs span.done { background: var(--teal); }
.segs span.now { background: var(--yellow); }
.kid .bar { background: var(--kid-line); }
.kid-card { background: #fff; border-radius: 26px; padding: 20px 16px 16px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 2px 0 var(--kid-line); }
.read-line { text-align: center; }
.meaning-block { border-top: 1px dashed #E3D3AF; padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.meaning-block .eyebrow { color: var(--kid-ink); }
.hint-card { background: #fff; border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; border: 2px dashed var(--yellow); }
.listen-zone { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 12px 0; }
.listen-ball { width: 200px; height: 200px; border-radius: 50%; border: none; background: var(--yellow); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 10px 0 var(--yellow-dark), 0 0 0 14px #FDE7A8; font-family: var(--display); font-weight: 800; font-size: 22px; }
.listen-ball:active { transform: translateY(4px); box-shadow: 0 6px 0 var(--yellow-dark), 0 0 0 14px #FDE7A8; }
.listen-ball.sm { width: 132px; height: 132px; box-shadow: 0 8px 0 var(--yellow-dark), 0 0 0 10px #FDE7A8; }
.quiz-top { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 8px; }
.option { min-height: 72px; border-radius: 20px; border: 2px solid #E3C98C; background: #fff; font-size: 32px; font-weight: 500; position: relative; display: flex; align-items: center; justify-content: center; }
.option.right { border: 3px solid var(--teal); background: var(--teal-soft); }
.option.wrong { border: 3px solid var(--bad); background: var(--bad-soft); }
.option.dim { opacity: .5; }
.option:disabled { cursor: default; color: var(--ink); }
.opt-mark { position: absolute; inset-inline-end: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; }
.feedback { background: #fff; border-radius: 20px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.feedback strong { font-family: var(--display); font-size: 20px; }
.feedback.good strong { color: var(--good); }
.feedback.bad strong { color: var(--bad); font-size: 17px; }
.celebrate { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 48px; text-align: center; }
.celebrate h1 { font-family: var(--display); font-weight: 800; font-size: 32px; }
.write-card { background: #fff; border-radius: 22px; padding: 16px; display: flex; align-items: center; gap: 16px; }
.write-card > div:last-child { display: flex; flex-direction: column; }
.tzg-row { display: flex; gap: 4px; flex-shrink: 0; }
.tzg { width: 46px; height: 46px; border: 2px solid #C2410C; position: relative; background:
  linear-gradient(#F0A47E, #F0A47E) center / 100% 1.5px no-repeat, linear-gradient(#F0A47E, #F0A47E) center / 1.5px 100% no-repeat; }
.photo-drop { border: 2px dashed #E3C98C; border-radius: 18px; min-height: 150px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px; cursor: pointer; }
.photo-drop > span { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--kid-ink); }
.photo-drop img { max-width: 100%; max-height: 280px; border-radius: 12px; }
.kid-card.self summary { font-weight: 700; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.tick-row { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.tick-row input { width: 22px; height: 22px; accent-color: var(--bad); }
.result { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 12px; border-radius: 14px; align-items: center; }
.result.ok { background: var(--good-soft); }
.result.no { background: var(--bad-soft); }
.result .mark { grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.result.ok .mark { background: var(--teal); }
.result.no .mark { background: var(--bad); }
.kid .banner { background: #fff; }

/* ---- ask about this page ---- */
.sug { display: flex; flex-wrap: wrap; gap: 8px; }
.sug-chip { min-height: 44px; padding: 8px 14px; border-radius: 22px; border: 1.5px solid var(--teal); background: #fff; color: var(--teal-dark); font-weight: 600; font-size: 15px; line-height: 1.3; text-align: start; }
.ask-screen { padding-bottom: 110px; }
.msgs { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 18px; line-height: 1.6; display: flex; flex-direction: column; gap: 10px; }
.msg.user { align-self: flex-end; background: var(--teal); color: #fff; border-end-end-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.ai { align-self: flex-start; background: #fff; border-end-start-radius: 6px; }
.msg.intro { background: var(--teal-soft); color: var(--teal-dark); }
.msg.thinking { flex-direction: row; align-items: center; color: var(--muted); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .6; } }
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 10px; }
.badge.hint { background: var(--yellow-soft); color: var(--yellow-ink); }
.badge.warn { background: var(--red-soft); color: var(--red-ink); }
.quote { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; background: var(--bg); border-radius: 12px; padding: 8px 8px 8px 12px; }
.quote .eyebrow { grid-column: 1; font-size: 12px; }
.quote .q-zh { grid-column: 1; font-size: 17px; line-height: 1.5; text-align: left; }
.quote .iconbtn { grid-column: 2; grid-row: 1 / span 2; }
.iconbtn.sm { width: 40px; height: 40px; }
.teacher { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.t-zh { font-size: 16px; line-height: 1.7; text-align: left; }
.teacher summary { font-size: 14px; font-weight: 600; color: var(--teal); cursor: pointer; min-height: 36px; display: flex; align-items: center; }
.linkish { align-self: flex-start; background: none; border: none; color: var(--teal); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; padding: 6px 0; min-height: 36px; }
.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px max(14px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.composer textarea { flex-grow: 1; min-height: 48px; max-height: 120px; resize: none; border-radius: 24px; border: 1.5px solid var(--line-2); padding: 11px 16px; background: #fff; line-height: 1.4; }
.iconbtn.send { background: var(--teal); color: #fff; }
.iconbtn.send:disabled { opacity: .5; }
#mic.on { background: var(--bad); color: #fff; }

/* consent */
.consent-pt { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; }
.consent-pt svg { flex: none; margin-top: 2px; color: var(--teal); }
.consent-box { border-bottom: none; align-items: flex-start; padding: 4px 0; line-height: 1.5; }
.consent-box input { flex: none; margin-top: 2px; accent-color: var(--teal); }
