/* ==========================================================================
   BoS Files — design system
   Hand-rolled. No framework. Dark-first, light supported.
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* neutral ramp (cool) */
  --n-0:  #07090c;
  --n-1:  #0b0e13;
  --n-2:  #11151b;
  --n-3:  #161b22;
  --n-4:  #1d232c;
  --n-5:  #262d38;
  --n-6:  #333c49;
  --n-7:  #4b5563;
  --n-8:  #6b7686;
  --n-9:  #99a3b2;
  --n-10: #c6ccd6;
  --n-11: #e7eaf0;
  --n-12: #f7f8fa;

  --bg:          var(--n-1);
  --bg-sunken:   var(--n-0);
  --surface:     var(--n-2);
  --surface-2:   var(--n-3);
  --surface-3:   var(--n-4);
  --line:        #222a34;
  --line-strong: #2e3742;

  --text:        var(--n-11);
  --text-dim:    var(--n-9);
  --text-mute:   var(--n-8);

  /* accent — cyan, used sparingly */
  --accent:        #22d3ee;
  --accent-hover:  #4de3f5;
  --accent-press:  #0fb9d4;
  --accent-fg:     #04222a;
  --accent-soft:   rgba(34, 211, 238, .12);
  --accent-line:   rgba(34, 211, 238, .32);
  --accent-text:   #5fe0f5;

  --ok:        #34d399;
  --ok-soft:   rgba(52, 211, 153, .12);
  --ok-line:   rgba(52, 211, 153, .30);
  --warn:      #fbbf24;
  --warn-soft: rgba(251, 191, 36, .12);
  --warn-line: rgba(251, 191, 36, .30);
  --bad:       #f87171;
  --bad-soft:  rgba(248, 113, 113, .12);
  --bad-line:  rgba(248, 113, 113, .30);
  --info:      #60a5fa;
  --info-soft: rgba(96, 165, 250, .12);
  --info-line: rgba(96, 165, 250, .30);

  --r-xs: 5px;
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(0,0,0,.35);
  --sh-2: 0 4px 12px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.25);
  --sh-3: 0 18px 48px rgba(0,0,0,.55), 0 4px 12px rgba(0,0,0,.35);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
          Consolas, "Liberation Mono", monospace;

  --nav-h: 60px;
  --wrap: 1160px;
  --wrap-narrow: 760px;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg:          #ffffff;
  --bg-sunken:   #f6f7f9;
  --surface:     #ffffff;
  --surface-2:   #f7f8fa;
  --surface-3:   #eef0f4;
  --line:        #e4e7ec;
  --line-strong: #d3d8e0;

  --text:        #10151c;
  --text-dim:    #59626f;
  --text-mute:   #7b8593;

  --accent:        #0e93ad;
  --accent-hover:  #0a7f97;
  --accent-press:  #086d82;
  --accent-fg:     #ffffff;
  --accent-soft:   rgba(14, 147, 173, .09);
  --accent-line:   rgba(14, 147, 173, .28);
  --accent-text:   #0b7d94;

  --ok:        #0f9d68;
  --ok-soft:   rgba(15, 157, 104, .10);
  --ok-line:   rgba(15, 157, 104, .26);
  --warn:      #b7791f;
  --warn-soft: rgba(183, 121, 31, .10);
  --warn-line: rgba(183, 121, 31, .26);
  --bad:       #d92d20;
  --bad-soft:  rgba(217, 45, 32, .09);
  --bad-line:  rgba(217, 45, 32, .26);
  --info:      #1d6fd8;
  --info-soft: rgba(29, 111, 216, .09);
  --info-line: rgba(29, 111, 216, .26);

  --sh-1: 0 1px 2px rgba(16,21,28,.06);
  --sh-2: 0 2px 8px rgba(16,21,28,.07), 0 1px 2px rgba(16,21,28,.05);
  --sh-3: 0 20px 48px rgba(16,21,28,.16), 0 4px 12px rgba(16,21,28,.08);
}

/* --- 2. Reset ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.22; letter-spacing: -.018em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
code, pre, kbd, samp { font-family: var(--mono); font-size: .9em; }
table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--accent-soft); color: var(--text); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--n-7); }

/* --- 3. Layout ----------------------------------------------------------- */

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.wrap-narrow { width: 100%; max-width: var(--wrap-narrow); margin-inline: auto; padding-inline: 24px; }
.main { flex: 1 0 auto; }

