/* LienGuard dashboard: the "warm ledger" design system from AGENTS.md.
 *
 * A well-kept paper ledger in a sunlit site office. Light brown, soft, calm.
 * The dollars-at-risk figure is the protagonist and everything else defers to
 * it. One humanist sans, tabular figures on every money and date value, soft
 * radii, one faint shadow, no pure white and no pure black anywhere.
 *
 * The palette below is copied from AGENTS.md unchanged. Three derived tokens are
 * added and only three, each documented at its definition. Two of them exist for
 * contrast: the burnt sienna and the olive are correct at display size but land
 * at 4.4:1 and 4.0:1 against the parchment, which is under WCAG AA for body
 * text, so small labels use a darkened shade of the same hue while the big
 * number uses --risk itself. The third is the enforcement-window colour, derived
 * from --accent rather than imported from outside the family.
 *
 * One theme, locked. AGENTS.md describes a sunlit paper ledger, so there is no
 * dark mode here and the page never inverts.
 */

:root {
  --bg: #F6F1E7;
  --bg-raised: #EFE6D8;
  --ink: #3E3226;
  --ink-soft: #6B5D4B;
  --accent: #A67C52;
  --accent-deep: #7C5A3A;
  --line: #DDD0BC;
  --risk: #B4552D;
  --ok: #6F7D4F;

  /* Same hue as --risk, darkened to 6.4:1 on the parchment so a 13px label is
   * readable. --risk is unchanged and is what the protagonist number uses. */
  --risk-ink: #8F3F1F;
  /* Same, for the olive: 5.9:1 rather than 4.0:1. */
  --ok-ink: #55613A;

  /* The enforcement window, and the only colour on this page that AGENTS.md
   * does not name.
   *
   * SPEC_FINAL.md section 7 item 2 asks for ENFORCE_WINDOW in amber. The
   * AGENTS.md palette is a paper ledger and has no amber, and AGENTS.md wins on
   * conflict, so this is derived from --accent rather than imported: the leather
   * brown #A67C52 is hue 30, saturation .34, lightness .49; this is the same
   * hue turned to 40 (toward gold, which is as amber as this family goes),
   * saturation .72, lightness .31. It lands at 4.9:1 on the parchment, so it is
   * readable as a small label as well as usable as a lane rail, and it is
   * plainly a different colour from both --risk and --accent at a glance.
   *
   * It earns a token because ENFORCE_WINDOW is the state the product thesis
   * rests on: a perfected lien is one more right that silently dies, and it
   * should not be drawing in the same colour as a deadline that is merely
   * running. */
  --enforce: #886216;

  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(62, 50, 38, .08);

  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Noto Sans",
    "Helvetica Neue", Arial, sans-serif;
}

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Money and dates. Columns of figures have to line up in a ledger. */
.num {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: 0;
}

.quiet {
  color: var(--ink-soft);
}

.tone-risk {
  color: var(--risk-ink);
}

.tone-ok {
  color: var(--ok-ink);
}

