/*
 * Corporate design of digital/organizing, taken from the slides theme
 * (digital-organizing/slides, theme/styles/tokens.css): paper instead of white,
 * black ink, yellow and gold as the brand, Bricolage Grotesque for headings,
 * Public Sans for text, and no rounded corners anywhere.
 */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-latin.ad33cbc6d232.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/public-sans-latin.e4c9b081863a.woff2") format("woff2");
}

:root {
  --do-yellow: #f1d962;
  --do-gold: #cfb045;
  --do-ink: #000000;
  --do-paper: #f5f0ea;

  --do-bg: var(--do-paper);
  --do-fg: var(--do-ink);
  --do-fg-muted: #55504a;
  --do-fg-subtle: #8a837a;
  --do-rule: #ddd5c9;
  --do-surface: #f5f0ea;
  --do-surface-2: #dbd5ce;

  /* Status: always with text, never colour alone. */
  --do-status-good: #1a6b4e;
  --do-status-warn: #6f5d18;
  --do-status-critical: #a33f52;

  --do-font-display: "Bricolage Grotesque", "Public Sans", ui-sans-serif, system-ui, sans-serif;
  --do-font-sans: "Public Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --do-track-display: -0.03em;
  --do-track-label: 0.12em;

  color-scheme: light;
}

/* Dark mode has its own steps, not an inversion (tokens.css, html.dark). */
@media (prefers-color-scheme: dark) {
  :root {
    --do-bg: #1f1c17;
    --do-fg: #f5f0ea;
    --do-fg-muted: #b8b0a4;
    --do-fg-subtle: #8a837a;
    --do-rule: #3a352d;
    --do-surface: #2a2620;
    --do-surface-2: #35302a;
    --do-status-good: #4fb98b;
    --do-status-warn: #cbb05a;
    --do-status-critical: #e08897;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; border-radius: 0; }

body {
  margin: 0;
  background: var(--do-bg);
  color: var(--do-fg);
  font: 400 15px/1.55 var(--do-font-sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--do-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--do-fg); }

h1, h2 {
  font-family: var(--do-font-display);
  font-weight: 800;
  letter-spacing: var(--do-track-display);
  line-height: 1.05;
  text-wrap: balance;
}
h1 { font-size: 2.1rem; margin: 0 0 1rem; }
/* Section labels: small, bold, wide, like the table heads of the design system. */
h2 {
  font-family: var(--do-font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--do-track-label);
  text-transform: uppercase;
  line-height: 1.3;
  margin: 0 0 1rem;
}
strong, b { font-weight: 700; }
.muted { color: var(--do-fg-muted); }
.small { font-size: 0.85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--do-fg); outline-offset: 2px; }

/* Top bar: a black band with the wordmark in paper colour. */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap;
  padding: 0.85rem 1.25rem; background: var(--do-fg); color: var(--do-bg);
}
.brand { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; }
.wordmark {
  display: block; width: 8.6rem; height: 0.94rem; background: currentColor;
  -webkit-mask: url("wordmark.16c625666afa.svg") no-repeat center / contain;
  mask: url("wordmark.16c625666afa.svg") no-repeat center / contain;
}
.brand-app {
  font-size: 0.72rem; font-weight: 700; letter-spacing: var(--do-track-label); text-transform: uppercase;
  padding-left: 0.9rem; border-left: 1px solid currentColor;
}
.topnav { display: flex; align-items: center; gap: 0.5rem 1.25rem; flex-wrap: wrap; font-size: 0.9rem; }
.topnav a { text-decoration-color: var(--do-yellow); }
.topnav form { margin: 0; }
.topnav .muted, .who { color: inherit; opacity: 0.7; }
.linklike {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 400; color: inherit; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--do-yellow); text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.linklike:hover { background: none; }