.section { padding-block: 72px; }
.section-sm { padding-block: 48px; }
.section-tight { padding-block: 40px; }

.stack { display: flex; flex-direction: column; }
.stack-2 { gap: 8px; }  .stack-3 { gap: 12px; } .stack-4 { gap: 16px; }
.stack-5 { gap: 20px; } .stack-6 { gap: 24px; } .stack-8 { gap: 32px; }
.stack-10 { gap: 40px; } .stack-12 { gap: 48px; }

.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }

/* two equal columns for marketing rows — collapses on tablet */
.grid-split {
  display: grid; gap: 48px; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.grid-split-wide { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grid-split-narrow { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }

/* content + fixed-width sidebar */
.grid-aside {
  display: grid; gap: 28px; align-items: start;
  grid-template-columns: minmax(0, 1fr) var(--aside, 300px);
}

@media (max-width: 980px) {
  .grid-aside { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .grid-split, .grid-split-wide, .grid-split-narrow {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4, .grid-auto { grid-template-columns: minmax(0, 1fr); }
  /* compact numeric tiles stay two-up — one per row wastes the screen */
  .grid.stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .section { padding-block: 48px; }
  .wrap, .wrap-narrow { padding-inline: 18px; }
}

/* --- 4. Type helpers ----------------------------------------------------- */

.t-display {
  font-size: clamp(2.1rem, 1.35rem + 3.1vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.032em;
  font-weight: 660;
}
.t-h1 { font-size: clamp(1.65rem, 1.25rem + 1.6vw, 2.25rem); letter-spacing: -.026em; }
.t-h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); letter-spacing: -.022em; }
.t-h3 { font-size: 1.115rem; }
.t-h4 { font-size: 1rem; }
.t-lead { font-size: clamp(1rem, .95rem + .35vw, 1.155rem); color: var(--text-dim); line-height: 1.62; }
.t-body { font-size: .955rem; color: var(--text-dim); }
.t-sm { font-size: .87rem; }
.t-xs { font-size: .8rem; }
.t-dim { color: var(--text-dim); }
.t-mute { color: var(--text-mute); }
.t-mono { font-family: var(--mono); font-variant-ligatures: none; }
.t-num { font-variant-numeric: tabular-nums; }
.t-center { text-align: center; }
.t-right { text-align: right; }
.t-nowrap { white-space: nowrap; }
.t-accent { color: var(--accent-text); }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-bad { color: var(--bad); }
.t-balance { text-wrap: balance; }
.t-pretty { text-wrap: pretty; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  align-self: flex-start;
  font-size: .755rem; font-weight: 600; letter-spacing: .085em;
  text-transform: uppercase; color: var(--text-mute);
}
.eyebrow::before {
  content: ""; width: 16px; height: 1px; background: var(--line-strong);
}

.prose { color: var(--text-dim); font-size: .955rem; line-height: 1.72; }
.prose h2 { color: var(--text); font-size: 1.24rem; margin-top: 36px; margin-bottom: 10px; letter-spacing: -.02em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { color: var(--text); font-size: 1.02rem; margin-top: 26px; margin-bottom: 8px; }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--text-mute); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

/* --- 5. Icons ------------------------------------------------------------ */

.i {
  width: 20px; height: 20px; flex: none;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
.i-sm { width: 16px; height: 16px; stroke-width: 1.75; }
.i-lg { width: 24px; height: 24px; stroke-width: 1.5; }
.i-xl { width: 32px; height: 32px; stroke-width: 1.4; }

.i-tile {
  width: 40px; height: 40px; border-radius: var(--r-md);
  display: grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--line);
}
.i-tile-accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.i-tile-lg { width: 48px; height: 48px; border-radius: var(--r-lg); }

/* --- 6. Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding-inline: 15px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: .9rem; font-weight: 550; letter-spacing: -.006em;
  white-space: nowrap; text-decoration: none;
  transition: background-color .14s var(--ease), border-color .14s var(--ease),
              color .14s var(--ease), transform .1s var(--ease), opacity .14s;
  user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn[disabled], .btn[aria-disabled="true"] {
  opacity: .5; pointer-events: none;
}
.btn .i { margin-block: -2px; }

.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; font-weight: 600; }
.btn-primary:hover { background: var(--accent-press); color: var(--accent-fg); }

.btn-secondary { background: var(--surface-3); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--n-5); border-color: var(--n-6); color: var(--text); }
:root[data-theme="light"] .btn-secondary:hover { background: var(--surface-3); border-color: var(--n-7); }

.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-outline { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--n-6); color: var(--text); }

.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad-line); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }

.btn-lg { height: 46px; padding-inline: 22px; font-size: .97rem; border-radius: var(--r-md); }
.btn-sm { height: 32px; padding-inline: 11px; font-size: .845rem; gap: 6px; }
.btn-icon { width: 34px; padding: 0; flex: none; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }

.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* link-styled button */
.btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-text); font-size: .9rem; font-weight: 500;
}
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --- 7. Surfaces --------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.card-pad { padding: 22px; }
.card-pad-lg { padding: 28px; }
.card-hover { transition: border-color .18s var(--ease), background-color .18s var(--ease); }
.card-hover:hover { border-color: var(--line-strong); background: var(--surface-2); }

.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { font-size: .975rem; font-weight: 600; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }

.panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
}

