/* Kerberos portal — one stylesheet for the whole site.
   Palette: olive drab for action, ink and field-grey for structure, amber only for
   "this needs you". Type: Public Sans (the US government's own face) for everything
   people read and click; Spectral for headings, echoing the logo's serif wordmark. */

:root {
  --paper: #f3f4f0;
  --surface: #ffffff;
  --ink: #1e201b;
  --ink-2: #565a50;
  --ink-3: #7c8075;
  --rule: #d8dbd1;
  --rule-strong: #b9bdb0;
  --od: #4b5320;
  --od-hover: #3c4319;
  --od-tint: #e9ebdf;
  --amber: #a66a10;
  --amber-tint: #faf0dc;
  --red: #9e3428;
  --red-tint: #f8e5e1;

  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Spectral', Georgia, 'Times New Roman', serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --radius: 6px;
  --wrap: 1120px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.55 var(--sans); font-variant-numeric: tabular-nums;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: var(--s6) var(--s4) var(--s8); }
img { max-width: 100%; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 var(--s3); letter-spacing: -0.005em; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.44rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 var(--s4); max-width: 68ch; }
a { color: var(--od); text-underline-offset: 2px; }
a:hover { color: var(--od-hover); }
small, .small { font-size: 0.875rem; }
.muted { color: var(--ink-2); }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--od) 55%, white); outline-offset: 2px; border-radius: 3px; }

/* ---------- Header / footer ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s3) max(var(--s4), calc((100% - var(--wrap)) / 2 + var(--s4)));
  background: var(--surface); border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: var(--s2); color: var(--ink); text-decoration: none; }
.brand span { font: 600 1.3rem/1 var(--serif); letter-spacing: 0.04em; }
.brand-role { font: italic 400 0.9rem var(--serif); color: var(--ink-2); margin-left: var(--s1); }
.site-header nav { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; justify-content: flex-end; }
.site-header nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; padding: var(--s1) 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current=page] { color: var(--ink); border-bottom-color: var(--od); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; }
.linklike:hover { color: var(--ink); text-decoration: underline; }

.site-footer {
  display: flex; flex-wrap: wrap; gap: var(--s5) var(--s7); justify-content: space-between;
  padding: var(--s5) max(var(--s4), calc((100% - var(--wrap)) / 2 + var(--s4)));
  border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 0.875rem; background: var(--surface);
}
.site-footer a { color: inherit; }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 42px; padding: 0 var(--s4); border-radius: var(--radius);
  font: 600 0.95rem/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-primary { background: var(--od); border-color: var(--od); color: #fff; }
.btn-primary:hover { background: var(--od-hover); border-color: var(--od-hover); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--od-tint); border-color: transparent; }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, white); }
.btn-danger:hover { background: var(--red-tint); color: var(--red); border-color: var(--red); }
.btn-small { min-height: 32px; padding: 0 var(--s3); font-size: 0.85rem; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn[data-busy] { cursor: progress; }
table.data td.col-add { text-align: right; width: 1%; white-space: nowrap; vertical-align: middle; }
.btn-big { min-height: 52px; padding: 0 var(--s5); font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }

.field { display: flex; flex-direction: column; gap: var(--s1); }
.field > span { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-weight: 400; color: var(--ink-3); }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 9px 11px; width: 100%;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--od); outline-offset: -1px; border-color: var(--od); }
input[readonly] { background: var(--paper); color: var(--ink-2); }
/* Round and square tick boxes keep their natural size (Safari otherwise stretches them) */
input[type=radio], input[type=checkbox] { width: auto; padding: 0; border: 0; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); }
.form-grid .wide { grid-column: 1 / -1; }

