:root {
    --bg: #101010;
    --surface: #171717;
    --surface-2: #1d1d1d;
    --surface-3: #252525;
    --text: #f2f0f3;
    --muted: #96919a;
    --faint: #66616a;
    --line: #2d2b30;
    --accent: #bb86fc;
    --accent-strong: #cba4ff;
    --accent-soft: rgba(187, 134, 252, .12);
    --success: #58d9c5;
    --error: #e2798a;
    --warning: #e8bf6a;
    --shadow: 0 24px 80px rgba(0, 0, 0, .35);
    --radius: 18px;
    --radius-small: 11px;
    --max: 1180px;
}

html[data-theme="light"] {
    --bg: #f7f5f7;
    --surface: #ffffff;
    --surface-2: #f0edf1;
    --surface-3: #e8e4ea;
    --text: #171419;
    --muted: #6d6771;
    --faint: #8d8790;
    --line: #ddd7df;
    --accent: #7d3fc7;
    --accent-strong: #6d30b5;
    --accent-soft: rgba(125, 63, 199, .09);
    --success: #087f70;
    --error: #b93e55;
    --warning: #9b6a12;
    --shadow: 0 24px 70px rgba(54, 35, 63, .12);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
html[data-theme="light"] { color-scheme: light; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 0%, rgba(187, 134, 252, .055), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
::selection { background: var(--accent); color: #111; }

.site-header {
    width: min(calc(100% - 40px), var(--max));
    height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid transparent;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.02em; }
.brand-mark {
    display: grid; place-items: center;
    width: 30px; height: 30px;
    border: 1px solid var(--line); border-radius: 9px;
    color: var(--accent); font-weight: 800; font-size: 14px;
    background: var(--surface);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.inline-form { display: inline-flex; margin: 0; }
.text-link, .text-button, .icon-button {
    border: 0; background: transparent; color: var(--muted); cursor: pointer;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.text-link, .text-button { padding: 8px 10px; font-size: 13px; }
.text-link:hover, .text-button:hover { color: var(--text); }
.pro-link { color: var(--accent); }
.icon-button {
    width: 36px; height: 36px; display: inline-grid; place-items: center;
    border-radius: 10px; font-size: 16px;
}
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.danger-hover:hover { color: var(--error); }

.page-shell { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; min-height: calc(100vh - 170px); }
.site-footer {
    width: min(calc(100% - 40px), var(--max));
    margin: 70px auto 0; padding: 24px 0 34px;
    display: flex; justify-content: space-between; gap: 20px;
    border-top: 1px solid var(--line); color: var(--faint); font-size: 12px;
}
.site-footer strong { color: var(--muted); font-weight: 550; }
.social-links { display: flex; flex-wrap: wrap; gap: 16px; }
.social-links a:hover { color: var(--accent); }

h1, h2, h3, p { margin-top: 0; }
h1 { letter-spacing: -.045em; line-height: 1.05; }
h2 { letter-spacing: -.03em; line-height: 1.15; }
.eyebrow { margin-bottom: 12px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .2em; text-transform: uppercase; }
.muted { color: var(--muted); }
.micro-copy, .form-note { color: var(--faint); font-size: 12px; }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.back-link:hover { color: var(--text); }

.button {
    min-height: 42px; padding: 10px 18px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: 11px;
    cursor: pointer; font-size: 13px; font-weight: 650;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button-primary { background: var(--accent); color: #111; }
.button-primary:hover:not(:disabled) { background: var(--accent-strong); }
.button-ghost { border-color: var(--line); background: transparent; color: var(--text); }
.button-ghost:hover:not(:disabled) { background: var(--surface-2); }
.button-quiet { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.button-quiet:hover:not(:disabled) { border-color: var(--accent); }
.button-full { width: 100%; }

.flash-stack { position: fixed; z-index: 80; top: 86px; right: 24px; width: min(360px, calc(100% - 48px)); }
.flash { margin-bottom: 10px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; }
.flash-success { border-color: rgba(88,217,197,.35); }
.flash-error { border-color: rgba(226,121,138,.4); }
.toast-region { position: fixed; z-index: 100; bottom: 24px; right: 24px; width: min(360px, calc(100% - 48px)); }
.toast { padding: 13px 15px; margin-top: 10px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; animation: toast-in .22s ease; }
.toast.error { border-color: rgba(226,121,138,.45); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Welcome */
.welcome-shell { padding-top: clamp(70px, 12vh, 140px); }
.hero { max-width: 820px; margin: 0 auto; text-align: center; }
.hero h1 { margin-bottom: 24px; font-size: clamp(48px, 7vw, 88px); font-weight: 670; }
.hero-copy { max-width: 610px; margin: 0 auto 34px; color: var(--muted); font-size: clamp(16px, 2vw, 20px); }
.hero-actions { display: flex; justify-content: center; gap: 12px; margin-bottom: 14px; }
.demo-preview { max-width: 960px; margin: 110px auto 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.glass-card, .panel {
    border: 1px solid var(--line); border-radius: var(--radius); background: rgba(24,24,24,.84);
    box-shadow: 0 1px 0 rgba(255,255,255,.015) inset;
}
html[data-theme="light"] .glass-card, html[data-theme="light"] .panel { background: rgba(255,255,255,.92); }
.demo-card { min-height: 190px; padding: 28px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.demo-card h2 { margin: 10px 0 8px; font-size: 24px; }
.demo-card p { margin: 0; color: var(--muted); font-size: 14px; }
.card-kicker { color: var(--faint); font-size: 10px; letter-spacing: .16em; }
.circle-arrow { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font-size: 21px; }
.circle-arrow:hover { border-color: var(--accent); background: var(--accent-soft); }
.principles { margin: 80px auto 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; border-top: 1px solid var(--line); padding-top: 34px; }
.principles div { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.principles strong { color: var(--accent); font-size: 25px; line-height: 1; }
.principles span { color: var(--muted); font-size: 13px; }

/* Auth */
.auth-shell { display: grid; place-items: center; padding: 70px 0 100px; }
.auth-card { width: min(100%, 470px); padding: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 32px; font-size: 35px; }
.field-label { display: block; margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.field-input, .field-select, .import-textarea {
    width: 100%; border: 1px solid var(--line); border-radius: var(--radius-small);
    background: var(--surface-2); color: var(--text); outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.field-input { height: 46px; padding: 0 14px; margin-bottom: 18px; }
.field-input-large { height: 52px; font-size: 17px; }
.field-input:focus, .field-select:focus, .import-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-error { margin: -11px 0 16px; color: var(--error); font-size: 12px; }
.check-row { display: flex; gap: 8px; align-items: center; margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.auth-switch { margin: 24px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.auth-switch a { color: var(--accent); }
.auth-card .form-note { margin: 14px 0 0; }
.error-card { text-align: center; }
.error-card h1 { font-size: 30px; }
.classroom-card .muted { margin-bottom: 20px; }
.class-meta { display: flex; gap: 8px; margin-bottom: 28px; }
.class-meta span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }

/* Dashboard */
.dashboard-shell { padding-top: 70px; }
.dashboard-heading, .editor-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 38px; }
.dashboard-heading h1, .editor-header h1 { margin: 0 0 9px; font-size: clamp(38px, 5vw, 58px); }
.dashboard-heading p:last-child { margin-bottom: 0; }
.deck-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.deck-card {
    min-height: 260px; padding: 22px;
    display: flex; flex-direction: column;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.deck-card:hover { transform: translateY(-2px); border-color: #444047; box-shadow: 0 18px 50px rgba(0,0,0,.16); }
.deck-card-active { border-left: 3px solid var(--accent); }
.deck-card-top { display: flex; justify-content: space-between; align-items: center; }
.privacy-pill, .word-count { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.privacy-pill { color: var(--accent); }
.word-count { color: var(--faint); }
.deck-card-body { margin: auto 0; }
.deck-card-body h2 { margin: 28px 0 10px; font-size: 24px; }
.deck-card-body p { color: var(--muted); font-size: 13px; }
.deck-card-actions { display: flex; align-items: center; gap: 7px; }
.deck-card-actions .button { margin-right: auto; }
.empty-state { padding: 50px 30px; text-align: center; color: var(--muted); }
.empty-state.wide { grid-column: 1/-1; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state code { color: var(--accent); }

.modal-backdrop { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.modal-card { position: relative; width: min(100%, 520px); padding: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.modal-card h2 { font-size: 30px; }
.modal-card > p:not(.eyebrow) { color: var(--muted); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 22px; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-actions { display: flex; gap: 10px; margin-top: 28px; }

/* Editor */
.editor-shell { padding-top: 45px; }
.editor-header { align-items: flex-end; }
.editor-header .back-link { margin-bottom: 18px; }
.editor-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 18px; align-items: start; }
.editor-main { display: grid; gap: 18px; }
.editor-aside { position: sticky; top: 20px; display: grid; gap: 18px; }
.panel { padding: 26px; }
.field-group + .field-group { margin-top: 2px; }
.settings-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 6px; padding-top: 20px; border-top: 1px solid var(--line); }
.switch-line { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch-line input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); transition: background .18s ease; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; top: 3px; left: 3px; border-radius: 50%; background: var(--muted); transition: transform .18s ease, background .18s ease; }
.switch-line input:checked + .switch { background: var(--accent-soft); border-color: var(--accent); }
.switch-line input:checked + .switch::after { transform: translateX(18px); background: var(--accent); }
.switch-line strong, .switch-line small { display: block; }
.switch-line strong { font-size: 13px; }
.switch-line small { color: var(--muted); font-size: 11px; }
.compact-field { display: grid; grid-template-columns: auto 120px; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.field-select { height: 40px; padding: 0 10px; }
.share-box { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; margin-top: 22px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); font-size: 11px; }
.share-box span { color: var(--muted); }
.share-box code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }
.share-box.is-muted { opacity: .48; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-heading h2 { margin: 0; font-size: 23px; }
.segmented-control { display: flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.segment { padding: 7px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.segment.active { background: var(--surface-3); color: var(--text); }
.import-textarea { min-height: 120px; padding: 14px; resize: vertical; margin-bottom: 12px; }
.file-drop { min-height: 130px; display: grid; place-items: center; align-content: center; gap: 4px; padding: 25px; margin-bottom: 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); text-align: center; cursor: pointer; }
.file-drop input { max-width: 250px; margin-bottom: 8px; }
.file-drop span { color: var(--muted); font-size: 11px; }
.warning-list { margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(232,191,106,.3); border-radius: 10px; color: var(--warning); background: rgba(232,191,106,.06); font-size: 12px; }
.warning-list p { margin: 4px 0; }
.sticky-heading { position: sticky; top: 0; z-index: 2; padding: 2px 0 14px; background: var(--surface); }
.vocab-list { display: grid; gap: 9px; }
.vocab-row {
    display: grid; grid-template-columns: 42px minmax(0,1fr) minmax(0,1fr) 38px;
    gap: 9px; align-items: start; padding: 10px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
}
.vocab-row.advanced { grid-template-columns: 42px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 150px 38px; }
.row-number { height: 42px; display: grid; place-items: center; color: var(--faint); font-size: 11px; }
.row-input, .row-select { width: 100%; min-height: 42px; padding: 10px 11px; border: 1px solid transparent; border-radius: 8px; background: var(--surface); color: var(--text); outline: none; font-size: 13px; }
.row-input:focus, .row-select:focus { border-color: var(--accent); }
.row-remove { width: 36px; height: 42px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); cursor: pointer; }
.row-remove:hover { color: var(--error); background: rgba(226,121,138,.08); }
.advanced-only { display: none; }
.vocab-row.advanced .advanced-only { display: block; }
.add-row-button { width: 100%; margin-top: 12px; padding: 15px; border: 1px dashed var(--line); border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; }
.add-row-button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.milestone-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, var(--surface), var(--surface-2)); overflow: hidden; }
.milestone-icon { float: right; color: var(--accent); font-size: 42px; line-height: 1; }
.milestone-card h2 { margin-bottom: 12px; font-size: 31px; }
.milestone-card > p:not(.eyebrow) { min-height: 60px; color: var(--muted); font-size: 13px; }
.milestone-scale { display: grid; grid-template-columns: repeat(6,1fr); gap: 3px; margin-top: 20px; }
.milestone-scale span { padding-top: 7px; border-top: 2px solid var(--line); color: var(--faint); text-align: center; font-size: 9px; }
.milestone-card[data-level="hard"] .milestone-icon,
.milestone-card[data-level="extreme"] .milestone-icon,
.milestone-card[data-level="peak"] .milestone-icon { text-shadow: 0 0 24px var(--accent); }
.mini-leaderboard h2 { font-size: 22px; }
.mini-rank-row { display: grid; grid-template-columns: 24px 1fr; gap: 3px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-rank-row > span { grid-row: 1/3; color: var(--accent); }
.mini-rank-row strong { font-size: 12px; }
.mini-rank-row small { color: var(--muted); font-size: 10px; }
.mini-leaderboard .text-link { display: inline-block; margin-top: 12px; padding-left: 0; }

/* Study */
.study-page { background: #101010; }
.study-page .page-shell { width: 100%; min-height: 100vh; }
.study-shell { margin: 0; }
.study-stage { position: relative; min-height: 100vh; width: 100%; padding: 28px clamp(24px, 8vw, 130px) 30px; display: flex; flex-direction: column; overflow: hidden; }
.study-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; color: #9b969f; font-size: 12px; }
.study-header a:hover, .study-header button:hover { color: #f4f1f5; }
.study-header button { justify-self: end; border: 0; background: transparent; color: #9b969f; cursor: pointer; font-size: 12px; }
.study-center { width: min(880px, 100%); margin: clamp(70px, 15vh, 155px) auto auto; text-align: center; }
.round-label { height: 20px; margin-bottom: 18px; color: #6f6973; font-size: 10px; text-transform: uppercase; letter-spacing: .18em; }
.study-prompt { min-height: 78px; margin-bottom: clamp(60px, 10vh, 105px); color: #f3f0f4; font-size: clamp(42px, 5vw, 64px); font-weight: 650; letter-spacing: -.035em; text-shadow: 1px 1px 0 #000; }
.answer-area { position: relative; }
.study-input { width: 100%; height: 66px; padding: 0 10px 13px; border: 0; border-bottom: 2px solid #b97df7; outline: 0; background: transparent; color: #f3f0f4; text-align: center; font-size: clamp(28px, 4vw, 44px); caret-color: #f3f0f4; }
.study-input.shake { animation: shake .34s ease; color: var(--error); border-color: var(--error); }
.study-input.correct-flash { animation: correct-flash .32s ease; }
@keyframes shake { 25% { transform: translateX(-7px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
@keyframes correct-flash { 50% { border-color: var(--success); text-shadow: 0 0 18px rgba(88,217,197,.55); } }
.pronunciation-line { margin-top: 17px; color: #bc83fb; font-size: 20px; }
.correction-panel { margin: 20px auto 0; display: grid; gap: 5px; }
.correction-panel[hidden] { display: none; }
.correction-panel span, .correction-panel small { color: #77717a; font-size: 11px; }
.correction-panel strong { color: var(--error); font-size: 25px; }
.context-line { width: min(720px, 92%); margin: 22px auto 0; padding: 13px 16px; border-left: 2px solid #7a4ba7; color: #a7a2aa; background: #171717; text-align: left; font-size: 14px; font-style: italic; }
.study-shortcuts { margin: auto auto 0; display: flex; justify-content: center; gap: 12px; color: #6e6871; font-size: 11px; }
kbd { padding: 3px 6px; border: 1px solid #39363b; border-radius: 5px; background: #262428; color: #a9a4ac; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; box-shadow: 0 1px 0 #444 inset; }
.round-toast { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); width: min(520px, calc(100% - 40px)); padding: 15px 18px; border: 1px solid #38343b; border-radius: 12px; background: rgba(24,24,24,.96); box-shadow: var(--shadow); text-align: center; animation: toast-in .2s ease; }
.round-toast strong, .round-toast span { display: block; }
.round-toast strong { font-size: 13px; }
.round-toast span { margin-top: 3px; color: #817a85; font-size: 11px; }

/* Results */
.result-shell { padding-top: 55px; }
.ad-card { width: min(100%, 540px); padding: 36px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); text-align: center; box-shadow: var(--shadow); }
.ad-label { color: var(--faint); font-size: 9px; letter-spacing: .16em; }
.ad-visual { width: 100%; height: 170px; margin: 18px 0 26px; display: grid; place-items: center; border-radius: 15px; background: radial-gradient(circle, rgba(187,134,252,.25), transparent 60%), #111; overflow: hidden; }
.ad-visual span { width: 72px; height: 72px; display: grid; place-items: center; border: 1px solid rgba(187,134,252,.5); border-radius: 22px; color: var(--accent); font-size: 32px; font-weight: 800; box-shadow: 0 0 45px rgba(187,134,252,.15); }
.ad-card h1 { font-size: 32px; }
.ad-card p { color: var(--muted); font-size: 14px; }
.ad-card .button { margin-top: 12px; }
.result-content.is-locked { visibility: hidden; }
.result-hero { max-width: 820px; margin: 0 auto 54px; text-align: center; }
.badge-orbit { width: 86px; height: 86px; margin: 0 auto 22px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font-size: 42px; box-shadow: 0 0 0 10px var(--accent-soft), 0 0 42px rgba(187,134,252,.18); animation: badge-arrive .6s cubic-bezier(.2,.8,.2,1); }
@keyframes badge-arrive { from { opacity: 0; transform: scale(.65) rotate(-20deg); } }
.result-hero h1 { margin-bottom: 18px; font-size: clamp(44px, 6vw, 75px); }
.result-hero > p:last-of-type { color: var(--muted); font-size: 16px; }
.rank-callout { display: inline-flex; gap: 8px; align-items: center; margin-top: 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.rank-callout strong { color: var(--accent); font-size: 16px; }
.stat-summary-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 18px; }
.stat-summary-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stat-summary-grid span, .stat-summary-grid strong { display: block; }
.stat-summary-grid span { color: var(--muted); font-size: 11px; }
.stat-summary-grid strong { margin-top: 7px; font-size: 30px; }
.result-panel { margin-bottom: 18px; }
.round-table { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.round-row { display: grid; grid-template-columns: 1fr repeat(3,120px); padding: 13px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.round-row:first-child { border-top: 0; }
.round-row span:not(:first-child) { text-align: right; }
.round-head { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; background: var(--surface-2); }
.result-two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.weak-row { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.weak-row strong { font-size: 14px; }
.weak-row span { color: var(--muted); font-size: 11px; }
.leaderboard-list { display: grid; }
.leaderboard-row { display: grid; grid-template-columns: 28px minmax(0,1fr) 70px 130px; align-items: center; gap: 10px; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.leaderboard-row.is-me { margin: 0 -10px; padding-left: 20px; padding-right: 20px; background: var(--accent-soft); border-radius: 8px; }
.rank-number { color: var(--accent); font-weight: 700; }
.leaderboard-row > span:nth-child(3), .leaderboard-row small { text-align: right; }
.leaderboard-row small { color: var(--muted); }
.leaderboard-row.large { grid-template-columns: 45px minmax(0,1fr) 100px 180px; padding: 17px 8px; }
.leaderboard-page { max-width: 900px; margin: 0 auto; }
.result-actions { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }

/* Pro */
.pro-shell { padding-top: 75px; }
.pro-hero { max-width: 850px; margin-bottom: 60px; }
.pro-hero h1 { font-size: clamp(50px, 7vw, 86px); }
.pro-hero p:last-child { max-width: 590px; color: var(--muted); font-size: 17px; }
.pro-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.pro-benefits h2, .payment-preview h2 { font-size: 28px; }
.benefit-row { display: grid; grid-template-columns: 45px 1fr; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.benefit-row > span { color: var(--accent); font-family: ui-monospace, monospace; }
.benefit-row strong { font-size: 15px; }
.benefit-row p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.payment-preview { position: relative; overflow: hidden; }
.demo-ribbon { position: absolute; top: 18px; right: -38px; width: 170px; padding: 6px; transform: rotate(35deg); background: var(--warning); color: #1a1308; text-align: center; font-size: 9px; font-weight: 800; }
.fake-qr { width: 210px; aspect-ratio: 1; margin: 24px auto; padding: 14px; display: grid; grid-template-columns: repeat(9,1fr); gap: 2px; background: white; border-radius: 12px; }
.fake-qr i { background: white; }
.fake-qr i.on { background: #111; }
.payment-line { display: flex; justify-content: space-between; gap: 10px; margin: 20px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; }
.payment-line span { color: var(--muted); }
.payment-line code { color: var(--accent); }

@media (max-width: 980px) {
    .deck-grid { grid-template-columns: repeat(2,1fr); }
    .editor-layout { grid-template-columns: 1fr; }
    .editor-aside { position: static; grid-template-columns: 1fr 1fr; }
    .vocab-row.advanced { grid-template-columns: 42px 1fr 1fr 38px; }
    .vocab-row.advanced .advanced-only { grid-column: span 2; }
    .pro-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .site-header, .page-shell, .site-footer { width: min(calc(100% - 28px), var(--max)); }
    .site-header { height: 64px; }
    .brand span:last-child { display: none; }
    .site-footer { flex-direction: column; }
    .welcome-shell { padding-top: 60px; }
    .hero h1 { font-size: 44px; }
    .demo-preview, .principles, .deck-grid, .result-two-column, .stat-summary-grid { grid-template-columns: 1fr; }
    .dashboard-heading, .editor-header { align-items: flex-start; flex-direction: column; }
    .dashboard-heading .button, .editor-header .button { width: 100%; }
    .deck-card { min-height: 220px; }
    .editor-aside { grid-template-columns: 1fr; }
    .settings-row { align-items: flex-start; flex-direction: column; }
    .share-box { grid-template-columns: 1fr; }
    .vocab-row, .vocab-row.advanced { grid-template-columns: 28px minmax(0,1fr) 34px; }
    .vocab-row .row-input:nth-of-type(2), .vocab-row.advanced .row-input:nth-of-type(2) { grid-column: 2; }
    .vocab-row.advanced .advanced-only { grid-column: 2; }
    .row-remove { grid-column: 3; grid-row: 1; }
    .study-stage { padding: 20px 18px; }
    .study-header { grid-template-columns: 1fr auto; gap: 10px; }
    .study-header > span { display: none; }
    .study-center { margin-top: 90px; }
    .study-prompt { margin-bottom: 70px; font-size: 42px; }
    .study-shortcuts { gap: 7px; font-size: 9px; }
    .round-row { grid-template-columns: 1fr repeat(3,70px); padding: 12px 10px; }
    .leaderboard-row, .leaderboard-row.large { grid-template-columns: 24px minmax(0,1fr) 60px; }
    .leaderboard-row small { grid-column: 2/4; text-align: left; }
    .result-actions { flex-direction: column; }
    .result-actions .button, .result-actions form, .result-actions form .button { width: 100%; }
    .auth-card { padding: 27px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Guest creator lock + analytics preview */
.guest-creator-preview { position: relative; min-height: 190px; margin-bottom: 18px; overflow: hidden; cursor: pointer; }
.guest-blurred-form { filter: blur(3px); opacity: .28; pointer-events: none; }
.guest-blurred-form .import-textarea { min-height: 80px; }
.guest-lock-overlay { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; padding: 20px; text-align: center; background: radial-gradient(circle, rgba(16,16,16,.25), rgba(16,16,16,.76)); }
.guest-lock-overlay > span { color: var(--accent); font-size: 30px; }
.guest-lock-overlay strong { font-size: 16px; }
.guest-lock-overlay small { color: var(--muted); }
.analytics-lock-card { position: relative; min-height: 170px; margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.analytics-blur { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 26px; filter: blur(5px); opacity: .25; }
.analytics-blur span { padding: 25px; border: 1px solid var(--line); border-radius: 12px; }
.analytics-lock-copy { position: relative; z-index: 2; min-height: 170px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 28px; background: linear-gradient(90deg, rgba(16,16,16,.8), rgba(16,16,16,.48)); }
html[data-theme="light"] .analytics-lock-copy { background: linear-gradient(90deg, rgba(255,255,255,.88), rgba(255,255,255,.6)); }
.lock-symbol { color: var(--accent); font-size: 36px; }
.analytics-lock-copy h2 { margin: 0 0 7px; }
.analytics-lock-copy p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.study-header-actions { justify-self: end; display: flex; align-items: center; gap: 14px; }
.study-header-actions a { color: #6f6973; font-size: 11px; }
.study-header-actions a:hover { color: #bc83fb; }
@media (max-width: 720px) {
  .analytics-lock-copy { grid-template-columns: auto 1fr; }
  .analytics-lock-copy .button { grid-column: 1/-1; width: 100%; }
  .analytics-blur { grid-template-columns: 1fr; }
  .study-header-actions a { display: none; }
}

/* MindFocus Handoff 0.1.2 — visual polish */
.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--faint);
    transition: color .18s ease, transform .18s ease;
}
.social-links a:hover { color: var(--accent); transform: translateY(-1px); }
.social-links svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.social-links a:first-child svg path,
.social-links a:nth-child(3) svg path { fill: currentColor; stroke: none; }
.social-links .svg-fill { fill: currentColor; stroke: none; }

/* Welcome: one complete desktop viewport at 1920 × 1080 / 100% zoom. */
.welcome-page {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}
.welcome-page .site-header { height: 64px; flex: 0 0 auto; }
.welcome-page .page-shell {
    flex: 1 1 auto;
    min-height: 0;
}
.welcome-shell {
    padding-top: clamp(6px, 1.2vh, 14px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.welcome-page .hero { max-width: 1000px; }
.welcome-page .hero h1 {
    margin: 0 0 clamp(10px, 1.5vh, 16px);
    font-size: clamp(48px, 4.4vw, 76px);
    line-height: .98;
    font-weight: 690;
}
.welcome-page .hero h1 span { display: block; white-space: nowrap; }
.welcome-page .hero-copy {
    margin-bottom: clamp(14px, 2vh, 22px);
    font-size: clamp(14px, 1.25vw, 18px);
}
.welcome-page .hero-actions { margin-bottom: 9px; }
.welcome-page .hero-note { margin-bottom: 0; font-size: 13px; }
.welcome-page .demo-preview {
    width: min(920px, 100%);
    margin: clamp(18px, 2.8vh, 30px) auto 0;
    gap: 12px;
}
.welcome-page .demo-card {
    min-height: 132px;
    padding: 20px 22px;
}
.welcome-page .demo-card h2 { margin: 7px 0 5px; font-size: 21px; }
.welcome-page .demo-card p { font-size: 12px; }
.welcome-page .circle-arrow { width: 38px; height: 38px; font-size: 18px; }
.welcome-page .principles {
    width: 100%;
    margin: clamp(16px, 2.3vh, 26px) auto 0;
    padding-top: clamp(14px, 1.8vh, 20px);
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 22px;
}
.welcome-page .principles div {
    min-height: 44px;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}
.welcome-page .principles strong {
    width: 38px;
    text-align: center;
    font-size: 22px;
    line-height: 1;
}
.welcome-page .principles span { font-size: 12px; line-height: 1.35; }
.welcome-page .site-footer {
    flex: 0 0 auto;
    margin-top: 12px;
    padding: 11px 0 15px;
}

/* Study success feedback: keep the learner's correct answer visible for 1 second. */
.study-input.correct-state {
    color: var(--success);
    border-bottom-color: var(--success);
    border-bottom-width: 4px;
    font-weight: 760;
    text-shadow: 0 0 18px rgba(88, 217, 197, .28);
    caret-color: transparent;
}
.study-input.correct-state::selection { background: transparent; color: var(--success); }

/* Guest dashboard conversion card. */
.guest-lock-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--accent);
    border: 1px solid rgba(187, 134, 252, .4);
    border-radius: 10px;
    background: var(--accent-soft);
}
.guest-lock-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.guest-lock-icon .svg-fill { fill: currentColor; stroke: none; }
.guest-lock-overlay > span.guest-lock-icon { font-size: 0; }
.guest-lock-overlay small { max-width: 560px; line-height: 1.5; }
.free-account-card {
    border-color: rgba(187, 134, 252, .28);
    background: linear-gradient(145deg, var(--surface), rgba(187, 134, 252, .055));
}
.free-account-content { margin: auto 0 18px; }
.free-account-content h2 { margin: 20px 0 18px; font-size: 23px; }
.free-benefits { display: grid; gap: 10px; }
.free-benefits div {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}
.free-benefits strong { color: var(--accent); font-size: 17px; }
.free-benefits span { color: var(--muted); font-size: 12px; }

@media (max-width: 980px) {
    .welcome-page .hero h1 span { white-space: normal; }
    .welcome-page .principles { grid-template-columns: repeat(2, 1fr); }
    .demo-deck-grid .free-account-card { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    .welcome-page { display: block; }
    .welcome-shell { display: block; padding-top: 42px; }
    .welcome-page .hero h1 { font-size: 43px; line-height: 1.02; }
    .welcome-page .hero h1 span { white-space: normal; }
    .welcome-page .demo-preview { margin-top: 44px; }
    .welcome-page .principles { grid-template-columns: 1fr; margin-top: 36px; }
    .welcome-page .site-footer { margin-top: 44px; }
    .social-links { gap: 14px; }
    .social-links a span { display: none; }
    .social-links svg { width: 17px; height: 17px; }
    .demo-deck-grid .free-account-card { grid-column: auto; }
}

@media (max-height: 820px) and (min-width: 981px) {
    .welcome-page .site-header { height: 56px; }
    .welcome-page .hero h1 { font-size: clamp(44px, 4vw, 64px); }
    .welcome-page .hero-copy { margin-bottom: 12px; }
    .welcome-page .demo-preview { margin-top: 15px; }
    .welcome-page .demo-card { min-height: 116px; padding: 16px 19px; }
    .welcome-page .principles { margin-top: 13px; padding-top: 12px; gap: 9px 18px; }
    .welcome-page .principles div { min-height: 38px; }
    .welcome-page .site-footer { margin-top: 8px; padding: 8px 0 10px; }
}

/* MindFocus Handoff 0.1.3 */
body.modal-open { overflow: hidden; }

/* Stable navigation: language and account text never move neighbouring controls. */
.site-header {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    gap: 22px;
}
.brand-zone { display: flex; align-items: center; min-width: 0; }
.brand-zone .brand { flex: 0 0 auto; }
.nav-back-button {
    width: 36px; height: 36px; margin-right: 12px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
}
.nav-back-button:hover { color: var(--text); border-color: var(--accent); }
.nav-back-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-nav { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 28px); white-space: nowrap; }
.primary-nav a { position: relative; padding: 8px 2px; color: var(--muted); font-size: 13px; transition: color .18s ease; }
.primary-nav a:hover, .primary-nav a.is-active { color: var(--text); }
.primary-nav a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: var(--accent); }
.header-actions {
    justify-self: end;
    display: grid;
    grid-template-columns: 38px 42px 96px;
    align-items: center;
    column-gap: 8px;
}
.header-control-cell { width: 100%; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.account-cell { justify-content: flex-end; }
.account-cell .text-link, .account-cell .text-button { width: 96px; text-align: center; justify-content: center; }
.locale-cell .text-button { width: 42px; text-align: center; }

/* Beta social proof on the first viewport. */
.beta-metrics {
    width: min(920px, 100%); margin: clamp(14px, 2vh, 22px) auto 0;
    display: grid; grid-template-columns: auto repeat(3, 1fr); align-items: stretch;
    border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(187,134,252,.025);
}
.beta-badge { display: grid; place-items: center; padding: 0 18px; color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: .16em; writing-mode: vertical-rl; transform: rotate(180deg); border-right: 1px solid var(--line); }
.beta-metrics article { min-height: 68px; display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 16px 12px; border-right: 1px solid var(--line); text-align: center; }
.beta-metrics article:last-child { border-right: 0; }
.beta-metrics strong { color: var(--accent); font-size: 23px; line-height: 1; }
.beta-metrics span:not(.beta-badge) { color: var(--muted); font-size: 11px; }
.welcome-page .demo-preview { margin-top: clamp(13px, 2vh, 22px); }
.welcome-page .principles { margin-top: clamp(12px, 1.8vh, 20px); }

/* Donation ticker and modal. */
.donation-ticker {
    width: min(calc(100% - 40px), var(--max)); height: 34px; margin: 10px auto 0; padding: 0;
    display: block; overflow: hidden; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer;
}
.donation-track { width: max-content; min-width: 200%; height: 100%; display: flex; align-items: center; animation: donation-marquee 28s linear infinite; }
.donation-track span { width: 50%; padding: 0 42px; text-align: center; font-size: 11px; white-space: nowrap; }
.donation-ticker:hover .donation-track, .donation-ticker:focus-visible .donation-track { animation-play-state: paused; color: var(--accent); }
@keyframes donation-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.donation-card { width: min(100%, 720px); }
.donation-layout { display: grid; grid-template-columns: minmax(210px, 320px) 1fr; gap: 24px; align-items: center; margin-top: 24px; }
.donation-layout img { width: 100%; max-height: 430px; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: #eaf8ff; }
.donation-layout dl { margin: 0; display: grid; gap: 16px; }
.donation-layout dl div { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.donation-layout dt { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.donation-layout dd { margin: 5px 0 0; color: var(--text); font-weight: 650; }
.donation-layout code { color: var(--accent); }

/* Pro one-page checkout. */
.pro-shell { padding-top: 48px; }
.pro-hero { max-width: 760px; margin-bottom: 34px; }
.pro-hero h1 { margin-bottom: 12px; font-size: clamp(42px, 6vw, 72px); }
.pro-hero > p:last-child { color: var(--muted); font-size: 17px; }
.pro-layout { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(330px, .82fr); gap: 18px; align-items: start; }
.pro-benefits-panel, .payment-card { padding: 30px; }
.pro-benefit-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pro-benefit-list article { min-height: 92px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.pro-benefit-list article span { color: var(--accent); font-size: 10px; letter-spacing: .14em; }
.pro-benefit-list article p { margin: 10px 0 0; font-size: 14px; }
.plan-comparison { margin-top: 22px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.comparison-row { display: grid; grid-template-columns: 1.2fr .7fr .7fr; gap: 8px; align-items: center; padding: 12px 15px; border-bottom: 1px solid var(--line); font-size: 12px; }
.comparison-row:last-child { border-bottom: 0; }
.comparison-row strong { text-align: center; }
.comparison-head { color: var(--faint); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; background: var(--surface-2); }
.payment-card { position: sticky; top: 18px; }
.plan-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.plan-option { min-height: 94px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left; }
.plan-option.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-option span, .plan-option small { color: var(--muted); font-size: 11px; }
.plan-option strong { font-size: 15px; }
.plan-option small { color: var(--accent); }
.payment-result { margin-top: 18px; }
.payment-result img { width: min(100%, 360px); display: block; margin: 0 auto 16px; border-radius: 14px; background: #fff; }
.payment-status { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 5px rgba(232,191,106,.08); }
.payment-line { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.payment-line code, .payment-line strong { color: var(--text); }
.payment-steps { margin: 18px 0 8px; color: var(--muted); font-size: 11px; line-height: 1.6; }

/* About page: content remains HTML; animation is only presentation. */
.about-shell { padding-top: 50px; }
.reveal-on-scroll { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
.about-opening { max-width: 1040px; min-height: 58vh; display: grid; align-content: center; }
.about-opening h1 { font-size: clamp(45px, 7vw, 94px); }
.about-opening h1 span { display: block; margin-bottom: .12em; }
.about-opening h1 span:nth-child(2) { color: var(--muted); }
.about-opening h1 span:nth-child(3) { color: var(--accent); }
.about-story { min-height: 70vh; display: grid; grid-template-columns: 1fr .8fr; gap: 60px; align-items: center; }
.about-story h2, .about-mission h2, .about-builder h2, .about-beta h2, .about-cta h2 { font-size: clamp(36px, 5vw, 64px); }
.about-story p, .about-builder p, .about-beta p { color: var(--muted); font-size: 16px; }
.about-line-art { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 66%); }
.about-line-art span { font-size: clamp(80px, 14vw, 180px); color: var(--accent); font-weight: 800; }
.about-mission { min-height: 64vh; display: grid; align-content: center; max-width: 1000px; }
.about-mission h2 { color: var(--text); line-height: 1.15; }
.about-principles { padding: 80px 0; }
.about-principle-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.about-principle-grid article { min-height: 160px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.about-principle-grid strong { color: var(--accent); font-size: 12px; }
.about-principle-grid span { font-size: 18px; font-weight: 650; }
.about-builder { min-height: 78vh; display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 70px; align-items: center; }
.about-photo-slot { width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; border: 1px dashed var(--accent); border-radius: var(--radius); background: linear-gradient(145deg, var(--surface), var(--accent-soft)); color: var(--faint); text-align: center; font-size: 10px; letter-spacing: .14em; }
.about-photo-slot img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.builder-role { color: var(--accent) !important; }
.about-contact { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; }
.about-contact a { color: var(--muted); }
.about-contact a:hover { color: var(--accent); }
.about-beta { max-width: 900px; margin: 60px 0; padding: 40px; border-left: 3px solid var(--accent); background: var(--surface); }
.about-cta { min-height: 52vh; display: grid; place-items: center; align-content: center; gap: 24px; text-align: center; }
.about-cta > div { display: flex; gap: 10px; }

/* Study donation nudge. */
.study-donation-nudge { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 11px; transition: color .18s ease; }
.study-donation-nudge:hover { color: var(--accent); }
.study-back-link { border: 0; background: transparent; color: var(--muted); cursor: pointer; text-align: left; }
.study-back-link:hover { color: var(--text); }
.editor-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0; }
.editor-pagination span { color: var(--muted); font-size: 12px; }

@media (max-width: 1050px) {
    .site-header { grid-template-columns: 1fr auto; }
    .primary-nav { display: none; }
    .pro-layout, .about-story, .about-builder { grid-template-columns: 1fr; }
    .payment-card { position: static; }
    .about-line-art { width: min(420px, 80vw); margin: 0 auto; }
    .about-principle-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .site-header { grid-template-columns: 1fr auto; gap: 8px; }
    .header-actions { grid-template-columns: 34px 36px 78px; column-gap: 2px; }
    .account-cell .text-link, .account-cell .text-button { width: 78px; padding-left: 2px; padding-right: 2px; font-size: 11px; }
    .nav-back-button { margin-right: 5px; }
    .beta-metrics { grid-template-columns: 1fr; }
    .beta-badge { writing-mode: horizontal-tb; transform: none; padding: 9px; border-right: 0; border-bottom: 1px solid var(--line); }
    .beta-metrics article { min-height: 54px; border-right: 0; border-bottom: 1px solid var(--line); }
    .beta-metrics article:last-child { border-bottom: 0; }
    .donation-track span { padding: 0 18px; }
    .donation-layout { grid-template-columns: 1fr; }
    .pro-benefit-list, .plan-picker, .about-principle-grid { grid-template-columns: 1fr; }
    .about-opening { min-height: 70vh; }
    .about-builder { gap: 30px; }
    .about-photo-slot { width: min(100%, 340px); }
    .about-cta > div { width: 100%; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .donation-track { animation: none; width: 100%; min-width: 100%; justify-content: center; }
    .donation-track span { width: auto; white-space: normal; }
    .donation-track span[aria-hidden="true"] { display: none; }
    .reveal-on-scroll { opacity: 1; transform: none; }
}

/* MindFocus Handoff 0.1.4 ------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(16, 16, 16, .88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom-color: rgba(255, 255, 255, .035);
}
html[data-theme="light"] .site-header { background: rgba(247, 245, 247, .9); border-bottom-color: rgba(23, 20, 25, .06); }

.footer-main-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.site-footer { flex-direction: column; gap: 10px; }
.footer-legal-links { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--faint); font-size: 10px; }
.footer-legal-links a:hover { color: var(--accent); }
.welcome-page .site-footer { gap: 7px; }
.welcome-page .footer-legal-links { justify-content: center; }

/* Beta metrics: number first, label on its own line, horizontal Beta badge. */
.beta-metrics { grid-template-columns: minmax(140px, .72fr) repeat(3, 1fr); }
.beta-badge {
    writing-mode: horizontal-tb;
    transform: none;
    padding: 0 18px;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    text-align: center;
    line-height: 1.45;
}
.beta-metrics article {
    min-height: 78px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
}
.beta-metrics strong { font-size: clamp(27px, 2.2vw, 36px); font-weight: 780; }
.beta-metrics span:not(.beta-badge) { display: block; line-height: 1.25; }

/* Benefit rows: icon and text stay centered; hover is subtle but visible. */
.welcome-page .principles div {
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 11px;
    transform-origin: center;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.welcome-page .principles div:hover,
.welcome-page .principles div:focus-visible {
    transform: scale(1.035);
    background: var(--surface);
    border-color: var(--line);
    outline: none;
}
.welcome-page .principles strong { font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; }

/* Donation QR now uses the clean MoMo/VietQR white card only. */
.donation-layout img { background: #fff; padding: 3px; }
.donation-layout code { display: inline-block; white-space: normal; line-height: 1.45; }

/* About: the four principles are left-centred and founder copy stays readable. */
.about-principle-grid article { align-items: flex-start; justify-content: center; gap: 24px; text-align: left; }
.about-principle-grid strong { font-size: 14px; }
.about-principle-grid span { max-width: 230px; font-size: clamp(17px, 1.4vw, 21px); }
.about-builder-copy { align-self: center; text-align: left; }
.about-builder-copy > p { max-width: 760px; }
.about-builder-copy .builder-role { font-size: 17px; line-height: 1.55; }

/* Pro: use the available space and make every privilege easy to scan. */
.pro-benefit-list article { min-height: 126px; padding: 23px; display: flex; flex-direction: column; justify-content: center; }
.pro-benefit-list article span { font-size: 13px; font-weight: 800; }
.pro-benefit-list article p { margin-top: 14px; font-size: clamp(16px, 1.3vw, 20px); line-height: 1.35; font-weight: 650; }
.pro-warning { margin: 18px 0 0; padding: 15px 16px; border-left: 2px solid var(--warning); background: rgba(232,191,106,.055); line-height: 1.6; }
.payment-card { top: 88px; }
.payment-card > .eyebrow { font-size: 12px; }

/* Public guides and legal pages for AdSense readiness. */
.public-hero { max-width: 900px; padding: 72px 0 46px; }
.public-hero h1 { margin-bottom: 18px; font-size: clamp(46px, 6.4vw, 82px); }
.public-hero > p:last-child { max-width: 720px; color: var(--muted); font-size: 17px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.guide-card { min-height: 290px; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.guide-card h2 { margin-bottom: 12px; font-size: 25px; }
.guide-card p:not(.eyebrow) { color: var(--muted); }
.guide-card .button { align-self: flex-start; }
.guide-detail-shell, .legal-shell { max-width: 920px; }
.guide-article, .legal-document { padding: 68px 0 30px; }
.guide-header, .legal-header { padding-bottom: 42px; margin-bottom: 42px; border-bottom: 1px solid var(--line); }
.guide-header h1, .legal-header h1 { margin-bottom: 18px; font-size: clamp(43px, 6vw, 72px); }
.guide-header > p:last-child { max-width: 760px; color: var(--muted); font-size: 18px; }
.guide-article > section, .legal-document > section { margin: 0 0 44px; }
.guide-article h2, .legal-document h2 { margin-bottom: 15px; font-size: 27px; }
.guide-article p, .legal-document p, .legal-document li { color: var(--muted); font-size: 16px; line-height: 1.78; }
.legal-document ul { padding-left: 22px; }
.legal-document a, .guide-article a { color: var(--accent); }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.contact-grid article { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.contact-grid h3 { margin: 0 0 12px; }
.guide-end { margin-top: 58px; padding-top: 30px; border-top: 1px solid var(--line); }
.guide-end > div { display: flex; gap: 10px; margin-top: 18px; }

/* Basic first-party preference banner. A Google-certified CMP is still needed before personalised AdSense. */
.consent-banner {
    position: fixed;
    z-index: 120;
    left: 50%;
    bottom: 18px;
    width: min(880px, calc(100% - 32px));
    transform: translateX(-50%);
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.consent-banner[hidden] { display: none; }
.consent-banner strong { display: block; margin-bottom: 5px; }
.consent-banner p { margin: 0; color: var(--muted); font-size: 12px; }
.consent-banner p a { color: var(--accent); }
.consent-actions { display: flex; gap: 8px; }

/* Pro insights: real history is calculated at the backend; Free sees a locked preview. */
.insights-shell { padding-top: 60px; }
.dashboard-heading-actions { display: flex; gap: 10px; }
.insights-wrap { position: relative; }
.insights-wrap.is-locked > :not(.insights-lock-overlay) { filter: blur(7px); opacity: .45; pointer-events: none; user-select: none; }
.insights-lock-overlay { position: absolute; z-index: 4; inset: 0; min-height: 440px; display: grid; place-items: center; align-content: center; gap: 12px; padding: 30px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(16,16,16,.62); backdrop-filter: blur(7px); }
html[data-theme="light"] .insights-lock-overlay { background: rgba(247,245,247,.68); }
.insights-lock-overlay > span { color: var(--accent); font-size: 38px; }
.insights-lock-overlay h2 { margin: 0; max-width: 620px; font-size: 30px; }
.insights-lock-overlay p { max-width: 620px; color: var(--muted); }
.history-row { padding: 13px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.history-row > div { display: grid; }
.history-row span { color: var(--muted); font-size: 11px; }

/* Advertising gates were removed in 0.1.4; results are always available immediately. */
.result-content { opacity: 1 !important; pointer-events: auto !important; filter: none !important; }

@media (max-width: 900px) {
    .guide-grid, .contact-grid { grid-template-columns: 1fr; }
    .beta-metrics { grid-template-columns: 1fr; }
    .beta-badge { min-height: 44px; border-left: 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .beta-metrics article { border-right: 0; border-bottom: 1px solid var(--line); }
    .beta-metrics article:last-child { border-bottom: 0; }
}

@media (max-width: 720px) {
    .footer-main-row { align-items: flex-start; flex-direction: column; }
    .footer-legal-links { gap: 8px 14px; }
    .consent-banner { grid-template-columns: 1fr; }
    .consent-actions { width: 100%; }
    .consent-actions .button { flex: 1; }
    .guide-article, .legal-document { padding-top: 44px; }
    .guide-header h1, .legal-header h1 { font-size: 40px; }
    .dashboard-heading-actions { width: 100%; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-page .principles div { transition: none; }
    .welcome-page .principles div:hover, .welcome-page .principles div:focus-visible { transform: none; }
}

/* AdSense readiness hooks: these are invisible until publisher, CMP, and slot IDs are configured. */
.publisher-ad-slot { margin: 38px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.publisher-ad-slot > span { display: block; margin-bottom: 8px; color: var(--faint); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.footer-consent-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.footer-consent-button:hover, .footer-consent-button:focus-visible { color: var(--accent); outline: none; }

/* MindFocus UI patch after 0.1.4 ------------------------------------------- */
/* Donation ticker: vertically centred and slightly easier to read. */
.donation-ticker {
    height: 42px;
    display: grid;
    place-items: center;
}
.donation-track {
    height: 100%;
    align-items: stretch;
}
.donation-track span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 42px;
    font-size: 12px;
    line-height: 1.35;
}

/* Footer: credit and legal navigation share one row on desktop. */
.site-footer { gap: 0; }
.footer-main-row {
    flex-wrap: wrap;
    align-items: center;
}
.footer-credit { flex: 0 0 auto; white-space: nowrap; }
.footer-legal-links {
    margin-left: auto;
    align-items: center;
    justify-content: flex-end;
}
.footer-consent-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
}
.footer-consent-button:hover { color: var(--accent); }

/* About: inline contact links and compact social profile row. */
.about-inline-note { margin-bottom: 16px; }
.inline-profile-link {
    color: var(--accent);
    font-style: italic;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.inline-profile-link:hover { color: var(--text); }
.about-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 28px;
}
.about-social-links a,
.about-social-links button {
    min-height: 34px;
    padding: 4px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    transition: color .18s ease, transform .18s ease;
}
.about-social-links a:hover,
.about-social-links button:hover {
    color: var(--accent);
    transform: translateY(-1px);
}
.about-social-links svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.about-social-links a:first-child svg path,
.about-social-links button svg path {
    fill: currentColor;
    stroke: none;
}
.about-social-links .svg-fill { fill: currentColor; stroke: none; }

/* WeChat QR popup. */
.wechat-card {
    width: min(100%, 480px);
    text-align: center;
}
.wechat-card > p:not(.eyebrow) { max-width: 390px; margin-left: auto; margin-right: auto; }
.wechat-qr-frame {
    width: min(100%, 360px);
    margin: 24px auto 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.wechat-qr-frame img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}
.wechat-id {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}
.wechat-id strong { color: var(--text); font-size: 15px; }

@media (max-width: 720px) {
    .footer-main-row {
        flex-direction: row;
        align-items: center;
    }
    .footer-credit { width: 100%; white-space: normal; }
    .footer-legal-links {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
    .donation-track span { padding: 0 24px; font-size: 11px; }
    .about-social-links { gap: 8px 15px; }
}

/* MindFocus Handoff 0.1.5 ------------------------------------------------- */
:root {
    --max: 1480px;
    --study-success: #58d9c5;
    --study-error: #e2798a;
}

/* One continuous canvas: the sticky header uses exactly the page colour. */
body { background: var(--bg); }
.site-header {
    width: min(calc(100% - 64px), var(--max));
    background: var(--bg);
    border-bottom-color: color-mix(in srgb, var(--line) 58%, transparent);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
html[data-theme="light"] .site-header { background: var(--bg); border-bottom-color: color-mix(in srgb, var(--line) 62%, transparent); }
.page-shell, .site-footer, .donation-ticker { width: min(calc(100% - 64px), var(--max)); }
.welcome-page .hero { max-width: 1040px; }
.welcome-page .beta-metrics { width: min(1260px, 100%); }
.welcome-page .demo-preview { width: min(1380px, 100%); }

/* Private display name in the header. */
.header-actions { grid-template-columns: 38px 42px minmax(112px, 190px); }
.account-cell, .account-control { min-width: 0; }
.account-control { position: relative; width: 100%; display: inline-flex; justify-content: flex-end; }
.account-trigger {
    width: 100% !important;
    min-width: 0;
    max-width: 190px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end !important;
    overflow: hidden;
}
.account-name-label, .account-logout-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-logout-label { display: none; color: var(--error); }
.account-popover {
    position: absolute;
    z-index: 90;
    top: calc(100% + 8px);
    right: 0;
    width: 190px;
    padding: 7px;
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.account-popover[hidden] { display: none; }
.account-popover button {
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    font-size: 12px;
}
.account-popover button:hover, .account-popover button:focus-visible { background: var(--surface-2); color: var(--text); outline: none; }
.account-popover button:last-child:hover { color: var(--error); }
@media (hover: hover) and (pointer: fine) {
    /* Keep the account name visible. The menu appears below the whole account hitbox. */
    .account-trigger:hover .account-name-label,
    .account-trigger:focus-visible .account-name-label { display: block; }
    .account-trigger:hover .account-logout-label,
    .account-trigger:focus-visible .account-logout-label { display: none; }
}

/* Display-name onboarding remains optional and stores no public profile. */
.display-name-card { width: min(100%, 560px); }
.display-name-card .field-input { margin-top: 8px; }
.display-name-meta { margin: 7px 0 0; display: flex; justify-content: space-between; gap: 14px; color: var(--faint); font-size: 10px; }
.display-name-meta .is-over { color: var(--error); }
.display-name-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 9px; }
.privacy-slogan { margin: 18px 0 0; text-align: center; }

/* About founder image is a replaceable 3:4 founder.jpg file. */
.about-photo-slot { overflow: hidden; border-style: solid; }
.about-photo-slot img { display: block; background: var(--surface); }

/* Study engine 0.1.5. */
.study-page { --study-canvas: #101010; background: var(--study-canvas); }
.study-stage { overflow-x: hidden; overflow-y: auto; }
.study-header { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.study-header-actions button { white-space: nowrap; }
.study-center { width: min(940px, 100%); margin-top: clamp(42px, 9vh, 92px); }
.study-prompt { margin-bottom: clamp(46px, 7vh, 78px); }
.study-input.correct-state {
    color: var(--study-success);
    border-bottom-color: var(--study-success);
    text-shadow: 0 0 18px color-mix(in srgb, var(--study-success) 34%, transparent);
}
.study-input.wrong-state, .study-input.shake {
    color: var(--study-error);
    border-bottom-color: var(--study-error);
}
.correction-panel strong { color: var(--study-error); }

.mastery-progress {
    position: relative;
    width: min(900px, 100%);
    height: 34px;
    margin: 0 auto 34px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}
.mastery-dash-svg { width: 100%; height: 12px; overflow: visible; }
.mastery-dash-svg line {
    stroke: color-mix(in srgb, var(--accent) 58%, var(--line));
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-dasharray: 1 1;
    vector-effect: non-scaling-stroke;
    transition: stroke .18s ease, filter .18s ease, opacity .2s ease;
}
.mastery-count {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--study-canvas);
    color: var(--text);
    font-size: 11px;
    font-weight: 750;
    transition: border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.mastery-progress.is-mastered-flash .mastery-dash-svg line,
.mastery-progress.is-completion-pulse .mastery-dash-svg line { stroke: var(--study-success); filter: drop-shadow(0 0 7px var(--study-success)); }
.mastery-progress.is-mastered-flash .mastery-count,
.mastery-progress.is-completion-pulse .mastery-count {
    color: var(--study-success);
    border-color: var(--study-success);
    box-shadow: 0 0 18px color-mix(in srgb, var(--study-success) 45%, transparent);
    transform: scale(1.07);
}
.mastery-burst { position: absolute; right: 17px; top: 17px; width: 1px; height: 1px; pointer-events: none; }
.mastery-burst i {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--study-success);
    opacity: 0;
    transform: rotate(var(--angle)) translateX(0) scale(.3);
}
.mastery-burst.is-bursting i { animation: mastery-particle .7s cubic-bezier(.2,.75,.25,1) var(--delay) forwards; }
@keyframes mastery-particle {
    12% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--angle)) translateX(var(--distance)) scale(1); }
}

.streak-message {
    position: absolute;
    left: 50%;
    top: -38px;
    transform: translate(-50%, 12px) scale(.92);
    padding: 8px 13px;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--study-canvas) 86%, var(--accent));
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 750;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}
.streak-message.is-visible { animation: streak-pop 1.7s ease both; }
@keyframes streak-pop {
    0% { opacity: 0; transform: translate(-50%, 14px) scale(.86) rotate(-2deg); }
    16%, 72% { opacity: 1; transform: translate(-50%, 0) scale(1) rotate(0); }
    100% { opacity: 0; transform: translate(-50%, -12px) scale(.96); }
}
.answer-area { position: relative; }

.study-settings-modal, .challenge-complete-modal { z-index: 150; }
.study-settings-card {
    width: min(920px, 100%);
    max-height: min(88vh, 900px);
    overflow-y: auto;
    padding: clamp(24px, 4vw, 40px);
}
.study-settings-card > p:not(.eyebrow) { max-width: 760px; }
.study-setting-section { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 86%, transparent); }
.setting-heading { margin-bottom: 13px; display: flex; align-items: center; gap: 8px; }
.setting-heading strong { font-size: 13px; }
.help-tip {
    position: relative;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--accent);
    cursor: help;
    font-size: 10px;
}
.help-tip-content {
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: calc(100% + 9px);
    width: min(420px, 78vw);
    padding: 12px 14px;
    transform: translate(-50%, 6px);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--muted);
    box-shadow: var(--shadow);
    font-size: 11px;
    line-height: 1.55;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}
.help-tip:hover .help-tip-content, .help-tip:focus .help-tip-content { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.difficulty-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.difficulty-options > label { min-width: 0; cursor: pointer; }
.difficulty-options > label[hidden] { display: none; }
.difficulty-options input { position: absolute; opacity: 0; pointer-events: none; }
.difficulty-options label > span {
    min-height: 92px;
    padding: 13px;
    display: grid;
    align-content: start;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-2);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.difficulty-options label:hover > span { transform: translateY(-1px); }
.difficulty-options input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.difficulty-options input:disabled + span { opacity: .48; cursor: not-allowed; transform: none; }
.difficulty-options strong { font-size: 13px; }
.difficulty-options small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.study-settings-grid { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.study-setting-section.is-unavailable { opacity: .48; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.segmented-control label { cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; }
.segmented-control span { min-height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 11px; }
.segmented-control input:checked + span { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.segmented-control input:disabled + span { cursor: not-allowed; }
.shortcut-setting, .color-setting label { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.shortcut-setting button {
    min-width: 86px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
}
.shortcut-setting button.is-capturing { border-color: var(--accent); color: var(--accent); }
.shortcut-setting button:disabled { opacity: .55; cursor: not-allowed; }
.color-setting input[type="color"] { width: 42px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); cursor: pointer; }
.study-settings-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 9px; }
.challenge-complete-card { width: min(100%, 560px); text-align: center; }
.challenge-complete-card .button { margin-top: 12px; }

@media (max-width: 1050px) {
    .site-header, .page-shell, .site-footer, .donation-ticker { width: min(calc(100% - 40px), var(--max)); }
    .study-settings-grid { grid-template-columns: 1fr 1fr; }
    .color-setting { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .site-header, .page-shell, .site-footer, .donation-ticker { width: min(calc(100% - 28px), var(--max)); }
    .header-actions { grid-template-columns: 32px 34px minmax(70px, 104px); }
    .account-trigger { max-width: 104px; font-size: 11px; }
    .study-header { grid-template-columns: 1fr auto; gap: 10px; }
    .study-header > #study-progress { display: none; }
    .study-header-actions { gap: 8px; }
    .study-header-actions button { font-size: 10px; }
    .study-center { margin-top: 54px; }
    .mastery-progress { margin-bottom: 26px; }
    .study-settings-grid, .difficulty-options { grid-template-columns: 1fr; }
    .color-setting { grid-column: auto; }
    .study-settings-card { max-height: 92vh; padding: 24px 18px; }
    .study-settings-actions { flex-direction: column-reverse; }
    .study-settings-actions .button { width: 100%; }
    .study-shortcuts { flex-wrap: wrap; }
    .streak-message { max-width: 88vw; overflow: hidden; text-overflow: ellipsis; }
    .display-name-actions { flex-direction: column-reverse; }
    .display-name-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .mastery-burst, .streak-message { animation: none !important; }
    .streak-message.is-visible { opacity: 1; transform: translate(-50%, 0); }
}


/* 0.1.5.1 guest header alignment: Login occupies the display-name slot. */
.header-actions.is-guest {
    grid-template-columns: 38px 42px max-content;
}
.account-cell.is-guest {
    justify-content: flex-start;
}
.account-cell.is-guest .text-link {
    width: auto;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    justify-content: flex-start;
    text-align: left;
    white-space: nowrap;
}
@media (max-width: 720px) {
    .header-actions.is-guest {
        grid-template-columns: 32px 34px max-content;
    }
}


/* 0.1.5.2 account header alignment: guest login and display name share one compact slot. */
.header-actions,
.header-actions.is-guest,
.header-actions.has-account {
    grid-template-columns: 38px 42px max-content;
}
.account-cell,
.account-cell.is-guest,
.account-cell.has-account {
    width: auto;
    min-width: 0;
    max-width: 190px;
    justify-content: flex-start;
}
.account-control {
    width: auto;
    max-width: 190px;
    justify-content: flex-start;
}
.account-trigger {
    width: auto !important;
    max-width: 190px;
    justify-content: flex-start !important;
    text-align: left;
}
@media (max-width: 720px) {
    .header-actions,
    .header-actions.is-guest,
    .header-actions.has-account {
        grid-template-columns: 32px 34px max-content;
    }
    .account-cell,
    .account-control,
    .account-trigger {
        max-width: 104px;
    }
}


/* 0.1.5.3 stable language/account rail.
   The account column keeps a fixed reserved width, while its visible text
   remains left-aligned beside VI/EN. Therefore changing locale text cannot
   move the theme or language controls. */
.header-actions,
.header-actions.is-guest,
.header-actions.has-account {
    grid-template-columns: 38px 42px 190px;
}
.locale-cell {
    width: 42px;
    min-width: 42px;
    flex: 0 0 42px;
}
.locale-cell .text-button {
    width: 42px;
    min-width: 42px;
    padding-left: 0;
    padding-right: 0;
    display: inline-grid;
    place-items: center;
    text-align: center;
}
.account-cell,
.account-cell.is-guest,
.account-cell.has-account {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    justify-content: flex-start;
    overflow: hidden;
}
.account-cell.is-guest .text-link {
    width: auto;
    max-width: 190px;
    justify-content: flex-start;
    text-align: left;
}
.account-control {
    width: 190px;
    min-width: 0;
    max-width: 190px;
    justify-content: flex-start;
}
.account-trigger {
    width: 190px !important;
    min-width: 0;
    max-width: 190px;
    justify-content: flex-start !important;
    text-align: left;
}
@media (max-width: 720px) {
    .header-actions,
    .header-actions.is-guest,
    .header-actions.has-account {
        grid-template-columns: 32px 34px 104px;
    }
    .locale-cell {
        width: 34px;
        min-width: 34px;
        flex-basis: 34px;
    }
    .locale-cell .text-button {
        width: 34px;
        min-width: 34px;
    }
    .account-cell,
    .account-cell.is-guest,
    .account-cell.has-account,
    .account-control {
        width: 104px;
        min-width: 104px;
        max-width: 104px;
    }
    .account-trigger {
        width: 104px !important;
        max-width: 104px;
    }
}

/* 0.1.5.4 streak-message visibility fix.
   The message used to be absolutely positioned relative to .study-stage at
   top:-38px, so the stage's overflow clipped it outside the viewport. */
.streak-message {
    position: fixed;
    top: clamp(86px, 13vh, 138px);
    left: 50%;
    z-index: 145;
    transform: translate(-50%, 12px) scale(.92);
    max-width: min(90vw, 680px);
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 720px) {
    .streak-message {
        top: 76px;
        max-width: calc(100vw - 32px);
        white-space: normal;
        text-align: center;
    }
}

/* ==========================================================================
   MindFocus 0.1.6 · Community, account, round checkpoints and admin UI
   ========================================================================== */

/* Header account menu: one stable cell for guests and signed-in users. */
.account-control { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.account-trigger { max-width: 168px; }
.account-name-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-popover {
    position: absolute;
    z-index: 130;
    top: calc(100% + 9px);
    right: 0;
    width: max-content;
    min-width: 150px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
}
.account-popover a,
.account-popover button {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 9px 11px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.account-popover a:hover,
.account-popover a:focus-visible,
.account-popover button:hover,
.account-popover button:focus-visible { background: var(--surface-2); color: var(--text); outline: none; }
.account-popover button:last-child:hover { color: var(--error); }

/* Three balanced home discovery cards. */
.welcome-page .demo-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.community-discovery-card { border-color: color-mix(in srgb, var(--accent) 36%, var(--border)); }

/* Deck source and community controls. */
.deck-card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.community-copy-pill { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.deck-source-credit { display: block; margin-top: 9px; color: var(--muted); }
.deck-share-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.deck-share-toggle.is-shared { color: #f2c94c; border-color: rgba(242, 201, 76, .45); background: rgba(242, 201, 76, .08); }
.icon-button.is-locked { color: var(--muted); font-size: 12px; }

/* Community directory. */
.community-shell,
.community-detail-shell,
.developer-shell,
.profile-shell { width: min(1480px, calc(100% - 48px)); }
.community-heading,
.developer-heading,
.profile-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin: 48px 0 28px; }
.community-heading h1,
.developer-heading h1,
.profile-heading h1 { margin: 5px 0 8px; font-size: clamp(38px, 5vw, 72px); line-height: .98; }
.community-heading p:last-child,
.developer-heading p:last-child,
.profile-heading p:last-child { max-width: 760px; color: var(--muted); }
.community-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(260px, 3fr); gap: 18px; align-items: start; padding-bottom: 80px; }
.community-main { min-width: 0; padding: 18px; }
.community-toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.community-search { flex: 1; display: flex; gap: 8px; }
.community-search .field-input { flex: 1; }
.community-sort { min-width: 190px; }
.community-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
.community-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.community-table th,
.community-table td { padding: 14px 15px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.community-table th { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.community-table tbody tr:last-child td { border-bottom: 0; }
.community-table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 64%, transparent); }
.community-code { color: var(--accent); font: 700 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; text-decoration: none; }
.community-deck-name { display: grid; gap: 4px; color: var(--text); text-decoration: none; }
.community-deck-name small { max-width: 440px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.privacy-pill.is-saved { color: var(--study-success); }
.community-side { display: grid; gap: 18px; }
.community-side .panel { position: relative; min-height: 245px; overflow: hidden; }
.coming-soon-blur { filter: blur(4px); opacity: .48; pointer-events: none; user-select: none; }
.coming-soon-blur ol { display: grid; gap: 9px; margin: 18px 0 0; padding-left: 24px; color: var(--muted); }
.coming-soon-label { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); border: 1px solid var(--accent); border-radius: 999px; padding: 8px 12px; background: color-mix(in srgb, var(--background) 88%, transparent); color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .13em; white-space: nowrap; }
.community-detail-card { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 56px 0 18px; padding: clamp(24px, 5vw, 60px); }
.community-detail-card h1 { margin: 8px 0 12px; font-size: clamp(42px, 7vw, 92px); line-height: .96; }
.community-detail-card p { color: var(--muted); max-width: 800px; }
.community-detail-meta { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 20px; color: var(--muted); font-size: 13px; }
.community-preview-list { padding: 18px; margin-bottom: 80px; }
.community-preview-row { display: grid; grid-template-columns: 38px minmax(140px, .7fr) minmax(180px, 1.3fr); gap: 14px; align-items: center; padding: 12px 8px; border-top: 1px solid var(--border); }
.community-preview-row span { color: var(--accent); font: 700 11px ui-monospace, monospace; }
.community-preview-row p { margin: 0; color: var(--muted); }

/* Pro B2B plan. */
.plan-option-b2b { grid-column: 1 / -1; min-height: 112px; align-items: flex-start; }
.plan-option-b2b strong { font-size: 22px; }
.plan-option-b2b small { max-width: 460px; line-height: 1.45; }
.b2b-contact { margin: 14px 0; }
.b2b-contact[hidden] { display: none; }

/* Profile. */
.profile-heading { display: block; max-width: 820px; }
.profile-form { max-width: 920px; margin-bottom: 80px; padding: clamp(20px, 4vw, 42px); }
.profile-form hr { border: 0; border-top: 1px solid var(--border); margin: 30px 0; }
.profile-password-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Developer dashboard. */
.developer-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.developer-metrics article,
.developer-plan-grid article { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.developer-metrics span,
.developer-plan-grid span { display: block; color: var(--muted); font-size: 11px; }
.developer-metrics strong { display: block; margin-top: 10px; font-size: clamp(24px, 3vw, 40px); color: var(--accent); }
.developer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.developer-grid > .panel,
.developer-orders { padding: 22px; }
.developer-plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.developer-plan-grid strong { display: block; margin: 8px 0 3px; font-size: 28px; }
.developer-plan-grid small { color: var(--muted); }
.developer-social-list { display: grid; margin-top: 15px; }
.developer-social-list div { display: flex; justify-content: space-between; padding: 11px 2px; border-top: 1px solid var(--border); }
.developer-orders { margin: 18px 0 80px; }
.developer-order-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--border); }
.developer-order-row > div:first-child { display: grid; gap: 3px; }
.developer-order-row > div:first-child span,
.developer-order-row small { color: var(--muted); }
.developer-order-row > div:last-child { display: flex; gap: 8px; }

/* Study header and round checkpoint. */
.study-header { position: relative; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.study-back-link { justify-self: start !important; max-width: min(42vw, 580px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.study-cloud-mark { justify-self: center; color: var(--text); font-size: 15px; letter-spacing: -.02em; }
.mastery-dash-svg line { stroke-dasharray: 1.88 .12; }
.round-break-card { width: min(660px, calc(100vw - 34px)); }
.round-basic-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 12px; }
.round-basic-summary article,
.round-pro-summary article { border: 1px solid var(--border); border-radius: 13px; padding: 15px; background: var(--surface-2); }
.round-basic-summary span,
.round-pro-summary span { display: block; color: var(--muted); font-size: 11px; }
.round-basic-summary strong { display: block; margin-top: 8px; font-size: 32px; color: var(--accent); }
.round-pro-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.round-pro-summary[hidden] { display: none; }
.round-pro-summary article { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.round-pro-summary strong { font-size: 17px; }
.round-free-note { margin: 14px 0; color: var(--muted); font-size: 12px; text-align: center; }

/* Editor toggle hierarchy. */
.deck-visibility-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1080px) {
    .welcome-page .demo-preview { grid-template-columns: 1fr 1fr; }
    .community-discovery-card { grid-column: 1 / -1; }
    .community-layout { grid-template-columns: 1fr; }
    .community-side { grid-template-columns: 1fr 1fr; }
    .developer-metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
    .community-shell,
    .community-detail-shell,
    .developer-shell,
    .profile-shell { width: min(100% - 24px, 1480px); }
    .welcome-page .demo-preview,
    .community-side,
    .developer-grid,
    .profile-password-grid { grid-template-columns: 1fr; }
    .community-discovery-card { grid-column: auto; }
    .community-heading,
    .developer-heading { display: block; }
    .community-toolbar,
    .community-search { flex-direction: column; }
    .community-sort { min-width: 0; width: 100%; }
    .community-detail-card { display: grid; align-items: start; }
    .community-preview-row { grid-template-columns: 28px 1fr; }
    .community-preview-row p { grid-column: 2; }
    .developer-metrics { grid-template-columns: repeat(2, 1fr); }
    .developer-plan-grid { grid-template-columns: 1fr; }
    .developer-order-row { align-items: flex-start; flex-direction: column; }
    .study-cloud-mark { font-size: 12px; }
    .study-back-link { max-width: 34vw; }
    .round-pro-summary { grid-template-columns: 1fr; }
    .deck-visibility-grid { grid-template-columns: 1fr; }
}


/* MindFocus 0.1.6.2 · account menu that works without hover JavaScript. */
.site-header,
.header-actions,
.account-cell,
.account-control {
    overflow: visible !important;
}
.account-control {
    position: relative;
    isolation: isolate;
}
.account-popover,
.account-popover[hidden] {
    display: none !important;
    top: calc(100% - 1px);
    right: 0;
    z-index: 240;
}
.account-control:hover .account-popover,
.account-control:focus-within .account-popover,
.account-control.is-open .account-popover {
    display: grid !important;
}
.account-logout-inline-form {
    display: block;
    width: 100%;
    margin: 0;
}
.account-logout-inline-form button {
    width: 100%;
}


/* MindFocus 0.1.6.3 · stable account hover hitbox.
   The previous label-swap collapsed the hover target and repeatedly opened/closed
   the popover. Keep a fixed account rail and never hide the display name. */
.account-cell.has-account,
.account-control {
    width: 190px !important;
    min-width: 190px !important;
    max-width: 190px !important;
}
.account-control {
    position: relative;
    display: block !important;
}
.account-trigger {
    width: 100% !important;
    min-width: 190px !important;
    max-width: 190px !important;
    min-height: 36px;
    padding-inline: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: flex-start !important;
    text-align: left;
}
.account-name-label {
    display: block !important;
    width: 100%;
}
.account-logout-label {
    display: none !important;
}
.account-popover,
.account-popover[hidden] {
    top: 100% !important;
    right: 0;
    margin-top: 0;
}
/* Invisible bridge covers sub-pixel/header-border gaps while moving downward. */
.account-control::after {
    content: "";
    position: absolute;
    z-index: 239;
    top: 100%;
    right: 0;
    width: 190px;
    height: 8px;
    pointer-events: none;
}
@media (max-width: 720px) {
    .account-cell.has-account,
    .account-control {
        width: 104px !important;
        min-width: 104px !important;
        max-width: 104px !important;
    }
    .account-trigger {
        min-width: 104px !important;
        max-width: 104px !important;
    }
    .account-popover,
    .account-popover[hidden] {
        width: min(190px, calc(100vw - 24px));
    }
}

/* ==========================================================================
   MindFocus 0.1.7 · Community search layout
   ========================================================================== */
.community-shell { padding-top: 32px; }
.community-hero { margin-top: 28px; }
.community-library { min-width: 0; }
.community-search {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(190px, 230px) auto;
    align-items: center;
    width: 100%;
    gap: 10px;
}
.community-search .field-input { width: 100%; min-width: 0; }
.community-search .community-sort { width: 100%; min-width: 0; }
.community-search-button {
    width: auto;
    min-width: 112px;
    padding-inline: 18px;
    white-space: nowrap;
}
@media (max-width: 760px) {
    .community-shell { padding-top: 18px; }
    .community-hero { margin-top: 18px; }
    .community-search { display: grid; grid-template-columns: 1fr; }
    .community-search-button { width: 100%; }
}

/* MindFocus 0.1.7.2 · Community controls use one visual height. */
.community-search {
    --community-control-height: 46px;
    align-items: stretch;
}
.community-search .field-input,
.community-search .community-sort,
.community-search-button {
    height: var(--community-control-height);
    min-height: var(--community-control-height);
    margin: 0;
    box-sizing: border-box;
}
.community-search .field-input,
.community-search .community-sort {
    padding-top: 0;
    padding-bottom: 0;
}
.community-search-button {
    align-self: stretch;
    line-height: 1;
}

/* MindFocus 0.1.7 · XLSX split workflow */
.xlsx-split-card { width: min(620px, calc(100vw - 28px)); }
.split-source-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}
.split-source-summary span { color: var(--muted); font-size: 12px; }
.split-source-summary strong { color: var(--accent); font-size: 24px; }
.split-enable-line { margin: 12px 0 18px; }
.split-size-field { margin-top: 12px; }
.split-size-field.is-disabled { opacity: .55; }
.split-preview {
    margin-top: 14px;
    padding: 13px 15px;
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    color: var(--muted);
    line-height: 1.55;
}
.split-plan-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 11px 13px;
    border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
    border-radius: 11px;
    color: var(--muted);
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.split-plan-status[hidden] { display: none; }
@media (max-width: 620px) {
    .xlsx-split-card .modal-actions { flex-direction: column-reverse; }
    .xlsx-split-card .modal-actions .button { width: 100%; }
    .split-plan-status { align-items: flex-start; flex-direction: column; }
}

/* MindFocus 0.1.7 · explicit VI / EN / Simplified Chinese selector */
.locale-cell { overflow: visible !important; }
.locale-control { position: relative; display: inline-flex; align-items: center; }
.locale-trigger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 58px;
    width: auto !important;
    white-space: nowrap;
}
.locale-caret { color: var(--muted); font-size: 10px; transition: transform .16s ease; }
.locale-control.is-open .locale-caret { transform: rotate(180deg); }
.locale-popover {
    position: absolute;
    z-index: 250;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    width: 190px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
}
.locale-popover[hidden] { display: none; }
.locale-popover button {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    cursor: pointer;
}
.locale-popover button span { color: var(--accent); font-size: 11px; font-weight: 800; }
.locale-popover button strong { color: inherit; font-size: 12px; font-weight: 650; }
.locale-popover button:hover,
.locale-popover button:focus-visible,
.locale-popover button[aria-checked="true"] { background: var(--surface-2); color: var(--text); outline: none; }
html[lang="zh-CN"] body {
    font-family: Inter, "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (max-width: 720px) {
    .locale-trigger { min-width: 48px; font-size: 11px; }
    .locale-popover { right: -48px; width: 176px; }
}
