/**
 * ClaimSim design system.
 *
 * One institutional green, white paper, near-black warm ink. Green means
 * primary action or current/complete state and nothing else; amber, red and
 * blue are status semantics only and never appear on a button or in navigation.
 *
 * Two background values per screen — the canvas and the surface — plus #FBFBF9
 * for table headers and inset panel footers. No gradients, no glow, no dark
 * mode. This is a system of record: the job is to make a hundred fields legible
 * at a glance, not to be interesting.
 *
 * The FNOL runner (styles.css) is deliberately not this. It is a dark call
 * console, siloed from the claims platform on purpose.
 */

:root {
  --green-900: #0D3222;
  --green-800: #14532D;
  --green-700: #1A6638;
  --green-600: #248246;
  --green-tint: #E9F1EB;
  --green-tint-2: #F3F8F4;

  --ink: #12140F;
  --ink-2: #3A3F38;
  --muted: #6E756A;
  --faint: #9AA095;

  --bg: #F6F6F3;
  --surface: #FFFFFF;
  --inset: #FBFBF9;
  --line: #E6E6E1;
  --line-2: #F0F0EC;

  --amber: #B4690E;      --amber-tint: #FDF3E4;  --amber-line: #F1E0C4;
  --red: #B03A2B;        --red-tint: #FBEDEA;    --red-line: #F0D5D0;
  --blue: #3A5A8C;       --blue-tint: #EDF1F8;   --blue-line: #D9E2F0;
  --green-line: #CFE3D6;

  --r: 10px;
  --shadow: 0 1px 2px rgba(18, 20, 15, .04), 0 1px 1px rgba(18, 20, 15, .03);
  --ui: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }

/* The body grows with its content. A body with its own background does not
   hand it to the canvas, so a body pinned to one viewport paints the page for
   one screen and lets whatever is behind it through the rest. */
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-900); text-decoration: underline; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hide, [hidden] { display: none !important; }

/* ------------------------------------------------------------------ shell */
/* Only .scroll scrolls. The sidebar and top bar are permanently visible. */
/*
 * `minmax(0, 1fr)`, never plain `1fr`.
 *
 * A `1fr` track floors at min-content, so a single wide table inside it makes
 * the whole column wider than the screen and the page — sidebar, top bar and
 * all — starts scrolling sideways. The zero minimum lets the track shrink and
 * hands the overflow to the one element that should own it.
 */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); height: 100vh; overflow: hidden; }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; }
.brand:hover { text-decoration: none; }
.mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--green-800); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; letter-spacing: -.02em;
}
.brand b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; display: block; line-height: 1.1; color: var(--ink); }
.brand span { font-size: 11.5px; color: var(--muted); display: block; }

.navwrap { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.navlabel { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 16px 8px 7px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--green-tint); color: var(--green-900); font-weight: 600; }
.nav a.on svg { color: var(--green-700); }
.nav svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--faint); }
.nav .ct { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav a.on .ct { color: var(--green-700); }

.sidefoot { border-top: 1px solid var(--line); padding: 12px 14px 14px; margin: 0 8px; }
.sidefoot .k { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 7px; }
.sidefoot .k b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green-700); border-radius: 99px; }
.sidefoot .s { font-size: 11px; color: var(--faint); margin-top: 7px; }