/* ---------- Status tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 99px;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap; background: var(--paper); color: var(--ink-2);
}
.tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag-attention { background: var(--amber-tint); color: var(--amber); }
.tag-active { background: var(--od-tint); color: var(--od); }
.tag-done { background: var(--od); color: #fff; }
.tag-unpaid { background: var(--red-tint); color: var(--red); }
.tag-muted { background: #ebece7; color: var(--ink-3); }

/* ---------- Page layout pieces ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.page-head h1 { margin: 0; }
.page-head .sub { margin: var(--s1) 0 0; color: var(--ink-2); }
.section { margin-top: var(--s7); }
.section > h2 { margin-bottom: var(--s4); }

.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s5); }
.notice { border-left: 4px solid var(--od); background: var(--od-tint); padding: var(--s3) var(--s4); border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: var(--s5); }
.notice p { margin: 0; }
.notice p + p { margin-top: var(--s2); }
.notice-attention { border-left-color: var(--amber); background: var(--amber-tint); }
.notice-danger { border-left-color: var(--red); background: var(--red-tint); }

.empty { padding: var(--s7) var(--s5); text-align: center; color: var(--ink-2); border: 1px dashed var(--rule-strong); border-radius: var(--radius); }
.empty p { margin: 0 auto var(--s4); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.data th { text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); padding: var(--s3) var(--s3); border-bottom: 1px solid var(--rule-strong); white-space: nowrap; background: #fafbf8; }
table.data td { padding: var(--s3); border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover td { background: #f8f9f5; }
table.data td.num, table.data th.num { text-align: right; }
table.data tfoot td { font-weight: 600; border-top: 1px solid var(--rule-strong); }
.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.row-link:hover { color: var(--od); text-decoration: underline; }
.cell-sub { display: block; color: var(--ink-3); font-size: 0.85rem; margin-top: 2px; overflow-wrap: anywhere; }

/* Editable item grid */
table.edit td { padding: var(--s2); vertical-align: middle; }
table.edit input, table.edit textarea { padding: 7px 9px; font-size: 0.95rem; }
table.edit .col-n { width: 36px; color: var(--ink-3); text-align: center; }
table.edit .col-qty { width: 84px; }
table.edit .col-money { width: 112px; }
table.edit .col-pct { width: 84px; }
table.edit .col-x { width: 44px; }
table.edit .col-store { min-width: 140px; }
table.edit input.money, table.edit input.qty, table.edit input.pct { text-align: right; }
.icon-btn { width: 32px; height: 32px; border-radius: var(--radius); border: 1px solid transparent; background: none; color: var(--ink-3); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.icon-btn:hover { background: var(--red-tint); color: var(--red); }
.found { display: block; font-size: 0.8rem; color: var(--ink-3); margin-top: 3px; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.found.bad { color: var(--red); }
tr.changed td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
tr.group-row td { background: var(--od-tint); padding: 8px 12px; border-bottom: 1px solid var(--rule-strong); }
tr.group-row strong { font-size: 1rem; margin-right: 8px; }
tr.group-row span { color: var(--ink-2); font-size: 0.875rem; }
.group-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.track-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.track-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 99px; padding: 2px 4px 2px 12px; font-size: 0.85rem; }
.track-chip em { color: var(--ink-3); font-style: normal; }
.track-chip .icon-btn { width: 24px; height: 24px; font-size: 0.95rem; }
.tracking-store + .tracking-store { border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 14px; }
.tracking-store h3 { font-family: var(--sans); font-size: 1rem; font-weight: 700; margin: 0 0 4px; }
.tracking-store ul { margin: 0 0 8px; padding-left: 18px; color: var(--ink-2); font-size: 0.9rem; }
.person + .person { border-top: 1px solid var(--rule); margin-top: 16px; padding-top: 16px; }
.person h3 { margin-bottom: 4px; }
.person-role { margin: 0 0 4px; font-size: 0.8rem; font-weight: 600; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }

/* Mobile: item rows become stacked blocks */
@media (max-width: 760px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: var(--s3) var(--s3) var(--s2); border-bottom: 1px solid var(--rule); position: relative; }
  table.stack td { border: 0; padding: var(--s1) 0; }
  table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 600; color: var(--ink-3); }
  table.stack td.col-n { position: absolute; top: var(--s3); right: var(--s5); width: auto; }
  table.stack td.col-x { position: absolute; top: var(--s2); right: 0; width: auto; }
  table.stack td.num { text-align: left; }
  table.stack tfoot { display: block; }
  table.stack tfoot td { display: flex; justify-content: space-between; }
}

/* ---------- Totals ---------- */
.totals { margin-left: auto; min-width: 280px; max-width: 360px; }
.totals div { display: flex; justify-content: space-between; gap: var(--s5); padding: var(--s1) 0; }
.totals .grand { border-top: 2px solid var(--ink); margin-top: var(--s2); padding-top: var(--s2); font-weight: 700; font-size: 1.15rem; }

