/* ============================================================================
   Scribe — design system (shared with the OCR/ASR panels: same tokens, same components)
   Visual language ported from the "Open World" reference:
   Unbounded display / Manrope UI / JetBrains Mono numerics, ember accent,
   hairline surfaces, ambient grid + glow, 20px card radius.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens -- */
:root {
  --bg:          #0E0E11;
  --bg-2:        #0B0B0E;
  --surface:     #15151A;
  --surface-2:   #101014;
  --card-a:      #16161B;
  --card-b:      #101014;

  --hair:        rgba(255, 255, 255, .06);
  --line:        rgba(255, 255, 255, .08);
  --line-2:      rgba(255, 255, 255, .14);
  --chip:        rgba(255, 255, 255, .04);
  --chip-hover:  rgba(255, 255, 255, .08);
  --grid:        rgba(255, 255, 255, .035);

  --text:        #F4F3F1;
  --muted:       #A6A6AF;
  --muted-2:     #9A9AA3;
  --faint:       #7C7C85;
  --faint-2:     #7E7E88;

  --accent:      #FF6A1A;
  --accent-2:    #FF8A3D;
  --accent-deep: #C2470A;
  --accent-soft: rgba(255, 106, 26, .12);
  --accent-glow: rgba(255, 106, 26, .30);
  --accent-ink:  #0B0B0D;

  --ok:          #27D07F;
  --ok-soft:     rgba(39, 208, 127, .12);
  --warn:        #F0B429;
  --warn-soft:   rgba(240, 180, 41, .12);
  --danger:      #FF4D5E;
  --danger-soft: rgba(255, 77, 94, .10);

  --header-bg:   rgba(14, 14, 17, .72);
  --shadow-sm:   0 10px 26px rgba(0, 0, 0, .35);
  --shadow-md:   0 24px 60px rgba(0, 0, 0, .42);
  --shadow-lg:   0 40px 100px rgba(0, 0, 0, .55);

  --r-xs: 8px;
  --r-sm: 11px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --font-ui:      'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-display: 'Unbounded', var(--font-ui);
  --font-mono:    'JetBrains Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace;

  --shell: 1180px;
  --play: running;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:          #F6F5F2;
  --bg-2:        #FFFFFF;
  --surface:     #FFFFFF;
  --surface-2:   #F1F0EC;
  --card-a:      #FFFFFF;
  --card-b:      #F6F5F2;

  --hair:        rgba(14, 14, 17, .07);
  --line:        rgba(14, 14, 17, .10);
  --line-2:      rgba(14, 14, 17, .17);
  --chip:        rgba(14, 14, 17, .035);
  --chip-hover:  rgba(14, 14, 17, .075);
  --grid:        rgba(14, 14, 17, .045);

  --text:        #131318;
  --muted:       #55555F;
  --muted-2:     #62626C;
  --faint:       #787882;
  /* Column headers and strip labels use --faint-2 at 10px uppercase, so it has
     to clear 4.5:1 on --surface-2 — a lighter grey is unreadable there. */
  --faint-2:     #696974;

  /* On light, --accent-2 is the *hover* accent: it must be darker than --accent,
     not lighter, or white button text loses contrast exactly on interaction. */
  --accent:      #C24507;
  --accent-2:    #A63A05;
  --accent-deep: #8E3104;
  --accent-soft: rgba(194, 69, 7, .10);
  --accent-glow: rgba(194, 69, 7, .18);
  --accent-ink:  #FFFFFF;

  --ok:          #0E9E5B;
  --ok-soft:     rgba(14, 158, 91, .10);
  --warn:        #7A5407;
  --warn-soft:   rgba(122, 84, 7, .12);
  --danger:      #D3384A;
  --danger-soft: rgba(211, 56, 74, .09);

  --header-bg:   rgba(246, 245, 242, .8);
  --shadow-sm:   0 8px 20px rgba(20, 18, 15, .07);
  --shadow-md:   0 20px 48px rgba(20, 18, 15, .10);
  --shadow-lg:   0 34px 80px rgba(20, 18, 15, .14);
  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  :root { --play: paused; }
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ base -- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: relative;
  overflow-x: hidden;
  transition: background .25s ease, color .25s ease;
}

