/* Developer portal design system (FastLane UI/UX pass 16 Nov).
   Tokens, type and components follow the Scan-61 customer portal (portal/ui/portal.css): black page,
   Bebas Neue display type, Montserrat body, rose brand accent, marker blue for good, marker red for bad.
   No green, yellow or amber (customer portal palette rule). Dark is the default; light only when this
   browser picked it with the header switch (localStorage "dp.theme"). Shared by every page. */
:root {
  color-scheme: dark;
  --page: #000; --bar: #000; --panel: #12141a; --panel-2: #171a21; --field: #0b0d11; --soft: rgba(255,255,255,.04);
  --line: rgba(255,255,255,.10); --line-2: rgba(255,255,255,.20); --line-soft: rgba(255,255,255,.06);
  --ink: #fff; --ink-2: rgba(255,255,255,.76); --ink-3: rgba(255,255,255,.60);
  --rose: #bf7474; --rose-2: #e87a7a; --rose-3: #d99e9e; --marker: #a83838; --blue: #10609d;
  --accent: #e87a7a; --link: #e3a9a9; --btn: #a85656; --btn-hover: #bf6464; --btn-ink: #fff;
  --bad: #ef9a9a; --ok: #8cc4ee; --warn: #e3a9a9;
  --ok-line: rgba(16,96,157,.75); --warn-line: rgba(191,116,116,.6); --bad-line: rgba(168,56,56,.75);
  --ok-bg: rgba(16,96,157,.12); --warn-bg: rgba(191,116,116,.10); --bad-bg: rgba(168,56,56,.14);
  --divider: rgba(255,255,255,.25); --skel: rgba(255,255,255,.07); --skel-2: rgba(255,255,255,.13);
  --shadow-card: 0 20px 60px rgba(0,0,0,.45); --shadow-top: 0 18px 48px rgba(0,0,0,.7), 0 10px 64px rgba(191,116,116,.22);
  --glow: 0 0 18px 2px rgba(232,122,122,.22); --glow-2: 0 0 26px 4px rgba(232,122,122,.38);
  --focus: #f2c5c5; --backdrop: rgba(0,1,10,.72);
  --r: 12px; --r-sm: 8px; --top-h: 64px; --max: 1200px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f5f3ef; --bar: #fff; --panel: #fff; --panel-2: #fff; --field: #fff; --soft: rgba(20,22,28,.04);
  --line: rgba(20,22,28,.12); --line-2: rgba(20,22,28,.26); --line-soft: rgba(20,22,28,.07);
  --ink: #15171d; --ink-2: #3c414d; --ink-3: #565b69;
  --rose: #a64f4f; --rose-2: #a8423f; --rose-3: #a64f4f; --marker: #a83838;
  --accent: #a8423f; --link: #9a3f3f; --btn: #a64f4f; --btn-hover: #8f3f3f; --btn-ink: #fff;
  --bad: #a83838; --ok: #10609d; --warn: #a64f4f;
  --ok-line: rgba(16,96,157,.55); --warn-line: rgba(166,79,79,.5); --bad-line: rgba(168,56,56,.6);
  --ok-bg: rgba(16,96,157,.07); --warn-bg: rgba(166,79,79,.07); --bad-bg: rgba(168,56,56,.07);
  --divider: rgba(20,22,28,.14); --skel: rgba(20,22,28,.06); --skel-2: rgba(20,22,28,.12);
  --shadow-card: 0 8px 28px rgba(20,22,28,.07); --shadow-top: 0 6px 24px rgba(20,22,28,.06), 0 10px 40px rgba(191,116,116,.12);
  --glow: 0 4px 14px rgba(166,79,79,.22); --glow-2: 0 6px 20px rgba(166,79,79,.32);
  --focus: #10609d; --backdrop: rgba(20,22,28,.42);
}