/* ---------- Progress (a real sequence, so it's numbered) ---------- */
.progress { display: flex; gap: 0; list-style: none; padding: 0; margin: 0 0 var(--s6); counter-reset: step; overflow-x: auto; }
.progress li { flex: 1; min-width: 92px; counter-increment: step; position: relative; padding-top: 30px; font-size: 0.85rem; color: var(--ink-3); text-align: center; }
.progress li::before { content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--rule-strong); background: var(--surface); font-size: 0.75rem; font-weight: 700; line-height: 20px; color: var(--ink-3); z-index: 1; }
.progress li::after { content: ''; position: absolute; top: 11px; left: -50%; right: 50%; height: 2px; background: var(--rule-strong); }
.progress li:first-child::after { display: none; }
.progress li.done { color: var(--ink-2); }
.progress li.done::before { content: '✓'; background: var(--od); border-color: var(--od); color: #fff; }
.progress li.done::after, .progress li.now::after { background: var(--od); }
.progress li.now { color: var(--ink); font-weight: 600; }
.progress li.now::before { border-color: var(--od); color: var(--od); }

/* ---------- Two-column order layout ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s6); align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }
.side > * + * { margin-top: var(--s5); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s4); margin: 0; font-size: 0.95rem; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; }

/* ---------- Metrics row (admin) ---------- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); margin-bottom: var(--s6); }
.metrics > * { padding: var(--s4) var(--s5); border-right: 1px solid var(--rule); text-decoration: none; color: inherit; }
.metrics > *:last-child { border-right: 0; }
.metrics strong { display: block; font: 600 1.6rem/1.2 var(--serif); }
.metrics span { color: var(--ink-2); font-size: 0.875rem; }
a.metric:hover { background: #f8f9f5; }
a.metric.attention strong { color: var(--amber); }

.filters { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s4); }
.chip { border: 1px solid var(--rule-strong); background: var(--surface); border-radius: 99px; padding: 6px 14px; font: 500 0.875rem var(--sans); cursor: pointer; color: var(--ink-2); }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filters input[type=search] { max-width: 280px; margin-left: auto; }

/* ---------- Dialog & toast ---------- */
.dialog { border: 0; border-radius: 10px; padding: var(--s5); width: min(520px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(30, 32, 27, 0.25); }
.dialog::backdrop { background: rgba(30, 32, 27, 0.45); }
.dialog .actions { justify-content: flex-end; margin-top: var(--s4); }
.dialog p { margin-top: 0; }
.dialog h2 { margin-top: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: var(--s3) var(--s5); border-radius: var(--radius); max-width: calc(100% - 32px);
  transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--red); }

/* ---------- Login ---------- */
.auth { max-width: 420px; margin: var(--s7) auto; }
.auth.is-wide { max-width: 640px; }
.auth .signup-head { margin: 8px 0 -4px; }
.auth .logo { display: block; width: 230px; height: auto; margin: 0 auto var(--s4); }
.auth h1 { text-align: center; font-size: 1.75rem; }
.auth .lede { text-align: center; color: var(--ink-2); margin: 0 auto var(--s5); }
.auth form { display: flex; flex-direction: column; gap: var(--s4); }
.code-input { font-size: 1.6rem; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Landing page ---------- */
.landing main { padding-top: 0; max-width: none; padding-left: 0; padding-right: 0; }
.lp-bar { display: flex; justify-content: space-between; align-items: center; padding: var(--s4) max(var(--s4), calc((100% - var(--wrap)) / 2 + var(--s4))); }
.lp-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s7); align-items: center;
  max-width: var(--wrap); margin: 0 auto; padding: var(--s7) var(--s4) var(--s8); }
.lp-hero h1 { font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.6rem); line-height: 1.08; margin-bottom: var(--s4); }
.lp-hero .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 44ch; margin-bottom: var(--s5); }
.lp-hero .fine { margin-top: var(--s4); font-size: 0.9rem; color: var(--ink-3); }
@media (max-width: 860px) { .lp-hero { grid-template-columns: 1fr; gap: var(--s6); padding-top: var(--s5); } }

