@layer reset, base, layout, components, pages, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, ul, blockquote { margin: 0; }
  button, input, select { font: inherit; }
  button, a { -webkit-tap-highlight-color: transparent; }
  button { cursor: pointer; }
  a { color: inherit; text-decoration: none; }
  button { color: inherit; }
  img, svg { display: block; }
  button:disabled { cursor: not-allowed; }
}

@layer base {
  :root {
    color-scheme: light;
    --ink: #263d32;
    --green: #254f3f;
    --green-dark: #1a3e30;
    --muted: #738074;
    --background: #f7f8f4;
    --line: #e5e9e0;
    --sage: #e8efd9;
    --lavender: #efebf8;
    --peach: #f8ebe2;
    --blue: #e7f0f1;
    --yellow: #f8f1dc;
    --pink: #f5e9ed;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: var(--background);
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
  }
  body { min-width: 320px; line-height: 1.5; }
  button { border: 0; }
  :focus-visible { outline: 3px solid #668855; outline-offset: 4px; }
  :disabled { opacity: .48; }
  h1, h2, h3 { font-weight: 650; line-height: 1.25; }
  h1 { font-size: clamp(26px, 2.2vw, 35px); letter-spacing: -1.2px; }
  h2 { font-size: 21px; letter-spacing: -.55px; }
  h3 { font-size: 16px; }
  input, select { min-width: 0; }
  input::placeholder { color: #849084; }
  ::selection { background: #d8e8b7; color: #203b2e; }
  .icon { flex-shrink: 0; }
  .sage { background: var(--sage); color: #567246; }
  .lavender { background: var(--lavender); color: #86759c; }
  .peach { background: var(--peach); color: #b07d58; }
  .yellow { background: var(--yellow); color: #a48c46; }
  .blue { background: var(--blue); color: #668a91; }
  .pink { background: var(--pink); color: #a87589; }
  .skip-link { position: fixed; top: -70px; left: 16px; z-index: 50; padding: 12px 20px; background: var(--green); color: white; border-radius: 10px; }
  .skip-link:focus { top: 12px; }
}

@layer layout {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; display: flex; flex-direction: column; padding: 35px 21px 0; background: #fffefa; border-right: 1px solid var(--line); z-index: 10; }
  .brand { display: flex; align-items: center; gap: 9px; width: fit-content; margin: 0 0 34px 10px; color: var(--green); }
  .brand > span { font-size: 37px; font-weight: 750; letter-spacing: -2px; line-height: 1; }
  .brand-dot { color: #d6a274; }
  .sidebar-course { display: flex; gap: 10px; align-items: center; padding: 14px 10px; margin-bottom: 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .sidebar-course strong { display: block; font-weight: 650; font-size: 13px; }
  .sidebar-course span:not(.italian-flag) { display: block; font-size: 9.5px; color: var(--muted); margin-top: 2px; }
  .nav-caption { padding-left: 13px; margin-bottom: 12px; font-size: 9px; font-weight: 650; letter-spacing: 1.65px; color: #93998d; }
  .navigation { display: grid; gap: 8px; }
  .nav-link { display: flex; align-items: center; gap: 13px; padding: 14px 14px; border-radius: 10px; font-size: 13px; font-weight: 550; color: #727d70; transition: background .18s, color .18s; }
  .nav-link:hover { background: #f1f3eb; color: var(--green); }
  .nav-link.active { background: var(--green); color: #fff; box-shadow: 0 4px 8px #254f3f0c; }
  .nav-link.active .icon { color: #d8e8b1; }
  .nav-dot { width: 5px; height: 5px; border-radius: 50%; background: #d8e8b1; margin-left: auto; }
  .sidebar-bottom { margin-top: auto; padding-top: 35px; }
  .little-reminder { background: #f3f4eb; padding: 6px 10px 21px; margin: 0 5px 24px; border-radius: 14px; text-align: center; }
  .little-reminder strong { display: block; font-size: 15px; line-height: 1.45; letter-spacing: -.2px; }
  .little-reminder p { font-size: 11px; color: #7f8977; line-height: 1.8; margin-top: 8px; }
  .plant-illustration { position: relative; height: 85px; width: 92px; margin: auto; }
  .plant-stem { position: absolute; width: 3px; height: 45px; background: #71835f; left: 45px; top: 19px; transform: rotate(5deg); }
  .plant-leaf { position: absolute; background: #94a678; width: 28px; height: 15px; border-radius: 0 90% 0 90%; left: 20px; top: 20px; transform: rotate(20deg); }
  .plant-leaf.two { left: 46px; top: 28px; transform: rotate(-65deg); background: #667e57; }
  .plant-leaf.three { left: 24px; top: 40px; width: 22px; height: 12px; background: #bac69a; }
  .plant-pot { position: absolute; left: 31px; top: 59px; width: 33px; height: 20px; background: #daa782; clip-path: polygon(0 0, 100% 0, 83% 100%, 17% 100%); }
  .plant-spark { position: absolute; right: 0; top: 17px; font-size: 20px; color: #b4bca0; font-weight: 300; }
  .profile-button { width: 100%; display: flex; align-items: center; text-align: left; gap: 10px; padding: 21px 0; border-top: 1px solid var(--line); background: transparent; }
  .avatar { width: 33px; height: 33px; display: grid; place-items: center; background: #e9eadc; border: 3px solid white; outline: 1px solid #e8eade; border-radius: 50%; font-size: 13px; font-weight: 650; color: #7a8260; flex-shrink: 0; }
  .profile-button strong { font-size: 11px; font-weight: 650; display: block; max-width: 124px; overflow: hidden; text-overflow: ellipsis; }
  .profile-button small { display: block; color: #92998a; font-size: 9px; margin-top: 2px; }
  .profile-button > .icon { margin-left: auto; color: #919a88; }
  .workspace { margin-left: 232px; }
  .topbar { height: 79px; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; border-bottom: 1px solid var(--line); background: #fbfcf9; }
  .topbar-location { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #76806e; }
  .topbar-location .icon { color: #7f9570; }
  .topbar-tools { display: flex; align-items: center; gap: 23px; }
  .language-badge { display: flex; align-items: center; gap: 8px; font-size: 11px; padding-right: 22px; border-right: 1px solid var(--line); }
  .language-badge b { background: #f0f2e8; border: 1px solid #e6eade; font-weight: 600; font-size: 9px; padding: 1px 5px; border-radius: 4px; margin-left: 3px; }
  .italian-flag { display: inline-flex; width: 23px; height: 16px; border-radius: 3px; overflow: hidden; flex-shrink: 0; border: 1px solid #00000007; box-shadow: 0 1px 2px #00000005; }
  .italian-flag i { width: 33.333%; background: #fcfcf8; }
  .italian-flag i:first-child { background: #71a287; }
  .italian-flag i:last-child { background: #d99588; }
  .top-stat { display: flex; align-items: center; gap: 6px; font-size: 11px; }
  .top-stat strong { font-weight: 650; color: #4b5946; font-size: 13px; }
  .top-stat > span { color: #818878; font-size: 10px; }
  .streak-stat > .icon { color: #d7a270; fill: #f3dabb; }
  .xp-stat > .icon { color: #b09d55; fill: #eee4ac; }
  .settings-shortcut { width: 30px; height: 30px; color: #8a9480; }
  .mobile-brand, .mobile-nav { display: none; }
  main { max-width: 1480px; padding: 34px 40px 0; margin: auto; }
  main:focus { outline: none; }
  .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
  .page-heading h1 { overflow-wrap: anywhere; }
  .eyebrow { color: #8c9680; font-size: 9px; font-weight: 650; letter-spacing: 1.65px; margin-bottom: 10px; }
  .page-subtitle { margin-top: 9px; font-size: 12px; color: #87907f; }
  .date-label { color: #8e9785; font-size: 11px; align-self: flex-end; padding-bottom: 3px; white-space: nowrap; }
  .dashboard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 265px; gap: 26px; align-items: start; }
  .learning-column { min-width: 0; }
  .right-rail { display: grid; gap: 20px; }
  .page-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 28px 0 22px; margin-top: 16px; border-top: 1px solid var(--line); color: #909985; font-size: 10px; }
  .page-footer > span:last-child { display: inline-flex; align-items: center; gap: 6px; font-family: Georgia, serif; font-style: italic; }
}

@layer components {
  .level-picker { display: flex; align-items: center; gap: 24px; padding: 17px 20px; margin-bottom: 27px; background: #fffefa; border: 1px solid #dce5d1; border-radius: 12px; }
  .level-picker label { display: grid; gap: 7px; flex: 0 1 300px; min-width: 0; font-size: 11px; font-weight: 600; color: #516b42; }
  .level-picker select { width: 100%; padding: 10px 12px; border: 1px solid #b8cba2; border-radius: 7px; background: #f1f5e9; color: #315238; font-size: 13px; cursor: pointer; }
  .level-picker > div { flex: 1; min-width: 0; }
  .level-picker p { color: #536b44; font-size: 12px; line-height: 1.7; }
  .level-picker small { display: block; color: #707b63; font-size: 10px; margin-top: 5px; }
  .button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 43px; padding: 11px 19px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 600; transition: background .16s, transform .16s, box-shadow .16s; }
  .button:not(:disabled):active, .practice-card:active { transform: translateY(1px); }
  .button-dark { color: #fff; background: var(--green); box-shadow: 0 3px 0 #193a2c; }
  .button-dark:hover:not(:disabled) { background: #32624e; box-shadow: 0 3px 0 #193a2c, 0 5px 12px #254f3f16; }
  .button-outline { border-color: #dce3d5; background: #fffefa; color: #506448; }
  .button-outline:hover:not(:disabled) { background: #f1f4e9; border-color: #c6d4b9; }
  .button-danger { background: #a34b3e; color: white; }
  .button-recording { background: #a35246; color: white; box-shadow: 0 3px 0 #7f3e36; }
  .full-width { width: 100%; }
  .icon-button { display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; padding: 8px; border-radius: 50%; background: transparent; }
  .icon-button:hover:not(:disabled) { background: #e9eee0; }
  .icon-button.small { padding: 5px; color: #9aa18f; }
  .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 0; background: transparent; color: #668050; font-size: 12px; font-weight: 600; }
  .text-button:hover:not(:disabled) { color: #254f3f; text-decoration: underline; text-underline-offset: 3px; }
  .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
  .section-heading h2 { font-size: 20px; }
  .section-heading .eyebrow { margin-bottom: 5px; font-size: 8.5px; }
  .section-heading > span { color: #89917e; font-size: 10px; white-space: nowrap; }
  .section-heading.compact h2 { font-size: 17px; }
  .category-tag { display: inline-flex; align-items: center; padding: 4px 9px; font-size: 10px; font-weight: 600; border-radius: 5px; }
  .pronunciation-hint { font-size: 11px; letter-spacing: .25px; color: #938b9d; }
  .audio-button { background: #f2f4ed; color: #6e8361; }
  .notifications { position: fixed; bottom: 25px; right: 25px; z-index: 100; display: grid; gap: 8px; max-width: min(410px, calc(100% - 32px)); pointer-events: none; }
  .toast { padding: 16px 20px; background: #254f3f; color: #fff; border-radius: 12px; box-shadow: 0 8px 35px #102b2626; font-size: 13px; line-height: 1.6; animation: enter .2s ease-out; }
  .dialog-notifications { padding: 12px 20px 20px; display: grid; gap: 8px; }
  .storage-notice { display: flex; align-items: flex-start; gap: 10px; padding: 15px; margin-bottom: 22px; border: 1px solid #ddc6a7; border-radius: 9px; background: #faf0df; color: #786140; font-size: 12px; line-height: 1.7; text-align: left; }
  .result-screen .storage-notice { margin-top: 20px; margin-bottom: 0; }
  .empty-state { grid-column: 1 / -1; display: grid; justify-items: center; text-align: center; padding: 70px 25px; background: #fffefa; border: 1px dashed #dce3d3; border-radius: 16px; }
  .empty-state > .icon { color: #9ca890; margin-bottom: 18px; }
  .empty-state p { color: var(--muted); max-width: 370px; margin: 12px 0 23px; }
  @keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}

@layer pages {
  .hero-card { position: relative; isolation: isolate; overflow: hidden; background: #eaf0d8; border: 1px solid #e3e9cf; border-radius: 16px; min-height: 289px; padding: 29px 30px 25px; }
  .hero-copy { position: relative; z-index: 1; max-width: 57%; }
  .hero-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 8px; letter-spacing: 1.1px; font-weight: 600; color: #68805b; margin-bottom: 15px; }
  .hero-tag > span { width: 5px; height: 5px; border-radius: 50%; background: #6e8a4a; }
  .hero-card h2 { font-size: clamp(32px, 3vw, 43px); letter-spacing: -1.8px; line-height: 1.1; color: #355239; }
  .hero-card h2 > span { color: #70845a; }
  .hero-card p { margin: 15px 0 20px; font-size: 11px; line-height: 1.8; color: #647153; }
  .hero-card .button { font-size: 11px; min-height: 40px; padding: 10px 15px; }
  .hero-meta { display: flex; align-items: center; gap: 5px; font-size: 9px; color: #8b9878; margin-top: 13px; }
  .hero-illustration { position: absolute; right: -13px; bottom: 0; width: 56%; height: auto; z-index: 0; pointer-events: none; }
  .learning-path { margin-top: 27px; }
  .chapter-count { font-size: 12px !important; color: #68785c !important; }
  .chapter-count > span { color: #8e9781; font-size: 10px; margin-left: 3px; }
  .chapter-progress { display: flex; gap: 5px; height: 3px; margin: 0 0 20px; }
  .chapter-progress > span { flex: 1; background: #e5e9dc; border-radius: 3px; }
  .chapter-progress > span.filled { background: #93ac6e; }
  .lesson-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .lesson-card { display: flex; align-items: center; text-align: left; gap: 14px; min-height: 120px; padding: 16px; background: #fffefa; border: 1px solid #e6e9df; border-radius: 11px; transition: transform .18s, border-color .18s, box-shadow .18s; }
  .lesson-card:hover { border-color: #b1c19a; transform: translateY(-2px); box-shadow: 0 5px 15px #294b3208; }
  .lesson-card.next-lesson { border-color: #b8c99d; background: #f4f7ea; }
  .lesson-icon { display: grid; place-items: center; width: 47px; height: 51px; border-radius: 12px; flex-shrink: 0; }
  .lesson-info { min-width: 0; display: flex; flex-direction: column; }
  .lesson-kicker { display: flex; align-items: center; gap: 8px; font-size: 7.5px; letter-spacing: 1.05px; color: #939b87; white-space: nowrap; }
  .next-label { font-size: 6.5px; background: #e5edce; border-radius: 3px; padding: 1px 4px; color: #7c905e; letter-spacing: .6px; }
  .lesson-done { display: inline-flex; gap: 3px; align-items: center; font-size: 8px; letter-spacing: 0; color: #759757; }
  .lesson-info > strong { display: block; font-weight: 650; font-size: 13px; letter-spacing: -.15px; margin-top: 5px; line-height: 1.35; }
  .lesson-description { font-size: 10px; color: #929a87; margin-top: 3px; line-height: 1.5; }
  .lesson-info small { font-size: 8px; color: #99a08f; margin-top: 9px; }
  .lesson-info small > span { margin: 0 3px; }
  .lesson-arrow { color: #a3ae95; margin-left: auto; }
  .extra-practice { margin-top: 29px; }
  .practice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .practice-card { padding: 17px 16px 14px; border: 1px solid #00000003; border-radius: 11px; text-align: left; transition: filter .16s, transform .16s; }
  .practice-card:hover { filter: saturate(1.25) brightness(.985); transform: translateY(-2px); }
  .practice-symbol { display: block; margin-bottom: 13px; }
  .practice-card > strong { display: block; font-size: 12px; font-weight: 600; color: #536044; letter-spacing: -.1px; }
  .practice-card > span:last-child { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 8.5px; margin-top: 6px; color: #889080; }
  .daily-card { padding: 20px 22px 23px; border: 1px solid #e4e8de; border-radius: 14px; background: #fffefa; }
  .card-heading { display: flex; align-items: center; justify-content: space-between; }
  .card-heading h2 { font-size: 15px; letter-spacing: -.25px; }
  .daily-card > p:not(.goal-caption) { font-size: 10px; color: #969d8a; margin-top: 2px; }
  .goal-ring { width: 147px; height: 147px; margin: 15px auto 11px; position: relative; }
  .goal-ring > svg { width: 100%; height: 100%; transform: rotate(-90deg); }
  .goal-ring circle { fill: none; stroke-width: 6; }
  .ring-track { stroke: #eff2e7; }
  .ring-progress { stroke: #91ad61; stroke-linecap: round; transition: stroke-dasharray .5s; }
  .goal-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .goal-ring .icon { color: #a8b584; fill: #e5edcf; margin-bottom: 6px; }
  .goal-ring strong { font-size: 26px; font-weight: 650; line-height: 1.25; }
  .goal-ring strong > span { font-size: 14px; color: #a4ae94; font-weight: 400; }
  .goal-ring small { font-size: 8px; letter-spacing: 1.7px; color: #a0a78e; margin-top: 4px; }
  .goal-caption { text-align: center; font-size: 9px; color: #7e8a6c; }
  .week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 21px; padding-top: 17px; border-top: 1px solid #eef0e7; }
  .week-days > div { display: flex; flex-direction: column; align-items: center; font-size: 8px; color: #a8ae9f; gap: 9px; }
  .week-days b { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #e9eddf; background: #f7f8f0; border-radius: 50%; }
  .week-days i { width: 3px; height: 3px; border-radius: 50%; background: #d2dac5; }
  .week-days .today { color: #72894e; font-weight: 600; }
  .week-days .today b { border-color: #bdcc9c; background: #f2f6e7; }
  .week-days .active b { color: #fff; background: #88a85e; border-color: #88a85e; }
  .word-of-day { position: relative; overflow: hidden; isolation: isolate; padding: 23px; background: #eeebf5; border-radius: 14px; border: 1px solid #e9e5f0; }
  .word-card-label { display: flex; align-items: center; gap: 7px; font-size: 7px; font-weight: 600; letter-spacing: 1.1px; color: #9a8fac; }
  .word-card-label .icon { color: #aa9bbe; }
  .word-of-day h2 { font-size: 13px; color: #70617e; margin: 13px 0 17px; letter-spacing: -.1px; }
  .daily-word { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 26px; letter-spacing: -.7px; color: #77608c; position: relative; z-index: 1; overflow-wrap: anywhere; }
  .word-of-day .pronunciation-hint { margin-top: 6px; font-size: 9px; }
  .word-translation { color: #958c9d; margin-top: 12px; font-size: 11px; }
  .audio-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #dbd2e4; background: #f6f3fa; border-radius: 6px; padding: 7px 11px; color: #8e7ba0; font-size: 10px; margin-top: 20px; }
  .audio-pill:hover { background: #fff; }
  .word-decoration { position: absolute; right: -3px; bottom: -43px; font-family: Georgia, serif; font-style: italic; font-size: 140px; color: #e4deee; z-index: -1; }
  .culture-card { position: relative; padding: 21px; border: 1px solid #e7e9df; border-radius: 13px; background: #fbfcf7; }
  .culture-icon { color: #aa9876; margin-bottom: 13px; display: block; }
  .culture-card h2 { font-size: 14px; margin-bottom: 8px; letter-spacing: -.25px; }
  .culture-card p { color: #929985; font-size: 11px; line-height: 1.9; }
  .culture-footer { display: flex; align-items: center; gap: 7px; margin-top: 18px; color: #a2a992; font-size: 8px; }
  .culture-footer .italian-flag { width: 15px; height: 10px; border-radius: 2px; opacity: .75; }

  .vocabulary-summary { display: flex; gap: 28px; margin: 5px 0 30px; color: #8b967e; font-size: 12px; }
  .vocabulary-summary > span { display: inline-flex; align-items: center; gap: 7px; }
  .vocabulary-summary strong { color: #576947; font-weight: 650; }
  .vocabulary-toolbar { display: flex; gap: 14px; }
  .search-field { display: flex; align-items: center; gap: 12px; flex: 1; border: 1px solid #dfe5d7; background: #fffefa; border-radius: 9px; padding: 0 16px; color: #97a18a; }
  .search-field:focus-within { outline: 2px solid #96ad76; outline-offset: 1px; }
  .search-field input { border: 0; background: transparent; padding: 14px 0; width: 100%; color: var(--ink); outline: none; font-size: 12px; }
  .bookmark-filter.selected { background: #edf1df; border-color: #a7bc86; }
  .filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 22px 0; }
  .filter-tabs button { border-radius: 7px; padding: 9px 14px; background: transparent; color: #849077; font-size: 11px; }
  .filter-tabs button:hover { background: #eef1e7; }
  .filter-tabs button.selected { background: var(--green); color: #fff; }
  .results-count { font-size: 10px; color: #949d89; margin-bottom: 16px; }
  .vocabulary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
  .vocabulary-card { background: #fffefa; border: 1px solid var(--line); border-radius: 13px; padding: 19px 21px 14px; }
  .vocab-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .bookmark-button { color: #b5bea8; }
  .bookmark-button.bookmarked { color: #b49a4b; }
  .bookmark-button.bookmarked .icon { fill: #f1e6b7; }
  .vocabulary-card h2 { font-size: 24px; font-family: Georgia, serif; font-weight: 400; letter-spacing: -.6px; }
  .vocabulary-card .pronunciation-hint { margin-top: 6px; font-size: 10px; color: #9aa18f; }
  .vocab-translation { margin-top: 13px; color: #727f64; font-size: 12px; }
  .vocab-card-bottom { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #edf0e6; padding-top: 12px; margin-top: 19px; gap: 7px; }
  .word-mastery { display: flex; align-items: center; gap: 4px; }
  .word-mastery i { width: 5px; height: 5px; background: #e5e9dd; border-radius: 50%; }
  .word-mastery i.filled { background: #8da86b; }
  .word-mastery small { color: #9ba48d; font-size: 8px; margin-left: 5px; }

  .pronunciation-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
  .speaking-card { background: #fffefa; border: 1px solid #e1e7d8; border-radius: 17px; padding: 23px 33px 18px; text-align: center; }
  .speaking-card-heading { display: flex; align-items: center; justify-content: space-between; }
  .speaking-card-heading > span:last-child { color: #9ca58e; font-size: 10px; }
  .speaking-visual { position: relative; width: 146px; height: 146px; margin: 28px auto 20px; }
  .speaking-visual > span { position: absolute; inset: 0; border: 1px solid #edf0e2; border-radius: 50%; }
  .speaking-visual > span:nth-child(2) { inset: 16px; background: #f6f8ee; border-color: #e8edda; }
  .speaking-visual > div { position: absolute; inset: 31px; display: grid; place-items: center; color: #8a9e6b; background: #e9f0d7; border-radius: 50%; }
  .speaking-visual.recording > div { background: #f6e2dd; color: #ae6b5d; }
  .speaking-visual.recording > span { animation: pulse 1.5s infinite; border-color: #eac5b9; }
  .speaking-card h2 { font-size: clamp(24px, 2.5vw, 34px); font-family: Georgia, serif; font-weight: 400; font-style: italic; line-height: 1.4; color: #456447; margin-top: 8px; }
  .phrase-translation { margin-top: 11px; color: #7c896d; font-size: 13px; }
  .phrase-hint { color: #9ca68b; font-size: 10px; letter-spacing: .5px; margin-top: 12px; }
  .listen-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; }
  .slow-button { display: flex; align-items: center; gap: 5px; color: #8d9a7a; background: none; font-size: 11px; padding: 10px 0; }
  .slow-button:hover { color: var(--green); }
  .speaking-divider { height: 1px; background: #eef0e6; margin: 29px 0 24px; }
  .microphone-button { min-width: 212px; }
  .microphone-note { color: #a0a78f; font-size: 9px; margin: 14px auto 6px; max-width: 330px; }
  .self-practice-toggle { font-weight: 400; font-size: 10px; margin: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
  .browser-note { color: #7b876d; font-size: 12px; line-height: 1.8; max-width: 430px; margin: auto; }
  .self-practice-box { background: #f5f7ef; border: 1px solid #e9eddf; padding: 18px; margin-top: 20px; border-radius: 10px; }
  .self-practice-box p { color: #7e8b70; font-size: 11px; line-height: 1.8; max-width: 390px; margin: auto auto 15px; }
  .self-practice-box small { display: block; color: #98a087; font-size: 9px; margin-top: 12px; }
  .phrase-navigation { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; margin-top: 21px; border-top: 1px solid #eef0e6; gap: 10px; }
  .phrase-navigation > span { display: flex; gap: 5px; }
  .phrase-navigation i { width: 5px; height: 5px; background: #e3e8d8; border-radius: 50%; }
  .phrase-navigation i.active { background: #95ae72; }
  .phrase-navigation .text-button { font-size: 10px; }
  .pronunciation-tip { display: flex; gap: 13px; padding: 21px 23px; background: #f0f0e3; border-radius: 11px; margin-top: 18px; color: #8b9277; }
  .pronunciation-tip h3 { font-size: 12px; color: #727c5f; }
  .pronunciation-tip p { font-size: 11px; margin-top: 7px; line-height: 1.8; }
  .pronunciation-tip small { display: block; font-size: 9px; margin-top: 8px; color: #9da38c; }
  .phrase-sidebar > h2 { font-size: 20px; margin-top: 5px; }
  .phrase-sidebar > p { font-size: 11px; color: #99a18b; margin-top: 9px; }
  .phrase-list { display: grid; gap: 8px; margin-top: 22px; }
  .phrase-list-item { display: flex; align-items: center; gap: 12px; padding: 15px 13px; background: #fffefa; border: 1px solid var(--line); border-radius: 10px; text-align: left; }
  .phrase-list-item.selected { border-color: #b3c79b; background: #f0f5e6; }
  .phrase-list-item:hover:not(:disabled) { border-color: #b3c79b; }
  .phrase-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #f0f3e8; color: #9ba88a; font-size: 9px; flex-shrink: 0; }
  .phrase-list-item strong { display: block; font-size: 11px; font-weight: 600; }
  .phrase-list-item small { display: block; font-size: 9px; color: #9aa58a; margin-top: 4px; }
  .phrase-list-item > .icon { margin-left: auto; color: #acb59c; }
  .privacy-note { display: flex; align-items: flex-start; gap: 10px; margin: 22px 7px; color: #9ba58c; }
  .privacy-note p { font-size: 10px; line-height: 1.8; }
  .speech-feedback { display: flex; align-items: flex-start; text-align: left; gap: 11px; padding: 17px; border-radius: 9px; margin-top: 22px; background: #f2f1e5; color: #85835d; }
  .speech-feedback.success { background: #eef4e5; color: #6d854b; }
  .speech-feedback.error { background: #f8eee8; color: #a27860; }
  .speech-feedback strong { display: block; font-size: 12px; }
  .speech-feedback p { font-size: 11px; line-height: 1.7; margin-top: 6px; }
  .speech-feedback small { display: block; font-size: 9px; margin-top: 7px; opacity: .85; }
  .speech-feedback .transcript { color: var(--ink); }
  @keyframes pulse { 0%, 100% { opacity: .6; transform: scale(.93); } 50% { opacity: 1; transform: scale(1.03); } }

  .stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 26px; }
  .stat-card { border: 1px solid var(--line); border-radius: 13px; background: #fffefa; padding: 22px; }
  .stat-icon { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 12px; }
  .stat-card > strong { display: block; font-size: 29px; font-weight: 650; letter-spacing: -1px; margin-top: 17px; }
  .stat-card > span:last-child { display: block; color: #97a088; font-size: 10px; margin-top: 3px; }
  .progress-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, 1fr); gap: 22px; }
  .activity-card, .skills-card { background: #fffefa; border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
  .activity-chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 15px 8px 0; }
  .chart-column { flex: 1; text-align: center; min-width: 0; }
  .chart-column > span { display: block; font-size: 9px; color: #9aaa89; margin-bottom: 8px; }
  .bar-track { height: 140px; display: flex; align-items: flex-end; border-bottom: 1px solid #e3e8d9; background: repeating-linear-gradient(to top, transparent, transparent 34px, #f0f2ea 34px, #f0f2ea 35px); }
  .chart-bar { width: 100%; max-width: 41px; margin: 0 auto; background: #c6d5a7; border-radius: 6px 6px 0 0; }
  .chart-column.today .chart-bar { background: #6d8f58; }
  .chart-column > strong { display: block; font-weight: 500; font-size: 10px; color: #9ba58c; margin-top: 12px; }
  .chart-column.today > strong { color: #68824d; }
  .chart-caption { font-size: 10px; text-align: center; color: #9aa38c; margin-top: 23px; line-height: 1.7; }
  .skills-card h2 { font-size: 18px; }
  .skills-card > p { font-size: 10px; color: #98a08d; margin: 9px 0 22px; }
  .skill-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid #edf0e5; }
  .skill-row > span { display: flex; align-items: center; gap: 11px; color: #859273; font-size: 11px; }
  .skill-row > strong { color: #718561; font-size: 12px; font-weight: 600; }
  .skill-row small { color: #a0a991; font-size: 8px; margin-left: 4px; font-weight: 400; }
  .mastery-note { display: block; color: #9ca68e; font-size: 9px; line-height: 1.7; margin-top: 20px; }
  .achievements-section { margin-top: 32px; }
  .achievement-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .achievement-card { padding: 25px 18px 20px; text-align: center; background: #f3f5ed; border: 1px dashed #dde3d3; border-radius: 12px; }
  .achievement-card.unlocked { background: #fffefa; border: 1px solid #dde3d3; }
  .achievement-icon { display: grid; place-items: center; width: 57px; height: 57px; border-radius: 50%; background: #e9eddf; color: #b3bda3; margin: auto auto 15px; }
  .achievement-card h3 { font-size: 12px; color: #849373; }
  .achievement-card p { font-size: 10px; color: #a1aa92; line-height: 1.7; margin: 8px auto 15px; max-width: 150px; }
  .achievement-status { display: inline-flex; align-items: center; gap: 5px; color: #a6af9b; font-size: 8px; }
  .unlocked .achievement-status { color: #7b985f; }

  dialog { border: 1px solid #e3e8db; border-radius: 20px; padding: 0; color: var(--ink); box-shadow: 0 30px 100px #122c2c30; background: #fffefa; max-height: calc(100dvh - 48px); }
  dialog::backdrop { background: #1b302c66; backdrop-filter: blur(5px); }
  .lesson-dialog { width: min(780px, calc(100% - 36px)); }
  .lesson-dialog[open] { display: flex; flex-direction: column; }
  .lesson-modal-header { display: flex; align-items: center; gap: 20px; padding: 26px 30px; border-bottom: 1px solid #edf0e5; }
  .lesson-modal-header > .icon-button { color: #a0a893; }
  .lesson-modal-header > div { flex: 1; }
  .lesson-modal-header > div > span { display: block; font-size: 10px; color: #849476; margin-bottom: 10px; }
  .exercise-progress { height: 7px; border-radius: 10px; background: #eef2e6; overflow: hidden; }
  .exercise-progress > span { display: block; height: 100%; background: #8eaa66; border-radius: 10px; transition: width .3s; }
  .lesson-modal-header > strong { font-size: 15px; font-weight: 600; white-space: nowrap; }
  .lesson-modal-header > strong > span { color: #b0bba0; font-size: 12px; font-weight: 400; }
  .exercise-body { padding: 34px 48px 38px; }
  .exercise-type { display: flex; align-items: center; gap: 7px; font-size: 9px; color: #9bab89; letter-spacing: 1.4px; margin-bottom: 14px; }
  .exercise-body h2 { font-size: 27px; line-height: 1.35; letter-spacing: -.6px; margin-bottom: 26px; }
  [data-question-heading]:focus { outline: none; }
  .question-word { display: flex; align-items: center; justify-content: center; gap: 16px; background: #f1f5e9; padding: 22px; border: 1px solid #e7eddc; border-radius: 12px; margin-bottom: 26px; }
  .question-word > span { font-family: Georgia, serif; font-size: 33px; color: #607b4e; }
  .question-word .audio-button { background: #e6eed9; color: #819768; }
  .answer-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .answer-option { display: flex; align-items: center; gap: 10px; min-height: 59px; background: white; border: 1px solid #dfe6d5; border-bottom-width: 3px; border-radius: 9px; text-align: left; padding: 12px; font-size: 12px; color: #6e8060; }
  .answer-option:hover:not(:disabled) { background: #f7f9f0; border-color: #b9cca3; }
  .answer-option.selected { background: #edf3e2; border-color: #a7c181; color: #627e45; }
  .answer-option > .icon { margin-left: auto; }
  .answer-number { display: grid; place-items: center; border: 1px solid #e5eadb; background: #fbfcf7; border-radius: 5px; width: 25px; height: 25px; flex-shrink: 0; font-size: 9px; color: #acb69b; }
  .answer-option:disabled, .word-token:disabled, .written-answer:disabled { opacity: 1; }
  .answer-option.correct, .written-answer.correct { border-color: #9abc7a; background: #eef5e7; color: #668649; }
  .answer-option.incorrect, .written-answer.incorrect { border-color: #d8b7a5; background: #faf0e9; color: #a77b63; }
  .translation-prompt { background: #f3f5ed; padding: 20px 24px; border-radius: 10px; border: 1px solid #e6ebdc; font-size: 19px; color: #6b7b5c; margin: 0 0 28px; }
  .sentence-answer { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-height: 89px; padding: 14px 0; border-top: 1px solid #e7ecde; border-bottom: 1px solid #dfe6d3; }
  .sentence-answer > span { color: #b0bba1; font-size: 12px; }
  .word-token { background: #fff; border: 1px solid #dce5d1; border-bottom-width: 3px; border-radius: 8px; padding: 10px 15px; font-size: 15px; color: #66804f; }
  .word-token:hover:not(:disabled) { background: #eef4e4; }
  .word-token.used { color: transparent; background: #f0f3e9; border-color: #edf0e4; }
  .token-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 26px 0 5px; min-height: 47px; }
  .sentence-answer.correct .word-token { background: #edf5e4; border-color: #a8c28a; }
  .sentence-answer.incorrect .word-token { background: #faf0e9; border-color: #d9bda9; color: #ad846b; }
  .write-label { display: block; font-size: 11px; font-weight: 600; color: #879779; margin-bottom: 10px; }
  .written-answer { width: 100%; padding: 17px 18px; border: 1px solid #dce4d1; border-radius: 10px; background: white; font-size: 17px; color: #456a3e; }
  .written-answer::placeholder { color: #b0bba2; font-size: 14px; }
  .input-hint { font-size: 10px; color: #a0ac91; margin-top: 12px; line-height: 1.7; }
  .listening-prompt { text-align: center; margin-bottom: 24px; }
  .listen-big-button { display: inline-flex; flex-direction: column; align-items: center; gap: 13px; background: #eef2e4; color: #7c9661; padding: 22px 43px; border: 1px solid #dce6cc; border-bottom-width: 3px; border-radius: 13px; font-size: 11px; }
  .listening-prompt .text-button { display: block; margin: 12px auto 0; color: #9aa78b; font-size: 10px; font-weight: 400; text-decoration: underline; }
  .revealed-text { font-family: Georgia, serif; font-style: italic; font-size: 22px; color: #668054; margin-top: 15px; }
  .lesson-modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 24px 35px; background: #f8faf3; border-top: 1px solid #e9eddf; margin-top: auto; }
  .lesson-modal-footer .button { flex-shrink: 0; min-width: 139px; }
  .exercise-footer-note { font-size: 10px; color: #a0ab91; }
  .feedback-correct { background: #eef4e4; border-color: #e1ebd3; }
  .feedback-incorrect { background: #f7eee6; border-color: #efded1; }
  .answer-feedback { display: flex; align-items: flex-start; gap: 13px; color: #729151; }
  .feedback-icon { display: grid; place-items: center; width: 38px; height: 38px; background: #fff9; border-radius: 50%; flex-shrink: 0; }
  .answer-feedback strong { display: block; font-size: 14px; font-weight: 650; }
  .answer-feedback p { font-size: 10px; line-height: 1.8; margin-top: 5px; color: #849772; }
  .answer-feedback .correct-answer { font-size: 14px; font-weight: 600; color: #a78367; }
  .feedback-incorrect .answer-feedback { color: #aa8467; }
  .feedback-incorrect .answer-feedback p:not(.correct-answer) { color: #b0947c; }
  .quit-screen { text-align: center; padding: 64px 48px; }
  .quit-screen > .icon { color: #96ac7b; margin: 0 auto 25px; }
  .quit-screen h2 { font-size: 28px; }
  .quit-screen p { color: #8b9a7d; line-height: 1.9; max-width: 420px; margin: 20px auto 30px; }
  .quit-screen .text-button { display: block; margin: 15px auto 0; }
  .dialog-close { position: absolute; right: 18px; top: 18px; color: #a8b699; }
  .result-screen { text-align: center; padding: 42px 48px; }
  .result-trophy { position: relative; display: grid; place-items: center; width: 113px; height: 113px; margin: 0 auto 28px; color: #a9ad65; background: #f4f2d9; border-radius: 50%; }
  .result-trophy i { position: absolute; font-size: 30px; font-style: normal; color: #c4b87b; right: -22px; top: 0; }
  .result-trophy i:last-child { left: -20px; top: 62px; right: auto; font-size: 23px; color: #b3c294; }
  .result-screen h2 { font-size: 38px; color: #4f7042; letter-spacing: -1px; }
  .result-screen > p:not(.eyebrow) { font-size: 12px; color: #96a287; max-width: 390px; margin: 15px auto 0; line-height: 1.8; }
  .result-stats { display: flex; justify-content: center; gap: 14px; margin: 29px auto 0; }
  .result-stats > div { width: 175px; padding: 17px 12px; background: #f4f6ec; border: 1px solid #e6ebda; border-radius: 10px; }
  .result-stats .icon { color: #9dac7c; margin: auto auto 8px; }
  .result-stats strong { display: block; color: #728953; font-size: 23px; }
  .result-stats span { display: block; color: #a0ab91; font-size: 9px; margin-top: 3px; }
  .result-screen > p.completion-note { font-size: 9px; margin-top: 13px; }
  .result-screen > .button { margin-top: 27px; min-width: 230px; }
  .result-screen > .text-button { display: block; margin: 13px auto 0; font-size: 11px; }
  .settings-dialog { width: min(500px, calc(100% - 32px)); padding: 30px; }
  .settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 26px; }
  .settings-heading .eyebrow { font-size: 8px; margin-bottom: 7px; }
  .settings-heading h2 { font-size: 25px; }
  .settings-heading .icon-button { color: #9aa88b; }
  .field-label { display: block; font-size: 11px; font-weight: 600; color: #81946f; margin-bottom: 9px; }
  .field-label > span { font-size: 9px; color: #a5b198; margin-left: 4px; font-weight: 400; }
  .settings-input { width: 100%; padding: 12px; font-size: 13px; background: #fcfdf8; border: 1px solid #dfe7d3; border-radius: 8px; color: #637f4d; }
  .goal-options { display: flex; gap: 8px; border: 0; padding: 0; margin: 25px 0; }
  .goal-options legend { font-size: 11px; font-weight: 600; color: #81946f; margin-bottom: 10px; padding: 0; }
  .goal-options label { flex: 1; position: relative; }
  .goal-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .goal-options label > span { display: block; text-align: center; padding: 13px 4px; border: 1px solid #e1e7d7; border-radius: 8px; background: #fcfdf8; cursor: pointer; }
  .goal-options input:checked + span { background: #eff5e4; border-color: #a6bf89; }
  .goal-options input:focus-visible + span { outline: 3px solid #7d9c59; outline-offset: 3px; }
  .goal-options strong { display: block; color: #6d8854; font-size: 17px; }
  .goal-options small { display: block; color: #9ba98a; font-size: 8px; margin-top: 4px; }
  .settings-privacy { display: flex; gap: 10px; margin: 25px 0; color: #9cae8a; }
  .settings-privacy p { font-size: 10px; color: #95a587; line-height: 1.8; }
  .reset-button { display: block; margin: 21px auto 0; color: #b49883; font-weight: 400; font-size: 10px; }
  .settings-dialog > p { color: #8a9b7a; font-size: 12px; line-height: 1.9; margin-bottom: 17px; }
  .settings-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
  .consent-icon { color: #8ea676; margin: 0 0 25px; }
  #consent-dialog .full-width { margin-top: 8px; font-size: 11px; }
}

@layer responsive {
  @media (min-width: 1600px) {
    main { padding-top: 42px; }
    .dashboard-layout { grid-template-columns: minmax(0, 1fr) 295px; gap: 32px; }
    .hero-card { min-height: 320px; padding: 35px; }
    .hero-card h2 { font-size: 49px; }
    .hero-card p { font-size: 13px; }
    .hero-card .button { font-size: 12px; }
    .lesson-card { min-height: 131px; padding: 20px; }
    .lesson-info > strong { font-size: 15px; }
    .lesson-description { font-size: 11px; }
    .daily-card, .word-of-day, .culture-card { padding: 26px; }
  }
  @media (max-width: 1250px) {
    .sidebar { width: 210px; padding-left: 15px; padding-right: 15px; }
    .workspace { margin-left: 210px; }
    main { padding: 29px 28px 0; }
    .topbar { padding: 0 28px; }
    .dashboard-layout { grid-template-columns: minmax(0, 1fr) 237px; gap: 20px; }
    .hero-card { padding: 26px 25px; min-height: 282px; }
    .hero-card h2 { font-size: 37px; }
    .hero-illustration { width: 56%; right: -20px; bottom: 11px; }
    .hero-copy { max-width: 62%; }
    .lesson-card { padding: 13px 11px; gap: 10px; }
    .lesson-icon { width: 39px; height: 46px; border-radius: 10px; }
    .lesson-info > strong { font-size: 11px; }
    .lesson-description { font-size: 9px; }
    .lesson-arrow { display: none; }
    .lesson-kicker { font-size: 7px; gap: 5px; }
    .next-label { font-size: 6px; letter-spacing: .3px; }
    .practice-card { padding: 16px 12px; }
    .practice-card > strong { font-size: 11px; }
    .practice-card > span:last-child { font-size: 8px; }
    .daily-card { padding-left: 19px; padding-right: 19px; }
    .pronunciation-layout { grid-template-columns: minmax(0, 1fr) 265px; gap: 20px; }
    .speaking-card { padding: 22px; }
    .vocabulary-card { padding: 17px; }
    .vocab-card-bottom { gap: 0; }
    .word-mastery small { font-size: 7px; }
    .vocabulary-grid { gap: 12px; }
    .stat-card { padding: 19px; }
    .progress-layout { gap: 16px; }
    .activity-card, .skills-card { padding: 22px; }
    .activity-chart { gap: 12px; }
    .achievement-grid { gap: 12px; }
  }
  @media (max-width: 1020px) {
    .sidebar { display: none; }
    .workspace { margin-left: 0; }
    .mobile-brand { display: inline-flex; align-items: center; gap: 7px; font-size: 26px; font-weight: 700; letter-spacing: -1.5px; color: var(--green); }
    .mobile-brand .brand-icon { width: 28px; height: 28px; }
    .topbar-location { display: none; }
    .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(4, 1fr); bottom: 0; left: 0; right: 0; z-index: 20; background: #fffefaf5; backdrop-filter: blur(15px); border-top: 1px solid var(--line); padding: 8px 15px calc(9px + env(safe-area-inset-bottom)); box-shadow: 0 -3px 20px #203a3005; }
    .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #9ba68d; font-size: 9px; padding: 5px; border-radius: 9px; }
    .mobile-nav a[aria-current="page"] { color: #436645; background: #edf2e5; }
    main { padding-bottom: 65px; }
    .notifications { bottom: 87px; }
    .hero-card h2 { font-size: 43px; }
    .hero-card { min-height: 300px; }
    .lesson-info > strong { font-size: 13px; }
    .lesson-card { padding: 16px; gap: 13px; }
    .lesson-description { font-size: 10px; }
    .dashboard-layout { grid-template-columns: minmax(0, 1fr) 255px; gap: 23px; }
  }
  @media (max-width: 820px) {
    .dashboard-layout { grid-template-columns: minmax(0, 1fr); }
    .right-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
    .daily-card { padding: 18px 15px; }
    .daily-card .card-heading h2 { font-size: 13px; }
    .daily-card .goal-ring { width: 123px; height: 123px; margin: 13px auto; }
    .goal-caption { font-size: 8px; }
    .week-days { gap: 3px; margin-top: 17px; }
    .week-days b { width: 19px; height: 19px; }
    .word-of-day { padding: 20px 17px; }
    .word-card-label { letter-spacing: .6px; font-size: 6px; gap: 5px; }
    .word-of-day h2 { margin-top: 17px; }
    .daily-word { font-size: 24px; }
    .culture-card { padding: 20px 17px; }
    .culture-card p { font-size: 10px; }
    .culture-footer { font-size: 7px; flex-wrap: wrap; }
    .hero-card { padding: 30px; min-height: 300px; }
    .hero-illustration { width: 50%; right: 5px; bottom: -10px; }
    .hero-copy { max-width: 55%; }
    .hero-card h2 { font-size: 43px; }
    .lesson-arrow { display: block; }
    .lesson-card { min-height: 120px; }
    .lesson-icon { width: 49px; height: 52px; }
    .practice-card { padding: 20px; }
    .practice-card > strong { font-size: 13px; }
    .practice-card > span:last-child { font-size: 10px; }
    .vocabulary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vocabulary-card { padding: 20px; }
    .word-mastery small { font-size: 9px; }
    .pronunciation-layout { grid-template-columns: minmax(0, 1fr); }
    .phrase-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .phrase-sidebar { margin-top: 15px; }
    .speaking-card { padding: 25px 36px 20px; }
    .speaking-card h2 { font-size: 34px; }
    .stat-grid { gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-card > strong { font-size: 25px; }
    .stat-card > span:last-child { font-size: 8px; }
    .progress-layout { grid-template-columns: 1fr; }
    .skills-card { padding: 25px; }
    .achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-heading > .button { white-space: nowrap; font-size: 11px; }
    .page-heading > div { min-width: 0; }
  }
  @media (max-width: 600px) {
    .level-picker { flex-direction: column; align-items: stretch; gap: 12px; padding: 15px; margin-bottom: 23px; }
    .level-picker label { flex-basis: auto; }
    .level-picker select { font-size: 12px; }
    .level-picker p { font-size: 11px; }
    main { padding: 27px 20px 65px; }
    .topbar { height: 68px; padding: 0 20px; }
    .topbar-tools { gap: 15px; }
    .language-badge { display: none; }
    .top-stat { gap: 3px; }
    .top-stat strong { font-size: 11px; }
    .top-stat > span { font-size: 8px; }
    .top-stat .icon { width: 18px; height: 18px; }
    .settings-shortcut { padding: 5px; width: 26px; }
    .page-heading { margin-bottom: 24px; flex-wrap: wrap; gap: 17px; }
    .page-heading h1 { font-size: 27px; letter-spacing: -1px; line-height: 1.3; }
    .page-heading .eyebrow { font-size: 7px; letter-spacing: 1.4px; }
    .page-subtitle { font-size: 11px; max-width: 320px; line-height: 1.7; }
    .date-label { display: none; }
    .hero-card { padding: 24px; min-height: 284px; }
    .hero-copy { max-width: 66%; }
    .hero-tag { font-size: 6.5px; letter-spacing: .8px; margin-bottom: 14px; }
    .hero-card h2 { font-size: 36px; letter-spacing: -1.5px; white-space: nowrap; }
    .hero-card p { font-size: 10px; line-height: 1.9; margin: 14px 0 18px; }
    .hero-card .button { font-size: 10px; padding: 10px 12px; gap: 8px; min-height: 40px; }
    .hero-card .button .icon { width: 15px; }
    .hero-illustration { width: 280px; right: -64px; bottom: 0; opacity: .95; }
    .hero-meta { font-size: 7px; margin-top: 14px; }
    .lesson-grid { grid-template-columns: 1fr; gap: 10px; }
    .lesson-card { min-height: 113px; gap: 16px; padding: 17px; }
    .lesson-icon { width: 48px; height: 52px; }
    .lesson-info > strong { font-size: 14px; }
    .lesson-kicker { font-size: 7.5px; gap: 8px; }
    .next-label { font-size: 6.5px; }
    .lesson-description { font-size: 11px; }
    .lesson-info small { font-size: 8px; margin-top: 7px; }
    .section-heading h2 { font-size: 19px; }
    .section-heading.compact { flex-wrap: wrap; gap: 5px; }
    .section-heading > span { font-size: 9px; }
    .chapter-count > span { font-size: 8px; }
    .extra-practice { margin-top: 27px; }
    .practice-grid { gap: 9px; }
    .practice-card { padding: 16px 11px 13px; }
    .practice-card > strong { font-size: 10px; line-height: 1.4; }
    .practice-card > span:last-child { font-size: 8px; line-height: 1.7; align-items: flex-end; }
    .practice-card > span:last-child .icon { width: 12px; }
    .practice-symbol { margin-bottom: 12px; }
    .right-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .daily-card { padding: 18px 13px; }
    .goal-ring { width: 115px !important; height: 115px !important; }
    .goal-ring strong { font-size: 22px; }
    .goal-ring small { font-size: 6px; }
    .goal-ring .icon { width: 19px; }
    .goal-ring strong > span { font-size: 12px; }
    .week-days { gap: 2px; }
    .week-days b { width: 16px; height: 16px; }
    .week-days > div { font-size: 7px; }
    .goal-caption { font-size: 7px; min-height: 21px; }
    .word-of-day { padding: 20px 14px; }
    .word-card-label { line-height: 1.7; font-size: 5.5px; letter-spacing: .5px; gap: 5px; }
    .word-card-label .icon { width: 14px; }
    .word-of-day h2 { font-size: 12px; margin: 18px 0 19px; }
    .daily-word { font-size: 23px; letter-spacing: -.9px; }
    .word-of-day .pronunciation-hint { font-size: 7px; overflow-wrap: anywhere; }
    .word-translation { font-size: 10px; }
    .word-decoration { font-size: 120px; bottom: -33px; }
    .culture-card { grid-column: 1 / -1; padding: 20px; }
    .culture-icon { float: left; margin-right: 15px; margin-bottom: 8px; }
    .culture-card p { font-size: 11px; }
    .culture-footer { margin-top: 13px; font-size: 8px; }
    .page-footer { font-size: 8px; margin-top: 22px; padding: 22px 0; }
    .page-footer > span:last-child { font-size: 9px; text-align: right; }
    .vocabulary-summary { flex-wrap: wrap; gap: 12px 20px; font-size: 10px; margin-bottom: 25px; }
    .vocabulary-summary .icon { width: 16px; }
    .vocabulary-toolbar { gap: 9px; }
    .search-field { padding: 0 12px; gap: 8px; }
    .search-field input { font-size: 11px; }
    .bookmark-filter { font-size: 10px; padding: 8px 11px; gap: 6px; }
    .bookmark-filter .icon { width: 15px; }
    .filter-tabs { flex-wrap: nowrap; overflow: auto; padding: 4px 2px 9px; margin: 19px -2px 14px; }
    .filter-tabs button { flex-shrink: 0; font-size: 10px; padding: 8px 12px; }
    .vocabulary-grid { gap: 11px; }
    .vocabulary-card { padding: 12px; }
    .vocab-card-top { margin-bottom: 12px; }
    .vocabulary-card .category-tag { font-size: 8px; padding: 3px 6px; }
    .vocabulary-card .bookmark-button { padding: 5px; }
    .vocabulary-card .bookmark-button .icon { width: 16px; }
    .vocabulary-card h2 { font-size: 22px; overflow-wrap: anywhere; }
    .vocabulary-card .pronunciation-hint { font-size: 8px; overflow-wrap: anywhere; }
    .vocab-translation { font-size: 10px; min-height: 30px; }
    .word-mastery { gap: 3px; flex-wrap: wrap; max-width: 80px; }
    .word-mastery i { width: 4px; height: 4px; }
    .word-mastery small { width: 100%; margin-left: 0; font-size: 7px; margin-top: 4px; }
    .vocab-card-bottom .audio-button { padding: 7px; }
    .vocab-card-bottom .audio-button .icon { width: 17px; height: 17px; }
    .speaking-card { padding: 20px 21px 13px; }
    .speaking-card h2 { font-size: 28px; }
    .speaking-card-heading > span:last-child { font-size: 9px; }
    .speaking-visual { width: 128px; height: 128px; margin-top: 26px; }
    .speaking-visual > div { inset: 28px; }
    .speaking-visual .icon { width: 33px; }
    .phrase-translation { font-size: 12px; }
    .phrase-hint { font-size: 9px; line-height: 1.8; }
    .microphone-note { font-size: 8px; }
    .phrase-navigation { gap: 6px; }
    .phrase-navigation > span { gap: 3px; }
    .phrase-navigation i { width: 4px; height: 4px; }
    .phrase-navigation .text-button { font-size: 9px; }
    .phrase-list { grid-template-columns: 1fr; }
    .pronunciation-tip { padding: 20px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card { padding: 21px; }
    .stat-card > strong { font-size: 28px; }
    .stat-card > span:last-child { font-size: 9px; }
    .activity-card, .skills-card { padding: 21px; }
    .activity-card .section-heading h2 { font-size: 18px; }
    .activity-card .eyebrow { font-size: 6px; }
    .activity-chart { gap: 13px; padding: 12px 0 0; }
    .chart-caption { font-size: 9px; }
    .achievements-section .section-heading { align-items: flex-end; }
    .achievements-section .section-heading h2 { font-size: 17px; max-width: 240px; }
    .achievement-grid { gap: 10px; }
    .achievement-card { padding: 20px 13px; }
    .achievement-card h3 { font-size: 11px; }
    .achievement-card p { font-size: 9px; }
    dialog { max-height: calc(100dvh - 24px); border-radius: 15px; }
    .lesson-dialog { width: calc(100% - 22px); }
    .lesson-modal-header { gap: 13px; padding: 18px 14px; }
    .lesson-modal-header > strong { font-size: 12px; }
    .lesson-modal-header > strong > span { font-size: 10px; }
    .exercise-body { padding: 26px 22px 30px; }
    .exercise-body h2 { font-size: 24px; margin-bottom: 23px; }
    .question-word { padding: 20px 16px; }
    .question-word > span { font-size: 29px; }
    .answer-options { grid-template-columns: 1fr; gap: 8px; }
    .answer-option { min-height: 51px; padding: 10px 12px; }
    .answer-number { width: 23px; height: 23px; }
    .lesson-modal-footer { flex-wrap: wrap; gap: 17px; padding: 20px 22px; }
    .lesson-modal-footer > .button { margin-left: auto; }
    .lesson-modal-footer .exercise-footer-note { width: 100%; text-align: center; font-size: 9px; }
    .lesson-modal-footer:not(.feedback-correct):not(.feedback-incorrect) .button { width: 100%; }
    .answer-feedback { width: 100%; gap: 10px; }
    .answer-feedback strong { font-size: 13px; }
    .answer-feedback p { font-size: 10px; }
    .feedback-icon { width: 33px; height: 33px; }
    .translation-prompt { padding: 18px; font-size: 17px; }
    .sentence-answer { min-height: 100px; gap: 6px; }
    .sentence-answer > span { font-size: 11px; }
    .word-token { font-size: 14px; padding: 10px 12px; }
    .token-bank { gap: 7px; }
    .written-answer { font-size: 16px; }
    .written-answer::placeholder { font-size: 12px; }
    .input-hint { font-size: 9px; }
    .result-screen { padding: 38px 23px 30px; }
    .result-screen h2 { font-size: 32px; }
    .result-screen > p:not(.eyebrow) { font-size: 11px; }
    .result-stats { gap: 10px; }
    .result-stats > div { width: 145px; }
    .result-stats strong { font-size: 21px; }
    .result-stats span { font-size: 8px; }
    .quit-screen { padding: 46px 28px; }
    .quit-screen h2 { font-size: 26px; }
    .quit-screen p { font-size: 12px; }
    .settings-dialog { padding: 25px; }
    .settings-heading h2 { font-size: 23px; }
    .settings-actions { flex-direction: column; }
    .notifications { right: 16px; bottom: 86px; }
  }
  @media (max-width: 360px) {
    main { padding-left: 14px; padding-right: 14px; }
    .topbar { padding: 0 14px; }
    .topbar-tools { gap: 10px; }
    .hero-card { padding-left: 20px; padding-right: 20px; }
    .hero-card h2 { font-size: 34px; }
    .hero-illustration { right: -76px; }
    .goal-caption { font-size: 6.5px; }
    .practice-card { padding-left: 9px; padding-right: 9px; }
    .practice-card > span:last-child .icon { display: none; }
    .phrase-navigation > span { display: none; }
    .goal-options { gap: 5px; }
    .goal-options small { font-size: 7px; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  }
}
