@font-face {
      font-family: "Satoshi";
      src: url("assets/fonts/satoshi-variable.woff2") format("woff2");
      font-weight: 300 900;
      font-style: normal;
      font-display: swap;
    }
    :root {
      color-scheme: light;
      --ink: #202b45;
      --muted: #7a8291;
      --blue: #4266d5;
      --blue-deep: #294daf;
      --blue-pale: #e9efff;
      --paper: #fffefa;
      --canvas: #f6f5ef;
      --line: #ecebe5;
      --green: #e6f2e5;
      --green-ink: #47784e;
      --orange: #f5a85a;
      --shadow: 0 12px 32px rgba(43, 54, 83, .08);
      --font-sans: "Satoshi", ui-rounded, "SF Pro Rounded", "Avenir Next", Avenir, system-ui, -apple-system, sans-serif;
      font-family: var(--font-sans);
      font-synthesis: none;
      text-rendering: optimizeLegibility;
      -webkit-font-smoothing: antialiased;
    }
    * { box-sizing: border-box; }
    body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at 15% 5%, #e8edff 0, transparent 34%), radial-gradient(ellipse at 88% 83%, #f5eadb 0, transparent 29%), #eeeff1; color: var(--ink); }
    button, input, select, textarea { font: inherit; }
    .field select { font-family: var(--font-sans); }
    button { color: inherit; }
    .app { position: relative; width: min(100%, 480px); min-height: 100svh; margin: 0 auto; padding-bottom: calc(86px + env(safe-area-inset-bottom)); overflow: hidden; background: var(--canvas); box-shadow: 0 0 70px rgba(30, 40, 67, .12); }
    .topbar { display: flex; align-items: center; gap: 10px; padding: 19px 21px 10px; }
    .brand { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 850; letter-spacing: -.65px; }
    .brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 12px; color: #fff; background: var(--blue); box-shadow: 0 5px 11px #4266d533; }
    .logo { display: block; width: 34px; height: 34px; flex: none; filter: drop-shadow(0 5px 8px #4266d52e); }
    .logo svg { display: block; width: 100%; height: 100%; }
    .profile { display: grid; width: 42px; height: 42px; margin-left: auto; padding: 2px; place-items: center; overflow: hidden; border: 2px solid white; border-radius: 50%; background: #fff; box-shadow: 0 2px 9px #29365418; }
    .profile img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 40% 40%; }
    .menu-trigger { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); color: #4a5772; cursor: pointer; transition: background .16s, border-color .16s; }
    .menu-trigger:hover { border-color: #dcd8cc; background: #fff; }
    .menu-trigger:focus-visible, .sidebar button:focus-visible { outline: 3px solid #f2b45c; outline-offset: 2px; }
    main { padding: 8px 20px 26px; }
    .eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: 1.15px; text-transform: uppercase; }
    h1, h2, h3, p { margin-top: 0; }
    h1 { margin-bottom: 4px; font-size: 28px; line-height: 1.12; letter-spacing: -1.05px; }
    h2 { margin-bottom: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.55px; }
    h3 { margin-bottom: 6px; font-size: 15px; letter-spacing: -.2px; }
    .hello { display: flex; align-items: flex-start; justify-content: space-between; margin: 9px 0 18px; }
    .hello p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
    .streak { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; padding: 8px 10px; border: 1px solid #f4e5ca; border-radius: 14px; color: #96601c; background: #fff6e6; font-size: 12px; font-weight: 800; white-space: nowrap; }
    .card { border: 1px solid rgba(34, 45, 70, .06); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
    .week-card { display: flex; align-items: center; gap: 13px; margin-bottom: 17px; padding: 14px 15px; }
    .week-icon { display: grid; flex: none; width: 39px; height: 39px; place-items: center; border-radius: 14px; background: #fff0dc; font-size: 20px; }
    .week-copy { flex: 1; min-width: 0; }
    .week-copy strong { display: block; margin-bottom: 3px; font-size: 12px; }
    .week-copy span { color: var(--muted); font-size: 11px; }
    .week-days { display: flex; gap: 4px; }
    .day-dot { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; color: #9097a4; background: #f1f1ef; font-size: 9px; font-weight: 800; }
    .day-dot.done { color: white; background: #68a875; }
    .lesson-card { overflow: hidden; margin-bottom: 21px; }
    .lesson-art { position: relative; height: 156px; overflow: hidden; background: #dfe8da; }
    .lesson-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
    .lesson-art:after { position: absolute; inset: 35% 0 0; background: linear-gradient(180deg, transparent, #17233c4d); content: ""; pointer-events: none; }
    .art-label { position: absolute; z-index: 1; bottom: 12px; left: 14px; padding: 5px 8px; border-radius: 9px; color: #485772; background: #ffffffed; font-size: 10px; font-weight: 800; }
    .lesson-body { padding: 15px 16px 16px; }
    .lesson-kicker { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: .85px; text-transform: uppercase; }
    .lesson-kicker span:last-child { color: #9298a5; font-weight: 750; letter-spacing: 0; text-transform: none; }
    .lesson-body h2 { font-size: 19px; }
    .lesson-body > p { margin: 6px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
    .button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 0; border-radius: 15px; background: var(--blue); color: white; font-weight: 800; font-size: 13px; cursor: pointer; transition: transform .16s, background .16s, box-shadow .16s; }
    .button:hover { background: var(--blue-deep); box-shadow: 0 7px 15px #4266d52b; transform: translateY(-1px); }
    .button:active { transform: scale(.98); }
    .button:focus-visible, .nav-btn:focus-visible, input:focus-visible, .answer:focus-visible { outline: 3px solid #f2b45c; outline-offset: 3px; }
    .button.full { width: 100%; }
    .section-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 1px 11px; }
    .text-link { padding: 5px; border: 0; color: var(--blue); background: none; font-size: 11px; font-weight: 800; cursor: pointer; }
    .subjects { display: grid; grid-auto-rows: 1fr; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 19px; }
    .subject { display: flex; min-height: 90px; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 12px; border: 1px solid #edece7; border-radius: 18px; background: var(--paper); text-align: left; cursor: pointer; transition: transform .16s; }
    .subject:hover { transform: translateY(-2px); }
    .subject-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 12px; font-size: 19px; }
    .subject:nth-child(1) .subject-icon { background: #fff1dc; }
    .subject:nth-child(2) .subject-icon { background: #e8f4e8; }
    .subject:nth-child(3) .subject-icon { background: #f0eaff; }
    .subject:nth-child(4) .subject-icon { background: #e6f1ff; }
    .subject:nth-child(5) .subject-icon { background: #fdeef0; }
    .subject:nth-child(6) .subject-icon { background: #e6f4f0; }
    .subject strong { font-size: 11px; line-height: 1.25; }
    .subject small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
    .ask-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #e8eaff; border-radius: 19px; background: #edf0ff; }
    .ask-icon { display: grid; flex: none; width: 40px; height: 40px; place-items: center; border-radius: 14px; color: white; background: var(--blue); }
    .ask-copy { flex: 1; }
    .ask-copy strong { display: block; margin-bottom: 3px; font-size: 12px; }
    .ask-copy span { color: #68748c; font-size: 10px; line-height: 1.4; }
    .round-arrow { display: grid; flex: none; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 50%; color: var(--blue); background: white; cursor: pointer; }
    .bottom-nav { position: fixed; z-index: 5; bottom: 0; left: 50%; display: grid; width: min(100%, 480px); grid-template-columns: repeat(3, 1fr); padding: 9px 17px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid #ecebe4; background: #fffefaed; backdrop-filter: blur(16px); transform: translateX(-50%); }
    .nav-btn { display: flex; min-height: 54px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 14px; color: #9298a5; background: transparent; font-size: 9px; font-weight: 750; cursor: pointer; }
    .nav-btn svg { width: 21px; height: 21px; }
    .nav-btn.active { color: var(--blue); background: #edf0ff; }
    .view { display: none; animation: appear .22s ease-out; }
    .view.active { display: block; }
    @keyframes appear { from { opacity: .25; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
    .view-title { display: flex; align-items: center; gap: 10px; margin: 5px 0 18px; }
    .back-btn { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); cursor: pointer; }
    .view-title h1 { font-size: 22px; }
    .view-title p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
    .tutor-progress { height: 7px; margin: 0 0 15px; overflow: hidden; border-radius: 8px; background: #e8e9ef; }
    .tutor-progress span { display: block; width: 42%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5977e3, #91a5ff); }
    .tutor-card { margin-bottom: 14px; padding: 17px; }
    .tutor-card .eyebrow { margin-bottom: 8px; color: var(--blue); }
    .tutor-card h2 { margin-bottom: 10px; font-size: 18px; }
    .diagram { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 15px 0; padding: 14px 8px; border-radius: 17px; background: #f6f5ef; }
    .diagram-item { text-align: center; }
    .diagram-circle { width: 64px; height: 64px; margin: 0 auto 6px; border: 2px solid white; border-radius: 50%; box-shadow: 0 3px 9px #3332; }
    .diagram-circle.half { background: conic-gradient(#f4b455 0 50%, #fffefa 50%); }
    .diagram-circle.fourths { background: conic-gradient(#7590ed 0 25%, #fffefa 25% 50%, #7590ed 50% 75%, #fffefa 75%); }
    .diagram-item strong { font-size: 12px; }
    .diagram-equals { padding-bottom: 18px; color: #596a8c; font-size: 19px; font-weight: 900; }
    .tutor-text { color: #566075; font-size: 13px; line-height: 1.62; }
    .tutor-text strong { color: var(--ink); }
    .coach-note { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; padding: 12px; border-radius: 15px; background: #fff4e6; color: #624d37; font-size: 12px; line-height: 1.5; }
    .coach-note span:first-child { font-size: 19px; }
    .practice-card { padding: 17px; }
    .practice-card .eyebrow { margin-bottom: 6px; color: #a66a23; }
    .practice-card h2 { margin-bottom: 13px; font-size: 16px; }
    .answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .answer { min-height: 48px; border: 1.5px solid #e7e8ec; border-radius: 14px; background: white; color: var(--ink); font-size: 16px; font-weight: 850; cursor: pointer; }
    .answer:hover { border-color: #8fa2ed; background: #f4f6ff; }
    .answer.correct { border-color: #77b783; background: #ebf7eb; color: #386b42; }
    .answer.incorrect { border-color: #efa596; background: #fff0ed; color: #a14e41; }
    .feedback { min-height: 18px; margin: 11px 0 0; color: #47784e; font-size: 12px; font-weight: 750; }
    .voice-panel { margin: 16px 0; padding: 16px; border: 1px solid #e6eaff; border-radius: 19px; background: #edf0ff; }
    .voice-row { display: flex; align-items: center; gap: 12px; }
    .mic-button { display: grid; width: 48px; height: 48px; flex: none; place-items: center; border: 0; border-radius: 17px; color: white; background: var(--blue); cursor: pointer; }
    .mic-button.listening { background: #db725f; animation: pulse 1.25s infinite; }
    @keyframes pulse { 50% { box-shadow: 0 0 0 7px #db725f2c; } }
    .voice-copy { flex: 1; }
    .voice-copy strong { display: block; margin-bottom: 3px; font-size: 12px; }
    .voice-copy span { color: #747d91; font-size: 10px; }
    .divider { display: flex; align-items: center; gap: 9px; margin: 14px 0 10px; color: #8890a0; font-size: 10px; }
    .divider:before, .divider:after { height: 1px; flex: 1; background: #dfe3f4; content: ""; }
    .ask-form { display: flex; gap: 7px; }
    .ask-form input { width: 100%; min-width: 0; min-height: 43px; padding: 0 12px; border: 1px solid #e1e4ef; border-radius: 13px; outline: none; background: white; color: var(--ink); font-size: 12px; }
    .ask-form button { width: 43px; flex: none; border: 0; border-radius: 13px; color: white; background: var(--blue); cursor: pointer; }
    .voice-reply { display: none; margin-top: 11px; padding: 11px 12px; border-radius: 13px; background: white; color: #566075; font-size: 11px; line-height: 1.5; }
    .voice-reply.show { display: block; }
    .stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 15px; }
    .stat-card { padding: 15px; }
    .stat-icon { display: grid; width: 35px; height: 35px; margin-bottom: 12px; place-items: center; border-radius: 12px; background: #edf0ff; font-size: 18px; }
    .stat-card:nth-child(2) .stat-icon { background: #fff0dc; }
    .stat-card:nth-child(3) .stat-icon { background: #e8f4e8; }
    .stat-card:nth-child(4) .stat-icon { background: #f0eaff; }
    .stat-value { display: block; margin-bottom: 2px; font-size: 24px; font-weight: 900; letter-spacing: -.7px; }
    .stat-label { color: var(--muted); font-size: 10px; }
    .progress-card { margin-bottom: 13px; padding: 16px; }
    .progress-card h2 { margin-bottom: 14px; font-size: 16px; }
    .bars { display: flex; height: 105px; align-items: end; justify-content: space-between; gap: 10px; padding: 0 3px; }
    .bar-day { display: flex; height: 100%; flex: 1; flex-direction: column; align-items: center; justify-content: end; gap: 6px; color: #858c99; font-size: 9px; }
    .bar { width: 100%; max-width: 25px; min-height: 10px; border-radius: 9px 9px 4px 4px; background: #dce4ff; }
    .bar.today { background: linear-gradient(#8298f1, #4f70dc); }
    .topic { margin-top: 12px; }
    .topic-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11px; font-weight: 750; }
    .topic-head span:last-child { color: var(--muted); font-weight: 650; }
    .topic-track { height: 8px; overflow: hidden; border-radius: 9px; background: #efefeb; }
    .topic-track i { display: block; height: 100%; border-radius: inherit; background: #6fa77b; }
    .topic:nth-of-type(3) .topic-track i { background: #6d87e5; }
    .topic:nth-of-type(4) .topic-track i { background: #efad58; }
    .badge-card { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid #f1e8d5; border-radius: 19px; background: #fff8e9; }
    .badge-art { display: grid; width: 47px; height: 47px; flex: none; place-items: center; border-radius: 16px; background: #ffebc1; font-size: 25px; }
    .badge-card strong { display: block; margin-bottom: 4px; font-size: 12px; }
    .badge-card span { color: #8b7856; font-size: 10px; line-height: 1.4; }
    .toast { position: fixed; z-index: 9; bottom: calc(88px + env(safe-area-inset-bottom)); left: 50%; max-width: calc(100vw - 36px); padding: 11px 15px; border-radius: 14px; color: white; background: #26344e; box-shadow: var(--shadow); font-size: 12px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .2s; }
    .toast.show { opacity: 1; transform: translate(-50%, 0); }

    /* Mobile navigation drawer */
    .drawer-scrim { position: fixed; z-index: 39; inset: 0; background: #1b2540; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; }
    .drawer-scrim.open { opacity: .42; visibility: visible; }
    html.drawer-open, html.drawer-open body { overflow: hidden; }
    .sidebar { position: fixed; z-index: 40; top: 0; bottom: 0; left: max(0px, calc(50% - 240px)); display: flex; width: min(86vw, 344px); flex-direction: column; border-radius: 0 30px 30px 0; background: linear-gradient(180deg, #fffefa 0%, #fbf8f0 64%, #f7f2e7 100%); box-shadow: 24px 0 60px #18223c33, inset -1px 0 0 #fff; visibility: hidden; overscroll-behavior: contain; transform: translateX(-104%); transition: transform .36s cubic-bezier(.22, 1, .36, 1), visibility .36s; }
    .sidebar.open { visibility: visible; transform: translateX(0); }
    .sidebar-top { display: flex; align-items: center; gap: 11px; padding: calc(16px + env(safe-area-inset-top)) 14px 15px 18px; border-bottom: 1px solid #efeade; }
    .sidebar-avatar { display: block; width: 50px; height: 50px; flex: none; overflow: hidden; border: 2.5px solid #fff; border-radius: 18px; background: #e8e3dc; box-shadow: 0 8px 16px #34446c1f; }
    .sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 40%; }
    .sidebar-learner h3 { margin: 0 0 3px; font-size: 16px; letter-spacing: -.35px; }
    .sidebar-learner p { margin: 0; color: #7a8291; font-size: 10.5px; font-weight: 650; }
    .sidebar-close { display: grid; width: 36px; height: 36px; margin-left: auto; flex: none; place-items: center; border: 1px solid #e9e4d8; border-radius: 12px; background: #fffdf8; color: #5c6780; cursor: pointer; }
    .sidebar-close:hover { border-color: #d8d2c2; background: #fff; }
    .sidebar-scroll { flex: 1; padding: 16px 16px 10px 18px; overflow-y: auto; }
    .sidebar-next { position: relative; overflow: hidden; padding: 15px; border: 1px solid #fff; border-radius: 21px; background: linear-gradient(150deg, #eef2ff, #e7ebff 58%, #fff1de); box-shadow: 0 12px 24px #2b36530d; }
    .sidebar-next:after { position: absolute; top: -26px; right: -22px; width: 84px; height: 84px; border-radius: 50%; background: #ffd17b; box-shadow: 0 0 0 10px #ffd17b26; content: ""; opacity: .75; }
    .sidebar-next .eyebrow { position: relative; z-index: 1; margin-bottom: 7px; color: #4b69d1; font-size: 9px; }
    .sidebar-next strong { position: relative; z-index: 1; display: block; margin-bottom: 3px; font-size: 15px; letter-spacing: -.4px; }
    .sidebar-next > span { position: relative; z-index: 1; display: block; color: #667084; font-size: 11px; }
    .sidebar-next-btn { position: relative; z-index: 1; display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: center; gap: 7px; margin-top: 13px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(150deg, #5a78e4, #2a4bb0); font-size: 12px; font-weight: 800; cursor: pointer; box-shadow: 0 10px 18px #4266d533; }
    .sidebar-next-btn:hover { background: linear-gradient(150deg, #6380ea, #23419e); }
    .sidebar-label { margin: 22px 0 8px; color: #969cab; font-size: 9px; font-weight: 850; letter-spacing: 1.5px; text-transform: uppercase; }
    .sidebar-nav { display: grid; gap: 3px; }
    .sidebar-link { display: grid; width: 100%; grid-template-columns: 36px minmax(0, 1fr) 16px; align-items: center; gap: 11px; padding: 8px 10px 8px 8px; border: 0; border-radius: 15px; background: transparent; text-align: left; cursor: pointer; transition: background .16s; }
    .sidebar-link:hover { background: #f4f1e7; }
    .sidebar-link.active { background: #edf0ff; }
    .sidebar-icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid #efeade; border-radius: 12px; background: #fffdf8; color: #5f6a80; }
    .sidebar-link.active .sidebar-icon { border-color: #fff; background: #fff; color: #2f52c0; box-shadow: 0 4px 9px #4266d51a; }
    .sidebar-link strong { display: block; font-size: 12.5px; letter-spacing: -.15px; }
    .sidebar-link small { display: block; margin-top: 1px; overflow: hidden; color: #7a8291; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    .sidebar-link .chev { color: #b8bdc7; }
    .sidebar-link.active strong { color: #2f52c0; }
    .sidebar-note { margin: 10px 2px 0; color: #8a8f9c; font-size: 10px; line-height: 1.5; }
    .sidebar-parent { margin-top: 6px; }
    .sidebar-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px calc(13px + env(safe-area-inset-bottom)); border-top: 1px solid #efeade; color: #a4a8b2; font-size: 8.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
    .sidebar-settings { flex: none; padding: 2px 14px 10px 16px; border-top: 1px solid #efeade; }
    .sidebar-settings .sidebar-label { margin: 12px 0 4px; }
    .theme-toggle { display: grid; width: 100%; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 9px 10px 9px 8px; border: 0; border-radius: 15px; background: transparent; text-align: left; cursor: pointer; transition: background .16s; }
    .theme-toggle:hover { background: #f4f1e7; }
    .theme-copy strong { display: block; font-size: 12.5px; letter-spacing: -.15px; }
    .theme-copy small { display: block; margin-top: 1px; color: #7a8291; font-size: 10px; }
    .theme-toggle .switch { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: #e4e0d4; box-shadow: inset 0 1px 2px #00000014; transition: background .2s; }
    .theme-toggle .switch::after { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px #00000030; content: ""; transition: transform .22s cubic-bezier(.22, 1, .36, 1); }
    .theme-toggle[aria-checked="true"] .switch { background: linear-gradient(150deg, #5a78e4, #2a4bb0); }
    .theme-toggle[aria-checked="true"] .switch::after { transform: translateX(18px); }
    .theme-toggle[aria-checked="true"] .theme-icon { border-color: #e4e2f7; background: #fff; color: #2f52c0; }
    .sidebar-logout:hover { background: #fdf1ee; }
    .sidebar-logout:hover .sidebar-icon { border-color: #f0d7d0; background: #fff; color: #b0503f; }
    .sidebar-logout:hover strong { color: #a74335; }
    .sidebar.open .sidebar-scroll > * { animation: drawer-item .42s cubic-bezier(.22, 1, .36, 1) backwards; }
    .sidebar.open .sidebar-scroll > *:nth-child(2) { animation-delay: .05s; }
    .sidebar.open .sidebar-scroll > *:nth-child(3) { animation-delay: .1s; }
    @keyframes drawer-item { from { opacity: 0; transform: translateX(-10px); } }
    .app.auth-mode { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
    .app.auth-mode .topbar, .app.auth-mode .bottom-nav { display: none; }
    .app.auth-mode main { min-height: 100svh; padding: max(22px, env(safe-area-inset-top)) 22px 30px; }
    .auth-view { min-height: calc(100svh - 52px); }
    .auth-brand { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 4px auto 24px; font-size: 17px; font-weight: 850; letter-spacing: -.55px; }
    .auth-brand .logo { width: 38px; height: 38px; }
    /* Welcome — staged brand screen */
    .app.auth-mode { background: radial-gradient(900px 520px at 10% 0%, #e9eeff 0, transparent 60%), radial-gradient(760px 460px at 92% 100%, #ffe9d2 0, transparent 62%), #f7f5ef; }
    .welcome-stage { display: grid; gap: 20px; }
    .welcome-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 20px; font-size: 19px; font-weight: 850; letter-spacing: -.6px; }
    .welcome-brand .logo { width: 42px; height: 42px; filter: drop-shadow(0 10px 16px #4266d530); }
    .brand-ai { align-self: center; padding-top: 3px; color: var(--blue); background: transparent; font-size: 11px; font-weight: 850; letter-spacing: .16em; }
    .welcome-eyebrow { margin: 0; color: #4b69d1; font-size: 10.5px; font-weight: 850; letter-spacing: 1.6px; text-transform: uppercase; }
    .welcome-title { margin: 9px 0 10px; font-size: clamp(33px, 9vw, 40px); line-height: 1.02; letter-spacing: -1.35px; }
    .welcome-lede { max-width: 46ch; margin: 0; color: #6a7283; font-size: 14px; line-height: 1.6; }
    .welcome-proof { display: none; margin: 28px 0 0; padding: 0; list-style: none; gap: 16px; }
    .welcome-proof li { display: flex; align-items: flex-start; gap: 12px; }
    .proof-icon { display: grid; width: 40px; height: 40px; flex: none; place-items: center; border: 1px solid #eceadf; border-radius: 14px; background: #fffefa; box-shadow: 0 6px 14px #2b365308; font-size: 19px; }
    .welcome-proof strong { display: block; margin-bottom: 2px; font-size: 13px; letter-spacing: -.2px; }
    .welcome-proof span:last-child { display: block; color: #6a7283; font-size: 12px; line-height: 1.5; }

    .welcome-panel { display: grid; gap: 13px; }
    .welcome-hero { position: relative; min-height: 246px; overflow: hidden; border-radius: 30px; background: #d9d6d0; box-shadow: inset 0 1px 0 #ffffffb8, 0 18px 40px #2b36531a; }
    .welcome-hero:after { position: absolute; z-index: 1; inset: 0; border-radius: inherit; background: linear-gradient(180deg, #17233c00 40%, #17233c18 100%); content: ""; pointer-events: none; }
    .hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 42% 38%; }
    .hero-card { position: absolute; z-index: 3; right: 14px; bottom: 14px; width: 158px; padding: 10px 11px; border: 1px solid #fff; border-radius: 18px; background: #fffdf8f2; box-shadow: 0 16px 28px #34446c22; backdrop-filter: blur(6px); }
    .hero-card-head { display: flex; justify-content: space-between; gap: 6px; color: #4b69d1; font-size: 8.5px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
    .hero-card-head span:last-child { color: #9aa0ae; font-weight: 750; letter-spacing: 0; text-transform: none; }
    .fraction-row { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
    .mini-pie { width: 34px; height: 34px; flex: none; border: 2px solid #fff; border-radius: 50%; background: conic-gradient(#ffbd69 0 50%, #fffefa 50%); box-shadow: 0 4px 9px #34446c1f; }
    .mini-pie.quarters { background: conic-gradient(#7c93ee 0 25%, #fffefa 25% 50%, #7c93ee 50% 75%, #fffefa 75%); }
    .fraction-eq { color: #344973; font-size: 14px; font-weight: 900; }
    .hero-card p { margin: 8px 0 0; color: #7b8291; font-size: 9.5px; line-height: 1.4; }

    .welcome-actions { padding: 16px; border: 1px solid #fff; border-radius: 28px; background: #fffefa; box-shadow: 0 18px 36px #2b365314; }
    .welcome-primary { justify-content: space-between; width: 100%; min-height: 54px; padding: 0 9px 0 19px; border-radius: 17px; font-size: 14px; background: linear-gradient(150deg, #5a78e4, #2a4bb0); box-shadow: 0 14px 24px #4266d53d, inset 0 1px 0 #ffffff3d; }
    .welcome-primary:hover { background: linear-gradient(150deg, #6380ea, #23419e); box-shadow: 0 16px 28px #4266d547, inset 0 1px 0 #ffffff3d; }
    .button-arrow { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 50%; background: #ffffff2b; }
    .welcome-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 11px; color: #79818f; font-size: 10px; }
    .welcome-divider:before, .welcome-divider:after { height: 1px; flex: 1; background: #efeee7; content: ""; }
    .welcome-actions .auth-light-button { display: flex; min-height: 52px; align-items: center; justify-content: center; gap: 8px; border-radius: 17px; font-size: 13px; }
    .welcome-trust { display: flex; align-items: center; justify-content: center; margin: 13px 0 0; padding: 0; list-style: none; color: #6f7787; font-size: 10px; font-weight: 750; }
    .welcome-trust li { display: flex; align-items: center; }
    .welcome-trust li + li:before { width: 3px; height: 3px; margin: 0 9px; border-radius: 50%; background: #cfd3dc; content: ""; }
    .welcome-demo { display: flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; gap: 7px; margin-top: 12px; border: 1px dashed #e2ded1; border-radius: 15px; color: #5c6a84; background: #fffdf7; font-size: 11.5px; font-weight: 800; cursor: pointer; }
    .welcome-demo:hover { border-color: #b9c4ea; background: #f8f9ff; }
    .welcome-actions .demo-footnote { margin: 11px 2px 0; color: #737b8a; font-size: 10px; line-height: 1.5; text-align: center; }
    .auth-card { padding: 20px; }
    .auth-card .eyebrow { margin-bottom: 8px; color: var(--blue); }
    .auth-card h1 { margin-bottom: 8px; font-size: 25px; }
    .auth-intro { margin-bottom: 17px; color: var(--muted); font-size: 13px; line-height: 1.55; }
    .auth-form { display: grid; gap: 12px; }
    .field { display: grid; gap: 6px; }
    .field label { font-size: 11px; font-weight: 800; }
    .field input, .field select { width: 100%; min-height: 48px; padding: 0 13px; border: 1.5px solid #e5e6e6; border-radius: 14px; outline: none; color: var(--ink); background: white; font-size: 13px; }
    .field input:focus, .field select:focus { border-color: #7188e5; box-shadow: 0 0 0 3px #7188e526; }
    .field input[aria-invalid="true"] { border-color: #d66c59; }
    .field-hint { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
    .field-error { min-height: 14px; margin: 0; color: #a74335; font-size: 10px; font-weight: 700; }
    .password-wrap { position: relative; }
    .password-wrap input { padding-right: 59px; }
    .show-password { position: absolute; top: 5px; right: 5px; min-width: 50px; height: 38px; border: 0; border-radius: 10px; color: var(--blue-deep); background: #f0f2ff; font-size: 10px; font-weight: 800; cursor: pointer; }
    .form-link-row { display: flex; justify-content: flex-end; margin-top: -5px; }
    .auth-link { min-height: 36px; padding: 7px 3px; border: 0; color: var(--blue-deep); background: transparent; font-size: 11px; font-weight: 800; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
    .auth-switch .auth-link { display: inline; min-height: 0; padding: 0 2px; }
    .auth-switch { margin: 14px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
    .auth-switch button { color: var(--blue-deep); }
    .auth-note { display: flex; gap: 9px; margin: 13px 0; padding: 11px 12px; border: 1px solid #e6eaff; border-radius: 14px; color: #59647d; background: #f1f3ff; font-size: 10px; line-height: 1.5; }
    .auth-note span:first-child { font-size: 16px; }
    .consent { display: flex; align-items: flex-start; gap: 9px; margin: 1px 0; color: #59647d; font-size: 10px; line-height: 1.5; }
    .consent input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--blue); }
    .grade-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
    .grade-option { position: relative; }
    .grade-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
    .grade-option label { display: grid; min-height: 58px; place-items: center; border: 1.5px solid #e5e6e6; border-radius: 15px; background: white; font-size: 13px; font-weight: 800; cursor: pointer; }
    .grade-option input:checked + label { border-color: var(--blue); color: var(--blue-deep); background: #edf0ff; box-shadow: 0 0 0 3px #7188e522; }
    .grade-option input:focus-visible + label { outline: 3px solid #f2b45c; outline-offset: 3px; }
    .demo-footnote { margin: 13px 0 0; color: #858c98; font-size: 9px; line-height: 1.5; text-align: center; }
    .auth-back { display: inline-flex; align-items: center; gap: 5px; min-height: 38px; margin: -2px 0 12px; padding: 5px 2px; border: 0; color: #59647d; background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
    .auth-success { display: none; margin: 0; padding: 11px 12px; border: 1px solid #cbe4ce; border-radius: 13px; color: #356944; background: #eff8ef; font-size: 11px; line-height: 1.5; }
    .auth-success.show { display: block; }
    .auth-divider { display: flex; align-items: center; gap: 10px; margin: 15px 0; color: #8c92a0; font-size: 10px; }
    .auth-divider:before, .auth-divider:after { height: 1px; flex: 1; background: #eeede8; content: ""; }
    .auth-light-button { width: 100%; min-height: 46px; border: 1px solid #e6e7e7; border-radius: 15px; background: #fffefa; font-size: 12px; font-weight: 800; cursor: pointer; }
    .auth-light-button:hover { border-color: #b7c2ef; background: #f8f9ff; }
    .app.auth-mode button:focus-visible { outline: 3px solid #f2b45c; outline-offset: 3px; }
    @media (max-width: 360px) { .auth-card { padding: 17px; } .welcome-title { font-size: 30px; } .hero-card { right: 12px; width: 146px; } }
    /* Portrait-only: the app always renders at phone width, and asks for portrait on sideways phones */
    .rotate-hint { display: none; }
    @media (orientation: landscape) and (max-height: 540px) {
      body { overflow: hidden; }
      .rotate-hint { position: fixed; z-index: 60; inset: 0; display: grid; align-content: center; justify-items: center; gap: 13px; padding: 24px; overflow-y: auto; background: radial-gradient(700px 380px at 50% 0%, #e9eeff 0, transparent 62%), #f7f5ef; text-align: center; }
      .rotate-hint .rotate-mark { display: grid; width: 54px; height: 54px; place-items: center; border: 1px solid #e5e1d5; border-radius: 18px; color: #4266d5; background: #fffefa; box-shadow: 0 10px 22px #2b365314; animation: rotate-nudge 2.6s ease-in-out infinite; }
      .rotate-hint h2 { margin: 0; font-size: 21px; letter-spacing: -.8px; }
      .rotate-hint p { max-width: 40ch; margin: 0; color: #6a7283; font-size: 12.5px; line-height: 1.55; }
    }
    @keyframes rotate-nudge { 0%, 40%, 100% { transform: rotate(0); } 56%, 86% { transform: rotate(-90deg); } }
    html[data-theme="dark"] .rotate-hint { background: radial-gradient(700px 380px at 50% 0%, #1b2340 0, transparent 62%), #0f1420; }
    html[data-theme="dark"] .rotate-hint .rotate-mark { border-color: #2b3447; background: #1b2233; color: #b3c4ff; }
    html[data-theme="dark"] .rotate-hint p { color: #a7b1c5; }
    /* Onboarding tour */
    .app.auth-mode.tour-mode { padding-bottom: 0; }
    .app.auth-mode.tour-mode main { padding: 0; }
    .app.tour-mode .auth-view { max-width: none; }
    .onboarding { min-height: inherit; overflow-y: auto; overscroll-behavior: contain; }
    .onboard-shell { display: flex; min-height: inherit; flex-direction: column; gap: 14px; padding: calc(14px + env(safe-area-inset-top)) 20px calc(12px + env(safe-area-inset-bottom)); }
    .onboard-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .onboard-brand { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 850; letter-spacing: -.5px; }
    .onboard-brand .logo { width: 30px; height: 30px; }
    .onboard-skip { padding: 9px 14px; border: 1px solid #e5e1d5; border-radius: 12px; background: #fffefa; color: #5c6780; font-size: 11px; font-weight: 800; cursor: pointer; transition: background .16s, border-color .16s; }
    .onboard-skip:hover { border-color: #cfd6ea; background: #fff; }
    .onboard-track { position: relative; display: grid; flex: 1; min-height: 0; touch-action: pan-y; }
    .onboard-slide { display: none; min-height: 0; align-content: center; grid-template-rows: auto auto; gap: 18px; }
    .onboard-slide.is-active { display: grid; animation: onboard-in .46s cubic-bezier(.22, 1, .36, 1); }
    @keyframes onboard-in { from { opacity: 0; transform: translateY(10px); } }
    .onboard-art { position: relative; min-height: 190px; max-height: 50svh; overflow: hidden; border-radius: 26px; background: #eef1f7; aspect-ratio: 4 / 5; }
    .onboard-copy { padding: 0 3px; }
    .onboard-step { margin: 0 0 7px; color: #4b69d1; font-size: 9.5px; font-weight: 850; letter-spacing: 1.4px; text-transform: uppercase; }
    .onboard-title { margin: 0 0 7px; font-size: clamp(28px, 7.6vw, 35px); line-height: 1.04; letter-spacing: -1.25px; }
    .onboard-title:focus { outline: none; }
    .onboard-title:focus-visible { border-radius: 6px; outline: 3px solid #f2b45c; outline-offset: 4px; }
    .onboard-lede { margin: 0; color: #6a7283; font-size: 13px; line-height: 1.55; }
    .onboard-foot { display: grid; gap: 12px; }
    .onboard-dots { display: flex; align-items: center; gap: 2px; }
    .onboard-dot { position: relative; width: 24px; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer; }
    .onboard-dot::after { position: absolute; top: 50%; left: 50%; width: 7px; height: 7px; border-radius: 99px; background: #d5d2c6; content: ""; transform: translate(-50%, -50%); transition: width .25s ease, background .25s ease; }
    .onboard-dot:hover::after { background: #b9c2d8; }
    .onboard-dot[aria-current="true"]::after { width: 24px; background: var(--blue); }
    .onboard-actions { display: flex; align-items: center; gap: 9px; }
    .onboard-back { display: grid; width: 48px; height: 48px; flex: none; place-items: center; border: 1px solid #e5e1d4; border-radius: 15px; background: #fffefa; color: #5c6780; cursor: pointer; }
    .onboard-back:hover { border-color: #cfd6ea; background: #fff; }
    .onboard-back[hidden] { display: none; }
    .onboard-next { flex: 1; min-height: 48px; justify-content: space-between; padding: 0 9px 0 18px; border-radius: 15px; font-size: 13px; background: linear-gradient(150deg, #5a78e4, #2a4bb0); box-shadow: 0 12px 22px #4266d536; }
    .onboard-next .button-arrow { width: 31px; height: 31px; background: #ffffff2b; }

    .art-learn { display: flex; align-items: center; justify-content: center; background: linear-gradient(155deg, #e6ecff, #e9e2ff 52%, #ffe7c8); }
    .art-learn-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; }
    .art-learn::after { position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px #ffffff5c; content: ""; pointer-events: none; }
    .art-chip { position: absolute; bottom: 12px; left: 12px; width: min(258px, calc(100% - 24px)); padding: 10px 12px; border: 1px solid #fff; border-radius: 16px; background: #fffdf8f0; box-shadow: 0 12px 24px #17233c29; backdrop-filter: blur(8px); }
    .art-chip .eyebrow { margin-bottom: 5px; color: #4b69d1; font-size: 8.5px; }
    .art-chip strong { display: block; margin-top: 6px; font-size: 12.5px; letter-spacing: -.2px; }
    .art-chip-meta { display: block; margin-top: 2px; color: #7a8291; font-size: 9.5px; }

    .art-voice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: radial-gradient(220px 200px at 50% 4%, #4f6fd8 0, transparent 72%), linear-gradient(160deg, #1d2c5e, #24408f 58%, #2a4bb0); }
    .voice-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
    .voice-stage::before, .voice-stage::after { position: absolute; left: 50%; border: 1px solid #ffffff26; border-radius: 50%; content: ""; transform: translateX(-50%); }
    .voice-stage::before { top: -24px; width: 136px; height: 136px; }
    .voice-stage::after { top: -48px; width: 204px; height: 204px; border-color: #ffffff14; }
    .voice-core { z-index: 1; display: grid; width: 56px; height: 56px; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(150deg, #6c87ea, #3155c0); box-shadow: 0 0 0 8px #ffffff14, 0 14px 26px #0b1330a6; }
    .voice-wave { z-index: 1; display: flex; height: 26px; align-items: center; gap: 3px; }
    .voice-wave i { width: 3px; height: 8px; border-radius: 3px; background: #a9bcfb; animation: onboard-wave 1.5s ease-in-out infinite; }
    .voice-wave i:nth-child(1) { height: 8px; animation-delay: -.2s; }
    .voice-wave i:nth-child(2) { height: 14px; animation-delay: -.4s; }
    .voice-wave i:nth-child(3) { height: 20px; animation-delay: -.1s; }
    .voice-wave i:nth-child(4) { height: 26px; animation-delay: -.3s; }
    .voice-wave i:nth-child(5) { height: 18px; animation-delay: -.5s; }
    .voice-wave i:nth-child(6) { height: 24px; animation-delay: -.15s; }
    .voice-wave i:nth-child(7) { height: 12px; animation-delay: -.35s; }
    .voice-wave i:nth-child(8) { height: 16px; animation-delay: -.25s; }
    .voice-wave i:nth-child(9) { height: 8px; animation-delay: -.45s; }
    @keyframes onboard-wave { 50% { transform: scaleY(.45); opacity: .65; } }
    .art-bubble { position: relative; max-width: 252px; padding: 10px 12px; border-radius: 14px; font-size: 11px; line-height: 1.45; }
    .art-question { align-self: flex-end; border: 1px solid #ffffff30; border-bottom-right-radius: 4px; color: #e8eeff; background: #ffffff1c; }
    .art-answer { display: flex; align-items: center; gap: 8px; align-self: flex-start; border-bottom-left-radius: 4px; color: #3d4759; background: #fffdf8; box-shadow: 0 10px 20px #0b133052; }
    .art-answer .mini-pie { width: 26px; height: 26px; border-color: #fff; }

    .art-trust { display: grid; place-items: center; padding: 18px; background: linear-gradient(155deg, #f6efdf, #efe6d2 58%, #e9eefc); }
    .art-trust::before, .art-trust::after { position: absolute; border-radius: 50%; content: ""; filter: blur(10px); }
    .art-trust::before { right: -70px; bottom: -78px; width: 226px; height: 226px; background: #ffd9a0; opacity: .5; }
    .art-trust::after { top: -80px; left: -64px; width: 210px; height: 210px; background: #c9d6ff; opacity: .55; }
    .trust-card { position: relative; z-index: 1; width: min(282px, 100%); padding: 16px; border: 1px solid #fff; border-radius: 20px; background: #fffefaed; box-shadow: 0 16px 32px #34446c1f; }
    .trust-logo { display: block; width: 36px; height: 36px; margin-bottom: 9px; }
    .trust-card strong { display: block; margin-bottom: 9px; font-size: 13.5px; letter-spacing: -.25px; }
    .trust-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
    .trust-list li { display: flex; align-items: center; gap: 8px; color: #4c576d; font-size: 11px; font-weight: 700; }
    .trust-list svg { flex: none; color: #4266d5; }
    .trust-note { margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed #e7e1d4; color: #7f8797; font-size: 9.5px; }
    .trust-stamp { position: absolute; z-index: 1; top: 13px; right: 13px; padding: 6px 9px; border-radius: 9px; color: #8a5a17; background: #fff6e3; font-size: 8.5px; font-weight: 850; letter-spacing: 1.2px; }
    .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }


    html[data-theme="dark"] .onboard-skip { border-color: #2b3447; background: #1b2233; color: #c3ccdd; }
    html[data-theme="dark"] .onboard-skip:hover { border-color: #3a4560; background: #232c40; }
    html[data-theme="dark"] .onboard-step { color: #b3c4ff; }
    html[data-theme="dark"] .onboard-lede { color: #a7b1c5; }
    html[data-theme="dark"] .onboard-back { border-color: #2b3447; background: #1b2233; color: #c3ccdd; }
    html[data-theme="dark"] .onboard-back:hover { border-color: #3a4560; background: #232c40; }
    html[data-theme="dark"] .onboard-dot::after { background: #3a4258; }
    html[data-theme="dark"] .onboard-dot:hover::after { background: #5b6ea8; }
    html[data-theme="dark"] .onboard-dot[aria-current="true"]::after { background: #b3c4ff; }
    html[data-theme="dark"] .art-learn { background: #1b2233; }
    html[data-theme="dark"] .art-trust { background: linear-gradient(155deg, #1c2438, #292318 58%, #1b2340); }
    html[data-theme="dark"] .art-trust::before { background: #7a5320; opacity: .38; }
    html[data-theme="dark"] .art-trust::after { background: #2b3f78; opacity: .5; }
    html[data-theme="dark"] .trust-card { border-color: #333d52; background: #1b2233f0; }
    html[data-theme="dark"] .trust-list li { color: #b3bdd2; }
    html[data-theme="dark"] .trust-list svg { color: #b3c4ff; }
    html[data-theme="dark"] .trust-note { border-color: #3a4258; color: #8b95a9; }
    html[data-theme="dark"] .trust-stamp { color: #f0c17e; background: #33281a; }
    html[data-theme="dark"] .art-chip { border-color: #333d52; background: #1b2233eb; box-shadow: 0 12px 24px #0006; }
    html[data-theme="dark"] .art-chip .eyebrow { color: #b3c4ff; }
    html[data-theme="dark"] .art-chip-meta { color: #a0aabd; }
    html[data-theme="dark"] .art-answer { border-color: #333d52; background: #1b2233; color: #dfe6f5; box-shadow: 0 10px 20px #0006; }

    /* Dark theme */
    html[data-theme="dark"] { color-scheme: dark; --ink: #e9edf7; --muted: #98a2b6; --blue: #8ba3f4; --blue-deep: #b3c4ff; --blue-pale: #232c48; --paper: #1b2233; --canvas: #121826; --line: #2b3447; --shadow: 0 12px 32px rgba(0, 0, 0, .38); --green: #223425; --green-ink: #a4d8ad; }
    html[data-theme="dark"] body { background: radial-gradient(ellipse at 15% 5%, #1a2340 0, transparent 40%), radial-gradient(ellipse at 88% 83%, #2b2218 0, transparent 36%), #0b101a; }
    html[data-theme="dark"] .app { box-shadow: 0 0 70px rgba(0, 0, 0, .55); }
    html[data-theme="dark"] .brand-mark { box-shadow: 0 5px 11px #0006; }
    html[data-theme="dark"] .profile { border-color: #2b3447; background: #1b2233; }
    html[data-theme="dark"] .menu-trigger { border-color: #2b3447; background: #1b2233; color: #c3ccdd; }
    html[data-theme="dark"] .menu-trigger:hover { border-color: #3a4560; background: #222b3f; }
    html[data-theme="dark"] .streak { border-color: #4a3a22; background: #2c2417; color: #f2c98b; }
    html[data-theme="dark"] .week-icon { background: #332817; }
    html[data-theme="dark"] .day-dot { background: #252e42; color: #98a2b6; }
    html[data-theme="dark"] .day-dot.done { background: #3f7a4f; color: #eaf7ec; }
    html[data-theme="dark"] .lesson-art { background: #20283a; }
    html[data-theme="dark"] .art-label { background: #1b2233eb; color: #d6deee; }
    html[data-theme="dark"] .lesson-kicker span:last-child { color: #97a1b6; }
    html[data-theme="dark"] .subject { border-color: #2b3447; }
    html[data-theme="dark"] .subject:nth-child(1) .subject-icon { background: #3a2c18; }
    html[data-theme="dark"] .subject:nth-child(2) .subject-icon { background: #223425; }
    html[data-theme="dark"] .subject:nth-child(3) .subject-icon { background: #2c2545; }
    html[data-theme="dark"] .subject:nth-child(4) .subject-icon { background: #1d2f45; }
    html[data-theme="dark"] .subject:nth-child(5) .subject-icon { background: #3a2229; }
    html[data-theme="dark"] .subject:nth-child(6) .subject-icon { background: #1f3733; }
    html[data-theme="dark"] .ask-card { border-color: #2b3552; background: #1d2540; }
    html[data-theme="dark"] .ask-copy span { color: #a6b0c6; }
    html[data-theme="dark"] .round-arrow { background: #26314f; color: #b3c4ff; }
    html[data-theme="dark"] .bottom-nav { border-color: #2a3346; background: #131a28f2; }
    html[data-theme="dark"] .nav-btn { color: #8d97ab; }
    html[data-theme="dark"] .nav-btn.active { background: #232c48; color: #b3c4ff; }
    html[data-theme="dark"] .view-title p { color: #98a2b6; }
    html[data-theme="dark"] .tutor-progress { background: #2a3346; }
    html[data-theme="dark"] .diagram { background: #1e2637; }
    html[data-theme="dark"] .diagram-circle { border-color: #2f3a52; }
    html[data-theme="dark"] .diagram-circle.half { background: conic-gradient(#f4b455 0 50%, #1e2637 50%); }
    html[data-theme="dark"] .diagram-circle.fourths { background: conic-gradient(#8ba3f4 0 25%, #1e2637 25% 50%, #8ba3f4 50% 75%, #1e2637 75%); }
    html[data-theme="dark"] .diagram-equals { color: #9fb0d6; }
    html[data-theme="dark"] .tutor-text { color: #b3bdd2; }
    html[data-theme="dark"] .coach-note { background: #33281a; color: #e2cba6; }
    html[data-theme="dark"] .practice-card .eyebrow { color: #e0ae6f; }
    html[data-theme="dark"] .answer { border-color: #333d52; background: #1b2233; color: var(--ink); }
    html[data-theme="dark"] .answer:hover { border-color: #5b6ea8; background: #222b41; }
    html[data-theme="dark"] .answer.correct { border-color: #4d8a5c; background: #1c3325; color: #a8e0b1; }
    html[data-theme="dark"] .answer.incorrect { border-color: #a05a4e; background: #3a2320; color: #f0b3a7; }
    html[data-theme="dark"] .voice-panel { border-color: #2b3552; background: #1b2340; }
    html[data-theme="dark"] .voice-copy span, html[data-theme="dark"] .divider { color: #98a3b9; }
    html[data-theme="dark"] .divider:before, html[data-theme="dark"] .divider:after { background: #2f3a56; }
    html[data-theme="dark"] .ask-form input { border-color: #333d52; background: #161d2c; color: var(--ink); }
    html[data-theme="dark"] .ask-form input::placeholder { color: #7e889c; }
    html[data-theme="dark"] .voice-reply { background: #161d2c; color: #c2ccdf; }
    html[data-theme="dark"] .stat-icon { background: #232c48; }
    html[data-theme="dark"] .stat-card:nth-child(2) .stat-icon { background: #332817; }
    html[data-theme="dark"] .stat-card:nth-child(3) .stat-icon { background: #223425; }
    html[data-theme="dark"] .stat-card:nth-child(4) .stat-icon { background: #2c2545; }
    html[data-theme="dark"] .bar { background: #2a3552; }
    html[data-theme="dark"] .bar-day { color: #8d97ab; }
    html[data-theme="dark"] .topic-track { background: #2a3346; }
    html[data-theme="dark"] .badge-card { border-color: #473a22; background: #2b2416; }
    html[data-theme="dark"] .badge-art { background: #3c3018; }
    html[data-theme="dark"] .badge-card span { color: #cbb894; }
    html[data-theme="dark"] .toast { background: #2c3654; }
    html[data-theme="dark"] .drawer-scrim.open { opacity: .62; }
    html[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #171f30 0%, #131a28 64%, #111726 100%); box-shadow: 24px 0 60px #0007, inset -1px 0 0 #2b3447; }
    html[data-theme="dark"] .sidebar-top { border-color: #2a3346; }
    html[data-theme="dark"] .sidebar-learner p { color: #98a2b6; }
    html[data-theme="dark"] .sidebar-close { border-color: #2b3447; background: #1b2233; color: #c3ccdd; }
    html[data-theme="dark"] .sidebar-close:hover { border-color: #3a4560; background: #232c40; }
    html[data-theme="dark"] .sidebar-next { border-color: #2f3a58; background: linear-gradient(150deg, #232c4a, #252b4a 58%, #332b22); }
    html[data-theme="dark"] .sidebar-next .eyebrow { color: #b3c4ff; }
    html[data-theme="dark"] .sidebar-next > span { color: #a6b0c6; }
    html[data-theme="dark"] .sidebar-label { color: #7f8a9f; }
    html[data-theme="dark"] .sidebar-link:hover, html[data-theme="dark"] .theme-toggle:hover { background: #202a3e; }
    html[data-theme="dark"] .sidebar-link.active { background: #232c48; }
    html[data-theme="dark"] .sidebar-icon { border-color: #2b3447; background: #1b2233; color: #b6c1d6; }
    html[data-theme="dark"] .sidebar-link.active .sidebar-icon { border-color: #3a4560; background: #2b3552; color: #b3c4ff; box-shadow: none; }
    html[data-theme="dark"] .sidebar-link small, html[data-theme="dark"] .theme-copy small { color: #98a2b6; }
    html[data-theme="dark"] .sidebar-link .chev { color: #6d7a90; }
    html[data-theme="dark"] .sidebar-link.active strong { color: #b9c9ff; }
    html[data-theme="dark"] .sidebar-note { color: #8b95a9; }
    html[data-theme="dark"] .sidebar-settings { border-color: #2a3346; }
    html[data-theme="dark"] .theme-toggle .switch { background: #333d52; }
    html[data-theme="dark"] .theme-toggle[aria-checked="true"] .switch { background: linear-gradient(150deg, #5a78e4, #2a4bb0); }
    html[data-theme="dark"] .theme-toggle[aria-checked="true"] .theme-icon { border-color: #3a4560; background: #2b3552; color: #b3c4ff; }
    html[data-theme="dark"] .sidebar-logout:hover { background: #33221f; }
    html[data-theme="dark"] .sidebar-logout:hover .sidebar-icon { border-color: #5a3a34; background: #2b1f1d; color: #f0a294; }
    html[data-theme="dark"] .sidebar-logout:hover strong { color: #f0a294; }
    html[data-theme="dark"] .sidebar-foot { border-color: #2a3346; color: #7f8a9f; }
    html[data-theme="dark"] .app.auth-mode { background: radial-gradient(900px 520px at 10% 0%, #1b2340 0, transparent 60%), radial-gradient(760px 460px at 92% 100%, #2f2519 0, transparent 62%), #0f1420; }
    html[data-theme="dark"] .brand-ai { color: #b3c4ff; }
    html[data-theme="dark"] .welcome-eyebrow { color: #b3c4ff; }
    html[data-theme="dark"] .welcome-lede, html[data-theme="dark"] .welcome-proof span:last-child { color: #a7b1c5; }
    html[data-theme="dark"] .proof-icon { border-color: #2b3447; background: #1b2233; }
    html[data-theme="dark"] .welcome-panel { border-color: #2b3447; background: #1b2233b3; box-shadow: 0 34px 80px #0007; }
    html[data-theme="dark"] .hero-card { border-color: #333d52; background: #1b2233eb; }
    html[data-theme="dark"] .hero-card-head span:last-child, html[data-theme="dark"] .hero-card p { color: #a0aabd; }
    html[data-theme="dark"] .fraction-eq { color: #dbe3f6; }
    html[data-theme="dark"] .mini-pie { border-color: #333d52; background: conic-gradient(#ffbd69 0 50%, #1b2233 50%); }
    html[data-theme="dark"] .mini-pie.quarters { background: conic-gradient(#8ba3f4 0 25%, #1b2233 25% 50%, #8ba3f4 50% 75%, #1b2233 75%); }
    html[data-theme="dark"] .welcome-actions { border-color: #333d52; background: #1b2233; box-shadow: 0 18px 36px #0006; }
    html[data-theme="dark"] .welcome-divider { color: #98a2b6; }
    html[data-theme="dark"] .welcome-divider:before, html[data-theme="dark"] .welcome-divider:after { background: #2f3a56; }
    html[data-theme="dark"] .welcome-trust { color: #a7b1c5; }
    html[data-theme="dark"] .welcome-trust li + li:before { background: #47536b; }
    html[data-theme="dark"] .welcome-demo { border-color: #3a4560; background: #171e2c; color: #c3ccdd; }
    html[data-theme="dark"] .welcome-demo:hover { border-color: #566ba4; background: #1f2942; }
    html[data-theme="dark"] .welcome-actions .demo-footnote { color: #939db1; }
    html[data-theme="dark"] .auth-note { border-color: #2b3552; background: #1d2540; color: #b3bdd2; }
    html[data-theme="dark"] .consent { color: #b3bdd2; }
    html[data-theme="dark"] .field input, html[data-theme="dark"] .field select { border-color: #333d52; background: #161d2c; color: var(--ink); }
    html[data-theme="dark"] .field input::placeholder { color: #7e889c; }
    html[data-theme="dark"] .show-password { background: #232c48; color: #b9c9ff; }
    html[data-theme="dark"] .grade-option label { border-color: #333d52; background: #1b2233; }
    html[data-theme="dark"] .grade-option input:checked + label { border-color: #7188e5; background: #232c48; color: #c8d5ff; }
    html[data-theme="dark"] .auth-light-button { border-color: #333d52; background: #1b2233; }
    html[data-theme="dark"] .auth-light-button:hover { border-color: #566ba4; background: #202a3e; }
    html[data-theme="dark"] .auth-success { border-color: #3a5c43; background: #1c3325; color: #a8e0b1; }
    html[data-theme="dark"] .auth-divider { color: #98a2b6; }
    html[data-theme="dark"] .auth-divider:before, html[data-theme="dark"] .auth-divider:after { background: #2f3a56; }
    html[data-theme="dark"] .demo-footnote { color: #8b95a9; }
    html[data-theme="dark"] .auth-back { color: #b3bdd2; }
    html[data-theme="dark"] .auth-link, html[data-theme="dark"] .auth-switch button { color: #b9c9ff; }
    html[data-theme="dark"] .field-error { color: #f0a294; }
    html[data-theme="dark"] .auth-success { border-color: #3f6a48; background: #1c3325; color: #a8e0b1; }
    @media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }

/* ==========================================================================
   Lesson runner (Phase 1): narration, practice, hints, consent sheet
   ========================================================================== */
:root { --pie-empty: #fffefa; }
html[data-theme="dark"] { --pie-empty: #1e2637; }

.narration { margin-top: 14px; }
.narration-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.narration-btn { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; padding: 0 14px; border: 1px solid #dfe4f4; border-radius: 14px; color: #2f52c0; background: #f3f5ff; font-size: 12px; font-weight: 800; cursor: pointer; }
.narration-btn:hover { border-color: #b9c4ea; background: #eaefff; }
.speed-group { display: flex; gap: 4px; margin-left: auto; padding: 3px; border-radius: 12px; background: #f1f1ee; }
.speed-btn { min-height: 34px; padding: 0 9px; border: 0; border-radius: 9px; color: #6f7787; background: transparent; font-size: 10.5px; font-weight: 800; cursor: pointer; }
.speed-btn.active { color: #2f52c0; background: #fff; box-shadow: 0 2px 6px #2b365314; }
.narration-text { margin: 10px 0 0; color: #5a6478; font-size: 13px; line-height: 1.65; }
.narration-text .say.is-reading { border-radius: 4px; background: #fff2d2; box-shadow: 0 0 0 3px #fff2d2; }

.answers-two { grid-template-columns: repeat(2, 1fr); }
.answer:disabled { cursor: default; }
.answer:disabled:hover { border-color: #e7e8ec; background: white; }
.answer.correct:disabled:hover { border-color: #77b783; background: #ebf7eb; }
.answer.incorrect:disabled:hover { border-color: #efa596; background: #fff0ed; }

.hint-card { display: flex; align-items: flex-start; gap: 9px; margin-top: 11px; padding: 11px 12px; border-radius: 14px; color: #6a5334; background: #fff4e6; font-size: 12px; line-height: 1.5; }
.hint-card span:first-child { font-size: 17px; }

.voice-answer { display: flex; align-items: center; gap: 12px; margin-top: 13px; padding: 12px; border: 1px solid #e6eaff; border-radius: 17px; background: #f4f6ff; }
.voice-answer .mic-button { width: 44px; height: 44px; border-radius: 15px; }
.voice-copy { min-width: 0; flex: 1; }
.voice-copy strong { display: block; font-size: 12px; }
.voice-copy span { display: block; margin-top: 2px; color: #747d91; font-size: 10.5px; line-height: 1.4; }

.lesson-actions { display: grid; gap: 9px; margin-top: 15px; }
.ghost-btn { min-height: 46px; border: 1px dashed #dcdcd3; border-radius: 15px; color: #5c6a84; background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.ghost-btn:hover { border-color: #b9c4ea; color: #2f52c0; }

.watch-frame { position: relative; margin: 0 0 14px; overflow: hidden; border-radius: 18px; background: #e7e6e1; }
.watch-frame img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.watch-frame figcaption { padding: 9px 11px; color: #6a7283; background: #fffefa; font-size: 10.5px; line-height: 1.45; }

.mastery-pips { display: flex; gap: 7px; margin: 14px 0 4px; }
.mastery-pips span { width: 34px; height: 8px; border-radius: 99px; background: #e6e6e0; }
.mastery-pips span.on { background: linear-gradient(90deg, #6d87e5, #4c6ad6); }

.subjects .subject:disabled { cursor: default; opacity: .62; }
.subjects .subject:disabled:hover { transform: none; }

/* Consent sheet */
.sheet-scrim { position: fixed; z-index: 70; inset: 0; display: grid; align-items: end; justify-items: center; padding: 0; background: #16203acc; }
.sheet-scrim[hidden] { display: none; }
.sheet { width: min(100%, 480px); max-height: 88svh; overflow-y: auto; padding: 20px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--paper); box-shadow: 0 -24px 60px #0b101a55; animation: sheet-up .26s cubic-bezier(.22, 1, .36, 1); }
@keyframes sheet-up { from { transform: translateY(18px); opacity: .6; } }
.sheet .eyebrow { margin-bottom: 8px; color: var(--blue); }
.sheet h2 { margin-bottom: 8px; font-size: 20px; letter-spacing: -.5px; }
.sheet > p { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.sheet-options { display: grid; gap: 9px; }
.sheet-option { display: block; width: 100%; min-height: 62px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--paper); text-align: left; cursor: pointer; transition: border-color .16s, background .16s; }
.sheet-option:hover { border-color: #b9c4ea; background: #f8f9ff; }
.sheet-option[aria-checked="true"] { border-color: var(--blue); background: #edf0ff; }
.sheet-option[disabled] { cursor: not-allowed; opacity: .55; }
.sheet-option strong { display: block; margin-bottom: 3px; font-size: 13px; }
.sheet-option span { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.sheet-foot { margin: 14px 0 0; color: var(--muted); font-size: 10.5px; }

html[data-theme="dark"] .narration-btn { border-color: #2f3a56; color: #b9c9ff; background: #202a45; }
html[data-theme="dark"] .narration-btn:hover { border-color: #566ba4; background: #26314f; }
html[data-theme="dark"] .speed-group { background: #20283a; }
html[data-theme="dark"] .speed-btn { color: #98a2b6; }
html[data-theme="dark"] .speed-btn.active { color: #c8d5ff; background: #2c3552; box-shadow: none; }
html[data-theme="dark"] .narration-text { color: #b3bdd2; }
html[data-theme="dark"] .narration-text .say.is-reading { color: #f3e7c8; background: #3a3220; box-shadow: 0 0 0 3px #3a3220; }
html[data-theme="dark"] .hint-card { color: #e2cba6; background: #33281a; }
html[data-theme="dark"] .voice-answer { border-color: #2b3552; background: #1d2540; }
html[data-theme="dark"] .voice-copy span { color: #a6b0c6; }
html[data-theme="dark"] .ghost-btn { border-color: #3a4560; color: #c3ccdd; }
html[data-theme="dark"] .watch-frame { background: #20283a; }
html[data-theme="dark"] .watch-frame figcaption { color: #a7b1c5; background: #1b2233; }
html[data-theme="dark"] .mastery-pips span { background: #2a3346; }
html[data-theme="dark"] .sheet { background: #1b2233; box-shadow: 0 -24px 60px #0009; }
html[data-theme="dark"] .sheet-option { background: #1b2233; }
html[data-theme="dark"] .sheet-option:hover { background: #222b41; }
html[data-theme="dark"] .sheet-option[aria-checked="true"] { background: #232c48; }

/* Keep tap targets clear of the fixed bottom navigation when scrolled into view. */
.answer, .lesson-actions, .narration-btn, .mic-button, .sheet-option { scroll-margin-block: 110px; }

/* Phase 2 — lesson clips */
.watch-frame video { display: block; width: 100%; aspect-ratio: 4 / 5; background: #10141d; object-fit: cover; }
.watch-frame { background: #10141d; }
.transcript { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfaf6; }
.transcript summary { padding: 11px 13px; color: #4a5772; font-size: 11.5px; font-weight: 800; cursor: pointer; }
.transcript summary:focus-visible { outline: 3px solid #f2b45c; outline-offset: 2px; }
.transcript ol { margin: 0; padding: 0 14px 12px 30px; color: #5a6478; font-size: 12px; line-height: 1.6; }
.transcript li + li { margin-top: 5px; }
.watch-question[hidden] { display: none; }
.watch-question { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.watch-question .eyebrow { margin-bottom: 7px; color: #a66a23; }
.watch-question h2 { margin-bottom: 11px; font-size: 16px; }
html[data-theme="dark"] .transcript { border-color: #2b3447; background: #171e2c; }
html[data-theme="dark"] .transcript summary { color: #c3ccdd; }
html[data-theme="dark"] .transcript ol { color: #b3bdd2; }
html[data-theme="dark"] .watch-question { border-color: #2b3447; }
html[data-theme="dark"] .watch-question .eyebrow { color: #e0ae6f; }

/* Phase 3 — real accounts, account page, privacy */
.form-alert { display: none; margin: 0 0 10px; padding: 10px 12px; border: 1px solid #f0cfc7; border-radius: 12px; color: #8f3c2d; background: #fdf1ee; font-size: 11.5px; line-height: 1.5; }
.form-alert.show { display: block; }
.account-list { display: grid; gap: 0; margin: 4px 0 16px; padding: 0; }
.account-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.account-list > div:last-child { border-bottom: 0; }
.account-list dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.account-list dd { margin: 0; font-size: 12.5px; font-weight: 800; text-align: right; word-break: break-word; }
.auth-card .auth-light-button + .auth-light-button { margin-top: 9px; }
.button.danger { background: #b1473a; }
.button.danger:hover { background: #973a2f; box-shadow: 0 7px 15px #b1473a33; }
.privacy-heading { margin: 18px 0 6px; font-size: 13px; letter-spacing: -.1px; }
.privacy-list { display: grid; gap: 7px; margin: 0 0 6px; padding-left: 18px; color: #5a6478; font-size: 12px; line-height: 1.55; }
.privacy-list li::marker { color: #4266d5; }
.privacy-body { margin: 0 0 10px; color: #5a6478; font-size: 12px; line-height: 1.6; }
.privacy-body a { color: var(--blue-deep); font-weight: 700; }
html[data-theme="dark"] .form-alert { border-color: #6d3a31; color: #f0b3a7; background: #3a2320; }
html[data-theme="dark"] .privacy-list, html[data-theme="dark"] .privacy-body { color: #b3bdd2; }
html[data-theme="dark"] .account-list > div { border-color: #2b3447; }

/* Phase 4 — offline and install state. One slim line under the top bar; it is
   hidden whenever there is nothing to say, so it never changes the layout. */
.connection-strip { display: flex; align-items: center; gap: 9px; margin: 0 20px 2px; padding: 8px 11px; border: 1px solid #e6e2d6; border-radius: 14px; background: #fffdf7; font-size: 11px; line-height: 1.35; }
.connection-strip[hidden] { display: none; }
.connection-strip p { flex: 1; margin: 0; color: #6b5a3c; }
.connection-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; }
.connection-strip[data-tone="offline"] { border-color: #f0dfc2; background: #fff6e6; color: #a86a1c; }
.connection-strip[data-tone="offline"] p { color: #8d5c1a; }
.connection-strip[data-tone="pending"],
.connection-strip[data-tone="syncing"] { border-color: #dde5fb; background: #edf0ff; color: var(--blue); }
.connection-strip[data-tone="pending"] p,
.connection-strip[data-tone="syncing"] p { color: #33488f; }
.connection-strip[data-tone="syncing"] .connection-dot { animation: connection-pulse 1s ease-in-out infinite; }
.connection-sync { flex: none; padding: 6px 10px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 800; cursor: pointer; }
.connection-sync[hidden] { display: none; }
.connection-sync:focus-visible { outline: 3px solid #f2b45c; outline-offset: 2px; }
@keyframes connection-pulse { 50% { opacity: .25; } }
html[data-theme="dark"] .connection-strip[data-tone="offline"] { border-color: #5b4526; background: #33281a; }
html[data-theme="dark"] .connection-strip[data-tone="offline"] p,
html[data-theme="dark"] .connection-strip[data-tone="offline"] { color: #e9c894; }
html[data-theme="dark"] .connection-strip[data-tone="pending"],
html[data-theme="dark"] .connection-strip[data-tone="syncing"] { border-color: #33405e; background: #232c42; }
html[data-theme="dark"] .connection-strip[data-tone="pending"] p,
html[data-theme="dark"] .connection-strip[data-tone="syncing"] p { color: #c3cdea; }

/* Provider sign-in and the public policies. */
.oauth-stack { display: grid; gap: 9px; margin: 14px 0 0; }
.oauth-btn { display: flex; min-height: 48px; align-items: center; justify-content: center; gap: 9px; border: 1.5px solid #e3e4e4; border-radius: 15px; color: var(--ink); background: #fffefa; font-size: 12.5px; font-weight: 800; text-decoration: none; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.oauth-btn:hover { border-color: #b7c2ef; background: #f8f9ff; }
.oauth-btn[aria-disabled="true"] { color: #6f7787; background: #fbfaf5; }
.oauth-btn:focus-visible { outline: 3px solid #f2b45c; outline-offset: 3px; }
.oauth-mark { display: grid; width: 22px; height: 22px; flex: none; place-items: center; border-radius: 50%; background: #fff; }
.oauth-mark.apple { color: #10131a; background: transparent; }
.auth-divider { margin: 15px 0 13px; }
.legal-links { margin: 11px 0 0; color: #858c98; font-size: 9.5px; line-height: 1.5; text-align: center; }
.legal-link { padding: 2px; border: 0; color: var(--blue-deep); background: transparent; font-size: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.legal-card h2 { margin: 0 0 10px; font-size: 20px; letter-spacing: -.5px; }
.legal-card h3 { margin: 16px 0 5px; font-size: 12.5px; letter-spacing: -.1px; }
.legal-card p { margin: 0 0 9px; color: #5a6478; font-size: 12px; line-height: 1.6; }
.legal-card p a, .legal-card a { color: var(--blue-deep); font-weight: 700; }
.legal-list { display: grid; gap: 7px; margin: 0 0 9px; padding-left: 17px; color: #5a6478; font-size: 12px; line-height: 1.55; }
.legal-list li::marker { color: var(--blue); }
.legal-contents { display: grid; gap: 1px; margin: 4px 0 10px; }
.legal-contents a { padding: 7px 0; border-bottom: 1px solid #efeee7; color: var(--blue-deep); font-size: 11.5px; font-weight: 800; text-decoration: none; }
.legal-contents a:last-child { border-bottom: 0; }
.legal-contents a:hover { text-decoration: underline; text-underline-offset: 3px; }
.legal-meta { margin: 4px 0 0; color: #858c98; font-size: 9.5px; line-height: 1.5; }
html[data-theme="dark"] .oauth-btn { border-color: #2b3447; background: #1b2233; color: #e6ebf7; }
html[data-theme="dark"] .oauth-btn:hover { border-color: #3a4560; background: #232c40; }
html[data-theme="dark"] .oauth-btn[aria-disabled="true"] { color: #8b93a4; background: #161c2a; }
html[data-theme="dark"] .oauth-mark { background: #fff; }
html[data-theme="dark"] .oauth-mark.apple { color: #eef2fb; background: transparent; }
html[data-theme="dark"] .legal-card p, html[data-theme="dark"] .legal-card .legal-list { color: #b3bdd2; }
html[data-theme="dark"] .legal-list li::marker { color: #8fa6ff; }
html[data-theme="dark"] .legal-contents a { border-color: #2b3447; color: #b3c4ff; }
html[data-theme="dark"] .legal-links, html[data-theme="dark"] .legal-meta { color: #9aa3b4; }
html[data-theme="dark"] .legal-link { color: #b3c4ff; }
.oauth-form { margin: 0; }
.oauth-btn { width: 100%; }
.signup-consent { margin: 0 0 2px; }
.signup-consent + .field-error { margin: -4px 0 0; }
.welcome-oauth-stack { margin: 0; }
.welcome-actions .oauth-btn { min-height: 52px; border-radius: 17px; font-size: 13px; }

/* ---------------------------------------------------------- grown-up gate --- */
/* A small arithmetic question before the parent-only parts of the app. */
.gate { width: min(100% - 32px, 372px); padding: 0; border: 0; border-radius: 26px; background: var(--paper); color: var(--ink); box-shadow: 0 28px 70px rgba(21, 29, 48, .32); }
.gate::backdrop { background: rgba(15, 21, 34, .52); backdrop-filter: blur(3px); }
.gate-form { display: grid; gap: 9px; padding: 23px 22px 19px; }
.gate-form .eyebrow { margin: 0; }
.gate-form h2 { margin: 0; font-size: 21px; letter-spacing: -.6px; }
.gate-copy { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.gate-copy strong { color: var(--ink); font-weight: 800; }
.gate-question { display: block; margin: 7px 0 1px; font-size: 31px; font-weight: 850; letter-spacing: -1.2px; }
.gate input { width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 15px; background: #fff; color: var(--ink); font-size: 19px; font-weight: 750; letter-spacing: .5px; }
.gate input:focus-visible { border-color: var(--blue); outline: 3px solid #c3d2ff; outline-offset: 1px; }
.gate-error { min-height: 16px; margin: 0; color: #b0442c; font-size: 11.5px; font-weight: 750; }
.gate-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gate-actions .auth-light-button, .gate-actions .button { min-height: 46px; margin: 0; }
html[data-theme="dark"] .gate { background: #1b2233; color: #eef2fb; box-shadow: 0 28px 70px rgba(0, 0, 0, .55); }
html[data-theme="dark"] .gate-copy { color: #a7b1c5; }
html[data-theme="dark"] .gate-copy strong { color: #eef2fb; }
html[data-theme="dark"] .gate input { border-color: #2b3447; background: #141a27; color: #eef2fb; }
html[data-theme="dark"] .gate input:focus-visible { border-color: #8fa6ff; outline-color: #2b3f78; }
html[data-theme="dark"] .gate-error { color: #ff9f88; }

/* ------------------------------------------------ growth additions v20 --- */
/* Unit cards, the weekly goal, badges, learners, settings, offline packs and
   signed-in devices. Built from the same tokens as the rest of the app. */

.unit-list { display: grid; gap: 12px; }
.unit-card { display: grid; gap: 8px; padding: 18px 18px 16px; }
.unit-card h3 { margin: 0; font-size: 17px; letter-spacing: -.3px; }
.unit-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.unit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.unit-head .eyebrow { margin: 0; }
.unit-min { color: var(--muted); font-size: 11px; font-weight: 800; }
.unit-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.unit-foot small { color: var(--muted); font-size: 12px; font-weight: 700; }
.unit-foot .button { width: auto; padding: 10px 16px; font-size: 13px; }

.goal-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.goal-copy { display: grid; gap: 2px; }
.goal-copy .eyebrow { margin: 0 0 2px; }
.goal-copy strong { font-size: 15px; }
.goal-copy span { color: var(--muted); font-size: 12px; }
.goal-ring { display: grid; place-items: center; width: 62px; height: 62px; flex: none; border-radius: 50%; background: conic-gradient(var(--blue) calc(var(--pct, 0) * 1%), var(--line) 0); }
.goal-ring span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--paper); font-size: 12px; font-weight: 850; }
.goal-track { height: 10px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: var(--line); }
.goal-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #6f8bf0); }
.goal-line { margin: 8px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; }

.warmup-card { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border: 1px dashed var(--blue); background: var(--blue-pale); }
.warmup-icon { font-size: 21px; }
.warmup-copy { display: grid; gap: 2px; min-width: 0; }
.warmup-copy strong { font-size: 14px; }
.warmup-copy span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.warmup-card .button { width: auto; flex: none; padding: 10px 14px; font-size: 12px; }

.badge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.badge { display: grid; gap: 2px; padding: 14px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); text-align: center; opacity: .6; }
.badge.earned { opacity: 1; border-color: #d9e3ff; background: var(--blue-pale); }
.badge-art { font-size: 24px; }
.badge strong { font-size: 12px; }
.badge small { color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.topic-unit { color: var(--muted); font-weight: 600; }

.learner-list { display: grid; gap: 8px; margin: 8px 0 14px; padding: 0; list-style: none; }
.learner-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.learner-row.is-active { border-color: var(--blue); background: var(--blue-pale); }
.learner-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 850; }
.learner-copy { display: grid; gap: 1px; min-width: 0; }
.learner-copy strong { font-size: 14px; }
.learner-copy small { color: var(--muted); font-size: 11px; font-weight: 700; }
.learner-row .small-btn { margin-left: auto; }

.small-btn { padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 12px; font-weight: 800; cursor: pointer; }
.small-btn.quiet { color: var(--muted); }
.small-btn:disabled { opacity: .55; cursor: default; }
.tag { display: inline-block; margin-left: 4px; padding: 2px 7px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; vertical-align: 1px; }
.tag.warn { background: #b4451f; }
.inline-note { display: grid; gap: 8px; margin: 10px 0; padding: 12px 14px; border-radius: 14px; background: #fff6e6; border: 1px solid #f4e5ca; }
.inline-note p { margin: 0; font-size: 12.5px; line-height: 1.5; color: #7c5316; }
.account-heading { margin: 18px 0 4px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 800; }
.form.compact, .auth-form.compact { gap: 10px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting-row:first-of-type { border-top: 0; }
.setting-row span { display: grid; gap: 2px; }
.setting-row strong { font-size: 13.5px; }
.setting-row small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.switch-btn { min-width: 62px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 12px; font-weight: 800; cursor: pointer; }
.switch-btn[aria-pressed="true"] { border-color: var(--blue); background: var(--blue); color: #fff; }

.pack-list, .device-list { display: grid; gap: 8px; margin: 10px 0; }
.pack-row, .device-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.pack-copy, .device-copy { display: grid; gap: 1px; min-width: 0; }
.pack-copy strong, .device-copy strong { font-size: 13.5px; }
.pack-copy small, .device-copy small { color: var(--muted); font-size: 11px; font-weight: 700; }
.pack-row .small-btn { margin-left: auto; flex: none; }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); font-size: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; }
.auth-light-button.as-link { display: block; text-align: center; text-decoration: none; }

/* Reading and motion preferences, applied from the account screen. */
html[data-text="large"] .view p,
html[data-text="large"] .view small,
html[data-text="large"] .view li,
html[data-text="large"] .answer,
html[data-text="large"] .tutor-text,
html[data-text="large"] .nav-btn span,
html[data-text="large"] .sidebar-link strong,
html[data-text="large"] .sidebar-link small { font-size: 1.14em; line-height: 1.6; }
html[data-text="large"] .practice-card h2,
html[data-text="large"] .tutor-card h2 { font-size: 1.3em; }

html[data-readable="on"] body { letter-spacing: .02em; word-spacing: .14em; line-height: 1.72; }
html[data-readable="on"] .answer { line-height: 1.5; letter-spacing: .015em; }

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

html[data-theme="dark"] .goal-ring span,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .learner-row,
html[data-theme="dark"] .pack-row,
html[data-theme="dark"] .device-row,
html[data-theme="dark"] .small-btn,
html[data-theme="dark"] .switch-btn { background: #1d2436; }
html[data-theme="dark"] .badge.earned,
html[data-theme="dark"] .learner-row.is-active,
html[data-theme="dark"] .warmup-card { background: #1c2748; }
html[data-theme="dark"] .inline-note { background: #2c2417; border-color: #4a3a22; }
html[data-theme="dark"] .inline-note p { color: #f2c98b; }

/* ------------------------------------------------------------- phone only --- */

/* The app is a phone surface: portrait, thumb-sized, installed to a home screen.
   A wide screen gets this cover instead of a stretched phone column, with the
   two surfaces that are built for a desk. */
.phone-cover {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background:
    radial-gradient(760px 460px at 12% 0%, #e9eeff 0, transparent 58%),
    radial-gradient(620px 420px at 92% 100%, #ffe9d2 0, transparent 60%),
    var(--canvas);
}
.phone-cover[hidden] { display: none; }
html.phone-cover, html.phone-cover body { overflow: hidden; }
.phone-cover-inner {
  display: grid;
  width: min(446px, 100%);
  padding: 30px 28px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.phone-cover-mark { display: block; width: 54px; height: 54px; margin: 0 auto 18px; }
.phone-cover-mark svg { display: block; width: 100%; height: 100%; }
.phone-cover-title { margin: 8px 0 0; font-size: 27px; letter-spacing: -.9px; line-height: 1.12; }
.phone-cover-copy { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.phone-cover-actions { display: grid; gap: 9px; margin-top: 20px; }
.phone-cover-actions .ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.phone-cover-continue { margin-top: 14px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.phone-cover-continue:hover { color: var(--ink); }