::selection { background: var(--accent-soft); color: var(--text); }

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }

h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@keyframes floatDrift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes glowPulse  { 0%, 100% { opacity: .45; } 50% { opacity: .8; } }
@keyframes blink      { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes spinSlow   { to { transform: rotate(360deg); } }
@keyframes shimmer    { 0% { background-position: -420px 0; } 100% { background-position: 420px 0; } }
@keyframes riseIn     { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes barFlow    { 0% { background-position: 0 0; } 100% { background-position: 34px 0; } }

/* -------------------------------------------------------------- ambience -- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient .grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 76% 58% at 50% 0%, #000, transparent 78%);
  mask-image: radial-gradient(ellipse 76% 58% at 50% 0%, #000, transparent 78%);
}
.ambient .glow {
  position: absolute;
  left: 50%;
  top: -300px;
  width: 1100px;
  height: 700px;
  max-width: 160vw;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--accent-glow), transparent 62%);
  filter: blur(40px);
  opacity: .55;
  animation: glowPulse 8s ease-in-out infinite;
  animation-play-state: var(--play);
}
.ambient .ring {
  position: absolute;
  right: 6%;
  top: 120px;
  width: 340px;
  height: 340px;
  border: 1px solid var(--line);
  border-radius: 50%;
  animation: spinSlow 70s linear infinite;
  animation-play-state: var(--play);
}
.ambient .ring.small {
  right: 10%;
  top: 178px;
  width: 224px;
  height: 224px;
  animation-duration: 52s;
  animation-direction: reverse;
}
@media (max-width: 900px) { .ambient .ring { display: none; } }

/* ---------------------------------------------------------------- header -- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hair);
}

.topbar-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
/* The glyph inside is drawn with hardcoded white strokes, so the chip keeps a
   dark fill in both themes — tying it to --surface-2 made it vanish on light. */
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r-sm);
  background: radial-gradient(circle at 50% 130%, #C2470A, #161318);
  color: #fff;
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .34em;
  color: var(--accent);
  margin-top: 4px;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14.5px;
  font-weight: 500;
}
.nav a {
  color: var(--muted-2);
  padding: 8px 13px;
  border-radius: var(--r-sm);
  transition: color .15s ease, background .18s ease;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--chip); }
.nav a.active { color: var(--text); background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.active::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px var(--accent);
}

.topbar-actions { display: flex; align-items: center; gap: 9px; }

.icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
  padding: 0;
}
.icon-btn:hover { background: var(--chip-hover); color: var(--text); }
.icon-btn svg { display: block; }

.burger { display: none; }

.mobile-menu {
  border-top: 1px solid var(--hair);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 22px 20px;
  flex-direction: column;
  gap: 2px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 14px 6px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--hair);
}
.mobile-menu a.active { color: var(--accent); }
.mobile-menu a:last-child { border-bottom: none; }

@media (max-width: 860px) {
  .topbar-inner { padding: 11px 18px; }
  .nav.desktop { display: none; }
  .burger { display: grid; }
}

/* ------------------------------------------------------------------ page -- */
.container {
  position: relative;
  z-index: 1;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 30px 22px 72px;
}
.container.narrow { max-width: 720px; }

@media (max-width: 620px) { .container { padding: 22px 16px 56px; } }

.page-head { margin-bottom: 26px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink 2.4s ease-in-out infinite;
  animation-play-state: var(--play);
}
.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.06;
  letter-spacing: -.022em;
  margin: 14px 0 0;
}
.page-sub {
  color: var(--muted);
  font-size: clamp(14.5px, 1.3vw, 16px);
  line-height: 1.6;
  margin: 12px 0 0;
  max-width: 620px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ----------------------------------------------------------------- cards -- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  animation: riseIn .32s ease both;
}
.card.flush { padding: 0; overflow: hidden; }
/* A card whose settings do not apply to the active configuration: still fully
   readable and usable, just visibly not the thing in charge right now. */