/* ── base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--page); -webkit-text-size-adjust: 100%; }
body {
  font: 15px/1.55 'Montserrat', system-ui, sans-serif; color: var(--ink); background: var(--page);
  min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; overflow-wrap: anywhere;
}
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::selection { background: rgba(191,116,116,.35); }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1 { font-family: 'Bebas Neue', Impact, sans-serif; font-weight: 400; letter-spacing: 1.4px; font-size: 2.5rem; line-height: 1.05; margin-bottom: 6px; }
h2 { font-size: 1.08rem; font-weight: 600; margin-bottom: 10px; letter-spacing: .1px; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--btn); color: var(--btn-ink); padding: 8px 14px; border-radius: var(--r-sm); text-decoration: none; font-weight: 600; }
.skip:focus { top: 10px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── top bar ─────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 14px;
  padding: 0 24px; background: var(--bar); box-shadow: var(--shadow-top);
}
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--divider); animation: dp-divider 12s linear infinite; }
@keyframes dp-divider { 0%, 100% { background: var(--divider); } 33% { background: var(--rose); } 66% { background: var(--marker); } }
.logo { display: inline-flex; align-items: baseline; gap: 0; text-decoration: none; color: var(--ink); font-size: 22px; line-height: 1; letter-spacing: -.5px; white-space: nowrap; user-select: none; }
.logo:hover { color: var(--ink); }
.logo .b1 { font-family: 'Bebas Neue', Impact, sans-serif; font-size: 1.15em; letter-spacing: .5px; }
.logo .b2, .logo .b3 { font-family: 'Montserrat', sans-serif; font-weight: 500; letter-spacing: -.3px; color: var(--ink); }
.logo .tag {
  align-self: center; margin-left: 10px; padding: 3px 9px; border: 1px solid var(--warn-line); border-radius: 999px;
  font: 600 10px/1.2 'Montserrat', sans-serif; letter-spacing: .8px; text-transform: uppercase; color: var(--rose-3);
}
.topnav { display: flex; align-items: center; gap: 4px; margin-left: 18px; }
.topnav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .9rem; padding: 7px 12px; border-radius: 999px; }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--ink); background: var(--soft); }
.spacer { flex: 1; }
.theme {
  flex: none; width: 38px; height: 38px; min-height: 0; display: inline-grid; place-items: center; padding: 0; cursor: pointer;
  background: none; border: 1px solid var(--line-2); border-radius: 50%; color: var(--ink-2); box-shadow: none;
  transition: color .15s ease, border-color .15s ease;
}
.theme:hover { color: var(--ink); border-color: var(--rose); background: none; transform: none; box-shadow: none; }
.theme svg { width: 18px; height: 18px; display: block; }
.theme .i-moon, :root[data-theme="light"] .theme .i-sun { display: none; }
:root[data-theme="light"] .theme .i-moon { display: block; }

/* ── buttons ─────────────────────────────── */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; text-decoration: none;
  min-height: 40px; padding: 9px 20px; border: 1px solid transparent; border-radius: 999px;
  background: var(--btn); color: var(--btn-ink); font-weight: 600; font-size: .92rem; letter-spacing: .2px; box-shadow: var(--glow);
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease, color .15s ease, border-color .15s ease;
}
button:hover, .btn:hover { background: var(--btn-hover); color: var(--btn-ink); box-shadow: var(--glow-2); transform: translateY(-1px); }
button:active, .btn:active { transform: none; }
button:disabled, button:disabled:hover { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; background: var(--btn); }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { border-color: var(--rose); color: var(--ink); background: var(--soft); box-shadow: none; }
button.ghost:disabled:hover { background: transparent; }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad-line); box-shadow: none; min-height: 34px; padding: 5px 14px; font-size: .84rem; }
button.danger:hover { background: var(--bad-bg); color: var(--bad); box-shadow: none; }
.btn.sm, button.sm { min-height: 36px; padding: 6px 16px; font-size: .86rem; }
.linkbtn, button.linkbtn { background: none; border: 0; padding: 0; min-height: 0; color: var(--link); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; box-shadow: none; border-radius: 4px; }
.linkbtn:hover { background: none; color: var(--ink); box-shadow: none; transform: none; }
a:has(> button) { display: inline-flex; text-decoration: none; border-radius: 999px; }
a:has(> button):hover > button { background: var(--btn-hover); box-shadow: var(--glow-2); }
a:has(> button.ghost):hover > button { background: var(--soft); border-color: var(--rose); box-shadow: none; }

/* ── form fields ─────────────────────────────── */
label { display: block; font-weight: 600; font-size: .88rem; margin: 14px 0 6px; color: var(--ink); }
input[type=text], input[type=url], input[type=password], input[type=email], select, textarea {
  width: 100%; max-width: 520px; min-height: 44px; padding: 10px 14px; background: var(--field); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--panel-2); color: var(--ink); }
input::placeholder { color: var(--ink-3); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(191,116,116,.2); }
input[type=checkbox] { accent-color: var(--rose); width: 18px; height: 18px; flex: none; cursor: pointer; }
fieldset { border: 0; margin-top: 18px; }
legend { font-size: .88rem; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; font-weight: 400; margin: 6px 0; color: var(--ink-2); cursor: pointer; }
label.check input { margin-top: 2px; }
label:has(> input[type=checkbox]) { display: flex; gap: 10px; align-items: center; font-weight: 400; color: var(--ink-2); }
form.card .row:last-of-type { margin-top: 18px; }

