/* ═══════════════════════════════════════════════════════════════════════════
   C&E Concrete Compliance Center — design system v200
   One file. Every screen, every facility, every form uses only these pieces.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Brand (letterhead v6.0): C&E red EC3840, ink 1E1E1E, grays 333 / 4D4D4D / 737373, band F2F2F2 */
  --red: #EC3840; --red-dark: #C9262E; --red-soft: #FDECEC;
  --ink: #1E1E1E; --ink-2: #333333; --ink-3: #737373; --ink-4: #9A9A9A; --ink-mid: #4D4D4D;
  --band: #F2F2F2;
  --line: #E3E1DD; --line-2: #D2D0CB;
  --bg: #F4F3F1; --surface: #FFFFFF; --surface-2: #FAF9F8;
  --good: #1F7A4D; --good-bg: #E6F4EC; --good-line: #9BD3B4;
  --warn: #8A5A00; --warn-bg: #FFF4D6; --warn-line: #F0C96A;
  --bad: #B01C22; --bad-bg: #FDECEC; --bad-line: #F3A6A9;
  --info: #2F4F9A; --info-bg: #EAF0FB; --info-line: #AFC2EE;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20,20,20,.05), 0 4px 16px rgba(20,20,20,.06);
  --shadow-up: 0 -6px 20px rgba(20,20,20,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --brand-font: Arial, "Helvetica Neue", Helvetica, sans-serif; /* the letterhead face */
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: Georgia, "Times New Roman", serif;
  --tap: 52px;
  --maxw: 760px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.45; min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ─── App shell ─────────────────────────────────────────────────────────── */
.hdr { position: sticky; top: 0; z-index: 100; background: var(--surface); border-bottom: 3px solid var(--red); height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 14px; box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(20,20,20,.06); }
.hdr-logo { display: flex; align-items: center; flex-shrink: 0; height: 60px; }
.hdr-logo img { height: 40px; width: auto; display: block; }
.hdr-logo .full { display: none; }
@media (min-width: 640px) { .hdr-logo .mark { display: none; } .hdr-logo .full { display: block; height: 36px; } }
.hdr-ctx { flex: 1; min-width: 0; border-left: 1px solid var(--line); padding-left: 12px; }
.hdr-trail { font: 700 10px/1 var(--mono); color: var(--ink-4); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-title { font: 800 14.5px/1.15 var(--font); color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; letter-spacing: -.01em; }
.hdr-btn { height: 40px; min-width: 40px; padding: 0 10px; border-radius: 10px; color: var(--ink-2); font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.hdr-btn:hover { background: #fff; border-color: var(--ink-4); color: var(--ink); }
.hdr-btn .ic svg { width: 18px; height: 18px; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(31,122,77,.18); flex-shrink: 0; }
.online-dot.off { background: var(--warn); box-shadow: 0 0 0 3px rgba(138,90,0,.18); }
@media (max-width: 360px) { .hdr-logo img { height: 34px; } }

.ic { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.ic svg { width: 1.25em; height: 1.25em; }

.page { max-width: var(--maxw); margin: 0 auto; padding: 18px 14px calc(110px + var(--safe-b)); }
.page-title { font: 800 24px/1.15 var(--font); letter-spacing: -.02em; margin-bottom: 4px; }
.page-sub { font-size: 14px; color: var(--ink-3); margin-bottom: 18px; }

/* ─── Permit band ───────────────────────────────────────────────────────── */
.band { background: var(--surface); border-bottom: 1px solid var(--line); display: flex; gap: 18px; padding: 10px 14px; overflow-x: auto; scrollbar-width: none; }
.band::-webkit-scrollbar { display: none; }
.band-item { flex-shrink: 0; }
.band-l { font: 700 9px/1 var(--font); color: var(--ink-4); text-transform: uppercase; letter-spacing: .09em; margin-bottom: 4px; }
.band-v { font: 700 12.5px/1.2 var(--mono); color: var(--ink); }

/* ─── Cards & sections ──────────────────────────────────────────────────── */
.sec { font: 800 11px/1 var(--font); color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; margin: 22px 2px 10px; display: flex; align-items: center; gap: 8px; }
.sec .cite { font: 600 10px/1 var(--mono); color: var(--ink-4); letter-spacing: 0; text-transform: none; background: var(--surface-2); border: 1px solid var(--line); padding: 3px 6px; border-radius: 6px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.card-body { padding: 16px; }
.card-hdr { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 14px; }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin: 0 0 8px; }
.note { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; line-height: 1.5; }

/* ─── Fields ────────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; scroll-margin-top: 130px; }
.section { scroll-margin-top: 130px; }
.field:last-child { margin-bottom: 0; }
.label { display: flex; align-items: baseline; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 6px; }
.label .req { color: var(--red); font-weight: 800; }
.label .unit { font: 600 11px var(--mono); color: var(--ink-4); }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap); padding: 12px 14px; font-size: 17px; line-height: 1.3; background: var(--surface);
  border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); color: var(--ink); outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(26,26,26,.08); }
.input::placeholder { color: var(--ink-4); }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }
textarea.input { min-height: 96px; resize: vertical; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%236B6B6B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
input[type="date"].input, input[type="time"].input, input[type="month"].input { min-height: var(--tap); }
.input.is-good { border-color: var(--good-line); background: #FBFEFC; }
.input.is-warn { border-color: var(--warn-line); background: #FFFDF6; }
.input.is-bad  { border-color: var(--bad-line);  background: #FFF8F8; }
.input.is-need { border-color: var(--warn-line); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.grid-2:last-child { margin-bottom: 0; }
.grid-2 .field { margin-bottom: 0; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 440px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Status line under a field (the "green good / red bad" indicator) */
.status { display: flex; align-items: flex-start; gap: 8px; margin-top: 7px; font-size: 13px; font-weight: 600; line-height: 1.4; border-radius: 9px; padding: 8px 11px; border: 1px solid transparent; }
.status .msg { flex: 1; }
.status .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.status.good { color: var(--good); background: var(--good-bg); border-color: var(--good-line); } .status.good .dot { background: var(--good); }
.status.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); } .status.warn .dot { background: var(--warn); }
.status.bad  { color: var(--bad);  background: var(--bad-bg);  border-color: var(--bad-line); animation: pulse 1.6s ease-in-out 2; } .status.bad .dot { background: var(--bad); }
.status.info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); } .status.info .dot { background: var(--info); }
.status.need { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); } .status.need .dot { background: var(--warn); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(176,28,34,0); } 50% { box-shadow: 0 0 0 4px rgba(176,28,34,.18); } }

