/* =========================================================================
   BOOST design system — "signal paper"
   warm neutral surfaces · deep pine accent · editorial serif + precise UI
   ========================================================================= */

:root {
  /* surfaces */
  --paper: #f5f3ee;
  --paper-2: #eeece5;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1b1c1a;
  --ink-2: #2f312d;

  /* type */
  --muted: #6d6c65;
  --faint: #9b988e;

  /* hairlines */
  --line: #e3dfd6;
  --line-strong: #d2cdc1;
  --line-soft: #efede7;

  /* accent — deep pine */
  --accent: #1c5b46;
  --accent-strong: #144534;
  --accent-soft: #e8f0eb;
  --accent-line: rgba(28, 91, 70, 0.22);

  /* status */
  --pass: #2f7d5b;
  --pass-soft: #e7f2ec;
  --pass-line: #cfe4d8;
  --warn: #9a6a17;
  --warn-soft: #f8f0dd;
  --warn-line: #ecdcbd;
  --fail: #a83c2c;
  --fail-soft: #fae8e4;
  --fail-line: #efcdc6;

  /* geometry */
  --radius: 9px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(27, 28, 26, 0.04), 0 12px 32px -24px rgba(27, 28, 26, 0.35);
  --shadow-pop: 0 18px 48px -28px rgba(27, 28, 26, 0.45);

  /* type stacks */
  --sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", "JetBrains Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;

  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(28, 91, 70, 0.16); }

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

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 32px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.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;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 17px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #f7f5ef; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); text-decoration: none; }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); background: var(--surface); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); background: var(--paper-2); text-decoration: none; }
.btn-danger { background: transparent; border-color: var(--fail-line); color: var(--fail); }
.btn-danger:hover { background: var(--fail-soft); text-decoration: none; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 243, 238, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 13px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--accent);
  color: #f5f3ee;
}
.brand-mark svg { width: 13px; height: 13px; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  position: relative;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- hero */
.hero { padding: 76px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(680px 340px at 82% 6%, rgba(28, 91, 70, 0.07), transparent 68%),
    linear-gradient(180deg, #f8f6f1 0%, var(--paper) 68%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 100%;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px);
  background-size: 100% 64px;
  opacity: .45;
  mask-image: linear-gradient(180deg, #000, transparent 72%);
  pointer-events: none;
}
.hero > .container {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 64px;
  align-items: center;
}
.hero-inner { max-width: 560px; text-align: left; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent); }
.eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--pass); }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 4.6vw, 62px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.03;
  margin-bottom: 22px;
  color: var(--ink);
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  letter-spacing: -0.04em;
}
.lede { color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 500px; }
.hero-cta { display: flex; gap: 10px; justify-content: flex-start; margin-top: 30px; flex-wrap: wrap; }
.hero-note {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------- preview */
.preview {
  position: relative;
  margin-top: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.preview::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #7aa892);
  z-index: 2;
}
.preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.win-dots { display: flex; gap: 5px; }
.win-dots i { width: 8px; height: 8px; border-radius: 50%; background: #d9d4c9; display: block; }
.win-dots i:nth-child(1) { background: #d8b3ab; }
.win-dots i:nth-child(2) { background: #ddcba8; }
.win-dots i:nth-child(3) { background: #b7cfbe; }
.preview-url {
  flex: 1;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 4px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sample-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--warn);
  border: 1px solid var(--warn-line);
  background: var(--warn-soft);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.preview-body { padding: 16px; background: var(--surface); }
.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 12px;
}
.pv-stat { background: var(--surface-2); padding: 11px 13px; }
.pv-stat .k { font-family: var(--mono); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); }
.pv-stat .v { font-size: 20px; font-weight: 650; margin-top: 2px; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.pv-stat .v.pass { color: var(--pass); }
.pv-stat .v.blocked { color: var(--warn); }
.pv-stat .v.fail { color: var(--fail); }
.pv-stat .s { font-family: var(--mono); font-size: 9.5px; color: var(--faint); }
.pv-main { display: grid; grid-template-columns: 1.65fr 1fr; gap: 12px; }
.pv-panel { border: 1px solid var(--line-soft); background: var(--surface); border-radius: 7px; overflow: hidden; }
.pv-panel-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
  background: var(--surface-2);
}
.pv-rows { padding: 2px 0; }
.pv-row {
  display: grid;
  grid-template-columns: 76px 1fr 46px 56px;
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}
.pv-row:last-child { border-bottom: 0; }
.pv-row .u { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.pv-row .t { text-align: right; color: var(--faint); }
.pv-chart { padding: 12px 12px 14px; height: 168px; display: flex; align-items: flex-end; }
.pv-bars { display: flex; align-items: flex-end; gap: 4px; width: 100%; height: 100%; }
.pv-bars i {
  flex: 1; display: block; border-radius: 2px 2px 0 0; min-height: 3px;
  background: linear-gradient(180deg, #2f7d5b, #b9d6c7);
}

/* ---------------------------------------------------------------- sections */
.section { padding: 84px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 660px; margin-bottom: 38px; }
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
}
.section-head p { color: var(--muted); font-size: 15px; line-height: 1.7; }
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-tag::before { content: ""; width: 22px; height: 1px; background: currentColor; }

/* features — a hairline ledger, not floating cards */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.feature {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 24px 22px 26px;
  transition: background .18s ease;
}
.feature:hover { background: rgba(255, 255, 255, .55); }
.feature-icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
  border: 1px solid var(--accent-line);
}
.feature-icon svg { width: 16px; height: 16px; }
.feature h3 { font-size: 14.5px; margin-bottom: 7px; letter-spacing: -0.01em; }
.feature p { color: var(--muted); font-size: 13px; line-height: 1.6; }

/* steps — editorial timeline */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.step { border-top: 1px solid var(--line-strong); padding-top: 20px; position: relative; }
.step .n {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.step h3 { font-size: 15px; margin-bottom: 7px; }
.step p { color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ---------------------------------------------------------------- pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.plan {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.plan.featured {
  border-color: var(--ink);
  background: var(--ink);
  color: #f5f3ee;
  box-shadow: var(--shadow-pop);
}
.plan-flag {
  position: absolute; top: -10px; left: 28px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  background: var(--accent); color: #f5f3ee; padding: 3px 9px; border-radius: 4px;
}
.plan.featured .plan-flag { background: #e9e5dc; color: var(--ink); }
.plan h3 { font-size: 15px; letter-spacing: .01em; }
.plan .blurb { color: var(--muted); font-size: 13px; min-height: 40px; line-height: 1.6; }
.plan.featured .blurb { color: rgba(245, 243, 238, .66); }
.plan-price { display: flex; align-items: baseline; gap: 7px; }
.plan-price .amount { font-family: var(--serif); font-size: 42px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.plan-price .per { color: var(--faint); font-family: var(--mono); font-size: 10.5px; }
.plan.featured .plan-price .per { color: rgba(245, 243, 238, .5); }
.plan-list { display: flex; flex-direction: column; gap: 9px; border-top: 1px solid var(--line-soft); padding-top: 16px; flex: 1; }
.plan-list li { display: flex; gap: 9px; font-size: 13px; color: var(--muted); }
.plan-list svg { width: 14px; height: 14px; color: var(--pass); flex: 0 0 auto; margin-top: 3px; }
.plan.featured .plan-list { border-top-color: rgba(245, 243, 238, .14); }
.plan.featured .plan-list li { color: rgba(245, 243, 238, .72); }
.plan.featured .plan-list svg { color: #8fceb0; }
.plan.featured .btn-primary { background: #f5f3ee; color: var(--ink); border-color: #f5f3ee; }
.plan.featured .btn-primary:hover { background: #e7e2d6; border-color: #e7e2d6; }
.plan.featured .btn-outline { background: transparent; border-color: rgba(245, 243, 238, .28); color: #f5f3ee; }
.plan.featured .btn-outline:hover { border-color: rgba(245, 243, 238, .6); }
.config-note {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  line-height: 1.7;
}

/* ---------------------------------------------------------------- faq */
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-width: 880px; }
.faq-item { border-bottom: 1px solid var(--line); background: transparent; }
.faq-item summary {
  cursor: pointer;
  padding: 17px 4px;
  font-weight: 600;
  font-size: 14.5px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  transition: color .15s;
}
.faq-item summary:hover { color: var(--accent); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--mono); color: var(--faint); font-size: 17px; font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 40px 18px 4px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }

/* ---------------------------------------------------------------- cta band */
.cta-band {
  border: 1px solid var(--ink);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(620px 260px at 12% 0%, rgba(47, 125, 91, .28), transparent 66%),
    var(--ink);
  color: #f5f3ee;
  padding: 40px 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.cta-band h2 { font-family: var(--serif); font-weight: 500; font-size: 27px; letter-spacing: -0.03em; margin-bottom: 7px; }
.cta-band p { color: rgba(245, 243, 238, .64); font-size: 14px; }
.cta-band .btn-primary { background: #f5f3ee; color: var(--ink); border-color: #f5f3ee; }
.cta-band .btn-primary:hover { background: #e7e2d6; border-color: #e7e2d6; }
.cta-band .btn-outline { background: transparent; border-color: rgba(245, 243, 238, .28); color: #f5f3ee; }
.cta-band .btn-outline:hover { border-color: rgba(245, 243, 238, .62); }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); padding: 52px 0 28px; margin-top: 0; background: var(--paper-2); }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand p { color: var(--muted); font-size: 13px; margin-top: 14px; max-width: 290px; line-height: 1.7; }
.footer-col h4 {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 13px;
  font-weight: 600;
}
.footer-col a { display: block; color: var(--muted); font-size: 13px; padding: 3.5px 0; }
.footer-col a:hover { color: var(--ink); text-decoration: none; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 38px; padding-top: 20px;
  font-family: var(--mono); font-size: 10.5px; color: var(--faint);
}
.status-line { display: inline-flex; align-items: center; gap: 7px; }
.status-line .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pass); }

/* ---------------------------------------------------------------- auth */
.auth-wrap {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
  padding: 56px 20px;
  position: relative;
  background:
    radial-gradient(600px 320px at 50% 0%, rgba(28, 91, 70, 0.07), transparent 70%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-pop);
}
.auth-card h1 { font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -0.03em; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; line-height: 1.6; }
.auth-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }
.demo-box {
  margin-top: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.8;
  background: var(--surface-2);
}
.demo-box b { color: var(--ink); font-weight: 500; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.input, .select, textarea.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13.5px;
  padding: 9px 11px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus, textarea.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(28, 91, 70, .12);
}
.input[aria-invalid="true"] { border-color: var(--fail); }
textarea.input { min-height: 120px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236d6c65' stroke-width='2' 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;
  padding-right: 32px;
  cursor: pointer;
}
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.checkbox { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.checkbox input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- alerts */
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-left-width: 2px;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 16px;
  background: var(--surface);
  line-height: 1.6;
}
.alert svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; }
.alert-ok { border-left-color: var(--pass); color: var(--ink-2); background: var(--pass-soft); border-color: var(--pass-line); }
.alert-ok svg { color: var(--pass); }
.alert-warn { border-left-color: var(--warn); color: var(--ink-2); background: var(--warn-soft); border-color: var(--warn-line); }
.alert-warn svg { color: var(--warn); }
.alert-err { border-left-color: var(--fail); color: var(--ink-2); background: var(--fail-soft); border-color: var(--fail-line); }
.alert-err svg { color: var(--fail); }
.alert-key { border-left-color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.alert key { font-family: var(--mono); }

/* ---------------------------------------------------------------- app shell */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: var(--paper); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 20px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 0; }
.side-brand .brand { font-size: 12.5px; }
.side-nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.side-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint); padding: 15px 10px 6px;
}
.side-label:first-child { padding-top: 4px; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  transition: background .15s, color .15s;
}
.side-link svg { width: 15px; height: 15px; opacity: .8; }
.side-link:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.side-link.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.side-link.active svg { opacity: 1; }
.side-link .count {
  margin-left: auto; font-family: var(--mono); font-size: 9.5px;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px;
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.plan-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: var(--paper-2);
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
}
.plan-chip b { display: block; color: var(--ink); font-size: 12px; letter-spacing: .01em; margin-bottom: 2px; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 12px 6px 0; border-top: 1px solid var(--line-soft); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-strong);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  border: 1px solid var(--accent-line);
  flex: 0 0 auto;
}
.side-user .who { min-width: 0; }
.side-user .who b { display: block; font-size: 12px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who span { font-size: 10px; color: var(--faint); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  background: rgba(245, 243, 238, 0.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-title { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.topbar-title .crumb { color: var(--faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.env-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 10px; background: var(--surface);
}
.env-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--pass); }
.env-pill.paused .dot { background: var(--warn); }
.user-menu { position: relative; }
.user-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px;
  padding: 3px 9px 3px 3px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); font-size: 12px; background: var(--surface);
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { border-color: var(--line-strong); color: var(--ink); }
.user-menu .menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 210px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 6px; box-shadow: var(--shadow-pop); z-index: 50;
}
.user-menu .menu a, .user-menu .menu button {
  display: flex; width: 100%; align-items: center; gap: 8px;
  padding: 8px 10px; border: 0; background: transparent; color: var(--muted);
  font-size: 12.5px; border-radius: 4px; cursor: pointer; text-align: left;
}
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.content { padding: 26px 28px 40px; max-width: 1440px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; letter-spacing: -0.025em; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-head > form { flex-wrap: nowrap; }
.page-head > form .input { width: auto; min-width: 170px; }

/* ---------------------------------------------------------------- cards */
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(27, 28, 26, 0.025);
}
.card.featured { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
}
.card-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.card-title svg { width: 14px; height: 14px; color: var(--faint); }
.card-sub { font-size: 10.5px; color: var(--faint); font-family: var(--mono); }
.card-body { padding: 18px; }
.card-body.tight { padding: 13px; }
.card-foot { padding: 11px 18px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.grid-2 > *, .grid-3 > *, .grid-dash > * { min-width: 0; }

/* stats — a single hairline strip that always fills its row */
.stats {
  display: flex;
  flex-wrap: nowrap;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.stat {
  flex: 1 1 0;
  min-width: 0;
  background: var(--surface);
  padding: 15px 16px;
  position: relative;
  overflow: hidden;
}
.stat-k { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.stat-v { font-size: 25px; font-weight: 600; letter-spacing: -0.03em; margin-top: 3px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-s { font-size: 10.5px; color: var(--faint); font-family: var(--mono); }
.stat.pass .stat-v { color: var(--pass); }
.stat.blocked .stat-v { color: var(--warn); }
.stat.fail .stat-v { color: var(--fail); }
.stat.queued .stat-v { color: var(--accent); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface-2);
  position: sticky;
  top: 0;
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
  color: var(--ink-2);
  vertical-align: middle;
}
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .trunc { max-width: 320px; }
.table a.row-link { color: var(--ink); }
.table a.row-link:hover { color: var(--accent); }
.table svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; color: var(--pass); }
.mono-cell { font-family: var(--mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* pills + badges */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .07em;
  padding: 3px 7px; border-radius: 4px; border: 1px solid transparent;
  text-transform: uppercase; font-weight: 500; line-height: 1.4;
}
.pill::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.pill-PASS { color: var(--pass); background: var(--pass-soft); border-color: var(--pass-line); }
.pill-WEAK { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.pill-BLOCKED { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.pill-FAIL { color: var(--fail); background: var(--fail-soft); border-color: var(--fail-line); }
.pill-neutral { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.pill-queued, .pill-running { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.pill-done { color: var(--pass); background: var(--pass-soft); border-color: var(--pass-line); }
.pill-failed, .pill-cancelled, .pill-paused { color: var(--muted); background: var(--surface-2); border-color: var(--line); }

.badge {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--faint);
  background: var(--surface-2); line-height: 1.4;
}
.badge-sample { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.badge-live { color: var(--pass); border-color: var(--pass-line); background: var(--pass-soft); }

.empty { text-align: center; padding: 44px 20px; color: var(--faint); }
.empty svg { width: 22px; height: 22px; margin: 0 auto 10px; color: var(--line-strong); }
.empty b { display: block; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.empty p { font-size: 12.5px; }
.empty .btn { margin-top: 14px; }

/* ---------------------------------------------------------------- filters */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.filters form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; }
.filters .input, .filters .select { height: 32px; padding: 0 10px; font-size: 12px; }
.filters .select { padding-right: 30px; }
.filters .search { flex: 1 1 200px; min-width: 160px; }
.chip-row { display: inline-flex; gap: 2px; padding: 2px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; }
.chip {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 4px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .12s, color .12s;
}
.chip:hover { color: var(--ink); }
.chip.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(27,28,26,.08); }
.chip.active.pass { color: var(--pass); }
.chip.active.blocked { color: var(--warn); }
.chip.active.weak { color: var(--warn); }
.chip.active.fail { color: var(--fail); }

.pagination { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.pagination .meta { margin-right: auto; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

/* ---------------------------------------------------------------- charts */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 158px; padding: 8px 2px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; position: relative; }
.chart .col span { display: block; border-radius: 1.5px; }
.chart .s-PASS { background: var(--pass); opacity: .9; }
.chart .s-BLOCKED { background: var(--warn); opacity: .85; }
.chart .s-FAIL { background: var(--fail); opacity: .85; }
.chart .col:hover span { filter: brightness(1.08); }
.chart-x { display: flex; gap: 6px; margin-top: 8px; border-top: 1px solid var(--line-soft); padding-top: 7px; }
.chart-x i { flex: 1; font-style: normal; font-family: var(--mono); font-size: 8px; color: var(--faint); text-align: center; overflow: hidden; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--mono); font-size: 9.5px; color: var(--faint); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; display: block; }
.legend .l-pass { background: var(--pass); }
.legend .l-blocked { background: var(--warn); }
.legend .l-fail { background: var(--fail); }

.progress { height: 5px; background: var(--paper-2); border-radius: 999px; overflow: hidden; display: flex; }
.progress i { display: block; height: 100%; }
.progress .p-pass { background: var(--pass); }
.progress .p-blocked { background: var(--warn); }
.progress .p-fail { background: var(--fail); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--faint); font-family: var(--mono); font-size: 10.5px; }
.kv .v { color: var(--ink-2); text-align: right; overflow-wrap: anywhere; }

.rate-row { display: flex; align-items: baseline; gap: 12px; }
.rate-big { font-size: 42px; font-weight: 650; letter-spacing: -0.045em; line-height: 1; color: var(--pass); font-variant-numeric: tabular-nums; }
.rate-sub { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

/* ---------------------------------------------------------------- job progress */
.job-progress { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.job-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.job-progress-target { font-size: 11.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-progress-target:hover { color: var(--accent); text-decoration: none; }
.job-progress-meta { display: inline-flex; align-items: center; gap: 10px; font-size: 10.5px; color: var(--faint); flex: 0 0 auto; }
.job-progress-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 10px; color: var(--faint); }
.job-progress-foot form { margin: 0; }

.pool-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.pool-chip {
  font-size: 10px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface-2); padding: 3px 7px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------------------------------------------------------- misc */
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.keybox {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 11.5px; color: var(--accent-strong);
  overflow-x: auto;
}
.code {
  font-family: var(--mono); font-size: 11.5px; color: #e9e5dc;
  background: #1b1c1a; border: 1px solid #2c2e2a;
  border-radius: var(--radius-sm); padding: 14px 15px;
  overflow-x: auto; white-space: pre; line-height: 1.75;
}
.code .c { color: #8b8a82; }
.code .k { color: #9fd0b6; }
.code .s { color: #d8b98a; }
.steps-mini { counter-reset: mini; display: flex; flex-direction: column; gap: 11px; }
.steps-mini li { display: flex; gap: 11px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.steps-mini .n {
  flex: 0 0 auto; width: 21px; height: 21px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 9.5px; color: var(--faint); margin-top: 2px;
}
.toast-stack { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast {
  background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm); padding: 11px 15px; font-size: 13px; color: var(--ink);
  box-shadow: var(--shadow-pop); animation: toast-in .18s ease-out; max-width: 360px;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.skeleton { position: relative; overflow: hidden; background: var(--paper-2); border-radius: 4px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sk-row { height: 12px; margin: 10px 0; }

/* slot geometry detail row inside audit tables */
.slot-detail { background: var(--surface-2); padding: 12px 16px; }

/* ---------------------------------------------------------------- docs / legal */
.doc-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 44px; align-items: start; }
.doc-nav { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--line); }
.doc-nav a { color: var(--muted); font-size: 13px; padding: 7px 12px; border-left: 1px solid transparent; margin-left: -1px; }
.doc-nav a:hover, .doc-nav a.active { color: var(--accent); border-left-color: var(--accent); text-decoration: none; }
.doc-body h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: -0.03em; margin: 36px 0 12px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { font-size: 15px; margin: 24px 0 8px; }
.doc-body p { color: var(--muted); margin-bottom: 13px; line-height: 1.7; }
.doc-body ul { display: flex; flex-direction: column; gap: 7px; margin: 0 0 15px; }
.doc-body ul li { color: var(--muted); padding-left: 18px; position: relative; font-size: 14px; line-height: 1.6; }
.doc-body ul li::before { content: "—"; position: absolute; left: 0; color: var(--faint); }
.legal-body { max-width: 760px; }
.legal-body h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.03em; }
.legal-body h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; letter-spacing: -0.02em; margin: 30px 0 9px; }
.legal-body p { color: var(--muted); margin-bottom: 11px; line-height: 1.7; }
.legal-meta { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-bottom: 26px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .hero > .container { gap: 44px; }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 252px; z-index: 70;
    transform: translateX(-100%); transition: transform .22s ease; height: 100vh;
    box-shadow: none;
  }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(27, 28, 26, .32); }
  .nav-toggle { display: inline-flex; }
  .grid-dash, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .preview-grid { grid-template-columns: repeat(2, 1fr); }
  .pv-main { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: 1fr; gap: 22px; }
  .doc-nav { position: static; flex-direction: row; flex-wrap: wrap; border-left: 0; border-bottom: 1px solid var(--line); }
  .doc-nav a { border-left: 0; border-bottom: 1px solid transparent; margin: 0; }
  .doc-nav a:hover, .doc-nav a.active { border-bottom-color: var(--accent); }
  .hero > .container { grid-template-columns: 1fr; gap: 40px; }
  .hero-inner { max-width: 680px; }
  .preview { max-width: 720px; }
}
@media (max-width: 860px) {
  .nav-links {
    display: none;
    position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 10px 24px 18px; gap: 1px;
    box-shadow: var(--shadow-pop);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 8px; }
  .nav-links a.active::after { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 32px; }
  .hero { padding-top: 54px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
}
@media (max-width: 900px) {
  .stats { flex-wrap: wrap; }
  .stat { flex: 1 1 calc(50% - 1px); }
  .wallet-banner { flex-wrap: wrap; }
  .wallet-banner-progress { flex: 1 1 100%; order: 3; }
  .wallet-hero-grid { grid-template-columns: 1fr; }
  .support-summary { flex-wrap: wrap; }
  .support-stat { flex: 1 1 calc(50% - 1px); }
}
@media (max-width: 620px) {
  .container { padding: 0 20px; }
  .content { padding: 18px 16px 32px; }
  .features, .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-actions .btn-outline { display: none; }
  .topbar { padding: 0 16px; }
  .topbar .env-pill { display: none; }
  .topbar-title { gap: 8px; min-width: 0; }
  .topbar-title > span:first-of-type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-title .crumb { display: none; }
  .page-head h1 { font-size: 19px; }
  .preview-body { padding: 12px; }
  .preview-grid { grid-template-columns: repeat(2, 1fr); }
  .pv-row { grid-template-columns: 64px 1fr 52px; }
  .pv-row .t { display: none; }
  .table td, .table th { padding: 9px 11px; }
  .table { font-size: 12px; }
  .section { padding: 60px 0; }
  .cta-band { padding: 26px; }
  .plan { padding: 24px; }
  .wallet-hero-top { flex-direction: column; align-items: flex-start; gap: 18px; padding: 20px; }
  .wallet-hero-balance { font-size: 36px; }
  .wallet-panel { padding: 18px 20px; }
  .topup-grid { grid-template-columns: repeat(2, 1fr); }
  .topup-custom, .redeem-form { flex-direction: column; align-items: stretch; }
  .topup-custom .btn, .redeem-form .btn { width: 100%; }
  .wallet-banner-actions { width: 100%; }
  .wallet-banner-actions .btn { flex: 1; }
  .activity-grid { grid-template-columns: 1fr; }
  .ticket-message { max-width: 100%; }
}

/* ---------------------------------------------------------------- wallet */
.wallet-banner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--accent-soft), transparent 65%);
}
.wallet-banner-main { flex: 0 0 auto; min-width: 190px; }
.wallet-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; color: var(--accent-strong);
  text-transform: uppercase; letter-spacing: .08em;
}
.wallet-label svg { width: 13px; height: 13px; }
.wallet-balance { font-size: 30px; font-weight: 650; letter-spacing: -0.04em; line-height: 1.1; margin: 4px 0 3px; font-variant-numeric: tabular-nums; }
.wallet-sub, .wallet-progress-foot, .wallet-note { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.wallet-banner-progress { flex: 1 1 auto; min-width: 180px; }
.wallet-progress-head { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-bottom: 7px; }
.wallet-banner-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.wallet-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 14px;
  overflow: hidden;
}
.wallet-hero-top {
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  padding: 22px 24px;
  background: linear-gradient(120deg, var(--accent-soft), var(--paper) 70%);
  border-bottom: 1px solid var(--line);
}
.wallet-hero-balance { font-size: 44px; font-weight: 650; letter-spacing: -0.05em; line-height: 1; margin: 6px 0 5px; font-variant-numeric: tabular-nums; }
.wallet-hero-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.wallet-hero-runway { width: min(360px, 100%); }
.wallet-hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1px; background: var(--line); }
.wallet-panel { padding: 20px 24px; background: var(--surface); }
.topup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 12px; }
.topup-grid form { margin: 0; }
.topup-option {
  width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 10px 11px;
  transition: border-color .15s, background .15s;
}
.topup-option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.topup-option:disabled { opacity: .5; cursor: not-allowed; }
.topup-option b { display: block; font-size: 15px; letter-spacing: -0.02em; color: var(--ink); }
.topup-option span { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--faint); margin-top: 2px; }
.topup-custom { display: flex; align-items: flex-end; gap: 10px; }
.topup-custom .field { flex: 1 1 auto; }
.topup-custom .btn { flex: 0 0 auto; }
.redeem-form { display: flex; align-items: flex-end; gap: 10px; }
.redeem-form .field { flex: 1 1 auto; }
.redeem-form .btn { flex: 0 0 auto; }
.wallet-note { margin-top: 10px; }
.activity-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; }
.wallet-chip { display: block; color: inherit; text-decoration: none; }
.wallet-chip:hover { border-color: var(--accent-line); text-decoration: none; }
.wallet-pill { color: var(--accent-strong); border-color: var(--accent-line); background: var(--accent-soft); text-decoration: none; }
.wallet-pill:hover { text-decoration: none; }
.wallet-pill .dot { background: var(--accent); }
.text-pass { color: var(--pass); }
.text-fail { color: var(--fail); }

/* ---------------------------------------------------------------- support */
.support-summary {
  display: flex; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; margin-bottom: 14px;
}
.support-stat { flex: 1 1 0; background: var(--surface); padding: 14px 16px; }
.support-stat b { display: block; font-size: 22px; letter-spacing: -0.03em; line-height: 1.1; }
.support-stat span { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--faint); margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; }
.support-stat-wide b { font-size: 16px; }
.ticket-thread { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; }
.ticket-message { max-width: 86%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 15px; background: var(--surface-2); }
.ticket-message.user { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent-line); }
.ticket-message.staff { align-self: flex-start; }
.ticket-message-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 7px; font-size: 11px; }
.ticket-message-head b { color: var(--ink); }
.ticket-message-head span { color: var(--faint); font-size: 9.5px; }
.ticket-message-body { font-size: 13px; line-height: 1.65; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- wallet */
.plan-chip { text-decoration: none; display: block; transition: border-color .15s ease, background .15s ease; }
.plan-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); text-decoration: none; }
.wallet-chip .progress { margin-top: 7px; height: 4px; }
.wallet-pill { text-decoration: none; }
.wallet-pill:hover { border-color: var(--accent-line); color: var(--accent-strong); text-decoration: none; }
.wallet-banner {
  display: flex; align-items: center; gap: 28px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  padding: 20px 22px; margin-bottom: 14px;
}
.wallet-banner-main { flex: 0 0 auto; min-width: 190px; }
.wallet-label { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.wallet-label svg { width: 13px; height: 13px; }
.wallet-balance { font-family: var(--serif); font-size: 34px; line-height: 1.05; letter-spacing: -0.03em; margin: 7px 0 4px; }
.wallet-sub { font-size: 11.5px; color: var(--muted); }
.wallet-banner-progress { flex: 1 1 auto; min-width: 180px; }
.wallet-progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.wallet-progress-head .mono { color: var(--faint); }
.wallet-progress-foot { font-size: 10.5px; color: var(--faint); margin-top: 7px; }
.wallet-banner-actions { display: flex; gap: 7px; flex: 0 0 auto; flex-wrap: wrap; }
.wallet-hero {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; margin-bottom: 14px;
}
.wallet-hero-top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 30px;
  padding: 24px 24px 20px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
.wallet-hero-balance { font-family: var(--serif); font-size: 52px; line-height: 1; letter-spacing: -0.045em; margin: 9px 0 6px; }
.wallet-hero-sub { font-size: 12px; color: var(--muted); }
.wallet-hero-runway { flex: 1 1 auto; max-width: 420px; }
.wallet-hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 0; }
.wallet-panel { padding: 20px 24px 22px; }
.wallet-panel + .wallet-panel { border-left: 1px solid var(--line); }
.topup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.topup-grid form { margin: 0; }
.topup-option {
  width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 10px 11px;
  transition: border-color .15s ease, background .15s ease;
}
.topup-option:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.topup-option:disabled { opacity: .55; cursor: not-allowed; }
.topup-option b { display: block; font-size: 16px; letter-spacing: -0.02em; }
.topup-option span { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--faint); margin-top: 2px; }
.topup-custom, .redeem-form { display: flex; align-items: flex-end; gap: 8px; }
.topup-custom .field, .redeem-form .field { flex: 1 1 auto; }
.topup-custom .btn, .redeem-form .btn { flex: 0 0 auto; height: 38px; }
.wallet-note { font-size: 10.5px; color: var(--faint); margin-top: 10px; }
.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.text-pass { color: var(--pass); }
.text-fail { color: var(--fail); }

/* ---------------------------------------------------------------- support */
.support-summary { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.support-stat { flex: 1 1 0; background: var(--surface); padding: 14px 16px; }
.support-stat b { display: block; font-size: 20px; letter-spacing: -0.03em; }
.support-stat span { font-family: var(--mono); font-size: 9.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.support-stat-wide { flex: 1.4 1 0; }
.ticket-thread { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.ticket-message { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 15px; background: var(--surface-2); }
.ticket-message.staff { background: var(--accent-soft); border-color: var(--accent-line); }
.ticket-message-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 7px; }
.ticket-message-head b { font-size: 12px; }
.ticket-message-head .mono { font-size: 10px; color: var(--faint); }
.ticket-message-body { font-size: 13px; line-height: 1.65; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- admin */
.admin-tabs {
  display: flex;
  gap: 2px;
  align-items: center;
  overflow-x: auto;
  padding: 0;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.admin-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  margin-bottom: -1px;
}
.admin-tabs a svg { width: 14px; height: 14px; }
.admin-tabs a:hover { color: var(--ink); text-decoration: none; }
.admin-tabs a.active {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.input-sm, .select.input-sm { height: 32px; padding: 0 10px; font-size: 12px; }
.select.input-sm { padding-right: 30px; }
.admin-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.admin-controls .select { width: auto; min-width: 82px; height: 30px; padding: 0 28px 0 8px; font-size: 11.5px; }
.check-inline {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer;
  background: var(--surface);
}
.check-inline input { accent-color: var(--accent); width: 12px; height: 12px; margin: 0; }
.btn-row form { margin: 0; }
@media (max-width: 720px) {
  .admin-tabs { margin-bottom: 14px; }
  .admin-tabs a { padding: 9px 10px; font-size: 11px; }
  .admin-controls { gap: 4px; }
}

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