/* gno.security: plain, readable, light and dark. No web fonts, no images
   but the logo, nothing from another origin. */

:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --fg: #15181d;
  --muted: #525a66;
  --line: #d9dde2;
  --line-strong: #b9c0c8;
  --code-bg: #eef0f2;
  --accent: #0b6b4c;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ea;
  --link: #0b6b4c;
  --ok: #146c43;
  --ok-bg: #e5f3eb;
  --bad: #b3261e;
  --bad-bg: #fcebe9;
  --warn: #875200;
  --warn-bg: #fdf1dc;
  --sev-critical: #b3261e;
  --sev-high: #b5400b;
  --sev-medium: #845400;
  --sev-low: #4b5563;
  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #161b21;
    --fg: #e6e9ed;
    --muted: #a3abb6;
    --line: #2a3139;
    --line-strong: #3d4651;
    --code-bg: #1d232b;
    --accent: #4fc796;
    --accent-ink: #062418;
    --accent-soft: #14342a;
    --link: #6fd6ab;
    --ok: #63d49f;
    --ok-bg: #11301f;
    --bad: #ff8f86;
    --bad-bg: #3b1a17;
    --warn: #f3b860;
    --warn-bg: #2e2412;
    --sev-critical: #ff8f86;
    --sev-high: #ffa56e;
    --sev-medium: #f0c867;
    --sev-low: #b7bfca;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 var(--sans);
  overflow-wrap: break-word;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--code-bg); border-radius: 4px; padding: 0.05em 0.3em; }
pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem 0.9rem; overflow-x: auto; line-height: 1.45; margin: 0.6rem 0; }
pre code { background: none; padding: 0; font-size: 0.86rem; white-space: pre; }
code.hash, .addrline { word-break: break-all; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 2rem; margin: 0.2rem 0 0.6rem; }
h2 { font-size: 1.35rem; margin: 2.4rem 0 0.8rem; padding-top: 0.4rem; }
h3 { font-size: 1.08rem; margin: 1.6rem 0 0.5rem; }
p, ul, ol, dl { margin: 0.6rem 0; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 0.4rem 0.7rem; z-index: 10; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--fg); text-decoration: none; font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; }
.logo .shield { fill: var(--accent); }
.logo .tick { fill: none; stroke: var(--surface); stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.top nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.top nav a { color: var(--fg); text-decoration: none; font-weight: 500; }
.top nav a:hover { text-decoration: underline; }
.wallet { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.me { font-family: var(--mono); font-size: 0.85rem; }

.notice { background: var(--accent-soft); border-bottom: 1px solid var(--line); padding: 0.6rem 0; font-size: 0.95rem; }
.notice.warn { background: var(--warn-bg); color: var(--fg); }

main { padding-bottom: 3rem; }

/* Footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.92rem; padding: 1.2rem 0 2rem; }
.foot a { color: var(--muted); }
.foot .links a { color: var(--link); }

/* Home */
.hero { padding: 2.6rem 0 0.6rem; max-width: 46rem; }
.hero h1 { font-size: 2.35rem; }
.kicker { color: var(--muted); font-size: 0.92rem; font-weight: 600; margin: 0; }
.lead { font-size: 1.12rem; max-width: 46rem; }
.ctas { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.2rem; }
.button, button {
  display: inline-block; font: inherit; font-weight: 600; border-radius: 8px; padding: 0.55rem 1rem; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); text-decoration: none; line-height: 1.3;
}
.button.quiet, button.quiet { background: transparent; color: var(--link); border-color: var(--line-strong); }
button:disabled { opacity: 0.55; cursor: progress; }
button.connect { padding: 0.4rem 0.8rem; font-size: 0.92rem; }

.rules { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 1.3rem 0.8rem; margin-top: 2rem; }
.rules h2 { margin-top: 0.8rem; }
.rules li { margin: 0.45rem 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin: 0.8rem 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 0.95rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.stat .label { color: var(--muted); font-size: 0.88rem; }
.stat .value { font-size: 1.45rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat .sub { color: var(--muted); font-size: 0.82rem; }
.books { color: var(--fg); }

.ok { color: var(--ok); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.warn { color: var(--warn); font-weight: 700; }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }

.how .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.9rem; }
.how .col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.2rem 1.1rem 0.6rem; }
.how .col h3 { margin-top: 0.9rem; }
.steps li { margin: 0.5rem 0; }
.why { max-width: 46rem; }

/* Tables */
.table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 0.8rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.82rem; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.id { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.nowrap { white-space: nowrap; }
.addr { font-family: var(--mono); font-size: 0.88rem; white-space: nowrap; }
td.code a { overflow-wrap: anywhere; }
td .pill { white-space: normal; border-radius: 8px; }

.tag { display: inline-block; font-size: 0.75rem; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 0.45rem; color: var(--muted); vertical-align: 1px; white-space: nowrap; }
.pill { display: inline-block; font-size: 0.8rem; font-weight: 600; border-radius: 999px; padding: 0.05rem 0.55rem; white-space: nowrap; border: 1px solid transparent; }
.pill.active, .pill.open { background: var(--ok-bg); color: var(--ok); }
.pill.pending, .pill.due { background: var(--warn-bg); color: var(--warn); }
.pill.embargo { background: var(--accent-soft); color: var(--fg); }
.pill.disclosed { background: var(--code-bg); color: var(--fg); }
.pill.lapsed { background: var(--bad-bg); color: var(--bad); }
.pill.quiet { background: transparent; color: var(--muted); border-color: var(--line-strong); }

.sev { display: inline-block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.sev.critical { color: var(--sev-critical); }
.sev.high { color: var(--sev-high); }
.sev.medium { color: var(--sev-medium); }
.sev.low { color: var(--sev-low); }
.sev.none { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }

.verdict { font-weight: 600; white-space: nowrap; }
.verdict.accept { color: var(--ok); }
.verdict.duplicate { color: var(--fg); }
.verdict.reject, .verdict.unreadable { color: var(--bad); }
.verdict.sealed, .verdict.opened { color: var(--muted); font-weight: 500; }

/* Other pages */
.crumbs { font-size: 0.9rem; color: var(--muted); margin: 1.2rem 0 0; }
.crumbs a { color: var(--muted); }
.head { margin: 1rem 0 1.2rem; }
.head h1 a { color: inherit; text-decoration-color: var(--line-strong); }
.meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; color: var(--muted); }

.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 0.7rem 0.95rem; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout p { margin: 0.2rem 0; }

.check { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 1rem; }
ul.checks { list-style: none; padding: 0; }
ul.checks li { margin: 0.55rem 0; padding-left: 1.4rem; text-indent: -1.4rem; }
ul.checks li small { display: inline-block; text-indent: 0; }

dl.facts { display: grid; grid-template-columns: minmax(10rem, max-content) 1fr; gap: 0.45rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; }
dl.facts dt { color: var(--muted); font-size: 0.92rem; }
dl.facts dd { margin: 0; min-width: 0; }
dl.facts pre { margin: 0.4rem 0 0.2rem; }

details { margin: 0.6rem 0; }
summary { cursor: pointer; color: var(--link); }
details.harbor p, blockquote.harbor { border-left: 3px solid var(--line-strong); padding: 0.2rem 0 0.2rem 0.9rem; margin: 0.6rem 0; color: var(--fg); font-style: italic; }

.raw { color: var(--muted); font-size: 0.9rem; margin-top: 2.4rem; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { margin: 0.35rem 0; }
ol.howto li { margin: 0.6rem 0; }
pre.key code { font-weight: 600; }

/* Actions */
.acts > .help { color: var(--muted); }
form.act { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.3rem 1.1rem 0.6rem; margin: 1rem 0; }
form.act.danger { border-left: 4px solid var(--warn); }
form.act h3 { margin-top: 0.9rem; }
form.act .help { color: var(--muted); font-size: 0.94rem; max-width: 52rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem 1rem; margin: 0.6rem 0; }
.field { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; font-weight: 600; }
.field label em { font-weight: 400; color: var(--muted); font-style: normal; }
.field.check label { flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 500; }
.field small { color: var(--muted); font-size: 0.82rem; }
.field .pick { margin-top: 0.3rem; font-weight: 400; }
input[type=text], select, textarea {
  font: inherit; font-size: 0.95rem; font-weight: 400; color: var(--fg); background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: 7px; padding: 0.45rem 0.6rem; width: 100%; min-width: 0;
}
textarea { font-family: var(--mono); font-size: 0.86rem; line-height: 1.45; resize: vertical; }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
input[type=file] { font-size: 0.86rem; max-width: 100%; }
.go { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.whohint { font-size: 0.88rem; color: var(--warn); }
details.cli summary { font-size: 0.9rem; }
details.cli pre code { white-space: pre-wrap; word-break: break-all; }

.preview { border: 1px solid var(--accent); border-radius: 8px; padding: 0.4rem 0.9rem 0.7rem; margin: 0.6rem 0; background: var(--bg); }
.preview h4 { margin: 0.5rem 0; font-size: 1rem; }
.preview dl.call { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0.4rem 0; font-size: 0.92rem; }
.preview dl.call dt { color: var(--muted); }
.preview dl.call dd { margin: 0; min-width: 0; }
.preview dl.call ol { margin: 0; padding-left: 1.3rem; }
.preview dl.call code { white-space: pre-wrap; word-break: break-all; }
.preview pre code { white-space: pre-wrap; word-break: break-all; }
.preview .buttons { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.6rem 0 0.2rem; }
.preview .problem { color: var(--bad); font-weight: 600; }
.preview .caution { background: var(--warn-bg); color: var(--fg); border-radius: 6px; padding: 0.4rem 0.6rem; }
.result { margin: 0.5rem 0 0; }
.result.ok { color: var(--ok); }
.result.bad { color: var(--bad); }

.copywrap { position: relative; }
.copywrap pre { padding-top: 2rem; }
.copybtn { position: absolute; top: 0.4rem; right: 0.4rem; font-size: 0.75rem; padding: 0.1rem 0.5rem; background: var(--surface); color: var(--link); border: 1px solid var(--line-strong); border-radius: 6px; font-weight: 600; }

/* Without a script, nothing that needs one shows. */
html:not(.js) .js-only { display: none !important; }

@media (max-width: 640px) {
  h1, .hero h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; }
  .hero { padding-top: 1.6rem; }
  .lead { font-size: 1.04rem; }
  .bar { gap: 0.4rem 1rem; }
  .wallet { margin-left: 0; width: 100%; }
  dl.facts { grid-template-columns: 1fr; gap: 0.15rem; }
  dl.facts dd { margin-bottom: 0.5rem; }
  .preview dl.call { grid-template-columns: 1fr; }
  .stat .value { font-size: 1.25rem; }
  /* A table of class stack becomes one card per row. */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 0.12rem 0; text-align: left; }
  table.stack td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 0.85rem; margin-right: 0.3rem; }
}

@media print {
  .top, .foot, .acts, .copybtn { display: none; }
  body { background: #fff; color: #000; }
}