/* ── console shell ─────────────────────────────── */
.shell { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; display: flex; align-items: flex-start; }
.side {
  flex: none; width: 216px; position: sticky; top: var(--top-h); padding: 28px 14px 28px 20px;
  display: flex; flex-direction: column; gap: 3px;
}
.side[hidden] { display: none; }
.side::before { content: 'Console'; display: block; font: 400 13px/1 'Bebas Neue', Impact, sans-serif; letter-spacing: 1.6px; color: var(--ink-3); padding: 0 12px 10px; }
.side a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2);
  text-decoration: none; font-weight: 500; font-size: .93rem; transition: background .15s ease, color .15s ease;
}
.side a:hover { background: var(--soft); color: var(--ink); }
.side a[aria-current="page"] { background: var(--warn-bg); color: var(--ink); box-shadow: inset 3px 0 0 var(--rose); font-weight: 600; }
.side .sep { height: 1px; background: var(--line); margin: 10px 12px; }
main { flex: 1; min-width: 0; padding: 32px 24px 64px; }
main > h1 + .sub { margin-top: 2px; }
.sub { color: var(--ink-2); margin-bottom: 24px; max-width: 720px; }
.hint { color: var(--ink-3); font-size: .86rem; }
.hint:empty { display: none; }
p + p { margin-top: 8px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 22px;
  margin-bottom: 18px; box-shadow: var(--shadow-card);
}
.card > h2:first-child { margin-bottom: 12px; }
.card > h2:not(:first-child) { margin-top: 22px; }
.card > p { color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tiles:empty { display: none; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-card); position: relative; overflow: hidden; }
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--rose); opacity: .7; }
.tile .k { font: 400 14px/1.1 'Bebas Neue', Impact, sans-serif; letter-spacing: 1.2px; color: var(--ink-3); }
.tile .v { font-size: 1.6rem; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile.skel .k, .tile.skel .v { color: transparent; border-radius: 6px; background: linear-gradient(90deg, var(--skel) 0%, var(--skel-2) 50%, var(--skel) 100%); background-size: 200% 100%; animation: dp-shimmer 1.3s ease-in-out infinite; }
.tile.skel .k { width: 60%; height: 12px; }
.tile.skel .v { width: 45%; height: 26px; margin-top: 10px; }
@keyframes dp-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }

/* ── tables ─────────────────────────────── */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card.tablewrap { padding: 6px 22px 10px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font: 400 14px/1.2 'Bebas Neue', Impact, sans-serif; letter-spacing: 1.2px; color: var(--ink-3); padding: 14px 14px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--soft); }
tbody tr:last-child td { border-bottom: 0; }
td[colspan] { color: var(--ink-3); text-align: center; padding: 26px 0; }
.mono, .code, code, pre { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.code {
  display: block; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px;
  font-size: .82rem; line-height: 1.6; overflow-x: auto; white-space: pre; color: var(--ink); max-width: 100%;
}
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--accent); border-color: var(--warn-line); }

/* ── states: status lines, loading, banners ─────────────────────────────── */
.status { min-height: 1.4em; margin-top: 12px; font-size: .88rem; color: var(--ink-2); }
.status:empty { min-height: 0; margin-top: 0; }
.status.err { color: var(--bad); }
.status.err::before { content: '!'; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 8px; border-radius: 50%; background: var(--bad-bg); border: 1px solid var(--bad-line); font-weight: 700; font-size: .75rem; vertical-align: 1px; }
.status.ok { color: var(--ok); }
.status.busy::before, .boot .spin, .spin {
  content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--rose); animation: dp-spin .8s linear infinite;
}
@keyframes dp-spin { to { transform: rotate(360deg); } }
.boot { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 40vh; color: var(--ink-3); font-size: .95rem; }
.boot .spin { width: 22px; height: 22px; border-width: 3px; }
.empty { text-align: center; color: var(--ink-3); padding: 26px 12px; }
.banner { border-left: 4px solid var(--line-2); }
.banner.ok { border-left-color: var(--blue); background: linear-gradient(90deg, var(--ok-bg), transparent 60%), var(--panel); }
.banner.warn { border-left-color: var(--rose); background: linear-gradient(90deg, var(--warn-bg), transparent 60%), var(--panel); }
.banner.err { border-left-color: var(--marker); background: linear-gradient(90deg, var(--bad-bg), transparent 60%), var(--panel); }
.banner strong { display: block; margin-bottom: 4px; font-size: 1rem; }
.banner > a { display: inline-block; margin-top: 10px; font-weight: 600; }
.banner ul { margin: 10px 0 0 20px; color: var(--ink-2); font-size: .88rem; }
.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { font-size: .8rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); }
.steps span.on { color: var(--ink); border-color: var(--rose); }

