/* Islamic Records Bureau: one stylesheet for the public site and the dashboard. */

@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans-var-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/source-serif-4-var.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ink: #0c1b2a;
  --ink-2: #1b2d40;
  --ink-3: #2c4157;
  --canvas: #f6f5f2;
  --surface: #ffffff;
  --line: #e3e0d9;
  --line-strong: #c9c5bc;
  --text: #0c1b2a;
  --muted: #56606b;
  --accent: #1f4fd1;
  --accent-hover: #173fa9;
  --accent-soft: #e9eefc;
  --valid: #13693f;
  --valid-soft: #e5f3eb;
  --warn: #7f4c00;
  --warn-soft: #fdf3dc;
  --danger: #a12a2a;
  --danger-soft: #fbeceb;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(12, 27, 42, .06), 0 8px 24px rgba(12, 27, 42, .08);
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }  /* layout classes must never override hidden */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--canvas); }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.eyebrow { font-size: .75rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: .75rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------ header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; letter-spacing: -.005em; }
.brand:hover { color: var(--ink); }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; background: var(--ink); color: #fff; font-family: var(--serif); font-size: .82rem; font-weight: 700; letter-spacing: .04em; }
.nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--accent); }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 72px; padding: 32px 0 40px; font-size: .9rem; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.6fr); gap: 24px 48px; }
.site-footer nav { display: flex; gap: 10px 18px; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer strong { color: var(--ink); }
.stripe-badge { display: inline-block; line-height: 0; }
.stripe-badge img { height: 27px; width: auto; }
.footer-badges { margin-top: 12px; }
.about-notice .stripe-badge { margin-top: 4px; }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius);
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-ghost { background: none; color: var(--accent); padding-inline: 8px; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #e3b9b6; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #e9edf2; color: var(--ink); }
.btn-outline-light { color: #fff; border-color: rgba(255,255,255,.4); background: none; }
.btn-outline-light:hover { border-color: #fff; color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .85rem; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn-row .spacer { flex: 1; }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------ forms */
.field { margin-bottom: 22px; }
.field > label, .label { display: block; font-weight: 600; margin-bottom: 4px; }
.req { color: var(--danger); font-weight: 600; }
.hint { color: var(--muted); font-size: .88rem; margin: 0 0 8px; }
input[type=text], input[type=email], input[type=date], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .88rem; font-weight: 600; margin: 6px 0 0; }
input[type=file] { font: inherit; font-size: .92rem; max-width: 100%; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.check + .check { margin-top: 10px; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check .why { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.choice-grid { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.choice input { grid-row: span 2; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
.choice strong { font-weight: 650; }
.choice span { color: var(--muted); font-size: .92rem; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice-row .choice { grid-template-columns: auto auto; align-items: center; padding: 12px 16px; }
.choice-row .choice input { grid-row: auto; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
legend { font-weight: 600; margin-bottom: 4px; padding: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }

/* ------------------------------------------------------------ surfaces, notices, badges */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.card-tight { padding: 20px; }
.record-notice { border-left: 3px solid var(--ink); background: #f6f5f1; padding: 16px 20px; margin: 14px 0 18px; font-size: .94rem; line-height: 1.6; }
.record-notice p { margin: 0 0 .75em; }
.record-notice p:last-child { margin-bottom: 0; }
.notice { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; border: 1px solid; font-size: .95rem; }
.notice > :last-child { margin-bottom: 0; }
.notice-info { background: var(--accent-soft); border-color: #cbd7f7; }
.notice-ok { background: var(--valid-soft); border-color: #bfdfcc; color: #0d4a2c; }
.notice-warn { background: var(--warn-soft); border-color: #efd9a6; color: #5b3700; }
.notice-error { background: var(--danger-soft); border-color: #ecc3c0; color: #7a1d1d; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: #eceae4; color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.b-confirmed, .b-signed, .b-issued { background: var(--valid-soft); color: var(--valid); }
.b-queried, .b-declined, .b-rejected, .b-signature_declined { background: var(--danger-soft); color: var(--danger); }
.b-unconfirmed, .b-pending, .b-submitted, .b-out_for_signature { background: var(--warn-soft); color: var(--warn); }
.b-confirmed.case, .b-draft { background: var(--accent-soft); color: var(--accent); }

.linkbox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.linkbox code { font-family: var(--mono); font-size: .82rem; overflow-wrap: anywhere; flex: 1; min-width: 200px; color: var(--ink-2); }

table { border-collapse: collapse; width: 100%; }
.table { font-size: .93rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------ home */
.hero { background: var(--ink); color: #e8edf2; padding: 72px 0 80px; }
/* A faint eight-point star-and-cross (assets/make_hero_pattern.py); it fades out behind the headline. */
.hero { position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: url("../hero-pattern.svg"); background-size: 110px 110px;
  -webkit-mask-image: linear-gradient(100deg, transparent 20%, #000 75%); mask-image: linear-gradient(100deg, transparent 20%, #000 75%); }
.hero > .wrap { position: relative; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero p.lead { font-size: 1.12rem; color: #c3ccd6; max-width: 54ch; margin-bottom: 28px; }
.hero .eyebrow { color: #8fa1b3; }
.check-card { background: var(--surface); color: var(--text); border-radius: 12px; padding: 28px; box-shadow: 0 20px 48px rgba(0,0,0,.28); }
.check-card h2 { font-size: 1.35rem; margin-bottom: 6px; }
.check-card form { display: grid; gap: 10px; margin-top: 16px; }
.check-card input { font-family: var(--mono); text-transform: uppercase; letter-spacing: .02em; }
.check-card .small { margin: 12px 0 0; }
.reveal { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.reveal.d1 { animation-delay: .08s; } .reveal.d2 { animation-delay: .16s; } .reveal.d3 { animation-delay: .26s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } * { transition: none !important; } }

.section { padding: 72px 0 0; }
.section-head { max-width: 62ch; margin-bottom: 32px; }
.steps4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: s; border-top: 2px solid var(--ink); }
.steps4 li { list-style: none; padding: 22px 24px 8px 0; }
.steps4 li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.steps4 .num { font-family: var(--mono); font-size: .85rem; color: var(--muted); display: block; margin-bottom: 10px; }
.steps4 h3 { font-size: 1.08rem; }
.steps4 p { color: var(--muted); font-size: .95rem; }
ol.steps4 { margin: 0; padding: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.ticks { list-style: none; padding: 0; margin: 0 0 24px; }
.ticks li { position: relative; padding: 10px 0 10px 30px; border-bottom: 1px solid var(--line); }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 10px; height: 6px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg); }
.ticks li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------ the record (verify result and its example) */
.record { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.record-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.record-number { font-family: var(--mono); font-weight: 500; font-size: 1.1rem; letter-spacing: .01em; }
.stamp { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: 4px; }
.stamp-valid { background: var(--valid); color: #fff; }
.stamp-invalid { background: var(--danger); color: #fff; }
.stamp-pending { background: var(--warn-soft); color: var(--warn); }
.stamp-example { background: #eceae4; color: var(--ink-2); }
.record table th, .record table td { padding: 11px 22px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .95rem; }
.record table th { width: 42%; color: var(--muted); font-weight: 500; }
.record table tr:last-child th, .record table tr:last-child td { border-bottom: 0; }
.record .fingerprint { font-family: var(--mono); font-size: .78rem; overflow-wrap: anywhere; color: var(--ink-2); }
.record-foot { padding: 14px 22px; background: #faf9f6; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.record-valid { border-top: 4px solid var(--valid); }
.record-invalid { border-top: 4px solid var(--danger); }
.record-pending { border-top: 4px solid #d99a1e; }

/* ------------------------------------------------------------ page scaffolds */
.page { padding-top: 44px; }
.page-head { margin-bottom: 28px; max-width: 70ch; }
.page-head p { color: var(--muted); font-size: 1.05rem; }
.narrow { max-width: 760px; }
/* Record type pages: the text in two thirds, the call to action in the right third, kept in view while scrolling. */
.record-page { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.record-cta { position: sticky; top: 24px; }
.record-cta .badge { margin-bottom: 16px; }
.record-cta h2 { margin-top: 0; }
.cta-meta { margin: 12px 0 0; text-align: center; font-size: .88rem; color: var(--muted); }
.btn-block { display: flex; width: 100%; justify-content: center; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; font-size: 1.35rem; }
.prose h3 { margin: 1.4em 0 .4em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prose h3 a { color: var(--ink); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------------------------------------ application wizard */
.wizard { display: grid; grid-template-columns: 250px 1fr; gap: 36px; align-items: start; }
.stepnav { position: sticky; top: 20px; }
.stepnav ol { list-style: none; margin: 0; padding: 0; }
.stepnav li a { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--radius); color: var(--muted); text-decoration: none; font-size: .93rem; }
.stepnav li a:hover { background: #eeece6; color: var(--ink); }
.stepnav .dot { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); font-family: var(--mono); font-size: .75rem; background: var(--surface); }
.stepnav li.done .dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.stepnav li.done .dot span { display: none; }
.stepnav li.done .dot::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translate(0, -1px) rotate(-45deg); }
.stepnav li.current a { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.stepnav li.current .dot { border-color: var(--accent); color: var(--accent); }
.progress-mobile { display: none; }
.progress-bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress-bar span { display: block; height: 100%; background: var(--accent); }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.form-card-head { padding: 26px 30px 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.form-card-head h1 { font-size: 1.75rem; margin-bottom: 4px; }
.form-card-head p { color: var(--muted); margin: 0; max-width: 60ch; }
.form-card-body { padding: 26px 30px 6px; }
.form-card-foot { padding: 18px 30px; border-top: 1px solid var(--line); background: #faf9f6; border-radius: 0 0 10px 10px; }
.save-status { font-size: .82rem; color: var(--muted); white-space: nowrap; padding-top: 6px; }
.save-status[data-state="saving"] { color: var(--warn); }
.save-status[data-state="error"] { color: var(--danger); }
.aside-link { margin-top: 22px; font-size: .85rem; color: var(--muted); }
.aside-link .linkbox { margin-top: 8px; }
.summary-group { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.summary-group header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #faf9f6; }
.summary-group header h2 { margin: 0; font-family: var(--sans); font-size: .95rem; font-weight: 650; letter-spacing: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.enter-default { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
details.faq { border-bottom: 1px solid var(--line); padding: 4px 0; }
details.faq summary { cursor: pointer; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary h2 { display: inline; font-size: 1.15rem; margin: 0; }
details.faq summary::after { content: "+"; float: right; color: var(--muted); font-size: 1.2rem; }
details.faq[open] summary::after { content: "\2212"; }
details.faq summary { padding: 14px 0; }
.summary-group dl { margin: 0; display: grid; grid-template-columns: minmax(160px, 38%) 1fr; }
.summary-group dt, .summary-group dd { margin: 0; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: .93rem; }
.summary-group dt { color: var(--muted); }
.summary-group dl > :nth-last-child(-n+2) { border-bottom: 0; }
.summary-group .missing { color: var(--danger); font-weight: 600; }
.doclist { list-style: none; padding: 0; margin: 0 0 22px; border: 1px solid var(--line); border-radius: var(--radius); }
.doclist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doclist li:last-child { border-bottom: 0; }
.doclist form { margin: 0; }
.person { border-top: 1px solid var(--line); padding-top: 16px; margin-bottom: 8px; }
.person .label { margin-bottom: 10px; }
.check-inline { padding: 10px 14px; margin: -6px 0 18px; }
.upload { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 16px; background: #fcfbf9; }

/* ------------------------------------------------------------ party status page */
.timeline { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 3px solid var(--line); }
.timeline li { padding: 14px 12px 0 0; position: relative; color: var(--muted); font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; top: -3px; left: 0; right: 0; height: 3px; }
.timeline li.done::before { background: var(--ink); }
.timeline li.now::before { background: var(--accent); }
.timeline li.done, .timeline li.now { color: var(--ink); }
.timeline strong { display: block; font-weight: 650; }

/* ------------------------------------------------------------ signing */
.doc-callout { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #faf9f6; margin-bottom: 24px; flex-wrap: wrap; }
details.disclosure > summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; list-style: none; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary > span > span { display: block; font-weight: 400; margin-top: 2px; }
details.disclosure > summary::after { content: "Show"; flex: none; font-size: .88rem; font-weight: 600; color: var(--accent); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 5px 12px; }
details.disclosure[open] > summary::after { content: "Hide"; }
details.disclosure > summary:hover::after { border-color: var(--accent); }
details.decline { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
details.decline summary { cursor: pointer; color: var(--muted); font-size: .92rem; }

/* ------------------------------------------------------------ dashboard */
body.dash { background: #f3f4f6; }
.dash-bar { background: var(--ink); color: #c3ccd6; }
.dash-bar .wrap { max-width: 1440px; display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 16px; flex-wrap: wrap; }
.dash-bar .brand { color: #fff; }
.dash-bar .brand-mark { background: #fff; color: var(--ink); }
.dash-bar nav { display: flex; gap: 16px; align-items: center; font-size: .9rem; flex-wrap: wrap; }
.dash-bar a { color: #c3ccd6; text-decoration: none; }
.dash-bar a:hover { color: #fff; }
.dash-bar form { margin: 0; }
.dash-bar button.link { background: none; border: 0; color: #c3ccd6; font: inherit; cursor: pointer; padding: 0; }
.dash-bar button.link:hover { color: #fff; }
.dash main > .wrap { max-width: 1440px; padding-top: 28px; padding-bottom: 48px; }
.dash h1 { font-family: var(--sans); font-weight: 700; font-size: 1.5rem; letter-spacing: -.01em; }
.dash h2 { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; letter-spacing: 0; margin: 0 0 12px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line-strong); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { font-family: var(--mono); font-size: .75rem; margin-left: 6px; color: var(--muted); }
.case-row td a.case-link { font-weight: 650; color: var(--ink); text-decoration: none; }
.case-row:hover td { background: #fafbfc; }
.case-row[data-href] { cursor: pointer; }
.case-row[data-href]:hover td { background: var(--accent-soft); }
.meter { display: inline-block; width: 70px; height: 5px; background: var(--line); border-radius: 3px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--valid); }
.age-late { color: var(--danger); font-weight: 650; }
.case-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.case-top h1 { margin-bottom: 2px; }
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 22px; }
.stepper div { font-size: .8rem; font-weight: 650; padding: 8px 10px; border-radius: 4px; background: #e7e9ec; color: var(--muted); }
.stepper div.done { background: var(--ink); color: #fff; }
.stepper div.now { background: var(--accent); color: #fff; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px; align-items: start; }
.review-grid > * { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.panel-body { padding: 16px 18px; }
.fact { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact:target { background: #fffbe8; }
.fact .flabel { font-size: .88rem; font-weight: 600; }
.fact .fsrc { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.fact .fnote { font-size: .82rem; color: var(--danger); margin-top: 4px; }
.fact .fmeta { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.fact form { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 0; }
.fact input[type=text], .fact select { min-height: 36px; padding: 6px 10px; font-size: .92rem; }
.fact .factions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fact .factions input { flex: 1; min-width: 140px; }
.fact .fvalue { font-size: .95rem; }
.viewer { position: sticky; top: 16px; }
.viewer iframe { display: block; width: 100%; height: calc(100vh - 210px); min-height: 480px; border: 0; background: #e7e9ec; border-radius: 0 0 8px 8px; }
.doc-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc-tabs button { font: inherit; font-size: .82rem; padding: 6px 10px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 4px; cursor: pointer; }
.doc-tabs button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.doc-actions { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: .85rem; }
.doc-actions form { margin: 0; display: flex; gap: 6px; }
.checks { font-size: .9rem; }
.checks summary { cursor: pointer; font-weight: 650; }
.events td { font-size: .82rem; }
.events td:last-child { overflow-wrap: anywhere; }  /* long fingerprints wrap instead of widening the column */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--ink); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 10px; padding: 32px; }
.login-card .brand { margin-bottom: 22px; }
.login-card h1 { font-family: var(--sans); font-size: 1.3rem; }

/* ------------------------------------------------------------ narrow screens */
@media (max-width: 960px) {
  .hero .wrap, .split, .review-grid, .record-page { grid-template-columns: 1fr; }
  .record-cta { position: static; }
  .hero { padding: 48px 0 56px; }
  .steps4 { grid-template-columns: 1fr 1fr; }
  .steps4 li:nth-child(3) { padding-left: 0; border-left: 0; }
  .wizard { grid-template-columns: 1fr; gap: 16px; }
  .stepnav { display: none; }
  .progress-mobile { display: block; font-size: .9rem; color: var(--muted); }
  .viewer { position: static; }
  .viewer iframe { height: 70vh; }
}
@media (max-width: 640px) {
  .two, .three { grid-template-columns: 1fr; }
  .steps4 { grid-template-columns: 1fr; }
  .steps4 li, .steps4 li + li { padding-left: 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .form-card-head, .form-card-body, .form-card-foot { padding-inline: 18px; }
  .card { padding: 20px; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .site-footer nav { justify-content: flex-start; }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: 16px; }
  .fact { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: 1fr 1fr; }
  .summary-group dl { grid-template-columns: 1fr; }
  .summary-group dt { border-bottom: 0; padding-bottom: 0; }
  .nav { gap: 14px; }
}

/* ------------------------------------------------------------ utilities (the CSP forbids inline styles) */
.mt { margin-top: 24px; }
.mt-xs { margin-top: 12px; }
.mt-xxs { margin-top: 6px; }
.h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 650; letter-spacing: 0; margin: 0 0 .6em; }
.form-card-body .h3 { margin-top: 6px; }
.btn-block { width: 100%; }
.record-note { margin: 0; border-radius: 0; border-width: 0 0 1px; }
.o-1 { order: 1; } .o-2 { order: 2; } .o-3 { order: 3; } .o-4 { order: 4; }
progress.progress-bar { appearance: none; -webkit-appearance: none; width: 100%; height: 4px; border: 0; background: var(--line); border-radius: 4px; }
progress.progress-bar::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
progress.progress-bar::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
progress.progress-bar::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
.meter span.pct-0 { width: 0; } .meter span.pct-10 { width: 10%; } .meter span.pct-20 { width: 20%; } .meter span.pct-30 { width: 30%; }
.meter span.pct-40 { width: 40%; } .meter span.pct-50 { width: 50%; } .meter span.pct-60 { width: 60%; } .meter span.pct-70 { width: 70%; }
.meter span.pct-80 { width: 80%; } .meter span.pct-90 { width: 90%; } .meter span.pct-100 { width: 100%; }
details.panel > summary { list-style: none; cursor: pointer; }
details.fold > summary { justify-content: flex-start; }
details.fold > summary > h2 { margin-right: auto; }
details.fold > summary::after { content: "Hide"; flex: none; font-size: .8rem; font-weight: 600; color: var(--accent); border: 1px solid var(--line-strong); border-radius: 4px; padding: 3px 10px; }
details.fold:not([open]) > summary::after { content: "Show"; }
details.fold > summary:hover::after { border-color: var(--accent); }
details.fold > summary:hover { background: #fafbfc; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel:not([open]) > summary { border-bottom: 0; }
.fact form select { width: 100%; }
input.mono { font-family: var(--mono); letter-spacing: .02em; }
@media (max-width: 640px) {
  .form-card-foot .btn-primary { flex-basis: 100%; }
  .form-card-foot .spacer { display: none; }
}

/* record types on the home page */
.record-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
/* About page */
.hero-about .wrap { grid-template-columns: 1fr; }
.hero-about h1 { max-width: none; }
.hero-about p.lead { max-width: 70ch; margin-bottom: 0; }
.about-cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.about-cases .type-card h3 { font-size: 1.2rem; }
.about-founding { max-width: 70ch; margin-top: 28px; font-size: 1.05rem; }
.about-notice { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }
.notice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.notice-grid h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1rem; margin: 0 0 6px; }
.notice-grid h3 a { color: var(--ink); }
.notice-grid p { margin: 0; color: var(--muted); }
.about-label { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.team-grid { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.person-card { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ink); border-radius: 8px; padding: 16px 18px; }
.person-card strong { display: block; font-family: var(--serif); font-size: 1.12rem; font-weight: 600; color: var(--ink); }
.person-card span { display: block; color: var(--muted); font-size: .9rem; margin-top: 2px; }
@media (max-width: 960px) { .about-cases, .about-notice { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .notice-grid { grid-template-columns: 1fr; } }
.type-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.type-card:hover { border-color: var(--ink); color: var(--ink); box-shadow: var(--shadow); }
.type-card h3 { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin: 14px 0 4px; }
.type-card p { color: var(--muted); font-size: .92rem; margin: 0; }
@media (max-width: 960px) { .record-types { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .record-types { grid-template-columns: 1fr; } }

/* apply: choose a record type */
.apply-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.apply-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.apply-card h2 { margin: 12px 0 2px; font-size: 1.5rem; }
.apply-card.is-closed { background: #fbfaf8; }
.mb { margin-bottom: 20px; }
/* outline of an application on a record page */
ol.outline { list-style: none; counter-reset: o; padding: 0; margin: 0; border-top: 1px solid var(--line); }
ol.outline li { counter-increment: o; display: grid; grid-template-columns: 2.2rem 1fr; column-gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
ol.outline li::before { content: counter(o, decimal-leading-zero); font-family: var(--mono); font-size: .8rem; color: var(--muted); padding-top: 3px; grid-row: span 2; }
ol.outline li strong { font-weight: 650; }
ol.outline li .muted { font-size: .9rem; }
/* the application of a record type not yet open */
fieldset[disabled] input, fieldset[disabled] textarea, fieldset[disabled] select { background: #f4f3ef; cursor: not-allowed; }
fieldset[disabled] .choice, fieldset[disabled] .check { cursor: not-allowed; }
@media (max-width: 640px) { .apply-grid { grid-template-columns: 1fr; } }

/* Side-by-side fields share rows (label, hint, input, error), so the inputs line up even when
   one field has a hint and its neighbour has none, or a longer one. */
.two > .field, .three > .field { display: grid; grid-template-rows: subgrid; grid-row: span 4; align-content: start; }
.two > .field > label, .three > .field > label { grid-row: 1; align-self: end; }
.two > .field > .hint, .three > .field > .hint { grid-row: 2; }
.two > .field > :is(input, textarea, select), .three > .field > :is(input, textarea, select) { grid-row: 3; }
.two > .field > .field-error, .three > .field > .field-error { grid-row: 4; }
