/* Warren County PVA — Exonerations.
   One stylesheet for every page. Look: navy sidebar, Public Sans, white cards on a cool grey ground,
   one colour per kind of task. Everything is self-hosted (the app runs on the office network). */

@font-face {
  font-family: "Public Sans";
  src: url("/static/fonts/PublicSans-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/static/fonts/PublicSans-latin-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface-soft: #F8FAFC;
  --ink: #18212F;
  --ink-2: #3F4B5C;
  --muted: #5A6678;
  --line: #DCE2EA;
  --line-soft: #E9EDF2;
  --field: #C9D2DE;
  --accent: #1E3A5F;          /* navy: sidebar, primary buttons */
  --accent-hover: #26497A;
  --accent-soft: #EAF0F7;
  --link: #1E4F8A;
  --gold: #E8C977;
  --danger: #A12C2C;
  --danger-soft: #FBECEC;
  --warn: #9A3412;
  --notice-bg: #FFF7E6;
  --notice-line: #EBCB86;
  --info-bg: #EDF3FA;
  --info-line: #B9CDE4;
  --ok-bg: #E7F4EE;
  --ok-line: #A9D6BE;
  --ok-ink: #14532D;
  /* one colour per kind of task, distinct in lightness as well as hue */
  --k-sign: #8A3D7A;
  --k-send: #B45309;
  --k-wait: #1D5FA6;
  --k-check: #0F766E;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 38, 61, .04);
  --shadow-lift: 0 8px 24px rgba(20, 38, 61, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Public Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: #163B68; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 700; margin: 0; }
h2 { font-size: 19px; line-height: 1.3; font-weight: 700; margin: 0 0 14px; }
h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
b, strong { font-weight: 600; }
:focus-visible { outline: 3px solid #7FA6D6; outline-offset: 2px; }

/* ---------- page shell ---------- */

body.with-side { display: flex; flex-wrap: wrap; align-items: stretch; }

.side {
  flex: 1 1 236px;
  max-width: 272px;
  min-height: 100vh;
  background: var(--accent);
  color: #C8D3E1;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; text-decoration: none; }
.side .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.side .brand-office { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #AFC0D4; }
.side .brand-name { font-size: 17px; font-weight: 700; color: #FFFFFF; }
.side .nav-label { padding: 18px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8EA3BC; }
.side a.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  color: #C8D3E1; text-decoration: none; font-size: 15px;
}
.side a.nav-item svg { flex: none; opacity: .9; }
.side a.nav-item:hover { background: rgba(255, 255, 255, .08); color: #FFFFFF; }
.side a.nav-item[aria-current="page"] { background: rgba(255, 255, 255, .13); color: #FFFFFF; font-weight: 600; }
.side .count {
  margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--gold); color: #14263D; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px;
}
.side .spacer { flex-grow: 1; min-height: 20px; }
.side .who { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 8px; }
.side .avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: #14263D; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.side .who-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.side .who-name { color: #FFFFFF; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side button.link { color: #AFC0D4; font-size: 13px; text-decoration: none; }
.side button.link:hover { color: #FFFFFF; text-decoration: underline; }

/* the bar used on sign-in, the public page and counter tablets */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  padding: 14px 28px; background: var(--accent); color: #FFFFFF;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #FFFFFF; text-decoration: none; font-size: 17px; font-weight: 700; }
.topbar .brand-office { font-weight: 400; color: #AFC0D4; margin-right: 2px; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; font-size: 15px; }
.topbar a { color: #FFFFFF; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

main { flex: 999 1 640px; min-width: 0; width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 40px 64px; }
body.with-side main { margin: 0; }
main.wide { max-width: 1560px; }

@media (max-width: 760px) {
  .side { max-width: none; min-height: 0; flex-basis: 100%; padding: 12px; }
  .side .brand { padding-bottom: 10px; }
  .side .nav-label { display: none; }
  .side .spacer { display: none; }
  main { padding: 20px 16px 48px; }
  .topbar { padding: 12px 16px; }
}

/* ---------- page heading ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.page-head .eyebrow { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.page-head .head-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- surfaces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card > h2:first-child { margin-top: 0; }
.card.narrow { max-width: 420px; margin: 56px auto; padding: 28px; }
.card.narrow h1 { font-size: 26px; margin-bottom: 18px; }
.card.done { text-align: center; }
.card.done h1 { margin-bottom: 12px; }

.notice, .error {
  border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 18px; border: 1px solid;
}
.notice { background: var(--notice-bg); border-color: var(--notice-line); color: #5A3B00; }
.notice.read { background: var(--info-bg); border-color: var(--info-line); color: #193A5E; }
.notice form.inline { margin-left: 8px; }
.error { background: var(--danger-soft); border-color: #E3B5B5; color: var(--danger); }
.field-error { display: block; color: var(--danger); font-weight: 400; font-size: 14px; margin-top: 5px; }
.muted { color: var(--muted); }
.note { margin: -8px 0 16px; }
.center { text-align: center; }
.empty { padding: 56px 0; text-align: center; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); border: 0; }

/* ---------- buttons ---------- */

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2;
  color: #FFFFFF; background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #FFFFFF; }
button.secondary, .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--field); }
button.secondary:hover, .button.secondary:hover { background: #EEF2F7; color: var(--ink); border-color: #AEBACB; }
button.small, .button.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
button.link {
  min-height: 0; padding: 0; background: none; border: 0; border-radius: 0;
  color: var(--link); font-weight: 400; text-decoration: underline;
}
button.link:hover { background: none; color: #163B68; }
.danger-button { background: var(--danger); border-color: var(--danger); }
.danger-button:hover { background: #8A2323; border-color: #8A2323; }
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }

/* ---------- forms ---------- */

label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px;
  padding: 10px 12px; min-height: 44px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--field); border-radius: var(--radius-sm);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #4C7BB5; box-shadow: 0 0 0 3px rgba(76, 123, 181, .22); }
input[type="checkbox"], input[type="radio"] { display: inline-block; width: 18px; height: 18px; min-height: 0; margin: 0 8px 0 0; vertical-align: -3px; accent-color: var(--accent); }
input[type="file"] { padding: 9px; background: var(--surface-soft); }
.card.narrow label { margin-bottom: 16px; }
.card.narrow button[type="submit"] { width: 100%; }
.optional { font-weight: 400; color: var(--muted); }

fieldset { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
legend { padding: 0; margin-bottom: 12px; font-size: 17px; font-weight: 700; color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 18px; align-items: start; }
.span-2 { grid-column: span 2; }
@media (max-width: 560px) { .span-2 { grid-column: auto; } }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; }
.checks-label { flex-basis: 100%; font-size: 14px; font-weight: 600; color: var(--ink-2); }
label.check { font-weight: 400; color: var(--ink); font-size: 15px; align-self: center; }
.record-form { padding: 26px 28px; }
.stack-form label { margin-bottom: 16px; max-width: 440px; }

label.prefilled input:not([type="checkbox"]), label.prefilled select { border-color: #D9A441; background: #FFFBF1; box-shadow: inset 4px 0 0 #D9A441; }
.prefilled-hint { display: block; margin-top: 5px; font-size: 13px; font-weight: 500; color: #7A5600; }
label.check .prefilled-hint { display: inline; margin-left: 6px; }

/* ---------- filters and search ---------- */

.filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.filter input, .filter select { margin: 0; width: auto; flex: 1 1 280px; max-width: 480px; }

.search-hero { text-align: center; padding: 48px 0 32px; }
.search-hero h1 { font-size: 36px; margin-bottom: 12px; }
.search-hero p { max-width: 640px; margin: 0 auto 22px; }
.search-hero form { display: flex; gap: 10px; max-width: 680px; margin: 0 auto; }
.search-hero input { margin: 0; padding: 14px 18px; min-height: 56px; font-size: 18px; border-radius: 12px; }
.search-hero button { min-height: 56px; padding: 0 26px; font-size: 17px; border-radius: 12px; }

/* ---------- tables and lists ---------- */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; background: var(--surface-soft); }
tbody tr:hover td { background: var(--surface-soft); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td input { margin: 0; min-width: 150px; }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
tr.void td { color: var(--muted); }

.pending { list-style: none; margin: 0; padding: 0; }
.pending li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.pending li:last-child { border-bottom: 0; }
.pending li .button { margin-left: auto; }
.pending li > a:first-child { font-weight: 600; text-decoration: none; }

.pager { display: flex; gap: 16px; justify-content: center; align-items: center; color: var(--muted); margin-top: 16px; }

/* ---------- tags and status pills ---------- */

.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 18px; vertical-align: middle;
  color: var(--danger); background: var(--danger-soft); border: 1px solid #E3B5B5;
}
.tag.neutral { color: var(--ink-2); background: #EEF2F7; border-color: var(--line); }

.state { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 20px; white-space: nowrap; border: 1px solid; }
.state.to_send { color: #8A3F06; background: #FFF3DC; border-color: #EBCB86; }
.state.awaiting { color: #174C86; background: #EAF2FB; border-color: #B9CDE4; }
.state.confirmed { color: var(--ok-ink); background: var(--ok-bg); border-color: var(--ok-line); }
.state.unrouted, .state.legacy { color: var(--muted); background: #F1F3F6; border-color: var(--line); }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: #EEF2F7; color: var(--accent); white-space: nowrap; }

/* ---------- record page ---------- */

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 24px; margin: 0; }
.facts dt { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 3px 0 0; font-size: 16px; overflow-wrap: anywhere; }

.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.history li:last-child { border-bottom: 0; }
.history-head b { font-weight: 600; }
.history time { color: var(--muted); font-size: 14px; margin-left: 6px; }
.changes { margin: 6px 0 0; padding-left: 18px; font-size: 15px; overflow-wrap: anywhere; color: var(--ink-2); }
.changes .field { color: var(--muted); }
.changes s { color: var(--muted); }

.offices { list-style: none; margin: 0 0 12px; padding: 0; }
.offices li { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.offices li:first-child { padding-top: 0; }
.office-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; font-size: 16px; }
.office-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 16px; align-items: end; }
.office-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }

.import-problems { margin: 8px 0 0; padding-left: 20px; font-size: 15px; }

details.danger { padding: 18px 24px; }
details.danger summary { cursor: pointer; color: var(--danger); font-weight: 600; }
details.danger p { margin: 12px 0; }
details.danger label { max-width: 480px; margin-bottom: 12px; }

.sign-request { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- uploads ---------- */

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 40px 20px; margin-bottom: 28px; text-align: center;
  background: var(--surface); border: 2px dashed #AEBACB; border-radius: var(--radius);
  transition: background .12s, border-color .12s;
}
.dropzone.over { background: #EDF3FA; border-color: var(--accent); border-style: solid; }
.dropzone.busy { opacity: .7; pointer-events: none; }
.dropzone p { margin: 0; }
.dropzone-title { font-size: 22px; font-weight: 700; }
.dropzone-hint { color: var(--muted); }
.dropzone-status:empty { display: none; }
.dropzone-status { font-weight: 600; }
.dropzone.has-error .dropzone-status { color: var(--danger); }
.dropzone.compact { padding: 20px; margin: 16px 0 0; }
.dropzone.compact .dropzone-title { font-size: 16px; }
label.button { margin: 0; font-size: 15px; }
label.button:focus-within { outline: 3px solid #7FA6D6; outline-offset: 2px; }

.review { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.review-pdf { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.review-pdf-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.review-pdf-head .filename { font-weight: 600; overflow-wrap: anywhere; }
.review-pdf-head a { margin-left: auto; white-space: nowrap; }
.review-pdf iframe { display: block; width: 100%; height: 70vh; border: 0; background: #525659; }
@media (min-width: 1000px) {
  .review { grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr); }
  .review-pdf { position: sticky; top: 16px; }
  .review-pdf iframe { height: calc(100vh - 110px); }
}

/* ---------- Today ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
a.tile {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 18px 16px; min-height: 132px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
a.tile:hover { border-color: #9AA8BA; color: var(--ink); }
a.tile[aria-current="true"] { border: 2px solid var(--k); padding: 17px 17px 15px; box-shadow: var(--shadow-lift); }
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.tile-label::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--k); }
.tile-count { font-size: 38px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-hint { font-size: 13px; color: var(--muted); }
.k-sign { --k: var(--k-sign); }
.k-send { --k: var(--k-send); }
.k-wait { --k: var(--k-wait); }
.k-check { --k: var(--k-check); }

.worklist { padding: 0; overflow: hidden; }
.worklist-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.worklist-head h2 { margin: 0; }
.work { list-style: none; margin: 0; padding: 0; }
.work li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 22px; border-bottom: 1px solid var(--line-soft); }
.work li:last-child { border-bottom: 0; }
.work li:hover { background: var(--surface-soft); }
.work .what { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.work .what a { font-size: 16px; font-weight: 600; text-decoration: none; color: var(--ink); }
.work .what a:hover { text-decoration: underline; }
.work .what span { font-size: 14px; color: var(--muted); }
.work .where { flex: 1 1 220px; display: flex; flex-wrap: wrap; gap: 6px; }
.work .when { flex: 0 0 160px; font-size: 14px; color: var(--muted); }
.work .when.late { color: var(--warn); font-weight: 600; }
.work .do { flex: 0 0 auto; display: flex; gap: 8px; }
.work .do .button, .work .do button { min-width: 128px; }
.worklist .empty { padding: 48px 22px; }
.worklist-foot { padding: 14px 22px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line-soft); }
@media (max-width: 760px) { .work .when { flex-basis: auto; } .work .do { width: 100%; } .work .do .button, .work .do button { flex: 1; } }

/* ---------- public search: results stack into cards on a phone ---------- */

@media (max-width: 640px) {
  .search-hero { padding: 24px 0 18px; }
  .search-hero h1 { font-size: 26px; }
  .search-hero form { flex-direction: column; align-items: stretch; }
  .table-wrap:has(table.stack) { background: none; border: 0; box-shadow: none; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; padding: 6px 14px; }
  table.stack td { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; text-align: right; overflow-wrap: anywhere; }
  table.stack td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; text-align: left; }
}

/* ---------- counter tablets ---------- */

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 20px 0; }
.choice { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 36px 28px; text-align: center; text-decoration: none; color: var(--ink); }
.choice:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); color: var(--ink); }
.choice-name { font-size: 32px; font-weight: 700; line-height: 1.15; color: var(--accent); }
.choice-blurb { font-size: 18px; }
.choice-code { margin-top: 6px; font-size: 13px; color: var(--muted); }
.waiting li .who { font-weight: 600; }

.counter-form label.check.heads { grid-column: 1 / -1; font-weight: 600; margin-top: 8px; }
.counter-form label.under { padding-left: 14px; border-left: 3px solid var(--line); }
.counter-form label.check.under { align-self: end; padding-bottom: 11px; }
.by-signer { margin-left: 4px; padding: 0 8px; font-size: 12px; font-weight: 500; color: var(--k-sign); border: 1px solid #DDB7D4; border-radius: 999px; white-space: nowrap; }
.deputy-password { max-width: 440px; }

.sigpad { margin: 0 0 24px; max-width: 680px; }
.sigpad-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; margin-bottom: 8px; }
.sigpad-head button.link { margin-left: auto; }
.sigpad canvas { display: block; width: 100%; height: 170px; background: #FFFFFF; border: 2px dashed #AEBACB; border-radius: var(--radius-sm); touch-action: none; cursor: crosshair; }
.sigpad.signed canvas { border-style: solid; border-color: var(--accent); }
.sigpad-typed { margin-top: 10px; max-width: 380px; }
.sig-state { margin-left: auto; padding: 1px 10px; font-size: 13px; font-weight: 600; border-radius: 999px; border: 1px solid; }
.sig-state.done { display: none; color: var(--ok-ink); background: var(--ok-bg); border-color: var(--ok-line); }
.sig-state.todo { color: #8A3F06; background: #FFF3DC; border-color: #EBCB86; }
.sigpad.signed .sig-state.done { display: inline-block; }
.sigpad.signed .sig-state.todo { display: none; }
.handoff-open { min-height: 52px; font-size: 18px; padding: 0 24px; }
.sigpad.pva details { margin-top: 10px; }
.sigpad.pva summary { cursor: pointer; color: var(--link); }
.sigpad.pva details > div { margin-top: 10px; }

body.handoff-active { overflow: hidden; }
.handoff { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; padding: max(28px, env(safe-area-inset-top)) 24px 28px; }
.handoff[hidden], .handoff [hidden] { display: none; }
.handoff-sign, .handoff-thanks { max-width: 920px; margin: 0 auto; }
.handoff h2 { font-size: 30px; margin: 8px 0 14px; }
.handoff h3 { font-size: 17px; margin: 0 0 8px; }
.handoff h3[hidden] { display: none; }
.handoff-form { color: var(--muted); margin: 0; }
.handoff-statement { font-size: 19px; line-height: 1.55; margin: 0 0 18px; }
.handoff canvas { height: min(46vh, 360px); border-width: 3px; }
.handoff-actions { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; }
.handoff-actions button { min-height: 56px; font-size: 19px; padding: 0 30px; }
.handoff-thanks { text-align: center; padding-top: 18vh; }
.handoff-thanks p { font-size: 22px; margin: 0 0 40px; }
.handoff-own { margin: 0 0 22px; padding: 16px 18px; background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); }
.handoff-own p { margin: 0 0 12px; }
.handoff-own input { font-size: 18px; padding: 12px; }
.handoff-own[hidden] { display: none; }
.handoff-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 22px; margin: 0 0 18px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.handoff-summary:empty { display: none; }
.handoff-summary dt { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.handoff-summary dd { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.form-pages img, .handoff-pages img { display: block; width: 100%; max-width: 900px; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #FFFFFF; }
.handoff-pages { margin-bottom: 18px; }

.signature-preview { display: block; max-width: 320px; max-height: 140px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #FFFFFF; margin-bottom: 10px; }

/* the one-line upload strip on Today */
.dropzone-text { display: flex; flex-direction: column; gap: 4px; }
.dropzone.strip { flex-direction: row; flex-wrap: wrap; justify-content: space-between; text-align: left; padding: 16px 20px; margin-bottom: 0; border-width: 1.5px; }
.dropzone.strip .dropzone-title { font-size: 16px; }
.dropzone.strip .dropzone-hint { font-size: 14px; }
.dropzone.strip .dropzone-status { flex-basis: 100%; }
.history .changes li { padding: 2px 0; border: 0; }
.counter-form .grid { align-items: end; }

/* the sidebar sits beside the page down to tablet width, then folds into a compact bar */
main { flex-basis: 480px; }
@media (max-width: 760px) {
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; }
  .side .brand { flex-basis: 100%; padding: 2px 6px 8px; }
  .side a.nav-item { padding: 8px 10px; font-size: 14px; gap: 8px; }
  .side .who { flex-basis: 100%; border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 6px; padding: 8px 6px 0; }
}

.notice.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); font-weight: 500; }

/* one-drop confirm */
.confirm-what { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.confirm-what .kind { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--k-check); }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 6px; }
.choice-list label { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 400; color: var(--ink); cursor: pointer; }
.choice-list label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice-list input { margin-top: 3px; }
.choice-list .sub { display: block; font-size: 14px; color: var(--muted); }
.office-picks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 8px; }
.confirm-section { margin-bottom: 22px; }
.confirm-section h3 { margin-bottom: 10px; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }

/* Send to the offices */
.mail-pick { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--ink); margin: 0 0 14px; cursor: pointer; }
.mail-pick input { margin-top: 4px; }
.mail-pick .sub { display: block; font-size: 14px; color: var(--muted); }
.mail-pick .sub.warn { color: var(--warn); }
.mail-head { display: grid; gap: 6px; margin: 0 0 14px; }
.mail-head div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.mail-head dt { font-size: 13px; font-weight: 600; color: var(--muted); }
.mail-head dd { margin: 0; overflow-wrap: anywhere; }
.mail-body { margin: 0; padding: 14px 16px; background: var(--surface-soft); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  font: inherit; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.small-print { display: block; font-size: 13px; font-weight: 400; margin-top: 4px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }

/* The confirm screen: a handful of facts, where it goes, one button */
.confirm-card .facts { grid-template-columns: 1fr 1fr; }
.more-facts { margin: 14px 0 20px; }
.more-facts summary { cursor: pointer; color: var(--link); font-size: 15px; }
.more-facts .facts { margin-top: 14px; }
.goes-to { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.goes-to label { flex: 1; margin: 0; }
.goes-label { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.goes-offices { display: flex; gap: 6px; flex-wrap: wrap; }
.wrong-file { margin-top: 12px; text-align: right; }
button.danger-link { color: var(--danger); }

/* Setup hub, and a calmer record page */
.setup-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
a.setup-item { display: block; text-decoration: none; color: var(--ink); margin: 0; }
a.setup-item:hover { border-color: var(--accent); }
a.setup-item b { display: block; font-size: 17px; color: var(--accent); margin-bottom: 4px; }
a.setup-item span { color: var(--muted); font-size: 15px; }
.office-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.office-when { font-size: 14px; }
.office-do { margin-left: auto; }
.office-edit summary { cursor: pointer; color: var(--link); font-size: 14px; margin-top: 4px; }
.office-edit .office-form { margin-top: 10px; }
.history-card summary { cursor: pointer; display: flex; align-items: baseline; gap: 10px; }
.history-card summary h2 { margin: 0; display: inline; }
.history-card[open] summary { margin-bottom: 12px; }

/* The taxpayer's signing screen: phone, date, one big box, one button */
.sign-simple { display: grid; gap: 16px; max-width: 760px; }
.sign-simple .card { margin: 0; }
.sign-simple .sign-box canvas { height: min(40vh, 300px); border-width: 3px; }
.sign-simple .sign-box .sigpad-head b { font-size: 22px; }
.sign-simple .sign-details input { font-size: 20px; padding: 14px; }
.sign-submit { min-height: 60px; font-size: 20px; padding: 0 44px; }
.staff-options summary { cursor: pointer; color: var(--link); }
.see-form { max-width: 760px; margin-top: 22px; }
.see-form summary { cursor: pointer; color: var(--link); }
.see-form .form-pages { margin-top: 14px; }
.reset-form { margin-right: 8px; }
.reset-form input { padding: 6px 10px; font-size: 14px; }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid var(--ok-line); }


/* ---------- tidy-up: a bigger drop box and room between things ---------- */
.page-head { margin-bottom: 24px; }

.dropzone.strip {
  flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 20px 26px;
  min-height: 140px; padding: 34px 38px; border-width: 2px; border-radius: var(--radius);
}
.dropzone.strip .dropzone-icon { flex: none; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.dropzone.strip .dropzone-text { flex: 1 1 300px; gap: 6px; }
.dropzone.strip .dropzone-title { font-size: 21px; }
.dropzone.strip .dropzone-hint { font-size: 15px; line-height: 1.45; }
.dropzone.strip label.button { margin-left: auto; min-height: 50px; padding: 0 30px; font-size: 16px; }
.dropzone.strip.over { border-style: solid; }
.dropzone.compact { padding: 28px 24px; }
.dropzone.strip + * { margin-top: 26px; }

.filter { margin: 16px 0 24px; align-items: stretch; }
.filter input, .filter select, .filter button { min-height: 46px; margin: 0; }

label.field { margin-bottom: 22px; }
.small-print { margin-top: 6px; }

table td.nowrap { white-space: nowrap; }
.table-wrap td:first-child { white-space: nowrap; }

.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.row-actions form { display: flex; align-items: center; gap: 8px; margin: 0; }
.row-actions input { width: 150px; min-width: 0; min-height: 36px; padding: 6px 10px; font-size: 14px; margin: 0; }
.reset-form { margin-right: 0; }

.office-edit summary { margin-top: 10px; }
.offices li { padding-bottom: 14px; }

.sign-wait { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.sign-wait-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.print-steps { margin: 18px 0 0; padding-left: 22px; display: grid; gap: 8px; max-width: 760px; }
.print-steps code { background: var(--surface-soft); padding: 1px 6px; border-radius: 6px; font-size: 14px; }