.divider { height: 1px; background: var(--line); border: 0; }

/* --- 8. Badges & pills --------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding-inline: 8px;
  border-radius: var(--r-xs);
  font-size: .71rem; font-weight: 600; letter-spacing: .035em; text-transform: uppercase;
  background: var(--surface-3); color: var(--text-dim);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.badge-ok   { background: var(--ok-soft);   color: var(--ok);   border-color: var(--ok-line); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-bad  { background: var(--bad-soft);  color: var(--bad);  border-color: var(--bad-line); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding-inline: 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .8rem; color: var(--text-dim);
  font-family: var(--mono); letter-spacing: -.01em;
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.dot-live { box-shadow: 0 0 0 0 currentColor; animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

/* --- 9. Forms ------------------------------------------------------------ */

.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: .85rem; font-weight: 550; color: var(--text); }
.hint { font-size: .8rem; color: var(--text-mute); line-height: 1.5; }
.hint-bad { color: var(--bad); }

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: .92rem;
  transition: border-color .14s var(--ease), background-color .14s var(--ease), box-shadow .14s var(--ease);
  appearance: none;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-mute); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--n-6); }
:root[data-theme="light"] .input:hover,
:root[data-theme="light"] .select:hover { border-color: var(--n-7); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input[readonly] { color: var(--text-dim); background: var(--surface-3); cursor: default; }
.input[readonly]:focus { border-color: var(--line-strong); box-shadow: none; }

.select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2399a3b2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
  cursor: pointer;
}
.select option { background: var(--surface); color: var(--text); }

.input-code {
  font-family: var(--mono);
  font-size: 1.35rem;
  letter-spacing: .42em;
  text-indent: .42em;
  text-align: center;
  height: 54px;
  font-weight: 500;
}

