/* RV-StreamRelay — shared styling for the marketing site and the creator dashboard.
   Palette: RV Classic theme (renderer/rv-theme.css), copied verbatim. Solid colours only,
   hairline borders, one gold accent used on meaning. No gradients, no glow. */

:root {
  /* warm surface ramp */
  --bg: #0d0b0a;
  --s1: #15110d;
  --s2: #1c1610;
  --s3: #241d14;
  --elev: #2a2117;
  /* gold accent ramp */
  --gold: #e6c068;
  --gold-hover: #f0d089;
  --gold-press: #c8962f;
  --gold-well: #201806;
  --gold-line: #6e5717;
  --ink-on-gold: #1a1410;
  /* warm cream text */
  --ink: #efe7d4;
  --body: #e9e0cd;
  --dim: #9c9384;
  --faint: #7a7161;
  /* gold-tinted hairlines */
  --hair: rgba(230, 192, 104, .10);
  --line: rgba(230, 192, 104, .16);
  --line2: rgba(230, 192, 104, .30);
  /* warning: one colour, one role (near-cap usage, destructive confirms, errors) */
  --warn: #e0594b;
  --warn-line: rgba(224, 89, 75, .35);
  --warn-well: #241210;
  /* type */
  --disp: "Segoe UI Variable Display", "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --text: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, Consolas, "Cascadia Mono", Menlo, monospace;
  --maxw: 1120px;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  background: var(--bg); color: var(--body); font-family: var(--text);
  font-size: 16.5px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--gold); color: var(--ink-on-gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { font-family: var(--disp); color: var(--ink); line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(18px, 4vw, 42px); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold); color: var(--ink-on-gold); padding: 10px 16px; font-weight: 700;
}
.skip:focus { left: 12px; top: 12px; }