/* Tap choices (one-touch answers) */
/* Answers sit in one row: two answers side by side, three across, four as 2 x 2 (or one row on wide screens), five or more three across.
   Long answers wrap inside the button at a slightly smaller size; the button never shrinks below a thumb. */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choices.cols-1 { grid-template-columns: minmax(0, 1fr); }
.choices.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .choices.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.choices.cols-4.fixed { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choices.cols-4.fixed .choice { flex-direction: column; gap: 4px; font-size: 13px; }
.choice { min-width: 0; min-height: 56px; padding: 10px 10px; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); font-weight: 700; font-size: 15px; line-height: 1.2; color: var(--ink-2);
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; text-align: center; white-space: normal; overflow-wrap: break-word; transition: all .12s; }
.choice .lbl { display: block; }
.choice:active { transform: scale(.985); }
.choices.cols-3 .choice { flex-direction: column; gap: 5px; padding: 10px 6px; font-size: 14px; }
.choices.cols-4 .choice { padding: 10px 6px; }
.choice.long { font-size: 13.5px; font-weight: 600; }
.choices.cols-3 .choice.long { font-size: 12.5px; }
.label .opt { font: 500 12px/1 var(--font); color: var(--muted); margin-left: 8px; letter-spacing: .01em; text-transform: lowercase; }
.choice .sub { display: block; font: 500 11px/1.25 var(--font); color: var(--muted); margin-top: 2px; letter-spacing: 0; text-transform: none; }
.choice.on .sub { color: inherit; opacity: .8; }
.choice .ic { font-size: 17px; line-height: 1; flex: none; }
.choice .ic svg { width: 18px; height: 18px; }
.choice.on { border-width: 2px; color: var(--ink); }
.choice.on.good { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.choice.on.warn { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.choice.on.bad  { background: var(--bad-bg);  border-color: var(--bad);  color: var(--bad); }
.choice.on.neutral { background: var(--surface-2); border-color: var(--ink); }

/* Check rows (compliance questions) */
.check { padding: 12px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: none; padding-bottom: 0; }
.check:first-child { padding-top: 0; }
.check .label { margin-bottom: 8px; }

/* Repeating rows */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row-item { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.row-item .field { margin: 0; }
.row-item .label { font-size: 12px; }
.row-del { width: 44px; height: var(--tap); border-radius: 9px; background: var(--surface); border: 1.5px solid var(--line-2); color: var(--ink-3); font-size: 18px; }
.btn-add { width: 100%; min-height: 46px; border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: 14px; margin-top: 10px; }
.btn-add:hover { border-color: var(--ink); color: var(--ink); }

/* Computed readouts */
.readout { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.readout .ro-l { font-size: 12.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.readout .ro-v { font: 800 20px/1.2 var(--mono); color: var(--ink); text-align: right; }
.readout.good .ro-v { color: var(--good); } .readout.warn .ro-v { color: var(--warn); } .readout.bad .ro-v { color: var(--bad); }
.readout.long { flex-direction: column; align-items: flex-start; gap: 4px; }
.readout.long .ro-v { font: 600 14.5px/1.4 var(--font); text-align: left; }

/* Signature */
.sig-wrap { border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); background: #fff; position: relative; overflow: hidden; }
.sig-wrap canvas { display: block; width: 100%; height: 150px; touch-action: none; }
.sig-wrap .sig-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-4); font-size: 14px; font-weight: 600; pointer-events: none; }
.sig-wrap.signed { border-style: solid; border-color: var(--good-line); }
.sig-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.btn-link { color: var(--ink-3); font-weight: 600; font-size: 13px; padding: 8px 4px; }
.btn-link:hover { color: var(--red); }

/* Photos */
.photo-btn { width: 100%; min-height: var(--tap); border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 10px; }
.photo-thumb { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb .x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); background: var(--surface-2); padding: 9px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.cur td { background: var(--info-bg); font-weight: 700; }
.tbl tr.auto td:first-child::after { content: ' · auto'; font-size: 10px; color: var(--good); font-weight: 700; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn { min-height: var(--tap); padding: 0 18px; border-radius: 12px; font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all .12s; }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--ink); color: #fff; width: 100%; }
.btn-primary:hover { background: #000; }
.btn-primary.locked { background: #DCDAD6; color: #8E8C88; cursor: not-allowed; }
.btn-primary.locked:active { transform: none; }
.btn-primary.done { background: var(--good); }
.btn-red { background: var(--red); color: #fff; } .btn-red:hover { background: var(--red-dark); }
.btn-ghost { background: var(--surface); border: 1.5px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 13px; border-radius: 9px; }

/* Sticky submit bar */
.submit-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: rgba(244,243,241,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 10px 14px calc(10px + var(--safe-b)); box-shadow: var(--shadow-up); }
.submit-bar-in { max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.submit-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.submit-meta .cnt { color: var(--ink); }
.submit-meta .flag { color: var(--bad); }

/* ─── Lists / tiles ─────────────────────────────────────────────────────── */
.tile { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; min-height: 72px; width: 100%; text-align: left; transition: transform .1s, border-color .12s; }
.tile:hover { border-color: var(--ink-4); } .tile:active { transform: scale(.99); }
.tile-ic { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.tile-ic svg { width: 32px; height: 32px; }
.tile-ic .ic { line-height: 0; }
/* plant tile: the plant's colour render (Chris's artwork) in a wide slot; falls back to the small glyph */
.tile-ic.art { width: 124px; height: 70px; border-radius: 12px; background: linear-gradient(180deg, #FFFFFF 0%, var(--surface-2) 100%); }
.tile-ic.art svg { width: 40px; height: 40px; }
.tile-ic.art img.art { width: 116px; height: 62px; object-fit: contain; display: block; }
@media (max-width: 360px) { .tile-ic.art { width: 104px; height: 60px; } .tile-ic.art img.art { width: 96px; height: 54px; } }
@media (min-width: 380px) { .tile-ic.art { width: 142px; height: 74px; } .tile-ic.art img.art { width: 134px; height: 66px; } }   /* the wide plant renders (asphalt plant is 3:1) need the room on today's phones */
/* form tile with an equipment render instead of a glyph */
.tile-ic.art-ic img.art { width: 46px; height: 46px; object-fit: contain; display: block; }
.tile.due .tile-ic.art, .tile.late .tile-ic.art, .tile.ok .tile-ic.art { background-image: none; }
.tile.due .tile-ic { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.tile.late .tile-ic { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.tile.ok .tile-ic { background: var(--good-bg); color: var(--good); border-color: var(--good-line); }
.tile.brand .tile-ic { background: var(--red-soft); color: var(--red); border-color: #F3B9BC; }
.hero { background: var(--ink); color: #fff; border-radius: 18px; padding: 18px 18px 16px; margin-bottom: 16px; position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(20,20,20,.18); }
.hero-k, .hero-t, .hero-s, .hero .btn, .hero > div { position: relative; }
/* hero: headline on the left, the plant's render on the right (Chris's artwork), actions full width underneath */
.hero-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }   /* headline left, the plant's render right */
.hero-text { flex: 1; min-width: 0; }
.hero-text .hero-s { margin-bottom: 0; }
.hero-art { flex: 0 0 auto; width: 150px; height: 96px; display: flex; align-items: center; justify-content: flex-end; margin: -4px -8px -4px 0; }
.hero-art img.art { width: 150px; height: 96px; object-fit: contain; object-position: right center; display: block; filter: drop-shadow(0 10px 14px rgba(0,0,0,.4)); }
.hero-row > .hero-ic { flex: 0 0 auto; width: 84px; height: 84px; color: #fff; opacity: .28; }
.hero-ic svg { width: 84px; height: 84px; }
@media (max-width: 360px) { .hero-art, .hero-art img.art { width: 118px; height: 84px; } }
@media (min-width: 380px) { .hero-art, .hero-art img.art { width: 164px; height: 100px; } }
@media (min-width: 700px) { .hero-art, .hero-art img.art { width: 250px; height: 140px; } .hero-art { margin-right: -4px; } }
.hero-k { font: 700 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-bottom: 8px; }
.hero-t { font: 800 20px/1.2 var(--font); letter-spacing: -.01em; margin-bottom: 4px; }
.hero-s { font-size: 13px; color: rgba(255,255,255,.7); margin-bottom: 14px; }
.hero .btn { width: 100%; }
.hero.done { background: var(--good); }
.hero.done .hero-s { color: rgba(255,255,255,.85); }
.hero.done .btn-primary { background: rgba(255,255,255,.16); color: #fff; }
.hero.done .btn-primary:hover { background: rgba(255,255,255,.26); }
.btn .ic svg { width: 20px; height: 20px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; }
.chip .ic svg { width: 16px; height: 16px; }
.chip.good { color: var(--good); border-color: var(--good-line); background: var(--good-bg); }
.chip.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.chip.bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.tile-main { flex: 1; min-width: 0; }
.tile-t { font-weight: 800; font-size: 15.5px; color: var(--ink); }
.tile-s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.tile-r { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tile-arrow { color: var(--ink-4); font-size: 22px; line-height: 1; }
.tile.plant { align-items: flex-start; padding: 14px; }
.tile.plant .tile-ic { margin-top: 2px; }
.tile.plant .tile-t { font-size: 16px; line-height: 1.2; }
.tile.plant .tile-status { margin-top: 8px; }
.tile.plant > .tile-arrow { align-self: center; }
.tile.due { border-color: var(--warn-line); }
.tile.late { border-color: var(--bad-line); }

.pill { display: inline-flex; align-items: center; gap: 5px; font: 800 10.5px/1 var(--font); letter-spacing: .05em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.pill.good { color: var(--good); background: var(--good-bg); border-color: var(--good-line); }
.pill.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.pill.bad  { color: var(--bad);  background: var(--bad-bg);  border-color: var(--bad-line); }
.pill.info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.pill.muted { color: var(--ink-3); background: var(--surface-2); border-color: var(--line); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat-n { font: 800 26px/1 var(--mono); }
.stat-l { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }
.stat.good .stat-n { color: var(--good); } .stat.warn .stat-n { color: var(--warn); } .stat.bad .stat-n { color: var(--bad); }

/* ─── Brand pieces: division headers, tagline, program sections ─────────── */
.div-hd { display: flex; align-items: center; gap: 10px; margin: 22px 2px 10px; }
.div-hd .div-n { font: 800 11px/1 var(--brand-font); color: var(--red); letter-spacing: .22em; text-transform: uppercase; white-space: nowrap; }
.div-hd .div-line { flex: 1; height: 1px; background: var(--line-2); }
.div-hd .div-tel { font: 600 11px/1 var(--mono); color: var(--ink-3); letter-spacing: .02em; white-space: nowrap; }
.tagline { display: inline-flex; align-items: center; gap: .55em; font-family: var(--brand-font); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.tagline .dot { width: .28em; height: .28em; background: var(--red); border-radius: 1px; display: inline-block; flex-shrink: 0; }
.sec.prog { margin-top: 26px; }
.sec.prog .ic svg { width: 16px; height: 16px; }
.sec .cite.red { color: var(--red); border-color: #F3B9BC; background: var(--red-soft); }
.hdr-trail.div { color: var(--red); letter-spacing: .18em; }

/* ─── Banners / alerts ──────────────────────────────────────────────────── */
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; line-height: 1.5; margin-bottom: 12px; border: 1px solid; }
.banner b { font-weight: 800; }
.banner.good { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.banner.bad  { background: var(--bad-bg);  border-color: var(--bad-line);  color: var(--bad); }
.banner.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }

.prefill { background: var(--info-bg); border: 1px solid var(--info-line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; color: var(--info); }
.prefill .ic svg { width: 20px; height: 20px; }
.prefill b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.prefill ul { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 1.5; }
.prefill-x { margin-left: auto; color: var(--info); font-weight: 800; font-size: 16px; padding: 0 4px; }
.photo-btn .ic svg { width: 20px; height: 20px; }
.photo-btn .photo-lbl { font-weight: 700; }
.success-ic { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; background: var(--good-bg); color: var(--good); border: 2px solid var(--good-line); }
.success-ic svg { width: 46px; height: 46px; stroke-width: 2.2; }
.success-ic.queued { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }

/* ─── Login ─────────────────────────────────────────────────────────────── */
body.is-login .hdr, body.is-login .band { display: none; }
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 18px; background: linear-gradient(180deg, #1A1A1A 0%, #1A1A1A 42%, var(--bg) 42%); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); padding: 28px 24px; }
.login-logo { margin-bottom: 16px; display: flex; justify-content: center; } .login-logo img { width: 100%; max-width: 250px; height: auto; display: block; }
.login-tag { font-size: 17px; margin-bottom: 8px; display: flex; justify-content: center; width: 100%; }
.login-sub { font: 700 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); border-top: 3px solid var(--red); padding-top: 12px; margin: 12px 0 18px; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.login-sub span:last-child { white-space: nowrap; color: var(--ink-4); font-size: 8.5px; }
.login-card .hint { text-align: center; }
.login-foot { width: 100%; max-width: 400px; margin-top: 14px; background: var(--ink); color: #fff; border-radius: 12px; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 700 9px/1 var(--brand-font); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.login-foot .stripes { display: inline-flex; gap: 3px; margin-right: 10px; }
.login-foot .stripes i { display: block; width: 7px; height: 11px; background: var(--red); transform: skewX(-25deg); }
.login-foot .l { display: inline-flex; align-items: center; }
.login-foot .r { color: rgba(255,255,255,.75); font-weight: 600; letter-spacing: .16em; }

/* ─── Toast ─────────────────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: calc(132px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); opacity: 0; transition: all .2s; z-index: 300; max-width: 92vw; text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.good { background: var(--good); } .toast.bad { background: var(--bad); } .toast.warn { background: var(--warn); }

/* ─── Loading / empty states ───────────────────────────────────────────── */
.spinner { width: 22px; height: 22px; border: 3px solid rgba(0,0,0,.1); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.btn-primary .spinner { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); font-size: 14px; }
.empty .big { font-size: 32px; margin-bottom: 8px; opacity: .5; }

/* ─── Records list / document ───────────────────────────────────────────── */
.filters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 14px; }
@media (max-width: 640px) { .filters { grid-template-columns: 1fr 1fr; } .filters .field:first-child { grid-column: 1 / -1; } }
.filters .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.filters .input { min-height: 44px; font-size: 14px; padding: 8px 10px; }
.rrow { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; margin-bottom: 8px; width: 100%; text-align: left; }
.rrow:hover { border-color: var(--red); }
.rr-date { font: 800 13px var(--mono); min-width: 84px; }
.rr-main { flex: 1; min-width: 0; } .rr-t { font-weight: 800; font-size: 14.5px; } .rr-s { font-size: 12px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-go { font: 800 11px var(--font); color: var(--red); letter-spacing: .05em; }

.doc-ov { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; overflow: auto; padding: 16px 8px; display: none; }
.doc-ov.on { display: block; }
.doc-sheet { background: #fff; max-width: 720px; margin: 0 auto; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.doc-bar { position: sticky; top: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); z-index: 1; }
.doc { padding: 26px 30px 0; color: var(--ink); font-family: var(--brand-font); }
/* Letterhead v6.0: logo left; right block = division (red), PEOPLE · HONOR · GRIT, business lines, markets; red rule */
.lh { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; border-bottom: 3px solid var(--red); padding-bottom: 12px; }
.lh-logo img { height: 54px; width: auto; display: block; }
.lh-r { text-align: right; }
.lh-div { font: 800 9px/1 var(--brand-font); color: var(--red); letter-spacing: .3em; text-transform: uppercase; margin-bottom: 7px; }
.lh-tag { font-size: 15px; justify-content: flex-end; display: flex; }
.lh-l { font: 500 7.5px/1 var(--brand-font); color: var(--ink-mid); letter-spacing: .22em; text-transform: uppercase; margin-top: 6px; display: flex; justify-content: flex-end; gap: .9em; }
.lh-l .dot { width: 2.5px; height: 2.5px; background: var(--red); display: inline-block; align-self: center; }
.lh-l.light { color: var(--ink-3); }
@media (max-width: 640px) {
  .doc { padding: 20px 16px 0; }
  .lh { flex-direction: column; align-items: flex-start; gap: 12px; }
  .lh-r { text-align: left; } .lh-tag { justify-content: flex-start; font-size: 13px; } .lh-l { justify-content: flex-start; flex-wrap: wrap; row-gap: 3px; }
  .lh-ft { margin: 22px -16px 0; padding: 14px 16px; grid-template-columns: 1fr; gap: 12px; } .lh-since, .lh-site { text-align: left; }
  .doc-meta { grid-template-columns: 1fr 1fr; } .doc-meta > div:nth-child(3n) { border-right: 1px solid #ddd; } .doc-meta > div:nth-child(2n) { border-right: none; } .doc-meta > div:nth-last-child(-n+3) { border-bottom: 1px solid #ddd; } .doc-meta > div:nth-last-child(-n+2) { border-bottom: none; }
}
.doc-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 6px; }
.doc-kicker { font: 800 9.5px/1 var(--brand-font); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); }
.doc-kicker b { color: var(--red); }
.doc-h { font: 800 20px/1.15 var(--brand-font); letter-spacing: -.01em; color: var(--ink); margin-top: 6px; }
.doc-form { display: none; }
/* Footer band as on the letterhead: division office, corporate office, SINCE 1974 + site */
.lh-ft { background: var(--band); margin: 26px -30px 0; padding: 16px 30px 18px; display: grid; grid-template-columns: 1.2fr 1.4fr auto; gap: 18px; align-items: end; }
.lh-ft-l { font: 800 8px/1 var(--brand-font); color: var(--red); letter-spacing: .28em; text-transform: uppercase; margin-bottom: 7px; }
.lh-ft-v { font: 400 10px/1.6 var(--brand-font); color: var(--ink-2); }
.lh-ft-v .dot { color: var(--red); padding: 0 4px; }
.lh-since { font: 800 8.5px/1 var(--brand-font); color: var(--red); letter-spacing: .28em; text-transform: uppercase; text-align: right; }
.lh-site { font: 800 13px/1.2 var(--brand-font); color: var(--ink); text-align: right; margin-top: 5px; }
.doc-fine { padding: 10px 0 18px; display: flex; justify-content: space-between; gap: 12px; font: 400 8.5px/1.5 var(--brand-font); color: var(--ink-3); }
.doc-fine b { color: var(--ink-2); font-weight: 700; }
.doc-meta { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #ddd; border-radius: 8px; overflow: hidden; margin: 12px 0 18px; }
.doc-meta > div { padding: 8px 12px; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; }
.doc-meta > div:nth-child(3n) { border-right: none; } .doc-meta > div:nth-last-child(-n+3) { border-bottom: none; }
.dm-l { font-size: 8.5px; font-weight: 800; color: #666; text-transform: uppercase; letter-spacing: .08em; } .dm-v { font: 700 12.5px var(--mono); margin-top: 2px; word-break: break-word; }
.doc-sec { font-size: 10.5px; font-weight: 800; color: var(--ink-mid); text-transform: uppercase; letter-spacing: .09em; margin: 18px 0 8px; display: flex; align-items: baseline; gap: 8px; }
.doc-cite { font: 600 9px/1 var(--mono); color: var(--ink-3); letter-spacing: 0; text-transform: none; border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; }
.doc-fields { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #ddd; border-bottom: none; border-radius: 8px; overflow: hidden; }
.df { background: #fff; padding: 9px 12px; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; } .df.wide { grid-column: 1 / -1; }
.df:nth-child(even), .df.wide, .df:last-child:nth-child(odd) { border-right: none; }
.df:last-child:nth-child(odd) { grid-column: 1 / -1; }
.doc-group.small { break-inside: avoid; }
.df-l { font-size: 9px; font-weight: 800; color: #666; text-transform: uppercase; letter-spacing: .07em; } .df-v { font-size: 13px; margin-top: 3px; word-break: break-word; white-space: pre-wrap; }
.df-v.good { color: var(--good); font-weight: 700; } .df-v.bad { color: var(--bad); font-weight: 700; } .df-v.warn { color: var(--warn); font-weight: 700; }
.doc-exc { border: 1px solid var(--bad-line); background: var(--bad-bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 12.5px; }
.doc-exc.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.doc-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.doc-img { border: 1px solid #ddd; border-radius: 8px; overflow: hidden; } .doc-img img { width: 100%; display: block; } .doc-img-l { font-size: 9px; color: #666; padding: 5px 8px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; border-top: 1px solid #eee; }
.doc-sig { margin-top: 16px; border-top: 1px dashed #ccc; padding-top: 12px; } .doc-sig img { max-height: 90px; border: 1px solid #ddd; border-radius: 6px; background: #fff; }
@media print {
  @page { margin: 12mm 12mm 10mm; }
  body { background: #fff; }
  .hdr, .band, .page, .submit-bar, .toast, .doc-bar { display: none !important; }
  .doc-ov { display: block !important; position: static; background: #fff; padding: 0; overflow: visible; }
  .doc-sheet { box-shadow: none; border-radius: 0; max-width: none; }
  .doc { padding: 0; }
  .lh-ft { margin: 24px 0 0; padding: 12px 16px; border-radius: 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
  .lh, .doc-title, .doc-meta, .df, .doc-img, .doc-exc, .doc-sig, .doc-fine { break-inside: avoid; }
  .doc-sec { break-after: avoid; }
  .lh-div, .tagline .dot, .lh-l .dot, .lh-ft-l, .lh-since, .doc-kicker b { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Method 9 readings grid ── */
.m9 { display: block; }
.m9-ro { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.m9-ro .ro { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; }
.m9-ro .ro-l { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.m9-ro .ro-v { font-size: 18px; font-weight: 800; margin-top: 2px; }
.m9-ro .ro.good .ro-v { color: var(--good); } .m9-ro .ro.warn .ro-v { color: var(--warn); } .m9-ro .ro.bad .ro-v { color: var(--bad); }
.m9-timer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.m9-clock { font: 800 26px/1 var(--brand-font); letter-spacing: .04em; min-width: 78px; }
.m9-due { flex: 1; font-size: 13px; opacity: .9; } .m9-due.late { color: #FFB4B4; font-weight: 700; }
.m9-btns { display: flex; gap: 6px; } .btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.m9-timer .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }
.m9-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.m9-cell { position: relative; min-height: 48px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 2px; cursor: pointer; }
.m9-cell .n { font-size: 10px; color: var(--ink-4); line-height: 1; } .m9-cell .v { font-size: 17px; font-weight: 800; line-height: 1.1; margin-top: 2px; }
.m9-cell.sel { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(30,30,30,.18); }
.m9-cell.good { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.m9-cell.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.m9-cell.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.m9-cell.miss { background: var(--surface-2); color: var(--ink-3); }
.m9-pal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.m9-pb { min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: 700 15px/1 var(--font); cursor: pointer; }
.m9-pb:active { transform: scale(.97); } .m9-pb.miss { grid-column: span 3; color: var(--ink-3); } .m9-pb.clr { grid-column: span 3; color: var(--ink-3); }

/* ── Method 22 timer ── */
.vet { display: block; }
.vet-top { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; margin-bottom: 10px; }
.vet-big { font: 800 34px/1 var(--brand-font); } .vet-big.good { color: var(--good); } .vet-big.warn { color: var(--warn); } .vet-big.bad { color: var(--bad); }
.vet-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.vet-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.vet-clock { font: 800 18px/1 var(--brand-font); letter-spacing: .03em; flex: 1; }
.vet-toggle { width: 100%; min-height: 72px; border-radius: 14px; border: 2px solid var(--red); background: #fff; color: var(--red); font: 800 17px/1.2 var(--font); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.vet-toggle.on { background: var(--red); color: #fff; box-shadow: 0 0 0 4px rgba(236,56,64,.25); }
@media print { .m9-timer, .m9-pal, .vet-toggle, .vet-row { display: none; } }