.messages { padding: 1rem 1.25rem 0; max-width: 1240px; margin: 0 auto; }
.message {
  margin: 0 0 0.5rem; padding: 0.6rem 0.9rem; border-left: 4px solid var(--do-status-good);
  background: var(--do-surface-2); font-weight: 600;
}
.message.error { border-left-color: var(--do-status-critical); }
.error { color: var(--do-status-critical); font-weight: 600; margin: 0.25rem 0; }
.ok { color: var(--do-status-good); font-weight: 700; margin: 0; }

.page { max-width: 1240px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.page.narrow { max-width: 440px; padding-top: 4rem; }

.card { background: var(--do-surface); border: 1px solid var(--do-rule); padding: 1.25rem 1.4rem; }
.card + .card { margin-top: 1rem; }

/* Forms */
label { display: block; font-weight: 700; margin: 1rem 0 0.35rem; }
input, select, textarea, button, .button { font: inherit; color: inherit; }
input:not([type=radio]):not([type=checkbox]), select, textarea {
  width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--do-fg-subtle); background: var(--do-bg);
}
input:not([type=radio]):not([type=checkbox]):focus, select:focus, textarea:focus {
  outline: 2px solid var(--do-fg); outline-offset: -1px; border-color: var(--do-fg);
}
input[type=radio], input[type=checkbox] { accent-color: var(--do-fg); width: 1rem; height: 1rem; margin: 0; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.6rem 1.1rem; border: 2px solid var(--do-fg); background: transparent;
  font-weight: 700; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: var(--do-surface-2); }
.primary { background: var(--do-yellow); border-color: var(--do-yellow); color: var(--do-ink); }
.primary:hover { background: var(--do-gold); border-color: var(--do-gold); }
.login h1 { font-size: 2.6rem; }
.login button { margin-top: 1.5rem; width: 100%; }
kbd { font: 600 0.7rem ui-monospace, monospace; padding: 0 0.3rem; border: 1px solid currentColor; opacity: 0.55; }

/* List */
.intro { display: grid; grid-template-columns: 1fr minmax(260px, 320px); gap: 2rem; align-items: end; margin-bottom: 2rem; }
.intro h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
.intro p { margin: 0; max-width: 62ch; font-weight: 300; font-size: 1.05rem; }
.progress-box { border: 2px solid var(--do-fg); padding: 1.1rem; display: grid; gap: 0.75rem; }
.progress-label { font-size: 0.95rem; }
.progress-label strong {
  font-family: var(--do-font-display); font-weight: 800; font-size: 2rem;
  letter-spacing: var(--do-track-display); margin-right: 0.15rem;
}
.progress { height: 10px; background: var(--do-surface-2); }
.progress span { display: block; height: 100%; background: var(--do-gold); }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select { flex: 0 1 230px; width: auto; }

