/* DNC rating sheet: compact light theme, one dark accent, one icon colour (the text colour), no external files. */
:root {
  --bg: #f5f6f8; --card: #fff; --line: #e3e6eb; --line-soft: #eef0f3;
  --ink: #111827; --muted: #5b6472; --faint: #8a93a1;
  --accent: #111827; --accent-ink: #fff;
  --ok: #067647; --ok-bg: #ecfdf3; --ok-line: #abefc6;
  --warn: #b54708; --warn-bg: #fffaeb; --warn-line: #fedf89;
  --bad: #b42318; --bad-bg: #fef3f2; --bad-line: #fecdca;
  --info: #175cd3; --info-bg: #eff8ff; --info-line: #b2ddff;
  --focus: #2563eb; --radius: 8px; --bar: 48px;
  font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1 { font-size: 17px; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 14px; line-height: 1.3; font-weight: 650; }
h3 { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
a { color: var(--accent); text-underline-offset: 2px; }
small { font-size: 11px; }
.mono { font-family: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.icon { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: 8px; top: -48px; z-index: 50; padding: 8px 12px; background: var(--accent); color: var(--accent-ink); border-radius: 0 0 6px 6px; }
.skip:focus { top: 0; }

/* frame */
.bar { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.bar-in { display: flex; align-items: center; gap: 14px; max-width: 1180px; min-height: var(--bar); margin: 0 auto; padding: 0 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand b { font-size: 13px; }
.brand span { color: var(--muted); font-size: 12px; padding-left: 7px; border-left: 1px solid var(--line); }
.nav { display: flex; gap: 2px; margin-right: auto; overflow-x: auto; }
.nav a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 6px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { background: var(--accent); color: var(--accent-ink); }
.who { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.name { display: inline-flex; align-items: center; gap: 6px; }
.name span { display: flex; flex-direction: column; line-height: 1.15; }
.name small { color: var(--muted); }
.priv { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--ok-line); background: var(--ok-bg); color: var(--ok); border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.priv.soon { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 14px 16px 22px; display: flex; flex-direction: column; gap: 12px; }
.page:focus { outline: none; }
.foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; max-width: 1180px; width: 100%; margin: 0 auto; padding: 8px 16px 14px; color: var(--faint); font-size: 11px; }
.foot .icon { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }

/* blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.card.narrow { max-width: 440px; margin: 6vh auto 0; width: 100%; }
.card.narrow + .card.narrow { margin-top: 0; }
.tbl td.nowrap { white-space: nowrap; }
a.card { color: inherit; text-decoration: none; }
a.card:hover { border-color: #9aa3b0; }
a.card p { color: var(--muted); }
.card > header, .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 550; overflow-wrap: anywhere; }

/* buttons and badges */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #1f2937; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: #c8cdd5; }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: #912018; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.chip.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.chip.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }

/* forms */
form { margin: 0; }
.form { display: grid; gap: 10px; }
.form.cols { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field label, .label { font-weight: 600; font-size: 12px; }
.field .hint { color: var(--muted); font-size: 11px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea { width: 100%; height: 32px; padding: 0 9px; border: 1px solid #c8cdd5; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; }
textarea { height: auto; min-height: 64px; padding: 6px 9px; }
input:hover, select:hover { border-color: #9aa3b0; }
input.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--accent); }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--info-line); border-radius: 6px; background: var(--info-bg); color: #194185; }
.notice.ok { background: var(--ok-bg); border-color: var(--ok-line); color: #074d31; }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); color: #93370d; }
.notice.bad { background: var(--bad-bg); border-color: var(--bad-line); color: #7a271a; }
.notice .icon { margin-top: 1px; }
.legal { max-height: 150px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font-size: 12px; }
.legal p + p { margin-top: 6px; }

/* tables */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { padding: 6px 10px; text-align: left; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafbfc; }
.tbl .num { text-align: right; }
.empty { padding: 22px 14px; text-align: center; color: var(--muted); }

/* a code that is shown once */
.codebox { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1px dashed #9aa3b0; border-radius: var(--radius); background: #fafbfc; }
.codebox output { min-width: 0; font: 600 16px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.06em; overflow-wrap: anywhere; }
.qr { display: inline-block; align-self: center; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.qr svg { display: block; width: 168px; height: 168px; }

/* modal windows: native dialogs, open without scripts and upgraded to modal by app.js */
dialog.modal { width: min(400px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); box-shadow: 0 18px 50px rgba(17, 24, 39, 0.28); }
dialog.modal:not(:modal) { position: fixed; top: 18vh; left: 50%; transform: translateX(-50%); z-index: 60; margin: 0; }
dialog.modal::backdrop { background: rgba(17, 24, 39, 0.5); }
dialog.modal form { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 12px; }
dialog.modal header { display: flex; align-items: center; gap: 8px; }
dialog.modal .mi { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--info-bg); color: var(--info); }
dialog.modal-ok .mi { background: var(--ok-bg); color: var(--ok); }
dialog.modal-warn .mi { background: var(--warn-bg); color: var(--warn); }
dialog.modal-bad .mi { background: var(--bad-bg); color: var(--bad); }
dialog.modal p { color: var(--muted); }
dialog.modal footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
dialog.modal[open] { animation: pop 120ms ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
dialog.modal:not(:modal)[open] { animation: none; }

/* plain error shell used when the layout itself cannot be built */
body.plain { align-items: center; justify-content: center; }
.box { max-width: 420px; margin: 8vh 16px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 720px) {
  .bar-in { gap: 8px; padding: 6px 12px; }
  .brand span, .name small, .priv span:first-of-type { display: none; }
  .nav { order: 3; width: 100%; flex-wrap: wrap; overflow-x: visible; }
  .who { gap: 6px; }
  .page { padding: 10px 12px 18px; }
  .card.narrow { margin-top: 2vh; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
