/* v6proxy dashboard — dark only. System fonts: the page loads nothing from
   outside the VPS. */
:root {
  --bg: #0E1116; --nav: #0B0E13; --card: #151A21; --panel: #12161C; --line: #232A33; --line2: #1D232C;
  --field: #0E1116; --field-line: #2B333E; --hover: #1B212A; --chip: #2A3440;
  --text: #E6EAF0; --text2: #D5DBE3; --muted: #AEB7C2; --dim: #8B95A3;
  --accent: #4CC9F0; --accent-hover: #7AD8F4; --accent-bg: #0F2A33; --accent-line: #2A7F96;
  --ok: #3FB950; --ok-text: #7EE2A0; --ok-bg: #0F2418; --ok-line: #1F4D2C;
  --warn: #D29922; --warn-text: #E8C46A; --warn-bg: #2E2410; --warn-line: #5C4716;
  --bad: #F85149; --bad-text: #FFB4AC; --bad-bg: #2D1416; --bad-line: #6E2B2F;
  --cool: #6E5BB0; --excl: #3A1F24; --free: #252C36;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
p { margin: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--dim); }
.small { font-size: 12px; }
.contents { display: contents; }
h1 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 16px; font-weight: 600; }
h3 { margin: 0; font-size: 14px; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; padding: 8px 14px; border-radius: 8px; background: var(--card); border: 1px solid var(--accent); color: var(--text); }
.skip:focus { left: 12px; }

/* ---- shell ---- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
nav.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px 16px; border-right: 1px solid var(--line2); background: var(--nav); display: flex; flex-direction: column; gap: 16px; }
nav.side .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand svg { color: var(--accent); }
nav.side .menu-btn { display: none; }
nav.side .links { flex: 1; display: flex; flex-direction: column; gap: 2px; }
nav.side .links a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--muted); text-decoration: none; }
nav.side .links a:hover { background: var(--hover); color: var(--text); }
nav.side .links a[aria-current="page"] { background: var(--hover); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
nav.side .links a.later { color: var(--dim); }
nav.side .links a.later::after { content: "later"; margin-left: auto; font-size: 11px; border: 1px solid var(--field-line); border-radius: 999px; padding: 0 7px; }
nav.side .foot { margin-top: auto; padding: 14px 4px 0; border-top: 1px solid var(--line2); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--dim); }
main { min-width: 0; width: 100%; max-width: 1320px; padding: 28px 36px 56px; display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  /* Phones: a top bar; the menu opens below it. */
  nav.side { position: sticky; z-index: 10; height: auto; max-height: 100vh; padding: 10px 16px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line2); }
  .brand { padding: 0; }
  nav.side .menu-btn { display: inline-flex; }
  nav.side .links { display: none; padding-bottom: 6px; }
  nav.side.open .links { display: flex; }
  nav.side .foot { margin-top: 8px; }
  main { padding: 20px 16px 40px; gap: 16px; }
  h1 { font-size: 22px; }
  .hide-sm { display: none; }
}

