/* SheetLab by Nymos Interactive
   Layout: marketing page with full-width bands; workspace = fixed sidebar + scrolling main;
   the spreadsheet grid is the one bold element, everything around it stays quiet. */
:root {
  --teal: #1cb2ba;          /* Nymos Teal: accents, lines, buttons */
  --teal-ink: #0b7178;      /* darker teal for text on light backgrounds */
  --teal-wash: #e2f4f5;
  --slate: #3c4452;         /* Slate: text, dark bands */
  --bg: #ffffff;
  --soft: #f4f5ef;          /* Off-white */
  --surface: #ffffff;
  --ink: #3c4452;
  --ink-2: #5f6774;
  --ink-3: #868d97;
  --line: #e2e4dc;
  --line-2: #cfd3c8;
  --band: #3c4452;
  --band-2: #333a46;
  --on-band: #ffffff;
  --on-band-2: #d3d7dd;
  --grid-head: #f1f2ec;
  --grid-line: #dfe2d9;
  --cell: #ffffff;
  --good: #1e7d49; --good-wash: #e5f4eb;
  --bad: #b3382c; --bad-wash: #fbeceb;
  --warn: #8a5a00; --warn-wash: #fbf2dc;
  --excel: #1e7145;
  --sheets: #2f5d73;
  --shadow: 0 1px 2px rgba(40, 46, 56, .06), 0 8px 24px rgba(40, 46, 56, .06);
  --f-head: 'Poppins', Arial, sans-serif;
  --f-body: 'Montserrat', Arial, sans-serif;
  --f-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r: 10px;
  --r-lg: 16px;
  --logo-plate: transparent;
  --series-2: #3c4452;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --teal: #29c1c9; --teal-ink: #6fd8de; --teal-wash: #173a3f;
    --bg: #1c2027; --soft: #171a20; --surface: #232831;
    --ink: #e8eae4; --ink-2: #b4bac3; --ink-3: #8c939d;
    --line: #333944; --line-2: #444b57;
    --band: #2a303a; --band-2: #232831; --on-band: #ffffff; --on-band-2: #c6ccd4;
    --grid-head: #2a2f38; --grid-line: #3a404b; --cell: #20242c;
    --good: #5fcf8f; --good-wash: #1b3328; --bad: #f08a80; --bad-wash: #3a2323; --warn: #e8b85c; --warn-wash: #3a311c;
    --excel: #3fa36b; --sheets: #5b8fa8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --logo-plate: #ffffff;
    --series-2: #8c96a6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --teal: #29c1c9; --teal-ink: #6fd8de; --teal-wash: #173a3f;
  --bg: #1c2027; --soft: #171a20; --surface: #232831;
  --ink: #e8eae4; --ink-2: #b4bac3; --ink-3: #8c939d;
  --line: #333944; --line-2: #444b57;
  --band: #2a303a; --band-2: #232831; --on-band: #ffffff; --on-band-2: #c6ccd4;
  --grid-head: #2a2f38; --grid-line: #3a404b; --cell: #20242c;
  --good: #5fcf8f; --good-wash: #1b3328; --bad: #f08a80; --bad-wash: #3a2323; --warn: #e8b85c; --warn-wash: #3a311c;
  --excel: #3fa36b; --sheets: #5b8fa8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --logo-plate: #ffffff;
  --series-2: #8c96a6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.tabnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.eyebrow.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 11px 18px; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-dark { background: var(--slate); color: #fff; }
.btn-dark:hover { background: #2c333e; }
:root[data-theme="dark"] .btn-dark { background: var(--teal); color: #0f2a2d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-dark { background: var(--teal); color: #0f2a2d; } }
.btn-teal { background: var(--teal); color: #10282b; }
.btn-teal:hover { filter: brightness(1.05); }
.btn-light { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-light:hover { border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink); padding-inline: 10px; }
.btn-ghost:hover { background: var(--soft); }
.btn-white { background: #fff; color: #3c4452; }
.btn-sm { padding: 7px 12px; font-size: 14px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--teal); padding-bottom: 2px; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0; }
.link:hover { color: var(--teal-ink); }
.arrow::after { content: "\2192"; }

/* ---------- pills ---------- */
.pill { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.pill.warn { background: var(--warn-wash); border-color: transparent; color: var(--warn); }
.pill.warn .d { background: var(--warn); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--ink-2); border: 1px solid var(--line); }
.tag.lvl-Beginner { background: var(--teal-wash); color: var(--teal-ink); border-color: transparent; }
.tag.lvl-Intermediate { background: #eef0ff; color: #3d48a3; border-color: transparent; }
.tag.lvl-Advanced { background: #fdeee4; color: #9a4a17; border-color: transparent; }
:root[data-theme="dark"] .tag.lvl-Intermediate { background: #262c4a; color: #aab3ff; }
:root[data-theme="dark"] .tag.lvl-Advanced { background: #3b2a1f; color: #f5b98f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag.lvl-Intermediate { background: #262c4a; color: #aab3ff; }
  :root:not([data-theme="light"]) .tag.lvl-Advanced { background: #3b2a1f; color: #f5b98f; }
}
.app-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: #fff; font-weight: 800; font-size: 13px; font-family: var(--f-head); flex: none; }
.app-ico.excel { background: var(--excel); }
.app-ico.sheets { background: var(--sheets); }
.app-ico.lg { width: 36px; height: 36px; border-radius: 8px; font-size: 16px; }

/* ---------- landing ---------- */
.site-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; text-decoration: none; flex: none; }
.brand img { height: 46px; width: auto; display: block; background: var(--logo-plate); border-radius: 8px; padding: 2px 4px; }
.logo-dark-plate { background: #fff; border-radius: 8px; padding: 3px 6px; }
.site-nav { display: flex; gap: 22px; margin-left: auto; margin-right: auto; }
.site-nav a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); }
.head-actions { display: flex; gap: 8px; align-items: center; }
.hero { padding-block: 72px 80px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); margin-top: 18px; letter-spacing: -0.035em; line-height: 1.02; }
.hero h1 em { font-style: normal; color: var(--teal-ink); display: block; }
.hero .lead { font-size: 18px; color: var(--ink-2); margin-top: 22px; max-width: 34em; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 18px 22px; align-items: center; margin-top: 30px; }
.hero .micro { margin-top: 18px; font-size: 14px; color: var(--ink-3); }
.demo-sheet { background: var(--teal-wash); border-radius: 22px; padding: 10px; box-shadow: var(--shadow); max-width: 100%; }
.demo-inner { background: var(--surface); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.demo-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--teal-wash); }
.demo-bar .dots { display: flex; gap: 4px; } .demo-bar .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.demo-bar b { flex: 1; text-align: center; font-size: 14px; font-family: var(--f-head); font-weight: 600; }
.demo-fx { display: flex; gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-family: var(--f-mono); min-height: 40px; }
.demo-fx .nb { font-weight: 700; font-family: var(--f-body); }
.demo-fx .caret { display: inline-block; width: 1px; height: 15px; background: var(--ink); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-foot { display: flex; justify-content: space-between; padding: 9px 14px; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--teal-wash); }
.demo-foot .ok { color: var(--good); transition: opacity .3s; }
.band { padding-block: 72px; }
.band.soft { background: var(--soft); }
.band h2 { font-size: clamp(28px, 4vw, 40px); margin-top: 10px; }
.band .sub { color: var(--ink-2); margin-top: 10px; font-size: 17px; max-width: 40em; }
.area-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.area-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.area-card .top { display: flex; justify-content: space-between; align-items: center; }
.area-card h3 { font-size: 22px; margin-top: 6px; }
.area-card p { color: var(--ink-2); }
.area-card .fns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.area-card .fns span { font-family: var(--f-mono); font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--soft); color: var(--ink-2); }
.area-card .go { margin-top: 10px; align-self: flex-start; }
.topics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 32px; }
.topic { border-top: 3px solid var(--teal); padding-top: 14px; }
.topic h3 { font-size: 18px; }
.topic .n { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.topic p { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.topic code { font-family: var(--f-mono); font-size: 12px; color: var(--teal-ink); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 34px; }
.step { border-top: 1px solid var(--line-2); padding-top: 18px; }
.step .num { font-size: 13px; font-weight: 700; color: var(--teal-ink); font-variant-numeric: tabular-nums; }
.step h3 { font-size: 21px; margin-top: 10px; }
.step p { color: var(--ink-2); margin-top: 8px; font-size: 15px; }
.tasks-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 30px; }
.task-chip { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.task-chip .f { font-family: var(--f-mono); font-size: 11px; font-weight: 700; background: var(--teal-wash); color: var(--teal-ink); padding: 3px 7px; border-radius: 5px; flex: none; margin-top: 2px; }
.task-chip b { display: block; font-size: 15px; }
.task-chip span { font-size: 13px; color: var(--ink-2); }
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.about .tagline { font-family: var(--f-head); font-weight: 600; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.02em; line-height: 1.15; }
.about .tagline span { color: var(--teal-ink); }
.about p { color: var(--ink-2); }
.about ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.about li { display: flex; gap: 10px; font-size: 15px; }
.about li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 2px; background: var(--teal); }
.cta-band { background: var(--band); color: var(--on-band); border-radius: var(--r-lg); padding: 32px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta-band h2 { font-size: clamp(24px, 3.2vw, 34px); color: var(--on-band); }
.cta-band p { color: var(--on-band-2); margin-top: 6px; }
.site-foot { padding-block: 26px 40px; font-size: 14px; color: var(--ink-2); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-foot a, .site-foot button { color: var(--ink); font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-main { padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; }
.auth-main .brand img { height: 44px; }
.auth-form { width: 100%; max-width: 420px; margin: auto; padding-block: 32px; display: grid; gap: 16px; }
.auth-form h1 { font-size: 34px; }
.auth-form .sub { color: var(--ink-2); margin-top: -6px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 14px; }
.field .help { font-size: 13px; color: var(--ink-3); }
.input, select.input { width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 11px 13px; font-size: 16px; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-wash); }
.pw { position: relative; }
.pw .input { padding-right: 70px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; padding: 6px 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--teal); flex: none; }
.form-msg { font-size: 14px; padding: 10px 12px; border-radius: 10px; }
.form-msg.err { background: var(--bad-wash); color: var(--bad); }
.form-msg.ok { background: var(--good-wash); color: var(--good); }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-alt { font-size: 15px; color: var(--ink-2); }
.auth-side { background: var(--band); color: var(--on-band); padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px; position: relative; overflow: hidden; }
.auth-side h2 { font-size: 34px; color: var(--on-band); max-width: 14em; }
.auth-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; color: var(--on-band-2); }
.auth-side li { display: flex; gap: 12px; }
.auth-side li::before { content: "\2713"; color: var(--teal); font-weight: 800; }
.auth-side .gridbg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 34px 34px; pointer-events: none; }
.auth-side > * { position: relative; }
.preview-note { font-size: 13px; background: var(--warn-wash); color: var(--warn); padding: 10px 12px; border-radius: 10px; }

/* ---------- workspace shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--surface) 232px, var(--line) 232px, var(--line) 233px, var(--soft) 233px); }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 2px 8px 14px; }
.side .brand img { height: 44px; }
.side h4 { font-family: var(--f-body); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink); border: 1px solid transparent; cursor: pointer; background: none; width: 100%; text-align: left; }
.nav-item:hover { background: var(--soft); }
.nav-item.on { background: var(--teal-wash); border-color: color-mix(in srgb, var(--teal) 40%, transparent); }
.nav-item svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.side .me { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; display: flex; gap: 10px; align-items: center; }
.side .me img { width: 30px; height: 30px; }
.side .me b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.side .me button { background: none; border: 0; padding: 0; font-size: 13px; text-decoration: underline; color: var(--ink-2); cursor: pointer; }
.main { min-width: 0; padding: 18px 32px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 36px; }
.crumbs { font-size: 14px; font-weight: 600; color: var(--ink-2); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); }
.crumbs b { color: var(--ink); }
.menu-btn { display: none; }
.page-head { margin: 22px 0 22px; }
.page-head h1 { font-size: clamp(32px, 4.4vw, 48px); margin-top: 8px; }
.page-head p { color: var(--ink-2); margin-top: 8px; }
.foot-line { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* library hero */
.studio { background: var(--band); color: var(--on-band); border-radius: 22px; padding: 40px 48px; display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: center; position: relative; overflow: hidden; }
.studio::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 30px 30px; }
.studio > * { position: relative; min-width: 0; }
.studio .eyebrow { color: var(--on-band-2); }
.studio h1 { font-size: clamp(32px, 4.6vw, 54px); color: var(--on-band); margin-top: 14px; letter-spacing: -0.035em; }
.studio p { color: var(--on-band-2); margin-top: 14px; max-width: 30em; }
.studio .btn { margin-top: 22px; }
.studio .stats { display: flex; gap: 22px; margin-top: 22px; flex-wrap: wrap; }
.studio .stats div { font-size: 13px; color: var(--on-band-2); }
.studio .stats b { display: block; font-size: 22px; color: var(--on-band); font-family: var(--f-head); font-variant-numeric: tabular-nums; }
.mini { background: #fff; color: #3c4452; border-radius: 12px; overflow: hidden; transform: rotate(-3deg); box-shadow: 0 20px 40px rgba(0,0,0,.25); font-size: 13px; }
.mini .mbar { background: #e2f4f5; padding: 8px 12px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.mini .mbar i { width: 6px; height: 6px; border-radius: 50%; background: #1cb2ba; display: inline-block; margin-right: 3px; }
.mini .mfx { padding: 6px 12px; border-bottom: 1px solid #e2e4dc; font-family: var(--f-mono); font-size: 12px; }
.mini table { border-collapse: collapse; width: 100%; }
.mini td { border: 1px solid #e2e4dc; padding: 4px 8px; }
.mini td:first-child { background: #f1f2ec; width: 26px; text-align: center; color: #868d97; }
.mini td.n { text-align: right; font-variant-numeric: tabular-nums; }
.mini td.t { outline: 2px solid #1cb2ba; outline-offset: -2px; background: #e2f4f5; font-weight: 700; }
.mini .mok { padding: 6px 12px; font-size: 12px; font-weight: 700; color: #1e7d49; text-align: right; }

/* filters + cards */
.lib-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin: 34px 0 14px; }
.lib-head h2 { font-size: 30px; margin-top: 6px; }
.lib-head p { color: var(--ink-2); margin-top: 6px; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) 160px 160px; gap: 10px; }
.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; stroke: var(--ink-3); fill: none; stroke-width: 2; }
.search .input { padding-left: 38px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 6px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--slate); color: #fff; border-color: var(--slate); }
:root[data-theme="dark"] .chip.on { background: var(--teal); color: #0f2a2d; border-color: var(--teal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { background: var(--teal); color: #0f2a2d; border-color: var(--teal); } }
.result-count { font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; min-width: 0; }
.card:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-2px); }
.card .ct { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--teal-wash); color: var(--teal-ink); display: grid; place-items: center; font-family: var(--f-head); font-weight: 600; font-style: italic; font-size: 14px; }
.card .ic.done { background: var(--good); color: #fff; font-style: normal; }
.card h3 { font-size: 18px; letter-spacing: -0.01em; }
.card p { color: var(--ink-2); font-size: 14px; flex: 1; }
.card .cf { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; font-size: 13px; font-weight: 700; gap: 8px; }
.card .cf .fn { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .cf .go { color: var(--ink); white-space: nowrap; }
.card .cf .go.done { color: var(--good); }
.empty { background: var(--surface); border: 1px dashed var(--line-2); border-radius: 14px; padding: 32px; text-align: center; color: var(--ink-2); }

/* tracks */
.tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.track { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.track .tb { background: var(--teal-wash); border-radius: 10px; padding: 10px; text-align: center; font-family: var(--f-mono); font-weight: 700; color: var(--teal-ink); font-size: 13px; }
.track h3 { font-size: 20px; }
.track p { color: var(--ink-2); font-size: 14px; }
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--teal); border-radius: 99px; transition: width .4s; }
.track .meta { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.track ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; counter-reset: t; }
.track li a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 600; }
.track li a:hover { background: var(--soft); }
.track li a::before { counter-increment: t; content: counter(t); width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.track li.done a::before { content: "\2713"; background: var(--good); border-color: var(--good); color: #fff; }
.track li .lv { margin-left: auto; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.track .btn { align-self: flex-start; margin-top: 4px; }

/* guide */
.guide-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.guide-tools .search { flex: 1 1 280px; max-width: 520px; }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fcard .cat { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; }
.fcard h3 { font-size: 20px; font-family: var(--f-mono); letter-spacing: 0; }
.fcard p { color: var(--ink-2); font-size: 14px; }
.fcard .syn { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.fcard .exm { background: var(--soft); border-radius: 8px; padding: 10px 12px; font-family: var(--f-mono); font-size: 13px; overflow-wrap: anywhere; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.fcard .exm button { border: 0; background: none; font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; font-family: var(--f-body); }
.fcard .note { font-size: 13px; color: var(--ink-3); }
.fcard .try { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 14px; text-decoration: none; text-align: center; }
.fcard .try:hover { color: var(--teal-ink); }

/* progress */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.tile b { display: block; font-family: var(--f-head); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile span { font-size: 14px; color: var(--ink-2); }
.tile .bar { margin-top: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; min-width: 0; }
.panel h2 { font-size: 20px; margin-bottom: 14px; }
.panel .hint { font-size: 14px; color: var(--ink-2); }
.topic-bars { display: grid; gap: 12px; }
.topic-bars .tr { display: grid; grid-template-columns: 100px minmax(0, 1fr) 50px; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.topic-bars .tr span:last-child { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl a { font-weight: 700; text-decoration: none; }
.tbl a:hover { color: var(--teal-ink); }
.tbl .muted { color: var(--ink-3); }
.profile-form { display: grid; gap: 12px; }

/* admin */
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { fill: var(--ink-3); font-size: 11px; font-family: var(--f-body); }
.chart-svg .gl { stroke: var(--line); }
.chart-svg .b1 { fill: var(--teal); }
.chart-svg .b2 { fill: var(--series-2); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.admin-actions .search { flex: 1 1 240px; }

/* ---------- exercise ---------- */
.ex-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 14px; position: sticky; top: 16px; }
.task .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.task h1 { font-size: 28px; }
.task .txt { font-size: 16px; }
.task .txt b { color: var(--ink); }
.task .use { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); }
.task .use code { font-family: var(--f-mono); background: var(--teal-wash); color: var(--teal-ink); padding: 3px 8px; border-radius: 6px; font-weight: 700; }
.hint-box { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.hint-box .h { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.hint-box .h b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 2px; }
.hint-box .h code, .explain code { font-family: var(--f-mono); font-size: 13px; }
.hint-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.explain { background: var(--good-wash); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.explain b { color: var(--good); display: block; margin-bottom: 4px; }
.sol { font-family: var(--f-mono); font-size: 14px; background: var(--soft); border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.sol button { flex: none; }
.status-line { font-size: 13px; color: var(--ink-3); font-weight: 600; }

.sheet-wrap { min-width: 0; display: grid; gap: 12px; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.sheet-title { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--soft); font-size: 14px; }
.sheet-title b { font-family: var(--f-head); font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { display: flex; gap: 4px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tb-btn { min-width: 34px; height: 32px; border: 1px solid transparent; background: none; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--ink); display: inline-grid; place-items: center; padding: 0 8px; }
.tb-btn:hover { background: var(--soft); border-color: var(--line); }
.tb-btn.on { background: var(--teal-wash); border-color: var(--teal); }
.tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.tb-note { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.fbar { display: grid; grid-template-columns: 70px 30px minmax(0, 1fr); align-items: stretch; border-bottom: 1px solid var(--line); position: relative; }
.fbar .nb { display: grid; place-items: center; font-weight: 700; font-size: 13px; border-right: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.fbar .fx { display: grid; place-items: center; font-family: var(--f-head); font-style: italic; color: var(--ink-3); border-right: 1px solid var(--line); }
.fbar input { border: 0; background: transparent; padding: 10px 12px; font-family: var(--f-mono); font-size: 14px; width: 100%; min-width: 0; }
.fbar input:focus { outline: none; background: var(--teal-wash); }
.fbar input[readonly] { color: var(--ink-2); }
.ac { position: absolute; left: 100px; top: 100%; z-index: 20; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); min-width: 280px; max-width: calc(100% - 110px); overflow: hidden; }
.ac .syn { padding: 8px 12px; font-family: var(--f-mono); font-size: 12px; background: var(--soft); color: var(--ink-2); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.ac .syn b { color: var(--teal-ink); }
.ac button { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; cursor: pointer; font-size: 13px; align-items: baseline; }
.ac button.on, .ac button:hover { background: var(--teal-wash); }
.ac button code { font-family: var(--f-mono); font-weight: 700; min-width: 92px; }
.ac button span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-scroll { overflow: auto; max-height: 520px; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 14px; user-select: none; -webkit-user-select: none; }
.grid th, .grid td { border-right: 1px solid var(--grid-line); border-bottom: 1px solid var(--grid-line); height: 32px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid th { background: var(--grid-head); color: var(--ink-3); font-weight: 600; font-size: 12px; position: sticky; top: 0; z-index: 2; text-align: center; }
.grid th.rh { position: sticky; left: 0; z-index: 3; width: 44px; min-width: 44px; }
.grid tbody th { position: sticky; left: 0; z-index: 1; }
.grid th.hl { background: var(--teal-wash); color: var(--teal-ink); }
.grid td { background: var(--cell); cursor: cell; max-width: 320px; }
.grid td.n { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.b { font-weight: 700; }
.grid td.err { color: var(--bad); font-weight: 700; }
.grid td.target { background: var(--teal-wash); box-shadow: inset 0 0 0 2px var(--teal); }
.grid td.sel { box-shadow: inset 0 0 0 2px var(--slate); }
.grid td.target.sel { box-shadow: inset 0 0 0 2px var(--teal), inset 0 0 0 3px var(--slate); }
.grid td.ref { background: color-mix(in srgb, var(--teal) 18%, var(--cell)); box-shadow: inset 0 0 0 1px var(--teal); }
.grid td.edit { padding: 0; }
.grid td.edit input { width: 100%; height: 30px; border: 0; padding: 0 8px; background: var(--cell); font-family: var(--f-mono); font-size: 13px; outline: 2px solid var(--teal); outline-offset: -2px; }
:root[data-theme="dark"] .grid td.sel { box-shadow: inset 0 0 0 2px #e8eae4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grid td.sel { box-shadow: inset 0 0 0 2px #e8eae4; } }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; background: var(--soft); flex-wrap: wrap; }
.sheet-foot .tabname { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; background: var(--surface); border-radius: 6px; border: 1px solid var(--line); }
.sheet-foot .live { color: var(--ink-2); font-family: var(--f-mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.feedback { border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); background: var(--surface); }
.feedback .fi { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--ink-3); font-size: 14px; }
.feedback b { display: block; }
.feedback p { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.feedback.correct { background: var(--good-wash); border-color: transparent; }
.feedback.correct .fi { background: var(--good); }
.feedback.wrong { background: var(--bad-wash); border-color: transparent; }
.feedback.wrong .fi { background: var(--bad); }
.feedback.partial, .feedback.empty { background: var(--warn-wash); border-color: transparent; }
.feedback.partial .fi, .feedback.empty .fi { background: var(--warn); }
.ex-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ex-actions .kbd { font-size: 12px; color: var(--ink-3); margin-left: auto; }
kbd { font-family: var(--f-mono); font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; background: var(--surface); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: var(--slate); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; z-index: 100; pointer-events: none; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--ink-3); font-weight: 600; }

/* privacy */
.doc { max-width: 720px; padding-block: 40px 60px; }
.doc h1 { font-size: 40px; margin-top: 8px; }
.doc h2 { font-size: 22px; margin-top: 30px; }
.doc p, .doc li { color: var(--ink-2); margin-top: 10px; }
.doc ul { padding-left: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .ex-layout { grid-template-columns: 1fr; }
  .task { position: static; }
  .studio { grid-template-columns: 1fr; }
  .studio .mini { display: none; }
  .topics { grid-template-columns: repeat(3, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero .wrap, .about, .area-cards { grid-template-columns: 1fr; }
  .hero { padding-block: 40px 56px; }
  .site-nav { display: none; }
  .head-actions { margin-left: auto; }
  .steps, .tasks-strip { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .shell { grid-template-columns: 1fr; background: var(--soft); }
  .side { position: fixed; z-index: 50; inset: 0 auto 0 0; width: 270px; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); padding-top: calc(20px + env(safe-area-inset-top, 0px)); padding-left: max(14px, env(safe-area-inset-left, 0px)); }
  .shell.open .side { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(20, 24, 30, .4); z-index: 45; }
  .menu-btn { display: inline-flex; }
  .main { padding: 12px 0 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .studio { padding: 28px 22px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search { grid-column: 1 / -1; }
  .topics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .brand img { height: 38px; }
  .head-actions .btn-ghost { display: none; }
  .row2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .topics { grid-template-columns: 1fr; }
  .cta-band { padding: 24px; }
  .ac { left: 0; max-width: 100%; min-width: 0; right: 0; }
  .fbar { grid-template-columns: 56px 26px minmax(0, 1fr); }
  .ex-actions .kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