/* input with leading icon / trailing buttons */
.input-wrap { position: relative; display: flex; align-items: stretch; }
.input-wrap > .input { flex: 1; min-width: 0; }
.input-wrap-icon > .input { padding-left: 38px; }
.input-lead {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-mute); pointer-events: none; display: flex;
}
.input-affix { display: flex; gap: 6px; margin-left: 8px; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input[type="checkbox"] {
  appearance: none; flex: none;
  width: 17px; height: 17px; margin: 2px 0 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-xs);
  background: var(--surface-2);
  transition: background-color .14s var(--ease), border-color .14s var(--ease);
  cursor: pointer;
}
.check input[type="checkbox"]:checked {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
  border-color: var(--accent);
}
:root[data-theme="light"] .check input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.check span { font-size: .9rem; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row .switch-label { font-size: .915rem; font-weight: 500; }
.switch-row .switch-desc { font-size: .82rem; color: var(--text-mute); margin-top: 2px; }

.switch { position: relative; flex: none; width: 38px; height: 22px; }
.switch input {
  appearance: none; position: absolute; inset: 0; margin: 0;
  width: 100%; height: 100%; border-radius: var(--r-pill);
  background: var(--n-6); cursor: pointer;
  transition: background-color .18s var(--ease);
}
:root[data-theme="light"] .switch input { background: var(--n-9); }
.switch input:checked { background: var(--accent); }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; pointer-events: none;
  transition: transform .18s var(--ease-out);
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.switch:has(input:checked)::after { transform: translateX(16px); }

/* --- 10. Alerts / callouts ----------------------------------------------- */

.alert {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--text-mute);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: .89rem; line-height: 1.55;
}
.alert .i { margin-top: 1px; color: var(--text-mute); }
.alert-success, .alert-ok { border-left-color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.alert-success .i, .alert-ok .i { color: var(--ok); }
.alert-danger, .alert-error, .alert-bad { border-left-color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
.alert-danger .i, .alert-error .i, .alert-bad .i { color: var(--bad); }
.alert-warning, .alert-warn { border-left-color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.alert-warning .i, .alert-warn .i { color: var(--warn); }
.alert-info { border-left-color: var(--info); background: var(--info-soft); border-color: var(--info-line); }
.alert-info .i { color: var(--info); }
.alert-close { margin-left: auto; color: var(--text-mute); display: flex; }
.alert-close:hover { color: var(--text); }

.flash-stack { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; }

/* --- 11. Tables ---------------------------------------------------------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { font-size: .9rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table thead th {
  font-size: .755rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-mute); background: var(--surface-2);
  position: sticky; top: 0; white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .12s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: center; font-variant-numeric: tabular-nums; }
.table .col-feature { color: var(--text); font-weight: 500; }
.table col.is-featured, .table td.is-featured, .table th.is-featured { background: var(--accent-soft); }

/* --- 12. Code ------------------------------------------------------------ */

.code {
  position: relative;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.code-title { font-size: .765rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-mute); }
.code pre {
  margin: 0; padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono); font-size: .815rem; line-height: 1.75;
  color: var(--n-10);
  tab-size: 2;
}
:root[data-theme="light"] .code pre { color: #2c3543; }
.code pre .k { color: var(--accent-text); }        /* keyword / method */
.code pre .s { color: #86efac; }                    /* string */
.code pre .c { color: var(--text-mute); font-style: italic; } /* comment */
.code pre .p { color: var(--text-dim); }            /* punctuation */
.code pre .n { color: #fcd34d; }                    /* number / literal */
:root[data-theme="light"] .code pre .s { color: #0a7a45; }
:root[data-theme="light"] .code pre .n { color: #9a6300; }

code.inline {
  padding: 1.5px 5px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-size: .855em;
  color: var(--text);
}

.method {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 54px; height: 21px; padding-inline: 7px;
  border-radius: var(--r-xs);
  font-family: var(--mono); font-size: .715rem; font-weight: 700; letter-spacing: .04em;
}
.method-get    { background: var(--ok-soft);   color: var(--ok);   border: 1px solid var(--ok-line); }
.method-post   { background: var(--info-soft); color: var(--info); border: 1px solid var(--info-line); }
.method-delete { background: var(--bad-soft);  color: var(--bad);  border: 1px solid var(--bad-line); }

/* --- 13. Header ---------------------------------------------------------- */

.hdr {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.hdr-inner { display: flex; align-items: center; gap: 8px; height: 100%; }

.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-name { font-size: 1.005rem; font-weight: 640; letter-spacing: -.028em; }
.brand-name b { font-weight: 640; }
.brand-name span { color: var(--text-mute); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: 14px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding-inline: 10px;
  border-radius: var(--r-sm);
  font-size: .885rem; font-weight: 500;
  color: var(--text-dim);
  transition: color .14s var(--ease), background-color .14s var(--ease);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-link.is-active { color: var(--text); background: var(--surface-3); }
.nav-link .i-sm { opacity: .7; }

.hdr-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: none;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  transition: color .14s var(--ease), background-color .14s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

.burger { display: none; }

/* dropdown */
.dd { position: relative; }
.dd-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding-inline: 9px;
  border-radius: var(--r-sm);
  font-size: .885rem; font-weight: 500; color: var(--text-dim);
  transition: color .14s var(--ease), background-color .14s var(--ease);
}
.dd-toggle:hover, .dd.is-open > .dd-toggle { color: var(--text); background: var(--surface-2); }
.dd-toggle .chev { transition: transform .18s var(--ease); opacity: .6; }
.dd.is-open > .dd-toggle .chev { transform: rotate(180deg); }

.dd-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 70;
  min-width: 190px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); box-shadow: var(--sh-3);
  opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.985);
  transform-origin: top right;
  transition: opacity .15s var(--ease), transform .15s var(--ease-out), visibility .15s;
}
.dd-menu-left { right: auto; left: 0; transform-origin: top left; }
.dd.is-open > .dd-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.dd-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--r-xs);
  font-size: .885rem; color: var(--text-dim); width: 100%;
  text-align: left;
}
.dd-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.dd-item .i-sm { opacity: .75; }
.dd-item.is-active { color: var(--accent-text); }
.dd-item.is-danger { color: var(--bad); }
.dd-item.is-danger:hover { background: var(--bad-soft); color: var(--bad); }
.dd-sep { height: 1px; background: var(--line); margin: 5px 0; }
.dd-head {
  padding: 8px 9px 6px;
  font-size: .74rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-mute);
}
.dd-user { padding: 9px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.dd-user .name { font-size: .9rem; font-weight: 600; color: var(--text); }
.dd-user .mail { font-size: .79rem; color: var(--text-mute); }

.avatar {
  width: 25px; height: 25px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
  border: 1px solid var(--accent-line);
  font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0;
}

/* mobile nav */
.mnav {
  position: fixed; inset: var(--nav-h) 0 0; z-index: 55;
  background: var(--bg);
  padding: 16px 18px 32px;
  overflow-y: auto;
  display: none;
  flex-direction: column; gap: 4px;
}
.mnav.is-open { display: flex; }
.mnav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: var(--r-sm);
  font-size: .96rem; font-weight: 500; color: var(--text-dim);
}
.mnav-link:hover, .mnav-link.is-active { background: var(--surface-2); color: var(--text); text-decoration: none; }
.mnav-sep { height: 1px; background: var(--line); margin: 10px 0; }
.mnav-head { padding: 12px 12px 4px; font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); }

@media (max-width: 1000px) {
  .nav, .hdr-actions .desk-only { display: none; }
  .burger { display: inline-flex; }
}

/* --- 14. Footer ---------------------------------------------------------- */

.ftr {
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  margin-top: auto;
  padding-block: 48px 28px;
}
.ftr-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px 28px;
}
.ftr-col h3 {
  font-size: .755rem; font-weight: 600; letter-spacing: .075em;
  text-transform: uppercase; color: var(--text-mute); margin-bottom: 13px;
}
.ftr-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.ftr-col a { color: var(--text-dim); font-size: .89rem; }
.ftr-col a:hover { color: var(--text); text-decoration: none; }
.ftr-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: .82rem; color: var(--text-mute);
}
@media (max-width: 820px) {
  .ftr-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
}
@media (max-width: 480px) { .ftr-grid { grid-template-columns: 1fr; } }