.main { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.top { height: 58px; flex: 0 0 58px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 22px; }
.top .sp { flex: 1; }
.topsearch {
  flex: 1 1 240px; min-width: 0; max-width: 420px;
  display: flex; align-items: center; gap: 9px;
  white-space: nowrap; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 11px; color: var(--muted); font: 400 13px var(--ui);
}
.topsearch:focus-within { border-color: var(--green-700); background: var(--surface); }
.topsearch svg { width: 15px; height: 15px; flex: 0 0 15px; }
.topsearch input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--ink); outline: none; }
.who { display: flex; align-items: center; gap: 9px; padding-left: 14px; border-left: 1px solid var(--line); }
.av { width: 30px; height: 30px; border-radius: 99px; background: var(--green-800); color: #fff; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; flex: 0 0 30px; }
.who .n { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.who .r { font-size: 11px; color: var(--muted); line-height: 1.2; }

/* The page never scrolls sideways. Anything too wide scrolls inside itself. */
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.pad { padding: 26px 30px 60px; max-width: 1440px; min-width: 0; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 8px; padding: 8px 13px;
  font: 600 13px/1 var(--ui); cursor: pointer;
  text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: #d6d6d0; color: var(--ink); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn.pri { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.btn.pri:hover:not(:disabled) { background: var(--green-900); border-color: var(--green-900); color: #fff; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.btn.icon { padding: 8px; }
.btn[aria-pressed="true"] { border-color: var(--green-700); color: var(--green-900); background: var(--green-tint); }

/* ---------------------------------------------------------------- headers */
.crumb { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.crumb svg { width: 13px; height: 13px; color: var(--faint); }
h1 { font: 700 25px/1.2 var(--ui); letter-spacing: -.02em; margin: 0; }
.sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.sub b { color: var(--ink); font-weight: 600; }
.hrow { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.hrow > div { min-width: 0; }
.hrow .acts { margin-left: auto; display: flex; gap: 8px; padding-top: 4px; flex-wrap: wrap; }
.sub { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ cards */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 17px; box-shadow: var(--shadow); }
.card .ch { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--green-tint); color: var(--green-700); flex: 0 0 28px; }
.ic svg { width: 15px; height: 15px; }
.ic.a { background: var(--amber-tint); color: var(--amber); }
.ic.r { background: var(--red-tint); color: var(--red); }
.ic.b { background: var(--blue-tint); color: var(--blue); }
.card .v { font: 700 30px/1.1 var(--ui); letter-spacing: -.03em; margin: 13px 0 8px; font-variant-numeric: tabular-nums; }
.card .v small { font-size: 16px; font-weight: 600; color: var(--muted); }
.card .f { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }

/* ------------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-top: 26px; overflow-x: auto; }
.tab {
  display: flex; align-items: center; gap: 7px;
  padding: 0 0 11px; font: 500 13.5px var(--ui); color: var(--muted);
  cursor: pointer; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; background: none; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--green-900); font-weight: 600; border-bottom-color: var(--green-700); }
.pill { font-size: 11px; font-weight: 600; background: var(--line-2); color: var(--muted); border-radius: 99px; padding: 1px 7px; min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .pill { background: var(--green-tint); color: var(--green-700); }

/* ---------------------------------------------------------------- filters */
.filters { display: flex; gap: 10px; align-items: center; margin: 18px 0 14px; flex-wrap: wrap; }
.filters .sp { flex: 1; }
.fsearch { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; width: 290px; color: var(--muted); }
.fsearch:focus-within { border-color: var(--green-700); }
.fsearch svg { width: 15px; height: 15px; flex: 0 0 15px; }
.fsearch input { flex: 1; min-width: 0; border: 0; background: none; font: 400 13px var(--ui); color: var(--ink); outline: none; }

/* ------------------------------------------------------------------ table */
.tbl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; max-width: 100%; }
/* Wide regions scroll; they never clip. */
.tscroll { overflow-x: auto; border-radius: var(--r) var(--r) 0 0; }
.tbl table { width: 100%; min-width: 900px; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: var(--inset); white-space: nowrap;
}
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.go { cursor: pointer; }
.tbl tbody tr.go:hover { background: var(--inset); }
.tfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); background: var(--inset); border-radius: 0 0 var(--r) var(--r); }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
/* Identifiers, dates and tags are single tokens: they scroll with the table
   rather than wrapping into two lines and doubling the row height. */
.tbl td .mono, .tbl td .tag, .tbl td .nowrap, .tbl .who2 .n, .tbl .who2 .e { white-space: nowrap; }

.who2 { display: flex; align-items: center; gap: 11px; }
.av2 { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: #fff; flex: 0 0 32px; background: var(--green-800); }
.who2 .n { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.who2 .e { font-size: 12px; color: var(--muted); line-height: 1.3; }

/* State is a tag, never a colour on its own: every tag carries its own text. */
.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; padding: 3px 9px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.tag.g { background: var(--green-tint); color: var(--green-700); border-color: var(--green-line); }
.tag.a { background: var(--amber-tint); color: var(--amber); border-color: var(--amber-line); }
.tag.r { background: var(--red-tint); color: var(--red); border-color: var(--red-line); }
.tag.b { background: var(--blue-tint); color: var(--blue); border-color: var(--blue-line); }
.tag.n { background: var(--line-2); color: var(--muted); border-color: var(--line); }
.dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; flex: 0 0 6px; }

/* ------------------------------------------------------------ stage strip */
.stage { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; overflow-x: auto; box-shadow: var(--shadow); margin-top: 20px; }
.st {
  position: relative; flex: 1 0 auto;
  padding: 11px 12px 11px 24px;
  font: 600 11px var(--ui); letter-spacing: .04em; text-transform: uppercase;
  color: var(--faint); display: flex; align-items: center; gap: 8px;
  white-space: nowrap; background: var(--surface); border: 0; cursor: pointer;
}
.st:first-child { padding-left: 16px; }
.st:after {
  content: ""; position: absolute; top: 50%; right: -10px;
  width: 20px; height: 20px; transform: translateY(-50%) rotate(45deg);
  border-top: 1px solid var(--line); border-right: 1px solid var(--line);
  background: inherit; z-index: 2;
}
.st:last-child:after { display: none; }
.st .n { width: 16px; height: 16px; border-radius: 99px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 9.5px; letter-spacing: 0; color: var(--faint); background: var(--surface); }
.st .n svg { width: 8px; height: 8px; }
.st.done { background: var(--green-tint-2); color: var(--green-700); }
.st.done .n { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.st.now { background: var(--green-800); color: #fff; z-index: 3; }
.st.now:after { border-color: var(--green-800); }
.st.now .n { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .4); color: #fff; }
.st:hover:not(.now) { background: var(--bg); }

.stbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 11px 16px; background: var(--inset); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); font-size: 12.5px; color: var(--muted); }
.stbar b { color: var(--ink); font-weight: 600; }
.stbar .sp { flex: 1; }
.stbar .rule { color: var(--line); }

/* ------------------------------------------------------------ detail grid */
.dgrid { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 20px; margin-top: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
/* A title and its action on one line where there is room, two where there is
   not. A header that will not wrap is a header that pushes its own panel wider
   than the screen. */
.ph { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ph h3 { font: 600 14px/1.25 var(--ui); margin: 0; letter-spacing: -.01em; min-width: 0; }
.ph .sp { min-width: 0; }
.ph .sp { flex: 1; }
.pb { padding: 18px; min-width: 0; }
.pb.flush { padding: 0; }

.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; }
.kv.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 5px; }
.v { font-size: 14.5px; font-weight: 500; color: var(--ink); }
.v.mono { font-size: 14px; }
.v.none { color: var(--faint); }
.note { border-top: 1px solid var(--line-2); margin-top: 18px; padding-top: 14px; font-size: 13px; color: var(--muted); }
.inset { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; padding: 13px 18px; border-top: 1px solid var(--line-2); background: var(--inset); border-radius: 0 0 var(--r) var(--r); }
.inset .sp { flex: 1; }
.inset .k { margin: 0; }

select, .field {
  font: 500 13px var(--ui);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.field { cursor: text; width: 100%; }
select:focus, .field:focus { outline: none; border-color: var(--green-700); }

/* ------------------------------------------------------------------ lists */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.li:last-child { border-bottom: 0; }
.li .sp { flex: 1; min-width: 0; }
.li .t { font-size: 13.5px; font-weight: 600; }
.li .d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.li .m { font-size: 12px; color: var(--faint); white-space: nowrap; }
.li .body { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin-top: 5px; }
.li.done .t { color: var(--muted); text-decoration: line-through; }
.chk { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #C9CCC4; margin-top: 2px; flex: 0 0 16px; cursor: pointer; display: grid; place-items: center; color: transparent; background: none; padding: 0; }
.chk.on { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.chk svg { width: 11px; height: 11px; }
.fic { width: 34px; height: 34px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font-size: 9px; font-weight: 700; letter-spacing: .03em; color: var(--muted); flex: 0 0 34px; }

.timeline { padding: 6px 18px 18px; }
.tl { display: flex; gap: 12px; padding: 12px 0; position: relative; }
.tl:not(:last-child):before { content: ""; position: absolute; left: 8px; top: 30px; bottom: -8px; width: 1px; background: var(--line); }
.tld { width: 17px; height: 17px; border-radius: 99px; background: var(--green-tint); border: 1px solid var(--green-line); flex: 0 0 17px; margin-top: 2px; display: grid; place-items: center; color: var(--green-700); }
.tld svg { width: 9px; height: 9px; }
.tl .t { font-size: 13px; font-weight: 600; }
.tl .d { font-size: 12px; color: var(--muted); margin-top: 2px; }

.mini { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.mini:last-of-type { border-bottom: 0; }
.mini .sp { flex: 1; color: var(--muted); }
.mini b { font-weight: 600; font-variant-numeric: tabular-nums; }
.mini b.none { color: var(--faint); font-weight: 500; }

/* Empty means empty: say so, and offer the action that fills it. */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty .eic { width: 38px; height: 38px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; margin: 0 auto 12px; color: var(--faint); }
.empty .eic svg { width: 19px; height: 19px; }
.empty b { display: block; color: var(--ink); font-size: 13.5px; margin-bottom: 4px; }
.empty p { margin: 0 0 14px; font-size: 12.5px; }

/* ----------------------------------------------------------- assigned work */
/* A test set by an instructor, sitting on the desk as a call to answer. */
.work { display: grid; gap: 12px; margin-top: 20px; }
.workcard { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 8px; padding: 15px 18px; }
.pb .work { margin-top: 0; }
.pb .workcard { background: var(--inset); }
.pb .workcard.waiting { background: var(--green-tint-2); }
.workcard.waiting { border-left-color: var(--green-700); }
.workcard.overdue { border-left-color: var(--amber); }
.worktop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.worktop .t { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.workmeta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 7px; font-size: 12px; color: var(--muted); }
.workbody { margin: 9px 0 0; font-size: 13px; color: var(--ink-2); max-width: 78ch; line-height: 1.55; }
.workacts { display: flex; align-items: center; gap: 12px; margin-top: 13px; flex-wrap: wrap; }
.workscore { font: 700 26px/1 var(--ui); letter-spacing: -.03em; color: var(--green-700); font-variant-numeric: tabular-nums; }
.workscore.bad { color: var(--red); }

/* ------------------------------------------------------------- form panel */
.form { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.formfield { display: flex; flex-direction: column; gap: 5px; flex: 1 1 180px; min-width: 0; }
.formfield.wide { flex: 2 1 300px; }
/* The submit sits on the same baseline as the fields but does not stretch with
   them — a full-width primary button reads as a banner, not a control. */
.formfield.action { flex: 0 0 auto; }
.formfield.action .k { visibility: hidden; }
.formfield > .k { margin: 0; }

.msg { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.msg.bad { color: var(--red); }
.stamp { font-size: 11.5px; color: var(--faint); margin-top: 26px; font-family: var(--mono); }

/* Text never wraps in fixed-height chrome; it truncates or hides. */
@media (max-width: 1240px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dgrid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .who .n, .who .r { display: none; }
  .topsearch { flex: 0 1 200px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 68px 1fr; }
  .brand > div, .nav a span:not(.ct), .navlabel, .sidefoot { display: none; }
  .nav a { justify-content: center; padding: 9px 0; }
  .pad { padding: 20px 16px 60px; }
}

/* ------------------------------------------------- editable record table */
/* records.js drives Participants, Claim items, Coverages, Payments, Tasks and
   Notes from one component. It is the same table as .tbl, with cells you can
   type into: a field shows its border on hover so a row of inputs does not read
   as a wall of boxes. */
.records-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.records-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.records-table th {
  text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 11px 12px;
  border-bottom: 1px solid var(--line); background: var(--inset); white-space: nowrap;
}
.records-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.records-table tr:last-child td { border-bottom: 0; }
.records-table input, .records-table select, .records-table textarea {
  width: 100%; font: 400 13px var(--ui); color: var(--ink);
  border: 1px solid transparent; border-radius: 6px; padding: 6px 8px;
  background: none; resize: vertical;
}
.records-table textarea { min-height: 34px; line-height: 1.5; }
.records-table input:hover, .records-table select:hover, .records-table textarea:hover { border-color: var(--line); }
.records-table input:focus, .records-table select:focus, .records-table textarea:focus {
  outline: none; border-color: var(--green-700); background: var(--surface);
}
/* Unsaved is a state worth seeing: amber while edited, green until saved. */
.records-table tr.dirty td { background: var(--amber-tint); }
.records-table tr.unsaved td { background: var(--green-tint-2); }
.records-gutter { width: 34px; text-align: center; }
.cell-static { color: var(--muted); padding: 0 8px; }

.records-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.records-status { font-size: 12.5px; color: var(--green-700); }
.records-status.bad { color: var(--red); }
.records-empty { margin: 0; padding: 20px; border: 1px dashed var(--line); border-radius: var(--r); font-size: 12.5px; color: var(--muted); background: var(--surface); }

/* records.js and files.js name their own buttons; they are the system's. */
.submit-btn, .chip-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 8px; padding: 8px 13px;
  font: 600 13px/1 var(--ui); cursor: pointer;
}
.submit-btn { background: var(--green-800); border: 1px solid var(--green-800); color: #fff; }
.submit-btn:hover:not(:disabled) { background: var(--green-900); border-color: var(--green-900); }
.chip-btn { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.chip-btn:hover:not(:disabled) { border-color: #d6d6d0; color: var(--ink); }
.submit-btn:disabled, .chip-btn:disabled { opacity: .5; cursor: not-allowed; }
.row-remove {
  border: 0; background: none; color: var(--faint); cursor: pointer;
  border-radius: 6px; padding: 4px 7px; font-size: 15px; line-height: 1;
}
.row-remove:hover { background: var(--red-tint); color: var(--red); }

/* ------------------------------------------------------------------ files */
/* The drop target. It has to look like somewhere you can put something, and it
   has to say so — a dashed rectangle with no words in it is decoration. */
.dropzone {
  display: block; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: var(--r);
  background: var(--inset); padding: 28px 20px; color: var(--muted);
}
.dropzone:hover, .dropzone:focus-within, .dropzone.over {
  border-color: var(--green-700); background: var(--green-tint-2); color: var(--green-900);
}
.dropzone.over { border-style: solid; }
.dropzone-icon { width: 34px; height: 34px; margin: 0 auto 10px; color: var(--green-700); }
.dropzone-icon svg { width: 100%; height: 100%; }
.dropzone b { display: block; color: var(--ink); font-size: 13.5px; margin-bottom: 4px; }
.dropzone span { display: block; font-size: 12.5px; }
/* Off screen, not `display: none` — a control that is not displayed cannot be
   focused, and the file input is the only way into this by keyboard. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.dropzone:focus-within { outline: 2px solid var(--green-700); outline-offset: 2px; }

.upload-list { margin-top: 12px; display: grid; gap: 6px; }
.upload-list:empty { margin-top: 0; }
.upload-row {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.upload-state { color: var(--muted); white-space: nowrap; }
.upload-state.ok { color: var(--green-700); font-weight: 600; }
.upload-state.bad { color: var(--red); }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
.file-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 13px 14px; }
.file-head { display: flex; align-items: center; gap: 10px; }
.file-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font-size: 9px; font-weight: 700; letter-spacing: .03em; color: var(--muted); flex: 0 0 34px; }
.file-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.file-category { margin-top: 10px; width: 100%; }
.file-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---------------------------------------------------------------- sign in */
/* No sidebar here: there is nothing to navigate to until somebody is signed in. */
body.centred { display: grid; place-items: center; min-height: 100vh; padding: 32px 20px; }
.signin { width: 100%; max-width: 400px; }
.signin-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.signin-brand b { font-size: 15px; font-weight: 700; display: block; line-height: 1.1; }
.signin-brand span { font-size: 11.5px; color: var(--muted); display: block; }
.signin h1 { font-size: 21px; margin-bottom: 8px; }
.signin form { display: grid; gap: 6px; margin-top: 18px; }
.signin .k { margin: 8px 0 0; }
.signin .btn { justify-content: center; margin-top: 12px; }
.signin-alt { margin: 16px 0 0; text-align: center; }
.linkish { background: none; border: 0; padding: 0; font: 500 12.5px var(--ui); color: var(--green-700); cursor: pointer; text-decoration: underline; }
.linkish:hover { color: var(--green-900); }

/* ---------------------------------------------------------- first notice */
/* Nine sections and seventy questions is not a form somebody fills in from
   memory. A rail on the left says where you are; one section at a time on the
   right keeps it to a screenful. */
.intake-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; min-width: 0; }
.intake-rail {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 8px;
}
.intake-step {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 8px; background: none;
  font: 500 13px var(--ui); color: var(--ink-2); cursor: pointer; width: 100%;
}
.intake-step:hover { background: var(--bg); color: var(--ink); }
.intake-step.on { background: var(--green-tint); color: var(--green-900); }
.intake-mark {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; font-size: 10px; color: var(--faint);
}
.intake-mark.done { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.intake-step.on .intake-mark { border-color: var(--green-700); color: var(--green-700); }
.intake-step.on .intake-mark.done { color: #fff; }
.intake-words { display: flex; flex-direction: column; min-width: 0; }
.intake-label { font-weight: 600; }
.intake-sub { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.intake-step.on .intake-sub { color: var(--green-700); }

.intake-meter { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; }
.intake-meter .bar { flex: 1; }
.intake-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.intake-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 20px; }
.intake-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.intake-field > .k { margin: 0; }
/* A greyed field is still a question — it is just not answerable yet, and the
   note under it says which answer opens it. */
.intake-field.locked { opacity: .55; }
.intake-field.locked .field { background: var(--bg); cursor: not-allowed; }
.intake-gate { font-size: 11px; color: var(--faint); }
.intake-gate.outstanding { color: var(--amber); }
.intake-field textarea.field { resize: vertical; min-height: 68px; line-height: 1.5; }

@media (max-width: 1000px) {
  .intake-body { grid-template-columns: 1fr; }
  .intake-rail { flex-direction: row; overflow-x: auto; }
  .intake-step { width: auto; white-space: nowrap; }
}
/* A field the policy answered. Distinct from "not yet answered" so an adjuster
   can see at a glance what they still have to get from the caller. */
.intake-gate.filled { color: var(--green-700); }

/* --------------------------------------------------------- VIN readback */
/* The policy holds the last six. The caller reads seventeen. This is the only
   part of that exchange a screen can actually check. */
.vin-check { grid-column: 1 / -1; display: grid; gap: 6px; margin-top: 2px; }
.vin-held { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.vin-tag {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  background: var(--line-2); color: var(--muted); border-radius: 6px; padding: 2px 7px;
}
.vin-mask { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; color: var(--ink); }
.vin-note { font-size: 12px; }
.vin-verdict { font-size: 12px; font-weight: 600; }
.vin-verdict.s-empty, .vin-verdict.s-short { color: var(--faint); font-weight: 500; }
.vin-verdict.s-unverified { color: var(--muted); font-weight: 500; }
.vin-verdict.s-long, .vin-verdict.s-ambiguous, .vin-verdict.s-mismatch { color: var(--red); }
.vin-verdict.s-confirmed { color: var(--green-700); }

/* ------------------------------------------------------------- routing */
/* How the file is coded and where it goes. Coding drives assignment, so it is
   stated rather than buried among the closing questions. */
.routing {
  display: grid; gap: 10px; margin-bottom: 18px; padding: 14px 16px;
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--r);
}
.routing-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.routing-row > .k { margin: 0; width: 88px; flex: 0 0 88px; }
.routing-flag { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.routing-flag .msg { margin: 0; }

/* ------------------------------------------------- looking inside a policy */
/* Four policies on one household cannot be told apart by their dates — you have
   to see whose cars are on which. So a result opens underneath its own row and
   the notice never moves. */
.peek-acts { display: flex; gap: 6px; justify-content: flex-end; }
.tbl tbody tr.peek-open td { background: var(--green-tint-2); border-bottom-color: transparent; }
.tbl tbody tr.peek-row td { padding: 0 16px 18px; background: var(--green-tint-2); }
.peek { display: grid; gap: 16px; }
.peek-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 20px; }
.peek-facts .v { font-size: 13.5px; }
.peek-block h4 {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; margin: 0 0 6px;
}
.peek-block .records-scroll { background: var(--surface); }
.peek .workacts { margin-top: 0; }

/* --------------------------------------------------------- narrow columns */
/*
 * A table stacks when its own column is narrow, not when the window is.
 *
 * The window is the wrong thing to ask. The wizard's results table sits in the
 * second column of a two-column layout beside a 240px rail, so on a 1280px
 * laptop it has about 700px to live in — a viewport rule would leave it as a
 * table and put the buttons out of reach, which is exactly what happened. A
 * container query asks the question that matters: how much room does this
 * actually have?
 */
.pb, .tabpane, .peek { container-type: inline-size; }

@container (max-width: 900px) {
  .tbl .tscroll { overflow-x: visible; }
  .tbl table { min-width: 0 !important; width: 100%; }
  .tbl thead { display: none; }
  .tbl tbody, .tbl tbody tr, .tbl tbody td { display: block; width: auto; }
  .tbl tbody tr { border-bottom: 1px solid var(--line); padding: 10px 4px; }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl tbody td { border: 0; padding: 5px 14px; display: flex; gap: 12px; align-items: baseline; }
  .tbl tbody td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--faint); font-weight: 600;
  }
  /* A cell with no heading is an actions cell: let it use the full width. */
  .tbl tbody td:not([data-label])::before,
  .tbl tbody td[data-label=""]::before { content: none; }
  .tbl tbody td:not([data-label]), .tbl tbody td[data-label=""] { padding-top: 10px; }
  .tbl td .mono, .tbl td .tag, .tbl td .nowrap { white-space: normal; }
  .peek-acts { justify-content: flex-start; flex-wrap: wrap; }
}

/* --------------------------------------------------------- narrow screens */
@media (max-width: 1100px) {
  /* The wizard rail sits above the questions rather than beside them, which
     hands the whole width back to the section being worked on. */
  .intake-body { grid-template-columns: minmax(0, 1fr); }
  .intake-rail { flex-direction: row; overflow-x: auto; }
  .intake-step { width: auto; white-space: nowrap; }
}

/* ------------------------------------------------------------- routing */
/* How the file is coded and where it goes. Coding drives assignment, so it is
   stated rather than buried among the closing questions. */
.routing {
  display: grid; gap: 10px; margin-bottom: 18px; padding: 14px 16px;
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--r);
}
.routing-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.routing-row > .k { margin: 0; width: 88px; flex: 0 0 88px; }
.routing-flag { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.routing-flag .msg { margin: 0; }

/* ------------------------------------------------- looking inside a policy */
/* Four policies on one household cannot be told apart by their dates — you have
   to see whose cars are on which. So a result opens underneath its own row and
   the notice never moves. */
.peek-acts { display: flex; gap: 6px; justify-content: flex-end; }
.tbl tbody tr.peek-open td { background: var(--green-tint-2); border-bottom-color: transparent; }
.tbl tbody tr.peek-row td { padding: 0 16px 18px; background: var(--green-tint-2); }
.peek { display: grid; gap: 16px; }
.peek-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 20px; }
.peek-facts .v { font-size: 13.5px; }
.peek-block h4 {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; margin: 0 0 6px;
}
.peek-block .records-scroll { background: var(--surface); }
.peek .workacts { margin-top: 0; }

/* --------------------------------------------------------- narrow screens */
/*
 * A seven-column table on a narrow screen is not a table anybody can read, and
 * a column header a screen and a half to the right is no use at all. So below
 * this width each row becomes a stacked card carrying its own labels. Nothing
 * is dropped and nothing is hidden — the shape changes.
 */
@media (max-width: 900px) {
  .tbl .tscroll { overflow-x: visible; }
  .tbl table { min-width: 0 !important; width: 100%; }
  .tbl thead { display: none; }
  .tbl tbody, .tbl tbody tr, .tbl tbody td { display: block; width: auto; }
  .tbl tbody tr { border-bottom: 1px solid var(--line); padding: 10px 4px; }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl tbody td { border: 0; padding: 5px 14px; display: flex; gap: 12px; align-items: baseline; }
  .tbl tbody td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--faint); font-weight: 600;
  }
  /* A cell with no heading is an actions cell: let it use the full width. */
  .tbl tbody td:not([data-label])::before,
  .tbl tbody td[data-label=""]::before { content: none; }
  .tbl tbody td:not([data-label]), .tbl tbody td[data-label=""] { padding-top: 10px; }
  .tbl td .mono, .tbl td .tag, .tbl td .nowrap { white-space: normal; }
  .peek-acts { justify-content: flex-start; }

  /* The wizard rail sits above the questions rather than beside them. */
  .intake-body { grid-template-columns: minmax(0, 1fr); }
  .intake-rail { flex-direction: row; overflow-x: auto; }
  .intake-step { width: auto; white-space: nowrap; }
}

/* ------------------------------------------------------------- the roster */
/* Who the notice is putting on the claim, shown while it is still being taken.
   A list that only appears after submission is a list nobody checks. */
.people { border: 1px solid var(--line); border-radius: var(--r); background: var(--inset); padding: 14px 16px; margin-bottom: 18px; }
.people > .k { margin-bottom: 10px; }
.people-list { display: grid; gap: 8px; }
.people-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.people-row .sp { flex: 1; min-width: 0; }
.people-row .t { font-size: 13.5px; font-weight: 600; }
.people-row .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.people-row .m { font-size: 12px; color: var(--muted); white-space: nowrap; }
.people .msg { margin-top: 10px; }

/* ------------------------------------------------------- policy results */
/*
 * Cards, not a table.
 *
 * Seven columns of policy detail will not fit a column that sits beside a
 * section rail, and every attempt to make them — a minimum width, a scroller, a
 * breakpoint — ends with the buttons off the right-hand edge. A card wraps, so
 * it fits at any width by construction rather than by picking the right number.
 */
.hits { display: grid; gap: 10px; }
.hit {
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: var(--r); background: var(--surface); padding: 13px 15px;
  display: grid; gap: 9px;
}
.hit.open { border-left-color: var(--green-700); background: var(--green-tint-2); }
.hit-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hit-number { font-size: 13.5px; font-weight: 600; }
.hit-insured { font-size: 14px; font-weight: 600; }
.hit-product { font-size: 12.5px; color: var(--muted); }
.hit-facts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.hit-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.hit .peek { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