.card.inactive { opacity: .62; }
.card.inactive:hover, .card.inactive:focus-within { opacity: 1; }
.card.accent { border-color: var(--accent); box-shadow: 0 24px 60px var(--accent-glow); }
.card.ok { border-color: var(--ok); background: linear-gradient(180deg, var(--ok-soft), transparent 60%), var(--surface); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.card-head:last-child { margin-bottom: 0; }
.card-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title .ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--r-xs);
  background: var(--accent-soft);
  color: var(--accent);
}
.card-note { color: var(--faint); font-size: 13px; line-height: 1.55; }

.card.flush .card-head { padding: 18px 22px 0; margin-bottom: 14px; }

/* --------------------------------------------------------------- buttons -- */
button, .btn {
  font-family: var(--font-ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, transform .15s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
button:hover, .btn:hover { background: var(--accent-2); color: var(--accent-ink); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); }

button.primary, .btn.primary { box-shadow: 0 10px 28px var(--accent-glow); }

button.secondary, .btn.secondary {
  background: var(--chip);
  color: var(--text);
  border-color: var(--line-2);
  box-shadow: none;
}
button.secondary:hover, .btn.secondary:hover { background: var(--chip-hover); color: var(--text); }

button.ghost, .btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
button.ghost:hover, .btn.ghost:hover { background: var(--chip); color: var(--text); }

button.danger, .btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
button.danger:hover, .btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

button.success, .btn.success { background: var(--ok); color: var(--accent-ink); }

button.sm, .btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: var(--r-xs); gap: 6px; }
button.lg, .btn.lg { padding: 14px 24px; font-size: 15.5px; border-radius: var(--r-md); }
button.block, .btn.block { width: 100%; }

button:disabled, .btn:disabled, button[disabled] {
  background: var(--chip);
  color: var(--faint-2);
  border-color: var(--line);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
button:disabled:hover { background: var(--chip); transform: none; }

button svg, .btn svg { flex: none; }

/* ---------------------------------------------------------------- inputs -- */
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: var(--chip);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint-2); }
input:hover, textarea:hover, select:hover { border-color: var(--line-2); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[readonly] { color: var(--muted); }
input.mono, .mono { font-family: var(--font-mono); }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238A8A93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
select option { background: var(--surface); color: var(--text); }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-hint { color: var(--faint); font-size: 12.5px; line-height: 1.55; margin-top: 8px; }

.input-group { position: relative; display: flex; }
.input-group input { padding-right: 44px; }
.input-group .input-action {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--faint);
  cursor: pointer;
  padding: 0;
}
.input-group .input-action:hover { background: var(--chip-hover); color: var(--text); transform: translateY(-50%); }

/* ---------------------------------------------------------------- switch -- */
.switch {
  display: inline-flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--chip);
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: border-color .18s ease, background .18s ease;
}
.switch:hover { border-color: var(--line-2); background: var(--chip-hover); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  transition: background .2s ease, border-color .2s ease;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--faint);
  transition: transform .2s cubic-bezier(.3, .9, .4, 1), background .2s ease;
}
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); background: var(--accent-ink); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.switch-hint { font-size: 12px; font-weight: 500; color: var(--faint); line-height: 1.45; }
.switch.on { border-color: var(--accent); background: var(--accent-soft); }

/* -------------------------------------------------------------- dropzone -- */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-md);
  padding: 34px 24px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.dragover {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
  color: var(--text);
  transform: scale(1.005);
}
.dropzone.has-file { border-style: solid; border-color: var(--line-2); background: var(--chip); }
.dz-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  transition: transform .3s ease;
}
.dropzone:hover .dz-icon { transform: translateY(-3px); }
.dz-title { font-size: 16.5px; font-weight: 700; color: var(--text); }
.dz-title em { font-style: normal; color: var(--accent); }
.dz-sub { font-size: 13px; color: var(--faint); margin-top: 7px; }
.dz-formats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}
.dz-formats span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--faint);
  background: var(--surface-2);
}

