/* GCEC Bills — one style sheet for every page. Colours come from the Gulf Coast Express Carriers logo:
   purple #513989 and gold #FBBF16. Layout: a white menu on the left, a search bar on top, cards on a quiet background. */
:root {
  --brand: #513989; --brand-ink: #432f73; --brand-deep: #2a1c4e; --brand-soft: #f2eef9; --brand-line: #d8cdec;
  --gold: #fbbf16; --gold-soft: #fef6dc; --gold-ink: #6f4e00;
  --bg: #f6f5f9; --card: #fff; --line: #e7e4ee; --line2: #d5d0e0; --soft: #f4f2f8;
  --ink: #1c1728; --ink2: #3c3550; --muted: #696279;
  --ok: #17794a; --ok-bg: #e4f4eb; --warn: #8a5200; --warn-bg: #fdf0d7; --bad: #b42318; --bad-bg: #fdecea;
  --info: #175cd3; --info-bg: #e8f0fe;
  --radius: 12px; --shadow: 0 1px 2px rgba(28, 23, 40, .05), 0 1px 3px rgba(28, 23, 40, .05);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); text-decoration: underline; }
h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.005em; }
h3 { margin: 0; font-size: 14px; font-weight: 650; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
code { background: var(--soft); padding: 1px 5px; border-radius: 5px; }
pre { margin: 8px 0 0; padding: 12px; background: var(--soft); border-radius: 8px; white-space: pre-wrap; word-break: break-word;
  font-size: 12px; line-height: 1.5; max-height: 340px; overflow: auto; }
.ic { flex: 0 0 auto; vertical-align: -3px; }
.muted { color: var(--muted); }
.lead { color: var(--muted); margin: 6px 0 0; }
.small { font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- the frame: menu, top bar, page */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px 14px; display: flex;
  flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebrand { display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.sidebrand:hover { text-decoration: none; }
.sidebrand img { width: 176px; height: auto; display: block; }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--brand); }
.nav { display: flex; flex-direction: column; gap: 18px; }
.nav .grp { display: flex; flex-direction: column; gap: 2px; }
.nav .gl { font-size: 10.5px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 10px 5px; }
.nav a, .nav .soon { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink2);
  font-weight: 500; position: relative; }