/* ---- page parts ---- */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.head p { margin-top: 4px; color: var(--dim); max-width: 760px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card.flush > .card-head { padding: 18px 20px 12px; }
.card.flush > .card-foot { padding: 12px 20px; border-top: 1px solid var(--line2); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
.card-head > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel.accent { border-color: var(--accent-line); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.top { align-items: flex-start; }
.row.end { justify-content: flex-end; }
.row.tight { gap: 8px; }
.grow { flex: 1 1 320px; min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
.layout-aside { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.layout-aside > aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1000px) { .layout-aside { grid-template-columns: minmax(0, 1fr); } .layout-aside > aside { position: static; } }

.kpis { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .l { font-size: 13px; color: var(--dim); }
.kpi .v { font-family: var(--mono); font-size: 26px; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; }
.kpi .s { font-size: 12px; color: var(--dim); }
@media (max-width: 760px) { .kpis { gap: 10px; } .kpi { padding: 12px 14px; } .kpi .v { font-size: 20px; } }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .v { font-family: var(--mono); font-size: 22px; overflow-wrap: anywhere; }
.stat .v.accent { color: var(--accent); }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.tile .v { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }

/* ---- buttons ---- */
.btn { min-height: 36px; padding: 0 14px; border: 1px solid var(--field-line); border-radius: 8px; background: transparent; color: var(--text); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0B0E13; font-weight: 600; min-height: 40px; padding: 0 18px; }
.btn.primary.sm { min-height: 32px; padding: 0 12px; }
.btn.primary:hover { background: var(--accent-hover); color: #0B0E13; }
.btn.danger { border-color: #5A2A2A; color: var(--bad-text); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.danger-solid { border-color: var(--bad); background: #3A1518; color: #FFDCD7; }
.btn.danger-solid:hover { background: #4A1A1E; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary[disabled] { background: var(--hover); border-color: var(--field-line); color: var(--dim); opacity: 1; }
.btn.wide { width: 100%; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; flex: none; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* ---- forms ---- */
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.inp { min-height: 40px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field); color: var(--text); width: 100%; min-width: 0; }
.inp:hover { border-color: #3A4452; }
.inp::placeholder { color: #6B7480; }
textarea.inp { padding: 10px 12px; min-height: 64px; resize: vertical; }
.inp[aria-invalid="true"] { border-color: var(--bad); }
.inp[readonly] { color: var(--text2); }
.hint { font-size: 12px; color: var(--dim); }
.err { font-size: 12px; color: var(--bad-text); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > .inp { flex: 1; }
.inline > .btn, .btn.tall { min-height: 40px; }
fieldset { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
fieldset.bare { padding: 0; border: 0; background: transparent; }
fieldset[disabled] { opacity: .55; }
legend { padding: 0 6px; margin-left: -6px; font-size: 15px; font-weight: 600; }
@media (max-width: 760px) { .card, fieldset { padding: 16px; } .card.flush > .card-head { padding: 14px 16px 10px; } .card.flush > .card-foot { padding: 10px 16px; } }
label.check { display: flex; gap: 10px; align-items: center; cursor: pointer; }
label.check input { width: 16px; height: 16px; accent-color: var(--accent); }
details > summary { cursor: pointer; color: var(--dim); font-size: 13px; width: fit-content; }
details > summary:hover { color: var(--text); }
details[open] > summary { margin-bottom: 10px; }

.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 3px; gap: 2px; border: 1px solid var(--field-line); border-radius: 9px; background: var(--field); }
.seg button { flex: 1 0 auto; min-height: 32px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500; font-size: 13px; }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--chip); color: var(--text); }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.choice { text-align: left; padding: 12px 14px; border: 1px solid var(--field-line); border-radius: 10px; background: transparent; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.choice:hover { border-color: #3A4452; }
.choice[aria-checked="true"] { border-color: var(--accent); background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--accent); }
.choice b { font-size: 14px; font-weight: 600; }
.choice span { font-size: 12px; color: var(--dim); }
.choice[aria-checked="true"] span { color: var(--muted); }

/* ---- notes, pills, status ---- */
.note { border-radius: 10px; padding: 12px 14px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; border: 1px solid transparent; }
.note.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-text); }
.note.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-text); }
.note.bad b { color: #FFDCD7; }
.note.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.note.info { background: var(--accent-bg); border-color: #18414D; color: var(--text2); }
.note ul { margin: 0; padding-left: 20px; }
.note .muted { color: inherit; opacity: .8; }
.note.bar { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.note.bar > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.flash { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 12px; overflow-wrap: anywhere; }
.flash .btn { color: inherit; margin: -4px -6px -4px 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: var(--chip); color: var(--text2); }
.pill.ok { background: #12291A; color: var(--ok-text); } .pill.warn { background: var(--warn-bg); color: var(--warn-text); }
.pill.bad { background: var(--bad-bg); color: var(--bad-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--dim); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

.health { display: flex; flex-direction: column; gap: 0; }
.health li { align-items: center; justify-content: flex-start; }
.ic { display: flex; flex: none; }
.ic.ok { color: var(--ok); } .ic.warn { color: var(--warn); } .ic.bad { color: var(--bad); }

/* ---- tables and lists ---- */
.tbl-wrap { overflow-x: auto; position: relative; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--dim); padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.tbl td { padding: 10px 16px; border-bottom: 1px solid var(--line2); color: var(--text2); white-space: nowrap; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #171D25; }
.tbl td.wrap { white-space: normal; }
.tbl .num { text-align: right; }
.tbl td.act { text-align: right; }
.tbl .sub { display: block; font-size: 12px; color: var(--dim); font-family: inherit; }
@media (max-width: 760px) { .tbl th, .tbl td { padding-left: 12px; padding-right: 12px; } }
.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.list li:last-child { border-bottom: 0; }
.list .when { color: var(--dim); font-size: 12px; white-space: nowrap; }
.list .what { min-width: 0; overflow-wrap: anywhere; display: flex; gap: 10px; align-items: flex-start; }
.list .what > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.empty { padding: 28px 16px; text-align: center; color: var(--dim); display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* Users of a pool. */
.users { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 10px; }
.users li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 14px; border-bottom: 1px solid var(--line2); }
.users li:last-child { border-bottom: 0; }
.users .who { flex: 0 1 160px; font-family: var(--mono); overflow-wrap: anywhere; }
.users .pw { flex: 1 1 220px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.users .pw > span { font-family: var(--mono); overflow-wrap: anywhere; min-width: 0; }
.users .acts { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.users .acts .inp { width: 240px; max-width: 100%; min-height: 32px; }

/* Copyable lines (proxy URL, curl). */
.cmd { display: flex; flex-direction: column; gap: 6px; }
.cmd .lbl { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
code.block, pre.block { display: block; padding: 10px 12px; border-radius: 8px; background: var(--field); border: 1px solid var(--line2); font-family: var(--mono); font-size: 12px; color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; margin: 0; }

/* Pool picker. */
.pool-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pool-card { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; min-width: 0; }
.pool-card:hover { border-color: #3A4452; color: var(--text); text-decoration: none; }
.pool-card[aria-current="true"] { border-color: var(--accent); background: var(--accent-bg); box-shadow: inset 0 0 0 1px var(--accent); }
.pool-card b { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.pool-card .s { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.pool-card[aria-current="true"] .s { color: var(--accent); }
@media (max-width: 760px) { .pool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .pool-card { padding: 10px 12px; } }

/* Ring slots. */
.strip { display: grid; gap: 2px; grid-template-columns: repeat(64, minmax(0, 1fr)); }
.map { display: grid; gap: 3px; grid-template-columns: repeat(32, minmax(0, 1fr)); }
@media (max-width: 760px) { .strip { grid-template-columns: repeat(32, minmax(0, 1fr)); } .map { gap: 2px; } }
.cell { height: 16px; border-radius: 3px; background: var(--free); }
.strip .cell { height: 18px; border-radius: 2px; }
.cell.leased { background: var(--accent); } .cell.announcing, .cell.draining { background: var(--warn); }
.cell.cooldown { background: var(--cool); } .cell.excluded { background: var(--excl); }
.cell.next { box-shadow: inset 0 0 0 2px var(--text); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.legend .val { font-family: var(--mono); color: var(--text2); }

/* Monitor charts. */
.charts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.chart-card { gap: 8px; padding: 16px 18px; }
.chart { position: relative; min-height: 190px; }
.chart svg { display: block; overflow: visible; }
.chart svg .axis { fill: var(--dim); font-size: 11px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.chart svg rect:focus { outline: none; }
.chart svg rect:focus-visible { outline: 2px solid var(--accent); }
.chart-tip { position: absolute; top: 4px; min-width: 150px; max-width: 240px; padding: 8px 10px; border-radius: 8px; background: #0B0E13; border: 1px solid var(--line); font-size: 12px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; z-index: 2; }
.chart-tip .r { display: flex; align-items: center; gap: 8px; }
.chart-tip i { width: 12px; height: 2px; display: inline-block; flex: none; }

/* Deployment steps 1–5 (System page). */
ol.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
ol.steps li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); }
ol.steps .n { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--chip); font-size: 12px; font-family: var(--mono); }
ol.steps li.done { color: var(--text2); }
ol.steps li.done .n { background: var(--ok-bg); color: var(--ok); }
ol.steps li[aria-current="step"] { border-color: var(--accent); color: var(--text); background: var(--accent-bg); }
ol.steps li[aria-current="step"] .n { background: var(--accent); color: #0B0E13; }

.login { width: min(420px, 100% - 32px); margin: 14vh auto; }
.login .card { gap: 14px; padding: 28px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--dim); padding: 8px 0; }

/* Accounts */
.checks { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.checks label.check { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.checks label.check.off { opacity: .6; }
.stack { display: flex; flex-direction: column; gap: 12px; }
nav.side .foot .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.secret { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--mono); overflow-wrap: anywhere; }
.keyonce { border: 1px solid var(--accent); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.keyonce code { overflow-wrap: anywhere; }