.file-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--chip);
  min-width: 0;
}
.file-pill .ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--r-xs);
  background: var(--accent-soft);
  color: var(--accent);
}
.file-pill .fp-body { min-width: 0; flex: 1; }
.file-pill .fp-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-pill .fp-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.file-pill.empty .ico { background: var(--chip); color: var(--faint-2); }
.file-pill.empty .fp-name { color: var(--faint); font-weight: 500; }

/* --------------------------------------------------------------- layout -- */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 8px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.row > .grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; }

/* --------------------------------------------------------------- badges -- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  vertical-align: middle;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.badge.waiting  { color: var(--muted); }
.badge.running  { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.badge.running::before { animation: blink 1.2s ease-in-out infinite; animation-play-state: var(--play); }
.badge.done     { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); }
.badge.error    { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 42%, transparent); background: var(--danger-soft); }
.badge.cancelled{ color: var(--faint); border-color: var(--line-2); }
.badge.accent   { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 42%, transparent); background: var(--accent-soft); }
.badge.plain::before { display: none; }
.badge.plain { padding: 4px 11px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: var(--r-xs);
  background: var(--chip);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.chip .k { color: var(--faint); }
.chip .v { font-family: var(--font-mono); color: var(--text); font-weight: 600; }
.chip.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }

.kbd {
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--faint);
  box-shadow: 0 0 8px currentColor;
}
.dot-live.ok { background: var(--ok); box-shadow: 0 0 9px var(--ok); }
.dot-live.warn { background: var(--warn); box-shadow: 0 0 9px var(--warn); animation: blink 1.6s ease-in-out infinite; animation-play-state: var(--play); }
.dot-live.bad { background: var(--danger); box-shadow: 0 0 9px var(--danger); }

/* ---------------------------------------------------------- status strip -- */
.status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(168px, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.status-cell { background: var(--surface-2); padding: 15px 17px; min-width: 0; }
.status-cell .l {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint-2);
}
/* Cells that must stay on one line opt in with `.truncate`; the rest wrap, so a
   long status like "модель загружается" is never clipped on a narrow screen. */
.status-cell .v {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  min-width: 0;
}
.status-cell .v.truncate { display: block; }

/* ---------------------------------------------------------------- tabs --- */
.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  margin-bottom: 20px;
  border-radius: var(--r-md);
  background: var(--chip);
  border: 1px solid var(--line);
  flex-wrap: wrap;
  max-width: 100%;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-xs);
  cursor: pointer;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
  user-select: none;
}
.tab:hover { color: var(--text); background: var(--chip-hover); }
.tab.active { color: var(--accent-ink); background: var(--accent); box-shadow: 0 6px 18px var(--accent-glow); }
.tab.active:hover { color: var(--accent-ink); background: var(--accent); }
.tab svg { opacity: .9; }

