/* =============================================================================================
   ScribeFiles styles: design tokens, marketing site, auth pages, and the dashboard app shell.
   Light by default; dark follows the OS unless the user picks a theme (data-theme on <html>).
   ============================================================================================= */

/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --canvas: #f5f6f8;
  --bg-elev: #ffffff;
  --sidebar: #fafafb;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e7e8ec;
  --line-strong: #d3d6de;
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-ink: #ffffff;
  --brand-soft: #eef0ff;
  --brand-text: #4338ca;
  --ok: #15803d;
  --ok-soft: #e7f6ed;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --err: #c62828;
  --err-soft: #fdecec;
  --info: #2563eb;
  --info-soft: #e8f0fe;
  --mark: #fde68a;
  --active: #eef0ff;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px rgba(17, 24, 39, .06);
  --shadow-lg: 0 24px 64px rgba(17, 24, 39, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e13; --bg-soft: #12151c; --canvas: #0c0e13; --bg-elev: #14171f; --sidebar: #0f1117;
    --ink: #e8eaf0; --ink-2: #c6cad5; --muted: #8d93a3; --line: #232733; --line-strong: #333847;
    --brand: #7c83ff; --brand-hover: #969bff; --brand-ink: #0c0e13; --brand-soft: #1d1f3b; --brand-text: #a5aaff;
    --ok: #4ade80; --ok-soft: #10261a; --warn: #fbbf24; --warn-soft: #2a2110; --err: #f87171; --err-soft: #2c1414;
    --info: #60a5fa; --info-soft: #10203a; --mark: #6b5310; --active: #1d1f3b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e13; --bg-soft: #12151c; --canvas: #0c0e13; --bg-elev: #14171f; --sidebar: #0f1117;
  --ink: #e8eaf0; --ink-2: #c6cad5; --muted: #8d93a3; --line: #232733; --line-strong: #333847;
  --brand: #7c83ff; --brand-hover: #969bff; --brand-ink: #0c0e13; --brand-soft: #1d1f3b; --brand-text: #a5aaff;
  --ok: #4ade80; --ok-soft: #10261a; --warn: #fbbf24; --warn-soft: #2a2110; --err: #f87171; --err-soft: #2c1414;
  --info: #60a5fa; --info-soft: #10203a; --mark: #6b5310; --active: #1d1f3b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink);
  background: var(--bg); min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 2.4vw, 1.75rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { flex: none; display: inline-block; vertical-align: middle; }
kbd { font-family: var(--mono); font-size: .72rem; padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--bg-elev); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 760px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.2;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--bg-elev); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--bg-soft); }
.btn-danger { background: var(--err); color: #fff; }
.btn-ghost-danger { background: transparent; color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.btn-ghost-danger:hover { background: var(--err-soft); }
.btn-sm { padding: 6px 11px; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 11px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; flex: none;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }
.icon-sm { width: 26px; height: 26px; font-size: .8rem; }
.link-btn { font: inherit; font-size: .85rem; font-weight: 600; color: var(--brand-text); background: none; border: 0; padding: 2px 4px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-arrow { display: inline-flex; align-items: center; gap: 4px; font-size: .86rem; font-weight: 600; }

/* ---------- Forms, alerts, pills ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > label, .field > legend { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
input[type=email], input[type=password], input[type=text], input[type=search], select, textarea {
  font: inherit; font-size: .92rem; color: var(--ink); background: var(--bg-elev);
  border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 12px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.form-narrow { max-width: 380px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { width: auto; }
.check-line { display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--ink-2); }
.alert { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 10px; font-size: .9rem; }
.alert-error { background: var(--err-soft); color: var(--err); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--bg-soft); color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--bg-soft); color: var(--muted); text-transform: capitalize; white-space: nowrap; }
.status-pill.ok { background: var(--ok-soft); color: var(--ok); }
.status-pill.err { background: var(--err-soft); color: var(--err); }
.status-pill.warn { background: var(--warn-soft); color: var(--warn); }
.status-pill.info { background: var(--info-soft); color: var(--info); }
.plan-pill { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 700; letter-spacing: .02em; padding: 2px 9px; border-radius: 6px; background: var(--bg-soft); color: var(--ink-2); border: 1px solid var(--line); }
.plan-pill.paid { background: var(--brand-soft); color: var(--brand-text); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.plan-pill.big { font-size: 1rem; padding: 4px 12px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--ink-2); background: var(--bg-elev); border: 1px solid var(--line); padding: 3px 9px; border-radius: 99px; }
.meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s ease; }
.meter-lg { height: 8px; margin: 14px 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; flex: none; }
.spinner-lg { width: 30px; height: 30px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.segmented, .billing-toggle { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: .84rem; border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg-btn .count { font-family: var(--mono); font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg-btn .count:empty { display: none; }

/* ---------- Marketing header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--brand); flex: none; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav-link { color: var(--ink-2); padding: 8px 12px; border-radius: 8px; font-size: .92rem; }
.nav-link:hover { background: var(--bg-soft); text-decoration: none; }

/* ---------- Landing ---------- */
.landing main { overflow-x: clip; }
.hero { padding: 56px 0 72px; background:
  radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
  radial-gradient(700px 380px at -10% 10%, color-mix(in srgb, #22d3ee 10%, transparent), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: start; }
.hero-copy { padding-top: 28px; }
.eyebrow { display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-text); background: var(--brand-soft); padding: 5px 11px; border-radius: 99px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); letter-spacing: -0.03em; margin-bottom: 18px; }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; }
.hero-points { list-style: none; padding: 0; margin: 22px 0 30px; display: grid; gap: 8px; }
.hero-points li { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.stats { display: flex; gap: 36px; }
.stats div { display: flex; flex-direction: column; }
.stats strong { font-size: 1.6rem; letter-spacing: -0.02em; }
.stats span { color: var(--muted); font-size: .9rem; }
.section { padding: 80px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -0.02em; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); }
.feature-icon { font-size: 1.5rem; display: block; margin-bottom: 12px; }
.feature p { color: var(--muted); margin: 0; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.steps p { color: var(--muted); margin: 0; }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font-weight: 700; margin-bottom: 14px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 4px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.02rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); margin: 12px 0 0; }
.cta { text-align: center; }
.cta h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

/* ---------- Pricing ---------- */
.pricing { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.save { font-size: .72rem; color: var(--ok); background: var(--ok-soft); padding: 2px 7px; border-radius: 99px; margin-left: 4px; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 22px; justify-content: center; width: 100%; }
.plan { position: relative; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; }
.plan-featured { border: 2px solid var(--brand); box-shadow: 0 12px 40px color-mix(in srgb, var(--brand) 16%, transparent); }
.ribbon { position: absolute; top: -12px; left: 26px; background: var(--brand); color: var(--brand-ink); font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.price { margin: 6px 0 4px; display: flex; align-items: baseline; gap: 6px; }
.amount { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; }
.per { color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 14px 0 24px; display: grid; gap: 9px; flex: 1; }
.checks li { position: relative; padding-left: 26px; color: var(--ink-2); }
.checks li::before { content: ""; position: absolute; left: 0; top: .3em; width: 16px; height: 16px; border-radius: 50%; background: var(--ok-soft); }
.checks li::after { content: ""; position: absolute; left: 5px; top: calc(.3em + 4px); width: 6px; height: 3px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }

/* ---------- Uploader (landing card and the dashboard dialog) ---------- */
.uploader { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.modal .uploader { padding: 0; border: 0; box-shadow: none; background: transparent; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; padding: 28px 18px; border: 2px dashed var(--line-strong); border-radius: 14px;
  background: var(--bg-soft); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone-icon { width: 38px; height: 38px; color: var(--brand); margin-bottom: 4px; }
.dropzone-title { font-size: 1.02rem; }
.dropzone .btn { margin-top: 8px; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow: auto; }
.file-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .88rem; background: var(--bg-elev); }
.file-item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .meta { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; display: flex; justify-content: space-between; gap: 8px; }
.file-item .meter { grid-column: 1 / -1; height: 4px; }
.file-item.error .meta { color: var(--err); }
.file-item.done .meta { color: var(--ok); }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode { position: relative; cursor: pointer; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 11px 6px; border: 1.5px solid var(--line-strong); border-radius: 12px; text-align: center; background: var(--bg-elev); transition: border-color .15s, background .15s; }
.mode-icon { font-size: 1.35rem; line-height: 1.2; }
.mode-card small { color: var(--muted); font-size: .76rem; }
.mode input:checked + .mode-card { border-color: var(--brand); background: var(--brand-soft); }
.mode input:focus-visible + .mode-card { outline: 2px solid var(--brand); outline-offset: 2px; }
.mode-lock { font-style: normal; font-size: .66rem; font-weight: 700; color: var(--brand-text); background: var(--brand-soft); padding: 1px 6px; border-radius: 99px; margin-top: 3px; }
.mode.locked .mode-card { opacity: .75; }
.more-settings { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.more-settings summary { cursor: pointer; padding: 11px 0; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.more-settings[open] { padding-bottom: 12px; }
.more-settings > * + * { margin-top: 12px; }
.toggle { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.toggle input { margin-top: 4px; width: 16px; height: 16px; flex: none; }
.toggle span { display: flex; flex-direction: column; }
.toggle small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.toggle.locked { opacity: .7; }
.speakers-field { padding-left: 26px; }
.fineprint { font-size: .76rem; color: var(--muted); text-align: center; margin: -6px 0 0; }

/* ---------- Dialogs ---------- */
.modal { border: 0; border-radius: 16px; padding: 26px; width: min(420px, calc(100vw - 32px)); background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow-lg); }
.modal-lg { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; padding: 22px 24px 24px; }
.modal::backdrop { background: rgba(8, 10, 18, .55); backdrop-filter: blur(2px); }
.modal h2 { padding-right: 24px; margin-bottom: 4px; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.modal-head p { margin: 0; }
.modal-x { position: absolute; top: 14px; right: 14px; border: 0; background: transparent; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; }

/* ---------- Auth, legal, error, footer ---------- */
.auth-wrap { min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 40px 16px; background: var(--bg-soft); }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 1.45rem; }
.auth-card .stack { margin: 18px 0; }
.prose { padding-top: 40px; padding-bottom: 60px; }
.prose h2 { margin-top: 1.6em; font-size: 1.12rem; }
.prose p, .prose li { color: var(--ink-2); }
.error-page { padding: 100px 20px; }
.footer { border-top: 1px solid var(--line); padding: 28px 0; background: var(--bg); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; font-size: .9rem; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: .9rem; }
.footer-links a { color: var(--muted); }

/* =============================================================================================
   Dashboard app shell
   ============================================================================================= */
.app-body { background: var(--canvas); }
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

/* sidebar */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30;
  display: flex; flex-direction: column; gap: 18px; padding: 18px 14px 14px;
  background: var(--sidebar); border-right: 1px solid var(--line);
}
.sidebar .brand { padding: 2px 6px; }
.new-btn { justify-content: center; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-label { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.side-label:first-child { padding-top: 0; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.side-link .icon { color: var(--muted); }
.side-link:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.side-link.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.side-link.active .icon { color: var(--brand-text); }
.side-link span:first-of-type { flex: 1; }
.side-badge { font-family: var(--mono); font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line); padding: 0 7px; border-radius: 99px; }
.side-badge.live { color: var(--info); background: var(--info-soft); border-color: transparent; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.plan-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); }
.plan-box p { margin: 0; }
.plan-box-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 4px 2px 0 6px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: .85rem; flex: none; }
.user-email { flex: 1; min-width: 0; font-size: .84rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row form { margin: 0; }
.scrim { position: fixed; inset: 0; background: rgba(8, 10, 18, .45); z-index: 25; }

/* top bar */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: color-mix(in srgb, var(--canvas) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumb-current { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb-sep { color: var(--line-strong); }
.top-search { position: relative; display: flex; align-items: center; width: min(320px, 34vw); }
.top-search .icon { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.top-search input { padding: 7px 36px 7px 34px; background: var(--bg-elev); border-radius: 9px; font-size: .88rem; }
.top-search kbd { position: absolute; right: 9px; }
.content { padding: 28px 32px 56px; width: 100%; max-width: 1360px; display: flex; flex-direction: column; gap: 22px; }

/* page building blocks */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; }
.page-head p { margin: 0; }
.panel { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.panel-flush { padding: 0; gap: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1rem; margin: 0; }
.panel-head.padded { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: .95rem; margin: 0; }
.panel-title .icon { color: var(--muted); }
.panel p { margin: 0; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.side-stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--warn-soft); color: var(--ink); font-size: .9rem; flex-wrap: wrap; }
.notice > span { flex: 1; min-width: 200px; }
.notice > .icon { color: var(--warn); }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-sub { font-size: .8rem; color: var(--muted); }
.kpi-bad .kpi-value { color: var(--err); }
.spark { width: 100%; height: 40px; display: block; }
.spark rect, .bars rect { fill: var(--line-strong); }
.spark rect.on, .bars rect.on { fill: var(--brand); }
.bars { width: 100%; height: 130px; display: block; }
.bars .axis { stroke: var(--line); stroke-width: 1; }
.bars-axis { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-top: -6px; }

/* overview side cards */
.dropcard { align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 26px 18px; border: 1.5px dashed var(--line-strong); box-shadow: none; cursor: pointer; transition: border-color .15s, background .15s; }
.dropcard:hover, .dropcard.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dropcard-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); margin-bottom: 4px; }
.usage-list { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.usage-list > div { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.usage-list dt { font-size: .86rem; color: var(--muted); }
.usage-list dd { margin: 0; font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.usage-list .meter { grid-column: 1 / -1; }
.tips h2 { font-size: 1rem; margin: 0; }
.tips ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tips li { display: flex; gap: 10px; font-size: .88rem; color: var(--ink-2); line-height: 1.45; }
.tips li .icon { color: var(--brand-text); margin-top: 2px; }

/* transcript lists */
.job-table { container-type: inline-size; }
.job-row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) 84px 168px 104px 36px; align-items: center; gap: 14px;
  padding: 11px 20px; border-bottom: 1px solid var(--line); position: relative;
}
.job-table[data-mode="recent"] .job-row { grid-template-columns: minmax(0, 1fr) 76px 150px 92px 36px; padding: 11px 4px; }
.job-table[data-mode="recent"] .job-row:last-child { border-bottom: 0; }
.job-row:not(.job-head):hover { background: var(--bg-soft); }
.job-head { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg-soft); padding-top: 9px; padding-bottom: 9px; }
.job-table[data-mode="recent"] .job-head { display: none; }
.cell-check { display: flex; }
.cell-check input { width: 16px; height: 16px; }
.job-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.job-name-text { min-width: 0; display: flex; flex-direction: column; }
.job-name a { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-name a::after { content: ""; position: absolute; inset: 0; } /* whole row is clickable */
.job-name span { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-badge { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.file-badge.video { background: var(--info-soft); color: var(--info); }
.job-cell { font-size: .86rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.job-status { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; min-width: 0; }
.job-status .stage { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-status .meter { height: 4px; }
.job-status .status-pill { align-self: flex-start; }
.job-status .stage { display: flex; align-items: center; gap: 6px; }
.cell-check, .row-menu { position: relative; z-index: 1; }
.row-menu { display: flex; justify-content: flex-end; }
.row-menu.open { z-index: 50; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 190px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.menu a, .menu button { display: flex; align-items: center; gap: 8px; font: inherit; font-size: .88rem; text-align: left; padding: 7px 10px; border-radius: 8px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--bg-soft); text-decoration: none; }
.menu.up { top: auto; bottom: calc(100% + 4px); }
.menu .danger { color: var(--err); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.menu-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px 2px; }
.job-loading, .empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .file-badge { width: 46px; height: 46px; border-radius: 12px; margin-bottom: 6px; }
.empty strong { color: var(--ink); }
.empty .btn { margin-top: 8px; }
@container (max-width: 680px) {
  .job-row, .job-table[data-mode="recent"] .job-row { grid-template-columns: minmax(0, 1fr) 126px 34px; gap: 10px; }
  .job-table[data-mode="full"] .job-row { grid-template-columns: 22px minmax(0, 1fr) 126px 34px; padding-left: 14px; padding-right: 14px; }
  .job-row .col-wide { display: none; }
  .file-badge { width: 30px; height: 30px; }
}
.list-toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.field-search { position: relative; display: flex; align-items: center; flex: 1; min-width: 200px; max-width: 340px; }
.field-search .icon { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.field-search input { padding-left: 34px; }
.sort { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sort select { width: auto; padding: 6px 10px; font-size: .86rem; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--brand-soft); padding: 10px 20px; font-weight: 600; font-size: .88rem; border-bottom: 1px solid var(--line); }
.bulk-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bulk-actions select { width: auto; padding: 6px 10px; font-size: .85rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager-btns { display: flex; gap: 8px; }

/* billing, settings, admin */
.plan-summary { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.dev-box { padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); display: flex; flex-direction: column; gap: 8px; }
.dev-box p { color: var(--warn); }
.plans-section { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.plans-section h2 { margin: 0; }
.plans-section .pricing { align-items: stretch; }
.plans-section .billing-toggle { align-self: center; }
.settings { display: flex; flex-direction: column; gap: 16px; max-width: 920px; }
.settings-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 22px 24px; }
.settings-intro h2 { font-size: 1rem; margin: 0 0 4px; }
.kv { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.kv > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; align-items: center; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.theme-choice { align-self: start; }
.danger-zone { border-color: color-mix(in srgb, var(--err) 28%, var(--line)); }
.backup-panel { gap: 8px; }
.backup-panel.backup-ok .panel-title .icon { color: var(--ok); }
.backup-panel.backup-bad { border-color: var(--err); }
.backup-panel.backup-bad .panel-title .icon { color: var(--err); }
.engine-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .9rem; }
.engine-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.status-dot.ok { background: var(--ok); }
.ok-text { color: var(--ok); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.form-grid .btn { grid-column: 1 / -1; justify-self: start; }
.plan-form input { flex: 1; min-width: 180px; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--bg-soft); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.panel .table th:first-child, .panel .table td:first-child { padding-left: 20px; }

/* ---------- Transcript page ---------- */
.t-head { display: flex; align-items: flex-start; gap: 14px; }
.t-head .file-badge { width: 44px; height: 44px; border-radius: 12px; margin-top: 2px; }
.t-head-text { min-width: 0; flex: 1; }
.t-head h1 { outline: none; border-radius: 8px; padding: 2px 6px; margin: 0 -6px 8px; overflow-wrap: anywhere; }
.t-head h1:hover { background: var(--bg-elev); }
.t-head h1:focus { background: var(--bg-elev); box-shadow: 0 0 0 2px var(--brand); }
.t-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.t-meta .chip:empty { display: none; }
.status-card { max-width: 560px; align-items: flex-start; padding: 26px; }
.status-card h2 { margin: 0; }
.status-icon.err { color: var(--err); }
.t-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.t-main { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.t-tabs { display: flex; gap: 4px; padding: 8px 14px 0; border-bottom: 1px solid var(--line); }
.t-tab { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px 11px; cursor: pointer; margin-bottom: -1px; }
.t-tab:hover { color: var(--ink); }
.t-tab.active { color: var(--ink); border-bottom-color: var(--brand); }
.t-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); position: sticky; top: var(--topbar-h); background: var(--bg-elev); z-index: 5; }
.t-search { max-width: 340px; }
.t-search #t-search-count { position: absolute; right: 12px; pointer-events: none; }
.t-actions { display: flex; gap: 8px; align-items: center; }
.view-select { width: auto; padding: 5px 10px; font-size: .84rem; }
.save-state { padding: 0 22px; }
.save-state:not(:empty) { padding-top: 10px; }
.t-body { padding: 16px 22px 28px; font-size: 1.02rem; line-height: 1.75; }
.para { padding: 10px 0; display: grid; grid-template-columns: 1fr; gap: 2px; }
.para-head { display: flex; align-items: center; gap: 10px; font-size: .84rem; }
.spk { font: inherit; font-weight: 700; border: 0; background: transparent; padding: 1px 0; cursor: pointer; color: var(--spk-color, var(--brand-text)); }
.spk:hover { text-decoration: underline; }
.ts { font: inherit; font-family: var(--mono); font-size: .78rem; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 1px 4px; border-radius: 6px; }
.ts:hover { background: var(--bg-soft); color: var(--ink); }
.para-text { margin: 0; }
.seg { border-radius: 4px; cursor: pointer; transition: background .15s; }
.seg:hover { background: var(--bg-soft); }
.seg.active { background: var(--active); box-shadow: 0 0 0 2px var(--active); }
.editing .seg { cursor: text; text-decoration: underline dotted var(--line-strong); text-underline-offset: 5px; }
.editing .seg[contenteditable] { outline: none; }
.editing .seg:focus { background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand-soft); }
.editing .t-body { background: color-mix(in srgb, var(--brand-soft) 40%, transparent); }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
mark.current { outline: 2px solid var(--warn); }
.t-side { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 14px; }
.t-side .panel { padding: 16px; gap: 12px; }
.t-player audio, .t-player video { width: 100%; display: block; border-radius: 10px; }
.t-player video { background: #000; max-height: 240px; }
.speed { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.speed select { width: auto; padding: 4px 8px; font-size: .84rem; }
.follow { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.speaker-row { display: flex; align-items: center; gap: 8px; }
.speaker-row .swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.speaker-row input { padding: 6px 10px; font-size: .88rem; }
.export-opts { display: flex; gap: 14px; flex-wrap: wrap; }
.export-opts label { display: flex; align-items: center; gap: 6px; }
.export-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name actions" "state state"; align-items: center; gap: 2px 8px; font-size: .88rem; }
.tr-row strong { grid-area: name; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-row > span:not(.tr-actions) { grid-area: state; }
.tr-actions { grid-area: actions; display: flex; align-items: center; gap: 2px; }
.tr-meter { display: block; height: 4px; }
.tr-new { display: flex; gap: 6px; margin-top: 4px; }
.tr-new select { padding: 6px 8px; font-size: .86rem; }
.warn-text { color: var(--warn); }
.err-text { color: var(--err); }

/* AI tools */
.ai-panel { padding: 18px 22px 26px; display: flex; flex-direction: column; gap: 16px; }
.ai-intro { display: flex; flex-direction: column; gap: 12px; }
.ai-intro > p { margin: 0; }
.ai-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.ai-tpl { font: inherit; font-size: .88rem; font-weight: 600; display: flex; align-items: center; gap: 8px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.ai-tpl span { font-size: 1.05rem; }
.ai-tpl:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.ai-tpl:disabled, .ai-ask .btn:disabled { opacity: .55; cursor: wait; }
.ai-ask { display: flex; gap: 8px; align-items: stretch; }
.ai-ask textarea { flex: 1; resize: vertical; min-height: 46px; }
.ai-opts { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-opts select { width: auto; padding: 4px 8px; font-size: .84rem; margin-left: 4px; }
.ai-outputs { display: flex; flex-direction: column; gap: 14px; }
.ai-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ai-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg-soft); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ai-card-head > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.ai-card-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-card-actions { display: flex; gap: 6px; align-items: center; }
.ai-content { padding: 14px 16px; line-height: 1.65; overflow-wrap: anywhere; }
.ai-content > :first-child { margin-top: 0; }
.ai-content > :last-child { margin-bottom: 0; }
.ai-content h3, .ai-content h4, .ai-content h5, .ai-content h6 { margin: 1.1em 0 .4em; font-size: 1rem; }
.ai-content h3 { font-size: 1.12rem; }
.ai-content p { margin: 0 0 .8em; }
.ai-content ul, .ai-content ol { margin: 0 0 .8em; padding-left: 1.4em; }
.ai-content li { margin: .25em 0; }
.ai-content blockquote { margin: 0 0 .8em; padding: 4px 12px; border-left: 3px solid var(--brand); color: var(--ink-2); }
.ai-content code { font-family: var(--mono); font-size: .88em; background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; }
.ai-content hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.ai-empty { padding: 28px 8px; text-align: center; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow-lg); animation: toast-in .2s ease; max-width: calc(100vw - 32px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-copy { padding-top: 0; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-main, .grid-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-layout { grid-template-columns: 1fr; }
  .t-side { display: contents; }
  .t-player { order: -1; position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 6; }
  .t-toolbar { position: static; }
  .settings-row { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; gap: 10px; }
  .top-search { width: auto; flex: 0 1 220px; }
  .top-search kbd { display: none; }
  .content { padding: 20px 16px 48px; }
}
@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .hide-sm { display: none !important; }
  .feature-grid, .steps, .grid-3 { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .stats { gap: 22px; }
  .section { padding: 56px 0; }
  .hero { padding: 32px 0 48px; }
  .kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 1.4rem; }
  .crumbs { display: none; }
  .top-search { flex: 1; }
  .t-body { padding: 14px 16px 24px; }
  .t-toolbar { padding: 12px 14px; }
  .list-toolbar { padding: 12px 14px; }
  .sort { margin-left: 0; }
  .field-search { max-width: none; }
  .form-grid { grid-template-columns: 1fr; }
  .kv > div { grid-template-columns: 1fr; gap: 2px; }
  .card { padding: 18px; }
  .nav-link { padding: 8px 7px; font-size: .9rem; }
}
@media (max-width: 420px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 12px 14px; }
}
