/* Symposia mobile (SymposiaMobile + SymposiaUIMobile).
   Layout follows xiongcha's mobile UI (xiongcha.PottingSoil.UI.Mobile: phone-width shell, 56px top bar, fixed
   bottom tab bar, 44px touch targets, safe-area insets); colors are SymposiaUI's light moss palette (css/tokens.css).
   Light theme only: no dark-mode media queries, and "only light" also opts out of browser/WebView auto-dark. */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

:root{color-scheme:only light;--brand:#8FA968;--brand-strong:#5D733E;--on-brand:#2F3B21;--paper:#fff;--canvas:#F8FAF5;--ink:#222B1D;--body:#45523C;--muted:#7D8B72;--line:#E2EAD8;--soft:#E9F0DD;--tint:#F4F7EE;--shadow:rgba(34,43,29,.08)}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--canvas);color:var(--ink);font:15px/1.6 'Plus Jakarta Sans','Noto Sans TC',-apple-system,system-ui,sans-serif;-webkit-text-size-adjust:100%}
a{color:inherit;text-decoration:none}button,input{font:inherit;color:inherit}button,a,input{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.5;cursor:default}
button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--brand-strong);outline-offset:3px}
h1,h2,h3,h4,h5,p{margin:0}h1:focus{outline:none}
:where(svg:not(mjx-container svg)){width:22px;height:22px;flex-shrink:0}
.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}

/* Shell */
.app-shell{max-width:460px;min-height:100dvh;margin:auto;background:var(--paper);box-shadow:0 0 0 1px var(--line);padding-top:env(safe-area-inset-top)}
.page-content{min-height:calc(100dvh - 65px);padding-bottom:calc(84px + env(safe-area-inset-bottom))}
.topbar{position:sticky;top:0;z-index:5;min-height:56px;height:auto;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 12px 0 16px;background:var(--paper);border-bottom:1px solid var(--line);flex-wrap:wrap}
.site-switch{flex:1 0 100%;margin:0 0 8px;text-align:center;font-size:13px;font-weight:700;color:var(--brand-strong);line-height:1.3}
/* The 90px avatar (left 56px to 146px, pointer-events:none) hangs over this row. The row is not a link:
   only the inline-block label on the right is, and the row's left padding keeps it clear of the avatar. */