/* segmented view switch (preview / markdown) */
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-xs);
  background: var(--chip);
  border: 1px solid var(--line);
}
.segmented button {
  background: transparent;
  border: none;
  color: var(--muted-2);
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 7px;
  box-shadow: none;
}
.segmented button:hover { background: var(--chip-hover); color: var(--text); transform: none; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------------------- tables -- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.card.flush .table-wrap { border: none; border-radius: 0; background: transparent; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint-2);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hair);
  color: var(--muted-2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody td:first-child { color: var(--text); font-weight: 600; }
tbody td.num { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
tbody tr { transition: background .15s ease; }
tbody tr:hover td { background: var(--chip); }
table tr.clickable { cursor: pointer; }
table tr.clickable:hover td { background: var(--accent-soft); }
td .cell-main { color: var(--text); font-weight: 600; }
td .cell-sub { color: var(--faint); font-size: 11.5px; margin-top: 2px; font-family: var(--font-mono); }
td.actions { text-align: right; white-space: nowrap; }

.table-empty {
  padding: 34px 20px !important;
  text-align: center;
  color: var(--faint) !important;
  font-weight: 500 !important;
  font-size: 13.5px;
}
.table-empty .ico { display: block; margin: 0 auto 10px; color: var(--faint-2); }

/* -------------------------------------------------------------- progress -- */
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.progress .bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-2));
  transition: width .4s cubic-bezier(.3, .9, .4, 1);
}
.progress.indeterminate .bar {
  width: 100% !important;
  background-image: repeating-linear-gradient(115deg, var(--accent) 0 12px, var(--accent-deep) 12px 24px);
  background-size: 34px 100%;
  animation: barFlow .9s linear infinite;
  animation-play-state: var(--play);
  opacity: .75;
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.meter .fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width .4s ease;
}
.meter.hot .fill { background: linear-gradient(90deg, var(--warn), var(--danger)); }

/* --------------------------------------------------------------- device -- */
.device-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.device {
  position: relative;
  display: block;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--chip);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
  color: var(--text);
}
.device:hover { border-color: var(--line-2); background: var(--chip-hover); transform: translateY(-2px); }
.device input { position: absolute; opacity: 0; width: 0; height: 0; }
.device.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 12px 32px var(--accent-glow); }
.device.active-device::after {
  content: "загружена";
  position: absolute;
  top: -9px;
  right: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.device-head { display: flex; align-items: center; gap: 11px; }
.device-radio {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  display: grid;
  place-items: center;
  transition: border-color .18s ease;
}
.device-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform .18s cubic-bezier(.3, .9, .4, 1);
}
.device.selected .device-radio { border-color: var(--accent); }
.device.selected .device-radio::after { transform: scale(1); }
.device-name {
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  flex: none;
}
.device-body { margin-top: 13px; }
.device-mem {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  margin-bottom: 7px;
}
.device-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
}
.device-specs span {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

/* ---------------------------------------------------------------- stats -- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(158px, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.stat { background: var(--surface-2); padding: 22px 20px; }
.stat .v {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.05;
  color: var(--text);
}
.stat .l { font-size: 13px; color: var(--faint); margin-top: 8px; }
.stat.accent .v { color: var(--accent); }

/* -------------------------------------------------------------- preview -- */
.preview {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px 24px;
  max-height: 620px;
  overflow: auto;
  line-height: 1.65;
  font-size: 14.5px;
  color: var(--muted-2);
}
.preview > *:first-child { margin-top: 0; }
.preview h1, .preview h2, .preview h3, .preview h4 {
  color: var(--text);
  margin: 1.4em 0 .5em;
  letter-spacing: -.015em;
  line-height: 1.25;
}
.preview h1 { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.preview h2 { font-size: 20px; font-weight: 700; }
.preview h3 { font-size: 17px; font-weight: 700; }
.preview p { margin: 0 0 1em; }
.preview strong { color: var(--text); }
.preview ul, .preview ol { padding-left: 22px; }
.preview li { margin-bottom: .35em; }
.preview blockquote {
  margin: 1em 0;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}
.preview hr { border: none; border-top: 1px solid var(--line); margin: 1.6em 0; }
.preview img { max-width: 100%; border-radius: var(--r-xs); }
.preview table {
  font-size: 13px;
  margin: 1em 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  overflow: hidden;
}
.preview th {
  position: static;
  background: var(--chip);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12.5px;
  letter-spacing: normal;
  text-transform: none;
  font-weight: 700;
  padding: 9px 12px;
}
.preview td { padding: 9px 12px; color: var(--muted-2); }
.preview tbody td:first-child { font-weight: 500; }
.preview pre {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: var(--r-xs);
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
}
.preview code {
  font-family: var(--font-mono);
  background: var(--chip);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--accent);
}
.preview pre code { background: transparent; padding: 0; color: var(--muted-2); }
.preview.raw {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 46px 20px;
  text-align: center;
  color: var(--faint);
  font-size: 13.5px;
}
.placeholder .ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--chip);
  color: var(--faint-2);
}
.placeholder.busy .ico { background: var(--accent-soft); color: var(--accent); }