/* The fold: lines from many stores become one Kerberos invoice */
.fold { position: relative; padding-bottom: 8px; }
.fold-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fold-lines li {
  display: grid; grid-template-columns: 7.5em 1fr auto; gap: var(--s3); align-items: baseline;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 14px; font-size: 0.92rem;
  transform-origin: 50% 100%;
}
.fold-lines .store { color: var(--ink-3); font-size: 0.8rem; font-weight: 600; }
.fold-lines .qty { color: var(--ink-2); }
.fold-join { display: flex; align-items: center; gap: var(--s3); margin: var(--s3) 0; color: var(--ink-3); font-size: 0.85rem; }
.fold-join::before, .fold-join::after { content: ''; flex: 1; height: 1px; background: var(--rule-strong); }
.fold-invoice { background: var(--ink); color: #fff; border-radius: var(--radius); padding: var(--s4) var(--s5); display: grid; grid-template-columns: auto 1fr auto; gap: var(--s4); align-items: center; }
.fold-invoice img { width: 46px; filter: invert(1); }
.fold-invoice b { font: 600 1.15rem var(--serif); display: block; }
.fold-invoice span { color: #c9ccc1; font-size: 0.85rem; }
.fold-invoice .amt { font: 600 1.4rem var(--serif); }
@media (prefers-reduced-motion: no-preference) {
  .fold-lines li { animation: drop .5s cubic-bezier(.2,.7,.3,1) both; }
  .fold-lines li:nth-child(2) { animation-delay: .08s; } .fold-lines li:nth-child(3) { animation-delay: .16s; }
  .fold-lines li:nth-child(4) { animation-delay: .24s; } .fold-lines li:nth-child(5) { animation-delay: .32s; }
  .fold-invoice { animation: rise .6s .55s cubic-bezier(.2,.7,.3,1) both; }
  @keyframes drop { from { opacity: 0; transform: translateY(-10px); } }
  @keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
}

.lp-band { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.lp-band-inner { max-width: var(--wrap); margin: 0 auto; padding: var(--s7) var(--s4); }
.steps { list-style: none; margin: var(--s5) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s5) var(--s6); counter-reset: s; }
.steps li { counter-increment: s; border-top: 2px solid var(--ink); padding-top: var(--s3); }
.steps li::before { content: counter(s); font: 600 2rem/1 var(--serif); color: var(--od); display: block; margin-bottom: var(--s2); }
.steps h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; margin-bottom: var(--s1); }
.steps p { color: var(--ink-2); margin: 0; font-size: 0.95rem; }
.lp-who { max-width: var(--wrap); margin: 0 auto; padding: var(--s7) var(--s4); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s7); }
.lp-who dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s5); }
.lp-who dt { color: var(--ink-2); }
.lp-who dd { margin: 0; font-weight: 600; }
@media (max-width: 760px) { .lp-who { grid-template-columns: 1fr; gap: var(--s5); } }

