/* English Speaking Coach · responsive design system */
:root {
  --ink:#173c36; --muted:#5d6f64; --green:#176b56; --green-dark:#104e40;
  --mint:#e8f3ec; --mint-light:#f2f7f2; --bg:#f5f7f5; --line:#dfe7e1;
  --white:#fff; --gold:#9a711c; --lilac:#eeebf8; --lime:#d2efb4;
  --radius:22px; --shadow:0 12px 36px #193c340a; --sidebar:244px;
  --bottom-nav:76px;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,"Noto Sans Thai",Tahoma,sans-serif;
  color:var(--ink); background:var(--bg); font-synthesis:none;
}
* { box-sizing:border-box; }
html { scroll-padding-top:100px; }
body { margin:0; font-size:16px; line-height:1.6; -webkit-text-size-adjust:100%; }
button,input,textarea,select { font:inherit; color:inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
a { color:var(--green); text-decoration:none; }
button { cursor:pointer; border:0; }
button:disabled { cursor:not-allowed; opacity:.55; }
h1,h2,h3,h4,p { margin:0; }
h1,h2,h3,h4 { line-height:1.22; letter-spacing:-.035em; overflow-wrap:break-word; }
h1 { font-size:36px; font-weight:700; }
h2 { font-size:25px; }
h3 { font-size:19px; }
p { color:var(--muted); }
small { font-size:13px; }
strong { font-weight:650; }
svg.icon { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; vertical-align:middle; flex-shrink:0; }
.icon-defs { position:absolute; width:0; height:0; overflow:hidden; }
[hidden] { display:none!important; }
:focus-visible { outline:3px solid #2a81c8; outline-offset:4px; }
a,button { touch-action:manipulation; }
::selection { background:#cce7b9; color:#153d34; }
.skip-link { position:fixed; top:-100px; left:20px; z-index:1000; background:var(--ink); color:#fff; padding:12px 20px; border-radius:12px; }
.skip-link:focus { top:12px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.print-only { display:none; }

/* Navigation and application shell */
.sidebar { position:fixed; inset:0 auto 0 0; width:var(--sidebar); padding:28px 18px 20px; background:#fff; border-right:1px solid var(--line); z-index:60; display:flex; flex-direction:column; overflow-y:auto; overscroll-behavior:contain; }
.sidebar-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:42px; }
.brand { display:flex; align-items:center; gap:12px; color:var(--ink); font-size:24px; line-height:1; letter-spacing:-.045em; font-weight:750; padding:0 10px; }
.brand-sub { display:block; font-size:10px; letter-spacing:.075em; color:var(--muted); font-weight:550; margin-top:8px; }
.brand-mark { background:var(--ink); color:var(--lime); border-radius:14px; width:44px; height:44px; display:grid; place-items:center; position:relative; flex-shrink:0; }
.brand-mark .icon { width:25px; height:25px; }
.brand-mark i { position:absolute; width:10px; height:10px; border:2px solid #fff; border-radius:50%; background:#b6dc8f; right:-2px; top:-2px; }
.nav-label { font-size:10px; font-weight:700; letter-spacing:.13em; color:var(--muted); margin:0 15px 10px; }
#navigation .nav-label { margin-top:28px; }
#navigation a { display:flex; align-items:center; gap:12px; color:#63776d; font-size:13px; padding:12px 14px; min-height:46px; border-radius:12px; margin:4px 0; font-weight:550; transition:background .15s,color .15s; }
#navigation a:hover { background:#f3f6f2; color:var(--ink); }
#navigation a.active { color:#144d3b; background:#e7f1df; font-weight:700; }
#navigation a.active .icon { stroke-width:2; }
.nav-count { font-size:11px; margin-left:auto; background:#fff; border-radius:6px; min-width:24px; text-align:center; padding:1px 4px; }
.sidebar-bottom { margin-top:auto; padding-top:32px; }
.habit-note { background:#f3f6ef; border:1px solid #e7ecdf; border-radius:18px; padding:18px; }
.habit-note strong { display:block; font-size:13px; margin-top:6px; letter-spacing:-.02em; }
.habit-note p { font-size:12px; line-height:1.7; margin:8px 0; }
.habit-note a { display:flex; align-items:center; justify-content:space-between; font-size:12px; font-weight:650; min-height:40px; }
.habit-spark { color:var(--green); font-size:25px; line-height:1; }
.sidebar-links { display:flex; align-items:center; gap:13px; justify-content:center; margin-top:14px; font-size:11px; color:var(--muted); }
.sidebar-links a { color:var(--muted); display:inline-flex; align-items:center; min-height:40px; }
.workspace { margin-left:var(--sidebar); min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; }
.topbar { min-height:80px; padding:0 36px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; background:#fbfdfaee; backdrop-filter:blur(16px); gap:16px; position:sticky; top:0; z-index:30; }
.topbar-start,.topbar-end { display:flex; align-items:center; gap:20px; min-width:0; }
.breadcrumb { font-size:12px; color:var(--muted); display:flex; gap:16px; align-items:center; }
.breadcrumb b { color:var(--ink); font-weight:600; }
.mode-indicator { font-size:11px; display:inline-flex; align-items:center; gap:7px; color:#516e5d; background:#edf3e9; padding:6px 10px; border:1px solid #e2ebdc; border-radius:20px; white-space:nowrap; }
.mode-indicator i { width:6px; height:6px; border-radius:50%; background:#50885c; }
.profile-button { display:flex; align-items:center; gap:10px; background:transparent; font-size:13px; font-weight:600; min-height:44px; padding:0; }
#profile-name { min-width:0; max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.profile-button { min-width:0; }
.avatar { flex-shrink:0; }
.profile-button>.icon { width:17px; height:17px; margin-left:5px; color:#75867b; }
.avatar { width:40px; height:40px; display:grid; place-items:center; background:#e8eedd; border:2px solid #fff; border-radius:50%; font-size:14px; color:#52673f; box-shadow:0 0 0 1px #dce5d6; }
.icon-btn { width:44px; height:44px; background:#fff; border:1px solid var(--line); border-radius:13px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.menu-button,.nav-close,.mobile-brand,.mobile-nav { display:none; }
.main { width:100%; max-width:1440px; padding:34px 36px 44px; margin:0 auto; outline:none; flex:1; min-width:0; }
.app-footer { font-size:11px; color:var(--muted); display:flex; gap:16px; justify-content:space-between; align-items:center; padding:18px 36px; border-top:1px solid var(--line); margin-top:auto; }
.footer-dot { padding:0 10px; }
.app-footer a { color:#526c5a; display:inline-flex; align-items:center; min-height:36px; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:22px; margin-bottom:27px; }
.page-heading>div { min-width:0; }
.page-heading h1 { font-size:clamp(28px,2.5vw,35px); }
.page-heading p { font-size:14px; margin-top:8px; line-height:1.65; }
.eyebrow { font-size:11px; letter-spacing:.13em; font-weight:700; color:var(--green); text-transform:uppercase; }
.today-pill { display:inline-flex; align-items:center; gap:8px; font-size:12px; color:#607365; padding:10px 13px; border:1px solid var(--line); border-radius:12px; background:#fff; white-space:nowrap; }
.today-pill .icon { width:16px; height:16px; }

/* Shared controls */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:9px; border:1px solid transparent; background:var(--green); color:#fff; font-weight:600; font-size:14px; padding:12px 19px; border-radius:12px; line-height:1.4; min-height:48px; transition:background .15s,box-shadow .15s,transform .15s; white-space:normal; text-align:center; max-width:100%; }
.btn:hover:not(:disabled) { background:var(--green-dark); box-shadow:0 4px 12px #153e3414; }
.btn.secondary { background:#fff; color:var(--ink); border-color:#d9e2da; }
.btn.secondary:hover:not(:disabled) { background:#f3f7f0; border-color:#b7cbb8; }
.btn.ghost { background:transparent; color:var(--green); border:1px solid #bfd5c3; }
.btn.danger { background:#a54239; }
.btn.small { font-size:12px; padding:10px 14px; min-height:44px; }
.btn.large { padding:14px 21px; min-height:52px; }
.btn .icon { width:18px; height:18px; }
.text-link { font-size:13px; color:var(--green); font-weight:650; display:inline-flex; align-items:center; gap:8px; background:none; padding:4px 0; min-height:40px; }
.text-link .icon { width:17px; height:17px; }
.actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.section-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:30px 0 17px; }
.section-heading>div { min-width:0; }
.section-heading h2 { font-size:23px; }
.section-heading p { font-size:13px; margin-top:6px; }
.section-heading>.text-link { white-space:nowrap; flex-shrink:0; }
.level-chip,.tag { display:inline-flex; align-items:center; gap:6px; border-radius:7px; padding:4px 9px; background:#edf4e9; font-size:11px; font-weight:650; color:#476d4c; letter-spacing:0; }
.tag.lilac { background:var(--lilac); color:#6f5b91; }
.tag.gold { background:#f8efd8; color:#8b651c; }
.tag.blue { background:#e9f1f7; color:#476c86; }
.tag .icon { width:15px; height:15px; }
input,textarea,select { background:#fff; border:1px solid #cbd8cf; border-radius:12px; padding:12px 14px; max-width:100%; font-size:16px; }
input:not([type="checkbox"]):not([type="radio"]),textarea,select { min-height:48px; }
select { padding-right:28px; }
textarea { width:100%; resize:vertical; min-height:138px; line-height:1.75; display:block; }
input::placeholder,textarea::placeholder { color:var(--muted); opacity:1; }
label { font-size:13px; font-weight:650; display:block; margin-bottom:8px; }
.field { margin-bottom:21px; min-width:0; }
.field small { display:block; font-size:12px; color:var(--muted); margin-top:7px; }
.field-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; }
.field-row input,.field-row select,.field>input,.field>select { width:100%; }
.checkbox-label { display:flex; align-items:flex-start; gap:11px; font-weight:400; font-size:14px; min-height:44px; cursor:pointer; }
.checkbox-label input { margin:3px 0 0; accent-color:var(--green); width:19px; height:19px; flex-shrink:0; }

/* Overview */
.hero { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(240px,.8fr); min-height:345px; background:#123f38; border:1px solid #17483d; border-radius:26px; overflow:hidden; position:relative; isolation:isolate; }
.hero:before { content:""; position:absolute; right:-70px; top:-160px; width:590px; height:590px; border:1px solid #ffffff0b; border-radius:50%; pointer-events:none; }
.hero-copy { padding:36px 0 35px 36px; position:relative; z-index:2; }
.hero h2 { font-size:clamp(35px,3.2vw,51px); font-weight:600; line-height:1.09; letter-spacing:-.052em; margin-top:18px; max-width:570px; color:#fff; }
.hero h2 em { color:var(--lime); font-style:normal; }
.hero p { font-size:14px; max-width:390px; line-height:1.8; margin-top:17px; color:#c3d9ce; }
.hero .actions { margin-top:26px; }
.hero .btn { background:var(--lime); color:#23442b; }
.hero .btn:hover { background:#e1f7ca; }
.hero .btn.ghost { color:#e7f3e5; background:#ffffff06; border-color:#759689; }
.hero .btn.ghost:hover { background:#ffffff0e; }
.hero-label { display:inline-flex; gap:9px; align-items:center; font-size:10px; font-weight:650; letter-spacing:.13em; color:#cfe6bf; text-transform:uppercase; }
.hero-label span { width:6px; height:6px; background:var(--lime); border-radius:50%; box-shadow:0 0 0 5px #d2efb40b; }
.hero-art { position:relative; min-width:0; display:grid; place-items:center; padding:20px 30px 20px 0; overflow:hidden; }
.voice-orbit { width:260px; height:260px; border:1px solid #b9d8b528; border-radius:50%; display:grid; place-items:center; position:relative; }
.voice-orbit:before,.voice-orbit:after { content:""; position:absolute; border:1px solid #b9d8b520; border-radius:50%; inset:28px; }
.voice-orbit:after { inset:-27px; border-style:dashed; border-color:#b9d8b513; }
.voice-disc { width:148px; height:148px; border-radius:50%; background:linear-gradient(145deg,#d4edb7,#9fc893); box-shadow:0 18px 60px #0002,inset 0 1px 0 #ffffff90; display:grid; place-items:center; position:relative; }
.voice-disc svg { width:89px; height:64px; color:#215742; }
.orbit-dot { position:absolute; width:11px; height:11px; background:#cceca9; border-radius:50%; top:20px; right:44px; box-shadow:0 0 0 8px #d0edbd0a; }
.voice-caption { position:absolute; bottom:36px; left:0; right:25px; text-align:center; font-size:11px; letter-spacing:.055em; color:#c1d7c7; }
.voice-bubble { position:absolute; z-index:2; padding:11px 16px; font-size:14px; font-weight:600; color:#214c37; background:#f5f9ec; border:1px solid #ffffff80; border-radius:16px 16px 4px 16px; box-shadow:0 7px 18px #0000000e; transform:rotate(-7deg); top:45px; left:8px; }
.voice-bubble.small { top:auto; bottom:74px; right:12px; left:auto; border-radius:16px 16px 16px 4px; font-size:11px; color:#e6f1de; background:#376b54; border-color:#6b93775c; transform:rotate(6deg); }
.quick-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:15px; margin-top:22px; }
.stat { display:flex; gap:14px; align-items:center; padding:21px 20px; background:#fff; border:1px solid var(--line); border-radius:18px; min-width:0; }
.stat>div:last-child { min-width:0; }
.stat-symbol { width:43px; height:43px; border-radius:13px; display:grid; place-items:center; background:#eaf3e6; color:#4a7a43; flex-shrink:0; }
.stat-symbol.gold { background:#fbf0d9; color:#9b7428; }
.stat-symbol.lilac { background:var(--lilac); color:#8470a5; }
.stat-symbol.blue { background:#eaf1f6; color:#5c82a0; }
.stat strong { font-size:28px; font-weight:650; letter-spacing:-.05em; line-height:1.2; }
.stat strong small { font-size:12px; letter-spacing:0; color:var(--muted); font-weight:500; margin-left:4px; }
.stat p { font-size:11px; color:var(--muted); margin-top:5px; }
.home-columns { display:grid; grid-template-columns:minmax(0,1fr) 286px; gap:24px; margin-top:5px; align-items:start; }
.home-columns>section,.home-columns>aside { min-width:0; }
.home-columns .lesson-grid { display:flex; flex-direction:column; gap:12px; }
.home-columns .lesson-card { display:grid; grid-template-columns:102px minmax(0,1fr); border-radius:18px; }
.home-columns .lesson-art { min-height:136px; height:auto; padding:14px; }
.home-columns .lesson-art .category-illustration { width:44px; height:44px; margin-top:24px; }
.home-columns .level-chip { top:12px; left:10px; font-size:10px; padding:3px 6px; }
.home-columns .lesson-body { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:16px; padding:20px; align-content:center; }
.home-columns .lesson-category,.home-columns .lesson-card h3,.home-columns .lesson-card p { grid-column:1; }
.home-columns .lesson-card h3 { font-size:17px; margin:5px 0 6px; }
.home-columns .lesson-card p { font-size:12px; line-height:1.7; }
.home-columns .lesson-meta { grid-column:2; grid-row:1 / span 3; flex-direction:column; align-items:flex-end; justify-content:space-between; margin:0; font-size:11px; }
.home-columns .lesson-meta a { font-size:12px; }
.panel { background:#fff; border:1px solid var(--line); border-radius:20px; padding:26px; min-width:0; }
.goal-panel { margin-top:30px; padding:23px; background:#fff; }
.goal-head { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.goal-head .icon { color:#8f7a45; width:19px; height:19px; }
.goal-panel h3 { font-size:17px; margin-bottom:0; }
.goal-dial { width:140px; height:140px; border-radius:50%; margin:26px auto 20px; display:grid; place-items:center; background:conic-gradient(var(--green) calc(var(--progress)*1%),#eaf0e4 0); position:relative; }
.goal-dial>div { width:118px; height:118px; background:#fff; border-radius:50%; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.goal-dial strong { font-size:30px; line-height:1.3; letter-spacing:-.04em; }
.goal-dial span { font-size:10px; color:var(--muted); }
.goal-panel>p { font-size:12px; text-align:center; line-height:1.8; }
.mini-week { display:flex; gap:8px; justify-content:center; margin-top:22px; }
.mini-week span { width:26px; height:26px; display:grid; place-items:center; border-radius:8px; font-size:10px; color:var(--muted); background:#f0f4ec; }
.mini-week span.done { background:var(--green); color:#fff; }
.mini-week span.current { outline:1px solid #91b478; outline-offset:3px; }
.goal-adjust { display:flex; justify-content:center; border-top:1px solid var(--line); margin-top:22px; padding-top:10px; }
.goal-adjust .text-link { font-size:12px; }
.tip-card { background:#edf2e7; border:1px solid #e1e8d9; border-radius:18px; padding:20px; margin-top:16px; display:flex; gap:12px; }
.tip-card>.icon { color:#6e8355; width:19px; height:19px; margin-top:3px; }
.tip-card strong { font-size:12px; }
.tip-card p { font-size:12px; line-height:1.8; margin-top:6px; color:#617354; }
.path-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.path-card { display:flex; align-items:center; gap:15px; background:#fff; border:1px solid var(--line); padding:22px; border-radius:18px; color:var(--ink); transition:border-color .15s,transform .15s; min-width:0; }
.path-card>div { min-width:0; }
.path-card>.icon { color:var(--green); width:23px; height:23px; }
.path-card h3 { font-size:15px; letter-spacing:-.02em; }
.path-card p { font-size:12px; margin-top:6px; }
.path-card:hover { border-color:#b0c6ab; transform:translateY(-2px); }

/* Lesson library and lesson details */
.lesson-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.lesson-card { background:#fff; border:1px solid var(--line); border-radius:21px; overflow:hidden; display:flex; flex-direction:column; min-width:0; transition:box-shadow .15s,transform .15s; }
.lesson-card:hover { box-shadow:var(--shadow); transform:translateY(-2px); }
.lesson-art { height:146px; background:#edf3df; position:relative; overflow:hidden; padding:18px; display:flex; align-items:center; justify-content:center; }
.lesson-art.travel { background:#eeeaf9; }
.lesson-art.work { background:#f6edd9; }
.lesson-art.maritime { background:#e2eff3; }
.lesson-art .category-illustration { width:64px; height:64px; stroke-width:1.25; color:#6f8e47; transform:rotate(-7deg); position:relative; z-index:1; }
.lesson-art.travel .category-illustration { color:#8a77ab; transform:rotate(-12deg); }
.lesson-art.work .category-illustration { color:#ae8a4a; transform:rotate(5deg); }
.lesson-art.maritime .category-illustration { color:#5f8c9e; transform:rotate(-6deg); }
.lesson-art:before,.lesson-art:after { content:""; position:absolute; width:180px; height:180px; border:1px solid #ffffffc0; border-radius:50%; right:-42px; top:8px; }
.lesson-art:after { width:120px; height:120px; left:-30px; top:-35px; }
.lesson-art .level-chip { position:absolute; left:16px; top:16px; z-index:2; font-size:10px; border:1px solid #ffffffc0; background:#ffffffd6; color:#50654d; }
.lesson-body { padding:22px; flex:1; display:flex; flex-direction:column; }
.lesson-category { font-size:10px; letter-spacing:.09em; text-transform:uppercase; font-weight:650; color:var(--muted); }
.lesson-card h3 { font-size:20px; margin:9px 0 10px; line-height:1.35; letter-spacing:-.035em; }
.lesson-card p { font-size:14px; line-height:1.8; flex:1; }
.lesson-meta { font-size:12px; color:#6c7a69; display:flex; justify-content:space-between; align-items:center; margin-top:20px; gap:10px; flex-wrap:wrap; }
.lesson-meta>span { white-space:nowrap; }
.lesson-meta .icon { width:15px; height:15px; margin-right:3px; }
.lesson-meta a { font-weight:650; display:inline-flex; align-items:center; color:var(--green); gap:4px; min-height:44px; }
.toolbar { display:flex; gap:16px; align-items:center; justify-content:space-between; margin-bottom:26px; flex-wrap:wrap; }
.filters { display:flex; gap:6px; flex-wrap:wrap; }
.filter { background:#fff; border:1px solid var(--line); border-radius:11px; padding:11px 14px; font-size:13px; min-height:44px; white-space:nowrap; }
.filter.active { background:var(--ink); color:#fff; border-color:var(--ink); }
.search-field { position:relative; }
.search-field .icon { position:absolute; left:14px; top:15px; width:18px; height:18px; color:var(--muted); }
.search-field input { padding-left:42px; width:245px; }
.back-link { display:inline-flex; align-items:center; gap:8px; font-size:13px; min-height:44px; margin-bottom:13px; }
.back-link .icon { transform:rotate(180deg); width:17px; height:17px; }
.lesson-detail-top { background:#e9f1e2; padding:31px; border:1px solid #dfe9d5; border-radius:23px; margin-bottom:24px; }
.lesson-detail-top h1 { margin-top:16px; font-size:35px; }
.lesson-detail-top p { max-width:720px; margin-top:14px; font-size:15px; }
.detail-grid { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:24px; align-items:start; }
.stack>*+* { margin-top:20px; }
.panel h2 { font-size:23px; margin-bottom:13px; }
.panel h3 { margin-bottom:11px; }
.panel>p { font-size:14px; line-height:1.85; }
.vocab-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:20px; }
.vocab-card { padding:18px; border:1px solid var(--line); border-radius:14px; }
.vocab-card strong { font-size:16px; display:block; }
.vocab-card p { font-size:14px; margin:7px 0; }
.vocab-card .example { font-size:13px; color:#496b56; font-style:italic; margin:10px 0; }
.vocab-card .thai { font-size:14px; color:#766392; padding-top:9px; border-top:1px solid var(--line); }
.vocab-card .text-link { font-size:12px; min-height:44px; }
.dialogue { display:flex; flex-direction:column; gap:14px; margin-top:20px; }
.dialogue-line { background:#f2f6ed; padding:15px 18px; border-radius:4px 15px 15px 15px; margin-right:30px; }
.dialogue-line:nth-child(even) { background:#edf2f6; margin-right:0; margin-left:30px; border-radius:15px 4px 15px 15px; }
.dialogue-line strong { font-size:10px; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); }
.dialogue-line p { font-size:15px; margin-top:6px; color:var(--ink); }
.list { padding-left:21px; margin:15px 0 0; font-size:14px; color:var(--muted); line-height:1.8; }
.list li+li { margin-top:12px; }
.objective { padding:18px 20px; border-left:3px solid var(--green); background:var(--mint-light); border-radius:0 12px 12px 0; margin:18px 0; }
.objective p { font-size:14px; line-height:1.8; }
.objective strong { font-size:11px; text-transform:uppercase; letter-spacing:.075em; display:block; margin-bottom:6px; }
.note { font-size:12px; color:var(--muted); line-height:1.8; margin-top:14px; }
.notice { font-size:13px; background:#f0f6ed; border:1px solid #dce8d6; padding:15px 17px; border-radius:13px; line-height:1.8; color:#526c54; display:flex; gap:11px; align-items:flex-start; }
.notice .icon { width:18px; height:18px; margin-top:3px; }
.notice.warning { background:#fcf5e6; color:#806129; border-color:#ecdfba; }
.notice.error { background:#fff2ed; color:#9a3e31; border-color:#efd7cc; }
.notice.success { background:#edf7ec; color:#3b7050; border-color:#cfe3c9; }
.notice a { text-decoration:underline; }

/* Speaking and pronunciation */
.practice-grid { display:grid; grid-template-columns:minmax(0,1fr) 290px; gap:24px; align-items:start; }
.practice-prompt { background:#f0f6ea; padding:25px; border:1px solid #e0ead8; border-radius:17px; margin:22px 0; }
.practice-prompt .eyebrow { font-size:10px; }
.practice-prompt h2 { font-size:25px; margin:12px 0; line-height:1.4; }
.practice-prompt p { font-size:14px; }
.record-area { border:1px dashed #bed1b6; background:#fbfcf9; border-radius:17px; padding:25px; text-align:center; margin:22px 0; }
.mic-button { background:var(--green); color:#fff; width:70px; height:70px; border-radius:50%; display:inline-grid; place-items:center; border:7px solid #e5efe1; box-shadow:0 0 0 1px #d4e1cf; }
.mic-button .icon { width:25px; height:25px; }
.mic-button.listening { background:#a84f41; box-shadow:0 0 0 5px #f7ded7; animation:mic-pulse 1.8s ease-in-out infinite; }
.record-area p { font-size:14px; margin:15px 0 6px; color:#47634d; }
.record-area small { font-size:12px; color:var(--muted); display:block; line-height:1.8; }
.transcript-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; }
.transcript-head label { margin:0; }
.transcript-head span { font-size:12px; color:var(--muted); }
.feedback-box { background:#eff6e9; border:1px solid #d7e6ca; padding:24px; border-radius:17px; margin-top:22px; }
.feedback-box h3 { font-size:19px; margin-bottom:14px; }
.feedback-box p { font-size:14px; line-height:1.8; }
.feedback-box .metric-row { margin-bottom:16px; }
.metric-row { display:flex; flex-wrap:wrap; gap:14px; }
.mini-metric { background:#fff; padding:14px 16px; border-radius:12px; min-width:100px; }
.mini-metric strong { font-size:25px; display:block; line-height:1.2; letter-spacing:-.03em; }
.mini-metric span { font-size:11px; color:var(--muted); }
.tips-list { list-style:none; padding:0; margin:20px 0 0; counter-reset:tips; }
.tips-list li { counter-increment:tips; display:flex; gap:12px; font-size:14px; color:var(--muted); margin-bottom:19px; line-height:1.75; }
.tips-list li:before { content:counter(tips); width:25px; height:25px; flex-shrink:0; background:#ebf2e5; color:#527740; border-radius:8px; display:grid; place-items:center; font-size:11px; font-weight:650; }
.model-text { font-size:14px; color:#627c66; line-height:1.85; padding:17px; background:#f5f7f0; border-radius:12px; }
.panel details { font-size:14px; }
.panel details+details { border-top:1px solid var(--line); margin-top:14px; padding-top:14px; }
.panel summary { cursor:pointer; font-weight:600; padding:10px 0; min-height:44px; }
.panel details p { font-size:14px; margin:12px 0; line-height:1.85; }
.empty-state { text-align:center; padding:52px 26px; background:#fff; border:1px dashed #c9d9c4; border-radius:21px; }
.empty-state>.icon { width:42px; height:42px; color:#85a775; margin-bottom:18px; }
.empty-state h2 { font-size:24px; }
.empty-state p { font-size:14px; max-width:440px; margin:14px auto 22px; }
.pronunciation-layout { display:grid; grid-template-columns:260px minmax(0,1fr); gap:24px; align-items:start; }
.phrase-tabs { display:flex; flex-direction:column; gap:10px; }
.phrase-tab { text-align:left; background:#fff; padding:16px; border:1px solid var(--line); border-radius:13px; font-size:13px; display:block; }
.phrase-tab small { display:block; color:var(--muted); margin-top:5px; font-size:11px; }
.phrase-tab.active { border-color:#97b583; background:#eef5e8; box-shadow:inset 3px 0 #6f9857; }
.phrase-picker { display:none; }
.practice-phrase { font-size:30px!important; color:var(--ink); font-weight:550; line-height:1.5; letter-spacing:-.035em; margin:20px 0!important; }
.match-score { display:flex; gap:21px; align-items:center; flex-wrap:wrap; }
.match-score>strong { font-size:44px; color:var(--green); letter-spacing:-.05em; }
.match-words { display:flex; gap:7px; flex-wrap:wrap; margin:13px 0; }
.match-words span { background:#fff; border:1px solid #d4dfcd; padding:5px 10px; border-radius:7px; font-size:12px; }

/* Conversations */
.scenario-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.scenario-card { display:flex; flex-direction:column; align-items:flex-start; }
.scenario-card .stat-symbol { margin-bottom:19px; width:48px; height:48px; }
.scenario-card h2 { font-size:22px; margin:15px 0 12px; }
.scenario-card p { font-size:14px; line-height:1.85; }
.scenario-card .btn { margin-top:auto; width:100%; }
.scenario-card p:last-of-type { padding-bottom:22px; }
.conversation-layout { display:grid; grid-template-columns:minmax(0,1fr) 286px; gap:24px; align-items:start; }
.chat-box { background:#fff; border:1px solid var(--line); border-radius:22px; overflow:hidden; min-width:0; }
.chat-toolbar { padding:22px 24px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); gap:15px; background:#fbfcf9; }
.chat-toolbar h2 { font-size:19px; }
.chat-toolbar p { font-size:12px; margin-top:5px; }
.chat-toolbar .tag { white-space:nowrap; }
.messages { padding:24px; min-height:230px; max-height:460px; overflow-y:auto; display:flex; flex-direction:column; gap:21px; overscroll-behavior:contain; }
.message { display:flex; gap:11px; max-width:94%; align-self:flex-start; }
.message.user { align-self:flex-end; flex-direction:row-reverse; }
.message-avatar { width:32px; height:32px; border-radius:10px; background:#e7f0df; display:grid; place-items:center; color:var(--green); flex-shrink:0; font-size:12px; }
.message-avatar .icon { width:18px; height:18px; }
.message.user .message-avatar { background:#eae7f3; color:#796d9c; }
.message .bubble { background:#f2f5ee; padding:16px 18px; border-radius:4px 17px 17px 17px; min-width:0; }
.message.user .bubble { background:#e5f1e5; border-radius:17px 4px 17px 17px; }
.bubble p { font-size:15px; color:var(--ink); white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.8; }
.bubble .text-link { margin-top:8px; font-size:12px; min-height:44px; }
.composer { padding:22px 24px; border-top:1px solid var(--line); }
.composer textarea { min-height:100px; }
.composer .actions { margin-top:13px; justify-content:space-between; }
.conversation-hint { background:#f9f4e7; padding:18px; border-radius:13px; font-size:14px; margin:18px 0; line-height:1.8; }

/* Quiz, progress and achievements */
.quiz-shell { max-width:850px; margin:0 auto; }
.quiz-intro { padding:42px; text-align:center; }
.quiz-intro>.stat-symbol { margin:0 auto 22px; width:66px; height:66px; border-radius:19px; }
.quiz-intro h1 { font-size:34px; }
.quiz-intro p { max-width:530px; margin:17px auto 26px; }
.quiz-intro .field-row { text-align:left; max-width:480px; margin:26px auto; }
.quiz-meta { display:flex; align-items:center; justify-content:space-between; font-size:13px; color:var(--muted); margin-bottom:15px; gap:12px; }
.progress-track { height:7px; background:#e6edde; border-radius:8px; overflow:hidden; }
.progress-track>span { height:100%; display:block; background:var(--green); border-radius:8px; }
.quiz-card { margin-top:25px; padding:34px; }
.quiz-card h2 { font-size:27px; line-height:1.5; margin:16px 0 26px; }
.quiz-options { display:flex; flex-direction:column; gap:12px; }
.quiz-option { text-align:left; width:100%; display:flex; align-items:center; gap:14px; padding:16px 18px; border-radius:13px; border:1px solid #d6e1d2; background:#fff; font-size:16px; line-height:1.6; min-height:64px; }
.quiz-option>span { width:29px; height:29px; border-radius:8px; background:#f0f4ec; color:var(--muted); font-size:12px; display:grid; place-items:center; flex-shrink:0; }
.quiz-option:hover:not(:disabled) { border-color:#95b581; background:#f8fbf4; }
.quiz-option.selected { border:2px solid #6b9458; background:#eef6e7; padding:15px 17px; }
.quiz-option.correct { background:#ebf5e6; border-color:#7da66f; opacity:1; }
.quiz-option.incorrect { background:#fff1e9; border-color:#d5a18e; opacity:1; }
.quiz-actions { display:flex; justify-content:space-between; align-items:center; margin-top:26px; gap:14px; }
.score-result { font-size:68px; font-weight:650; color:var(--green); letter-spacing:-.06em; line-height:1; margin:30px 0 18px; }
.score-result small { font-size:25px; color:#6e8260; }
.review-item { padding:22px 0; border-bottom:1px solid var(--line); }
.review-item:last-child { border-bottom:0; }
.review-item h3 { font-size:16px; line-height:1.6; margin:12px 0; }
.review-item p { font-size:14px; margin-top:8px; }
.chart-panel { margin-top:25px; }
.week-chart { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); align-items:end; gap:18px; height:210px; margin-top:24px; border-bottom:1px solid var(--line); padding:0 8px 11px; }
.chart-col { height:180px; display:flex; align-items:center; justify-content:flex-end; flex-direction:column; gap:9px; min-width:0; }
.chart-bar { width:100%; max-width:58px; background:#dce9cd; border-radius:8px 8px 0 0; min-height:3px; }
.chart-col:last-child .chart-bar { background:var(--green); }
.chart-col span { font-size:12px; color:var(--muted); }
.chart-col strong { font-size:10px; font-weight:550; color:#627857; white-space:nowrap; }
.chart-caption { font-size:12px; margin-top:15px; }
.table-wrap { overflow-x:auto; border-radius:20px; }
table { border-collapse:collapse; width:100%; font-size:13px; text-align:left; }
th { font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:650; padding:16px; background:#f5f8f0; }
td { padding:17px 16px; border-bottom:1px solid var(--line); color:#5f7457; }
td:first-child { color:var(--ink); font-weight:550; }
td small { display:block; font-size:11px; color:var(--muted); margin-top:5px; }
.badge-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin-top:24px; }
.badge-card { text-align:center; padding:31px 24px; }
.badge-symbol { width:68px; height:68px; border-radius:22px; display:grid; place-items:center; margin:0 auto 20px; background:#eef2e9; color:#78856e; border:1px solid #e1e8d9; }
.badge-symbol .icon { width:32px; height:32px; }
.badge-card.earned .badge-symbol { background:#f9efd5; color:#a77b23; border-color:#e9d8a8; }
.badge-card h2 { font-size:19px; }
.badge-card p { font-size:14px; min-height:48px; line-height:1.8; }
.badge-card .tag { margin-top:18px; }
.notes-actions { display:flex; justify-content:flex-end; margin-top:13px; }
.session-history-title { display:flex; gap:10px; align-items:center; }
.session-history-title .icon { width:18px; height:18px; }

/* Help, dialogs and feedback */
.help-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); gap:24px; align-items:start; }
.content-prose h2 { margin-top:28px; }
.content-prose h2:first-child { margin-top:0; }
.content-prose p { font-size:15px; line-height:1.9; margin:15px 0; }
.content-prose ul { font-size:14px; color:var(--muted); padding-left:21px; }
.content-prose li+li { margin-top:10px; }
.help-grid .panel+.panel { margin-top:22px; }
.support-mail { display:block; font-size:14px; margin:17px 0; overflow-wrap:anywhere; }
.toast { position:fixed; bottom:26px; left:calc(50% + var(--sidebar)/2); transform:translateX(-50%); background:#193f32; color:#fff; box-shadow:0 10px 32px #0002; border:1px solid #507461; border-radius:14px; padding:14px 20px; font-size:13px; z-index:100; max-width:calc(100vw - 36px); width:max-content; }
.storage-warning { padding:13px 36px; font-size:13px; background:#fff2d5; color:#7b5e23; }
dialog { width:min(600px,calc(100vw - 32px)); max-height:90vh; max-height:90dvh; border:1px solid var(--line); border-radius:24px; padding:0; box-shadow:0 24px 80px #18332c30; background:#fff; color:var(--ink); overflow:hidden; }
dialog[open] { display:flex; flex-direction:column; }
#dialog-content { display:flex; flex-direction:column; min-height:0; max-height:inherit; }
dialog::backdrop { background:#19372c66; backdrop-filter:blur(5px); }
.dialog-header { display:flex; justify-content:space-between; align-items:center; padding:24px 27px 20px; border-bottom:1px solid var(--line); gap:18px; flex-shrink:0; }
.dialog-header h2 { font-size:24px; }
.dialog-body { padding:25px 27px; overflow-y:auto; min-height:0; flex:1 1 auto; overscroll-behavior:contain; }
.dialog-body h3 { font-size:18px; margin:26px 0 13px; }
.dialog-body h3:first-child { margin-top:0; }
.dialog-footer { border-top:1px solid var(--line); padding:19px 27px; display:flex; justify-content:flex-end; gap:11px; flex-shrink:0; background:#fbfcf9; }
.error-text { color:#a54335; font-size:13px; margin:12px 0; }
.setting-description { font-size:14px; margin-bottom:18px; line-height:1.8; }
.loading { padding:80px 20px; text-align:center; }
.loading .brand-mark { margin:0 auto 25px; }
.loading p { margin-top:17px; }
.noscript { position:fixed; inset:0; background:white; z-index:1000; padding:20vh 10vw; }
.busy-indicator { font-size:14px; color:var(--green); padding:12px 0; }
.busy-indicator:before { content:""; display:inline-block; width:14px; height:14px; border:2px solid #b5d6a8; border-top-color:var(--green); border-radius:50%; animation:spin 1s linear infinite; margin-right:9px; vertical-align:middle; }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes mic-pulse { 50% { box-shadow:0 0 0 10px #f7ded780; } }

/* Smaller desktops and landscape tablets */
/* Learners, bilingual guidance and dependable mobile saving */
.topbar-end { gap:14px; }
.save-status { display:inline-flex; gap:7px; align-items:center; justify-content:center; min-height:44px; min-width:44px; padding:6px 10px; border-radius:12px; color:#38694e; background:#edf5e9; font-size:11px; font-weight:650; white-space:nowrap; }
.save-status .icon { width:17px; height:17px; }
.save-status[data-status="pending"] { color:#705e20; background:#f6f0dc; }
.save-status[data-status="error"] { color:#8c392c; background:#ffede6; }
.storage-warning { display:flex; align-items:flex-start; gap:11px; }
.storage-warning>span { flex:1; }
.storage-warning a { display:inline-flex; gap:6px; align-items:center; color:inherit; font-weight:700; text-decoration:underline; flex-shrink:0; }
.storage-warning .icon { width:18px; height:18px; margin-top:2px; }
.thai-guide { font-size:14px; line-height:1.8; margin-top:9px; color:var(--muted); letter-spacing:0; }
.page-heading .thai-heading { font-size:13px; margin-top:5px; }
.thai-feature-title { color:var(--green); font-weight:550; }
.continue-strip { display:flex; gap:16px; align-items:center; padding:19px 21px; border:1px solid #dce7d6; border-radius:18px; margin-top:20px; background:#edf4e8; }
.continue-icon { display:grid; place-items:center; width:42px; height:48px; color:var(--green); flex-shrink:0; }
.continue-icon .icon { width:28px; height:28px; }
.continue-strip>div:first-of-type { flex:1; min-width:0; }
.continue-strip strong { font-size:14px; }
.continue-strip p { font-size:12px; margin-top:3px; }
.text-button { background:transparent; border-color:transparent; color:var(--green); }
.text-button:hover:not(:disabled) { background:#e5efdf; color:var(--ink); box-shadow:none; }
.draft-note { display:flex; align-items:flex-start; gap:7px; margin-top:9px; font-size:12px; }
.draft-note .icon { width:16px; height:16px; margin-top:2px; }
.notes-actions { justify-content:space-between; gap:16px; align-items:center; }
#notes-save-status { font-size:12px; color:var(--muted); }
.profile-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin:24px 0; }
.profile-welcome { max-width:620px; margin:0 auto; }
.profile-welcome h2 { margin-top:20px; }
.profile-welcome form { margin-top:26px; }
.profile-welcome #profile-error:not(:empty) { margin-bottom:16px; color:var(--danger, #a33030); }
.profile-welcome .profile-links { margin-bottom:0; }
.learner-card { display:flex; flex-direction:column; }
.learner-card.selected { border-color:#9dbb89; background:#f3f8ee; box-shadow:0 0 0 2px #cadfc04d; }
.learner-card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.learner-card .avatar { width:50px; height:50px; font-size:20px; }
.learner-card h2 { font-size:24px; margin:21px 0 8px; overflow-wrap:anywhere; }
.learner-card p { font-size:13px; margin-bottom:22px; }
.learner-card .actions { margin-top:auto; }
.profile-explainer { display:flex; gap:30px; align-items:center; justify-content:space-between; }
.profile-explainer>div:first-child { max-width:700px; }
.profile-explainer p { margin-top:12px; font-size:14px; }
.profile-explainer .actions { flex-shrink:0; flex-direction:column; align-items:stretch; }
.profile-links { display:flex; gap:10px; flex-wrap:wrap; margin:15px 0 25px; }
.local-leaderboard .section-heading { margin-top:0; }
.local-leaderboard .eyebrow { display:block; margin-bottom:8px; }
.local-leaderboard>p { font-size:14px; max-width:740px; }
.rank-list { margin:22px 0 16px; display:grid; gap:9px; }
.rank-row { display:flex; gap:17px; align-items:center; padding:17px 20px; background:#f5f7f3; border:1px solid transparent; border-radius:16px; }
.rank-row.current { background:#eaf3df; border-color:#d4e2c6; }
.rank-number { color:var(--muted); font-size:16px; font-weight:650; width:30px; flex-shrink:0; }
.rank-name { flex:1; min-width:0; }
.rank-name strong { display:flex; align-items:center; flex-wrap:wrap; gap:8px; overflow-wrap:anywhere; }
.rank-name small { display:block; color:var(--muted); margin-top:2px; }
.rank-points { text-align:right; min-width:48px; }
.rank-points strong { font-size:26px; line-height:1.2; }
.rank-points small { display:block; font-size:11px; color:var(--muted); }
.guide-intro { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(160px,.7fr); gap:30px; align-items:center; border-radius:25px; padding:35px; background:var(--green-dark); color:#fff; margin-bottom:26px; }
.guide-intro .eyebrow { color:#cce5b3; }
.guide-intro h2 { font-size:33px; margin:14px 0; }
.guide-intro p { color:#d1e0d6; font-size:14px; }
.guide-intro .thai-guide { color:#bed4c5; }
.guide-facts { display:grid; gap:18px; padding-left:34px; border-left:1px solid #ffffff30; }
.guide-facts span { color:#d2e2d7; font-size:12px; }
.guide-facts strong { display:block; color:#d9f0c0; font-size:34px; line-height:1.15; font-weight:550; }
.feature-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.feature-card { display:flex; flex-direction:column; min-width:0; }
.feature-card-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:19px; }
.feature-number { font-size:13px; color:#708373; font-weight:600; }
.feature-card h2 { font-size:22px; }
.feature-card>p { font-size:13px; margin-top:12px; }
.feature-card .thai-feature-title { font-size:14px; margin-top:7px; }
.feature-card .feature-limit { display:flex; align-items:flex-start; gap:8px; padding-top:15px; margin-top:18px; border-top:1px solid var(--line); font-size:12px; }
.feature-limit .icon { width:15px; height:15px; margin-top:3px; }
.feature-card .feature-limit-thai { font-size:12px; }
.feature-card>.text-link { margin-top:auto; padding-top:17px; }
.device-hero { display:flex; gap:24px; padding:30px; border-radius:24px; background:#e8f1df; border:1px solid #d4e3c7; align-items:flex-start; margin-bottom:24px; }
.device-hero>div { flex:1; min-width:0; }
.device-hero-icon { flex-shrink:0; width:58px; height:70px; display:grid; place-items:center; border-radius:17px; background:#fff9; }
.device-hero-icon .icon { width:34px; height:34px; stroke-width:1.4; }
.device-hero h2 { margin:10px 0; font-size:29px; }
.device-hero p { font-size:13px; }
.device-hero>.tag { flex-shrink:0; }
.device-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; margin:24px 0; }
.device-grid .panel>h2 { font-size:24px; margin-top:19px; }
.device-grid .panel>p { font-size:14px; margin-top:13px; }
.device-grid .panel>.note { font-size:12px; }
.device-grid .actions,.storage-protection { margin-top:22px; }
.storage-protection { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.recovery-panel>p { font-size:14px; margin:13px 0 20px; }
.guide-article>p { margin-top:12px; font-size:14px; }
.guide-article .thai-guide { font-size:13px; }
.guide-steps { padding-left:24px; margin:24px 0; }
.guide-steps li { padding-left:7px; margin-bottom:22px; }
.guide-steps li::marker { color:var(--green); font-weight:700; }
.guide-steps li>strong { font-size:15px; color:var(--ink); }
.guide-steps li>p { font-size:13px; margin-top:6px; }
.ai-score { background:#fff9; border:1px solid #cbdcc8; border-radius:16px; padding:20px; margin:18px 0; }
.ai-score-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.ai-score-heading h4 { font-size:17px; margin-top:5px; }
.ai-score-heading>strong { font-size:32px; white-space:nowrap; }
.ai-score-heading>strong small { font-size:13px; color:var(--muted); }
.rubric-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 22px; margin:20px 0 14px; }
.rubric-item>div { display:flex; justify-content:space-between; gap:10px; font-size:12px; margin-bottom:5px; }
.rubric-item meter { display:block; width:100%; height:10px; border-radius:8px; border:0; overflow:hidden; background:#dfebd8; }
.rubric-item meter::-webkit-meter-bar { background:#dfebd8; border:0; }
.rubric-item meter::-webkit-meter-optimum-value { background:var(--green); }
.rubric-item meter::-moz-meter-bar { background:var(--green); }

@media (max-width:1250px) {
  .topbar-end { gap:10px; }
  .save-status span { display:none; }
  .feature-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .profile-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .continue-strip { flex-wrap:wrap; }
  .continue-strip>.actions { margin-left:58px; }
  :root { --sidebar:224px; }
  .sidebar { padding-left:14px; padding-right:14px; }
  .brand { font-size:22px; gap:10px; padding:0 6px; }
  #navigation a { font-size:12px; gap:10px; padding:12px; }
  .main { padding:28px; }
  .topbar { padding:0 28px; }
  .hero { grid-template-columns:minmax(0,1.3fr) minmax(200px,.7fr); }
  .hero-copy { padding:31px 0 31px 29px; }
  .hero h2 { font-size:39px; }
  .hero-art { padding-right:13px; }
  .voice-orbit { width:220px; height:220px; }
  .voice-disc { width:132px; height:132px; }
  .voice-bubble { left:0; top:50px; font-size:12px; }
  .voice-bubble.small { bottom:67px; right:5px; }
  .stat { padding:18px 15px; gap:11px; }
  .stat-symbol { width:36px; height:36px; border-radius:11px; }
  .stat strong { font-size:25px; }
  .stat p { font-size:10px; }
  .home-columns { grid-template-columns:minmax(0,1fr) 255px; gap:20px; }
  .home-columns .lesson-body { display:flex; padding:17px; }
  .home-columns .lesson-meta { flex-direction:row; align-items:center; margin-top:10px; }
  .lesson-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .detail-grid,.practice-grid,.conversation-layout { grid-template-columns:minmax(0,1fr); }
  .practice-grid>aside,.detail-grid>aside,.conversation-layout>aside { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
  .practice-grid>aside>*+*,.detail-grid>aside>*+*,.conversation-layout>aside>*+* { margin-top:0; }
  .scenario-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .path-card { padding:19px; gap:12px; align-items:flex-start; }
  .path-card>.icon { width:20px; height:20px; }
  .path-card h3 { font-size:14px; }
  .path-card p { font-size:11px; }
  .breadcrumb { font-size:11px; gap:10px; }
}

/* Tablet and phone navigation */
@media (max-width:1024px) {
  :root { --sidebar:292px; }
  body.nav-open { overflow:hidden; }
  .sidebar { visibility:hidden; transform:translateX(-100%); transition:transform .2s ease; width:min(var(--sidebar),calc(100vw - 36px)); padding:22px 18px max(20px,env(safe-area-inset-bottom)); box-shadow:12px 0 60px #163c341a; }
  .sidebar.open { visibility:visible; transform:translateX(0); }
  .sidebar-heading { margin-bottom:30px; gap:8px; }
  .brand { font-size:23px; gap:11px; padding:0; }
  .brand-mark { width:42px; height:42px; }
  .brand-sub { font-size:9px; }
  .nav-close { display:inline-flex; width:38px; height:44px; border:0; background:#f2f5ef; }
  #navigation a { font-size:14px; min-height:48px; padding:12px 14px; gap:13px; }
  .nav-label { font-size:10px; }
  .nav-shade { position:fixed; inset:0; background:#193a3266; backdrop-filter:blur(4px); z-index:50; }
  .workspace { margin-left:0; padding-bottom:calc(var(--bottom-nav) + env(safe-area-inset-bottom)); }
  .topbar { min-height:73px; padding:0 26px; }
  .topbar-start { gap:15px; }
  .menu-button { display:inline-flex; border:0; background:transparent; margin-left:-8px; }
  .mobile-brand { display:block; font-size:19px; font-weight:750; color:var(--ink); line-height:1.06; letter-spacing:-.04em; }
  .mobile-brand span { display:block; font-size:10px; font-weight:500; letter-spacing:.055em; margin-top:5px; color:#617561; }
  .breadcrumb { display:none; }
  .main { padding:28px 26px 36px; }
  .hero-copy { padding:34px 0 34px 34px; }
  .hero h2 { font-size:44px; }
  .hero-art { padding-right:26px; }
  .voice-orbit { width:250px; height:250px; }
  .voice-bubble { top:48px; left:0; }
  .home-columns { grid-template-columns:minmax(0,1fr) 260px; gap:22px; }
  .home-columns .lesson-body { padding:18px; }
  .app-footer { padding:16px 26px; }
  .mobile-nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); align-items:center; position:fixed; inset:auto 0 0; padding:7px max(12px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); background:#ffffffed; backdrop-filter:blur(18px); border-top:1px solid #dce5dc; box-shadow:0 -5px 24px #183e3006; z-index:40; min-height:calc(var(--bottom-nav) + env(safe-area-inset-bottom)); }
  .mobile-nav>a,.mobile-nav>button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; color:#5d7364; background:transparent; margin:0; min-height:60px; padding:5px 2px; border-radius:12px; font-size:10px; line-height:1.1; font-weight:550; }
  .mobile-nav .icon { width:21px; height:21px; }
  .mobile-nav>a.active,.mobile-nav>button.active { color:#1a6448; font-weight:750; background:#eff5e9; }
  .mobile-nav>a:focus-visible,.mobile-nav>button:focus-visible { outline-offset:-3px; }
  .mobile-speak-icon { display:grid; place-items:center; width:37px; height:32px; border-radius:11px; background:var(--green); color:#fff; margin-top:-5px; }
  .mobile-nav>a.mobile-speak.active { background:transparent; }
  .mobile-nav>a.mobile-speak.active .mobile-speak-icon { background:#234b38; box-shadow:0 0 0 4px #dcebcf; }
  .toast { left:50%; bottom:calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 14px); }
  .help-grid { grid-template-columns:1fr; }
}

/* Phone and small tablet content */
@media (max-width:760px) {
  .main { padding:25px 22px 32px; }
  .topbar { padding:0 22px; }
  .page-heading h1 { font-size:30px; }
  .page-heading p { font-size:14px; }
  .today-pill { display:none; }
  .hero { grid-template-columns:minmax(0,1fr) 220px; min-height:320px; }
  .hero-copy { padding:29px 0 29px 27px; }
  .hero h2 { font-size:36px; }
  .hero p { font-size:13px; }
  .hero .btn { font-size:12px; padding:12px 15px; }
  .hero-art { padding-right:16px; }
  .voice-orbit { width:200px; height:200px; }
  .voice-disc { width:118px; height:118px; }
  .voice-disc svg { width:74px; height:54px; }
  .voice-bubble { top:55px; font-size:11px; padding:9px 12px; }
  .voice-bubble.small { bottom:72px; font-size:9px; }
  .voice-caption { bottom:40px; font-size:9px; }
  .quick-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .stat { padding:18px; gap:14px; }
  .stat-symbol { width:40px; height:40px; }
  .stat strong { font-size:29px; }
  .stat p { font-size:11px; }
  .home-columns { grid-template-columns:minmax(0,1fr); gap:0; }
  .home-columns .lesson-card { grid-template-columns:104px minmax(0,1fr); }
  .home-columns .lesson-body { display:grid; padding:20px; }
  .home-columns .lesson-meta { flex-direction:column; align-items:flex-end; margin-top:0; }
  .home-columns>aside { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:16px; margin-top:24px; align-items:start; }
  .goal-panel { margin:0; padding:22px; }
  .tip-card { margin-top:0; flex-direction:column; }
  .path-grid { grid-template-columns:1fr; gap:12px; }
  .path-card { padding:22px; align-items:center; }
  .path-card>.icon { width:23px; height:23px; }
  .path-card h3 { font-size:17px; }
  .path-card p { font-size:13px; }
  .pronunciation-layout { grid-template-columns:minmax(0,1fr); gap:18px; }
  .phrase-tabs { display:none; }
  .phrase-picker { display:block; background:#fff; border:1px solid var(--line); padding:18px; border-radius:17px; }
  .phrase-picker select { width:100%; }
  .badge-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .practice-grid>aside,.detail-grid>aside,.conversation-layout>aside { display:block; }
  .practice-grid>aside>*+*,.detail-grid>aside>*+*,.conversation-layout>aside>*+* { margin-top:18px; }
  .scenario-grid { gap:16px; }
  .scenario-card { padding:22px; }
  .scenario-card h2 { font-size:21px; }
  .quiz-card { padding:27px; }
  .app-footer { font-size:10px; padding:18px 22px; gap:10px; }
}

@media (max-width:560px) {
  html { scroll-padding-top:85px; }
  .main { padding:24px 18px 30px; }
  .topbar { min-height:69px; padding:0 18px; }
  .topbar-start { gap:10px; }
  .topbar-end { gap:10px; }
  .profile-button>#profile-name,.profile-button>.icon,.mode-indicator { display:none; }
  .profile-button { min-width:44px; justify-content:center; }
  .avatar { width:36px; height:36px; font-size:13px; }
  .page-heading { margin-bottom:23px; align-items:flex-start; flex-wrap:wrap; gap:14px; }
  .page-heading h1 { font-size:29px; line-height:1.18; }
  .page-heading p { font-size:13px; margin-top:10px; }
  .hero { display:block; min-height:0; border-radius:22px; }
  .hero-copy { padding:27px 22px 29px; }
  .hero h2 { font-size:38px; line-height:1.08; margin-top:17px; max-width:340px; }
  .hero p { font-size:13px; max-width:330px; margin-top:17px; }
  .hero-label { font-size:9px; letter-spacing:.12em; }
  .hero .actions { gap:9px; margin-top:24px; }
  .hero .btn { min-height:48px; font-size:12px; padding:12px 11px; gap:7px; }
  .hero .btn:first-child { flex:1 1 auto; }
  .hero .btn.ghost { flex:1 1 auto; border-color:#64897b; }
  .hero-art { display:none; }
  .hero:before { right:-150px; top:-220px; width:480px; height:480px; }
  .quick-stats { gap:11px; margin-top:16px; }
  .stat { padding:17px 13px; gap:11px; align-items:flex-start; }
  .stat-symbol { width:33px; height:33px; border-radius:10px; margin-top:3px; }
  .stat-symbol .icon { width:18px; height:18px; }
  .stat strong { font-size:26px; }
  .stat strong small { font-size:11px; margin-left:3px; }
  .stat p { font-size:10px; line-height:1.6; }
  .section-heading { margin:28px 0 16px; gap:12px; align-items:flex-start; }
  .section-heading h2 { font-size:23px; line-height:1.25; }
  .section-heading p { font-size:13px; }
  .section-heading .text-link { font-size:11px; min-height:32px; }
  .section-heading>.text-link .icon { width:14px; height:14px; }
  .home-columns .lesson-card { grid-template-columns:76px minmax(0,1fr); }
  .home-columns .lesson-art { min-height:162px; }
  .home-columns .lesson-art .category-illustration { width:37px; height:37px; }
  .home-columns .level-chip { top:13px; left:9px; font-size:10px; padding:4px 7px; }
  .home-columns .lesson-body { display:flex; padding:17px 16px 12px; }
  .home-columns .lesson-category { font-size:9px; letter-spacing:.065em; }
  .home-columns .lesson-card h3 { font-size:18px; margin:6px 0; }
  .home-columns .lesson-card p { font-size:12px; line-height:1.75; }
  .home-columns .lesson-meta { flex-direction:row; align-items:center; margin-top:9px; gap:7px; }
  .home-columns .lesson-meta a { font-size:11px; }
  .home-columns>aside { display:block; margin-top:22px; }
  .goal-panel { display:grid; grid-template-columns:130px minmax(0,1fr); column-gap:18px; row-gap:12px; padding:22px; }
  .goal-head { grid-column:1 / -1; }
  .goal-dial { width:122px; height:122px; margin:7px 0 3px; grid-row:2 / span 2; }
  .goal-dial>div { width:102px; height:102px; }
  .goal-dial strong { font-size:28px; }
  .goal-dial span { font-size:9px; }
  .goal-panel>p { text-align:left; align-self:end; font-size:12px; }
  .mini-week { margin-top:0; gap:5px; align-self:start; flex-wrap:wrap; justify-content:flex-start; }
  .mini-week span { width:23px; height:23px; font-size:9px; border-radius:7px; }
  .goal-adjust { grid-column:1 / -1; margin:0; padding-top:9px; }
  .tip-card { flex-direction:row; margin-top:13px; padding:18px 20px; }
  .tip-card strong { font-size:13px; }
  .tip-card p { font-size:12px; }
  .lesson-grid { grid-template-columns:minmax(0,1fr); gap:18px; }
  .lesson-art { height:135px; }
  .lesson-art .category-illustration { width:58px; height:58px; }
  .lesson-body { padding:22px; }
  .lesson-card h3 { font-size:22px; }
  .lesson-card p { font-size:14px; }
  .lesson-meta { margin-top:18px; font-size:12px; }
  .lesson-meta a { font-size:13px; }
  .toolbar { display:flex; flex-direction:column-reverse; flex-wrap:nowrap; align-items:stretch; gap:14px; margin-bottom:23px; }
  .search-field,.search-field input { width:100%; }
  .filters { flex-wrap:nowrap; min-width:0; width:100%; max-width:100%; overflow-x:auto; padding:3px 3px 7px; scrollbar-width:thin; }
  .filter { font-size:12px; padding:11px 14px; flex-shrink:0; }
  .panel { padding:23px 20px; border-radius:19px; }
  .panel h2 { font-size:22px; }
  .panel h3 { font-size:18px; }
  .panel>p { font-size:14px; }
  .lesson-detail-top { padding:25px 22px; border-radius:20px; }
  .lesson-detail-top h1 { font-size:30px; }
  .lesson-detail-top p { font-size:14px; }
  .lesson-detail-top .actions { gap:7px; }
  .detail-grid,.practice-grid,.conversation-layout { gap:20px; }
  .vocab-grid { grid-template-columns:minmax(0,1fr); }
  .vocab-card { padding:19px; }
  .vocab-card strong { font-size:17px; }
  .vocab-card p { font-size:15px; }
  .dialogue-line { margin-right:15px; padding:14px 15px; }
  .dialogue-line:nth-child(even) { margin-left:15px; }
  .dialogue-line p { font-size:14px; }
  .practice-prompt { padding:21px 19px; margin:20px 0; }
  .practice-prompt h2 { font-size:22px; }
  .practice-prompt p { font-size:15px; }
  .record-area { padding:23px 17px; }
  .record-area p { font-size:14px; }
  .record-area small { font-size:11px; }
  .transcript-head { flex-wrap:wrap; gap:7px; }
  .actions>.btn { flex-grow:1; }
  .practice-grid>.panel>.actions>.btn:first-child { width:100%; }
  .feedback-box { padding:20px 17px; }
  .metric-row { gap:10px; }
  .mini-metric { padding:13px; flex:1 1 120px; }
  .mini-metric strong { font-size:23px; }
  .tips-list li { font-size:14px; }
  .notice { font-size:12px; padding:14px; gap:9px; }
  .scenario-grid { grid-template-columns:minmax(0,1fr); gap:17px; }
  .scenario-card { padding:25px; }
  .scenario-card .stat-symbol { width:48px; height:48px; margin-bottom:17px; }
  .scenario-card h2 { font-size:23px; }
  .chat-toolbar { padding:19px 17px; gap:10px; }
  .chat-toolbar h2 { font-size:18px; }
  .chat-toolbar p { font-size:11px; }
  .chat-toolbar .tag { font-size:10px; padding:5px 7px; }
  .messages { padding:20px 16px; max-height:55vh; max-height:55dvh; gap:19px; }
  .message { max-width:100%; gap:8px; }
  .message-avatar { width:27px; height:27px; border-radius:8px; font-size:11px; }
  .message-avatar .icon { width:16px; height:16px; }
  .message .bubble { padding:14px 13px; }
  .bubble p { font-size:16px; }
  .composer { padding:20px 17px; }
  .composer .actions .btn { flex-grow:0; }
  .phrase-picker { padding:18px; }
  .practice-phrase { font-size:26px!important; line-height:1.5; }
  .pronunciation-layout>.panel>.actions .btn { font-size:12px; padding:11px 13px; }
  .field-row { grid-template-columns:minmax(0,1fr); gap:0; }
  .quiz-intro { padding:30px 22px; }
  .quiz-intro h1 { font-size:30px; }
  .quiz-intro .field-row { margin:23px auto 4px; }
  .quiz-intro p { margin:17px auto 23px; font-size:14px; }
  .quiz-card { padding:23px 19px; }
  .quiz-card h2 { font-size:23px; margin:17px 0 23px; }
  .quiz-option { font-size:15px; padding:15px 13px; gap:11px; }
  .quiz-option.selected { padding:14px 12px; }
  .quiz-actions { gap:10px; align-items:stretch; }
  .quiz-actions>.btn { font-size:12px; padding:12px; }
  .quiz-meta { font-size:12px; }
  .badge-grid { gap:13px; }
  .badge-card { padding:24px 15px; }
  .badge-symbol { width:56px; height:56px; border-radius:17px; }
  .badge-card h2 { font-size:18px; }
  .badge-card p { font-size:12px; min-height:64px; }
  .badge-card .tag { font-size:10px; }
  .week-chart { gap:10px; padding:0 0 10px; }
  .chart-col strong { font-size:9px; }
  .chart-col span { font-size:10px; }
  .table-wrap table { min-width:510px; }
  .table-wrap { scrollbar-width:thin; }
  .content-prose p { font-size:14px; }
  .app-footer { flex-direction:column; align-items:flex-start; gap:2px; padding:18px; font-size:10px; }
  .footer-dot { padding:0 7px; }
  .app-footer a { min-height:36px; }
  .storage-warning { padding:12px 18px; font-size:12px; }
  .toast { font-size:12px; padding:13px 16px; width:max-content; max-width:calc(100vw - 28px); }
  dialog { width:calc(100vw - 24px); max-height:calc(100vh - 24px); max-height:calc(100dvh - 24px); border-radius:22px; }
  .dialog-header { padding:19px 20px 17px; }
  .dialog-header h2 { font-size:22px; }
  .dialog-body { padding:22px 20px; }
  .dialog-footer { padding:16px 20px; }
  .dialog-footer .btn { font-size:13px; flex:1; }
  .dialog-footer .btn:first-child { flex:.6; }
}

@media (max-width:360px) {
  .main { padding-left:14px; padding-right:14px; }
  .hero-copy { padding:25px 21px; }
  .hero h2 { font-size:34px; }
  .hero .btn { flex-basis:100%!important; }
  .stat { flex-direction:column; gap:9px; padding:16px; }
  .stat-symbol { width:30px; height:30px; margin:0; }
  .stat p { font-size:11px; }
  .home-columns .lesson-card { grid-template-columns:62px minmax(0,1fr); }
  .home-columns .lesson-body { padding-left:14px; padding-right:14px; }
  .home-columns .lesson-art .category-illustration { width:31px; height:31px; }
  .home-columns .level-chip { left:7px; }
  .home-columns .lesson-meta { flex-wrap:wrap; }
  .goal-panel { grid-template-columns:114px minmax(0,1fr); padding:20px 17px; gap:14px; }
  .goal-dial { width:110px; height:110px; }
  .goal-dial>div { width:90px; height:90px; }
  .goal-dial strong { font-size:26px; }
  .goal-panel>p { font-size:11px; }
  .section-heading { flex-wrap:wrap; }
  .section-heading>.text-link { margin-top:-5px; }
  .badge-grid { grid-template-columns:minmax(0,1fr); }
  .badge-card p { min-height:0; }
  .quiz-actions { flex-direction:column; }
  .match-score { gap:12px; }
  .mobile-nav { padding-left:7px; padding-right:7px; }
}
@media (max-width:760px) {
  .profile-explainer { flex-direction:column; align-items:flex-start; }
  .profile-explainer .actions { flex-direction:row; flex-wrap:wrap; }
  .device-hero { padding:24px; gap:18px; flex-wrap:wrap; }
  .device-hero>.tag { margin-left:76px; }
  .device-hero-icon { width:48px; height:58px; }
  .device-hero>div { flex-basis:calc(100% - 70px); }
  .device-hero h2 { font-size:25px; }
  .device-grid { gap:17px; }
  .storage-warning { flex-wrap:wrap; }
  .storage-warning>span { min-width:200px; }
  .storage-warning>a { margin-left:29px; min-height:32px; }
  .rank-row { gap:12px; padding:15px; }
  .rank-name small { font-size:12px; }
}
@media (max-width:560px) {
  .save-status { padding:0; width:44px; }
  .save-status span { display:none; }
  .topbar-end { gap:6px; }
  .continue-strip { padding:16px; gap:9px; }
  .continue-strip .continue-icon { width:30px; }
  .continue-strip>.actions { margin-left:0; gap:5px; }
  .continue-strip>div:first-of-type { flex-basis:calc(100% - 40px); }
  .continue-strip strong { font-size:13px; }
  .continue-strip .btn { font-size:12px; }
  .feature-grid,.profile-grid,.device-grid { grid-template-columns:minmax(0,1fr); gap:17px; }
  .guide-intro { grid-template-columns:minmax(0,1fr); padding:25px; gap:23px; border-radius:22px; }
  .guide-intro h2 { font-size:29px; }
  .guide-facts { grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; border-left:0; border-top:1px solid #ffffff30; padding:23px 0 0; }
  .guide-facts span { font-size:11px; line-height:1.4; }
  .guide-facts strong { font-size:30px; margin-bottom:4px; }
  .device-hero { padding:22px; gap:14px; }
  .device-hero-icon { width:37px; height:48px; border-radius:12px; }
  .device-hero-icon .icon { width:26px; height:26px; }
  .device-hero>div { flex-basis:calc(100% - 54px); }
  .device-hero>.tag { margin-left:51px; }
  .device-hero h2 { font-size:23px; }
  .device-hero .eyebrow { font-size:9px; }
  .device-grid .panel>h2 { font-size:23px; }
  .local-leaderboard .section-heading { align-items:flex-start; flex-direction:column; }
  .rank-row { gap:9px; padding:14px 11px; }
  .rank-row .avatar { width:32px; height:32px; font-size:12px; }
  .rank-number { width:20px; font-size:13px; }
  .rank-name strong { font-size:14px; }
  .rank-name small { font-size:11px; }
  .rank-points { min-width:35px; }
  .rank-points strong { font-size:23px; }
  .rank-name .tag { padding:2px 6px; font-size:10px; }
  .notes-actions { gap:10px; }
  .notes-actions .btn { flex-shrink:0; }
  .ai-score { padding:16px; }
  .ai-score-heading { flex-wrap:wrap; }
  .rubric-grid { gap:14px; }
  .rubric-item>div { gap:5px; font-size:11px; }
  .profile-links>.btn { flex:1; }
}
@media (prefers-reduced-motion:reduce) {
  *,*:before,*:after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}
@media print {
  .sidebar,.topbar,.app-footer,.back-link,.btn,.text-link,.toast,.nav-shade,.notes-actions,.mobile-nav,.phrase-picker { display:none!important; }
  .workspace { margin:0; padding:0; }
  .main { padding:0; max-width:100%; }
  .panel,.lesson-detail-top { break-inside:avoid; box-shadow:none; border:1px solid #bbb; }
  .detail-grid,.practice-grid,.help-grid { display:block; }
  .detail-grid>aside { margin-top:20px; }
  .print-only { display:block; }
  .main h1 { font-size:26px; }
  body { background:#fff; color:#000; }
}
