/* Ryftpoint UI — Plasma palette (royal purple), light + dark.
   Brand tokens (--rp-*) inlined from brand/tokens.css. Dark is the default;
   light applies via prefers-color-scheme (unless the viewer forced dark) and
   via the manual .theme-light / .theme-dark classes the header toggle sets
   on <html>. The semantic aliases below resolve through the brand tokens, so
   they follow whichever theme is active. */
@font-face {
  font-family:"Inter";
  src:url("/static/inter-latin.woff2") format("woff2");
  font-weight:100 900; font-style:normal; font-display:swap;
}
:root {
  /* Plasma brand tokens — dark (default) */
  --rp-bg:#0C0A14; --rp-surface:#181527; --rp-surface-2:#201B33; --rp-border:#2A2440;
  --rp-accent:#6A0DAD; --rp-accent-2:#7C3AED; --rp-accent-bright:#A855F7;
  --rp-text:#ECEAF5; --rp-muted:#A99CC2; --rp-on-accent:#FFFFFF;
  /* Severity — FIXED, never themed by the accent */
  --sev-crit:#E5484D; --sev-high:#F76808; --sev-med:#F5D90A; --sev-low:#30A46C;
  --rp-font:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rp-radius:14px;

  /* Semantic aliases → brand tokens (theme-following) */
  --bg:var(--rp-bg); --card:var(--rp-surface); --ink:var(--rp-text);
  --muted:var(--rp-muted); --line:var(--rp-border);
  --accent:var(--rp-accent); --on-accent:var(--rp-on-accent);
  --ok:var(--sev-low); --warn:var(--sev-high); --bad:var(--sev-crit); --run:var(--rp-accent-2);
  --header-bg:var(--rp-surface); --header-ink:var(--rp-muted);
  --th-bg:var(--rp-surface-2); --th-ink:var(--rp-muted);
  --input-bg:var(--rp-bg); --input-line:var(--rp-border);
  --code-bg:var(--rp-surface-2); --chip-bg:var(--rp-surface-2); --chip-ink:var(--rp-muted);
  --neutral-bg:var(--rp-surface-2); --neutral-ink:var(--rp-muted);
  --ok-bg:color-mix(in srgb, var(--sev-low) 16%, var(--rp-surface));
  --bad-bg:color-mix(in srgb, var(--sev-crit) 16%, var(--rp-surface));
  --warn-bg:color-mix(in srgb, var(--sev-high) 16%, var(--rp-surface));
  --run-bg:color-mix(in srgb, var(--rp-accent-2) 16%, var(--rp-surface));
  --flash-ok-bg:var(--ok-bg); --flash-ok-ink:var(--ok);
  --flash-bad-bg:var(--bad-bg); --flash-bad-ink:var(--bad);
  --pre-bg:var(--rp-surface-2); --pre-ink:var(--rp-text);
}
/* Light — system preference (unless the viewer forced dark) */
@media (prefers-color-scheme: light) {
  :root:not(.theme-dark) {
    --rp-bg:#F4F1FA; --rp-surface:#FFFFFF; --rp-surface-2:#F0EBFA; --rp-border:#E3DAF4;
    --rp-accent:#6A0DAD; --rp-accent-2:#7217C4; --rp-accent-bright:#8B2FE0;
    --rp-text:#1A0E2E; --rp-muted:#6B5B86;
  }
}
/* Manual overrides (toggle sets .theme-light / .theme-dark on <html>) */
.theme-light {
  --rp-bg:#F4F1FA; --rp-surface:#FFFFFF; --rp-surface-2:#F0EBFA; --rp-border:#E3DAF4;
  --rp-accent:#6A0DAD; --rp-accent-2:#7217C4; --rp-accent-bright:#8B2FE0;
  --rp-text:#1A0E2E; --rp-muted:#6B5B86;
}
.theme-dark {
  --rp-bg:#0C0A14; --rp-surface:#181527; --rp-surface-2:#201B33; --rp-border:#2A2440;
  --rp-accent:#6A0DAD; --rp-accent-2:#7C3AED; --rp-accent-bright:#A855F7;
  --rp-text:#ECEAF5; --rp-muted:#A99CC2;
}
* { box-sizing:border-box; }
body { margin:0; font:14px/1.5 var(--rp-font); background:var(--bg); color:var(--ink); }
a { color:var(--accent); text-decoration:none; } a:hover { text-decoration:underline; }
:focus-visible { outline:2px solid var(--rp-accent-bright); outline-offset:2px; }
.top { display:flex; align-items:center; gap:24px; padding:10px 24px; background:var(--header-bg); color:var(--ink); border-bottom:1px solid var(--line); }
.top a { color:var(--header-ink); } .top nav a { margin-right:16px; }
.brand { display:flex; align-items:center; gap:9px; font-weight:800; color:var(--ink) !important; }
.brand:hover { text-decoration:none; }
.brand-mark { width:26px; height:26px; display:block; flex:none; }
.brand-word { text-transform:uppercase; letter-spacing:.12em; font-weight:800; font-size:16px; }
.top .right { margin-left:auto; display:flex; align-items:center; gap:14px; }
.who { font-size:13px; } .who a { margin-left:10px; }
.theme-toggle { background:transparent; border:1px solid var(--line); color:var(--header-ink);
  border-radius:6px; padding:4px 9px; cursor:pointer; font-size:14px; line-height:1; }