.skeleton {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--chip) 8%, var(--chip-hover) 18%, var(--chip) 33%);
  background-size: 800px 100%;
  animation: shimmer 1.5s linear infinite;
  animation-play-state: var(--play);
  height: 12px;
}

/* --------------------------------------------------------------- alerts -- */
.error-box {
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 42%, transparent);
  border-left-width: 3px;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--r-xs);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.note-box {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-left-width: 3px;
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--r-xs);
  font-size: 13.5px;
  line-height: 1.55;
}

.muted { color: var(--faint); font-size: 13px; }

/* --------------------------------------------------------------- toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 40px));
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  padding: 13px 18px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s cubic-bezier(.3, .9, .4, 1);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
@media (max-width: 620px) { .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; } }

/* --------------------------------------------------------------- modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(6, 6, 8, .62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: riseIn .2s ease both;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  width: min(980px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-body { padding: 20px 22px; overflow: auto; flex: 1; }
.modal-body .preview { max-height: none; border: none; background: transparent; padding: 0; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.modal-close {
  background: transparent;
  color: var(--faint);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex: none;
}
.modal-close:hover { color: var(--text); background: var(--chip); transform: none; }
@media (max-width: 620px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .modal-foot > * { flex: 1; }
}

/* --------------------------------------------------------------- footer -- */
.site-foot {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--hair);
  background: var(--bg-2);
}
.site-foot-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 26px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--faint-2);
}
.site-foot-inner .links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot-inner .links a { color: var(--faint); }
.site-foot-inner .links a:hover { color: var(--text); }
.site-foot-inner .mono { font-family: var(--font-mono); font-size: 11.5px; }

/* ------------------------------------------------------------------ misc -- */
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }

/* login screen */
.auth-shell {
  min-height: calc(100vh - 210px);
  display: grid;
  place-items: center;
  padding: 40px 0;
}
.auth-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 34px 30px;
  box-shadow: var(--shadow-md);
  animation: riseIn .35s ease both;
}
.auth-card .auth-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: var(--r-md);
  background: radial-gradient(circle at 50% 130%, #C2470A, #161318);
  color: #fff;
}
.auth-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px;
}
.auth-card .auth-sub { text-align: center; color: var(--faint); font-size: 13.5px; margin-bottom: 24px; }

/* ============================================================================
   LANDING — главная страница
   Structure mirrors the speech2text sibling site: hero with a signature visual,
   feature grid, three steps, an API block and a closing call to action. Built
   on the tokens above, so both pages stay one product.
   ========================================================================== */
.wrap { max-width: var(--shell); margin: 0 auto; padding: 0 22px; position: relative; z-index: 1; }

.section { padding: clamp(56px, 8vw, 110px) 0; position: relative; }
.section.band {
  background: var(--chip);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.hide-sm { display: inline-flex; }
@media (max-width: 860px) { .hide-sm { display: none; } }

/* ------------------------------------------------------------------ hero -- */
.hero {
  position: relative;
  padding: clamp(44px, 7vw, 96px) 0 clamp(24px, 3vw, 44px);
  overflow: hidden;
}
.hero .ambient { position: absolute; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(32px, 5vw, 60px);
  align-items: center;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5.4vw, 66px);
  line-height: 1.04;
  letter-spacing: -.024em;
  margin: 20px 0 0;
}
.lead {
  color: var(--muted);
  font-size: clamp(15.5px, 1.5vw, 18px);
  line-height: 1.62;
  margin: 20px 0 0;
  max-width: 560px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-note {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--faint);
  margin: 22px 0 0;
}