/* --- 15. Hero / landing -------------------------------------------------- */

.hero { position: relative; padding-block: 88px 72px; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute; inset: -40% -20% auto; height: 780px;
  background:
    radial-gradient(ellipse 42% 48% at 26% 34%, var(--accent-soft), transparent 68%),
    radial-gradient(ellipse 38% 44% at 74% 20%, rgba(96,165,250,.09), transparent 66%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 62% 58% at 50% 34%, #000 8%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 34%, #000 8%, transparent 72%);
  opacity: .5;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: 56px; align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0,1fr); gap: 44px; }
  .hero { padding-block: 56px 48px; }
}

.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  height: 27px; padding: 0 11px 0 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  font-size: .795rem; color: var(--text-dim);
}
.hero-tag b { color: var(--text); font-weight: 600; }

.trust-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: .825rem; color: var(--text-mute); }
.trust-row > span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row .i-sm { color: var(--ok); }

/* product mock shown in hero */
.mock {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  overflow: hidden;
}
.mock-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.mock-dots { display: flex; gap: 5px; }
.mock-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); display: block; }
.mock-url {
  flex: 1; height: 22px; border-radius: var(--r-xs);
  background: var(--bg-sunken); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px; padding-inline: 8px;
  font-family: var(--mono); font-size: .715rem; color: var(--text-mute);
}
.mock-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.mock-drop {
  border: 1px dashed var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex; align-items: center; gap: 13px;
}
.mock-drop .i { color: var(--accent-text); }

