/* ===== styles/00-base.css ===== */
:root{
    --ink:#20345F; --ink-soft:#4C5F82; --ink-2:#182A50;
    --paper:#FAF9F6; --paper-raised:#FFFFFF; --line:#DED8CC;
    --app-bg-color:#FAF9F6;
    --app-bg:
      radial-gradient(circle at 12% 9%, rgba(219,229,255,.28) 0%, rgba(219,229,255,0) 34%),
      radial-gradient(circle at 88% 78%, rgba(255,226,216,.20) 0%, rgba(255,226,216,0) 35%),
      linear-gradient(180deg, #FCFBF8 0%, #F8F7F3 55%, #FBFAF7 100%);
    --stamp:#B85F4B; --stamp-soft:#F3DFD8;
    --sage:#5C7A5B; --sage-soft:#DFE7DB;
    --gold:#B98B25; --gold-soft:#F1E4C4;
    --text:#24304A; --text-muted:#706D66;
    --radius:16px;
    --shadow: 0 10px 35px rgba(15,23,42,0.06);
  }
  *{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
  html,body{margin:0; padding:0; height:100%; background:#E9E4D8;}
  body{
    font-family:'Inter',sans-serif; color:var(--text);
    display:flex; justify-content:center;
    min-height:100vh;
  }
  #phone{
    width:100%; max-width:430px; min-height:100vh;
    background-color:var(--app-bg-color);
    background-image:var(--app-bg);
    background-repeat:no-repeat;
    background-size:100% 100%;
    position:relative; overflow-x:hidden; isolation:isolate;
    box-shadow: var(--shadow);
    display:flex; flex-direction:column;
  }
  @media(min-width:460px){
    body{ padding:12px; align-items:flex-start; }
    #phone{ min-height:calc(100vh - 24px); border-radius:28px; margin:0 auto; }
  }
  main,.screen-enter{background:transparent;}
  h1,h2,h3,.display{font-family:'Fraunces',serif;}
  .mono{font-family:'IBM Plex Mono',monospace;}
  a{color:inherit;}
  ::-webkit-scrollbar{display:none;}

/* ===== styles/10-topbar.css ===== */
  /* ---------- top bar ---------- */
  .topbar{
    position:relative;
    display:flex; align-items:center; justify-content:space-between;
    padding:18px 20px 10px;
  }
  .my-account-wrap{position:relative;}
  .my-account-overlay{position:fixed; inset:0; z-index:59; background:transparent; border:none; padding:0;}
  .my-account-menu{
    position:absolute; top:100%; left:0; right:0; margin-top:4px; z-index:60;
    background:var(--paper-raised); border:1px solid var(--line); border-radius:12px;
    box-shadow:var(--shadow); padding:6px; display:flex; flex-direction:column;
    animation:screenFadeIn .15s ease both;
  }
  .my-account-menu-item{
    display:block; width:100%; text-align:left;
    background:none; border:none; padding:10px 12px; border-radius:8px; cursor:pointer;
    font-family:'Inter',sans-serif; font-size:13.5px; color:var(--ink); font-weight:500;
  }
  .my-account-menu-item:hover{background:var(--paper);}
  .topbar .brand{display:flex; align-items:center; gap:6px;}
  .brand-mark{height:28px; display:flex; align-items:center; flex-shrink:0;}
  .brand-mark img{height:100%; width:auto; display:block;}
  .brand-wordmark{height:20px; display:flex; align-items:center; flex-shrink:0;}
  .brand-wordmark img{height:100%; width:auto; display:block;}
  .topbar .role-chip, .topbar .role-toggle-chip{
    font-size:11px; text-transform:uppercase; letter-spacing:.06em; line-height:1;
    color:var(--ink-soft); background:var(--paper-raised); border:1px solid var(--line);
    padding:5px 10px; border-radius:999px; cursor:pointer;
    display:inline-flex; align-items:center; gap:3px;
  }
  .topbar .role-chip .chip-ic, .topbar .role-toggle-chip .chip-ic{width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; opacity:.72;}

  main{flex:1; padding:18px 20px 140px; overflow-y:auto;}
  .screen-enter{animation:screenFadeIn .28s ease both;}
  /* Re-renders on the card's back side (flip, hint toggles) don't re-fade the page. */
  .screen-enter.no-enter{animation:none;}
  @keyframes screenFadeIn{from{opacity:0;} to{opacity:1;}}
  @keyframes fadeUp{from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:translateY(0);}}

/* ===== styles/20-welcome-forms.css ===== */
  /* ---------- welcome ---------- */
  .welcome-hero{padding:135px 4px 12px; position:relative;}
  .welcome-hero .eyebrow{
    font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:.12em;
    color:var(--stamp); text-transform:uppercase; margin-bottom:10px;
  }
  .welcome-screen{position:relative;}
  .welcome-screen > .topbar, .welcome-screen > main{position:relative; z-index:1;}
  .welcome-banner{position:absolute; top:0; left:0; right:0; height:320px; z-index:0; overflow:hidden; pointer-events:none; user-select:none;}
  .app-backdrop{position:absolute; top:0; left:0; right:0; height:320px; z-index:-1; overflow:hidden; pointer-events:none; user-select:none;}
  .welcome-banner svg, .app-backdrop svg{display:block; position:absolute;}
  .welcome-banner .wb-bg, .app-backdrop .wb-bg{inset:0; width:100%; height:100%;}
  .welcome-banner .wb-art{top:0; right:0; width:min(400px, 100%); height:auto;}
  /* Units are the SVG's: its ring runs past the viewBox, so keep it inside the screen. */
  .app-backdrop .wb-art{top:12px; right:22px; width:160px; height:auto; overflow:visible; opacity:.4;}
  /* Blur melts the wave's edge; the overhang hides the blur fading at the sides. */
  .app-backdrop .wb-bg{inset:-30px -30px auto; width:calc(100% + 60px); height:230px; filter:blur(14px);}
  .welcome-hero h1{position:relative; z-index:1; font-size:32px; line-height:1.15; margin:0 0 26px; color:var(--ink); font-weight:700;}
  .welcome-hero h1 .accent{color:#2F6FE8;}
  .welcome-hero p{font-size:14.5px; color:var(--text-muted); line-height:1.55; margin:0 0 28px;}
  .google-icon-badge{
    width:26px; height:26px; border-radius:50%; background:#fff; flex-shrink:0;
    display:flex; align-items:center; justify-content:center; box-shadow:0 1px 3px rgba(15,23,42,.2);
  }
  .login-features{display:flex; margin-top:32px; align-items:flex-start;}
  .login-feature{flex:1; min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:6px; text-align:left; padding:0 9px; position:relative;}
  .login-feature:first-child{padding-left:0;}
  .login-feature:last-child{padding-right:0;}
  .login-feature:not(:last-child)::after{content:''; position:absolute; right:0; top:2px; bottom:2px; width:1px; background:var(--line);}
  .login-feature-header{display:flex; align-items:center; gap:8px;}
  .login-feature-icon-wrap{
    width:34px; height:34px; border-radius:10px; flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
  }
  .login-feature-blue{background:#EFF4FE; color:#1247E0;}
  .login-feature-green{background:var(--sage-soft); color:var(--sage);}
  .login-feature-gold{background:var(--gold-soft); color:#8A6A1C;}
  .login-feature h4{font-family:'Fraunces',serif; font-weight:700; font-size:12px; line-height:1.28; margin:0; color:var(--ink);}
  .login-feature p{font-size:10px; line-height:1.4; color:var(--text-muted); margin:0;}
  .login-bio-link{
    color:#2F6FE8; font-weight:600; text-decoration:underline; text-underline-offset:2px;
    display:inline-flex; align-items:center; gap:2px; white-space:nowrap;
  }
  .login-bio-link .login-bio-arrow{flex-shrink:0;}
  .role-cards{display:flex; flex-direction:column; gap:12px;}
  .role-card{
    background:var(--paper-raised); border:1px solid var(--line); border-radius:var(--radius);
    padding:18px 18px; display:flex; align-items:center; gap:14px; cursor:pointer;
    box-shadow:var(--shadow); transition:transform .15s ease;
  }
  .role-card:active{transform:scale(0.98);}
  .role-card .icon{
    width:44px; height:44px; border-radius:12px; flex-shrink:0;
    display:flex; align-items:center; justify-content:center; font-size:19px;
  }
  .role-card.teacher .icon{background:var(--ink); color:var(--paper);}
  .role-card.student .icon{background:var(--stamp); color:#fff;}
  .role-card h3{margin:0 0 3px; font-size:16px; color:var(--ink);}
  .role-card p{margin:0; font-size:12.5px; color:var(--text-muted);}
  .role-card .arrow{margin-left:auto; color:var(--text-muted); font-size:18px;}

  .auth-restore-note{
    display:flex; align-items:flex-start; gap:9px; margin-top:11px; padding:10px 12px;
    border:1px solid var(--line); border-radius:12px; background:var(--paper-raised);
    color:var(--text-muted); font-size:12.5px; line-height:1.45;
  }
  .auth-spinner{
    width:14px; height:14px; margin-top:2px; flex:0 0 14px; border-radius:50%;
    border:2px solid var(--line); border-top-color:var(--ink); animation:authSpin .8s linear infinite;
  }
  @keyframes authSpin{to{transform:rotate(360deg);}}

  /* ---------- forms ---------- */
  .field{margin-bottom:14px;}
  .field label{display:block; font-size:12px; color:var(--text-muted); margin-bottom:6px; font-weight:500;}
  .field input, .field textarea, .field select{
    width:100%; padding:12px 14px; border-radius:11px; border:1px solid var(--line);
    background:var(--paper-raised); font-family:'Inter',sans-serif; font-size:14.5px; color:var(--text);
  }
  .field textarea{min-height:110px; resize:vertical; line-height:1.5;}
  .field input:focus, .field textarea:focus, .field select:focus{outline:2px solid var(--ink); outline-offset:1px;}
  .btn{
    display:inline-flex; align-items:center; justify-content:center; gap:6px;
    padding:13px 18px; border-radius:11px; border:none; font-family:'Inter',sans-serif;
    font-weight:600; font-size:14.5px; cursor:pointer; width:100%;
  }
  .btn-primary{background:var(--ink); color:var(--paper);}
  .btn-primary:active{background:var(--ink-2);}
  .btn-stamp{background:var(--stamp); color:#fff;}
  .btn-accent{background:#2F6FE8; color:#fff;}
  .btn-ghost{background:transparent; color:var(--ink); border:1px solid var(--line);}
  .btn-sm{width:auto; padding:8px 14px; font-size:13px; border-radius:9px;}
  .btn:disabled{opacity:.45;}
  .error-note{color:var(--stamp); font-size:12.5px; margin:-6px 0 14px;}
  .back-link{
    display:inline-flex; align-items:center; gap:4px; font-size:13px; color:var(--text-muted);
    background:none; border:none; padding:0; margin-bottom:16px; cursor:pointer; font-family:'Inter',sans-serif;
  }

/* ===== styles/30-lessons.css ===== */
  /* ---------- section heads ---------- */
  .section-head{display:flex; align-items:baseline; justify-content:space-between; margin:22px 0 12px;}
  .section-head h2{font-size:18px; margin:0; color:var(--ink); font-weight:600;}
  .section-head .count{font-size:12px; color:var(--text-muted); font-family:'IBM Plex Mono',monospace;}
  .page-title{font-size:24px; color:var(--ink); font-weight:600; margin:4px 0 16px;}
  .page-sub{font-size:13px; color:var(--text-muted); margin:0 0 16px;}

  /* ---------- lesson list ---------- */
  .lesson-item{
    background:var(--paper-raised); border:1px solid var(--line); border-radius:14px;
    padding:14px 16px; margin-bottom:10px; cursor:pointer; box-shadow:var(--shadow);
  }
  .lesson-item .topic-tag{
    font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; font-family:'IBM Plex Mono',monospace;
    color:var(--ink-soft); background:#EDEAE0; padding:3px 8px; border-radius:999px; display:inline-block; margin-bottom:8px;
  }
  .lesson-item h3{margin:0 0 4px; font-size:15.5px; color:var(--ink);}
  .lesson-item .meta{font-size:12px; color:var(--text-muted); display:flex; gap:10px; align-items:center;}
  .due-badge{
    background:var(--stamp-soft); color:var(--stamp); font-size:11px; font-weight:600;
    padding:2px 8px; border-radius:999px; font-family:'IBM Plex Mono',monospace;
  }
  .new-badge{
    background:#E6EDFB; color:#2F6FE8; font-size:11px; font-weight:600;
    padding:2px 8px; border-radius:999px; font-family:'IBM Plex Mono',monospace;
  }
  .empty-state{
    text-align:center; padding:50px 14px; color:var(--text-muted);
  }
  .empty-state .stamp-mark{
    width:56px; height:56px; border-radius:50%; border:2px dashed var(--line); margin:0 auto 16px;
    display:flex; align-items:center; justify-content:center; font-size:22px; color:var(--line);
  }
  .empty-state p{font-size:13.5px; line-height:1.6; margin:0 0 18px;}

  /* ---------- lesson-list footer illustration ---------- */
  /* Keep the Lessons tab within the visible viewport. The artwork stays in
     normal flow, so long lesson lists can scroll without the image covering
     a lesson card. */
  .student-lessons-screen{
    height:100dvh;
    min-height:0;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }

  .student-lessons-screen > main{
    flex:1 1 auto;
    min-height:0;
    display:flex;
    flex-direction:column;
    overflow-y:auto;
    overscroll-behavior-y:contain;
    /* Clears the fixed bottom nav. */
    padding-bottom:calc(130px + env(safe-area-inset-bottom));
  }

  /* The desktop shell adds 12px body padding above and below. */
  @media (min-width:460px){
    .student-lessons-screen{
      height:calc(100dvh - 24px);
    }
  }

/* ===== styles/40-navigation.css ===== */
  /* ---------- bottom nav ---------- */
  .bottom-fixed-wrap{
    position:fixed; left:50%; transform:translateX(-50%); bottom:0;
    width:100%; max-width:430px; z-index:40;
  }
  .bottomnav{
    display:flex;
    background:rgba(255,255,255,.90);
    -webkit-backdrop-filter:blur(18px) saturate(135%);
    backdrop-filter:blur(18px) saturate(135%);
    border-top:1px solid rgba(32,52,95,.07);
    box-shadow:0 -10px 30px rgba(32,52,95,.045);
    padding:8px 8px calc(10px + env(safe-area-inset-bottom));
  }
  .navbtn{
    flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
    background:none; border:none; padding:6px 4px; cursor:pointer; color:var(--text-muted);
    font-family:'Inter',sans-serif; font-size:10.5px; font-weight:500; border-radius:14px;
    transition:background .15s, color .15s;
  }
  .navbtn .ic{width:20px; height:20px; opacity:.62; transition:opacity .15s; object-fit:contain; display:block;}
  .navbtn .ic:not(img){fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;}
  .navbtn.active{color:var(--ink); background:rgba(47,111,232,0.16); font-weight:700;}
  .navbtn.active .ic{opacity:1;}
  .fab{
    /* bottom is relative to .bottom-fixed-wrap, whose height equals .bottomnav's
       (this button is out of flow) — 100% clears the nav bar on any device,
       including tall safe-area-inset-bottom, instead of guessing a fixed px. */
    position:absolute; right:18px; bottom:calc(100% + 14px); z-index:1;
    width:52px; height:52px; border-radius:50%; background:#2F6FE8; color:#fff;
    border:none; font-size:24px; box-shadow:0 6px 18px rgba(47,111,232,0.4); cursor:pointer;
    display:flex; align-items:center; justify-content:center;
  }
  .fab-inline{
    width:64px; height:64px; border-radius:50%; background:#2F6FE8; color:#fff;
    border:none; font-size:30px; box-shadow:0 6px 18px rgba(47,111,232,0.4); cursor:pointer;
    display:flex; align-items:center; justify-content:center; margin:22px auto 0;
  }
  /* Laptop sidebar for non-tab screens; shown only by 110-desktop-landscape.css. */
  .side-nav-only, .bottom-fixed-wrap > .brand, .side-account{display:none;}

/* ===== styles/50-lesson-review.css ===== */
  /* ---------- lesson detail ---------- */
  .content-block{
    background:var(--paper-raised); border:1px solid var(--line); border-radius:14px;
    padding:16px 18px; font-size:14px; line-height:1.7; white-space:pre-wrap; color:var(--text);
    margin-bottom:16px;
  }
  .vocab-row{
    display:flex; justify-content:space-between; align-items:center;
    padding:11px 4px; border-bottom:1px solid var(--line); font-size:14px;
  }
  .vocab-row:last-child{border-bottom:none;}
  .vocab-row .w{font-weight:600; color:var(--ink);}
  .vocab-row .ipa{font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--text-muted); margin-left:6px;}

  .browse-vocab-row{justify-content:flex-start; gap:10px; min-width:0;}
  .browse-vocab-row .vocab-row-copy{display:flex; align-items:baseline; gap:2px; min-width:0;}
  .browse-vocab-row .vocab-row-copy .w{overflow-wrap:anywhere;}
  .browse-vocab-row .vocab-row-actions{margin-left:auto; display:flex; align-items:center; gap:4px; flex:0 0 auto;}
  .vocab-icon-btn{
    width:34px; height:34px; padding:0; border:0; border-radius:10px; background:transparent;
    color:var(--ink-soft); display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
    font-family:'Inter',sans-serif; font-size:16px; line-height:1; transition:background .15s ease, color .15s ease, transform .15s ease;
  }
  .vocab-icon-btn:hover{background:var(--paper); color:var(--ink);}
  .vocab-icon-btn:active{transform:scale(.94);}
  .vocab-card-btn svg{width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;}
  /* Clear the + button so it never covers the last row's icons. */
  .my-words-list{margin-bottom:48px;}

  /* ---------- flashcard ---------- */
  .review-progress{display:flex; align-items:center; gap:10px; margin-bottom:22px;}
  .review-bar{flex:1; height:5px; background:var(--line); border-radius:99px; overflow:hidden;}
  .review-bar-fill{height:100%; background:#2F6FE8; transition:width .25s ease;}
  .review-count{font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--text-muted);}
  /* Chained review: one dot per screen of the current word (Dictation / Flashcard / Shadowing). */
  .chain-steps{display:inline-flex; align-items:center; gap:5px; flex:none;}
  .chain-dot{width:7px; height:7px; border-radius:50%; background:var(--line); transition:background .2s ease;}
  .chain-dot.is-on{background:#2F6FE8;}

  .card-stage{perspective:1200px; margin-bottom:22px;}
  .flashcard{
    position:relative; width:100%; min-height:340px; cursor:pointer;
    transform-style:preserve-3d; transition:transform .5s cubic-bezier(.4,.2,.2,1);
  }
  .flashcard.flipped{transform:rotateY(180deg);}
  .face{
    position:absolute; inset:0; backface-visibility:hidden;
    background:var(--paper-raised); border:none; border-radius:28px;
    box-shadow:var(--shadow); padding:28px 24px; display:flex; flex-direction:column;
  }
  .face-front{align-items:center; justify-content:flex-start; text-align:center; overflow-y:auto;}
  .face-front .word{font-family:'Fraunces',serif; font-size:40px; color:var(--ink); font-weight:700; letter-spacing:-0.02em; margin-bottom:12px; line-height:1.15;}
  .face-front .ipa{font-family:'IBM Plex Mono',monospace; color:var(--text-muted); margin-top:8px; font-size:14px;}
  .speak-inline{
    background:none; border:none; color:var(--ink-soft); font-size:14px; cursor:pointer; padding:2px 6px; flex-shrink:0;
  }
  .face-front .tap-hint{margin-top:16px; text-align:center; font-size:11px; color:var(--text-muted);}

  .cloze-sentence{font-size:17px; line-height:1.5; color:var(--ink); text-align:center; font-weight:500;}
  .cloze-sentence .blank{color:var(--stamp); font-weight:700; letter-spacing:.02em;}
  .cloze-sentence .fill{color:var(--stamp); font-weight:700;}
  .collapsible{
    border:1px solid var(--line); border-radius:18px; margin-top:18px; width:100%; overflow:hidden; background:var(--paper-raised);
  }
  .collapsible-head{
    padding:10px 14px; font-size:12.5px; font-weight:600; color:var(--ink-soft); cursor:pointer;
    text-align:center; user-select:none;
  }
  .collapsible-body{
    padding:12px 14px; border-top:1px solid var(--line); font-size:13.5px; color:var(--text); line-height:1.5;
  }
  .collapsible-body ol{margin:0; padding-left:18px;}
  .collapsible-body li{margin-bottom:8px;}
  /* Same size as a plain .collapsible: the negative margins keep the icons
     from making the head taller than its one line of text. */
  .hint-panel{background:transparent;}
  .hint-head{display:flex; align-items:center; gap:8px; text-align:left;}
  .hint-bulb{
    width:26px; height:26px; margin-block:-6px; border-radius:50%; background:var(--gold-soft); color:var(--ink);
    display:flex; align-items:center; justify-content:center; flex:0 0 auto;
  }
  .collapse-chevron{
    width:16px; height:16px; margin-block:-4px; vertical-align:middle; color:var(--ink);
    fill:none; stroke:currentColor; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round;
  }
  .hint-bulb svg{fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round;}
  .hint-bulb svg{width:15px; height:15px; stroke-width:2;}
  .hint-title{font-weight:700; color:var(--ink);}
  .hint-chevron{margin-left:auto;}
  .hint-panel .collapsible-body{margin:0 14px; padding:12px 0;}
  .info-box{margin-top:26px; width:100%;}
  .info-box + .info-box{border-top:1px solid var(--line); padding-top:22px;}
  .info-box-head{
    font-size:16px; font-weight:700; color:var(--ink); text-align:left;
    display:flex; align-items:center; gap:8px;
  }
  .info-box-body{
    padding:0; margin-top:10px; font-size:15px; color:var(--text); line-height:1.75;
  }
  .info-box-body .vi{color:var(--ink-soft); margin-top:4px;}
  .info-box-body ul{margin:0; padding-left:20px; list-style:disc;}
  .info-box-body li{margin-bottom:12px; line-height:1.7;}

  .note-section{margin-top:26px; padding-top:22px; border-top:1px solid var(--line);}
  .note-section .info-box{margin-top:0;}
  .note-add-link{
    display:inline-flex; align-items:center; gap:6px; background:none; border:none; padding:0;
    font-family:'Inter',sans-serif; font-size:13.5px; font-weight:600; color:var(--text-muted); cursor:pointer;
  }
  .note-add-link:hover{color:var(--ink);}
  .note-edit-label{font-size:16px; font-weight:700; color:var(--ink); margin-bottom:10px;}
  .note-input-wrap{position:relative;}
  .note-textarea{
    width:100%; min-height:80px; resize:vertical; padding:12px 14px 26px; border-radius:16px;
    border:1px solid var(--line); background:var(--paper); font-family:'Inter',sans-serif;
    font-size:14.5px; color:var(--text); line-height:1.5;
  }
  .note-textarea:focus{outline:2px solid var(--ink); outline-offset:1px;}
  .note-counter{
    position:absolute; right:12px; bottom:9px; font-family:'IBM Plex Mono',monospace;
    font-size:11px; color:var(--text-muted); pointer-events:none;
  }
  .note-save-btn{margin-top:12px;}
  .note-edit-btn{
    background:none; border:none; cursor:pointer; font-size:14px; line-height:1; padding:2px; margin-left:auto;
    color:var(--text-muted);
  }
  .note-edit-btn:hover{color:var(--ink);}
  .guess-input{
    width:100%; margin-top:14px; padding:12px 14px; border-radius:16px; border:1px solid var(--line);
    background:var(--paper-raised); font-family:'Inter',sans-serif; font-size:14.5px; color:var(--text); text-align:center;
  }
  .guess-input:focus{outline:2px solid var(--ink); outline-offset:1px;}
  .guess-textarea{
    text-align:left; resize:none; line-height:1.5; font-size:15px;
  }
  .guess-textarea:disabled, .guess-textarea:read-only{opacity:.7;}
  .lt-hint-row{
    display:flex; align-items:flex-start; gap:8px; margin-top:14px; min-height:24px;
  }
  .lt-hint{
    flex:1; min-width:0; font-size:12.5px; line-height:1.5; text-align:left; word-wrap:break-word; font-style:italic;
  }
  .lt-sent-badge{
    font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--text-muted);
    background:var(--paper); border:1px solid var(--line); border-radius:999px;
    padding:2px 8px; white-space:nowrap; flex-shrink:0; margin-top:2px;
  }
  .lt-reveal-btn{
    width:28px; height:28px; padding:0; flex-shrink:0; margin-top:1px;
    border:1px solid var(--line); border-radius:50%; background:var(--paper-raised); color:var(--text-muted);
    display:flex; align-items:center; justify-content:center; cursor:pointer; transition:background .15s;
  }
  .lt-reveal-btn:hover{background:var(--sage-soft); color:var(--sage);}
  .answer-check{
    border-radius:12px; padding:12px 16px; margin-top:6px; text-align:center; border:1px solid;
  }
  .answer-check.ok{ background:var(--sage-soft); border-color:var(--sage); }
  .answer-check.no{ background:var(--stamp-soft); border-color:var(--stamp); }
  .answer-check-line{ font-size:17px; display:flex; align-items:center; justify-content:center; gap:8px; }
  .answer-check-line .mono{ font-family:'IBM Plex Mono',monospace; letter-spacing:.02em; font-size:15px; }
  .speak-dot-row{display:flex; gap:18px; justify-content:center; margin:12px 0 30px;}
  /* On the flashcard the check result is a slim pill, so it never eats the picture's height. */
  .ac-main .answer-check{width:fit-content; max-width:100%; margin:-16px auto 16px; padding:3px 12px; border-radius:99px;}
  .ac-main .answer-check-line{font-size:13px; gap:6px;}
  .ac-main .answer-check-line .mono{font-size:13px;}
  .speak-dot{
    width:52px; height:52px; padding:0; border:none; border-radius:50%; background:transparent; cursor:pointer;
    display:flex; align-items:center; justify-content:center; transition:transform .2s, filter .2s;
  }
  .speak-dot .speaker-icon-svg{width:40px; height:40px; display:block; pointer-events:none;}
  .speak-dot:hover{transform:translateY(-2px); filter:drop-shadow(0 7px 10px rgba(32,52,95,.14));}
  .speak-dot:active{transform:scale(.94);}
  .back-word-box{
    text-align:center; margin-top:2px;
  }
  .back-word-box .ipa{font-family:'IBM Plex Mono',monospace; color:var(--text-muted); font-size:13px; margin-top:2px;}
  @keyframes cardReveal{from{opacity:0; transform:scale(.992);} to{opacity:1; transform:none;}}
  .rate-ghost{display:none;}
  .answer-card{
    position:relative; background:var(--paper-raised); border:1px solid var(--line); border-radius:26px;
    box-shadow:var(--shadow); padding:26px 22px 22px; margin-bottom:22px; animation:cardReveal .2s ease-out both;
  }

  .rate-fixed-wrap{
    position:fixed;
    left:50%;
    transform:translateX(-50%);
    bottom:calc(8px + env(safe-area-inset-bottom));
    width:calc(100vw - 40px);
    max-width:390px;
    z-index:120;
    background:rgba(255,255,255,.94);
    -webkit-backdrop-filter:blur(18px) saturate(135%);
    backdrop-filter:blur(18px) saturate(135%);
    border:1px solid rgba(32,52,95,.07);
    border-radius:18px;
    box-shadow:0 -8px 28px rgba(32,52,95,.08);
    padding:8px 10px;
  }
  /* #phone only grows to 640px on the desktop breakpoint (>=900px).
     Matching that breakpoint prevents the rating bar from becoming wider
     than the app shell on tablets / medium browser windows. */
  @media(min-width:900px){
    .rate-fixed-wrap{
      width:calc(100vw - 64px);
      max-width:576px;
      bottom:12px;
    }
  }
  .rate-row{display:flex; gap:8px; width:100%; min-width:0;}
  .rate-btn{
    flex:1 1 0; min-width:0; border:none; border-radius:14px; padding:11px 4px; font-family:'Inter',sans-serif;
    font-weight:600; font-size:12.5px; line-height:1.15; cursor:pointer; color:#fff;
    white-space:normal; overflow-wrap:anywhere;
  }
  @media(max-width:380px){
    .rate-fixed-wrap{width:calc(100vw - 10px); padding:7px 6px;}
    .rate-row{gap:5px;}
    .rate-btn{font-size:11.5px; padding:10px 2px;}
  }
  .rate-again{background:var(--stamp);}
  .rate-hard{background:var(--gold);}
  .rate-good{background:var(--sage);}
  .rate-easy{background:var(--ink);}

  .review-done{text-align:center; padding:52px 10px 10px;}
  .rd-badge{position:relative; width:150px; height:150px; margin:0 auto;}
  .rd-badge-deco{position:absolute; inset:0; width:100%; height:100%; pointer-events:none;}
  .rd-badge-circle{
    position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
    width:68px; height:68px; border-radius:50%;
    background:radial-gradient(circle at 35% 30%, #ffffff 0%, #F3F7FF 68%, #E9F0FF 100%);
    box-shadow:0 0 0 10px rgba(47,111,232,.07), 0 14px 34px rgba(47,111,232,.24);
    display:flex; align-items:center; justify-content:center; color:#2F6FE8;
  }
  .rd-check-icon{width:46px; height:46px;}
  .rd-title{font-family:'Fraunces',serif; font-weight:700; font-size:30px; line-height:1.16; margin:12px 0 10px; color:var(--ink);}
  .rd-title span{color:#2F6FE8;}
  .review-done .rd-sub{color:var(--text-muted); font-size:13.5px; line-height:1.55; max-width:280px; margin:0 auto;}
  .review-done .btn{max-width:280px;}

  @media (prefers-reduced-motion: reduce){ .answer-card, .rate-fixed-wrap{animation:none !important;} }

/* ===== styles/60-progress-teacher.css ===== */
  /* ---------- progress / gauge ---------- */
  .gauge-wrap{display:flex; flex-direction:column; align-items:center; padding:18px 0 8px;}
  .gauge-label{font-size:12px; color:var(--text-muted); margin-top:8px; text-transform:uppercase; letter-spacing:.06em;}
  .gauge-number{font-family:'Fraunces',serif; font-size:15px; color:var(--ink); margin-top:2px;}
  .stat-grid{display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; margin:22px 0 18px;}
  .stat-card{
    background:var(--paper-raised); border:1px solid var(--line); border-radius:14px; padding:14px 10px;
  }
  .stat-card .num{font-family:'Fraunces',serif; font-size:24px; color:var(--ink);}
  .stat-card .lbl{font-size:11.5px; color:var(--text-muted); margin-top:2px;}

  /* ---------- teacher: student list ---------- */
  .student-row{
    display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line);
  }
  .student-row:last-child{border-bottom:none;}
  .avatar{
    width:36px; height:36px; border-radius:50%; background:var(--gold-soft); color:var(--gold);
    display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; flex-shrink:0;
  }
  .student-row .em{font-size:13.5px; font-weight:500; word-break:break-all;}
  .student-row .sub{font-size:11.5px; color:var(--text-muted);}
  .student-row .del{margin-left:auto; background:none; border:none; color:var(--text-muted); font-size:18px; cursor:pointer; padding:4px;}
  .add-email-row{display:flex; gap:8px; margin-top:14px;}
  .add-email-row input{flex:1;}

  .chip{
    padding:8px 14px; border-radius:999px; border:1px solid var(--line); background:var(--paper-raised);
    font-size:13px; cursor:pointer; color:var(--text-muted);
  }
  .chip.selected{background:var(--ink); color:var(--paper); border-color:var(--ink);}

  /* vocab editor rows */
  .vocab-editor-card{
    background:var(--paper-raised); border:1px solid var(--line); border-radius:14px; padding:14px; margin-bottom:10px; position:relative;
  }
  .vocab-editor-card .rm{
    position:absolute; top:10px; right:10px; background:none; border:none; color:var(--text-muted); font-size:16px; cursor:pointer;
  }
  .two-col{display:grid; grid-template-columns:1fr 1fr; gap:10px;}

  .toast{
    position:absolute; left:16px; right:16px; bottom:96px; background:var(--ink); color:var(--paper);
    padding:12px 16px; border-radius:11px; font-size:13px; text-align:center; box-shadow:var(--shadow);
    animation:fadeUp .2s ease both; z-index:50;
  }
  .hint-banner{
    background:var(--gold-soft); border:1px solid var(--gold); color:#7A5C1A; font-size:12px;
    border-radius:12px; padding:10px 12px; margin-bottom:16px; line-height:1.5;
  }
  .loading-wrap{display:flex; align-items:center; justify-content:center; min-height:60vh; color:var(--text-muted); font-size:13px;}

  /* ---------- teacher: pricing ---------- */
  .pr-revenue{
    background:var(--paper-raised); border:1px solid var(--line); border-radius:14px; padding:14px 16px; margin:16px 0 14px;
  }
  .pr-revenue .num{font-family:'Fraunces',serif; font-size:28px; color:var(--ink); margin:2px 0;}
  .pr-revenue .lbl{font-size:11.5px; color:var(--text-muted);}
  /* One line per row at every width: fixed columns, long names cut with "…"
     (full name in the tooltip). Phones shrink type and columns to fit. */
  .pr-table{
    --pr-cols:minmax(0,1fr) 64px 116px 124px 150px;
    border:1px solid var(--line); border-radius:14px; background:var(--paper-raised); overflow:hidden;
  }
  .pr-lesson{border-top:1px solid var(--line);}
  .pr-row{
    display:grid; grid-template-columns:var(--pr-cols); column-gap:10px; align-items:center;
    padding:6px 14px; min-height:44px; box-sizing:border-box;
  }
  .pr-head{
    min-height:34px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em;
    color:var(--text-muted); background:var(--paper);
  }
  .pr-row-lesson{background:var(--paper);}
  .pr-row-lesson .pr-name{font-weight:600; color:var(--ink);}
  .pr-row-section{min-height:40px;}
  .pr-row-section .pr-name{padding-left:16px; color:var(--ink-soft);}
  .pr-name{font-size:13px; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .pr-num, .pr-words{text-align:right; font-variant-numeric:tabular-nums;}
  .pr-words{font-size:12.5px; color:var(--text-muted);}
  .pr-note{font-size:12px; color:var(--text-muted); padding-left:2px;}
  .pr-row select, .pr-row input{
    width:100%; min-width:0; height:32px; box-sizing:border-box; padding:4px 8px; font-size:13px; margin:0;
    border:1px solid var(--line); border-radius:8px; background:var(--paper-raised); color:var(--ink); font-family:inherit;
  }
  .pr-row input.pr-price{text-align:right; font-variant-numeric:tabular-nums;}
  .pr-short{display:none;}
  .pr-tag{
    display:inline-block; font-size:10.5px; font-weight:500; padding:1px 7px; border-radius:999px;
    background:var(--stamp-soft); color:var(--stamp); margin-left:4px; white-space:nowrap; vertical-align:1px;
  }
  .pr-head > div{white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  @media (max-width:640px){
    .pr-table{--pr-cols:minmax(0,1fr) 22px 52px 64px 44px;}
    .pr-row{column-gap:4px; padding:4px 8px; min-height:36px;}
    .pr-row-section{min-height:34px;}
    .pr-row-section .pr-name{padding-left:8px;}
    .pr-head{min-height:28px; font-size:9.5px; letter-spacing:0;}
    .pr-long{display:none;}
    .pr-short{display:inline;}
    .pr-name{font-size:11.5px;}
    .pr-words{font-size:10.5px;}
    .pr-note{font-size:10.5px; padding-left:0; text-align:center;}
    .pr-row select, .pr-row input{height:28px; padding:2px 3px; font-size:11.5px; border-radius:7px;}
    /* No native arrow on phones: "Locked"/"Priced" fit the narrow column. */
    .pr-row input.pr-price{text-align:center; padding:2px 1px;}
    .pr-row select{-webkit-appearance:none; appearance:none; text-align:center; text-align-last:center;}
    .pr-tag{font-size:9px; padding:0 5px;}
  }

/* ===== styles/70-responsive-learning-path.css ===== */
  /* ---------- wider layout on laptop/desktop screens ---------- */
  @media(min-width:900px){
    #phone{ max-width:640px; }
    body{ padding:40px 20px; }
    main{ padding-left:32px; padding-right:32px; }
    .face, .answer-card{ padding:28px 32px; }
    .cloze-sentence{ font-size:19px; }
    .word{ font-size:26px; }
    h1{ font-size:30px; }
    .bottom-fixed-wrap{ max-width:640px; }
    .bottomnav{ padding-left:32px; padding-right:32px; }
  }
  /* ===== Lesson detail "learning path" screen — scoped classes (lp- prefix)
     so these never collide with the app's existing global .page-title,
     .btn-primary, etc. used everywhere else. Values match the reference
     design exactly. ===== */
  /* Refined palette for this screen, from the detailed reference */
  .lp-topic-crumb{font-size:13px; color:var(--text-muted);}
  .lp-title{font-size:clamp(24px, 7vw, 36px); font-weight:700; margin:14px 0 4px; color:var(--ink); font-family:'Fraunces',serif; letter-spacing:-0.02em;}
  .lp-subtitle{font-size:16px; color:var(--text-muted); margin:0;}
  .lp-image{width:100%; aspect-ratio:35/12; border-radius:20px; object-fit:cover; margin:22px 0 8px; display:block; background:#DFE7DB; box-shadow:0 14px 32px rgba(28,39,55,.10), 0 2px 8px rgba(28,39,55,.05);}
  .lp-image-fallback{width:100%; aspect-ratio:35/12; border-radius:20px; margin:22px 0 8px; display:flex; align-items:center; justify-content:center; background:#DFE7DB; color:#5C7A5B; font-family:'Fraunces',serif; font-weight:600; font-size:42px; box-shadow:0 14px 32px rgba(28,39,55,.10), 0 2px 8px rgba(28,39,55,.05);}
  .lp-action-card{background:transparent; padding:0; margin-top:16px; display:grid; gap:14px;}
  .lp-btn-primary{width:100%; height:56px; border:1px solid var(--ink); border-radius:12px; background:var(--ink); color:#fff; font-size:16px; font-weight:650; cursor:pointer; font-family:'Inter',sans-serif; box-shadow:0 7px 16px rgba(32,52,95,.16); transition:background .15s, box-shadow .15s, transform .15s, border-color .15s;}
  .lp-btn-primary:hover{background:var(--ink-2); border-color:var(--ink-2); box-shadow:0 9px 20px rgba(32,52,95,.2); transform:translateY(-1px);}
  .lp-btn-primary:active{transform:translateY(0) scale(.995);}
  .lp-btn-primary:disabled{opacity:.45; cursor:default; transform:none;}
  .lp-btn-secondary{width:100%; height:52px; border-radius:12px; background:rgba(255,255,255,.4); border:1px solid var(--ink); font-size:15px; font-weight:650; color:var(--ink); display:flex; align-items:center; justify-content:space-between; padding:0 20px; cursor:pointer; font-family:'Inter',sans-serif; transition:background .15s;}
  .lp-btn-secondary:hover{background:rgba(255,255,255,.85);}
  .lp-section-title{margin-top:34px; margin-bottom:16px; font-size:21px; font-weight:700; color:var(--ink); font-family:'Fraunces',serif;}
  .lp-timeline{position:relative; padding-left:34px;}
  .lp-timeline:before{content:""; position:absolute; left:11px; top:8px; bottom:8px; width:1px; background:var(--line);}
  .lp-timeline-item{position:relative; margin-bottom:16px;}
  .lp-timeline-dot{position:absolute; left:-30px; top:24px; width:14px; height:14px; border-radius:50%; background:#F7F4ED; border:2px solid var(--ink);}
  .lp-timeline-dot.current{background:var(--ink); box-shadow:0 0 0 4px #F7F4ED, 0 0 0 5px var(--ink);}
  .lp-timeline-dot.done{background:#22C55E; border-color:#22C55E;}
  .lp-timeline-dot.locked{border-color:var(--line);}
  .lp-part-card{background:#fff; border-radius:20px; border:1px solid #E2DFD6; padding:16px; display:flex; justify-content:space-between; align-items:center; box-shadow:0 12px 30px rgba(28,39,55,.07), 0 2px 6px rgba(28,39,55,.03); cursor:pointer; gap:10px;}
  .lp-part-left{display:flex; gap:14px; align-items:center; min-width:0;}
  .lp-part-icon{width:34px; height:34px; border-radius:8px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:15px; color:#fff;}
  .picker-icon-img{position:relative; flex-shrink:0; overflow:hidden; display:flex; align-items:center; justify-content:center;}
  .picker-icon-img img{width:100%; height:100%; object-fit:cover; display:block;}
  .picker-icon-img .picker-check-badge{
    position:absolute; right:-3px; bottom:-3px; width:16px; height:16px; border-radius:50%;
    background:var(--ink); color:#fff; font-size:9px; font-weight:700; line-height:1;
    display:flex; align-items:center; justify-content:center; border:2px solid var(--paper);
  }
  .lp-part-title{font-size:16px; font-weight:650; color:var(--ink);}
  .lp-part-sub{margin-top:3px; color:var(--text-muted); font-size:13px;}
  .lp-part-status{text-align:right; line-height:1.6; font-size:13px; flex-shrink:0;}
  .lp-new-count{color:var(--ink-soft); font-weight:600;}
  .lp-due-count{color:var(--stamp); font-weight:600;}

/* ===== styles/80-study-feature-cards.css ===== */
  /* ---------- Study/Practice feature cards (Review & Audio tabs) ---------- */
  .feature-card{
    border-radius:22px; padding:24px; margin-bottom:18px; position:relative; overflow:hidden;
  }
  .feature-card.study{background:#E6EDFB;}
  .feature-card.practice{background:var(--stamp-soft);}
  .feature-card h2{margin:0 0 6px; font-family:'Fraunces',serif; font-size:24px; color:var(--ink);}
  .feature-card p{margin:0 0 16px; font-size:13.5px; color:var(--text-muted); line-height:1.5; max-width:78%;}
  .fc-illustration{position:absolute; right:14px; top:10px; width:72px; height:auto; z-index:0;}
  .fc-content{position:relative; z-index:1;}

  /* Compact hero layout for Review & Audio.
     Keeps the current blue/pink card colors and large artwork, but removes
     unnecessary empty space above/below the content. */
  .feature-card-hero{
    display:grid;
    grid-template-columns:minmax(0, 1.12fr) minmax(190px, .88fr);
    align-items:center;
    gap:12px;
    min-height:0;
    padding:14px 28px;
  }
  .feature-card-hero .fc-content{
    min-width:0;
    align-self:center;
  }
  .feature-card-hero h2{
    font-size:27px;
    margin-bottom:7px;
  }
  .feature-card-hero p{
    max-width:100%;
    margin-bottom:16px;
    font-size:13.5px;
    line-height:1.5;
  }
  .fc-artwork{
    position:relative;
    z-index:0;
    width:100%;
    min-width:0;
    min-height:145px;
    display:flex;
    align-items:center;
    justify-content:center;
    pointer-events:none;
    user-select:none;
  }
  /* One shared box for every feature-card illustration (Review, Practice,
     Listen, Listen & Type) so all cards render at the same height instead of
     each image's own aspect ratio driving a different card size. */
  .fc-artwork img{
    display:block;
    width:100%;
    max-width:305px;
    max-height:133px;
    object-fit:contain;
    object-position:center;
  }

  .fc-outline-btn{
    display:inline-flex; align-items:center; gap:8px; background:#fff; color:var(--stamp);
    border:1.5px solid var(--stamp); border-radius:14px; padding:12px 18px; cursor:pointer;
    font-size:14px; font-weight:700; max-width:280px;
  }
  .fc-outline-btn-full{
    width:100%; max-width:320px; min-height:56px; height:auto; justify-content:center; font-size:15px;
    white-space:normal; overflow:visible; text-overflow:clip; text-align:center; line-height:1.25;
    padding:10px 14px; overflow-wrap:anywhere; text-wrap:balance;
  }
  .fc-nothing-due{
    display:flex; align-items:center; justify-content:center; gap:6px;
    width:100%; max-width:320px; min-height:56px; height:auto;
    font-size:15px; font-weight:700; color:var(--ink);
    background:#fff; border:1.5px solid var(--ink);
    border-radius:14px; padding:10px 14px; margin:0;
    text-align:center; line-height:1.25;
  }
  .fc-review-btn{
    width:100%; max-width:320px; min-height:56px; height:auto; border:1px solid var(--ink); border-radius:12px;
    background:var(--ink); color:#fff; font-size:15px; font-weight:700; cursor:pointer; font-family:'Inter',sans-serif;
    box-shadow:0 7px 16px rgba(32,52,95,.16); transition:background .15s, box-shadow .15s, transform .15s, border-color .15s;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
    white-space:normal; overflow:visible; text-overflow:clip; padding:9px 12px;
    text-align:center; line-height:1.15; overflow-wrap:anywhere;
  }
  .fc-btn-main{display:block; font-size:15px; font-weight:700; line-height:1.15;}
  .fc-btn-count{display:block; font-size:12.5px; font-weight:600; line-height:1.15; opacity:.9; white-space:normal;}
  .fc-review-btn:hover{background:var(--ink-2); border-color:var(--ink-2); box-shadow:0 9px 20px rgba(32,52,95,.2); transform:translateY(-1px);}
  .fc-review-btn:active{transform:translateY(0) scale(.995);}
  .fc-choose-text{
    display:inline-block; margin-top:14px; margin-left:14px; font-size:13px; font-weight:600; color:#2F6FE8;
    text-decoration:none; background:none; border:none; cursor:pointer; padding:0;
  }

  .search-entry-card{
    display:flex; align-items:center; gap:12px; width:100%;
    background:var(--paper-raised); border:1px solid var(--line); border-radius:14px;
    padding:14px 16px; cursor:pointer; text-align:left; font-family:'Inter',sans-serif;
    transition:border-color .15s ease, transform .15s ease;
  }
  .search-entry-card:hover{border-color:#2F6FE8;}
  .search-entry-card:active{transform:scale(.995);}
  .search-entry-icon{
    width:40px; height:40px; border-radius:50%; background:#E6EDFB; color:#2F6FE8;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
  }
  .search-entry-icon svg{width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
  .search-entry-copy{flex:1; min-width:0;}
  .search-entry-title{display:block; font-size:14.5px; font-weight:700; color:var(--ink);}
  .search-entry-sub{display:block; font-size:12.5px; color:var(--text-muted); margin-top:2px;}
  .search-entry-chevron{color:var(--text-muted); font-size:18px; flex-shrink:0;}

  @media(max-width:680px){
    .feature-card-hero{
      grid-template-columns:minmax(0,1.08fr) minmax(150px,.82fr);
      gap:6px;
      padding:12px 18px;
    }
    .feature-card-hero h2{
      font-size:25px;
      margin-bottom:6px;
    }
    .feature-card-hero p{
      font-size:13px;
      margin-bottom:14px;
      line-height:1.45;
    }
    .fc-artwork{
      min-height:130px;
    }
    .fc-artwork img{
      max-width:230px;
      max-height:117px;
    }
    .fc-review-btn,
    .fc-outline-btn-full,
    .fc-nothing-due{
      max-width:100%;
      min-height:52px;
      height:auto;
    }
    .fc-choose-text{
      margin-top:11px;
      margin-left:10px;
    }
    .search-entry-card{
      padding:12px 14px;
    }
    .search-entry-icon{
      width:36px; height:36px;
    }
    .search-entry-title{font-size:14px;}
    .search-entry-sub{font-size:12px;}
  }

  /* Keep the phone layout side-by-side too, matching the reference design.
     Only extremely narrow screens stack vertically. */
  @media(max-width:430px){
    .feature-card-hero{
      grid-template-columns:minmax(0,1.12fr) minmax(118px,.78fr);
      gap:3px;
      padding:10px 14px;
      border-radius:20px;
    }
    .feature-card-hero h2{
      font-size:23px;
    }
    .feature-card-hero p{
      font-size:12.5px;
      margin-bottom:12px;
    }
    .fc-artwork{
      min-height:118px;
    }
    .fc-artwork img{
      max-width:180px;
      max-height:101px;
    }
    .fc-review-btn,
    .fc-outline-btn-full,
    .fc-nothing-due{
      min-height:50px;
      height:auto;
      font-size:13.5px;
      padding:8px 10px;
    }
    .fc-btn-main{font-size:13.5px;}
    .fc-btn-count{font-size:11.5px;}
    .fc-choose-text{
      margin-top:10px;
      margin-left:6px;
      font-size:12.5px;
    }
    .search-entry-card{
      padding:10px 12px; gap:10px;
    }
    .search-entry-icon{
      width:32px; height:32px;
    }
    .search-entry-icon svg{width:16px; height:16px;}
    .search-entry-title{font-size:13.5px;}
    .search-entry-sub{font-size:11.5px;}
  }

  @media(max-width:330px){
    .feature-card-hero{
      grid-template-columns:1fr;
      gap:4px;
    }
    .feature-card-hero .fc-artwork{
      min-height:120px;
      margin-top:0;
    }
    .feature-card-hero .fc-artwork img{
      max-width:190px;
      max-height:145px;
    }
  }

  /* Review tab cards: "Add practice" checkboxes, then the Choose lessons row.
     Title/description sit beside the artwork; the controls span the card. */
  .study-card .study-controls{grid-column:1 / -1; display:flex; flex-direction:column; gap:10px; padding:2px 0 14px;}
  .study-controls svg{width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0;}
  .study-choose{
    display:flex; align-items:center; gap:10px; width:100%; min-height:52px; padding:10px 14px;
    background:#fff; border:1px solid rgba(32,52,95,.10); border-radius:14px; cursor:pointer;
    font-family:'Inter',sans-serif; text-align:left; color:var(--ink);
    box-shadow:0 2px 8px rgba(32,52,95,.05); transition:border-color .15s, box-shadow .15s;
  }
  .study-choose:hover{border-color:#2F6FE8; box-shadow:0 4px 12px rgba(32,52,95,.08);}
  .study-choose-icon{display:flex; color:var(--ink);}
  .study-choose-title{font-size:14.5px; font-weight:700; white-space:nowrap;}
  .study-choose-chevron{font-size:20px; line-height:1; color:var(--ink); margin-left:auto;}
  /* Shadowing / Dictation: plain checkboxes on the card background, no box
     of their own, so the white Choose lessons row stays the main control. */
  .study-opts{display:flex; flex-wrap:wrap; align-items:center; gap:2px 16px;}
  .study-opts-label{flex-basis:100%; font-size:12.5px; color:var(--text-muted);}
  .study-opt{
    display:inline-flex; align-items:center; gap:6px; min-height:34px; padding:4px 2px;
    background:none; border:0; cursor:pointer;
    font-family:'Inter',sans-serif; font-size:13.5px; font-weight:500; color:var(--text-muted);
  }
  .study-opt > svg{width:17px; height:17px;}
  .study-opt-box{
    display:flex; align-items:center; justify-content:center; width:18px; height:18px; flex-shrink:0;
    border:1.5px solid rgba(32,52,95,.32); border-radius:5px; background:rgba(255,255,255,.55);
    transition:background .15s, border-color .15s;
  }
  .study-opt:hover .study-opt-box{border-color:#6D4FD8;}
  .study-opt.is-on{color:var(--ink);}
  .study-opt.is-on > svg{color:#6D4FD8;}
  .study-opt.is-on .study-opt-box{background:#6D4FD8; border-color:#6D4FD8; color:#fff;}
  .study-opt-box svg{width:13px; height:13px; stroke-width:3;}
  @media(max-width:430px){
    .study-card .study-controls{gap:9px; padding-bottom:12px;}
    .study-choose{padding:9px 12px; gap:8px;}
    .study-choose-title{font-size:14px;}
  }

  /* Tighter Review / Audio cards: header beside a smaller artwork, controls right under. */
  .study-card{row-gap:6px;}
  .study-card.feature-card-hero p{margin-bottom:0;}
  .study-card .fc-artwork{min-height:0;}
  .study-card .fc-artwork img{max-height:104px;}
  .study-card .study-controls{gap:8px; padding:4px 0 12px;}
  /* Review / Practice picker: the card's Shadowing/Dictation choice, above Start. */
  .picker-combo-note{margin-top:14px; font-size:13px; font-weight:600; color:#6D4FD8; text-align:center;}

/* ===== styles/90-audio-performance.css ===== */
  /* ---------- Audio Review: single white card + auto-advance pill ---------- */
  .ar-card{
    background:var(--paper-raised); border-radius:24px; box-shadow:var(--shadow);
    padding:40px 30px; text-align:center;
  }
  .ar-card .ar-word{font-family:'Fraunces',serif; font-size:32px; color:var(--ink); margin-bottom:22px;}
  .ar-quote{text-align:center;}
  .ar-quote .ar-quote-mark{
    display:block; font-family:'Fraunces',serif; font-size:30px; font-weight:700; color:#2F6FE8;
    line-height:1; margin-bottom:6px;
  }
  .ar-quote p{margin:0 auto; max-width:92%; font-size:17px; line-height:1.65; color:var(--ink);}
  .ar-audio-icon{display:flex; align-items:center; justify-content:center; margin-top:26px; margin-bottom:14px; min-height:56px;}
  /* On Listen & Type the icon is the card's first thing (no word/quote above
     it), so it doesn't need the same top offset those screens use to clear
     text above it — sit it closer to the card's own top padding instead. */
  .ar-card > .ar-audio-icon:first-child{margin-top:4px;}
  .ar-audio-badge{
    width:56px; height:56px; border-radius:50%; background:#EEF3FD;
    display:flex; align-items:center; justify-content:center; font-size:24px;
  }
  .btn-audio-play{background:#2F6FE8; color:#fff;}
  .ar-transport-btn{white-space:nowrap;}
  .ar-repeat-btn{
    width:44px; height:44px; padding:0; border:1px solid var(--line); border-radius:11px;
    background:transparent; color:var(--ink); display:inline-flex; align-items:center;
    justify-content:center; cursor:pointer; font-size:18px; flex-shrink:0;
  }
  .ar-repeat-btn.active{background:#2F6FE8; color:#fff; border-color:#2F6FE8;}
  .ar-advance-pill{
    display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:8px;
    background:#EEF3FD; border-radius:999px; padding:9px 16px; margin-top:14px;
    font-size:12.5px; color:#2F6FE8;
  }
  .ar-advance-pill .ar-pill-sep{color:var(--line);}
  .ar-advance-pill strong{color:#7A5C1A; font-weight:700;}
  /* ---------- Performance: streak / active-days / lessons-completed ---------- */
  .streak-card{
    background:linear-gradient(135deg, #2F6FE8 0%, #1E4FBE 100%); border-radius:20px;
    padding:20px; color:#fff; display:flex; align-items:center; gap:16px; margin:4px 0 18px;
    box-shadow:0 10px 24px rgba(37,73,168,0.32); position:relative; overflow:hidden;
  }
  .streak-card .streak-deco{position:absolute; inset:0; width:100%; height:100%; z-index:0; pointer-events:none;}
  .streak-card .streak-rocket{position:absolute; left:82.75%; top:42.5%; height:52px; width:auto; transform:translate(-59%,-50%); z-index:0; pointer-events:none; user-select:none;}
  .streak-card .streak-badge{position:relative; z-index:1; width:52px; height:52px; flex-shrink:0;}
  .streak-card .streak-badge svg{width:100%; height:100%;}
  .streak-card .streak-content{position:relative; z-index:1; min-width:0;}
  .streak-num{font-family:'Fraunces',serif; font-size:32px; font-weight:700; line-height:1; text-shadow:0 1px 3px rgba(8,18,46,.4);}
  .streak-label{font-size:12.5px; opacity:.98; margin-top:2px; text-shadow:0 1px 2px rgba(8,18,46,.35);}
  .streak-sub{font-size:11.5px; opacity:.92; margin-top:3px; text-shadow:0 1px 2px rgba(8,18,46,.35);}
  .perf-card{background:var(--paper-raised); border-radius:18px; padding:16px 16px 14px; margin-bottom:18px; box-shadow:var(--shadow);}
  .perf-card-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; gap:8px; flex-wrap:wrap;}
  .perf-card-title{font-size:13.5px; font-weight:700; color:var(--ink);}
  .period-toggle{display:flex; background:var(--paper); border-radius:999px; padding:3px; gap:2px;}
  .period-btn{border:none; background:none; font-size:11px; font-weight:600; color:var(--text-muted); padding:5px 10px; border-radius:999px; cursor:pointer; font-family:'Inter',sans-serif;}
  .period-btn.active{background:var(--ink); color:#fff;}
  .active-days-num{font-family:'Fraunces',serif; font-size:24px; font-weight:700; color:var(--ink);}
  .active-days-num small{font-size:14px; color:var(--text-muted); font-weight:500;}
  .active-days-sub{font-size:12px; color:var(--text-muted); margin-bottom:10px;}
  .retention-num{font-family:'Fraunces',serif; font-size:24px; font-weight:700; color:var(--ink);}
  .retention-sub{font-size:12px; color:var(--text-muted);}
  .dot-row{display:flex; gap:3px; flex-wrap:wrap;}
  .dot{width:8px; height:8px; border-radius:2px; background:var(--line);}
  .dot.on{background:var(--sage);}
  .lesson-frac{font-family:'Fraunces',serif; font-size:15px; font-weight:700; color:var(--ink); white-space:nowrap;}
  .lesson-progress-row{display:flex; align-items:center; gap:4px; margin-bottom:8px;}
  .lesson-pip{flex:1; height:8px; border-radius:4px; background:var(--line);}
  .lesson-pip.done{box-shadow:0 0 0 1.5px var(--sage);}
  .lesson-list-item{display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); font-size:12.5px;}
  .lesson-list-item:last-child{border-bottom:none;}
  .lesson-check{width:18px; height:18px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:10px; flex-shrink:0;}
  .lesson-check.done{background:var(--sage-soft); color:var(--sage);}
  .lesson-check.wip{background:#E6EDFB; color:#2F6FE8;}
  .lesson-name{flex:1; color:var(--ink);}
  .lesson-pct{color:var(--text-muted); font-size:11.5px;}

  /* ---------- Shadowing (Audio tab, web only) ---------- */
  .feature-card.shadow{background:var(--sage-soft);}
  .sh-card-btn{color:var(--sage); border-color:var(--sage);}
  /* Same box as the other feature-card illustrations (see .fc-artwork img). */
  .fc-artwork .sh-art{display:block; width:100%; max-width:200px; max-height:133px;}
  @media(max-width:680px){ .fc-artwork .sh-art{max-height:117px;} }
  @media(max-width:430px){ .fc-artwork .sh-art{max-height:101px;} }
  .sh-card{padding:30px 24px 24px;}
  .sh-sentence{margin:0 auto; max-width:620px; font-size:19px; line-height:1.6; color:var(--ink); font-weight:500;}
  .sh-word.ok{color:var(--sage); font-weight:600;}
  .sh-word.miss{color:var(--stamp); font-weight:600; text-decoration:underline; text-decoration-thickness:1.5px; text-underline-offset:3px;}
  .sh-heard{margin:12px auto 0; max-width:620px; font-size:13.5px; line-height:1.5; color:var(--text-muted);}
  .sh-controls{display:flex; align-items:center; justify-content:center; gap:22px; margin-top:24px;}
  /* The two side buttons are the same size and line up with the mic's centre. */
  .sh-side{display:flex; justify-content:center; width:56px;}
  /* Keeps the mic centred whether or not a recording exists yet. */
  .sh-side.is-hidden{visibility:hidden;}
  /* The speaker icon's circle fills 34/36 of its box: 55px draws a 52px circle. */
  .sh-replay.speak-dot{width:55px; height:55px;}
  .sh-replay .speaker-icon-svg{width:55px; height:55px;}
  .sh-self{width:52px; height:52px; border-radius:50%; border:none; padding:0 0 0 3px; cursor:pointer; background:var(--sage-soft); color:var(--sage); display:flex; align-items:center; justify-content:center; transition:transform .2s;}
  .sh-self:not(:disabled):active{transform:scale(.94);}
  .sh-self:disabled{opacity:.4; cursor:default;}
  .sh-replay:disabled{opacity:.4; cursor:default;}
  .sh-mic{
    width:72px; height:72px; border-radius:50%; border:none; cursor:pointer; padding:0;
    background:#E5484D; color:#fff; display:flex; align-items:center; justify-content:center;
    box-shadow:0 8px 20px rgba(229,72,77,.35), inset 0 0 0 4px rgba(255,255,255,.22);
    transition:transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  }
  .sh-mic:hover{transform:scale(1.04);}
  .sh-mic:disabled{opacity:.45; cursor:default; transform:none;}
  .sh-mic.is-listening{animation:shPulse 1.3s ease-out infinite;}
  .sh-mic-stop{width:22px; height:22px; border-radius:5px; background:#fff;}
  .sh-mic-spin{width:26px; height:26px; border-radius:50%; border:3px solid rgba(255,255,255,.45); border-top-color:#fff; animation:shSpin .8s linear infinite;}
  @keyframes shPulse{0%{box-shadow:0 0 0 0 rgba(229,72,77,.55);} 100%{box-shadow:0 0 0 18px rgba(229,72,77,0);}}
  @keyframes shSpin{to{transform:rotate(360deg);}}
  .sh-caption{margin-top:14px; font-size:13px; color:var(--text-muted);}
  .sh-note{margin:14px auto 0; max-width:520px; font-size:13px; line-height:1.5; color:var(--stamp); background:var(--stamp-soft); border-radius:12px; padding:10px 14px;}
  .sh-help{text-align:left;}
  .sh-help-title{font-weight:600;}
  .sh-help-steps{margin:6px 0 0; padding-left:20px;}
  .sh-help-steps li{margin-top:3px;}
  .sh-help-retry{margin-top:10px;}
  @media (prefers-reduced-motion: reduce){ .sh-mic.is-listening, .sh-mic-spin{animation:none;} }

/* ===== styles/100-account.css ===== */
  /* ---------- account / settings ---------- */
  .account-section{
    background:var(--paper-raised); border:1px solid var(--line); border-radius:var(--radius);
    padding:14px 16px; margin-bottom:14px; box-shadow:var(--shadow);
  }
  .account-section-title{font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); margin-bottom:8px;}
  .account-row{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:8px 0; border-bottom:1px solid var(--line); font-size:14px;
  }
  .account-row:last-child{border-bottom:none;}
  .account-row-label{color:var(--text-muted);}
  .account-row-value{color:var(--ink); font-weight:600; text-align:right; word-break:break-word;}
  .account-row-title{color:var(--ink);}
  .account-row-tag{
    font-size:11px; color:var(--ink-soft); background:var(--paper); border:1px solid var(--line);
    padding:2px 8px; border-radius:999px;
  }
  .account-row-empty{color:var(--text-muted); font-size:13.5px; padding:4px 0;}
  .account-row-link{
    width:100%; text-align:left; background:none; border:none; padding:8px 0;
    font-family:'Inter',sans-serif; color:var(--ink); text-decoration:none; font-weight:600; cursor:pointer;
  }
  .account-actions-list{display:flex; flex-direction:column; gap:8px;}
  .account-delete-btn{color:var(--stamp); border-color:var(--stamp-soft);}
  .account-delete-warning{font-size:13px; color:var(--text-muted); margin:2px 0 0;}
  .account-delete-actions{display:flex; gap:8px;}
  .account-section-danger{border-color:var(--stamp-soft);}
  .account-section-danger .account-section-title{color:var(--stamp);}

  /* ---------- Privacy Policy / Terms of Service (in-app) ---------- */
  .legal-section p{margin:0 0 10px; font-size:13.5px; line-height:1.6; color:var(--text);}
  .legal-section p:last-child{margin-bottom:0;}
  .legal-section ul{margin:0 0 10px; padding-left:18px;}
  .legal-section li{margin-bottom:6px; font-size:13.5px; line-height:1.55; color:var(--text);}
  .legal-section li:last-child{margin-bottom:0;}
  .legal-section a{color:var(--ink); font-weight:600;}

/* ===== styles/105-guide.css ===== */
  /* ---------- How to use Magi (in-app guide) ---------- */
  .lessons-list{display:flex; flex-direction:column;}
  .lessons-guide-link-wrap{display:flex; justify-content:center; margin:22px 0 8px;}
  .lessons-guide-link{display:inline-flex; align-items:center; gap:8px; background:none; border:0; padding:6px 8px; cursor:pointer; font:inherit; font-size:14px; color:#2F6FE8; text-decoration:underline; text-underline-offset:3px;}
  .lessons-guide-link:hover{color:#1F55C4;}
  .lessons-guide-q{width:18px; height:18px; border-radius:50%; border:1.5px solid currentColor; font-size:11px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; text-decoration:none;}

  .guide-screen main{max-width:980px; container-type:inline-size;}
  .guide-hero{padding:6px 2px 4px;}
  .guide-eyebrow{font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:#2F6FE8; margin-bottom:10px;}
  .guide-hero h1{font-family:'Fraunces',serif; font-size:30px; line-height:1.15; margin:0 0 12px; color:var(--ink); font-weight:700;}
  .guide-hero h1 .accent{color:#2F6FE8;}
  .guide-hero p{font-size:14px; line-height:1.6; color:var(--text); margin:0;}
  .guide-hero p + p{margin-top:8px;}
  .guide-bio-link{white-space:nowrap;}

  /* Jump links: one row, scrolls sideways on phones. */
  .guide-jumps{display:flex; flex-wrap:wrap; gap:8px; margin:20px 0 0;}
  .guide-jump{display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); background:var(--paper-raised); color:var(--ink); border-radius:999px; padding:6px 14px 6px 6px; font:600 13px 'Inter',sans-serif; cursor:pointer; transition:border-color .15s, color .15s;}
  .guide-jump-num{display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; background:#EFF4FE; color:#2F6FE8; font-size:11.5px; font-weight:700;}
  .guide-jump:hover{border-color:#2F6FE8; color:#2F6FE8;}

  /* Each section starts on a thin divider with a numbered heading
     (01, 02, ...), so the page reads as a sequence and is easy to scan. */
  .guide-section{margin-top:32px; padding-top:22px; border-top:1px solid var(--line); scroll-margin-top:16px;}
  .guide-section-lessons{margin-top:24px;}
  .guide-h2{
    display:flex; align-items:center; gap:12px;
    font-family:'Fraunces',serif; font-size:23px; line-height:1.2; color:var(--ink); margin:0 0 16px; font-weight:700;
  }
  .guide-h3{font-size:15px; font-weight:700; color:var(--ink); margin:24px 0 12px; display:flex; align-items:center; gap:8px;}
  .guide-h2 + .guide-h3{margin-top:4px;}
  .guide-h3::before{content:""; width:4px; height:16px; border-radius:2px; background:#2F6FE8;}
  .guide-h2-num{
    display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
    width:38px; height:38px; border-radius:12px;
    background:linear-gradient(135deg,#2F6FE8,#1247E0); color:#fff;
    font:700 15px 'Inter',sans-serif; letter-spacing:.02em;
    box-shadow:0 6px 14px rgba(47,111,232,.28);
  }

  /* Numbered badges, same colours as the markers on the screenshots. */
  .guide-num{display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50%; flex-shrink:0; color:#fff; font:700 13px 'Inter',sans-serif;}
  .guide-num-blue{background:#3E6BE0;}
  .guide-num-orange{background:#E8912F;}
  .guide-num-purple{background:#8A5BD6;}
  .guide-num-green{background:#4E8A55;}
  .guide-num-red{background:#D9533F;}

  .guide-lead{font-size:14px; line-height:1.6; color:var(--text); margin:0;}
  .guide-quick{display:grid; grid-template-columns:1fr; gap:10px;}
  .guide-quick-item{display:grid; grid-template-columns:26px 1fr; column-gap:12px; row-gap:2px; align-items:center; background:var(--paper-raised); border:1px solid var(--line); border-radius:16px; padding:14px 16px; box-shadow:var(--shadow);}
  .guide-quick-item strong{font-size:15px; color:var(--ink);}
  .guide-quick-item > span:last-child{grid-column:2; font-size:13px; line-height:1.5; color:var(--text);}

  .guide-split{display:grid; grid-template-columns:1fr; gap:16px; align-items:start;}
  .guide-figure{margin:0; border-radius:18px; overflow:hidden; background:linear-gradient(160deg,#EEF2FB,#F7F4EF); border:1px solid var(--line);}
  .guide-figure img{display:block; width:100%; height:auto;}
  .guide-figure-phone{max-width:230px; justify-self:center; background:none; border:0; border-radius:0;}

  .guide-steps{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:12px;}
  .guide-step{display:flex; gap:12px; align-items:flex-start; font-size:14px; line-height:1.5; color:var(--ink);}
  .guide-step > div{padding-top:2px;}
  .guide-step-note{color:var(--text-muted); font-size:13px;}

  .guide-ratings{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:14px 0 0 38px;}
  .guide-rating{display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:12px; color:#fff; font-size:12px; line-height:1.35;}
  .guide-rating b{display:block; font-size:13px;}
  .guide-rating-key{width:22px; height:22px; border-radius:6px; background:rgba(255,255,255,.92); display:flex; align-items:center; justify-content:center; font:700 12px 'Inter',sans-serif; flex-shrink:0;}
  .guide-rating-again{background:var(--stamp);} .guide-rating-again .guide-rating-key{color:var(--stamp);}
  .guide-rating-hard{background:var(--gold);} .guide-rating-hard .guide-rating-key{color:var(--gold);}
  .guide-rating-good{background:var(--sage);} .guide-rating-good .guide-rating-key{color:var(--sage);}
  .guide-rating-easy{background:var(--ink);} .guide-rating-easy .guide-rating-key{color:var(--ink);}

  .guide-tabs{display:grid; grid-template-columns:1fr; gap:12px;}
  .guide-card{background:var(--paper-raised); border:1px solid var(--line); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow);}
  .guide-card-head{display:flex; align-items:center; gap:10px;}
  .guide-card-kicker{font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted);}
  .guide-card h3{font-family:'Fraunces',serif; font-size:18px; margin:0; color:var(--ink);}
  .guide-card-intro{font-size:13px; color:var(--text-muted); margin:8px 0 4px;}
  .guide-terms{margin:0;}
  .guide-term{padding:9px 0; border-bottom:1px solid var(--line);}
  .guide-term:last-child{border-bottom:none; padding-bottom:0;}
  .guide-term dt{font-size:13.5px; font-weight:700; color:var(--ink); margin-bottom:2px;}
  .guide-term dd{margin:0; font-size:13px; line-height:1.5; color:var(--text);}
  .guide-howto{display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:12px; padding:10px 12px; border-radius:12px; background:#EFF4FE;}
  .guide-howto-label{flex-basis:100%; font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:#2F6FE8; font-weight:700;}
  .guide-howto-step{font-size:12.5px; font-weight:600; color:var(--ink); background:#fff; border-radius:999px; padding:3px 10px;}
  .guide-howto i{font-style:normal; color:var(--text-muted); font-size:12px;}
  .guide-note-box{display:block; font-size:12.5px; line-height:1.5; color:var(--ink);}

  .guide-tips{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px;}
  .guide-tip{display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--paper-raised); border:1px solid var(--line); border-left:4px solid; border-radius:14px; padding:12px 14px; font-size:13.5px; line-height:1.45; color:var(--text); box-shadow:var(--shadow);}
  .guide-tip b{color:var(--ink);}
  .guide-tip-blue{border-left-color:#3E6BE0;}
  .guide-tip-orange{border-left-color:#E8912F;}
  .guide-tip-purple{border-left-color:#8A5BD6;}
  .guide-tip-green{border-left-color:#4E8A55;}
  .guide-keys{display:flex; gap:4px; flex-shrink:0;}
  .guide-keys kbd{min-width:26px; height:28px; padding:0 7px; display:inline-flex; align-items:center; justify-content:center; border:1px solid rgba(32,52,95,.2); border-bottom-width:3px; border-radius:7px; background:#fff; font:700 12.5px 'Inter',sans-serif; color:var(--ink);}

  .guide-concepts{margin:0; padding-left:20px;}
  .guide-concepts li{font-size:13.5px; line-height:1.55; color:var(--text); margin-bottom:12px;}
  .guide-concepts li:last-child{margin-bottom:0;}
  .guide-concepts strong{color:var(--ink);}
  .guide-intervals{display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:8px 0;}
  .guide-intervals span{font-size:12px; font-weight:600; color:var(--sage); background:var(--sage-soft); padding:4px 10px; border-radius:999px;}
  .guide-intervals i{font-style:normal; color:var(--text-muted); font-size:12px;}

  .guide-lessons{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
  .guide-lesson{background:var(--paper-raised); border:1px solid var(--line); border-radius:14px; padding:12px; box-shadow:var(--shadow);}
  .guide-lesson-top{display:flex; flex-direction:column; align-items:flex-start; gap:6px; margin-bottom:6px;}
  .guide-lesson h4{font-family:'Fraunces',serif; font-size:14px; line-height:1.25; margin:0; color:var(--ink);}
  .guide-lesson p{font-size:12px; line-height:1.45; color:var(--text-muted); margin:0;}
  .guide-level{font-size:10.5px; font-weight:600; color:#1247E0; background:#EFF4FE; padding:2px 8px; border-radius:999px;}
  .guide-note{font-size:12px; color:var(--text-muted); margin:8px 2px 0;}

  .guide-routine{margin-top:30px; border-radius:var(--radius); padding:16px 18px; background:linear-gradient(135deg,#2F6FE8,#1247E0); color:#fff; box-shadow:0 10px 30px rgba(47,111,232,.25);}
  .guide-routine-title{font-family:'Fraunces',serif; font-size:17px; font-weight:700; margin-bottom:10px;}
  .guide-routine ol{margin:0; padding-left:20px;}
  .guide-routine li{font-size:14px; line-height:1.5; margin-bottom:4px;}
  .guide-cta{margin-top:18px; padding:16px;}

  /* Breakpoints follow the guide's own width: on laptops it can sit in the
     narrow app frame, where the phone layout fits best. */
  @container (min-width:640px){
    .guide-quick{grid-template-columns:repeat(3,1fr);}
    .guide-quick-item{align-content:start;}
    .guide-tabs{grid-template-columns:repeat(3,1fr);}
  }
  @container (min-width:860px){
    .guide-hero h1{font-size:38px;}
    .guide-split{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:28px; align-items:center;}
    .guide-split-phone{grid-template-columns:240px minmax(0,1fr);}
    .guide-lessons{grid-template-columns:repeat(4,1fr);}
  }

/* ===== styles/110-desktop-landscape.css ===== */
  /* ===== Laptop / desktop landscape shell (>=1024px wide, landscape) =====
     On a laptop the app fills the whole screen instead of sitting in a
     phone-shaped frame:
     - A permanent left sidebar on every signed-in screen: logo on top,
       tabs, then the teacher/student switch and the account button at the
       bottom. It replaces the topbar and the "back to menu" links.
     - Content is fluid: dashboards, the lesson page and the study session
       use the full width (grids add columns as the window grows). Only
       running text is capped, at ~50-75 characters per line.
     - Utility screens (pickers, editors, account) stay in a 1200px column.
     - Big screens scale the whole app up (see the end of this file), so no
       vh or unbounded vw here: zoom multiplies them. Use %, cqh or a
       position:fixed box, which all stay true to the window.
     Everything below 1024px keeps the mobile/tablet layout untouched. */
  .sidebar-toggle{ display:none; }
  @media (min-width:1024px) and (orientation:landscape){
    :root{
      --side-w:256px;
      --gutter:clamp(24px, 2.6vw, 48px);
      --utility-w:1200px;
      --measure:72ch;
    }

    html,body{ background:var(--app-bg-color); }
    body{ padding:0; display:block; min-height:100%; }
    #phone{
      max-width:none; width:100%; min-height:100%; margin:0;
      border-radius:0; box-shadow:none;
      background-attachment:fixed;
    }

    .app-backdrop{ position:fixed; inset:0; height:auto; }
    .app-backdrop .wb-bg{ height:250px; }
    /* The ring's tip lines up with the right edge of the content. */
    .app-backdrop .wb-art{ top:16px; right:calc(var(--gutter) + 16px); width:248px; }

    .topbar{ padding:22px var(--gutter) 10px; }
    main{ padding:28px var(--gutter) 48px; }
    main > *{ min-width:0; }

    /* ---------- utility screens: one centered column ---------- */
    .screen-enter:not(:has(> .bottom-fixed-wrap)) > main{
      width:100%; max-width:calc(var(--utility-w) + 2 * var(--gutter)); margin:0 auto;
    }

    /* ---------- left sidebar (tab bar, or desktopSideNav on other screens) ---------- */
    #phone:has(.bottom-fixed-wrap) > .screen-enter{ padding-left:var(--side-w); }
    /* Logo, role switch and account all live in the sidebar. */
    #phone:has(.bottom-fixed-wrap) > .screen-enter > .topbar{ display:none; }
    .screen-enter:has(> .bottom-fixed-wrap) > main{ width:100%; }
    .side-nav-only{ display:block; }
    .bottom-fixed-wrap{
      top:0; bottom:0; left:0; transform:none;
      width:var(--side-w); max-width:none;
      display:flex; flex-direction:column;
      background:rgba(255,255,255,.72);
      border-right:1px solid rgba(32,52,95,.07);
      box-shadow:10px 0 30px rgba(32,52,95,.035);
    }
    .bottom-fixed-wrap > .brand{
      display:flex; align-items:center; gap:6px; flex-shrink:0;
      padding:26px 28px 24px;
    }
    .bottomnav{
      flex:1; min-height:0; flex-direction:column; gap:4px;
      padding:4px 16px 18px;
      background:none; -webkit-backdrop-filter:none; backdrop-filter:none;
      border-top:none; box-shadow:none;
    }
    .navbtn{
      flex:0 0 auto; flex-direction:row; justify-content:flex-start; gap:12px;
      padding:10px 14px; border-radius:12px;
      font-size:14.5px; text-align:left;
    }
    .navbtn:hover{ background:rgba(32,52,95,.05); color:var(--ink); }
    .navbtn.active:hover{ background:rgba(47,111,232,0.16); }
    .navbtn .ic{ width:20px; height:20px; flex-shrink:0; }
    .navbtn:focus-visible, .side-me:focus-visible{ outline:2px solid #2F6FE8; outline-offset:2px; }

    /* Bottom of the sidebar: role switch + account (opens upwards). */
    .side-account{
      display:flex; flex-direction:column; gap:4px;
      margin-top:auto; padding-top:12px; border-top:1px solid var(--line);
    }
    .side-me{
      width:100%; display:flex; align-items:center; gap:10px;
      padding:8px 10px; border:none; border-radius:12px; background:none;
      cursor:pointer; text-align:left; font-family:'Inter',sans-serif;
    }
    .side-me:hover{ background:rgba(32,52,95,.05); }
    .side-me-avatar{
      width:34px; height:34px; border-radius:50%; flex-shrink:0;
      display:flex; align-items:center; justify-content:center;
      background:var(--ink); color:#fff; font-weight:700; font-size:14px;
    }
    .side-me-text{ display:flex; flex-direction:column; min-width:0; }
    .side-me-label{ font-size:13.5px; font-weight:650; color:var(--ink); }
    .side-me-email{
      font-size:12px; color:var(--text-muted);
      overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
    }
    .side-account .my-account-menu{ top:auto; bottom:calc(100% + 6px); margin-top:0; }

    /* The sidebar replaces "back to the menu" links. Links back to an
       in-between screen (lesson, vocabulary list) stay, and so does the
       one on vocabulary search, which opens from inside the Review tab. */
    #phone:has(.bottom-fixed-wrap) main:not(:has(#review-flashcard-search)) .back-link:not(.back-link-keep):is([data-act="back-student-lessons"], [data-act="back-to-review-tab"], [data-act="back-to-audio-tab"]){
      display:none;
    }
    /* ---------- Hide / show the sidebar (focus mode) ----------
       Hidden: the sidebar slides away and the content keeps its exact width
       (window minus the sidebar), so it simply moves to the centre. */
    #phone:has(.bottom-fixed-wrap) .sidebar-toggle{
      position:fixed; top:24px; left:calc(var(--side-w) - 46px); z-index:45;
      width:32px; height:32px; padding:0;
      display:flex; align-items:center; justify-content:center;
      border:1px solid var(--line); border-radius:10px;
      background:rgba(255,255,255,.9); color:var(--ink); cursor:pointer;
      transition:left .22s ease, background .15s;
    }
    .sidebar-toggle:hover{ background:#fff; }
    .sidebar-toggle:focus-visible{ outline:2px solid #2F6FE8; outline-offset:2px; }
    .sidebar-toggle svg{ transition:transform .22s ease; }
    .sidebar-toggle::after{
      content:"Hide sidebar"; position:absolute; top:calc(100% + 8px); left:0;
      padding:6px 10px; border-radius:8px; background:var(--ink); color:#fff;
      font:600 12px/1 'Inter',sans-serif; white-space:nowrap;
      opacity:0; pointer-events:none; transition:opacity .12s;
    }
    .sidebar-toggle:hover::after, .sidebar-toggle:focus-visible::after{ opacity:1; }
    #phone.side-collapsed .sidebar-toggle{ left:16px; }
    #phone.side-collapsed .sidebar-toggle svg{ transform:rotate(180deg); }
    #phone.side-collapsed .sidebar-toggle::after{ content:"Show sidebar"; }
    .bottom-fixed-wrap{ transition:transform .22s ease; }
    #phone:has(.bottom-fixed-wrap) > .screen-enter{ transition:padding .22s ease; }
    #phone.side-collapsed:has(.bottom-fixed-wrap) > .screen-enter{
      padding-left:calc(var(--side-w) / 2); padding-right:calc(var(--side-w) / 2);
    }
    #phone.side-collapsed .bottom-fixed-wrap{
      transform:translateX(-100%); visibility:hidden;
      transition:transform .22s ease, visibility 0s .22s;
    }
    #phone.side-collapsed:has(.bottom-fixed-wrap) .rate-fixed-wrap{ left:50%; }
    #phone.side-collapsed:has(.bottom-fixed-wrap) .toast{ left:calc(50% - 220px); right:calc(50% - 220px); }

    /* "Add" button: bottom-right of the content area. */
    .fab{ position:fixed; right:var(--gutter); bottom:32px; width:56px; height:56px; }

    /* ---------- type scale ---------- */
    .page-title{ font-size:32px; margin:0 0 24px; letter-spacing:-0.01em; }
    .page-sub{ font-size:14.5px; }
    .section-head h2{ font-size:20px; }
    h1{ font-size:34px; }

    /* ---------- Lessons tab: card grid ---------- */
    .student-lessons-screen{ position:fixed; inset:0; height:auto; }
    /* main is a flex column so the "How to use MAGI" link can sit at the
       bottom, level with My account in the sidebar; the cards grid lives in
       .lessons-list. */
    .student-lessons-screen > main{ padding-bottom:20px; }
    .student-lessons-screen .lessons-list{
      display:grid; align-content:start;
      grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
      gap:20px;
    }
    .student-lessons-screen > main > .lessons-guide-link-wrap{ margin:auto 0 8px; padding-top:40px; }
    .student-lessons-screen .lesson-item{
      position:relative; z-index:1;
      margin:0; padding:22px 24px; min-height:0;
      display:flex; flex-direction:column; justify-content:space-between; gap:14px;
    }
    .lesson-item{ transition:transform .15s, box-shadow .15s, border-color .15s; }
    .lesson-item:hover{
      transform:translateY(-2px); border-color:#CFC7B6;
      box-shadow:0 14px 34px rgba(15,23,42,.09);
    }
    .lesson-item h3{ font-size:18px; }
    .lesson-item .meta{ font-size:13px; }
    .student-lessons-screen .lesson-item > div[style*="height"]{ display:none; }
    /* Topic folder list: same card grid. */
    main:has(> .lesson-item){
      display:grid; align-content:start;
      grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:20px;
    }
    main:has(> .lesson-item) > :not(.lesson-item){ grid-column:1 / -1; }
    main:has(> .lesson-item) > .lesson-item{ margin:0; }

    /* ---------- Review / Audio tabs: feature cards side by side ---------- */
    main:has(> .feature-card-hero){
      display:grid; align-content:start;
      grid-template-columns:repeat(2, minmax(0, 1fr));
      gap:24px;
    }
    /* Audio tab has a third card (Shadowing): three across. */
    main:has(> .feature-card-hero.shadow){ grid-template-columns:repeat(3, minmax(0, 1fr)); }
    main:has(> .feature-card-hero) > .page-title,
    main:has(> .feature-card-hero) > .search-entry-card,
    main:has(> .feature-card-hero) > .empty-state{ grid-column:1 / -1; }
    main:has(> .feature-card-hero) > .page-title{ margin-bottom:0; }
    main > .feature-card-hero{
      margin:0; min-height:240px; padding:28px 32px;
      grid-template-columns:minmax(0, 1fr) minmax(160px, .8fr);
    }
    main > .feature-card-hero h2{ font-size:30px; }
    main > .feature-card-hero p{ font-size:15px; }
    main > .feature-card-hero .fc-artwork img{ max-height:170px; }
    main > .search-entry-card{ margin:0; padding-top:10px; padding-bottom:10px; }
    main > .search-entry-card .search-entry-icon{ width:36px; height:36px; }
    /* Three across (Audio) leaves each card too narrow for text beside
       artwork, so stack it: title / description / full-width button /
       artwork. The cards are subgrids of one shared set of rows, so each
       row lines up across all three cards even when one description wraps
       to two lines; the artwork sits in a same-height box, centred. */
    main:has(> .feature-card-hero.shadow) > .feature-card-hero{
      grid-row:span 4; grid-template-rows:subgrid; grid-template-columns:minmax(0, 1fr);
      row-gap:0; align-content:stretch; padding:26px 28px 24px;
    }
    main:has(> .feature-card-hero.shadow) > .feature-card-hero > .fc-content{ display:contents; }
    main:has(> .feature-card-hero.shadow) > .feature-card-hero h2{ font-size:28px; margin:0 0 6px; }
    main:has(> .feature-card-hero.shadow) > .feature-card-hero p{ margin:0 0 18px; align-self:start; }
    main:has(> .feature-card-hero.shadow) > .feature-card-hero :is(.fc-review-btn, .fc-outline-btn-full){
      max-width:none; width:100%; min-height:52px; margin:0; align-self:start;
    }
    main:has(> .feature-card-hero.shadow) > .feature-card-hero .fc-artwork{
      height:200px; min-height:0; margin-top:20px;
    }
    main:has(> .feature-card-hero.shadow) > .feature-card-hero :is(.fc-artwork img, .fc-artwork .sh-art){
      width:auto; max-width:100%; height:170px; max-height:170px;
    }

    /* Review / Audio cards with Choose lessons + Start: compact. */
    main > .feature-card-hero.study-card{ min-height:0; padding:22px 26px 12px; row-gap:6px; }
    main > .feature-card-hero.study-card h2{ font-size:28px; margin-bottom:4px; }
    main > .feature-card-hero.study-card p{ font-size:14.5px; margin-bottom:0; }
    main > .feature-card-hero.study-card .fc-artwork img{ max-height:118px; }
    main:has(> .feature-card-hero.shadow) > .feature-card-hero.study-card{ padding:22px 24px 12px; }
    main:has(> .feature-card-hero.shadow) > .feature-card-hero.study-card p{ margin:0 0 4px; }
    main:has(> .feature-card-hero.shadow) > .feature-card-hero.study-card .fc-artwork{ height:128px; margin-top:6px; }
    main:has(> .feature-card-hero.shadow) > .feature-card-hero.study-card :is(.fc-artwork img, .fc-artwork .sh-art){ height:118px; max-height:118px; }

    /* ---------- Progress: dashboard grid ----------
       Left: streak / retention + the three totals / activity calendar.
       Right: "Lessons completed", as tall as the left side and scrolling
       inside if the list is longer. Dense placement lets the totals sit
       next to retention and the list start beside the streak; anything
       else in main (titles, back links, teacher sections) spans the row. */
    main:has(> .streak-card){
      display:grid; grid-auto-flow:row dense; align-content:start; align-items:start;
      grid-template-columns:minmax(0, 1fr) minmax(0, 2fr) minmax(340px, 2fr);
      gap:20px;
    }
    main:has(> .streak-card) > *{ grid-column:1 / -1; margin:0; }
    main:has(> .streak-card) > .page-title{ margin-bottom:0; }
    main > .streak-card{ grid-column:1 / 3; padding:22px 28px; }
    main > .streak-card + .perf-card{
      grid-column:1 / 2; align-self:stretch;
      display:flex; flex-direction:column; justify-content:center;
    }
    main > .streak-card + .perf-card + .perf-card{ grid-column:1 / 3; }
    main:has(> .streak-card) > .stat-grid{
      grid-column:2 / 3; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:16px;
      align-self:stretch;
    }
    main:has(> .streak-card) > .stat-grid > .stat-card{
      display:flex; flex-direction:column; justify-content:center;
    }
    /* height:0 + min-height:100% = exactly the height of the rows it spans,
       without stretching those rows. */
    main > .stat-grid + .perf-card{
      grid-column:3; grid-row:span 3;
      height:0; min-height:100%; overflow-y:auto;
    }
    main:has(> .streak-card) .perf-card{ padding:18px 22px 16px; }
    .perf-card-title{ font-size:15px; }
    .streak-card .streak-num{ font-size:38px; }
    .streak-card .streak-label{ font-size:15px; }
    .streak-card .streak-sub{ font-size:13px; }
    .retention-num, .active-days-num{ font-size:30px; }
    .retention-sub, .active-days-sub{ font-size:13.5px; }
    .dot-row{ gap:5px; }
    .dot{ width:11px; height:11px; border-radius:3px; }
    .stat-card{ padding:16px 20px; }
    .stat-card .num{ font-size:30px; }
    .stat-card .lbl{ font-size:13.5px; }
    .lesson-list-item{ font-size:14px; padding:10px 0; }
    .lesson-pct{ font-size:13px; }

    /* ---------- Lesson page: two equal columns, one screen tall ----------
       Left: cover, title and study actions, fixed in place.
       Right: the learning path, scrolling on its own (like the answer
       side of a flashcard). Each column scrolls by itself only if its
       content is taller than the window. */
    .screen-enter.lesson-view-screen > main{ max-width:none; }
    .screen-enter.lesson-view-screen:has(.lp-path){
      position:fixed; inset:0; display:flex; flex-direction:column; overflow:hidden;
      container-type:size;
    }
    .screen-enter.lesson-view-screen:has(.lp-path) > main{
      flex:1 1 auto; min-height:0; padding-bottom:0;
      display:grid; grid-template-columns:repeat(2, minmax(0, 1fr));
      grid-template-rows:minmax(0, 1fr); column-gap:48px;
    }
    main > .lp-hero:has(+ .lp-path),
    main > .lp-hero + .lp-path{ min-height:0; overflow-y:auto; padding-bottom:32px; }
    /* Room for the cards' shadows inside the scrolling column, and a soft
       fade at the bottom edge to hint that it scrolls. */
    main > .lp-hero + .lp-path{
      padding:0 18px 48px 6px; margin-right:-18px;
      -webkit-mask-image:linear-gradient(to bottom, #000 calc(100% - 48px), transparent);
      mask-image:linear-gradient(to bottom, #000 calc(100% - 48px), transparent);
    }
    .lp-hero .lp-image, .lp-hero .lp-image-fallback{
      aspect-ratio:16 / 9; max-height:36cqh; margin-top:20px;
    }
    .lp-title{ font-size:clamp(32px, 2.6vw, 44px); }
    .lp-subtitle{ font-size:17px; }
    .lp-crumb-sep{ display:none; }
    #phone:has(.bottom-fixed-wrap) .lp-topic-crumb{
      font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-soft);
    }
    .content-block{ max-width:var(--measure); }
    .my-words-list{ max-width:none; }
    /* Vocabulary search: results as wide as the search box, and only as
       tall as the rows (pre-wrap would show the template's line breaks). */
    .field:has(#review-flashcard-search) + .content-block{ max-width:none; white-space:normal; }
    .lp-path > .lp-section-title{ margin-top:0; font-size:24px; }
    .lp-part-card{ padding:18px 22px; transition:transform .15s, box-shadow .15s; }
    .lp-part-card:hover{ transform:translateY(-1px); box-shadow:0 16px 34px rgba(28,39,55,.10); }
    .lp-part-title{ font-size:17px; }
    .lp-part-sub, .lp-part-status{ font-size:14px; }
    .lp-part-icon{ width:40px; height:40px; border-radius:10px; }

    /* ---------- Welcome / sign-in: one blended canvas ----------
       The rocket artwork sits in the left 45% of the screen; the sign-in
       column takes the wider right 55%. There is no hard edge between the
       two: the sky/wave background reaches past the artwork and fades out
       into the page colour (mask), so both halves read as one scene.
       The screen is a window-sized box, so its widths are in %. */
    .welcome-screen{ --art-w:45%; position:fixed; inset:0; overflow:hidden auto; }
    .welcome-banner{
      position:fixed; top:0; bottom:0; right:auto; width:calc(var(--art-w) + 22%); height:auto;
      -webkit-mask-image:linear-gradient(to right, #000 55%, transparent 100%);
      mask-image:linear-gradient(to right, #000 55%, transparent 100%);
    }
    .welcome-banner .wb-art{
      /* The drawing inside the 400x300 viewBox sits up and to the right
         (planet near the top-right corner), so the box is offset by that
         amount to put the rocket + planet group itself at the centre of
         the left panel. */
      top:50%; right:auto; left:calc(var(--art-w) * .75); transform:translate(-73%, -36%);
      width:min(1320px, calc(var(--art-w) * 1.7)); overflow:visible;
    }
    /* Units are the SVG's own, so the gap to the planet scales with the art. */
    .welcome-banner .wb-art image{ transform:translate(-34px, 34px); }
    .welcome-screen > .topbar{
      position:absolute; top:0; left:0; width:var(--art-w); padding:28px 40px;
    }
    .screen-enter.welcome-screen > main{
      max-width:none; margin:0 0 0 var(--art-w); min-height:100%;
      display:flex; flex-direction:column; justify-content:center;
      padding:48px clamp(40px, 6vw, 112px) 48px clamp(24px, 3vw, 56px);
    }
    .welcome-screen > main > *{ width:100%; max-width:560px; }
    .welcome-hero{ padding:0 0 8px; }
    /* Wider than the 560px column, so the headline stays on its two lines. */
    .welcome-hero h1{ font-size:clamp(40px, 3.9vw, 58px); line-height:1.1; margin-bottom:36px; width:max-content; }
    .welcome-screen .btn-accent{ font-size:16px; min-height:58px; border-radius:12px; }
    .login-features{ margin-top:44px; }
    .login-feature h4{ font-size:14px; }
    .login-feature p{ font-size:12.5px; }

    /* ---------- Study session (flashcards) ----------
       One screen, no leftover space: the screen is a viewport-tall column
       (progress bar / card / rating bar) and the card takes exactly the
       height that remains, whatever the window size or browser zoom.
       The answer side splits 1:1: left = recognise (sentence, IPA, audio,
       check, picture), top-aligned; right = look up (meaning, examples,
       related, usage, notes), which scrolls on its own when long.
       Type scale: sentence 19px, headings 14.5px, body 14px / 1.6. */
    .screen-enter.review-screen{ position:fixed; inset:0; display:flex; flex-direction:column; }
    .screen-enter.review-screen > main{
      flex:1 1 auto; min-height:0; max-width:none;
      display:flex; flex-direction:column; overflow-y:auto;
      padding-top:24px; padding-bottom:20px !important;
    }
    .review-screen > main > *{ flex-shrink:0; }
    .review-screen .review-progress{ width:100%; margin-bottom:16px; }
    /* With "Exit review" hidden, keep the teacher's Edit control on the right. */
    .review-screen > main > div:first-child > :last-child{ margin-left:auto; }
    /* Front and back fill the same remaining height, so flipping never
       jumps. The front face is in normal flow (inline position:relative). */
    .review-screen > main > .card-stage{
      flex:1 1 auto; min-height:320px; margin-bottom:0; display:flex;
    }
    .review-screen .flashcard{ flex:1 1 auto; min-height:0; display:flex; }
    .review-screen .face-front{ flex:1 1 auto; min-height:0; overflow-y:auto; }
    /* Front text sits near the top (44px) and scrolls if it overflows. */
    .review-screen .face{ padding:44px 40px 28px; justify-content:flex-start; }
    .review-screen .face-front > *{ width:100%; max-width:640px; flex-shrink:0; }
    .review-screen .face-front .word{ font-size:40px; }
    .review-screen .face-front .cloze-sentence{ font-size:20px; line-height:1.5; }
    .review-screen .collapsible-head{ font-size:12.5px; }
    .review-screen .collapsible-body{ font-size:14px; }
    .review-screen .guess-input{ font-size:15px; padding:12px 16px; }
    .review-screen .tap-hint{ font-size:11.5px; }

    .review-screen > main > .answer-card-split{ flex:1 1 auto; min-height:320px; }
    .answer-card-split{ display:flex; padding:0; overflow:hidden; margin-bottom:0; }
    .answer-card-split > .ac-main,
    .answer-card-split > .ac-details{
      flex:1 1 0; min-width:0; min-height:0; overflow-y:auto; padding:28px 32px;
    }
    /* Centred vertically when short; "safe" falls back to top-aligned when
       the column overflows, so nothing is cut off. */
    /* Left column auto-fits, never scrolls: sentence, IPA, audio and the
       answer check keep their size; the picture takes whatever height is
       left and scales to fit it whole. The column is a size container so
       the sentence can step down (19px -> 16px) on short windows.
       "safe" centring falls back to top-aligned if text alone overflows. */
    .answer-card-split > .ac-main{
      display:flex; flex-direction:column; align-items:center; justify-content:safe center;
      border-right:1px solid var(--line);
      container-type:size;
    }
    .answer-card-split > .ac-main > *{ flex-shrink:0; width:100%; max-width:520px; }
    .answer-card-split .cloze-sentence{ font-size:clamp(16px, 2.7cqh, 19px); line-height:1.45; }
    .answer-card-split .back-word-box .ipa{ font-size:13px; margin-top:4px; }
    .answer-card-split .speak-dot-row{ margin:12px auto 0; }
    .answer-card-split .speak-dot{ width:44px; height:44px; }
    .answer-card-split .speak-dot .speaker-icon-svg{ width:34px; height:34px; }
    .answer-card-split > .ac-main > .answer-check{ width:fit-content; margin:8px auto 0; }
    /* The picture box (inline style: 200px tall, cover-cropped) becomes the
       flexible part: it fills the remaining height, and the image inside is
       shown whole at its own aspect ratio, as large as the box allows. */
    .answer-card-split > .ac-main > div:has(> img){
      flex:1 1 0; min-height:150px; max-height:340px;
      height:auto !important; margin:16px 0 0 !important;
      border-radius:0 !important; overflow:visible !important;
      display:flex; align-items:center; justify-content:center;
    }
    .answer-card-split > .ac-main > div:has(> img) > img{
      width:auto !important; height:auto !important; max-width:100%; max-height:100%;
      object-fit:contain !important; border-radius:16px;
    }
    .answer-card-split > .ac-details{
      padding-bottom:40px;
      -webkit-mask-image:linear-gradient(to bottom, #000 calc(100% - 32px), transparent);
      mask-image:linear-gradient(to bottom, #000 calc(100% - 32px), transparent);
    }
    .answer-card-split > .ac-details > *{ max-width:var(--measure); }
    .answer-card-split .info-box{ margin-top:16px; }
    .answer-card-split .info-box + .info-box{ padding-top:16px; }
    .answer-card-split > .ac-details > .info-box:first-child{ margin-top:0; }
    .answer-card-split .info-box-head{ font-size:14.5px; }
    .answer-card-split .info-box-body{ font-size:14px; line-height:1.6; margin-top:6px; }
    .answer-card-split .info-box-body li{ margin-bottom:5px; line-height:1.6; }
    .answer-card-split .note-section{ margin-top:16px; padding-top:14px; }
    /* Rating bar: in flow, right under the card. */
    .review-screen .rate-fixed-wrap{
      position:static; transform:none; width:100%; max-width:520px; margin:16px auto 0;
    }
    /* Front side: reserve the rating bar's space so the card doesn't shrink on flip. */
    .review-screen .rate-ghost{ display:block; visibility:hidden; pointer-events:none; }
    .review-screen .rate-fixed-wrap:not(.rate-ghost){ animation:screenFadeIn .2s ease both; }
    /* Show the existing keyboard shortcuts (1-4) on the rating buttons. */
    .rate-btn{ position:relative; font-size:13px; padding:9px 4px; }
    .rate-btn::after{
      position:absolute; top:6px; right:8px;
      font:600 10px/1 'IBM Plex Mono',monospace; opacity:.6;
    }
    .rate-again::after{ content:"1"; }
    .rate-hard::after{ content:"2"; }
    .rate-good::after{ content:"3"; }
    .rate-easy::after{ content:"4"; }

    .loading-wrap{ min-height:420px; }

    /* ---------- overlays ---------- */
    .toast{ left:calc(50% - 220px); right:calc(50% - 220px); bottom:40px; }
    .rate-fixed-wrap{ bottom:20px; max-width:640px; }
    /* Centre bottom overlays on the content area, not the whole window. */
    #phone:has(.bottom-fixed-wrap) .rate-fixed-wrap{ left:calc(50% + var(--side-w) / 2); }
    #phone:has(.bottom-fixed-wrap) .toast{
      left:calc(50% + var(--side-w) / 2 - 220px); right:calc(50% - var(--side-w) / 2 - 220px);
    }
  }

  /* ===== Automatic scale on big screens =====
     A 14" laptop runs the app about 1280-1512px wide; a 2560px monitor shows
     the same fixed sizes at half that share of the screen. So big screens get
     a whole-app zoom, the way the OS already scales a small hi-dpi laptop.
     The tier comes from the screen (data-screen-tier, set in index.html), so
     the browser's own zoom keeps working on top of it. Each step also needs a
     window big enough for it: split-screen windows fall back to a smaller
     step, and phones, tablets and laptops never match. */
  @media (orientation:landscape) and (min-width:1400px) and (min-height:700px){
    html[data-screen-tier="1"], html[data-screen-tier="2"], html[data-screen-tier="3"]{ zoom:1.25; }
  }
  @media (orientation:landscape) and (min-width:1650px) and (min-height:780px){
    html[data-screen-tier="2"], html[data-screen-tier="3"]{ zoom:1.5; }
  }
  @media (orientation:landscape) and (min-width:2000px) and (min-height:1000px){
    html[data-screen-tier="3"]{ zoom:2; }
  }