/* ── Header bar ─────────────────────────────────────────────────────────── */
header.bar { position: sticky; top: 0; z-index: 50; background: var(--s2); border-bottom: 1px solid var(--line); }
.bar-in { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-family: var(--disp); font-weight: 800; letter-spacing: .1em; font-size: 15px; color: var(--ink); white-space: nowrap; }
.brand .g { color: var(--gold); }
.bar-sub { font-size: 12.5px; color: var(--dim); border-left: 1px solid var(--line2); padding-left: 14px; white-space: nowrap; }
nav.bar-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
nav.bar-nav a { font-size: 14px; color: var(--dim); padding: 7px 11px; border-radius: 7px; }
nav.bar-nav a:hover { color: var(--ink); background: var(--s3); }
.bar-cta { margin-left: 6px; }
@media (max-width: 760px) { .bar-sub { display: none; } }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--disp); font-weight: 700; font-size: 14.5px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-gold { background: var(--gold); color: var(--ink-on-gold); }
.btn-gold:hover { background: var(--gold-hover); }
.btn-gold:active { background: var(--gold-press); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line2); }
.btn-ghost:hover { background: var(--s3); border-color: var(--gold-line); }
.btn-danger { background: transparent; color: var(--warn); border-color: var(--warn-line); }
.btn-danger:hover { background: var(--warn-well); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

.linklike { color: var(--gold); font-weight: 600; }
.linklike:hover { color: var(--gold-hover); text-decoration: underline; text-underline-offset: 3px; }

/* ── Marketing sections ─────────────────────────────────────────────────── */
.site main section { padding: clamp(48px, 8vh, 88px) 0; border-bottom: 1px solid var(--hair); }
.hero { padding-top: clamp(56px, 10vh, 110px); }
.hero h1 { font-size: clamp(38px, 6.4vw, 68px); font-weight: 800; max-width: 16ch; }
.hero h1 .g { color: var(--gold); }
.hero .sub { margin-top: 22px; font-size: clamp(17px, 2.1vw, 20px); max-width: 62ch; }
.hero .sub b { color: var(--ink); font-weight: 700; }
.hero-ctas { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 40px; max-width: 940px; }
.fig { background: var(--s2); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 18px; }
.fig .n { font-family: var(--disp); font-weight: 800; font-size: 24px; color: var(--gold); font-variant-numeric: tabular-nums; }
.fig .l { font-size: 12.5px; color: var(--dim); margin-top: 2px; line-height: 1.4; }

.sec-h { max-width: 70ch; }
.sec-h h2 { font-size: clamp(27px, 4.2vw, 42px); font-weight: 800; }
.sec-h p { margin-top: 14px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 36px; }
.step { background: var(--s2); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.step .num { font-family: var(--disp); font-weight: 800; font-size: 15px; color: var(--gold); }
.step h3 { font-size: 18px; margin-top: 8px; }
.step p { font-size: 14.5px; color: var(--dim); margin-top: 8px; line-height: 1.55; }

figure.diagram { margin-top: 44px; background: var(--s1); border: 1px solid var(--line); border-radius: 14px; padding: clamp(14px, 3vw, 28px); overflow-x: auto; }
figure.diagram svg { display: block; min-width: 640px; width: 100%; height: auto; color: var(--dim); }
figure.diagram figcaption { font-size: 13.5px; color: var(--dim); margin-top: 12px; max-width: 76ch; line-height: 1.55; }
.dg-box { fill: var(--s2); stroke: var(--line2); }
.dg-box-accent { fill: var(--gold-well); stroke: var(--gold-line); }
.dg-title { fill: var(--ink); font-family: var(--disp); font-weight: 700; font-size: 13px; }
.dg-label { fill: var(--dim); font-size: 11.5px; }
.dg-note { fill: var(--dim); font-size: 11.5px; }
.dg-flow { stroke: currentColor; stroke-width: 1.5; fill: none; }
.dg-up { stroke: var(--gold); stroke-width: 2; fill: none; }
.dg-up-label { fill: var(--gold); font-size: 11.5px; font-weight: 600; }

.quality-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; margin-top: 36px; }
.qcard { background: var(--s2); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.qcard h3 { font-size: 17px; }
.qcard p { font-size: 14.5px; color: var(--dim); margin-top: 10px; line-height: 1.6; }
.qcard p b { color: var(--body); font-weight: 600; }

/* ── Pricing ────────────────────────────────────────────────────────────── */
.trial-strip {
  margin-top: 36px; background: var(--s2); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.trial-strip .t-head { font-family: var(--disp); font-weight: 700; color: var(--ink); font-size: 16px; }
.trial-strip .t-desc { font-size: 14px; color: var(--dim); flex: 1 1 320px; line-height: 1.5; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
.tier { background: var(--s2); border: 1px solid var(--line); border-radius: 14px; padding: 24px 22px; display: flex; flex-direction: column; gap: 0; }
.tier.hl { border-color: var(--gold-line); }
.tier h3 { font-size: 20px; }
.tier .price { margin-top: 14px; font-family: var(--disp); }
.tier .price .amt { font-size: 34px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.tier .price .per { font-size: 14px; color: var(--dim); }
.tier .annual { font-size: 13px; color: var(--dim); margin-top: 4px; }
.tier .caps { display: flex; gap: 10px; margin: 18px 0 4px; }
.tier .cap { flex: 1; background: var(--s1); border: 1px solid var(--hair); border-radius: 9px; padding: 10px 12px; }
.tier .cap .n { font-family: var(--disp); font-weight: 800; font-size: 19px; color: var(--gold); font-variant-numeric: tabular-nums; }
.tier .cap .l { font-size: 11.5px; color: var(--dim); margin-top: 1px; line-height: 1.35; }
.tier ul { list-style: none; margin: 14px 0 20px; display: flex; flex-direction: column; gap: 7px; }
.tier li { font-size: 14px; color: var(--body); padding-left: 18px; position: relative; line-height: 1.45; }
.tier li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 2px; background: var(--gold); }
.tier .btn { margin-top: auto; }
.enterprise-row {
  margin-top: 16px; background: var(--s1); border: 1px solid var(--hair); border-radius: 12px;
  padding: 16px 20px; font-size: 14px; color: var(--dim); line-height: 1.6;
}
.enterprise-row b { color: var(--body); }

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq { margin-top: 32px; max-width: 78ch; }
.faq details { border-bottom: 1px solid var(--hair); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 34px 18px 2px; position: relative;
  font-family: var(--disp); font-weight: 700; font-size: 16px; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 8px; top: 14px; color: var(--gold); font-size: 20px; font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq .a { padding: 0 2px 20px; font-size: 14.5px; color: var(--dim); line-height: 1.65; max-width: 72ch; }
.faq .a b { color: var(--body); font-weight: 600; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer.site-foot { padding: 34px 0 44px; }
.foot-in { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 13.5px; color: var(--dim); }
.foot-in a { color: var(--dim); }
.foot-in a:hover { color: var(--ink); }
.foot-spacer { flex: 1; }

/* ── Notices (checkout return, transient status) ────────────────────────── */
.notice {
  background: var(--gold-well); border: 1px solid var(--gold-line); color: var(--body);
  border-radius: 10px; padding: 12px 16px; font-size: 14px; margin: 18px auto 0;
  max-width: var(--maxw); display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.notice.warn { background: var(--warn-well); border-color: var(--warn-line); }

/* ── Dashboard layout ───────────────────────────────────────────────────── */
.dash main { padding: 28px 0 64px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }

.card { background: var(--s2); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.card > h2 { font-size: 16px; font-weight: 700; letter-spacing: 0; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card > h2 .count { font-family: var(--text); font-weight: 400; font-size: 13.5px; color: var(--dim); }
.card-body { margin-top: 16px; }
.card-note { font-size: 13px; color: var(--dim); line-height: 1.55; }

.state-card { max-width: 520px; margin: 8vh auto 0; text-align: center; padding: 40px 30px; }
.state-card h1 { font-size: 24px; }
.state-card p { margin: 14px 0 22px; color: var(--dim); font-size: 15px; }

/* Usage */
.usage-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.usage-big .used { font-family: var(--disp); font-weight: 800; font-size: clamp(30px, 5vw, 44px); color: var(--ink); font-variant-numeric: tabular-nums; }
.usage-big .of { font-size: 16px; color: var(--dim); }
.usage-big .pct { margin-left: auto; font-family: var(--disp); font-weight: 700; font-size: 18px; color: var(--gold); font-variant-numeric: tabular-nums; }
.usage-big .pct.hot { color: var(--warn); }
.meter { margin-top: 14px; height: 14px; background: var(--s1); border: 1px solid var(--hair); border-radius: 7px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--gold); border-radius: 6px; transition: width .2s; }
.meter > span.hot { background: var(--warn); }
.usage-reset { margin-top: 12px; font-size: 14px; color: var(--dim); }
.usage-reset b { color: var(--body); font-weight: 600; }
.usage-warnline { margin-top: 10px; font-size: 13.5px; color: var(--warn); }

/* Ingest */
.kv { display: flex; flex-direction: column; gap: 12px; }
.kv .row { display: flex; flex-direction: column; gap: 5px; }
.kv .k { font-size: 12.5px; color: var(--dim); font-weight: 600; letter-spacing: .02em; }
.kv .v { display: flex; gap: 8px; align-items: center; }
.kv code, .keybox code {
  font-family: var(--mono); font-size: 13px; color: var(--body);
  background: var(--s1); border: 1px solid var(--hair); border-radius: 7px;
  padding: 8px 11px; flex: 1; overflow-x: auto; white-space: nowrap; scrollbar-width: thin;
}
.key-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.key-once { margin-top: 10px; font-size: 13px; color: var(--warn); line-height: 1.5; }

/* Inline confirm strip (rotate, remove) */
.confirm { margin-top: 12px; background: var(--warn-well); border: 1px solid var(--warn-line); border-radius: 9px; padding: 12px 14px; font-size: 13.5px; color: var(--body); }
.confirm .c-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Destinations */
.dest-list { display: flex; flex-direction: column; }
.dest { display: flex; align-items: center; gap: 14px; padding: 13px 2px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
.dest:last-child { border-bottom: 0; }
.dest .d-name { font-family: var(--disp); font-weight: 700; font-size: 14.5px; color: var(--ink); min-width: 120px; }
.dest .d-label { font-size: 13px; color: var(--dim); }
.dest .d-key { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.dest .d-off { font-size: 12px; color: var(--faint); border: 1px solid var(--hair); border-radius: 6px; padding: 1px 7px; }
.dest .d-spacer { flex: 1; }
.dest-msg { font-size: 13px; color: var(--warn); padding: 6px 2px 10px; }

/* Toggle switch (checkbox-based, keyboard native) */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 34px; height: 20px; }
.switch .tr { width: 34px; height: 20px; border-radius: 10px; background: var(--s1); border: 1px solid var(--line2); position: relative; transition: background-color .15s, border-color .15s; }
.switch .tr::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--dim); transition: left .15s, background-color .15s; }
.switch input:checked + .tr { background: var(--gold-well); border-color: var(--gold-line); }
.switch input:checked + .tr::after { left: 16px; background: var(--gold); }
.switch input:focus-visible + .tr { outline: 2px solid var(--gold); outline-offset: 2px; }
.switch .sw-l { font-size: 12.5px; color: var(--dim); min-width: 22px; }

/* Add-destination form */
.addform { margin-top: 16px; border-top: 1px solid var(--hair); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; color: var(--dim); font-weight: 600; }
.field input, .field select {
  font: inherit; font-size: 14px; color: var(--body); background: var(--s1);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; width: 100%;
}
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold-line); }
.field .hint { font-size: 12.5px; color: var(--dim); line-height: 1.5; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-err { font-size: 13.5px; color: var(--warn); }
.cap-note { margin-top: 16px; border-top: 1px solid var(--hair); padding-top: 16px; font-size: 14px; color: var(--dim); line-height: 1.6; }
.cap-note b { color: var(--body); }

/* Sessions table */
.tablewrap { overflow-x: auto; }
table.sessions { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
table.sessions th { text-align: left; font-size: 12px; color: var(--dim); font-weight: 600; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.sessions td { padding: 10px; border-bottom: 1px solid var(--hair); color: var(--body); font-variant-numeric: tabular-nums; }
table.sessions td.num, table.sessions th.num { text-align: right; }
table.sessions tr:last-child td { border-bottom: 0; }

/* Plan card */
.plan-tier { font-family: var(--disp); font-weight: 800; font-size: 22px; color: var(--ink); }
.plan-sub { font-size: 13.5px; color: var(--dim); margin-top: 4px; }
.plan-caps { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.plan-caps .cap { background: var(--s1); border: 1px solid var(--hair); border-radius: 9px; padding: 9px 14px; }
.plan-caps .n { font-family: var(--disp); font-weight: 800; font-size: 17px; color: var(--gold); font-variant-numeric: tabular-nums; }
.plan-caps .l { font-size: 11.5px; color: var(--dim); }
.plan-feats { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.plan-feats li { font-size: 13.5px; color: var(--dim); padding-left: 16px; position: relative; line-height: 1.45; }
.plan-feats li::before { content: ""; position: absolute; left: 0; top: 9px; width: 7px; height: 2px; background: var(--gold); }
.plan-actions { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Plans panel (subscribe) */
#plans-panel { margin-top: 16px; }
.buy-row { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.buy-row .btn { flex: 1 1 120px; }
.buy-unavailable { font-size: 12.5px; color: var(--dim); margin-top: 8px; }

/* Loading / error / empty states */
.loading-line { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; padding: 8px 0; }
.spin { width: 14px; height: 14px; border: 2px solid var(--line2); border-top-color: var(--gold); border-radius: 50%; animation: rv-spin .7s linear infinite; }
@keyframes rv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation: none; border-top-color: var(--line2); }
  .meter > span { transition: none; }
  * { scroll-behavior: auto !important; }
}
.error-box { background: var(--warn-well); border: 1px solid var(--warn-line); border-radius: 10px; padding: 14px 16px; font-size: 14px; color: var(--body); }
.error-box .btn { margin-top: 10px; }
.empty { color: var(--dim); font-size: 14px; padding: 8px 0; }
.empty .btn { margin-top: 12px; }

/* Toast (aria-live status) */
#toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--elev); border: 1px solid var(--line2); color: var(--ink);
  padding: 10px 18px; border-radius: 9px; font-size: 14px; z-index: 80;
}
#toast[hidden] { display: none; }

/* Account area in dashboard bar */
.acct { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--dim); }
.acct img { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line2); }