.mock-file {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.mock-file .meta { min-width: 0; flex: 1; }
.mock-file .name {
  display: block;
  font-size: .855rem; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mock-file .sub {
  display: block; margin-top: 2px;
  font-size: .755rem; color: var(--text-mute); font-family: var(--mono);
}

/* --- 16. Feature cards --------------------------------------------------- */

.feature {
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color .18s var(--ease), transform .18s var(--ease-out);
}
.feature:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.feature h3 { font-size: .985rem; }
.feature p { font-size: .885rem; color: var(--text-dim); line-height: 1.62; }

.step { display: flex; gap: 15px; }
.step-num {
  flex: none; width: 27px; height: 27px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--line);
  font-family: var(--mono); font-size: .78rem; font-weight: 700; color: var(--accent-text);
}
.step h3 { font-size: .955rem; margin-bottom: 5px; }
.step p { font-size: .88rem; color: var(--text-dim); }

.stat-tile {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.stat-tile .k {
  font-size: .755rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-mute);
  display: flex; align-items: center; gap: 7px; margin-bottom: 9px;
}
.stat-tile .v {
  font-size: 1.75rem; font-weight: 620; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-tile .s { font-size: .805rem; color: var(--text-mute); margin-top: 4px; }

/* format conversion pills */
.fmt-flow { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.fmt {
  display: inline-flex; align-items: center; height: 26px; padding-inline: 10px;
  border-radius: var(--r-sm); background: var(--surface-3); border: 1px solid var(--line);
  font-family: var(--mono); font-size: .755rem; font-weight: 600;
  letter-spacing: .04em; color: var(--text-dim);
}
.fmt-to { color: var(--text-mute); display: flex; }

/* --- 17. Pricing --------------------------------------------------------- */

.price-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .price-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px)  { .price-grid { grid-template-columns: minmax(0,1fr); } }

.plan {
  position: relative;
  display: flex; flex-direction: column;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  height: 100%;
}
.plan-featured {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft), transparent 190px), var(--surface);
}
.plan-flag {
  position: absolute; top: -1px; right: 18px;
  transform: translateY(-50%);
}
.plan-name { font-size: .955rem; font-weight: 600; }
.plan-desc { font-size: .82rem; color: var(--text-mute); margin-top: 3px; }
.plan-price { display: flex; align-items: baseline; gap: 5px; margin: 18px 0 4px; }
.plan-price .amount { font-size: 2.1rem; font-weight: 640; letter-spacing: -.035em; line-height: 1; }
.plan-price .per { font-size: .845rem; color: var(--text-mute); }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 20px 0; flex: 1; }
.plan-features li { display: flex; gap: 9px; align-items: flex-start; font-size: .865rem; color: var(--text-dim); }
.plan-features .i-sm { color: var(--ok); margin-top: 2.5px; }
.plan-features li.off { color: var(--text-mute); }
.plan-features li.off .i-sm { color: var(--text-mute); opacity: .6; }
.plan-meta {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-sm); overflow: hidden; margin-bottom: 18px;
  background: var(--surface-2);
}
.plan-meta div {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
}
.plan-meta div:last-child { border-bottom: 0; }
.plan-meta .k { font-size: .765rem; color: var(--text-mute); }
.plan-meta .v { font-size: .82rem; font-weight: 600; font-family: var(--mono); white-space: nowrap; }

/* --- 18. Tabs ------------------------------------------------------------ */

.tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  align-self: flex-start;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow-x: auto; max-width: 100%;
}
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding-inline: 13px;
  border-radius: var(--r-sm);
  font-size: .875rem; font-weight: 500; color: var(--text-dim);
  white-space: nowrap;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--surface); color: var(--text);
  box-shadow: var(--sh-1);
  border: 1px solid var(--line);
  height: 32px;
}
:root[data-theme="light"] .tab[aria-selected="true"] { background: #fff; }
.tab-panel[hidden] { display: none; }

.tabs-block { display: flex; flex-direction: column; gap: 20px; }

/* segmented sidebar nav (settings) */
.snav { display: flex; flex-direction: column; gap: 2px; }
.snav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-sm);
  font-size: .9rem; font-weight: 500; color: var(--text-dim);
}
.snav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.snav a[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.snav a[aria-selected="true"] .i-sm { color: var(--accent-text); }

/* --- 19. Accordion ------------------------------------------------------- */

.acc { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-item:last-child { border-bottom: 0; }
.acc-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; padding: 16px 18px;
  font-size: .935rem; font-weight: 550; color: var(--text); text-align: left;
  transition: background-color .14s var(--ease);
}
.acc-btn:hover { background: var(--surface-2); }
.acc-btn .chev { color: var(--text-mute); transition: transform .2s var(--ease); flex: none; }
.acc-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.acc-panel { padding: 0 18px 18px; font-size: .9rem; color: var(--text-dim); line-height: 1.7; }
.acc-panel[hidden] { display: none; }
.acc-panel p { margin-bottom: 10px; }
.acc-panel p:last-child { margin-bottom: 0; }
.acc-panel ul, .acc-panel ol { padding-left: 20px; margin-bottom: 10px; }
.acc-panel li { margin-bottom: 5px; }
.acc-panel strong { color: var(--text); }

/* --- 20. Modal ----------------------------------------------------------- */

.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(3, 6, 10, .68);
  backdrop-filter: blur(3px);
  animation: fadeIn .16s var(--ease);
}
.modal-card {
  position: relative;
  width: 100%; max-width: 480px;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  animation: modalIn .22s var(--ease-out);
  overflow: hidden;
}
.modal-lg .modal-card { max-width: 660px; }
.modal-sm .modal-card { max-width: 380px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 18px; border-bottom: 1px solid var(--line); flex: none;
}
.modal-head h2 { font-size: .99rem; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* --- 21. Toast ----------------------------------------------------------- */

#toasts {
  position: fixed; top: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 9px;
  pointer-events: none; max-width: min(400px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-left: 2px solid var(--text-mute);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-3);
  font-size: .885rem; line-height: 1.5;
  pointer-events: auto; cursor: pointer;
  animation: toastIn .26s var(--ease-out);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-out { opacity: 0; transform: translateX(16px); }
.toast .i { flex: none; margin-top: 1px; }
.toast-success { border-left-color: var(--ok); }
.toast-success .i { color: var(--ok); }
.toast-error   { border-left-color: var(--bad); }
.toast-error .i { color: var(--bad); }
.toast-warning { border-left-color: var(--warn); }
.toast-warning .i { color: var(--warn); }
.toast-info    { border-left-color: var(--info); }
.toast-info .i { color: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* --- 22. Progress -------------------------------------------------------- */

.bar {
  height: 6px; border-radius: var(--r-pill);
  background: var(--surface-3); overflow: hidden;
  border: 1px solid var(--line);
}
.bar-fill {
  height: 100%; border-radius: var(--r-pill);
  background: var(--accent);
  transition: width .3s var(--ease);
  width: 0;
}
.bar-fill.is-warn { background: var(--warn); }
.bar-fill.is-bad  { background: var(--bad); }
.bar-lg { height: 8px; }

.spinner {
  width: 17px; height: 17px; flex: none;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-lg { width: 30px; height: 30px; border-width: 2.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

.meter-ring { transform: rotate(-90deg); }
.meter-ring circle { fill: none; stroke-width: 6; }
.meter-ring .track { stroke: var(--surface-3); }
.meter-ring .value { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .5s var(--ease); }

/* --- 23. Dropzone & file rows -------------------------------------------- */

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 11px; text-align: center;
  padding: 38px 22px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.dropzone:hover { border-color: var(--n-6); background: var(--surface-3); }
.dropzone.is-over {
  border-color: var(--accent); background: var(--accent-soft);
}
.dropzone.is-over .dz-icon { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.dz-icon {
  width: 46px; height: 46px; border-radius: var(--r-lg);
  display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--line);
  color: var(--text-dim);
  transition: all .16s var(--ease);
}
.dz-title { font-size: .96rem; font-weight: 550; color: var(--text); }
.dz-sub { font-size: .84rem; color: var(--text-mute); }
.dropzone-sm { padding: 24px 18px; gap: 9px; }

.file-row {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  transition: background-color .12s var(--ease);
}
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: var(--surface-2); }
.file-row[hidden] { display: none; }

.file-ico {
  width: 36px; height: 36px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--line);
  font-family: var(--mono); font-size: .625rem; font-weight: 700;
  letter-spacing: .02em; color: var(--text-dim);
  text-transform: uppercase;
}
.file-ico[data-kind="image"]   { color: #a78bfa; border-color: rgba(167,139,250,.28); background: rgba(167,139,250,.10); }
.file-ico[data-kind="video"]   { color: #f472b6; border-color: rgba(244,114,182,.28); background: rgba(244,114,182,.10); }
.file-ico[data-kind="audio"]   { color: #fbbf24; border-color: var(--warn-line); background: var(--warn-soft); }
.file-ico[data-kind="archive"] { color: #fb923c; border-color: rgba(251,146,60,.28); background: rgba(251,146,60,.10); }
.file-ico[data-kind="doc"]     { color: #60a5fa; border-color: var(--info-line); background: var(--info-soft); }
.file-ico[data-kind="app"]     { color: #34d399; border-color: var(--ok-line); background: var(--ok-soft); }

.file-main { min-width: 0; flex: 1; }
.file-name {
  font-size: .915rem; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .785rem; color: var(--text-mute); margin-top: 2px;
}
.file-meta span { display: inline-flex; align-items: center; gap: 4px; }
.file-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.file-actions { display: flex; align-items: center; gap: 5px; flex: none; }
@media (max-width: 620px) {
  .file-row { flex-wrap: wrap; }
  .file-actions { width: 100%; justify-content: flex-end; }
}

/* upload queue item */
.uq-item { display: flex; flex-direction: column; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.uq-item:last-child { border-bottom: 0; }
.uq-top { display: flex; align-items: center; gap: 10px; }
.uq-name { flex: 1; min-width: 0; font-size: .875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uq-pct { font-size: .78rem; font-family: var(--mono); color: var(--text-mute); font-variant-numeric: tabular-nums; }

/* --- 24. Empty state ----------------------------------------------------- */

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 13px;
  padding: 56px 24px; text-align: center;
}
.empty .i-tile { width: 48px; height: 48px; border-radius: var(--r-lg); color: var(--text-mute); }
.empty h3 { font-size: 1rem; }
.empty p { font-size: .885rem; color: var(--text-mute); max-width: 380px; }

/* --- 25. Auth pages ------------------------------------------------------ */

.auth {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 56px 20px 72px;
  position: relative; overflow: hidden;
}
.auth::before {
  content: "";
  position: absolute; inset: -30% -10% auto; height: 620px;
  background: radial-gradient(ellipse 40% 46% at 50% 30%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 412px;
}
.auth-card-wide { max-width: 460px; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head .i-tile { margin: 0 auto 14px; }
.auth-head h1 { font-size: 1.42rem; letter-spacing: -.026em; }
.auth-head p { font-size: .9rem; color: var(--text-dim); margin-top: 5px; }
.auth-foot { text-align: center; margin-top: 20px; font-size: .875rem; color: var(--text-dim); }
.auth-note {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 16px; font-size: .795rem; color: var(--text-mute);
}
.auth-note .i-sm { color: var(--ok); }

/* --- 26. App shell (dashboard/settings) ---------------------------------- */

.page-head { padding-block: 32px 24px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 1.42rem; letter-spacing: -.026em; }
.page-head p { font-size: .9rem; color: var(--text-dim); margin-top: 4px; }

.app-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .app-grid { grid-template-columns: minmax(0,1fr); gap: 20px; } }

.sticky { position: sticky; top: calc(var(--nav-h) + 20px); }
@media (max-width: 860px) { .sticky { position: static; } }

/* key/value list */
.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv-row:last-child { border-bottom: 0; }
.kv-k { font-size: .865rem; color: var(--text-dim); }
.kv-v { font-size: .885rem; font-weight: 550; font-family: var(--mono); text-align: right; }

/* --- 27. Utilities ------------------------------------------------------- */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; } .mt-10 { margin-top: 40px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.mt-auto { margin-top: auto; }
.w-full { width: 100%; }
.flex-1 { flex: 1; min-width: 0; }
.no-pad { padding: 0 !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.reveal { opacity: 0; transform: translateY(10px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }

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