.table-wrap { overflow-x: auto; }
table.permits { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
/* Table head: a black bar with paper-coloured labels (design system, tables). */
.permits thead tr { background: var(--do-fg); color: var(--do-bg); }
.permits th {
  text-align: left; padding: 0.65rem 0.75rem; font-size: 0.69rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.permits td { text-align: left; padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--do-rule); vertical-align: top; }
.permits tbody tr:hover { background: var(--do-surface-2); }
.permits td a { font-weight: 700; }
.sub { font-size: 0.85rem; color: var(--do-fg-muted); }

.pill {
  display: inline-block; padding: 0.1rem 0.45rem; margin: 0 0.25rem 0.25rem 0;
  background: var(--do-surface-2); font-size: 0.82rem; font-weight: 700;
}
/* The triage's union in the yellow bar; the design system has no gradients, so it is a shadow. */
.pill.big {
  font-family: var(--do-font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: var(--do-track-display);
  padding: 0 0.15em; background: none; box-shadow: inset 0 -0.38em 0 var(--do-yellow); margin: 0 0.6rem 0 0;
}
@media (prefers-color-scheme: dark) {
  .pill.big { box-shadow: none; color: var(--do-yellow); }
}
.flag {
  display: inline-block; padding: 0.05rem 0.4rem; border: 1px solid var(--do-status-warn); color: var(--do-status-warn);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.verdict {
  display: inline-block; padding: 0.05rem 0.45rem; margin-right: 0.25rem; border-left: 4px solid currentColor;
  background: var(--do-surface-2); font-size: 0.85rem; font-weight: 700;
}
.verdict.correct { color: var(--do-status-good); }
.verdict.wrong { color: var(--do-status-critical); }
.verdict.unclear { color: var(--do-status-warn); }

/* Detail: facts and the judgment on the left, the PDF on the right. */
.split { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.15fr); gap: 1.25rem; padding: 1.25rem; }
.pane.info { min-width: 0; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.9rem; font-size: 0.9rem; }
.pager a { font-weight: 700; }
.detail h1 { font-size: 1.9rem; }

.facts { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.45rem 0.9rem; margin: 0; }
.facts dt { color: var(--do-fg-muted); font-size: 0.88rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts summary, .older summary { cursor: pointer; color: var(--do-fg-muted); }
.unions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin-bottom: 1.1rem; }
.older { margin-top: 1.1rem; font-size: 0.9rem; }
.older ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }

/* The form is the one thing to do on the page: framed in ink, headed by the yellow bar. */
.judgment { border: 2px solid var(--do-fg); border-top: 8px solid var(--do-yellow); }
.judgment fieldset { border: 0; padding: 0; margin: 0; }
.verdicts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.verdict-option {
  margin: 0; display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 0.75rem; font-weight: 700;
  border: 2px solid var(--do-rule); cursor: pointer;
}
.verdict-option:hover { border-color: var(--do-fg-subtle); }
.verdict-option kbd { margin-left: auto; }
.verdict-option:has(input:checked) { background: var(--do-surface-2); }
.verdict-option.correct:has(input:checked) { border-color: var(--do-status-good); color: var(--do-status-good); }
.verdict-option.wrong:has(input:checked) { border-color: var(--do-status-critical); color: var(--do-status-critical); }
.verdict-option.unclear:has(input:checked) { border-color: var(--do-status-warn); color: var(--do-status-warn); }
.verdict-option.correct input { accent-color: var(--do-status-good); }
.verdict-option.wrong input { accent-color: var(--do-status-critical); }
.verdict-option.unclear input { accent-color: var(--do-status-warn); }
.union-choice { margin-top: 1.25rem !important; }
.union-choice legend { font-weight: 700; }
.checks { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-top: 0.5rem; }
.checks label { margin: 0; font-weight: 400; display: flex; gap: 0.4rem; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }

.pane.pdf {
  position: sticky; top: 1.25rem; height: calc(100vh - 2.5rem - 3.5rem); display: flex; flex-direction: column;
  border: 1px solid var(--do-rule); background: var(--do-surface);
}
.pdf-bar {
  display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.9rem;
  background: var(--do-fg); color: var(--do-bg); font-size: 0.88rem;
}
.pdf-bar span { font-size: 0.69rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; align-self: center; }
.pdf-bar a { text-decoration-color: var(--do-yellow); }
.pane.pdf iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.pdf-hint { margin: 0; padding: 0.45rem 0.9rem; border-top: 1px solid var(--do-rule); }
.pdf-missing { padding: 1.5rem; max-width: 46ch; }
.pdf-missing p { margin: 0 0 0.5rem; }
.pdf-missing strong {
  font-family: var(--do-font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: var(--do-track-display);
}

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; align-items: start; }
  .split { grid-template-columns: 1fr; padding: 1rem; }
  .pane.pdf { position: static; height: 75vh; }
  .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .page { padding: 1.25rem 1rem 3rem; }
  .verdicts { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: 0.4rem; }
  .verdict-option kbd, .actions kbd { display: none; }
  .brand-app { display: none; }
}