.tone-quiet {
  color: var(--ink-soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

.plain-link {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.plain-link:hover {
  color: var(--ink);
}

/* -- the shell ---------------------------------------------------------- */

.banner {
  margin: 0;
  padding: 9px 24px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 2;
}

.masthead {
  display: flex;
  align-items: baseline;
  gap: 16px;
  height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}

.masthead-page {
  font-size: 14px;
  color: var(--ink-soft);
}

/* Pushed to the right end of the masthead so the page name stays next to the
 * wordmark. One link, not a navigation bar: there are two screens to reach from
 * here and a bar of one item is a bar pretending to be a system. */
.masthead-aside {
  margin-left: auto;
  font-size: 13px;
}

.sheet {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 8px;
  animation: settle 160ms ease-out both;
}

/* The only motion on this page, and it runs once when the page loads. The two
 * regions swap their contents every couple of seconds, and a fade on that would
 * be a flicker on a timer rather than something that told the reader anything. */
@keyframes settle {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet {
    animation: none;
  }
  * {
    transition-duration: 0ms !important;
  }
}

.region + .region {
  margin-top: 56px;
}

.region-title {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.colophon {
  max-width: 1180px;
  margin: 56px auto 0;
  padding: 20px 24px 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
}

.colophon p {
  margin: 0 0 6px;
  max-width: 68ch;
}

/* -- the protagonist ---------------------------------------------------- */

.ledger-head {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 13px;
}

.ledger-head b {
  color: var(--ink);
  font-weight: 600;
}

.protagonist {
  margin: 0 0 24px;
}

.protagonist-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.protagonist-number {
  margin: 2px 0 10px;
  color: var(--risk);
  font-size: clamp(52px, 8vw, 88px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.02em;
}

.protagonist-note {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 13px;
}

/* Where the figure came from. Quieter than the note above it, because a
 * foreman reads the note and an auditor reads this. */
.protagonist-source {
  margin: 6px 0 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 12px;
}

.tallies {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--ink-soft);
}

.tally b {
  font-weight: 600;
  font-size: 16px;
}

/* -- the project ledger -------------------------------------------------- */

/* The radius and the border live on a wrapper rather than on the table.
 * border-radius does not clip a table's own corners, so a rounded table with
 * square first and last cells is what that would actually look like. */
.ledger-wrap {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* Clips the corners so the radius is real, and gives the table somewhere to
   * go on a window too narrow for seven columns but too wide to stack. */
  overflow-x: auto;
}

.ledger {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.ledger thead th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
}

.ledger tbody tr + tr th,
.ledger tbody tr + tr td {
  border-top: 1px solid var(--line);
}

.ledger tbody th,
.ledger tbody td {
  padding: 14px 16px;
  vertical-align: top;
  font-weight: 400;
  text-align: left;
}

/* No row hover tint. The project id is a link and carries its own hover; the
 * rest of the row is inert text, and a highlight that followed the cursor over
 * inert text would be decoration pretending to be a control. */

.cell-project a {
  color: var(--ink);
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.cell-project a:hover {
  color: var(--accent-deep);
  text-decoration-color: var(--accent-deep);
}

.ledger .right {
  text-align: right;
  white-space: nowrap;
}

.cell-project b {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.cell-deadline {
  min-width: 190px;
}

.deadline-rule {
  display: block;
  color: var(--ink);
}

.sub {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}

.pill {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  /* One radius system, 10 to 14px per AGENTS.md. On a chip this height that
   * reads as a soft pill without introducing a second shape language. */
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 12px;
  font-weight: 600;
}

.footnote {
  margin: 14px 0 0;
  max-width: 68ch;
  font-size: 13px;
}

/* -- the activity feed --------------------------------------------------- */

.feed {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-line {
  padding: 12px 0 12px 16px;
  border-left: 2px solid var(--line);
}

.feed-line + .feed-line {
  border-top: 1px solid var(--line);
}

.feed-line.tone-risk {
  border-left-color: var(--risk);
}

.feed-line.tone-ok {
  border-left-color: var(--ok);
}

/* A feed line is assembled in web/fleet.py as one string, so a dollar figure
   inside it cannot carry its own .num span. Tabular figures go on the whole
   line instead: the money and the months line up, and the prose around them is
   unaffected. */
.feed-headline {
  margin: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums lining-nums;
}

.feed-project {
  font-weight: 600;
  color: var(--ink);
}

/* A note is whole sentences or nothing (web/readers.py), so one sentence longer
   than the display target renders whole and the paragraph carries it. Wrapping
   anywhere is what keeps a stored value with no spaces in it inside the column
   instead of pushing the page sideways. */
.feed-note {
  margin: 4px 0 0;
  max-width: 82ch;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums lining-nums;
}

.feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

/* -- the project detail head --------------------------------------------- */

.detail-name {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}

/* -- the rights timeline (project detail) -------------------------------- */

/* One lane per right, deliberately not a table. The fleet screen is a ledger of
 * projects and reads as columns; this is one project's state machine and reads
 * as a stack of rails, so the two screens do not look like the same list twice.
 *
 * The rail carries the state colour. It is a border rather than a background
 * because a full tint behind ten lanes would make the page a colour chart, and
 * the money is still meant to be the protagonist. */

.lanes {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The rail itself, shared by the timeline's lanes and by the health view's
 * rights tally so one state has one colour across the whole dashboard.
 *
 * Declared before the colour rules and reaching the tally's children through
 * the child combinator rather than through a type selector, so that a colour
 * class carries the same specificity as this and wins on source order. A base
 * rule of higher specificity here would repaint every rail back to the hairline. */
.lane,
.tally-grid > * {
  border-left: 3px solid var(--line);
}

/* The approval screen's checks ride the same rails, so a passing check and a
 * preserved right are the same colour across the dashboard. Declared here,
 * before the colour classes, and as its own rule rather than folded into the
 * selector above: this one has to stay ahead of .lane-preserved and
 * .lane-lapsed in source order for the same equal-specificity reason, and the
 * rule above is pinned by a test that reads its selector list literally. */
.check {
  border-left: 3px solid var(--line);
}

.lane {
  padding: 14px 0 14px 16px;
}

.lane + .lane {
  border-top: 1px solid var(--line);
}

.lane-dormant {
  border-left-color: var(--line);
}

.lane-armed {
  border-left-color: var(--ink-soft);
}

.lane-due-soon {
  border-left-color: var(--accent);
}

.lane-critical {
  border-left-color: var(--risk);
}

.lane-preserved {
  border-left-color: var(--ok);
}

.lane-enforce {
  border-left-color: var(--enforce);
}

.lane-lapsed {
  border-left-color: var(--risk);
}

.lane-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}

.lane-rule {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.lane-month {
  font-size: 13px;
  color: var(--ink-soft);
}

/* The state chip. Same shape language as the fleet pill.
 *
 * It takes its tone as its own class rather than inheriting one from an
 * ancestor, because the service ledger uses the same chip for a letter's status
 * and a letter is not on a lane. One chip, one mechanism, in both places.
 *
 * The colours here are the readable variants (--risk-ink, --ok-ink) rather than
 * the rail colours, because this is 12px text and the rails are not text. */
.lane-state {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.chip-dormant,
.chip-armed {
  color: var(--ink-soft);
  border-color: var(--line);
}

.chip-critical,
.chip-lapsed {
  color: var(--risk-ink);
  border-color: var(--risk-ink);
}

.chip-due-soon {
  color: var(--accent-deep);
  border-color: var(--accent-deep);
}

.chip-preserved {
  color: var(--ok-ink);
  border-color: var(--ok-ink);
}

.chip-enforce {
  color: var(--enforce);
  border-color: var(--enforce);
}

/* The four facts a foreman reads off a lane: when it is due, when that rolled
 * to, how long is left, and what it protects. A grid rather than a flex row so
 * the columns line up down the whole timeline the way a ledger's do. */
.lane-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 20px;
  margin: 8px 0 0;
  max-width: 720px;
}

.lane-fact {
  font-size: 13px;
}

.lane-fact-label {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.lane-fact-value {
  display: block;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}

.lane-fact-value.tone-risk {
  color: var(--risk-ink);
}

/* One line under a lane whose state was written before its deadline passed.
 * Held in the soft ink rather than the sienna: the row is not at greater risk
 * than the number beside it already says, it is a lane whose label is older
 * than its count of days, so it reads as a note and not as an alarm. */
.lane-stale {
  margin: 8px 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--line);
  max-width: 68ch;
  color: var(--ink-soft);
  font-size: 12px;
}

.lane-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.lane-meta .num {
  font-variant-numeric: tabular-nums lining-nums;
}

/* -- the service ledger and the claim file ------------------------------- */

.section {
  margin-top: 48px;
}

.section-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.section-lede {
  margin: 0 0 16px;
  max-width: 72ch;
  color: var(--ink-soft);
  font-size: 13px;
}

.proof-note {
  margin: 14px 0 0;
  max-width: 72ch;
  color: var(--ink-soft);
  font-size: 12px;
}

/* -- the health view ------------------------------------------------------ */

/* Readings on the left, the things nothing measures on the right, so a reader
 * never has to work out which of the two a line is. */
.readings {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.reading {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.reading-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.reading-value {
  margin: 4px 0 0;
  font-size: 17px;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}

.reading-note {
  margin: 5px 0 0;
  max-width: 78ch;
  color: var(--ink-soft);
  font-size: 13px;
}

.reading-value.tone-risk {
  color: var(--risk-ink);
}

/* Small figures on rails, used twice: rights by state, and the events sitting
 * unacknowledged on the bus. Ten small numbers rather than a chart, because a
 * bar chart of ten bars where most are zero says less than the numbers do. */
.tally-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tally-grid li {
  padding: 8px 0 8px 12px;
}

.tally-count {
  display: block;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}

.tally-name {
  display: block;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.tally-sub {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: .06em;
  overflow-wrap: anywhere;
}

/* Halted agent tasks, one per row, inside the circuit-breaker reading. A list
 * rather than a tally grid: each one carries a sentence about why it stopped,
 * and a count on its own would tell an operator a task is stuck without telling
 * them which. The left rule is the only ornament, and it is in the risk tone
 * because a halt is money standing still. */
.halt-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.halt {
  margin: 0 0 10px;
  padding: 10px 0 10px 12px;
  border-left: 2px solid var(--risk);
  background: var(--bg-raised);
  border-radius: 0 10px 10px 0;
}

.halt:last-child {
  margin-bottom: 0;
}

.halt-task {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
  overflow-wrap: anywhere;
}

.halt-body {
  margin: 4px 8px 0 0;
  max-width: 78ch;
  color: var(--ink-soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* The subsystems the spec names and nothing measures. Set apart from the
 * readings above on purpose: an unmeasured zero printed next to measured ones
 * is the failure this screen exists to catch. */
.absences {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.absence {
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}

.absence-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.absence-body {
  margin: 4px 0 0;
  max-width: 78ch;
  color: var(--ink-soft);
  font-size: 13px;
}

/* -- the approval screen -------------------------------------------------- */

/* The affidavit itself. Rendered in one block with the line breaks the template
 * loader produced, because the statutory wording is not this stylesheet's to
 * reflow. pre-wrap keeps every line the form has and still wraps a long line
 * rather than putting a horizontal scrollbar under a legal document. */
.document {
  margin: 0;
  padding: 28px 30px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums lining-nums;
}

/* A merge value on the sources table, set apart from the reference under it so
 * a reader can see at a glance which is the claim and which is the citation. */
.field-value {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.provenance {
  color: var(--ink-soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* One check per rail, the same rails the rights timeline uses, so a passing
 * check and a preserved right read as the same colour on both screens. */
.checks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.check {
  padding: 14px 0 14px 16px;
}

.check + .check {
  border-top: 1px solid var(--line);
}

.check-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}

.check-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.check-basis {
  margin: 6px 0 0;
  max-width: 78ch;
  color: var(--ink-soft);
  font-size: 13px;
}

.check-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* What 12.002 costs. Given the width of a paragraph a person will actually
 * read, and none of the shrinking that would signal small print. */
.acknowledgment-body {
  margin: 0 0 14px;
  max-width: 74ch;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

.refusal {
  margin: 16px 0 0;
  padding: 12px 16px;
  max-width: 74ch;
  background: var(--bg-raised);
  border: 1px solid var(--risk-ink);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* The other half of .refusal: something went right, said in the same shape and
 * in the olive the rest of the app uses for a preserved right. */
.accepted {
  margin: 16px 0 0;
  padding: 12px 16px;
  max-width: 74ch;
  background: var(--bg-raised);
  border: 1px solid var(--ok-ink);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.tickbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  max-width: 74ch;
  font-size: 14px;
}

.tickbox input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-deep);
  flex: none;
}

/* Label above the control, help under it. */
.field {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
  max-width: 620px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.field-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 15px;
}

.field-input:focus-visible {
  border-color: var(--accent-deep);
}

.field-help {
  color: var(--ink-soft);
  font-size: 12px;
}

/* The ingest form. Quiet on purpose: the dollars-at-risk figure at the top of
 * the page is the protagonist and an upload box is a filing cabinet drawer, so
 * it sits on the same tan card every other grouped block uses and asks for
 * nothing. */
.upload-form {
  margin: 20px 0 0;
  padding: 24px 24px 8px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 680px;
}

/* A native file control cannot be restyled past this without replacing it, and
 * replacing it costs keyboard and screen reader behaviour that works. So the
 * box around it matches every other input and the button inside it is left to
 * the platform. */
.upload-form input[type="file"] {
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
}

/* A content hash is 71 characters with no spaces in it. Allowed to break
 * anywhere so it wraps inside its cell instead of widening the table, and shown
 * whole rather than shortened: it is the provenance reference, and half of one
 * cites nothing. */
.hash {
  overflow-wrap: anywhere;
  color: var(--ink-soft);
}

/* The pad. A strip of parchment with a rule under it, which is what a person
 * expects to sign on. touch-action off so a drag draws instead of scrolling. */
.pad {
  display: block;
  width: 100%;
  max-width: 600px;
  height: 180px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  touch-action: none;
  cursor: crosshair;
}

.pad-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 0;
}

.actions {
  margin: 24px 0 0;
}

.button {
  padding: 11px 20px;
  background: var(--accent-deep);
  color: var(--bg);
  border: 1px solid var(--accent-deep);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease-out;
}

.button:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.button:active {
  transform: translateY(1px);
}

.button[disabled] {
  background: var(--bg-raised);
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  cursor: not-allowed;
  transform: none;
}

.button-quiet {
  padding: 7px 14px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.button-quiet:hover {
  border-color: var(--accent-deep);
  color: var(--accent-deep);
}

/* The signed state. The capture is shown at the size it was taken, on the same
 * parchment the pad used, so the mark on screen is the mark that was stored. */
.signed-block {
  padding: 22px 24px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 660px;
}

.signed-line {
  margin: 0 0 12px;
  font-size: 15px;
}

.signature-image {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--accent);
  border-radius: var(--radius-sm);
}

.signed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

/* -- the statutory notice on an unconditional release ---------------------- */

/* Section 53.284(c)(1) and (e)(1) require this notice in bold type at least as
 * large as the largest type used in the document and never smaller than
 * 10-point. A screen has no points, so the rule is honoured the way a screen
 * can: the heaviest weight this stylesheet uses, a size above the body's, and
 * the statute's own line breaks kept rather than reflowed. The reference line
 * above it says what the rule is, so a person printing the form knows what the
 * paper has to carry. */
.notice-header {
  margin: 18px 0 0;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--risk-ink);
  border-radius: var(--radius-sm);
}

.notice-header-ref {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.notice-header-text {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
}

/* -- the waiver guardian -------------------------------------------------- */

/* The card that says what the release in front of this person is. It sits on
 * the raised tan the rest of the page uses for a document rather than a row,
 * because that is what this is: somebody else's paperwork, read. */
.guardian {
  padding: 22px 24px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 78ch;
}

.guardian-headline {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.guardian-source {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.guardian .lane-facts {
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* One flag per block, on a rail in the colour of what it is. Sienna for an
 * objection under the subchapter, leather for a 53.287 exception: the second is
 * not an alarm, it is the statute stepping back, and drawing the two the same
 * way would say they meant the same thing. */
.flags {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  max-width: 78ch;
}

.flag {
  margin: 0 0 14px;
  padding: 16px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.flag:last-child {
  margin-bottom: 0;
}

.flag-red {
  border-left-color: var(--risk-ink);
}

.flag-scope {
  border-left-color: var(--accent-deep);
}

.flag-head {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.flag-cite {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums lining-nums;
}

.flag-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.flag-body {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 14px;
}

.flag-basis {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

/* The document's own words, set apart so nobody mistakes them for ours. */
.flag-quote {
  margin: 10px 0 0;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 13px;
}

/* -- empty and problem states -------------------------------------------- */

.empty {
  padding: 28px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 72ch;
}

.empty-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
}

.empty p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 14px;
}

.empty p:last-child {
  margin-bottom: 0;
}

/* -- narrow screens ------------------------------------------------------ */

@media (max-width: 900px) {
  .sheet {
    padding: 28px 16px 8px;
  }

  .masthead,
  .banner {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* The ledger stops being a grid and becomes one block per project. The
   * column headings go with it, so each value that is not self describing
   * carries its own label from the data-label attribute on its cell. */
  .ledger,
  .ledger thead,
  .ledger tbody,
  .ledger tr,
  .ledger th,
  .ledger td {
    display: block;
  }

  .ledger thead {
    display: none;
  }

  .ledger tbody tr {
    padding: 6px 0;
  }

  .ledger tbody tr + tr {
    border-top: 1px solid var(--line);
  }

  .ledger tbody tr + tr th,
  .ledger tbody tr + tr td {
    border-top: 0;
  }

  .ledger tbody th,
  .ledger tbody td {
    padding: 4px 16px;
  }

  .ledger .right {
    text-align: left;
  }

  .ledger tbody td[data-label]::before {
    content: attr(data-label) " ";
    color: var(--ink-soft);
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  /* Four facts side by side need four columns of room. On a phone they stack
   * into two, which still lines the money up under the days. */
  .lane-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .masthead {
    height: auto;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .masthead-aside {
    margin-left: 0;
    flex-basis: 100%;
  }
}
