﻿/* Shared palette and system fonts: no external dependencies. */
:root{--ink:#23434b;--muted:#607478;--green:#087f83;--line:#dce9e6;--paper:#fffaf3}

*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:24px}
body{margin:0;background:var(--paper);color:var(--ink);font-family:"Segoe UI",Arial,sans-serif;font-size:15px;line-height:1.6}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;cursor:pointer}
a,button{-webkit-tap-highlight-color:transparent}
a:focus-visible,button:focus-visible{outline:3px solid #b98426;outline-offset:5px}
h1,h2,h3,p{margin:0}
h1,h2,h3{line-height:1.25;letter-spacing:-.6px}
h2{font-size:22px}
.skip{position:fixed;top:-80px;left:16px;background:white;padding:12px;z-index:5}
.skip:focus{top:16px}

/* Desktop sidebar and main canvas. */
.sidebar{position:fixed;inset:0 auto 0 0;width:240px;background:#fffef9;border-right:1px solid var(--line);padding:36px 24px;display:flex;flex-direction:column;gap:32px;overflow-y:auto}
.brand{display:flex;align-items:center;gap:10px;font-size:23px;font-weight:750;letter-spacing:-1px}
.brand-mark{display:grid;place-items:center;width:42px;height:44px;background:var(--green);color:white;border-radius:14px;font-size:31px;flex-shrink:0}
.accent{color:var(--green)}
.brand small{display:block;font-size:8px;letter-spacing:2px;color:var(--muted)}
.profile{display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--line);padding:0 4px 24px}
.avatar{display:grid;place-items:center;background:#f2dfba;color:#856227;border-radius:50%;width:42px;height:42px;font-weight:700}
.profile strong{font-size:14px}
.profile small{display:block;color:var(--muted);font-size:12px}
nav{display:grid;gap:8px}
.nav-link{display:flex;align-items:center;gap:14px;padding:12px 15px;border-radius:12px;color:var(--muted);font-weight:600;font-size:14px}
.nav-link>span{font-size:23px;line-height:1;width:24px;text-align:center}
.nav-link.active{background:#eaf2e8;color:var(--green)}
.nav-link:hover{background:#f0f4eb}
.sidebar-note{margin-top:auto;padding:20px 16px;background:#f7f4e8;border-radius:16px;font-size:13px}
.sidebar-note>span{display:block;color:#b48b38;font-size:26px;margin-bottom:8px}
.sidebar-note p{margin-top:8px;color:var(--muted);font-size:12px}
.developer{border:0;background:none;text-align:left;color:var(--muted);font-size:11px;padding:0 10px}
main{margin-left:240px;max-width:1440px;padding:28px 48px 0}
.topbar{display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:12px;padding-bottom:18px}
.muted{color:#8a9386;margin-left:12px}
.pill{background:white;border:1px solid var(--line);padding:6px 13px;border-radius:30px;color:var(--ink);font-weight:600}
.welcome{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:18px}
.eyebrow{font-size:10px;letter-spacing:1.7px;font-weight:750;color:var(--green);margin-bottom:10px}
h1{font-size:32px}
.sun{color:#bf913a;font-size:31px;margin-left:8px}
.welcome p:last-child{color:var(--muted);margin-top:10px}
.sample{font-size:10px;color:var(--muted);border:1px solid var(--line);padding:4px 9px;border-radius:20px;white-space:nowrap}

/* Hero and three primary study choices. */
.hero{display:flex;align-items:center;justify-content:space-between;gap:20px;background:#eaf1df;border:1px solid #e2e9d5;border-radius:18px;padding:10px 24px;margin-top:22px;overflow:hidden}
.hero .eyebrow{font-size:9px;color:#557958}
.hero h2{font-size:19px;margin:0 0 5px}
.hero-copy>p:not(.eyebrow){font-size:13px;color:#63725c;line-height:1.6}
.button{display:inline-flex;align-items:center;justify-content:center;gap:24px;padding:11px 19px;border:0;border-radius:10px;font-weight:650;font-size:13px;color:white;background:var(--green)}
.button:hover{background:#1b6053}
.hero .button{margin-top:22px}
.companion{width:92px;flex-shrink:0;display:flex;align-items:center}
.speech{background:#fffef8;border-radius:14px 14px 3px 14px;padding:8px 15px;font-size:12px;transform:rotate(-4deg);box-shadow:0 3px 0 #dce5cd}
.companion svg{display:block;width:92px;height:76px}
.companion small{font-size:10px;color:#5d7058}
.section-heading{display:flex;justify-content:space-between;align-items:center;margin:20px 0 16px}
.section-heading p{color:var(--muted);font-size:13px;margin-top:6px}
.quiet{font-size:9px;letter-spacing:1.4px;color:#75816e}
.choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.choice{display:flex;flex-direction:column;align-items:flex-start;text-align:left;border-radius:20px;border:1px solid;padding:22px;transition:transform .18s,box-shadow .18s;min-height:230px}
.choice:hover{transform:translateY(-4px);box-shadow:0 10px 24px #263f3710}
.today{background:#edf5ef;border-color:#dce8de}
.tomorrow{background:#fdf4df;border-color:#eee3c7}
.exam{background:#efedf8;border-color:#e3dff0}
.icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#d5e8da;color:#276950;font-size:25px;margin-bottom:14px}
.tomorrow .icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#d5e8da;color:#276950;font-size:25px;margin-bottom:14px}
.exam .icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#d5e8da;color:#276950;font-size:25px;margin-bottom:14px}
.kicker{font-size:8px;letter-spacing:1.2px;font-weight:700;color:#65776a;margin-bottom:6px}
.tomorrow .kicker{color:#8b753f}
.exam .kicker{color:#7b6b94}
.choice strong{font-size:21px;letter-spacing:-.6px;line-height:1.3}
.description{font-size:14px;color:#58685d;line-height:1.6;margin:10px 0 18px}
.action{border-top:1px solid #253f3712;padding-top:13px;width:100%;font-size:12px;font-weight:700;margin-top:auto;display:flex;justify-content:space-between}
.action span{font-size:18px}

/* Sample content is clearly labeled rather than presented as saved data. */
.lower-grid{display:grid;grid-template-columns:1.5fr 1fr;gap:22px;margin-top:18px}
.panel{background:white;border:1px solid var(--line);border-radius:20px;padding:20px;min-width:0}
.panel-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}
.panel-heading h2{font-size:18px}
.panel .sample{font-size:9px}
.book-row{display:flex;gap:22px;align-items:center}
.book-cover{width:74px;min-width:74px;height:96px;background:#e3b467;border-radius:3px 9px 9px 3px;padding:8px;border-left:4px solid #cb9a4f;box-shadow:3px 3px 0 #f3ecd9;display:flex;flex-direction:column;color:#513d22}
.book-cover small{font-size:5px;letter-spacing:.3px}
.book-cover strong{font-size:9px}
.book-cover>span{font-family:Georgia,serif;font-size:30px;line-height:1.5;text-align:center}
.book-info .eyebrow{font-size:8px;margin-bottom:8px}
.book-info h3{font-size:20px}
.book-info>p:not(.eyebrow){font-size:12px;color:var(--muted);margin:8px 0 12px}
.text-button{padding:0;background:none;border:0;font-weight:700;color:var(--green);font-size:12px}
.streak{display:flex;gap:13px;align-items:center}
.streak>span{font-size:25px;color:#ae772c;background:#fff1d9;border-radius:10px;width:38px;text-align:center}
.streak strong{font-size:22px;line-height:1}
.streak p{font-size:11px;color:var(--muted)}
.week{display:flex;justify-content:space-between;gap:6px;margin-top:12px}
.week>span{text-align:center;font-size:9px;color:var(--muted)}
.week b{display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;width:27px;height:27px;font-size:13px;margin-bottom:5px;font-weight:500}
.week .done{background:var(--green);border-color:var(--green);color:white}
.progress-note{font-size:11px;color:var(--muted);margin-top:10px}
footer{display:flex;justify-content:space-between;gap:16px;padding:28px 0 22px;color:#788472;font-size:10px}

/* Native dialog supplies focus containment and Escape-to-close. */
dialog{border:1px solid var(--line);border-radius:24px;padding:36px;width:min(460px,calc(100% - 32px));color:var(--ink);box-shadow:0 20px 80px #163d3633}
dialog::backdrop{background:#18372c66}
dialog h2{padding-right:20px}
dialog p:not(.eyebrow){font-size:14px;color:var(--muted);margin:16px 0}
dialog .button{margin-top:12px}
.close{position:absolute;top:10px;right:14px;border:0;background:none;font-size:28px;padding:2px 8px}
#developer-details{font-size:12px}
#developer-details ul{padding-left:20px}

/* Tablet and phone layouts. The three action cards remain the primary content. */
@media(max-width:1200px){
  .sidebar{width:210px;padding:28px 18px}

  main{margin-left:210px;padding:24px 28px 0}

  .choice{padding:20px}
.choice strong{font-size:20px}

  .book-row{gap:15px}
.panel-heading{flex-wrap:wrap}

}

@media(max-width:960px){
  .sidebar{position:static;width:auto;padding:18px 24px;gap:18px;border-right:0;border-bottom:1px solid var(--line)}

  .profile,.sidebar-note{display:none}

  nav{display:flex;gap:8px;flex-wrap:wrap}

  .nav-link{padding:8px 12px;font-size:12px}
.nav-link>span{font-size:19px;width:18px}

  .developer{position:absolute;right:24px;top:31px;font-size:10px}

  main{margin-left:0;padding:24px}

  .choices{gap:12px}
.choice{padding:18px}
.choice strong{font-size:18px}

  .lower-grid{grid-template-columns:1.2fr 1fr}

}

@media(max-width:640px){
  .sidebar{padding:16px;gap:14px}
.brand{font-size:19px}

  .brand-mark{width:35px;height:36px;font-size:26px}
.brand small{font-size:7px}

  .developer{right:12px;top:27px;font-size:9px}

  nav{display:grid;grid-template-columns:repeat(4,1fr);gap:3px}

  .nav-link{flex-direction:column;gap:3px;padding:8px 3px;font-size:10px;white-space:nowrap}

  main{padding:20px 16px 0}
.welcome .sample{display:none}

  h1{font-size:26px}
.welcome p:last-child{font-size:13px}
.quiet{display:none}

  .choices{grid-template-columns:1fr;gap:12px}

  .choice{min-height:0;padding:20px 20px 20px 78px;position:relative}

  .icon{position:absolute;left:18px;top:20px;width:40px;height:40px}

  .choice strong{font-size:21px}
.description{margin-bottom:14px}

  .hero{padding:12px 16px;gap:12px}
.hero h2{font-size:17px}

  .companion,.companion svg{width:70px}
.companion svg{height:58px}

  .lower-grid{grid-template-columns:1fr;gap:14px}

  .book-info h3{font-size:18px}

  footer{font-size:9px;flex-direction:column;gap:4px}

}

@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}
.choice{transition:none}
.choice:hover{transform:none}
}

/* Learning styles are scoped to the new flow; the home design stays unchanged. */
[hidden] { display: none !important; }
.review-screen { max-width: 900px; }
.back-home { margin: 4px 0 24px; padding: 8px 0; font-size: 14px; }
.review-heading { margin-bottom: 24px; }
.review-heading > p:last-child { color: var(--muted); margin-top: 12px; }
.review-form { display: grid; gap: 22px; padding: 28px; }
.form-field { display: grid; gap: 8px; }
.form-field label { font-weight: 650; }
.form-field .muted { margin-left: 0; font-size: 13px; font-weight: 400; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid #b8c6ba;
  border-radius: 10px; background: #fffef9; color: var(--ink); font: inherit;
}
.form-field textarea { resize: vertical; }
.form-field small { color: var(--muted); }
.form-field input:focus-visible, .form-field select:focus-visible, .form-field textarea:focus-visible {
  outline: 3px solid #b98426; outline-offset: 3px;
}
.review-form .button { justify-self: start; }
.button:disabled { opacity: .65; cursor: wait; }
.secondary { background: #eaf2e8; color: var(--green); margin-top: 20px; }
.secondary:hover { background: #dce8de; }
.loading-panel { text-align: center; padding: 36px 24px; background: #edf5ef; }
.loading-panel h2 { font-size: 21px; }
.loading-panel p { color: var(--muted); margin-top: 12px; }
.loading-dot { display: block; font-size: 36px; color: var(--green); animation: breathe 1.5s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .4; transform: scale(.85); } }
.lesson-error { border: 1px solid #e1b997; background: #fff3e8; padding: 18px; border-radius: 12px; margin-top: 18px; }
.lesson-result { display: grid; gap: 18px; overflow-wrap: anywhere; }
.lesson-result > header { padding: 8px 0 12px; }
.lesson-result h2 { font-size: 28px; }
.lesson-result h3 { font-size: 21px; margin-bottom: 14px; }
.lesson-result h4 { font-size: 16px; margin: 18px 0 8px; }
.lesson-copy { white-space: pre-wrap; line-height: 1.85; }
.lesson-example { background: #fdf4df; border-color: #eee3c7; }
.lesson-points { padding-left: 24px; margin: 0; }
.lesson-points li { padding: 5px 0 5px 6px; white-space: pre-wrap; }
.term-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.term-list li { background: #eaf2e8; border-radius: 12px; padding: 6px 12px; }
.school-section { background: #f5f4fb; }
.quiz-question { border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 18px 0 0; min-width: 0; }
.quiz-question legend { padding: 0 8px; font-weight: 650; white-space: pre-wrap; }
.quiz-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin-top: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.quiz-option input { flex-shrink: 0; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--green); }
.quiz-option:has(input:checked) { background: #eaf2e8; border-color: var(--green); }
.quiz-section > p { color: var(--muted); }
@media(max-width:640px) {
  .review-form { padding: 20px; }.review-heading h1 { font-size: 26px; }
  .lesson-result h2 { font-size: 25px; }.review-form .button { width: 100%; }
}
@media(prefers-reduced-motion:reduce) { .loading-dot { animation: none; } }

/* Multiple-choice feedback uses reassuring green and warm amber, never harsh red. */
.quiz-check, .quiz-retry { margin-top: 16px; }
.quiz-check:disabled { cursor: default; }
.quiz-option.answer-correct { background: #eaf2e8; border-color: var(--green); }
.quiz-option.answer-retry { background: #fdf4df; border-color: #bc954d; }
.quiz-option:has(input:disabled) { cursor: default; }
.answer-badge { margin-left: auto; flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--green); }
.answer-retry .answer-badge { color: #806024; }
.quiz-feedback { margin-top: 16px; padding: 16px; border-radius: 12px; }
.feedback-correct { background: #edf5ef; }
.feedback-retry { background: #fdf4df; }
.quiz-feedback strong { display: block; }
.quiz-feedback p { margin-top: 8px; }
.quiz-result { margin-top: 24px; padding: 20px; border-radius: 14px; background: #eaf1df; border: 1px solid #dce8de; }
.quiz-result strong { font-size: 19px; }
.quiz-result p { margin-top: 8px; color: #58685d; }
@media(max-width:640px) {
  .quiz-option { flex-wrap: wrap; }
  .quiz-option > span:not(.answer-badge) { flex: 1; min-width: 0; }
  .answer-badge { margin-left: 30px; width: 100%; }
}

/* Written understanding check: same calm cards, with no score or harsh verdicts. */
.understanding-check > h3 { margin-bottom: 12px; }
.understanding-form { display: grid; gap: 12px; margin-top: 20px; }
.understanding-form label { font-weight: 650; }
.understanding-form textarea {
  width: 100%; min-width: 0; padding: 14px; border: 1px solid #b8c6ba;
  border-radius: 10px; background: #fffef9; color: var(--ink); font: inherit; resize: vertical;
}
.understanding-form textarea:focus-visible { outline: 3px solid #b98426; outline-offset: 3px; }
.understanding-form small { color: var(--muted); }
.understanding-form .button { justify-self: start; }
.understanding-status { color: var(--green); }
.understanding-status:empty { display: none; }
.understanding-error { background: #fdf4df; padding: 14px; border-radius: 10px; }
.understanding-feedback { margin-top: 20px; padding: 20px; background: #edf5ef; border-radius: 14px; }
.understanding-feedback .understanding-verdict { margin-top: 0; font-size: 18px; color: var(--green); }
.understanding-example { background: #fffef9; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 18px; }
.understanding-example summary { font-weight: 650; color: var(--green); cursor: pointer; }
.understanding-example p { margin-top: 12px; }
.understanding-retry-prompt { margin-top: 18px; font-weight: 600; }
@media(max-width:640px) {
  .understanding-feedback { padding: 16px; }
  .understanding-form .button { width: 100%; }
}
.reference-options { border-top: 1px solid var(--line); padding-top: 16px; }
.reference-options summary { cursor: pointer; color: var(--green); font-weight: 600; }
.reference-options .form-field { margin-top: 18px; }
.reference-preview { max-width: 100%; max-height: 260px; border-radius: 12px; object-fit: contain; }
.reference-buttons { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.reference-buttons .secondary { margin: 0; }
.progress-history { margin-top: 22px; }
.progress-record { padding: 18px 0; border-bottom: 1px solid var(--line); }
.progress-record:last-child { border-bottom: 0; }
.progress-record h3 { font-size: 18px; margin-bottom: 8px; overflow-wrap: anywhere; }
.progress-record p { color: var(--muted); font-size: 13px; }
#progress-screen .back-home { display: inline-block; }
#storage-warning:empty { display: none; }
.network-banner { background: #fdf4df; padding: 14px 18px; border: 1px solid #eee3c7; border-radius: 12px; margin-bottom: 18px; font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
input, select, textarea { font-size: 16px; }
@media(max-width:640px) { .topbar-actions { gap: 8px; } #install-app { font-size: 11px; } }

/* Memolilo artwork stays supportive; content retains the existing layout. */
.brand-logo{display:block;width:100%;max-width:192px;height:auto}
.companion img{display:block;width:100%;height:auto;border-radius:12px}
.loading-mascot{display:block;width:72px;height:auto;margin:0 auto 16px;border-radius:12px}
.hero{background:#e5f6f3;border-color:#cce8e3}
.hero-copy>p:not(.eyebrow){color:var(--muted)}
.today,.nav-link.active,.secondary{background:#e5f6f3;border-color:#cce8e3}
.exam{background:#fff0e3;border-color:#f3dcc6}
.icon,.tomorrow .icon,.exam .icon{background:#ccefeb;color:#087f83}
.button:hover{background:#06696d}
/* Intrinsic grid/flex sizes must never force a phone into a desktop-sized canvas. */
main,#home-screen,.review-screen,.form-field,.book-info,.hero-copy{min-width:0}
.review-form,.understanding-form{grid-template-columns:minmax(0,1fr)}
img{max-width:100%}
input,select,textarea{max-width:100%}
.panel,.progress-note,.book-info,.quiz-question legend{overflow-wrap:anywhere}
@media(max-width:640px){
  body{font-size:16px}
  .brand-logo{width:180px}
  .developer{position:static;align-self:flex-end;min-height:32px;margin-top:-8px}
  nav{grid-template-columns:repeat(4,minmax(0,1fr))}
  .nav-link{font-size:11px;white-space:normal;text-align:center;min-height:56px}
  .topbar{flex-wrap:wrap;gap:8px}
  .topbar-actions{flex-wrap:wrap}
  .topbar .muted{margin-left:4px}
  .pill{white-space:nowrap}
  .button,.text-button{min-height:44px;font-size:14px}
  .welcome p:last-child,.section-heading p,.hero-copy>p:not(.eyebrow){font-size:14px}
  .choice{padding:20px 16px 20px 72px;min-width:0}
  .choice .icon{width:40px;height:40px}
  .kicker{font-size:10px;letter-spacing:.7px}
  .action{font-size:14px}
  .companion{width:64px}
  .panel,.review-form{padding:16px}
  .form-field input,.form-field select,.form-field textarea,.understanding-form textarea{font-size:16px}
  .form-field small,.progress-note,.progress-record p{font-size:13px}
  .quiz-question{padding:12px;margin-top:16px}
  .quiz-question legend{max-width:100%;padding:0 4px}
  .quiz-option{padding:12px 8px;gap:8px;min-height:48px}
  .reference-buttons .button,.understanding-form .button{width:100%}
  .reference-options summary{padding:8px 0}
  .panel-heading .sample{white-space:normal}
  .book-row{gap:12px}
  footer{font-size:12px}
}

/* Compact Home and responsive drawer overrides. */
.mobile-header,.mobile-choice-label,.mobile-tile-icon,.mobile-subject-icon,.mobile-home-progress,.mobile-stage-status{display:none}
.account-navigation{display:grid;gap:4px;border-top:1px solid var(--line);padding-top:16px}
.account-navigation button{border:0;background:transparent;text-align:left}
.continue-status{font-size:13px;color:var(--muted);margin:8px 0}
#continue-help{display:block;font-size:12px;color:var(--muted);margin-top:8px}
#continue-learning{gap:8px}
#mobile-drawer{padding:0;border:0;border-radius:0 22px 22px 0;margin:0;width:min(310px,85vw);max-width:none;height:100dvh;max-height:none;overflow:auto}
#mobile-drawer::backdrop{background:#173e4c66}
.menu-button{display:grid;place-items:center;border:0;background:transparent;font-size:24px;width:44px;height:44px;flex-shrink:0}
.drawer-close{position:absolute;right:10px;top:12px;z-index:1}
body.drawer-open{overflow:hidden}
#mobile-drawer[open]{animation:drawer-in .18s ease-out}
@keyframes drawer-in{from{transform:translateX(-100%)}to{transform:translateX(0)}}
@media(prefers-reduced-motion:reduce){#mobile-drawer[open]{animation:none}}
@media(max-width:960px){
  .mobile-header{display:flex;align-items:center;gap:10px;padding:8px 12px;background:#fffef9;border-bottom:1px solid var(--line)}
  .mobile-header a{display:flex;align-items:center;min-width:0}
  .mobile-header img{width:142px;height:auto}
  .grade-chip{margin-left:auto;white-space:nowrap;font-size:12px;font-weight:650;background:#edf6f5;border-radius:16px;padding:5px 10px}
  #mobile-drawer .sidebar{display:flex;position:static;min-height:100%;padding:24px 18px;gap:20px;border:0;background:#fffef9}
  #mobile-drawer .brand-logo{width:190px}
  #mobile-drawer nav{display:grid;grid-template-columns:1fr;gap:6px}
  #mobile-drawer .nav-link{flex-direction:row;justify-content:flex-start;text-align:left;font-size:15px;gap:12px;padding:12px;min-height:48px}
  #mobile-drawer .sidebar-note{display:none}
  #mobile-drawer .developer{position:static;align-self:flex-start;margin-top:auto;padding:12px;font-size:11px;min-height:44px}
  .topbar{display:none}
  main{padding:18px 16px 0}
}
@media(max-width:640px){
  body{background:#f7fbff}
  .mobile-header{height:80px;padding:16px 18px;gap:10px;border:0;background:#f7fbff;color:#112a68}
  .mobile-header .menu-button{width:44px;font-size:23px}
  .mobile-header img{width:150px}
  .grade-chip{font-size:13px;padding:6px 12px;background:#f1f6fc;border:1px solid #e8eff7;color:#152c63}
  main{padding:34px 20px 0}
  #home-screen{display:flex;flex-direction:column;gap:0;color:#10245d}
  .welcome{margin:0 0 10px;display:block}
  .welcome .eyebrow,.welcome p:last-child,.welcome .sample{display:none}
  .welcome h1{font-size:28px;line-height:1.25;letter-spacing:-.7px}
  .welcome .sun{font-size:26px;margin-left:3px}
  .section-heading{margin:0 0 28px}
  .section-heading h2{font-size:16px;font-weight:400;letter-spacing:0;line-height:1.5;color:#355989}
  .section-heading p,.section-heading .quiet{display:none}
  .choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
  .choice{position:static;padding:18px 6px;align-items:center;justify-content:center;gap:12px;height:130px;min-height:0;border:0;border-radius:20px;box-shadow:0 4px 14px #1d4c8310}
  .choice:hover{transform:none}
  .mobile-tile-icon{display:block;width:48px;height:48px;flex-shrink:0}
  .choice .icon,.choice .kicker,.choice strong,.choice .description,.choice .action{display:none}
  .mobile-choice-label{display:block;font-size:15px;font-weight:700;order:1}
  .today{background:linear-gradient(145deg,#fff8e9,#fff2d5);color:#302614}
  .today .mobile-tile-icon{color:#ffa514}
  .tomorrow{background:linear-gradient(145deg,#e7f6ff,#def0ff);color:#125de3}
  .tomorrow .mobile-tile-icon{color:#1686f5}
  .exam{background:linear-gradient(145deg,#fff0f7,#ffe5f0);color:#182457}
  .exam .mobile-tile-icon{color:#d84378}
  .lower-grid{margin:26px -4px 0;gap:12px}
  #buku{padding:18px 16px 14px;border:0;border-radius:24px;background:#eef5fb}
  #buku .panel-heading{margin-bottom:14px}
  #buku .panel-heading h2{font-size:21px;color:#10245d}
  #buku .sample{display:none}
  #buku .book-row{display:grid;grid-template-columns:68px minmax(0,1fr);gap:7px 12px;background:#fff;padding:16px;border-radius:18px;box-shadow:0 5px 16px #2f629408;align-items:start}
  #buku .book-cover{grid-column:1;grid-row:1 / span 4;width:68px;min-width:0;height:86px;padding:0;border:4px solid #e6f4ff;border-radius:12px;background:linear-gradient(145deg,#c8ecff,#e8f7fc);box-shadow:none;color:#338bb1;display:grid;place-items:center}
  #buku .book-cover small,#buku .book-cover strong{display:none}
  #buku .book-cover>span{display:none}
  .mobile-subject-icon{display:block;width:36px;height:36px}
  #buku .book-info{display:contents}
  #buku .book-info .eyebrow{grid-column:2;grid-row:1;font-size:12px;font-weight:500;letter-spacing:0;margin:0;color:#537eae}
  #buku .book-info h3{grid-column:2;grid-row:2;font-size:16px;line-height:1.3;letter-spacing:-.3px;color:#10245d}
  #buku #current-description{display:none}
  #buku #continue-status{display:none}
  .mobile-home-progress{display:block;grid-column:2;grid-row:3;width:100%;height:8px;border:0;border-radius:8px;overflow:hidden;background:#e7eff6;accent-color:#14c877}
  .mobile-home-progress::-webkit-progress-bar{background:#e7eff6;border-radius:8px}
  .mobile-home-progress::-webkit-progress-value{background:#14c877;border-radius:8px}
  .mobile-home-progress::-moz-progress-bar{background:#14c877;border-radius:8px}
  #buku .mobile-stage-status{display:block;grid-column:2;grid-row:4;font-size:11px;line-height:1.4;margin:0;color:#385987}
  #continue-learning{grid-column:1 / -1;grid-row:5;width:100%;height:52px;padding:10px;margin-top:10px;font-size:16px;border-radius:12px;background:#197bf2;color:white;box-shadow:0 4px 10px #197bf21c}
  #continue-learning:hover{background:#106bdd}
  #continue-help{grid-column:1 / -1;grid-row:6;font-size:11px;line-height:1.4;margin-top:0;color:#537092}
  #progress-summary{background:#fff4e0;padding:14px 16px;border:0;border-radius:18px}
  #progress-summary .panel-heading,#progress-summary .progress-note:last-child{display:none}
  #progress-summary .streak{gap:12px}
  #progress-summary .streak>span{font-size:30px;line-height:1.25;width:auto;background:transparent}
  #progress-summary .streak strong,#progress-summary .streak p{display:inline;font-size:15px;line-height:1.4;letter-spacing:-.2px;color:#aa5b12}
  #progress-summary .streak p{font-weight:650;margin-left:3px}
  #progress-summary .progress-note{font-size:11px;margin:2px 0 0 43px;color:#355989}
  .hero{position:relative;margin:14px -20px 0;padding:20px;min-height:190px;align-items:flex-start;border:0;border-radius:0;background:radial-gradient(ellipse at bottom right,#d1f1f5 0,transparent 70%);overflow:hidden}
  .hero-copy{max-width:52%;padding-top:16px}
  .hero h2{font-size:16px;color:#10245d}
  .hero-copy>p:not(.eyebrow){font-size:12px;line-height:1.5;color:#355989}
  .companion{position:absolute;right:8px;top:2px;width:170px}
  .companion img{width:100%;height:auto;border-radius:22px}
  #home-screen:not([hidden])~footer{font-size:10px;padding-top:10px;color:#647f9b}
  #mobile-drawer{width:82vw;max-width:340px;border-radius:0 26px 26px 0;background:#f7fbff;color:#244f86}
  #mobile-drawer .sidebar{background:#f7fbff;padding:28px 20px;gap:26px}
  #mobile-drawer .brand-logo{width:185px}
  #mobile-drawer nav{gap:12px;margin-top:10px}
  #mobile-drawer .nav-link{padding:14px 16px;border-radius:14px;color:#345d8e}
  #mobile-drawer .nav-link.active{background:#d8eaff;color:#176ee5}
  #mobile-drawer .account-navigation{padding-top:24px;gap:12px}
  #mobile-drawer .developer{color:#7798bc}
  .review-heading h1{font-size:23px}
  .review-heading{margin-bottom:18px}
  .review-form{gap:18px}
}
@media(max-width:375px){
  .mobile-header{padding-inline:16px;gap:8px}
  .mobile-header img{width:138px}
  .grade-chip{padding-inline:10px}
  main{padding:26px 16px 0}
  .welcome h1{font-size:26px}
  .choices{gap:12px}
  .choice{height:120px;padding-block:16px}
  .lower-grid{margin-top:24px}
  #buku{padding-inline:14px}
  #buku .book-row{grid-template-columns:60px minmax(0,1fr);gap:7px 10px;padding:14px}
  #buku .book-cover{width:60px;height:82px}
  #buku .book-info h3{font-size:15px}
  .hero{margin-inline:-16px}
  .companion{width:150px}
}

/* Compact destinations use a shared spacing scale; educational content stays fluid.
   Expanded reference tools/history and longer user text can grow naturally. */
.mobile-progress-recent{display:none}
#progress-history-disclosure>summary{display:none}
#typed-reference-options>summary{display:none}
@media(max-width:640px){
  .mobile-header{height:64px;padding-block:10px}
  main{padding:16px 16px 0}
  .welcome h1{font-size:25px}
  .welcome{margin-bottom:6px}
  .section-heading{margin-bottom:14px}
  .choice{height:100px;padding:12px 6px;gap:8px}
  .mobile-tile-icon{width:40px;height:40px}
  .lower-grid{margin-top:16px;gap:10px}
  #buku{padding:12px}
  #buku .panel-heading{margin-bottom:10px}
  #buku .panel-heading h2{font-size:19px}
  #buku .book-row{padding:12px;gap:5px 10px;grid-template-columns:56px minmax(0,1fr)}
  #buku .book-cover{width:56px;height:74px}
  #continue-learning{height:44px;margin-top:6px}
  #progress-summary{padding:10px 14px}
  .hero{margin:10px -16px 0;padding:12px 16px;min-height:100px}
  .hero-copy{padding-top:10px;max-width:65%}
  .hero-copy>p:not(.eyebrow){font-size:12px}
  .companion{width:92px;right:10px;top:2px}
  footer,#home-screen:not([hidden])~footer{padding:12px 0;font-size:10px;gap:2px}
  .back-home{margin:0 0 8px;padding:8px 0;min-height:44px}
  #review-screen:has(#review-form:not([hidden])) .review-heading,#progress-screen .review-heading{margin-bottom:10px}
  #review-screen:has(#review-form:not([hidden])) h1,#progress-heading{font-size:22px;line-height:1.25}
  #review-screen:has(#review-form:not([hidden])) .eyebrow,#progress-screen .eyebrow{margin-bottom:5px;font-size:10px}
  #review-screen:has(#review-form:not([hidden])) .review-heading>p:last-child,#progress-screen .review-heading>p:last-child{margin-top:4px;font-size:14px;line-height:1.45}
  .review-form{gap:10px;padding:14px}
  .form-field{gap:4px}
  .form-field label{font-size:14px;line-height:1.4}
  .form-field input,.form-field select,.form-field textarea{padding:10px 12px;min-height:44px;font-size:16px;line-height:1.4}
  /* Explicit closed-control sizing avoids browser-dependent intrinsic heights.
     Leave native select appearance and its OS-controlled popup intact. */
  .form-field input:not([type="file"]),.form-field select{
    width:100%;height:44px;min-height:44px;padding:8px 10px;font-size:16px;line-height:1.25;
  }
  .review-form .button,.reference-buttons .button{
    height:44px;min-height:44px;padding:8px 14px;font-size:16px;line-height:1.25;
  }
  #review-reference{height:80px;min-height:80px}
  .form-field small{font-size:12px;line-height:1.4}
  .reference-options{padding-top:10px}
  .reference-options summary{font-size:13px;line-height:1.4;min-height:44px;padding:5px 0}
  .reference-options .form-field{margin-top:10px}
  #typed-reference-options>summary{display:list-item;font-size:14px;font-weight:650;color:var(--green);padding:10px 0;min-height:44px;cursor:pointer}
  #typed-reference-options .form-field{margin-top:6px}
  #profile-status:empty{display:none}
  #progress-screen>.progress-note{font-size:12px;line-height:1.45}
  .mobile-progress-recent{display:block;margin-top:12px;padding:12px;background:#edf5fb;border-radius:12px;font-size:13px;line-height:1.45;overflow-wrap:anywhere}
  #progress-history-disclosure{margin-top:8px}
  #progress-history-disclosure>summary{display:list-item;padding:10px 0;min-height:44px;font-size:14px;color:var(--green);cursor:pointer}
  .progress-history{margin-top:6px;padding:14px}
  .progress-record{padding:12px 0}
  #mobile-drawer .sidebar{padding:22px 18px;gap:18px}
  #mobile-drawer nav{gap:6px;margin-top:4px}
  #mobile-drawer .account-navigation{padding-top:16px;gap:6px}
  #mobile-drawer .nav-link{padding:10px 14px;min-height:44px}
  #preview-dialog{padding:24px;max-height:calc(100dvh - 32px);overflow:auto}
  #preview-dialog h2{font-size:22px}
  #preview-dialog p:not(.eyebrow){margin:12px 0}
}