/* ---------- Printable invoice / receipt ---------- */
.print-page main { max-width: 860px; }
.print-bar { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: space-between; align-items: center; margin-bottom: var(--s4); }
.doc { background: #fff; color: #000; padding: 48px 52px; border: 1px solid var(--rule); font-size: 13.5px; line-height: 1.45; }
.doc-head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.doc-co { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
.doc-co img { width: 150px; height: auto; }
.doc-co h2 { font: 700 20px/1.1 var(--serif); letter-spacing: 0.04em; margin: 0 0 4px; }
.doc-co div { color: #333; }
.doc-title { font: 600 28px/1 var(--serif); text-align: right; letter-spacing: 0.06em; margin-bottom: 10px; }
.doc-meta { border-collapse: collapse; margin-left: auto; }
.doc-meta td { padding: 2px 0 2px 16px; text-align: right; }
.doc-meta td:first-child { color: #555; }
.doc-billto { margin: 28px 0 22px; display: grid; grid-template-columns: 1fr auto; gap: 24px; }
.doc-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px 28px; }
.doc-billto h3 { font: 700 12px var(--sans); color: #555; margin: 0 0 4px; }
.doc-amount { text-align: right; }
.doc-amount strong { display: block; font: 600 26px var(--serif); }
.doc table.lines { width: 100%; border-collapse: collapse; }
.doc table.lines th { text-align: left; font-size: 11.5px; color: #333; border-bottom: 1.5px solid #000; padding: 6px 6px; }
.doc table.lines td { padding: 7px 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
.doc table.lines .num { text-align: right; }
.doc table.lines tr.part td { padding-top: 3px; padding-bottom: 3px; font-size: 0.92em; color: #444; border-bottom-color: #eee; }
.doc table.lines tr.part td:nth-child(2) { padding-left: 22px; }
.doc table.lines tr.part td:nth-child(2)::before { content: '\21B3\00a0'; color: #888; }
.doc .muted-note { color: #777; font-style: italic; font-size: 0.9em; }
.doc-foot { display: grid; grid-template-columns: 1fr 260px; gap: 32px; margin-top: 18px; }
.doc-notes h3 { font: 700 12px var(--sans); color: #555; margin: 0 0 4px; }
.doc .totals { min-width: 0; max-width: none; }
.doc .totals div { padding: 2px 0; }
.doc .totals .grand { border-top: 1.5px solid #000; font-size: 15px; }
@keyframes kb-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(75, 83, 32, 0); } 50% { box-shadow: 0 0 0 6px rgba(75, 83, 32, 0.35); } }
.file-pick.pulse { animation: kb-pulse 1.1s ease-in-out 3; }
.paycode-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.paycode-form .field { flex: 0 1 220px; margin: 0; }
.paycode-form input { font: 600 18px ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.tax-status { font-size: 14px; line-height: 1.45; padding: 8px 12px; border-radius: var(--radius); background: var(--amber-tint); margin: 0 0 12px; max-width: none; }
.tax-status.is-exempt { background: var(--od-tint); }
.paycode { font: 700 1.05em ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; letter-spacing: 0.06em; white-space: nowrap; }
.doc-paycode { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 6px 18px; border: 2.5px solid #000; border-radius: 6px; padding: 12px 18px; margin: 0 0 22px; }
.doc-paycode-label { font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: 0.08em; }
.doc-paycode-code { font: 700 32px/1 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; letter-spacing: 0.08em; white-space: nowrap; }
.doc-paycode p { margin: 0; font-size: 12.5px; color: #333; max-width: none; }
@media (max-width: 640px) { .doc-paycode { grid-template-columns: 1fr; } }
.doc-paid { display: inline-block; border: 2px solid var(--od); color: var(--od); font: 700 13px var(--sans); padding: 4px 10px; border-radius: 4px; transform: rotate(-4deg); margin-top: 8px; }
@media (max-width: 700px) {
  .doc { padding: 24px 18px; }
  .doc-head, .doc-billto, .doc-foot { grid-template-columns: 1fr; }
  .doc-title, .doc-amount { text-align: left; }
  .doc-meta { margin-left: 0; } .doc-meta td { text-align: left; padding: 2px 16px 2px 0; }
}
@media print {
  @page { size: letter; margin: 0.5in; }
  body { background: #fff; }
  .site-header, .site-footer, .print-bar, .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; }
  .doc table.lines tr { break-inside: avoid; }
}

@media (max-width: 520px) {
  .site-header { flex-wrap: wrap; row-gap: var(--s2); }
  .site-header nav { gap: var(--s3); font-size: 0.95rem; }
}

.check { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 6px; font-size: 0.95rem; line-height: 1.5; max-width: 70ch; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--od); }
.check .muted { display: block; font-size: 0.85rem; }


/* =====================================================================
   October update: new logo, list builder, phone layouts
   ===================================================================== */
.brand-logo { height: 68px; width: auto; display: block; margin: -6px 0; }
.lp-bar .brand-logo { height: 84px; }
.form-note { margin: 0; text-align: left; }
.dialog p { white-space: pre-line; }
.dialog { max-height: calc(100dvh - 32px); overflow: auto; }
.dialog-wide { width: min(720px, calc(100% - 32px)); }
table.review { margin-top: 8px; }
table.review td, table.review th { padding: 8px 6px; }
.panel-title { font-size: 1.2rem; margin-bottom: var(--s2); }
.form-grid.tight { gap: var(--s3); }
.field .hint { font-size: 0.8rem; }
.panel + .panel, #details + #people { margin-top: var(--s5); }
.side-actions .btn { flex: 1 1 auto; }

/* Lines in the list builder: green with a check once complete */
.row-mark { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  font-size: 0.8rem; font-weight: 700; color: var(--ink-3); border: 2px solid var(--rule-strong); background: var(--surface); }
tr.row-ok td { background: #f2f6ea; }
tr.row-ok .row-mark { background: var(--od); border-color: var(--od); color: #fff; }
tr.row-ok td:first-child { box-shadow: inset 4px 0 0 var(--od); }
tr.row-needs-name td:first-child, tr.row-bad-link td:first-child, tr.row-bad-qty td:first-child { box-shadow: inset 4px 0 0 var(--amber); }
tr.row-needs-name .row-mark, tr.row-bad-link .row-mark, tr.row-bad-qty .row-mark { border-color: var(--amber); color: var(--amber); }
.row-hint { display: block; font-size: 0.8rem; color: var(--amber); margin-top: 3px; min-height: 0; }
.row-hint:empty { display: none; }
tr.row-empty input { background: #fbfbf9; }

/* Drag handle for putting lines in the customer's own order */
table.sortable .col-n { width: 64px; }
.row-tools { display: flex; align-items: center; justify-content: center; gap: 4px; }
.grip { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--ink-3); fill: currentColor;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.grip:hover, .grip:focus-visible { background: var(--od-tint); color: var(--od); }
.grip:focus-visible { outline: 2px solid var(--od); outline-offset: 1px; }
tr.row-empty .grip { visibility: hidden; }
.grip-inline { display: inline-block; vertical-align: -2px; color: var(--ink-3); fill: currentColor; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
#items tr.dragging, #items tr.dragging td { background: var(--od-tint); }
#items tr.dragging { position: relative; z-index: 2; box-shadow: 0 6px 18px rgba(30,32,27,.18); outline: 2px solid var(--od); outline-offset: -2px; }

/* Running estimate meter */
.meter { height: 10px; border-radius: 99px; background: #e6e8df; overflow: hidden; margin: 12px 0 4px; }
.meter span { display: block; height: 100%; background: var(--od); border-radius: 99px; transition: width .2s; }
.meter span.near { background: var(--amber); }
.meter span.over { background: var(--red); }
#estimate .notice { margin: 12px 0 0; }

/* People on an order (customer side) */
.people { list-style: none; margin: 0 0 var(--s3); padding: 0; }
.people li { padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.people li:last-child { border-bottom: 0; }

/* Draft actions: a normal row on big screens, pinned to the bottom on phones */
.sticky-actions { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: space-between; align-items: center; margin-top: var(--s6); }
.mobile-bar { display: none; }

@media (max-width: 760px) {
  main { padding: var(--s5) var(--s4) calc(var(--s8) + 40px); }
  h1 { font-size: 1.7rem; }
  .brand-logo { height: 54px; margin: -4px 0; }
  .lp-bar .brand-logo { height: 64px; }
  .site-header { padding-top: var(--s2); padding-bottom: var(--s2); }
  .page-head { margin-bottom: var(--s4); }
  .page-head .btn-big { width: 100%; }
  .btn { min-height: 44px; }                         /* comfortable tap size */
  .btn-small { min-height: 38px; }
  input, textarea, select { font-size: 16px; }       /* stops iPhone zooming in on fields */

  /* Order and customer lists become cards */
  table.cards thead { display: none; }
  table.cards, table.cards tbody { display: block; }
  .table-wrap:has(table.cards) { border: 0; background: none; overflow: visible; }
  table.cards tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 12px; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 14px 12px; margin-bottom: 10px; }
  table.cards td { display: block; border: 0; padding: 0; text-align: left !important; min-width: 0; }
  table.cards td.card-title { grid-column: 1 / -1; order: -2; }
  table.cards td.card-status { grid-column: 1 / -1; order: -1; }
  table.cards td.card-wide { grid-column: 1 / -1; }
  table.cards td.card-action { grid-column: 1 / -1; }
  table.cards td.card-action .btn { width: 100%; }
  table.cards td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; font-weight: 600; color: var(--ink-3); }
  table.cards tbody tr.clickable:hover td { background: none; }

  /* Admin summary boxes: a compact two-column strip */
  .metrics { grid-template-columns: 1fr 1fr; margin-bottom: var(--s4); }
  .metrics > * { padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .metrics > *:nth-child(odd) { border-right: 1px solid var(--rule); }
  .metrics strong { font-size: 1.2rem; }
  .metrics span { font-size: 0.78rem; line-height: 1.3; display: block; }
  .filters { gap: 6px; }
  .filters input[type=search] { max-width: none; margin-left: 0; width: 100%; }
  .chip { padding: 6px 12px; }

  /* Item editors: short fields side by side instead of one per line */
  table.stack tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 10px; padding: 14px 12px 12px 46px; }
  table.stack td { padding: 0; min-width: 0; }
  table.stack td.col-n { top: 14px; left: 10px; right: auto; }
  table.stack td.col-x { top: 6px; right: 4px; }
  table.sortable .row-tools { flex-direction: column; gap: 2px; }
  table.sortable .grip { width: 30px; height: 30px; }
  table.stack td:not(.col-n):not(.col-x) { grid-column: 1 / -1; }
  #items td[data-label="Qty"], #items td[data-label="Rough price each"], #items td[data-label="Cost each"],
  #items td[data-label="Margin %"], #items td[data-label="Unit price"], #items td[data-label="Price"],
  #items td[data-label="Profit"], #items td[data-label="Paid each"], #items td[data-label="Ordered"] { grid-column: auto; }
  #items td[data-label="Rough price each"] { grid-column: span 2; }
  #items td[data-label="Store"] { grid-column: 1 / -1; }
  table.stack td[data-label=""]::before { display: none; }
  #items tr.group-row { display: block; padding: 10px 12px; }
  #items tr.group-row td { grid-column: auto; }
  #lines tr { padding-left: 12px; }
  #lines td.col-n { display: none; }
  #lines td[data-label="Qty"], #lines td[data-label="Unit price"], #lines td[data-label="Price"], #lines td[data-label="Your rough price"] { grid-column: auto; }
  #lines td.col-add { text-align: left; }

  .progress li { min-width: 58px; font-size: 0.72rem; }
  .split { gap: var(--s4); }
  .totals { min-width: 0; }

  /* Pinned action bars */
  .sticky-actions { position: sticky; bottom: 0; z-index: 20; margin: var(--s5) calc(-1 * var(--s4)) 0;
    padding: 10px var(--s4) calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96);
    border-top: 1px solid var(--rule-strong); box-shadow: 0 -6px 18px rgba(30,32,27,.08); }
  .sticky-actions .actions { flex: 1; flex-wrap: nowrap; }
  .sticky-actions .btn-big { min-height: 48px; font-size: 1rem; flex: 1; padding: 0 12px; }
  .sticky-actions > .btn-danger { width: 100%; min-height: 36px; border: 0; background: none; }
  .mobile-bar { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px var(--s4) calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97);
    border-top: 1px solid var(--rule-strong); box-shadow: 0 -6px 18px rgba(30,32,27,.08); }
  .mobile-bar .btn { flex: 1; min-height: 48px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .dialog { padding: var(--s4); }
}
@media print { .mobile-bar, .sticky-actions { display: none !important; } }

/* Tablets: keep the pricing table inside the screen */
.table-wrap { position: relative; }
@media (min-width: 761px) and (max-width: 1000px) {
  table.edit td { padding: 6px 4px; }
  table.edit input { padding: 6px 6px; font-size: 0.9rem; }
  table.edit .col-store { min-width: 96px; }
  #items td[data-label="Item and link"] { min-width: 190px !important; }
  #items .btn-small { padding: 0 8px; }
  table.edit .col-money { width: 84px; }
  table.edit .col-pct { width: 62px; }
  table.edit .col-qty { width: 62px; }
  table.data th { padding: 10px 6px; }
}

/* Payment method choice (Mark paid) */
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.field legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.choice-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice { flex-direction: row; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; font-weight: 500; min-height: 44px; }
.choice:has(input:checked) { border-color: var(--od); background: color-mix(in srgb, var(--od-tint) 100%, white); }
.choice input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--od); }

/* Address block: street, line 2, then city / state / ZIP on one row */
.address-grid { display: grid; grid-template-columns: 1fr 6.5rem 8rem; gap: 12px 14px; grid-column: 1 / -1; }
.address-grid .a-street1, .address-grid .a-street2, .address-grid .a-hint { grid-column: 1 / -1; }
.address-grid .a-hint { margin: -4px 0 0; font-size: 0.85rem; color: var(--ink-3); }
.address-grid .field { margin: 0; }
@media (max-width: 560px) {
  .address-grid { grid-template-columns: 1fr 1fr; }
  .address-grid .a-city { grid-column: 1 / -1; }
}
.addr-head { font-family: var(--sans); font-size: 0.95rem; font-weight: 700; color: var(--ink); margin: 0 0 8px; }

/* Picking orders to cancel on the Orders list */
.col-pick { width: 36px; text-align: center; }
.col-pick input { width: 18px; height: 18px; cursor: pointer; }
.selbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2); position: sticky; top: 8px; z-index: 15; }
.selbar p { margin: 0; }

/* Banner on the test copy of the site (see js/site-mode.js) */
#test-banner { padding: 8px 16px; background: var(--amber); color: #fff;
  font-size: 0.85rem; line-height: 1.4; text-align: center; }
#test-banner a { color: #fff; text-decoration: underline; }
@media print { #test-banner { display: none !important; } }

/* Parts under an item (a computer's RAM and drive, what's in a kit) */
tr.part-row:not(.row-ok) td { background: #fafaf6; }
.part-incl { display: flex; gap: 6px; align-items: center; margin-top: 5px; font-size: 0.8rem; color: var(--ink-2); cursor: pointer; }
.part-incl input { width: 16px !important; height: 16px; margin: 0; flex: none; }
.add-part { display: inline-block; margin-top: 5px; color: var(--od); font-weight: 600; }
tr.row-empty .add-part { display: none; }
tr.part-line td { font-size: 0.92rem; color: var(--ink-2); }
.part-mark { color: var(--ink-3); }
@media (min-width: 761px) {
  #items tr.part-row td:nth-child(2) { padding-left: 30px; position: relative; }
  #items tr.part-row td:nth-child(2)::after { content: '↳'; position: absolute; left: 10px; top: 14px; color: var(--ink-3); }
  tr.part-line td:nth-child(2) { padding-left: 26px; }
  #items tr.part-row .row-mark { width: 30px; font-size: 0.72rem; border-radius: 13px; }
}
@media (max-width: 760px) {
  table.stack tr.part-row, table.stack tr.part-line { margin-left: 22px; width: calc(100% - 22px); border-left: 3px solid var(--rule-strong); }
  #lines td.cell-blank { display: none; }
}
.part-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; }

/* Customers page: Kerberos staff and back-office access */
.staff-panel summary { cursor: pointer; list-style-position: outside; }
.staff-list { list-style: none; margin: 0; padding: 0; }
.staff-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule); }
.staff-row .cell-sub { display: block; }
.staff-add { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; flex-wrap: wrap; }
.staff-add .field { flex: 1 1 240px; margin: 0; }
.attention-text { color: var(--amber); }

/* ==========================================================
   Files: Kerberos files page and order paperwork
   ========================================================== */
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.file-list li:last-child { border-bottom: 0; }
.file-list .file-name { font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-align: left; overflow-wrap: anywhere; }
.file-list .cell-sub { flex: 1 1 220px; }
.file-pick { position: relative; cursor: pointer; }
.file-pick:focus-within { outline: 2px solid var(--od); outline-offset: 2px; }
.shared-files .file-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s2) var(--s4); align-items: center; padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.shared-files .file-row:last-child { border-bottom: 0; }
.shared-files h3 { margin: 0 0 2px; font-size: 1.05rem; }
.shared-files .file-actions { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) {
  .shared-files .file-row { grid-template-columns: 1fr; }
  .shared-files .file-actions { justify-content: flex-start; }
}
.same-check { margin: var(--s2) 0 var(--s3); }
.addr-check { margin-top: var(--s3); padding: var(--s3); border: 1px solid var(--amber, #b7791f); border-radius: var(--radius); background: var(--amber-tint, #fdf6e7); }
.addr-check.is-done { border-color: var(--rule); background: transparent; }
.addr-confirm { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s3) 0; padding: var(--s3); border: 1px solid var(--rule); border-radius: var(--radius); }
@media (max-width: 480px) { .addr-confirm { grid-template-columns: 1fr; } }

/* Privacy policy and terms of use */
.landing main.legal { max-width: calc(72ch + 2 * var(--s4)); margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
.legal h1 { margin-bottom: var(--s2); }
.legal h2 { font-size: 1.25rem; margin: var(--s6) 0 var(--s2); }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: var(--s2); }
.legal-date { color: var(--ink-3); margin-top: 0; }