.nav a:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.nav a.on { color: var(--brand); background: var(--brand-soft); font-weight: 650; }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav .t { flex: 1; min-width: 0; }
.nav .soon { color: #9a94a8; cursor: default; }
.nav .badge { font-size: 11.5px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 10px; padding: 0 7px; line-height: 19px; }
.nav .chip { font-size: 10.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line2); border-radius: 999px; padding: 0 7px; line-height: 17px; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.me .who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.me .who strong { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { font-size: 12px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 12.5px;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; letter-spacing: .02em; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.off { background: #b9b4c6; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.iconbtn:hover { background: var(--soft); color: var(--ink); }

.col { min-width: 0; display: flex; flex-direction: column; }
.top { background: var(--card); border-bottom: 1px solid var(--line); min-height: 62px; padding: 10px 32px; display: flex;
  align-items: center; gap: 14px; position: sticky; top: 0; z-index: 20; }
.top .burger { display: none; }
.top .mini { display: none; }
.search { flex: 1 1 280px; max-width: 520px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line2);
  border-radius: 10px; padding: 0 12px; height: 40px; background: var(--soft); color: var(--muted); }
.search:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(81, 57, 137, .14); }
.search input { flex: 1; border: 0; outline: none; background: transparent; font: inherit; color: var(--ink); min-width: 0; padding: 0; height: 100%; }
.top .grow { flex: 1; }
main { width: 100%; max-width: 1240px; padding: 26px 32px 56px; display: flex; flex-direction: column; gap: 20px; }
main.wide { max-width: none; }
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.ph .sub { color: var(--muted); margin-top: 4px; }
.ph .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---------------------------------------------------------------- parts */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card > h2 { margin-bottom: 12px; }
.card .ch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card .ch h2 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .ch { padding: 16px 22px 0; }
.card.flush > .hint { padding: 0 22px 16px; margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 16px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { display: flex; gap: 14px; align-items: flex-start; color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--brand-line); box-shadow: 0 2px 10px rgba(81, 57, 137, .10); }
.kpi .tile { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: flex;
  align-items: center; justify-content: center; flex: 0 0 auto; }
.kpi .tile.warn { background: var(--warn-bg); color: var(--warn); }
.kpi .tile.ok { background: var(--ok-bg); color: var(--ok); }
.kpi .tile.gold { background: var(--gold-soft); color: var(--gold-ink); }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .k { color: var(--muted); font-size: 13px; font-weight: 550; }
.kpi .s { color: var(--muted); font-size: 12px; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 9px;
  line-height: 19px; white-space: nowrap; background: var(--soft); color: var(--ink2); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.done { background: #e9e7ef; color: var(--ink2); }
.pill.gold { background: var(--gold-soft); color: var(--gold-ink); }
.pill.idle { background: var(--soft); color: var(--muted); }

.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 11px 14px; border: 1px solid transparent; }
.alert .ic { margin-top: 2px; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert.ok { background: var(--ok-bg); color: #0f5132; border-color: #bfe3cd; }
.alert.bad { background: var(--bad-bg); color: #8a1c13; border-color: #f4c7c2; }
.alert.warn { background: var(--warn-bg); color: #6b4000; border-color: #f0d59b; }
.alert.info { background: var(--info-bg); color: #123f91; border-color: #c4d7fb; }
.alert.quiet { background: var(--soft); color: var(--ink2); border-color: var(--line); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 9px;
  border: 1px solid var(--line2); background: var(--card); color: var(--ink2); font: inherit; font-weight: 600; cursor: pointer;
  white-space: nowrap; }
.btn:hover { border-color: #b9b1cd; color: var(--ink); text-decoration: none; background: #fbfafd; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(42, 28, 78, .25); }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn.danger { color: var(--bad); border-color: #efc4bf; }
.btn.danger:hover { background: var(--bad-bg); border-color: #e3a49d; color: var(--bad); }
.btn.ghost { border-color: transparent; background: none; color: var(--brand); padding: 0 8px; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .iconbtn:focus-visible, a:focus-visible { outline: 3px solid rgba(81, 57, 137, .35); outline-offset: 2px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.inline { display: inline; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label { display: block; margin: 14px 0 5px; font-size: 13px; font-weight: 600; color: var(--ink2); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=search], select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line2); border-radius: 9px; font: inherit; color: var(--ink);
  background: #fff; }
textarea { height: auto; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(81, 57, 137, .16); }
input:disabled, select:disabled, fieldset:disabled input, fieldset:disabled select { background: var(--soft); color: var(--ink2); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
label.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 500; color: var(--ink); cursor: pointer; }
label.check.flat { margin: 0; }
label.check.gap { margin-top: 10px; }
.formfoot.tight { margin-top: 10px; }
input.num { text-align: right; }
label.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: 0 0 auto; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.sub { border: 1px solid var(--brand-line); background: #fbfaff; border-radius: 10px; padding: 4px 14px 14px; margin-top: 12px; }
fieldset.sub legend { font-weight: 650; padding: 0 6px; color: var(--brand); font-size: 13px; }
.hl input, .hl select { border-color: #e5b93c; box-shadow: 0 0 0 3px rgba(251, 191, 22, .22); }
.formfoot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.narrow { max-width: 620px; }

.scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; background: #fbfafd;
  white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.card.flush th:first-child, .card.flush td:first-child { padding-left: 22px; }
.card.flush th:last-child, .card.flush td:last-child { padding-right: 22px; }
tbody tr[data-href] { cursor: pointer; }
tbody tr[data-href]:hover td { background: #faf8fd; }
td .sub { display: block; color: var(--muted); font-size: 12.5px; }
td.acts-cell { white-space: nowrap; text-align: right; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; padding: 0 14px; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 12px 10px 11px; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .n { font-size: 11.5px; font-weight: 700; background: var(--soft); color: var(--ink2); border-radius: 10px; padding: 0 7px; line-height: 18px; }
.tabs a.on .n { background: var(--brand-soft); color: var(--brand); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.toolbar .search { height: 36px; max-width: 320px; }
.toolbar .w { flex: 1; min-width: 0; }

.empty { text-align: center; padding: 38px 20px; color: var(--muted); }
.empty .tile { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 10px; }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }

.drop { border: 1.5px dashed var(--brand-line); border-radius: 12px; background: #fbfaff; padding: 22px 16px; text-align: center;
  color: var(--muted); transition: background .12s, border-color .12s; cursor: pointer; display: block; margin: 0; font-weight: 400; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .tile { width: 42px; height: 42px; border-radius: 11px; background: #fff; border: 1px solid var(--brand-line); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.drop strong { color: var(--ink); display: block; font-weight: 650; }
.drop u { color: var(--brand); text-decoration: none; font-weight: 600; }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.files { list-style: none; margin: 10px 0 0; padding: 0; text-align: left; color: var(--ink2); font-size: 13px; }
.files li { padding: 4px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }

.dl { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; margin: 0; }
.dl dt, .dl dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
.dl dt { color: var(--muted); font-weight: 550; padding-right: 12px; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { position: relative; padding: 0 0 14px 22px; overflow-wrap: anywhere; }
.timeline > li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: #fff;
  border: 2px solid var(--brand); }
.timeline > li::after { content: ''; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line2); }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li:last-child::after { display: none; }
.timeline time { display: block; color: var(--muted); font-size: 12px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.feed li:last-child { border-bottom: 0; }
.feed .w { flex: 1; min-width: 0; }
.feed time { color: var(--muted); font-size: 12px; white-space: nowrap; }
ul.plain { margin: 0; padding-left: 18px; color: var(--ink2); }
ul.plain li { margin: 3px 0; }

/* ---------------------------------------------------------------- one bill beside its scan
   After 365's review screen: three columns from 1800px (the scan at the screen's height, the bill and its lines, a side
   column with what is wrong, Claude's note and the history), two below that, one under 900px. The bar stays pinned. */
.review { display: flex; gap: 18px; align-items: flex-start; }
.review > .doc { flex: 1 1 46%; min-width: 0; position: sticky; top: 74px; height: calc(100vh - 86px); display: flex; flex-direction: column; }
.dochead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
iframe.pdf { flex: 1 1 auto; width: 100%; min-height: 420px; border: 1px solid var(--line2); border-radius: var(--radius); background: #fff;
  box-shadow: var(--shadow); display: block; }
.review > .work { flex: 1 1 54%; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.work > div { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.work > div:empty { display: none; }
.w-bar { position: sticky; top: 74px; z-index: 5; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--card); border: 1px solid var(--line2);
  border-radius: 14px; padding: 10px 14px; box-shadow: 0 6px 18px rgba(28, 23, 40, .10); }
.bar .state { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.bar .why { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bar .acts form { display: inline-flex; margin: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 0 14px; }
.fields > p, .lgrid > p { margin: 0; min-width: 0; }
.fields .wide { grid-column: 1 / -1; }
.fields .span2 { grid-column: span 2; }
.fields .row { display: flex; gap: 8px; }
.fields .row input { flex: 1; min-width: 0; }
.fields #foot { margin-top: 6px; white-space: normal; }
.req { color: var(--bad); font-weight: 700; }
.need { border-color: var(--bad) !important; background: var(--bad-bg) !important; }
label.first { margin-top: 0; }
p.gap { margin: 12px 0 0; }
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; background: #fbfafd; }
.lhead { display: flex; justify-content: space-between; align-items: center; }
.lhead .linkbtn { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.lhead .linkbtn:hover { color: var(--bad); }
.lgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.lgrid .full { grid-column: 1 / -1; }
.lgrid.charge { grid-template-columns: minmax(130px, 1fr) minmax(170px, 1.5fr) 120px; }       /* a wash's charge: the account needs the room */
@media (max-width: 560px) { .lgrid.charge { grid-template-columns: 1fr; } }
.lgrid label { margin-top: 8px; }
.lgrid label > input, .lgrid label > select, .lgrid label > textarea { margin-top: 4px; }
.lgrid input.amt { text-align: right; font-variant-numeric: tabular-nums; }
label.check.rule { font-size: 12.5px; color: var(--muted); margin-top: 6px; align-items: center; }
label.check.rule input { margin-top: 0; }
textarea.memo { min-height: 3.2em; resize: vertical; line-height: 1.45; }
ul.issues { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 8px; }
ul.issues li { border-radius: 10px; padding: 9px 12px; display: flex; gap: 9px; align-items: flex-start; overflow-wrap: anywhere; }
ul.issues li .ic { margin-top: 2px; }
ul.issues li.block { background: var(--bad-bg); color: #8a1c13; }
ul.issues li.flag { background: var(--warn-bg); color: #6b4000; }
.card.notes p { margin: 0 0 8px; overflow-wrap: anywhere; }
details.hist > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 0; }
details.hist > summary::-webkit-details-marker { display: none; }
details.hist > summary h2::before { content: '▸ '; color: var(--muted); }
details.hist[open] > summary h2::before { content: '▾ '; }
details.hist[open] > summary { margin-bottom: 12px; }
ul.chg { list-style: none; margin: 4px 0 2px; padding: 0; font-size: 12.5px; color: var(--ink2); overflow-wrap: anywhere; }
ul.chg li { padding: 1px 0; }
del { background: var(--bad-bg); color: #8a1c13; text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
ins { background: var(--ok-bg); color: #0f5132; text-decoration: none; border-radius: 3px; padding: 0 2px; }
details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; color: var(--ink2); }
@media (min-width: 1800px) {
  .review > .doc { flex: 0 0 42%; }
  .review > .work { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr); grid-template-rows: auto auto 1fr;
    grid-template-areas: "bar bar" "main info" "main hist"; align-items: start; }
  .w-bar { grid-area: bar; } .w-info { grid-area: info; } .w-main { grid-area: main; } .w-hist { grid-area: hist; }
}

/* the washes of one scan, over the review screen; notes Level 2 acknowledges; the Waiting for billing list */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chips .chip { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px;
  background: var(--card); color: var(--ink2); min-width: 150px; max-width: 250px; }
.chips a.chip:hover { text-decoration: none; border-color: var(--line2); color: var(--ink); }
.chips .chip.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-line); }
.chips .chip.gone { opacity: .55; }
.chips .chip > span, .chips .chip small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips .chip small { color: var(--muted); }
.chips .chip.plainchip { background: none; border-style: dashed; justify-content: center; }
ul.issues li.note { background: var(--gold-soft); color: var(--gold-ink); border: 1px solid #f0d98a; }
ul.issues li.done { background: var(--soft); color: var(--ink2); }
ul.issues form { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.rowform { display: flex; gap: 6px; align-items: center; margin: 0; }
.rowform input { width: 96px; height: 30px; padding: 0 8px; border-radius: 8px; }
.neg { color: var(--bad); font-weight: 600; }
.sending { margin-top: 10px; }
/* under the bill's pages on a wash: the customer's contract (its tank-wash section), then the vendor's rate sheet */
.review > .doc.with-sections { overflow-y: auto; padding-right: 2px; }
.doc.with-sections iframe.pdf { flex: 0 0 auto; height: calc(100vh - 250px); }
details.sect { flex: 0 0 auto; margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
details.sect > summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
details.sect > summary .muted { font-size: 12.5px; }
details.sect[open] > summary { margin-bottom: 8px; }
table.mini { width: 100%; font-size: 12.5px; }
table.mini th, table.mini td { padding: 5px 8px; vertical-align: top; }
table.mini td:first-child, table.mini th:first-child { padding-left: 0; }
.btn.addnew em { font-style: italic; font-weight: 500; }      /* "Add vendor…": nothing matched, so the field was left empty */
.flags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 96px; }
.flags .pill { white-space: nowrap; }
.kpi .s a { color: inherit; text-decoration: underline; text-decoration-color: var(--line2); }
.kpi .s a:hover { color: var(--brand); }

/* ---------------------------------------------------------------- pop-ups */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(28, 23, 40, .28); color: var(--ink); }
dialog::backdrop { background: rgba(28, 23, 40, .45); }
dialog .db { padding: 22px 22px 6px; }
dialog .df { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
dialog h2 { margin-bottom: 6px; }
.busy { position: fixed; inset: 0; background: rgba(28, 23, 40, .4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.busy > div { background: var(--card); border-radius: 14px; padding: 20px 24px; max-width: 420px; box-shadow: 0 20px 60px rgba(28, 23, 40, .28);
  display: flex; gap: 14px; align-items: center; }
.spin { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--brand-line); border-top-color: var(--brand);
  animation: spin .9s linear infinite; }
.spin.sm { flex-basis: 14px; width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* ---------------------------------------------------------------- signing in */
body.auth { background: var(--card); }
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; }
.auth-form { display: flex; flex-direction: column; align-items: center; padding: 40px 24px 28px; }
.auth-form .box { width: 100%; max-width: 380px; margin: auto 0; display: flex; flex-direction: column; gap: 16px; }
.auth-form .logo img { width: 230px; max-width: 70%; height: auto; display: block; margin-bottom: 8px; }
.auth-form h1 { font-size: 24px; }
.auth-form .btn { height: 42px; }
.auth-form .btn.primary { width: 100%; margin-top: 18px; }
.auth-form input[type=text], .auth-form input[type=password], .auth-form input[type=tel] { height: 42px; font-size: 15px; }
.auth-form input.code { letter-spacing: .3em; font-size: 20px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.auth-foot { margin-top: 28px; color: var(--muted); font-size: 12px; text-align: center; }
.auth-art { background: linear-gradient(150deg, #5b409a 0%, var(--brand) 38%, var(--brand-deep) 100%); color: #fff; padding: 56px 56px 40px;
  display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-art::before, .auth-art::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-art::before { width: 620px; height: 620px; right: -260px; top: -240px; border: 46px solid rgba(251, 191, 22, .9); border-left-color: transparent;
  border-bottom-color: transparent; transform: rotate(18deg); }
.auth-art::after { width: 520px; height: 520px; left: -300px; bottom: -280px; border: 34px solid rgba(255, 255, 255, .10); }
.auth-art .in { position: relative; max-width: 470px; z-index: 1; }
.auth-art .kicker { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.auth-art h2 { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin-bottom: 14px; color: #fff; }
.auth-art p { color: rgba(255, 255, 255, .82); font-size: 15px; }
.auth-art ul { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 14px; }
.auth-art li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: rgba(255, 255, 255, .92); }
.auth-art li .dot { width: 24px; height: 24px; border-radius: 50%; background: rgba(251, 191, 22, .18); color: var(--gold); display: inline-flex;
  align-items: center; justify-content: center; flex: 0 0 auto; margin-top: -1px; }
.auth-art .marks { margin-top: 44px; display: flex; gap: 14px; flex-wrap: wrap; }
.auth-art .marks span { background: #fff; border-radius: 12px; padding: 10px 14px; display: inline-flex; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.auth-art .marks img { height: 44px; width: auto; display: block; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: inline-block; }
.qr svg { display: block; }
ol.do { margin: 0; padding-left: 20px; }
ol.do li { margin: 6px 0; }

/* ---------------------------------------------------------------- narrow screens */
.scrim { display: none; }
@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 60; width: 272px; transform: translateX(-102%); }
  body.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(28, 23, 40, .25); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(28, 23, 40, .4); z-index: 50; }
  .top { padding: 10px 16px; }
  .top .burger { display: inline-flex; }
  .top .mini { display: block; }
  .top .mini img { height: 30px; width: auto; display: block; }
  .top .hide-s { display: none; }
  main { padding: 18px 16px 48px; }
  h1 { font-size: 22px; }
  .review { flex-direction: column; }
  .review > .doc, .review > .work { width: 100%; flex: none; }
  .review > .doc { position: static; height: auto; }
  iframe.pdf { flex: none; height: 62vh; }
  .w-bar { top: 70px; }
  .fields .span2 { grid-column: auto; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form { padding-top: 28px; padding-bottom: 84px; }
}

/* ---- Ask Claude: the button at the bottom right and its box (app/chat.py) */
.cx-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 8px; border: 0;
  border-radius: 999px; padding: 10px 16px; background: var(--brand); color: #fff; font: 600 14px/1 var(--font); cursor: pointer;
  box-shadow: 0 6px 18px rgba(28, 23, 40, .25); }
.cx-fab:hover { background: var(--brand-ink); }
.cx-fab[hidden], .cx-panel[hidden], .cx-err[hidden] { display: none; }
.cx-panel { position: fixed; right: 20px; bottom: 20px; z-index: 41; width: 430px; max-width: calc(100vw - 24px);
  height: min(680px, calc(100vh - 40px)); display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line2); border-radius: 16px; box-shadow: 0 12px 36px rgba(28, 23, 40, .25); overflow: hidden; }
.cx-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--brand); }
.cx-head strong { flex: 1; color: var(--ink); }
#cx-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cx-topics { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); align-items: center; }
.cx-topics .cx-sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cx-m { max-width: 92%; border-radius: 12px; padding: 8px 11px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.cx-m p { margin: 0 0 6px; } .cx-m p:last-child { margin: 0; } .cx-m ul { margin: 2px 0 6px; padding-left: 18px; }
.cx-m.me { align-self: flex-end; background: var(--brand-soft); }
.cx-m.cl { align-self: flex-start; background: var(--soft); border: 1px solid var(--line); }
.cx-m.wait { color: var(--muted); font-style: italic; }
.cx-tag, .cx-looked, .cx-sub, .cx-why, .cx-done { font-size: 12px; color: var(--muted); }
.cx-looked { margin-bottom: 4px; }
.cx-rule { border: 1px solid var(--brand-line); background: #fbfaff; border-radius: 12px; padding: 9px 11px; font-size: 13.5px; }
.cx-rule.saved { border-color: #b9dcc8; background: var(--ok-bg); } .cx-rule.dismissed { opacity: .7; }
.cx-rule.failed { border-color: #f1b8b2; background: var(--bad-bg); }
.cx-rt { font-weight: 650; margin-bottom: 3px; } .cx-why { margin-top: 4px; }
.cx-acts { display: flex; gap: 8px; margin-top: 8px; }
.cx-err { margin: 0 12px 8px; padding: 7px 10px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); font-size: 13px; }
.cx-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.cx-form textarea { flex: 1; resize: none; font: 13.5px/1.45 var(--font); max-height: 140px; padding: 8px 10px; border: 1px solid var(--line2);
  border-radius: 10px; color: var(--ink); }
.cx-form textarea:focus { outline: 2px solid var(--brand-line); border-color: var(--brand); }
@media (max-width: 600px) { .cx-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: calc(100vh - 16px); } }
@media print { .cx-fab, .cx-panel { display: none; } }
