:root {
  --bg: #0e0f13; --panel: #171920; --panel-2: #1f222b; --line: #2a2e39;
  --text: #eceef3; --muted: #9097a6; --accent: #ffe135; --accent-ink: #1a1a1a;
  --good: #3ddc84; --bad: #ff5d5d; --link: #8fb4ff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--link); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 80px; }
.narrow { max-width: 760px; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.logo { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin: 0; text-decoration: none; color: var(--text); }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nav a.plain { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 6px; }
.nav a.plain:hover { color: var(--text); }

/* basics */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.btn { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 11px 16px; border-radius: 10px;
  cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; display: inline-block; text-align: center; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 7px 10px; font-size: 12.5px; }
.btn.block { display: block; width: 100%; }
.badge { font-size: 12px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.on { color: var(--good); border-color: #2a5a3f; }
.badge.tier { color: var(--accent); border-color: #6a5d1f; }
input[type=text], input[type=email], input[type=password], input[type=url] {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 12px 14px;
  font-size: 15px; outline: none; width: 100%; }
input:focus { border-color: var(--accent); }
select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.err { color: var(--bad); font-size: 14px; min-height: 1em; }
.ok { color: var(--good); }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
h2 { font-size: 17px; margin: 0 0 4px; }
.note { font-size: 12.5px; color: var(--muted); background: var(--panel-2); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.note b { color: var(--text); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

/* segmented toggle */
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 7px 14px; border-radius: 99px; font-weight: 600; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--text); color: var(--bg); }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan .ribbon { position: absolute; top: -11px; left: 22px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.plan h3 { margin: 0; font-size: 18px; }
.plan .tag { color: var(--muted); font-size: 13.5px; min-height: 2.6em; }
.plan .price { font-size: 38px; font-weight: 800; letter-spacing: -1px; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.plan .billed { color: var(--muted); font-size: 12.5px; min-height: 1.2em; }
.plan ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.plan li::before { content: "✓"; color: var(--good); font-weight: 800; margin-right: 8px; }
.plan li.no { color: var(--muted); }
.plan li.no::before { content: "–"; color: var(--muted); }
.plan .cta { margin-top: auto; padding-top: 12px; }
table.compare { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
table.compare th, table.compare td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: center; }
table.compare th:first-child, table.compare td:first-child { text-align: left; color: var(--muted); }
table.compare thead th { color: var(--text); font-size: 15px; }
.table-scroll { overflow-x: auto; }

/* usage meter */
.meter { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.meter > div { height: 100%; background: var(--accent); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal.on { display: flex; }
.modal .card { max-width: 460px; width: 100%; }

/* legal / help pages */
.doc h1 { font-size: 28px; margin: 10px 0 6px; }
.doc h2 { font-size: 19px; margin: 28px 0 8px; }
.doc p, .doc li { color: #cfd3dc; }
.doc .step { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 10px 0; }
.doc .step b.n { display: inline-flex; width: 24px; height: 24px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); align-items: center; justify-content: center; font-size: 13px; margin-right: 8px; }
footer.foot { color: var(--muted); font-size: 13px; text-align: center; margin-top: 50px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
footer.foot a { color: var(--muted); }

/* ---------- dashboard ---------- */
:root { --chart: #ffe135; --ok: #3ddc84; --warn: #ffb547; --fail: #ff6b6b; }
.adm-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.adm-tabs button { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 7px 14px; font-weight: 600; cursor: pointer; font-size: 13px; }
.adm-tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.health-banner { display: flex; gap: 14px; align-items: center; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; border: 1px solid; }
.health-banner.h-ok { border-color: #2a5a3f; background: rgba(61, 220, 132, .08); }
.health-banner.h-warn { border-color: #6a5d1f; background: rgba(255, 181, 71, .08); }
.health-banner.h-fail { border-color: #6a2b2b; background: rgba(255, 107, 107, .1); }
.hicon, .hdot { display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; font-weight: 900; color: #111; }
.hicon { width: 36px; height: 36px; font-size: 18px; } .hdot { width: 20px; height: 20px; font-size: 12px; flex: none; }
.h-ok .hicon, .h-ok .hdot { background: var(--ok); } .h-warn .hicon, .h-warn .hdot { background: var(--warn); } .h-fail .hicon, .h-fail .hdot { background: var(--fail); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.hcard { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid; border-radius: 10px; padding: 10px 12px; }
.hcard.h-ok { border-left-color: var(--ok); } .hcard.h-warn { border-left-color: var(--warn); } .hcard.h-fail { border-left-color: var(--fail); }
.hhead { display: flex; gap: 8px; align-items: center; } .hhead b { flex: 1; font-size: 14px; }
.hlabel { font-size: 11.5px; color: var(--muted); } .hdetail { font-size: 13px; color: var(--muted); margin-top: 6px; }
.hfix { margin-top: 8px; font-size: 13px; } .hfix summary { cursor: pointer; color: var(--link); } .hfix p { margin: 6px 0; }
.linkish { background: none; border: 0; color: var(--link); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.tip { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; border-left: 4px solid var(--line); }
.tip.good { border-left-color: var(--ok); } .tip.warn, .tip.bad { border-left-color: var(--warn); } .tip.bad { border-left-color: var(--fail); } .tip.info { border-left-color: var(--link); }
.tip p { margin: 4px 0 0; font-size: 13px; color: #cfd3dc; }
.chart { margin: 12px 0; } .chart figcaption { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.chart svg { width: 100%; height: auto; display: block; } .chart .tick { fill: var(--muted); font-size: 11px; } .chart .axis { stroke: var(--line); stroke-width: 1; }
.chart rect:hover, .chart circle:hover { opacity: .8; }
.chart-table summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.online { color: var(--ok); }
.thread { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.msg.admin { border-left: 4px solid var(--accent); } .msg.system { background: none; border-style: dashed; font-size: 12.5px; color: var(--muted); }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 4px; } .msg .body { white-space: pre-wrap; font-size: 14px; }
textarea { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; width: 100%; resize: vertical; }
.pill.open, .pill.in_progress { color: var(--accent); border-color: #6a5d1f; } .pill.awaiting_user { color: var(--link); border-color: #2c4470; }
.pill.resolved, .pill.closed { color: var(--good); border-color: #2a5a3f; }
pre.trace { white-space: pre-wrap; font-size: 11.5px; max-height: 240px; overflow: auto; background: var(--bg); padding: 8px; border-radius: 6px; }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 720px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.consent p { margin: 0 0 10px; font-size: 13.5px; } .consent .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- accessibility (WCAG 2.1 AA) ---------- */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { left: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