.theme-toggle:hover { background:var(--rp-surface-2); }
main { max-width:1280px; margin:0 auto; padding:20px 24px 40px; }
footer { text-align:center; color:var(--muted); font-size:12px; padding:20px; }
h1 { font-size:22px; margin:6px 0 16px; } h2 { font-size:16px; margin:24px 0 10px; }
.head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.actions { display:flex; gap:8px; align-items:center; }
.muted, .sub { color:var(--muted); } .sub { font-size:12px; }
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:12px 14px; }
.card .k { color:var(--muted); font-size:12px; } .card .v { font-size:26px; font-weight:600; } .card .v.warn { color:var(--warn); }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:24px; } @media (max-width:900px){ .grid2{grid-template-columns:1fr;} }
table.t { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.t th, .t td { padding:7px 10px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.t th { background:var(--th-bg); font-weight:600; font-size:12px; color:var(--th-ink); }
.t .n, .n { text-align:right; } .t tr.disabled td { opacity:.5; } td.url { font-family:ui-monospace,monospace; font-size:12px; word-break:break-all; }
.kvt th { width:180px; }
.status, .tag, .pill { display:inline-block; padding:1px 8px; border-radius:10px; font-size:12px; background:var(--chip-bg); color:var(--chip-ink); }
.status.done { background:var(--ok-bg); color:var(--ok); } .status.failed { background:var(--bad-bg); color:var(--bad); }
.status.running { background:var(--run-bg); color:var(--run); } .status.queued, .status.pending { background:var(--warn-bg); color:var(--warn); }
.status.cancelled, .status.skipped { background:var(--neutral-bg); color:var(--neutral-ink); }
.tag.external { background:var(--bad-bg); color:var(--bad); } .tag.internal { background:var(--run-bg); color:var(--run); } .tag.verify { background:var(--warn-bg); color:var(--warn); }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; } .dot.ok { background:var(--ok); } .dot.bad { background:var(--bad); }
.btn, button { background:var(--accent); color:var(--on-accent); border:0; border-radius:6px; padding:7px 14px; font:inherit; cursor:pointer; }
.btn.ghost { background:var(--card); color:var(--accent); border:1px solid var(--accent); } .btn.danger { background:var(--bad); color:#fff; }
form.inline { display:inline-flex; gap:6px; align-items:center; margin:0; }
input, select, textarea { font:inherit; padding:6px 8px; border:1px solid var(--input-line); border-radius:6px; background:var(--input-bg); color:var(--ink); }
.filters { display:flex; gap:8px; margin:0 0 12px; } .bulk { margin:8px 0; display:flex; gap:8px; align-items:center; }
.form fieldset { background:var(--card); border:1px solid var(--line); border-radius:8px; margin:0 0 14px; padding:12px 16px;
  display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:10px 18px; }
.form legend { font-weight:600; padding:0 6px; } .form label { display:flex; flex-direction:column; gap:3px; font-size:13px; }
.form label.check { flex-direction:row; align-items:center; gap:6px; } .form textarea { width:100%; box-sizing:border-box; }
.form label.wide { grid-column:1/-1; }
.hint { grid-column:1/-1; color:var(--muted); font-size:12px; } .checks { grid-column:1/-1; display:flex; gap:14px; flex-wrap:wrap; align-items:center; }
.auth { display:contents; }
.flash { padding:9px 12px; border-radius:6px; margin:0 0 14px; background:var(--flash-ok-bg); color:var(--flash-ok-ink); }
.flash.error { background:var(--flash-bad-bg); color:var(--flash-bad-ink); }
dl.kv { display:grid; grid-template-columns:180px 1fr; gap:6px 14px; background:var(--card); border:1px solid var(--line); border-radius:8px; padding:12px 16px; }
dl.kv dt { color:var(--muted); } dl.kv dd { margin:0; }
code { font-family:ui-monospace,monospace; font-size:12px; background:var(--code-bg); color:var(--ink); padding:1px 4px; border-radius:4px; }
.step { background:var(--card); border:1px solid var(--line); border-radius:8px; margin:0 0 8px; }
.step summary { display:flex; gap:14px; align-items:center; padding:9px 12px; cursor:pointer; flex-wrap:wrap; }
.step .tool { font-weight:600; width:80px; } .step .files a { margin-right:8px; font-size:12px; }
.step pre { margin:0; padding:10px 12px; background:var(--pre-bg); color:var(--pre-ink); max-height:420px; overflow:auto; font-size:12px;
  border-radius:0 0 8px 8px; white-space:pre-wrap; word-break:break-all; }
ul.notes { font-size:13px; color:var(--muted); }

/* ---- portal-specific widgets (Phase 2a) ---- */
.quota { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:14px 16px; }
.meter { height:12px; border-radius:6px; background:var(--neutral-bg); overflow:hidden; margin:8px 0 6px; }
.meter > span { display:block; height:100%; background:var(--accent); }
.meter > span.warn { background:var(--warn); } .meter > span.bad { background:var(--bad); }
.steps { counter-reset:step; display:grid; gap:10px; margin:0 0 16px; padding:0; list-style:none; }
.steps li { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:12px 14px 12px 48px; position:relative; }
.steps li::before { counter-increment:step; content:counter(step); position:absolute; left:12px; top:12px;
  width:24px; height:24px; border-radius:50%; background:var(--accent); color:var(--on-accent);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; }
.faq details { background:var(--card); border:1px solid var(--line); border-radius:8px; margin:0 0 8px; padding:0 14px; }
.faq summary { cursor:pointer; padding:11px 0; font-weight:600; }
.faq details[open] summary { border-bottom:1px solid var(--line); margin-bottom:8px; }
.faq p { margin:0 0 11px; color:var(--muted); }
.verify-box { background:var(--code-bg); border:1px solid var(--line); border-radius:8px; padding:12px 14px; margin:10px 0; }
.verify-box code { background:var(--card); display:inline-block; padding:4px 8px; margin:2px 0; word-break:break-all; }
.sevbar { display:flex; height:22px; border-radius:6px; overflow:hidden; border:1px solid var(--line); }
.sevbar > span { display:flex; align-items:center; justify-content:center; color:#fff; font-size:11px; min-width:24px; }
.sev-crit{background:var(--sev-crit);} .sev-high{background:var(--sev-high);}
.sev-med{background:var(--sev-med); color:#1A0E2E;} .sev-low{background:var(--sev-low);}
.sev-info{background:var(--rp-muted);}
.plan-pill { font-weight:600; }
.lede { font-size:15px; color:var(--muted); max-width:70ch; }
.loginwrap { max-width:380px; margin:8vh auto 0; }
.loginwrap .card { padding:22px 24px; }
.loginwrap h1 { text-align:center; }
.loginwrap label { display:block; margin:0 0 12px; }
.loginwrap input { width:100%; }
.qrcode { text-align:center; margin:12px 0; } .qrcode svg, .qrcode img { max-width:200px; }