.site-switch-row--lesson{flex:0 0 auto;width:100%;margin:0;padding:4px 12px 6px 154px;background:var(--paper);border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}
.site-switch--lesson{display:inline-block;flex:none;width:auto;margin:0;padding:0;vertical-align:middle}
/* site-switch.js sets data-site-phone on phones and narrow windows, where a desktop choice would not stick. */
html[data-site-phone] .site-switch,html[data-site-phone] .site-switch-row{display:none}
.topbar-title{flex:1;min-width:0;text-align:center;font-size:15px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.header-spacer{width:44px;flex-shrink:0}
.icon-button{background:none;border:0;width:44px;height:44px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;color:var(--ink)}
.icon-button:active{background:var(--soft)}
.brand{display:inline-flex;align-items:center;gap:10px;font-size:19px;font-weight:800;line-height:1.2;min-height:44px}
.brand-mark{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:var(--brand);color:var(--on-brand);font-size:18px;font-weight:800}
.lang-toggle{display:inline-flex;border:1px solid var(--line);border-radius:999px;padding:2px;background:var(--canvas)}
.lang-toggle button{border:0;background:none;min-width:40px;min-height:34px;padding:0 10px;border-radius:999px;font-size:13px;font-weight:700;color:var(--muted)}
.lang-toggle button.on{background:var(--brand);color:var(--on-brand)}
.tabbar{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:460px;display:flex;background:var(--paper);border-top:1px solid var(--line);padding:5px 6px calc(5px + env(safe-area-inset-bottom));z-index:10}
.tab{flex:1;min-width:0;min-height:54px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:4px 2px;color:var(--muted);font-size:11px;font-weight:700}
.tab span{display:block;max-width:100%;line-height:1.15;text-align:center}
.tab svg{width:21px;height:21px}.tab.on{color:var(--brand-strong)}

/* Content */
.content{padding:20px}
.muted{color:var(--muted)}.small-text{font-size:12px}
.eyebrow{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--brand-strong)}
.hero{padding:8px 0 20px;display:flex;flex-direction:column;gap:8px}
.hero-title{font-size:23px;line-height:1.35;font-weight:800;color:var(--ink)}
.continue{display:flex;flex-direction:column;gap:8px;margin-bottom:8px;padding:16px;border-radius:14px;background:linear-gradient(135deg,#BED09F,#8FA968);color:#2F3B21}
.continue-title{font-size:18px;font-weight:800;line-height:1.35}
.continue-meta{font-size:13px;display:flex;gap:8px;align-items:center}
.continue .code{background:rgba(255,255,255,.55)}
.continue-btn{align-self:flex-end;background:#fff;color:#2F3B21;border-color:transparent}
.section-label{font-size:13px;font-weight:700;color:var(--muted);margin:20px 0 8px}
.list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.list-row{display:flex;align-items:center;gap:14px;min-height:60px;padding:12px 4px;border-bottom:1px solid var(--line)}
.list-row:active{background:var(--tint)}
.list-row>svg{width:16px;color:var(--muted)}
.list-text{flex:1;min-width:0;display:flex;flex-direction:column}
.list-text strong{font-size:15px;color:var(--ink)}.list-text small{font-size:12px;color:var(--muted)}
.clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.badge{flex-shrink:0;width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--soft);color:var(--brand-strong);font-weight:800}
.badge--small{width:30px;height:30px;border-radius:8px;font-size:13px}
.code{flex-shrink:0;max-width:40%;padding:3px 8px;border-radius:6px;background:var(--soft);color:var(--brand-strong);font:600 12px ui-monospace,Menlo,monospace;overflow-wrap:anywhere}
.standard-name{font-size:21px;line-height:1.4;font-weight:800;margin:6px 0 8px}
.lead{color:var(--body);font-size:15px;margin-bottom:16px}
.card{border:1px solid var(--line);border-radius:14px;padding:16px;background:var(--paper)}
.chapter{display:flex;flex-direction:column;gap:10px}.chapter-title{font-size:17px}.chapter h4{font-size:15px;margin-top:6px}.chapter h5{font-size:14px;color:var(--body)}
.start-card{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:16px;padding:16px;border-radius:14px;background:linear-gradient(135deg,#BED09F,#8FA968 60%,#76904F);color:#2F3B21}
.start-icon{width:48px;height:48px;border-radius:14px;background:#fff;color:#465730;display:grid;place-items:center;flex-shrink:0}
.start-card h3{font-size:17px;font-weight:800}.start-card p{font-size:13px;margin-top:2px}
.start-btn{background:#fff;color:#2F3B21;border-color:transparent;width:100%}
.collapse-btn{width:100%;display:flex;align-items:center;gap:8px;flex-wrap:wrap;text-align:left;min-height:48px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--paper);font-weight:800}
.count{min-width:26px;height:26px;padding:0 7px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:var(--brand);color:var(--on-brand);font-size:12px}
.collapse-label{margin-left:auto;color:var(--brand-strong);font-size:13px}
#problems-panel[hidden]{display:none}
.progress-list{display:flex;flex-direction:column;gap:12px}
.timeline{position:relative;margin:4px 0 12px}
.timeline-cap{text-align:center;font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--brand-strong)}
.timeline-cap--top{margin-bottom:8px}
.timeline-cap--bottom{margin-top:10px}
.timeline-track{position:relative;padding:4px 0 8px}
.timeline-spine{position:absolute;left:13px;top:8px;bottom:8px;width:2px;border-radius:999px;background:linear-gradient(to bottom,transparent,var(--brand) 10%,var(--brand) 90%,transparent)}
.timeline-item{display:grid;grid-template-columns:28px minmax(0,1fr);column-gap:12px;align-items:start}
.timeline-item.timeline-gap-sm{margin-top:12px}
.timeline-item.timeline-gap-md{margin-top:28px}
.timeline-item.timeline-gap-lg{margin-top:48px}
.timeline-node{grid-column:1;grid-row:1;display:flex;justify-content:center;padding-top:16px;z-index:1}
.timeline-dot{width:14px;height:14px;border-radius:50%;background:var(--paper,#fff);border:3px solid var(--brand);box-shadow:0 0 0 4px color-mix(in srgb,var(--brand) 16%,transparent)}
.timeline-item.band-low .timeline-dot{border-color:#E07A2F;box-shadow:0 0 0 4px color-mix(in srgb,#E07A2F 18%,transparent)}
.timeline-item.band-mid .timeline-dot{border-color:#EAB308;box-shadow:0 0 0 4px color-mix(in srgb,#EAB308 20%,transparent)}
.timeline-item.band-high .timeline-dot{border-color:#3F8F4E;box-shadow:0 0 0 4px color-mix(in srgb,#3F8F4E 20%,transparent)}
.timeline-bubble{position:relative;grid-column:2;grid-row:1;justify-self:stretch}
.timeline-bubble::after{content:"";position:absolute;top:20px;left:-7px;width:12px;height:12px;background:var(--paper,#fff);transform:rotate(45deg);border-bottom:1px solid var(--line);border-left:1px solid var(--line)}
.progress-card{display:flex;flex-direction:column;gap:8px;margin-bottom:0}
.progress-when{margin:0;font-size:12px;color:var(--muted)}
.progress-when span{font-weight:750;margin-right:6px}
.progress-top{display:flex;align-items:center;gap:8px}
.progress-status{margin-left:auto;font-size:12px;font-weight:750;padding:2px 8px;border-radius:999px;border:1px solid transparent}
.progress-name{font-size:17px;font-weight:800}
.progress-mastery{display:flex;align-items:center;gap:8px}
.progress-mastery strong{font-size:18px;font-variant-numeric:tabular-nums}
.progress-actions{display:flex;justify-content:flex-end}
.meter{flex:1;height:8px;border-radius:999px;background:#E2EAD8;overflow:hidden}
.meter span{display:block;height:100%;border-radius:inherit}
.band-low .progress-status{color:#9A3412;background:#FFF4E8;border-color:#F0C08A}
.band-low .progress-mastery strong{color:#9A3412}
.band-low .meter span{background:#E07A2F}
.band-mid .progress-status{color:#713F12;background:#FEF9C3;border-color:#E4CC5C}
.band-mid .progress-mastery strong{color:#854D0E}
.band-mid .meter span{background:#EAB308}
.band-high .progress-status{color:#14532D;background:#E7F6EA;border-color:#8FCB9B}
.band-high .progress-mastery strong{color:#166534}
.band-high .meter span{background:#3F8F4E}
.prose{color:var(--body);line-height:1.8;overflow-wrap:anywhere}
.problem .list-text span{font-size:14px;overflow-wrap:anywhere}
.list-text img,.bubble-text img,.prose img,.lead img{display:block;max-width:100%;height:auto;margin:8px 0}
.cta{flex-shrink:0;font-size:13px;font-weight:700;color:var(--brand-strong)}
.tag{flex-shrink:0;font-size:11px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:2px 8px}
.is-disabled{opacity:.6}
.loading{display:flex;align-items:center;gap:10px;color:var(--muted);padding:24px 0}
.spinner{width:18px;height:18px;border-radius:50%;border:2px solid var(--line);border-top-color:var(--brand);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.feedback{border:1px solid var(--line);border-left:3px solid var(--brand-strong);background:var(--canvas);padding:12px 14px;margin:16px 0;font-size:13px}
.text-button{border:0;background:none;color:var(--brand-strong);font-weight:700;padding:10px;min-height:44px}
.empty-state{padding:56px 24px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:16px}.empty-state p{color:var(--muted)}
.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 20px;border-radius:10px;font-size:14px;font-weight:700}
.primary{border:1px solid var(--brand);background:var(--brand);color:var(--on-brand)}
.secondary{border:1px solid var(--line);background:var(--paper);color:var(--ink)}
.options{display:flex;flex-direction:column;gap:8px}
.option{text-align:left;min-height:48px;padding:12px 16px;border:1px solid var(--line);border-radius:10px;background:var(--paper)}
.option.selected{border-color:var(--brand);background:var(--soft);font-weight:700}

/* Lesson chat: fixed 100dvh, the thread scrolls (xiongcha's composer / direct-message layout). */
.app-shell--lesson{height:100dvh;min-height:0;display:flex;flex-direction:column}
.lesson-content{flex:1;min-height:0;display:flex;flex-direction:column}
.chat{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}
.mastery{display:flex;flex-direction:column;align-items:flex-end;max-width:88px;line-height:1.15;flex-shrink:0}
.mastery-name{font-size:10px;font-weight:700;max-width:88px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mastery-pct{font-size:16px;font-weight:800}
.mastery--pulse{animation:mastery-blink .9s ease-in-out,mastery-bounce .9s cubic-bezier(.22,1.35,.36,1)}
@keyframes mastery-blink{0%,100%{opacity:1}38%{opacity:.12}}
@keyframes mastery-bounce{0%{transform:translateY(0) scale(1)}32%{transform:translateY(-8px) scale(1.16)}58%{transform:translateY(1px) scale(.94)}78%{transform:translateY(-3px) scale(1.05)}100%{transform:translateY(0) scale(1)}}
.toast{position:absolute;left:50%;bottom:92px;transform:translateX(-50%);z-index:8;max-width:calc(100% - 24px);padding:8px 14px;border-radius:999px;border:1.5px solid;font-size:13px;font-weight:700;text-align:center;background:#fff}
.toast--ok{background:#E7F6EA;color:#0E6B32;border-color:#0E6B32}
.toast--miss{background:#FDECEF;color:#DC143C;border-color:#DC143C}
.chat-head{justify-content:flex-start;padding:0 8px;overflow:visible;z-index:5;flex-wrap:nowrap;height:56px}
/* 90px hanging avatar: sits to the right of the back button so the 44px control stays tappable.
   Top half overlaps the 56px bar; the lower half floats over the thread. */
.tutor-av-space{width:94px;flex-shrink:0}
.sy-tutor-av{
  position:absolute;top:11px;left:56px;width:90px;height:90px;z-index:6;
  border-radius:50%;overflow:hidden;background:var(--paper);
  border:2px solid var(--line);box-shadow:0 6px 18px var(--shadow);pointer-events:none
}
.sy-tutor-av-layer{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .2s ease;pointer-events:none}
.sy-tutor-av-layer.is-on{opacity:1}
.chat-info{flex:1;min-width:0}.chat-name{font-size:15px;font-weight:700;line-height:1.3}.chat-status{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.thread{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:56px 14px 16px;display:flex;flex-direction:column;gap:8px;background:var(--canvas);position:relative;z-index:1}
.msg{display:flex}.msg.mine{justify-content:flex-end}
.bubble{max-width:84%;padding:10px 14px;border-radius:18px;background:var(--paper);border:1px solid var(--line);color:var(--ink);overflow-wrap:anywhere}
.msg.theirs .bubble{border-bottom-left-radius:6px}
.msg.mine .bubble{background:var(--brand);border-color:var(--brand);color:var(--on-brand);border-bottom-right-radius:6px}
.kind-prompt .bubble{border-color:var(--brand);font-weight:600}
.kind-hint .bubble,.kind-success .bubble{background:var(--soft)}
.bubble-label{font-size:11px;font-weight:700;color:var(--brand-strong);margin-bottom:2px}
.typing-dots{display:inline-flex;gap:4px}.typing-dots i{width:6px;height:6px;border-radius:50%;background:var(--muted);animation:blink 1.2s infinite}
.typing-dots i:nth-child(2){animation-delay:.2s}.typing-dots i:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:.3}40%{opacity:1}}
.composer{flex-shrink:0;border-top:1px solid var(--line);background:var(--paper);padding:10px 12px calc(10px + env(safe-area-inset-bottom))}
.composer-wait{color:var(--muted);font-size:13px;text-align:center;min-height:44px;display:flex;align-items:center;justify-content:center}
/* One row: answers (choices, or input + send), then the hint button at the end. It never wraps to its own line. */
.composer-row{display:flex;flex-wrap:nowrap;align-items:center;gap:8px}
.choices{flex:1;min-width:0;display:flex;flex-wrap:wrap;gap:8px}
.choice{min-height:44px;padding:8px 14px;border:1px solid var(--line);border-radius:999px;background:var(--paper);font-weight:600}
.choice:active{background:var(--soft);border-color:var(--brand)}
.composer-input{flex:1;min-width:0;min-height:44px;padding:10px 14px;border:1px solid var(--line);border-radius:999px;background:var(--canvas);font-size:16px}
.send-button{flex-shrink:0;width:44px;height:44px;border:0;border-radius:50%;background:var(--brand);color:var(--on-brand);display:grid;place-items:center}
.send-button svg{width:20px;height:20px}
.hint-button{flex-shrink:0;align-self:center;display:inline-flex;align-items:center;gap:4px;min-height:44px;padding:0 10px;border:0;border-radius:10px;background:none;color:var(--brand-strong);font-size:13px;font-weight:700;white-space:nowrap}
.hint-button svg{width:18px;height:18px}
.done{display:flex;flex-direction:column;gap:10px;align-items:stretch;text-align:center}.done-actions{display:flex;justify-content:flex-end}.done-next{max-width:100%}

/* Pre-Blazor splash and fatal error bar (index.html in both hosts). */
.startup{min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--muted)}
#blazor-error-ui{display:none;position:fixed;left:0;right:0;bottom:0;z-index:100;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:var(--ink);color:var(--paper)}
#blazor-error-ui a{color:var(--paper);font-weight:700;margin-left:8px}

/* All About Learning articles */
.list-row--article{align-items:flex-start;padding:14px 4px}
.list-row--article .list-text{gap:4px}
.recommended-list .eyebrow{display:block}
.article-page{padding-bottom:24px}
.article-back{display:inline-block;margin-bottom:10px;font-weight:700;color:var(--brand-strong)}
.article-title{font-size:22px;line-height:1.35;font-weight:800;margin:6px 0 10px}
.article-subhead{font-size:17px;font-weight:800;margin:22px 0 8px}
.article-prose{font-size:15.5px;line-height:1.7;color:var(--body);margin:0 0 14px}
.article-refs{margin:0;padding-left:1.2em;color:var(--body);font-size:13.5px;line-height:1.55}
.article-refs li{margin:0 0 8px}

/* Splash login (/login, preview), a simpler xiongcha mobile login: no tab bar, brand, two taglines, dummy email. */
.auth-shell{display:flex;flex-direction:column}.auth-shell>main{flex:1;display:flex;flex-direction:column}
.auth-content{position:relative;flex:1;display:flex;flex-direction:column;padding:64px 28px calc(28px + env(safe-area-inset-bottom));background:var(--paper)}
.auth-lang{position:absolute;top:14px;right:16px}
.auth-brand{display:flex;flex-direction:column;align-items:flex-start;gap:18px;font-size:24px;font-weight:800;line-height:1.25;color:var(--brand-strong);margin-bottom:28px}
.auth-brand .brand-mark{width:40px;height:40px;border-radius:10px;font-size:22px}
.auth-tagline{font-size:28px;font-weight:800;line-height:1.35;color:var(--ink);margin:0 0 12px}
.auth-subtagline{font-size:15px;line-height:1.7;color:var(--body);margin:0}
.account-form{display:flex;flex-direction:column;margin-top:36px}
.account-form .auth-intro{color:var(--muted);font-size:13px;margin:0 0 4px}
.account-form>label{font-size:11px;font-weight:700;letter-spacing:.055em;color:var(--muted);margin:20px 0 5px}
.account-form>input{border:0;border-bottom:1px solid var(--line);border-radius:0;padding:7px 0 10px;font-size:16px;background:transparent;width:100%;min-height:44px;outline:none}
.account-form>input:focus{border-color:var(--brand)}
.account-form>.primary{margin-top:30px;width:100%;min-height:48px;font-size:15px}
.auth-foot{margin-top:auto;padding-top:32px;font-size:11.5px;color:var(--muted);text-align:center}
@media(max-width:360px){.auth-content{padding:56px 22px 24px}.auth-tagline{font-size:24px}}
