/* GADVOX – plain CSS, system fonts only (no third-party assets). */
:root {
  --ink: #1b1f24;
  --muted: #5b6470;
  --line: #d9dee5;
  --bg: #fbfbf9;
  --panel: #ffffff;
  --accent: #1d4f91;
  --accent-dark: #143a6b;
  --accent-soft: #e8eef7;
  --ok: #1e6b3a;
  --ok-soft: #e4f3e9;
  --warn: #8a5a00;
  --warn-soft: #fdf3dc;
  --danger: #a4161a;
  --danger-soft: #fbe6e6;
  --info: #37517e;
  --info-soft: #e9eef7;
  --radius: 6px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.55; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.25; margin: 1.4em 0 0.5em; font-weight: 600; }
h1 { font-size: 2rem; margin-top: 0.6em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
code, pre, .mono { font-family: var(--mono); font-size: 0.88em; }
pre { background: #f2f4f7; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #f0b400; outline-offset: 2px; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 1.25rem; }
.wrap-wide { max-width: 1400px; margin: 0 auto; padding: 0 1.25rem; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: 0.5rem; z-index: 10; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.inline { display: inline; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }

/* Header / footer */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 0.9rem; padding-bottom: 0.9rem; flex-wrap: wrap; }
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.brand-mark { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.08em; color: var(--accent-dark); }
.brand-sub { font-size: 0.75rem; color: var(--muted); }
.main-nav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.main-nav a { text-decoration: none; }
.main-nav a.active { font-weight: 600; text-decoration: underline; }
.site-footer { margin-top: 4rem; border-top: 1px solid var(--line); background: #fff; font-size: 0.875rem; color: var(--muted); }
.footer-inner { padding-top: 1.2rem; padding-bottom: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
main { padding-bottom: 2rem; }

/* Panels & cards */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; margin: 1.25rem 0; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-highlight { border-left: 4px solid var(--accent); }
.panel-warning { border-left: 4px solid var(--warn); background: var(--warn-soft); }
.panel-danger { border-left: 4px solid var(--danger); background: var(--danger-soft); }
.hero { padding: 2.5rem 0 1rem; }
.hero h1 { font-size: 2.4rem; margin-bottom: 0.3rem; }
.lead { font-size: 1.15rem; color: #333; }
.cta-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0; }
.stat-list ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; }
.stat-list li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; }
.prose p:first-child { margin-top: 0; }
.prose table { border-collapse: collapse; }
.prose td, .prose th { border: 1px solid var(--line); padding: 0.3rem 0.5rem; }

/* Buttons */
.button, button, input[type=submit] {
  display: inline-block; font: inherit; font-weight: 600; padding: 0.6rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; line-height: 1.3;
}
.button:hover, button:hover, input[type=submit]:hover { background: var(--accent-dark); color: #fff; }
.button-secondary, button.button-secondary { background: #fff; color: var(--accent); }
.button-secondary:hover, button.button-secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }
.button-danger, button.button-danger { background: var(--danger); border-color: var(--danger); }
.button-danger:hover, button.button-danger:hover { background: #7e1013; }
.button-ok, button.button-ok { background: var(--ok); border-color: var(--ok); }
.button-small, button.button-small { padding: 0.3rem 0.7rem; font-size: 0.875rem; }
.button-large { padding: 0.85rem 1.5rem; font-size: 1.05rem; }
.link-button, button.link-button { background: none; border: 0; color: var(--accent); padding: 0; font-weight: normal; text-decoration: underline; cursor: pointer; }
.link-button:hover { background: none; color: var(--accent-dark); }
button[disabled], .button[aria-disabled=true] { opacity: 0.45; cursor: not-allowed; }
form.inline, .button_to.inline { display: inline; }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.field { margin-bottom: 1.1rem; }
.hint { font-size: 0.85rem; color: var(--muted); margin: 0.2rem 0 0.4rem; font-weight: normal; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 0.5rem 0.65rem; border: 1px solid #b8c0cb; border-radius: var(--radius); background: #fff; color: var(--ink);
}
textarea { min-height: 7rem; resize: vertical; }
textarea.tall { min-height: 20rem; font-family: var(--mono); font-size: 0.875rem; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.checkbox { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: normal; margin: 0.5rem 0; }
.checkbox input { margin-top: 0.3rem; flex: none; width: 1.1rem; height: 1.1rem; }
.radio-group label { font-weight: normal; display: inline-flex; gap: 0.4rem; margin-right: 1.2rem; align-items: center; }
.field-error { color: var(--danger); font-size: 0.875rem; margin: 0.2rem 0 0; }
.field_with_errors input, .field_with_errors select, .field_with_errors textarea { border-color: var(--danger); background: #fff8f8; }
.field_with_errors label { color: var(--danger); }
.char-count { font-size: 0.8rem; color: var(--muted); text-align: right; }
.form-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; margin-top: 1.5rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1.2rem; }
legend { font-weight: 700; padding: 0 0.4rem; }
.honeypot { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.inline-warning { background: var(--warn-soft); border: 1px solid #e6c56a; color: #5c3d00; padding: 0.6rem 0.8rem; border-radius: var(--radius); font-size: 0.92rem; margin-top: 0.5rem; }
.repeat-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 0.6rem; align-items: end; margin-bottom: 0.6rem; }
@media (max-width: 700px) { .repeat-row { grid-template-columns: 1fr; } }

/* Alerts, badges, flags */
.alert { padding: 0.8rem 1rem; border-radius: var(--radius); margin: 1rem 0; border: 1px solid; }
.alert ul { margin: 0.3rem 0 0; }
.alert p { margin: 0; }
.alert-notice { background: var(--ok-soft); border-color: #9ccfae; color: #174d2b; }
.alert-error { background: var(--danger-soft); border-color: #e2a3a5; color: #6e0f12; }
.alert-warning { background: var(--warn-soft); border-color: #e6c56a; color: #5c3d00; }
.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: #eceff3; color: #333; white-space: nowrap; }
.state-approved { background: var(--ok-soft); color: var(--ok); }
.state-declined, .state-pi_declined, .state-revoked { background: var(--danger-soft); color: var(--danger); }
.state-needs_info, .state-awaiting_pi { background: var(--warn-soft); color: var(--warn); }
.state-submitted, .state-under_review { background: var(--info-soft); color: var(--info); }
.flags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.6rem 0 1rem; }
.flag { display: inline-block; padding: 0.3rem 0.7rem; border-radius: var(--radius); font-weight: 600; font-size: 0.85rem; border: 1px solid; }
.flag-danger { background: var(--danger-soft); color: var(--danger); border-color: #e2a3a5; }
.flag-warning { background: var(--warn-soft); color: var(--warn); border-color: #e6c56a; }
.flag-info { background: var(--info-soft); color: var(--info); border-color: #b9c6de; }
.flag-ok { background: var(--ok-soft); color: var(--ok); border-color: #9ccfae; }
.banner-draft { background: var(--danger-soft); color: var(--danger); font-weight: 700; padding: 0.6rem 1rem; border-radius: var(--radius); border: 1px dashed var(--danger); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: #fff; font-size: 0.92rem; }
table.data th, table.data td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: #f3f5f8; font-weight: 600; font-size: 0.85rem; }
table.data tr:hover td { background: #fafbfd; }
dl.kv { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 0.35rem 1rem; margin: 0; }
dl.kv dt { font-weight: 600; color: #333; }
dl.kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.checksum { font-family: var(--mono); font-size: 0.78rem; overflow-wrap: anywhere; color: #333; }

/* Steps */
.steps { display: flex; gap: 0; list-style: none; padding: 0; margin: 1rem 0 1.5rem; counter-reset: step; flex-wrap: wrap; }
.steps li { flex: 1; min-width: 130px; padding: 0.5rem 0.7rem; border-bottom: 3px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.steps li.done { border-color: #8fb3de; color: var(--ink); }
.steps li.current { border-color: var(--accent); color: var(--accent); font-weight: 700; }

/* DUA signing */
.dua-panel { max-height: 28rem; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.5rem; font-family: var(--serif); }
.dua-end { font-family: var(--sans); color: var(--muted); font-size: 0.85rem; text-align: center; border-top: 1px dashed var(--line); padding-top: 0.6rem; }
.scroll-hint { font-size: 0.9rem; color: var(--warn); margin: 0.5rem 0; }
fieldset.signature-section[disabled] { opacity: 0.5; }
.signature-pad-wrap { border: 2px dashed #9aa6b5; border-radius: var(--radius); background: #fff; position: relative; max-width: 560px; }
.signature-pad-wrap canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.signature-baseline { position: absolute; left: 8%; right: 8%; bottom: 40px; border-bottom: 1px solid #c8ced6; pointer-events: none; }
.signature-actions { margin-top: 0.4rem; }

/* Downloads */
.warning-box { background: var(--danger-soft); border: 2px solid var(--danger); color: #6e0f12; padding: 0.9rem 1rem; border-radius: var(--radius); font-weight: 700; }
.copy-box { position: relative; }
.copy-box button { position: absolute; top: 0.4rem; right: 0.4rem; }
.citation { font-family: var(--serif); background: #fff; border-left: 4px solid var(--accent); padding: 0.8rem 1rem; }

/* Admin */
body.admin { background: #f5f6f8; }
.admin-header { background: #16294a; border-bottom: 0; }
.admin-header .brand-mark { color: #fff; }
.admin-header .brand-sub, .admin-header .muted { color: #c9d4e6; }
.admin-header a, .admin-header .link-button { color: #fff; }
.admin-grid { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; padding-top: 1rem; }
.admin-nav { display: flex; flex-direction: column; font-size: 0.92rem; position: sticky; top: 1rem; align-self: start; }
.admin-nav a { padding: 0.25rem 0.5rem; text-decoration: none; border-radius: 4px; color: #243b5e; }
.admin-nav a.active { background: var(--accent-soft); font-weight: 700; }
.admin-nav .nav-group { margin: 1rem 0 0.2rem 0.5rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.admin-main { min-width: 0; }
.admin-main h1 { margin-top: 0.2rem; font-size: 1.7rem; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.counter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.8rem; }
.counter { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; }
.counter .num { font-size: 1.9rem; font-weight: 700; font-family: var(--serif); color: var(--accent-dark); display: block; }
.counter .lbl { font-size: 0.82rem; color: var(--muted); }
.counter.hot .num { color: var(--danger); }
.action-bar { position: sticky; bottom: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; box-shadow: 0 -2px 10px rgba(0,0,0,0.06); margin-top: 1.5rem; z-index: 5; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid var(--line); padding: 0 0 0.9rem 1rem; position: relative; }
.timeline li::before { content: ""; width: 10px; height: 10px; background: var(--accent); border-radius: 50%; position: absolute; left: -6px; top: 0.4rem; }
.timeline .meta { font-size: 0.82rem; color: var(--muted); }
.timeline details { margin-top: 0.3rem; }
.diff-old { background: var(--danger-soft); text-decoration: line-through; }
.diff-new { background: var(--ok-soft); }
.progress { width: 100%; height: 12px; background: #e6e9ee; border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); }
.auth-box { max-width: 420px; margin: 4rem auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; }
.qr svg { width: 220px; height: 220px; }
.codes { columns: 2; font-family: var(--mono); font-size: 1.05rem; }

/* Modal */
dialog.modal { border: 0; border-radius: 10px; padding: 0; width: min(860px, 95vw); max-height: 92vh; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
dialog.modal::backdrop { background: rgba(16, 24, 40, 0.55); }
.modal-body { padding: 1.4rem 1.6rem; overflow-y: auto; max-height: 92vh; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; }
.email-preview { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1rem 1.2rem; max-height: 22rem; overflow-y: auto; font-family: var(--serif); }
.email-preview .subject { font-family: var(--sans); font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; margin-bottom: 0.8rem; }
.prewrap { white-space: pre-wrap; }

.narrow { width: 5rem !important; }
.progress > span.w-0 { width: 0%; }
.progress > span.w-5 { width: 5%; }
.progress > span.w-10 { width: 10%; }
.progress > span.w-15 { width: 15%; }
.progress > span.w-20 { width: 20%; }
.progress > span.w-25 { width: 25%; }
.progress > span.w-30 { width: 30%; }
.progress > span.w-35 { width: 35%; }
.progress > span.w-40 { width: 40%; }
.progress > span.w-45 { width: 45%; }
.progress > span.w-50 { width: 50%; }
.progress > span.w-55 { width: 55%; }
.progress > span.w-60 { width: 60%; }
.progress > span.w-65 { width: 65%; }
.progress > span.w-70 { width: 70%; }
.progress > span.w-75 { width: 75%; }
.progress > span.w-80 { width: 80%; }
.progress > span.w-85 { width: 85%; }
.progress > span.w-90 { width: 90%; }
.progress > span.w-95 { width: 95%; }
.progress > span.w-100 { width: 100%; }
.ror-results { list-style: none; padding: 0; margin: 0.4rem 0; } .ror-results li { padding: 0.15rem 0; }
