[hidden] { display: none !important; }
/* Fonts are served from Leerivo's own server (no Google Fonts), so no visitor data goes to a third party. */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/atkinson-400.woff") format("woff"); unicode-range: U+0000-024F, U+0259, U+1E00-1EFF, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/atkinson-700.woff") format("woff"); unicode-range: U+0000-024F, U+0259, U+1E00-1EFF, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/atkinson-400i.woff") format("woff"); unicode-range: U+0000-024F, U+0259, U+1E00-1EFF, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/bricolage-600.woff") format("woff"); unicode-range: U+0000-024F, U+0259, U+1E00-1EFF, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/bricolage-800.woff") format("woff"); unicode-range: U+0000-024F, U+0259, U+1E00-1EFF, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: "Noto Naskh Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/naskh-400.woff") format("woff"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Noto Naskh Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/naskh-700.woff") format("woff"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Noto Sans Ethiopic"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ethiopic-400.woff") format("woff"); unicode-range: U+1200-139F, U+2D80-2DDF, U+AB00-AB2F; }
@font-face { font-family: "Noto Sans Ethiopic"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/ethiopic-700.woff") format("woff"); unicode-range: U+1200-139F, U+2D80-2DDF, U+AB00-AB2F; }
/* Layout: one-screen app. Header, settings, scrollable tab row, then one view that fills the rest. Delft blue ink, Dutch orange accent. */
  :root {
    --bg: #eef2f7; --surface: #ffffff; --sunk: #e4eaf3; --ink: #14223b; --muted: #5b6a82; --line: #d7dfeb;
    --accent: #e4570f; --accent-ink: #ffffff; --delft: #1f4e9c; --me: #fde6d6;
    --again: #c62f2f; --hard: #b8700a; --good: #1d8a4c; --easy: #1f4e9c; --grade-ink: #ffffff;
    --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --body: "Atkinson Hyperlegible", "Noto Naskh Arabic", "Noto Sans Ethiopic", system-ui, -apple-system, sans-serif;
  }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
    --bg: #0e1522; --surface: #172235; --sunk: #111b2b; --ink: #e9eef7; --muted: #9aa8bf; --line: #26344c;
    --accent: #ff7a33; --accent-ink: #1a0d05; --delft: #8db3ff; --me: #3b2416;
    --again: #ff6b6b; --hard: #f0a640; --good: #4fcf86; --easy: #8db3ff; --grade-ink: #0e1522; color-scheme: dark; } }
  :root[data-theme="dark"] {
    --bg: #0e1522; --surface: #172235; --sunk: #111b2b; --ink: #e9eef7; --muted: #9aa8bf; --line: #26344c;
    --accent: #ff7a33; --accent-ink: #1a0d05; --delft: #8db3ff; --me: #3b2416;
    --again: #ff6b6b; --hard: #f0a640; --good: #4fcf86; --easy: #8db3ff; --grade-ink: #0e1522; color-scheme: dark; }

  html, body { height: 100%; }
  body { margin: 0; -webkit-text-size-adjust: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; }
  * { box-sizing: border-box; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; }
  :focus-visible { outline: 2px solid var(--delft); outline-offset: 2px; }
  [dir="rtl"] { text-align: right; line-height: 1.75; }

  .app { max-width: 720px; height: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 10px;
         padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-top: max(14px, env(safe-area-inset-top, 0px)); padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
  header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .tile { width: 38px; height: 38px; border-radius: 9px; background: var(--delft); display: grid; place-items: center; flex: none; }
  .tile { object-fit: cover; }
  h1 { font-family: var(--display); font-weight: 800; font-size: 1.3rem; margin: 0; letter-spacing: -0.01em; }
  h2 { font-family: var(--display); font-weight: 800; font-size: 1.15rem; margin: 0; text-wrap: balance; }
  .sub { color: var(--muted); font-size: .8rem; }
  .lbl { display: flex; align-items: center; gap: 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); min-width: 0; }
  select, input[type="date"], textarea, input[type="text"] { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: .95rem; max-width: 100%; text-transform: none; letter-spacing: 0; }
  textarea { width: 100%; min-height: 110px; padding: 10px 12px; border-radius: 12px; resize: vertical; line-height: 1.5; }
  .settings { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
  .settings .lbl { flex: 1 1 170px; }
  .settings select { flex: 1; min-width: 0; }
  .toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: .85rem; font-weight: 700; }
  .toggle[aria-pressed="true"] { background: var(--delft); border-color: var(--delft); color: var(--bg); }

  .tabs { display: flex; gap: 4px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; scrollbar-width: none; flex: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 1 0 auto; border: 0; background: transparent; border-radius: 9px; padding: 9px 12px; font-weight: 700; display: flex; justify-content: center; align-items: center; gap: 6px; white-space: nowrap; }
  .tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
  .count { font-size: .72rem; min-width: 20px; padding: 1px 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-variant-numeric: tabular-nums; }

  .view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
  .scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
  .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .muted { color: var(--muted); }
  .small { font-size: .85rem; }
  p { margin: 0; line-height: 1.5; }

  .primary { border: 0; border-radius: 12px; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
  .primary:disabled, .ghost:disabled { opacity: .5; cursor: default; }
  .ghost { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
  .mini { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 3px 10px; font-size: .8rem; color: var(--delft); }
  .chip { align-self: center; font-size: .8rem; color: var(--good); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; text-align: center; }
  .chip.warn { color: var(--hard); }
  .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
  .wide { width: 100%; }
  .notice { font-size: .85rem; color: var(--muted); text-align: center; }

  /* Chat */
  .scenarios { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: none; padding-bottom: 2px; }
  .scenarios::-webkit-scrollbar { display: none; }
  .scen { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: .85rem; white-space: nowrap; }
  .scen[aria-pressed="true"] { border-color: var(--accent); background: var(--me); font-weight: 700; }
  #thread { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-block: 4px; }
  .msg { max-width: 86%; padding: 11px 14px; border-radius: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
  .tutor { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
  .me { align-self: flex-end; background: var(--me); border-bottom-right-radius: 4px; }
  .who { display: block; font-family: var(--display); font-weight: 600; font-size: .75rem; color: var(--delft); margin-bottom: 2px; }
  .notes { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .92rem; }
  .typing { color: var(--muted); font-style: italic; }
  form.send { display: flex; gap: 8px; flex: none; }
  #msg { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }

  /* Letter */
  .drop { border: 2px dashed var(--line); border-radius: 14px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
  .drop img { max-height: 160px; border-radius: 8px; }
  .todo { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: start; }
  .due { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }
  .badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--sunk); color: var(--ink); }
  .badge.urgent { background: var(--again); color: var(--grade-ink); }

  /* Exam */
  .countdown { display: flex; align-items: baseline; gap: 8px; }
  .countdown b { font-family: var(--display); font-size: 2.2rem; font-variant-numeric: tabular-nums; line-height: 1; }
  .skills { display: grid; gap: 8px; }
  .skill { display: grid; grid-template-columns: 92px 1fr 64px; gap: 10px; align-items: center; font-size: .9rem; }
  .bar { height: 10px; background: var(--sunk); border-radius: 99px; overflow: hidden; position: relative; }
  .bar i { display: block; height: 100%; border-radius: 99px; background: var(--muted); }
  .bar i.ok { background: var(--good); } .bar i.mid { background: var(--hard); } .bar i.low { background: var(--again); }
  .bar::after { content: ""; position: absolute; left: 70%; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .35; }
  .skill span:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
  .tasks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .task-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
  .task-btn b { font-family: var(--display); }
  .task-btn small { color: var(--muted); }
  .options { display: grid; gap: 6px; }
  .opt { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; }
  .opt.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
  .opt.wrong { border-color: var(--again); background: color-mix(in srgb, var(--again) 14%, var(--surface)); }
  .score { font-family: var(--display); font-weight: 800; font-size: 2rem; font-variant-numeric: tabular-nums; }
  .reading { background: var(--surface); border-radius: 10px; padding: 12px; line-height: 1.55; white-space: pre-wrap; }
  .plan { margin: 0; padding-inline-start: 24px; display: grid; gap: 4px; }

  /* Flashcards */
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; }
  .stat b { display: block; font-family: var(--display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
  .stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .card { flex: 1; min-height: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
          display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
  .article { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
  .front { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 9vw, 3rem); line-height: 1.05; text-wrap: balance; overflow-wrap: anywhere; }
  .back { font-size: 1.25rem; font-weight: 700; color: var(--delft); }
  .example { font-style: italic; color: var(--muted); max-width: 40ch; border: 0; background: transparent; }
  .speak { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 6px 14px; font-size: .9rem; color: var(--delft); }
  .grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .grades button { border: 0; border-radius: 12px; padding: 10px 4px; color: var(--grade-ink); font-weight: 700; display: flex; flex-direction: column; gap: 2px; align-items: center; }
  .grades small { font-weight: 400; font-size: .72rem; opacity: .9; }
  .g-again { background: var(--again); } .g-hard { background: var(--hard); } .g-good { background: var(--good); } .g-easy { background: var(--easy); }
  .empty-title { font-family: var(--display); font-weight: 800; font-size: 1.4rem; }

  /* ABC */
  .abc { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
  .letter { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .letter b { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; }
  .letter small { color: var(--muted); font-size: .8rem; }
  .letter.sound b { color: var(--accent); }
  .letter.right { border-color: var(--good); border-width: 2px; } .letter.wrong { border-color: var(--again); border-width: 2px; }
  .seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--sunk); border-radius: 10px; padding: 3px; }
  .seg button { border: 0; background: transparent; border-radius: 8px; padding: 8px 12px; font-weight: 700; }
  .seg button[aria-pressed="true"] { background: var(--surface); }

  /* Class */
  .student { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
  .student:first-child { border-top: 0; padding-top: 0; }
  .student-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }

  /* Web app extras */
  .mic { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 0 14px; font-size: 1.1rem; }
  .mic.on { background: var(--again); border-color: var(--again); color: var(--grade-ink); }
  .install { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 8px 12px; font-size: .88rem; }
  .install button { border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; }
  footer { font-size: .75rem; color: var(--muted); text-align: center; flex: none; }
  footer a { color: inherit; }

  /* Tutor avatars */
  .av { display: inline-block; flex: none; border-radius: 50%; overflow: hidden; vertical-align: middle; }
  .av svg { width: 100%; height: 100%; display: block; }
  .av .smile, .av .flat, .av .grin, .av .mouth-open, .av .think, .av .cheeks { transition: opacity .15s; }
  .av .flat, .av .grin, .av .mouth-open, .av .think { opacity: 0; }
  .av .cheeks { opacity: .25; }
  .av .eyes { transform-box: fill-box; transform-origin: center; animation: av-blink 5.5s infinite; }
  .av .look { transition: transform .25s; }
  .av.thinking .look { transform: translate(2px, -3px); }
  .av.thinking .think { opacity: 1; }
  .av.thinking .think circle { animation: av-dot 1.2s infinite; }
  .av.thinking .think circle:nth-child(2) { animation-delay: .2s; }
  .av.thinking .think circle:nth-child(3) { animation-delay: .4s; }
  .av.thinking .smile, .av.soft .smile { opacity: 0; }
  .av.thinking .flat, .av.soft .flat { opacity: 1; }
  .av.happy .smile { opacity: 0; }
  .av.happy .grin { opacity: 1; }
  .av.happy .cheeks { opacity: .6; }
  .av.happy svg { animation: av-bounce .5s ease-out; }
  .av.talking .smile, .av.talking .flat, .av.talking .grin { opacity: 0; }
  .av.talking .mouth-open { opacity: 1; transform-box: fill-box; transform-origin: center; animation: av-talk .2s infinite alternate ease-in-out; }
  @keyframes av-blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
  @keyframes av-talk { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
  @keyframes av-dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
  @keyframes av-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-4px); } }
  @media (prefers-reduced-motion: reduce) { .av *, .av svg { animation: none !important; transition: none !important; } }
  .tutorbar { display: flex; align-items: center; gap: 10px; flex: none; }
  .tutorinfo { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
  .tutorinfo b { font-family: var(--display); font-size: 1.05rem; }
  .who { display: flex; align-items: center; gap: 6px; }

  /* Topic picker */
  .topicbtn { margin-left: auto; border: 1px solid var(--accent); background: var(--me); color: var(--ink); border-radius: 99px; padding: 7px 14px; font-weight: 700; font-size: .9rem; white-space: nowrap; }
  .sheet { gap: 16px; }
  .sheet-head { display: flex; justify-content: space-between; align-items: center; }
  .sheet-head b { font-family: var(--display); font-size: 1.1rem; }
  #topicList { display: grid; gap: 18px; }
  .topic-group h3 { margin: 0 0 8px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
  .topic-grid .scen { text-align: left; white-space: normal; border-radius: 12px; padding: 10px 12px; }
  .tasks .task-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
  @media (max-width: 420px) { .tasks { grid-template-columns: 1fr; } .skill { grid-template-columns: 78px 1fr 48px; } }
  @media (prefers-reduced-motion: no-preference) { .msg { animation: rise .18s ease-out; } @keyframes rise { from { transform: translateY(4px); opacity: .6; } } }

  /* Today: streak, week, lesson steps */
  .lessonbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--me); border-radius: 12px; padding: 8px 12px; font-size: .9rem; font-weight: 700; flex: none; }
  .streak-top { display: flex; align-items: center; gap: 12px; }
  .streak { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .streak b { font-family: var(--display); font-size: 2.2rem; line-height: 1; font-variant-numeric: tabular-nums; }
  .streak span { color: var(--muted); font-size: .9rem; }
  .flame { font-size: 2rem; }
  .flame.off { filter: grayscale(1); opacity: .45; }
  .week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
  .day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .72rem; color: var(--muted); }
  .day i { width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: .9rem; color: var(--accent-ink); }
  .day.on i { background: var(--accent); border-color: var(--accent); }
  .day.now i { border-color: var(--accent); }
  .steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
  .steps li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--sunk); }
  .steps li .tick { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface); }
  .steps li.done .tick { background: var(--good); border-color: var(--good); color: var(--grade-ink); }
  .steps li.done span:last-child { color: var(--muted); text-decoration: line-through; }
  .steps li.next { outline: 2px solid var(--accent); }
  .wide { width: 100%; }

  /* Stories: tap a word */
  .story { font-size: 1.12rem; line-height: 1.9; }
  .story .w { border: 0; background: none; padding: 0 1px; margin: 0; font: inherit; color: inherit; border-radius: 4px; cursor: pointer; border-bottom: 1px dotted var(--muted); }
  .story .w.saved { background: var(--me); border-bottom-color: var(--accent); }
  .story .w.on { background: var(--delft); color: var(--bg); }
  .wordpop { position: sticky; bottom: 0; background: var(--surface); border: 2px solid var(--delft); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
  .wordpop .base { font-weight: 700; font-size: 1.1rem; }
  .storylist { display: flex; flex-direction: column; gap: 6px; }
  .storylist button { text-align: start; display: flex; justify-content: space-between; gap: 8px; }

  /* Progress report */
  .report { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
  .report h3 { margin: 0; font-family: var(--display); font-size: 1.1rem; }
  .report dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; }
  .report dt { color: var(--muted); }
  .report dd { margin: 0; font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
  .heat { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; }
  .heat i { aspect-ratio: 1; border-radius: 3px; background: var(--sunk); border: 1px solid var(--line); }
  .heat i.on { background: var(--good); border-color: var(--good); }
  @media print {
    body * { visibility: hidden; }
    .report, .report * { visibility: visible; }
    .report { position: absolute; inset: 0 auto auto 0; width: 100%; border: 0; }
  }

  /* Course */
  .stack { display: flex; flex-direction: column; gap: 12px; }
  .units { display: flex; flex-direction: column; gap: 8px; }
  .unit { display: flex; align-items: center; gap: 12px; text-align: start; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; }
  .unit.next { border: 2px solid var(--accent); }
  .unit.done { background: var(--sunk); }
  .unit-icon { font-size: 1.5rem; width: 36px; text-align: center; flex: none; }
  .unit-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .unit-state { font-weight: 700; color: var(--good); width: 20px; text-align: center; }
  .progress { height: 10px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
  .progress i { display: block; height: 100%; background: var(--good); border-radius: 99px; }
  .panel h3 { margin: 0; font-family: var(--display); font-size: 1.05rem; }
  .wordrow, .line { display: flex; gap: 10px; align-items: flex-start; }
  .line { padding: 8px 10px; border-radius: 12px; background: var(--sunk); }
  .line.b { background: var(--me); margin-inline-start: 24px; }
  .seg button { min-width: 44px; }
  .seg4 { grid-template-columns: repeat(4, 1fr); }
  .seg4 button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
  details.mylesson > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
  details.mylesson > summary::-webkit-details-marker { display: none; }
  details.mylesson > summary::after { content: "▾"; font-size: 1.2rem; color: var(--muted); }
  details.mylesson[open] > summary::after { content: "▴"; }
  details.mylesson[open] { gap: 10px; }
  details.mylesson:not([open]) { gap: 0; }
  .seg5 { grid-template-columns: repeat(5, 1fr); }
  .seg5 button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
  .seg5 button { padding: 8px 4px; min-width: 0; }

  /* ---------- Today dashboard ---------- */
  .hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 132px; gap: 6px 8px; border-radius: 22px; padding: 18px; color: #fbfbf8;
          background: radial-gradient(circle at 85% 10%, rgba(255,201,77,.35), transparent 45%), linear-gradient(135deg, #2a5fb8 0%, #173f85 100%); box-shadow: 0 10px 28px rgba(23,63,133,.28); }
  .hero-text { min-width: 0; display: flex; flex-direction: column; gap: 8px; z-index: 1; }
  .hello { font-family: var(--display); font-weight: 700; color: #ffc94d; font-size: 1rem; }
  .hero h2 { color: #fbfbf8; font-size: 1.35rem; line-height: 1.2; }
  .hero-art { position: relative; margin: -18px -18px 0 0; align-self: start; }
  .hero-art svg { display: block; width: 150px; height: auto; }
  .hero-av { display: none; }
  .hero-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; z-index: 1; }
  .ring { position: relative; width: 72px; height: 72px; flex: none; }
  .ring svg { width: 72px; height: 72px; }
  .ring-text { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.1rem; color: #fbfbf8; }
  .hero-btn { flex: 1; border: 0; border-radius: 14px; padding: 14px 16px; background: #ffc94d; color: #14223b; font-weight: 800; font-size: 1rem; box-shadow: 0 4px 0 #d9a52c; }
  .hero-btn:disabled { background: rgba(255,255,255,.18); color: #fbfbf8; box-shadow: none; }
  .dtiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .dtile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-width: 0; }
  .dtile b { font-family: var(--display); font-size: 1.45rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
  .dtile span:last-child { font-size: .7rem; color: var(--muted); line-height: 1.25; }
  .dtile-icon { font-size: 1.3rem; }
  .dtile.t1 { border-bottom: 4px solid #ff6a1f; } .dtile.t2 { border-bottom: 4px solid #1f4e9c; } .dtile.t3 { border-bottom: 4px solid #1d8a4c; } .dtile.t4 { border-bottom: 4px solid #ffc94d; }
  .streak-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--me); border-radius: 99px; padding: 4px 10px; font-size: .8rem; }
  .streak-chip b { font-size: 1rem; }
  .flame.off { filter: grayscale(1); opacity: .45; }
  .bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; }
  .bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .72rem; color: var(--muted); }
  .bar-track { width: 100%; max-width: 30px; height: 84px; background: var(--sunk); border-radius: 10px; display: flex; align-items: flex-end; overflow: hidden; }
  .bar-track i { display: block; width: 100%; background: var(--line); border-radius: 10px; }
  .bar-col.on .bar-track i { background: linear-gradient(180deg, #ffb27f, #ff6a1f); }
  .bar-col.now span { color: var(--ink); font-weight: 700; }
  .bar-col.now .bar-track { outline: 2px solid var(--accent); outline-offset: 1px; }
  .quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .qa { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
  .qa:active { transform: scale(.97); }
  .qa-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.45rem; }
  .qa-label { font-size: .78rem; font-weight: 700; line-height: 1.2; }
  .q1 .qa-icon { background: #ffe1cf; } .q2 .qa-icon { background: #fde9b8; } .q3 .qa-icon { background: #dbe7f7; }
  .q4 .qa-icon { background: #d9eee3; } .q5 .qa-icon { background: #ebe2f5; } .q6 .qa-icon { background: #f6dfdf; }
  .empty-art { display: flex; justify-content: center; }
  .scen { display: inline-flex; align-items: center; gap: 8px; }
  .scen-icon { font-size: 1.15rem; }

  /* ---------- Call mode ---------- */
  .callbtn { border: 0; border-radius: 99px; padding: 8px 12px; background: #1d8a4c; color: #fbfbf8; font-weight: 700; font-size: .85rem; white-space: nowrap; }
  .call { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; border-radius: 22px; padding: 16px; text-align: center; color: #fbfbf8;
          background: radial-gradient(circle at 50% 28%, rgba(255,255,255,.14), transparent 55%), linear-gradient(180deg, #173f85 0%, #0f2a5c 100%); }
  .call-top { width: 100%; display: flex; justify-content: space-between; font-size: .85rem; color: #c4d4ee; }
  .call-time { font-variant-numeric: tabular-nums; }
  .call-stage { position: relative; width: 190px; height: 190px; display: grid; place-items: center; }
  .call-waves { position: absolute; inset: 0; }
  .call-waves i { position: absolute; inset: 20px; border-radius: 50%; border: 3px solid rgba(255,201,77,.0); }
  .call[data-state="speaking"] .call-waves i { border-color: rgba(255,201,77,.55); animation: wave 1.8s ease-out infinite; }
  .call[data-state="listening"] .call-waves i { border-color: rgba(79,207,134,.65); animation: wave 1.4s ease-out infinite; }
  .call-waves i:nth-child(2) { animation-delay: .5s !important; } .call-waves i:nth-child(3) { animation-delay: 1s !important; }
  @keyframes wave { from { transform: scale(.75); opacity: 1; } to { transform: scale(1.12); opacity: 0; } }
  .call-name { font-family: var(--display); font-size: 1.3rem; }
  .call-status { font-size: .95rem; color: #ffc94d; font-weight: 700; min-height: 1.4em; }
  .call[data-state="listening"] .call-status { color: #4fcf86; }
  .call-heard { min-height: 1.4em; color: #dbe6f7; font-style: italic; }
  .call-line { background: rgba(255,255,255,.1); border-radius: 16px; padding: 10px 14px; font-size: 1.05rem; line-height: 1.45; max-width: 100%; }
  .call-line:empty { display: none; }
  .call-notes { background: #fbfbf8; color: #14223b; border-radius: 14px; padding: 10px 12px; font-size: .88rem; white-space: pre-wrap; text-align: start; width: 100%; }
  .call-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; margin-top: auto; }
  .cbtn { border: 0; border-radius: 18px; padding: 10px 4px; background: rgba(255,255,255,.14); color: #fbfbf8; display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .cbtn span { font-size: 1.4rem; }
  .cbtn small { font-size: .72rem; }
  .cbtn[aria-pressed="true"] { background: #4fcf86; color: #0e1522; }
  .cbtn.end { background: #c62f2f; }
  .cbtn.end span { display: inline-block; transform: rotate(135deg); }
  @media (prefers-reduced-motion: reduce) { .call-waves i { animation: none !important; } }

  /* ---------- Pronunciation ---------- */
  .say-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 4px; }
  .mini.say.on { background: #4fcf86; color: #0e1522; border-color: #4fcf86; }
  .say-out:empty { display: none; }
  .say-out { background: var(--sunk); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
  .say-words { display: flex; flex-wrap: wrap; gap: 4px; font-weight: 700; }
  .say-words .ok { color: var(--good); }
  .say-words .miss { color: var(--hard); text-decoration: underline wavy; }
  .card .say-wrap { align-items: center; }
  .streak-chip .flame { font-size: 1rem; }
  .scroll > * { flex-shrink: 0; }

  /* ================= Modern design refresh ================= */
  body { background: radial-gradient(1200px 500px at 50% -200px, #dbe7f7 0%, transparent 70%), var(--bg); }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { background: radial-gradient(1200px 500px at 50% -200px, #1b2c4a 0%, transparent 70%), var(--bg); } }
  .app { gap: 12px; padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  .panel { border: 0; border-radius: 22px; box-shadow: 0 1px 2px rgba(20,34,59,.05), 0 6px 20px rgba(20,34,59,.06); }
  .primary { background: linear-gradient(180deg, #ff7a33, #e4570f); box-shadow: 0 3px 0 #b8440b; border-radius: 14px; }
  .primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #b8440b; }
  .ghost { border-radius: 14px; }
  header { padding: 2px 0; }
  .head-right { display: flex; align-items: center; gap: 8px; }
  .level-chip { background: var(--surface); border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: .85rem; box-shadow: 0 1px 6px rgba(20,34,59,.08); white-space: nowrap; }
  .iconbtn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface); font-size: 1.15rem; box-shadow: 0 1px 6px rgba(20,34,59,.1); }
  .iconbtn[aria-expanded="true"] { background: var(--ink); }
  .settings { background: var(--surface); border-radius: 20px; padding: 14px; box-shadow: 0 8px 28px rgba(20,34,59,.12); }
  .settings .lbl { flex: 1 1 100%; }
  /* bottom navigation */
  .tabs { order: 10; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; overflow: visible; border: 0; border-radius: 22px; padding: 6px;
          background: var(--surface); box-shadow: 0 -2px 16px rgba(20,34,59,.10); }
  footer { order: 11; }
  .tab { flex-direction: column; gap: 2px; padding: 6px 2px; border-radius: 16px; font-size: .66rem; font-weight: 700; color: var(--muted); min-width: 0; }
  .tab .ti { position: relative; font-size: 1.3rem; line-height: 1.1; }
  .tab .tl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab[aria-selected="true"] { background: var(--me); color: var(--ink); }
  .tab .count { position: absolute; top: -6px; right: -14px; font-size: .62rem; min-width: 18px; padding: 1px 5px; }
  .tab .count:empty, .tab .count[data-zero] { display: none; }
  footer { font-size: .72rem; }
  /* welcome */
  .welcome { position: fixed; inset: 0; z-index: 50; background: linear-gradient(160deg, #2a5fb8 0%, #173f85 60%, #0f2a5c 100%); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
  .welcome-card { width: 100%; max-width: 520px; max-height: 100%; overflow-y: auto; background: var(--surface); color: var(--ink); border-radius: 28px; padding: 22px 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
  .wlogo { display: flex; justify-content: center; }
  .wlogo img { border-radius: 20px; box-shadow: 0 8px 24px rgba(23,63,133,.35); }
  .wbrand { text-align: center; font-size: 2rem; }
  .wmulti { text-align: center; color: var(--muted); font-size: .85rem; line-height: 1.7; }
  .whead { display: flex; align-items: center; gap: 10px; }
  .whead h2 { flex: 1; }
  .wback { border: 0; background: var(--sunk); border-radius: 50%; width: 38px; height: 38px; font-size: 1.1rem; flex: none; }
  .wdots { display: flex; gap: 5px; }
  .wdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
  .wdots i.on { background: var(--accent); }
  .wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .wgrid.levels { grid-template-columns: repeat(5, 1fr); }
  .wlist { display: flex; flex-direction: column; gap: 10px; }
  .wopt { border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px; font-weight: 700; text-align: start; font-size: 1rem; }
  .wopt.sel { border-color: var(--accent); background: var(--me); }
  .wopt.main { border-color: var(--accent); }
  .wopt.big { text-align: center; font-size: 1.2rem; font-family: var(--display); padding: 18px 4px; }
  .wopt.ghosty { border-style: dashed; color: var(--muted); font-weight: 400; }
  .wopt:active, .wtarget:active { transform: scale(.98); }
  .wtargets { display: flex; flex-direction: column; gap: 10px; }
  .wtarget { display: flex; align-items: center; gap: 14px; border: 2px solid var(--line); background: var(--surface); border-radius: 18px; padding: 10px 14px; text-align: start; }
  .wtarget.sel { border-color: var(--accent); background: var(--me); }
  .wtarget span { display: flex; flex-direction: column; }
  .wtarget b { font-size: 1.1rem; }
  .wprog { height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
  .wprog i { display: block; height: 100%; background: linear-gradient(90deg, #ffc94d, #ff6a1f); border-radius: 99px; transition: width .3s; }
  .wq { font-family: var(--display); font-size: 1.4rem; font-weight: 700; line-height: 1.3; }
  .wresult { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 10px 0; }
  .wresult h2 { font-size: 1.6rem; }
  .founder { flex: 1 1 100%; margin: 4px 0 0; line-height: 1.6; } .founder a { color: inherit; }

/* Leerivo Plus prices on Today */
.planrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.planbox { border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: center; }
.planbox.best { border: 2px solid var(--accent); }
.planbox .price { font-size: 1.25rem; font-weight: 800; color: var(--delft); font-variant-numeric: tabular-nums; }
a.planbuy { display: block; text-align: center; text-decoration: none; margin: 6px 0; }
@media (max-width: 360px) { .planrow { grid-template-columns: 1fr; } }
.orgplans { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.orgplans h3 { margin: 0 0 4px; }
.orgseats { gap: 10px; align-items: center; margin: 8px 0; font-weight: 700; }
.orgseats input { width: 90px; font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
button.planbox { font: inherit; color: var(--ink); background: var(--surface); cursor: pointer; }
.welcome-note { background: var(--surface); border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.reflink { width: 100%; font: inherit; font-size: .9rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); margin: 6px 0; }
.refbtns { gap: 8px; flex-wrap: wrap; }

.panel.pathivo { border-left: 5px solid var(--delft); }

.risk { background: #fdecea; border: 2px solid #b3261e; color: #5c1410; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 4px; }
.risk p { margin: 0; }
.quote { margin: 4px 0 0; font-size: 13px; display: grid; gap: 2px; border-inline-start: 3px solid var(--line); padding-inline-start: 8px; }
.quote q { text-align: left; }
.quote q { font-style: italic; color: var(--ink); quotes: "„" "”"; }

.panel.consent { border: 2px solid var(--delft); }
.panel.consent p { margin: 6px 0; }

.msg.report { border: 2px solid var(--delft); }
.msg.report .skill { margin: 6px 0; }
ul.fixes { margin: 4px 0 8px; padding-inline-start: 18px; display: grid; gap: 6px; }
.panel.mistakes { border-left: 5px solid var(--accent); }
.panel.mistakes .wrongline { font-size: 1.05rem; }
.panel.mistakes input { flex: 1; min-width: 0; }
.panel.mistakes .ok { color: #1d8a4c; font-weight: 700; }
.memory { display: grid; gap: 6px; margin-top: 8px; }
ul.memlist { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
ul.memlist li { display: flex; gap: 8px; align-items: center; justify-content: space-between; }

.panel.rate { border-left: 5px solid #f2b705; }
.stars { display: flex; gap: 4px; margin: 6px 0 10px; }
.star { font-size: 2rem; line-height: 1; background: none; border: 0; padding: 4px 6px; color: var(--muted); cursor: pointer; min-width: 44px; min-height: 44px; }
.star.on { color: #f2b705; }
.panel.rate textarea { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.flag { font-size: .8rem; padding: 4px 10px; min-height: 32px; opacity: .8; }
.flagdone { display: inline-block; padding: 4px 0; }
.adminnote { margin: 0 0 10px; padding: 10px 14px; border-radius: 14px; background: #fff4d6; color: #5a3d00; border: 1px solid #f2c94c; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .adminnote { background: #3a2e10; color: #ffe2a0; border-color: #6b5320; } }
:root[data-theme="dark"] .adminnote { background: #3a2e10; color: #ffe2a0; border-color: #6b5320; }