/* Signature visual: a scanned page turning into markdown. */
.live-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: riseIn .5s ease both;
}
.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.live-src { font-size: 11.5px; color: var(--faint); }
.live-body {
  display: grid;
  grid-template-columns: 1fr auto 1.3fr;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
}
@media (max-width: 560px) {
  .live-body { grid-template-columns: 1fr; }
  .live-arrow { transform: rotate(90deg); justify-self: center; }
}

/* The "page": grey text bars with an accent line sweeping down them. */
.scan-page {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 14px 12px;
  overflow: hidden;
  min-height: 158px;
}
.scan-page i {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--line-2);
  margin-bottom: 8px;
}
.scan-page i.gap { background: transparent; }
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 26px;
  background: linear-gradient(180deg, transparent, var(--accent-soft) 45%, var(--accent) 50%, var(--accent-soft) 55%, transparent);
  animation: scanSweep 3.4s ease-in-out infinite;
  animation-play-state: var(--play);
  pointer-events: none;
}
@keyframes scanSweep {
  0%, 100% { transform: translateY(-26px); opacity: 0; }
  12%, 88% { opacity: 1; }
  50% { transform: translateY(158px); }
}

.live-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.md-out {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 12px 13px;
  overflow: auto;
}
.md-out pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--muted-2);
  white-space: pre;
}
.md-out .tk-h { color: var(--accent); font-weight: 700; }
.md-out .tk-t { color: var(--muted); }
.md-out .tk-b { color: var(--text); font-weight: 700; }

/* -------------------------------------------------------- section heads -- */
.sec-head { max-width: 640px; margin-bottom: 44px; }
.sec-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.08;
  letter-spacing: -.022em;
  margin: 14px 0 0;
}
.sec-head p {
  color: var(--muted);
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.6;
  margin: 14px 0 0;
}
.sec-head .btn { margin-top: 24px; }

/* ---------------------------------------------------------- feature grid -- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
  gap: 16px;
}
.card.feature {
  margin: 0;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  transition: border-color .2s ease, transform .2s ease;
}
.card.feature:hover { border-color: var(--accent); transform: translateY(-3px); }
.card.feature h3 { font-size: 18.5px; font-weight: 700; margin: 0; }
.card.feature p { color: var(--muted-2); font-size: 14.5px; line-height: 1.6; margin: 0; }
.f-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

/* ----------------------------------------------------------------- steps -- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px;
}
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 26px;
}
.step .s-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--accent);
  margin-bottom: 14px;
}
.step h3 { font-size: 18.5px; font-weight: 700; margin: 0 0 10px; }
.step p { color: var(--muted-2); font-size: 14.5px; line-height: 1.6; margin: 0; }
.s-formats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.s-formats span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--faint);
}

/* ------------------------------------------------------------------- api -- */
.api-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(28px, 4vw, 52px);
  align-items: center;
}
@media (max-width: 900px) { .api-grid { grid-template-columns: 1fr; } }

.code-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11.5px;
  color: var(--faint);
}
.code-card pre {
  margin: 0;
  padding: 18px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted-2);
}
.code-card .tk-cmd { color: var(--accent); font-weight: 700; }
.code-card .tk-flag { color: var(--text); }
.code-card .tk-str { color: var(--ok); }
.code-card .tk-mut { color: var(--faint-2); }

/* ------------------------------------------------------------- final cta -- */
.cta-card {
  position: relative;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: linear-gradient(140deg, var(--card-a), var(--card-b));
  padding: clamp(36px, 6vw, 72px) clamp(22px, 4vw, 56px);
  overflow: hidden;
  text-align: center;
}
.cta-card .ambient { position: absolute; }
.cta-inner { position: relative; z-index: 1; }
.cta-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 44px);
  line-height: 1.06;
  letter-spacing: -.022em;
}
.cta-card p {
  color: var(--muted);
  font-size: clamp(15px, 1.4vw, 17.5px);
  line-height: 1.6;
  margin: 16px auto 0;
  max-width: 520px;
}