/* ── first scan guide ─────────────────────────────── */
.guidehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.guidehead h2 { margin: 0; }
.guide ol { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.guide li { display: flex; gap: 14px; min-width: 0; }
.guide li > div { flex: 1; min-width: 0; }
.guide li > div > a { display: inline-block; margin-top: 4px; font-weight: 600; font-size: .9rem; }
.guide .tick { flex: none; width: 26px; height: 26px; margin-top: -1px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; color: var(--ink); font-size: .8rem; font-weight: 700; }
.guide li.done .tick { background: var(--blue); border-color: var(--blue); color: #fff; }
.guide li.done strong { color: var(--ink-2); font-weight: 500; }
.guide .code { margin-top: 10px; }

/* ── sign-in, dialog ─────────────────────────────── */
.center { max-width: 480px; margin: 8vh auto 40px; }
.center.card { padding: 34px 32px; text-align: left; }
.center h1 { font-size: 2.4rem; }
.center .row { margin-top: 20px; }
.center::before {
  content: ''; display: block; width: 54px; height: 54px; margin-bottom: 18px; border-radius: 50%;
  background: radial-gradient(circle, var(--rose-2) 0 5px, transparent 6px), repeating-radial-gradient(circle, transparent 0 9px, var(--line-2) 9px 10px), var(--warn-bg);
  box-shadow: 0 0 0 1px var(--warn-line), var(--glow);
}
dialog {
  margin: auto; width: min(560px, calc(100vw - 32px)); background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(191,116,116,.12);
}
dialog h3 { font-family: 'Bebas Neue', Impact, sans-serif; font-weight: 400; letter-spacing: 1.2px; font-size: 1.8rem; }
dialog .code { margin-top: 14px; white-space: pre-wrap; word-break: break-all; }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }

/* ── footer (every page) ─────────────────────────────── */
.foot { border-top: 1px solid var(--line); margin-top: auto; background: var(--bar); }
.foot .in { max-width: var(--max); margin: 0 auto; padding: 22px 24px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; font-size: .86rem; color: var(--ink-3); }
.foot .brand { font-family: 'Bebas Neue', Impact, sans-serif; letter-spacing: .5px; font-size: 1.15rem; color: var(--ink); margin-right: 6px; }
.foot .brand span { font-family: 'Montserrat', sans-serif; font-size: .82rem; font-weight: 500; letter-spacing: -.2px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot .spacer { flex: 1; }
.foot .note { display: inline-flex; align-items: center; gap: 8px; }
.foot .note::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); }

/* ── phone ─────────────────────────────── */
@media (max-width: 860px) {
  .shell { display: block; }
  .side {
    position: sticky; top: var(--top-h); z-index: 10; width: auto; flex-direction: row; gap: 6px; overflow-x: auto;
    padding: 10px 16px; background: var(--bar); border-bottom: 1px solid var(--line); scrollbar-width: none;
  }
  .side::-webkit-scrollbar { display: none; }
  .side::before { display: none; }
  .side a { white-space: nowrap; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: .88rem; }
  .side a[aria-current="page"] { box-shadow: none; border-color: var(--rose); }
  .side .sep { display: none; }
  main { padding: 22px 16px 48px; }
  h1 { font-size: 2.1rem; }
  .top { padding: 0 16px; gap: 10px; }
  .topnav { display: none; }
  .card { padding: 18px 16px; }
  .card.tablewrap { padding: 4px 16px 8px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 14px; }
  .tile .v { font-size: 1.3rem; }
  .center { margin-top: 24px; }
  .center.card { padding: 26px 20px; }
  .foot .in { padding: 20px 16px 26px; }
  .foot .spacer { display: none; }
  .foot .note { flex-basis: 100%; }
  input[type=text], input[type=url], input[type=password], input[type=email], select, textarea { max-width: none; font-size: 16px; }
  .row > button, .row > a:has(> button) { flex: 1 1 auto; }
  .row > a:has(> button) > button { width: 100%; }
}
@media (max-width: 400px) {
  .logo .tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
