/* Weighbridge Tracker -- utility styles, no framework. Dark-on-light. */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #d8dee6;
  --text: #1c2530;
  --muted: #5d6b7a;
  --brand: #0f4c81;
  --brand-dark: #0b3a63;
  --accent: #f0a202;
  --ok: #17794c;
  --warn: #a15c00;
  --err: #b3261e;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(16, 30, 47, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.topbar {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 54px;
}
.brand {
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  letter-spacing: 0.2px;
  margin-right: 8px;
}
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a {
  color: #e7eef6;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 14px;
}
.nav a:hover, .nav a.active { background: rgba(255, 255, 255, 0.16); color: #fff; text-decoration: none; }
.nav-user { font-size: 13px; color: #d8e4f0; display: flex; align-items: center; gap: 10px; }

.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px 64px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.subtitle { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kv { margin: 0; }
.kv dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.kv dd { margin: 2px 0 10px; font-size: 15px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #eef2f6; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); white-space: nowrap; }
tbody tr:hover { background: #f8fafc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 24px; text-align: center; color: var(--muted); }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #e6ebf1;
  color: var(--muted);
  white-space: nowrap;
}
.badge.planned { background: #e6ebf1; color: #46586b; }
.badge.mobilization { background: #fdf0d5; color: var(--warn); }
.badge.ongoing { background: #dbeafe; color: #16457e; }
.badge.suspended { background: #fde2e1; color: var(--err); }
.badge.completed { background: #d9f2e4; color: var(--ok); }
.badge.turned_over { background: #ded7f5; color: #4a3690; }
.badge.not_started { background: #e6ebf1; color: #46586b; }
.badge.in_progress { background: #dbeafe; color: #16457e; }
.badge.done { background: #d9f2e4; color: var(--ok); }
.badge.role { background: #e8eef6; color: var(--brand-dark); }
.badge.danger { background: #fde2e1; color: var(--err); }
.badge.ok { background: #d9f2e4; color: var(--ok); }

/* ---------- Progress ---------- */
.bar { background: #e6ebf1; border-radius: 999px; height: 8px; min-width: 70px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #33404e; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="file"], select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(15, 76, 129, 0.35);
  outline-offset: 1px;
  border-color: var(--brand);
}
textarea { min-height: 90px; resize: vertical; }
select[multiple] { min-height: 150px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .error { font-size: 12px; color: var(--err); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.check label { margin: 0; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 9px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.secondary:hover { background: #eef3f8; color: var(--brand-dark); }
.btn.danger { background: var(--err); border-color: var(--err); }
.btn.danger:hover { background: #8c1c16; }
.btn.small { padding: 5px 9px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.inline-form { display: inline; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { margin-bottom: 0; min-width: 160px; flex: 1 1 160px; }

/* ---------- Flash ---------- */
.flashes { margin-bottom: 14px; }
.flash {
  padding: 10px 12px;
  border-radius: var(--radius);
  border-left: 4px solid var(--muted);
  background: #eef2f6;
  margin-bottom: 8px;
  font-size: 14px;
}
.flash.success { background: #e6f6ee; border-color: var(--ok); color: #10583a; }
.flash.error { background: #fdeceb; border-color: var(--err); color: #8c1c16; }
.flash.warning { background: #fdf3e0; border-color: var(--accent); color: #7a4a00; }
.flash.info { background: #e8f0fa; border-color: var(--brand); color: var(--brand-dark); }

/* ---------- Placeholder panels for later work packages ---------- */
.placeholder-panel {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 14px;
}

/* ---------- Progress feed (progress-event engine) ---------- */
.progress-form { border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 12px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item {
  border-left: 3px solid var(--border);
  padding: 8px 0 8px 12px;
  margin-bottom: 8px;
}
.feed-item.progress { border-left-color: var(--ok); }
.feed-item.correction { border-left-color: var(--err); background: #fdf6f5; }
.feed-item.note { border-left-color: var(--brand); }
.feed-item.empty { border-left-color: transparent; color: var(--muted); font-size: 14px; }
.feed-item.is-live { animation: feed-in 0.6s ease-out; }
@keyframes feed-in { from { background: #fdf3e0; } to { background: transparent; } }
.feed-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feed-pct { font-variant-numeric: tabular-nums; font-weight: 700; }
.feed-meta { margin-top: 2px; }
.feed-note { margin-top: 4px; white-space: pre-wrap; }
.struck { text-decoration: line-through; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- RAG status ---------- */
.badge.rag-green { background: #d9f2e4; color: var(--ok); }
.badge.rag-amber { background: #fdf0d5; color: var(--warn); }
.badge.rag-red { background: #fde2e1; color: var(--err); }
.nav-count { margin-left: 4px; }

/* ---------- Dashboards: stat row ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-value { font-size: 24px; font-weight: 700; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.stat-value.is-danger { color: var(--err); }
.stat-unit { font-size: 14px; font-weight: 500; color: var(--muted); }
.stat-rags { display: flex; gap: 5px; flex-wrap: wrap; font-size: 12px; font-weight: 600; }
.stat-sub { font-size: 12px; }
.stat-sub.ahead { color: var(--ok); }
.stat-sub.behind { color: var(--err); }

/* ---------- Dashboards: map ---------- */
.map-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr); gap: 14px; }
.map { height: 460px; border: 1px solid var(--border); border-radius: var(--radius); }
.map-tall { height: 560px; }
.leaflet-container { font: inherit; background: #dfe6ee; }
.map-popup { min-width: 200px; }
.map-popup-kv { margin: 6px 0; display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; }
.map-popup-kv dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.map-popup-kv dd { margin: 0; font-size: 13px; }

.unmapped-panel { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: #fbfcfd; overflow: auto; max-height: 460px; }
.unmapped-list { list-style: none; margin: 8px 0 0; padding: 0; }
.unmapped-list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--border); }
.map-legend { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 14px 0 0; align-items: center; }
.map-legend dt { margin: 0; }
.map-legend dd { margin: 0; font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.dot.rag-green { background: var(--ok); }
.dot.rag-amber { background: #c07800; }
.dot.rag-red { background: var(--err); }
.dot.rag-none { background: #8b98a6; }

.geotag-form { margin-top: 14px; }

/* ---------- Dashboards: portfolio timeline ---------- */
.timeline-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.timeline { min-width: 860px; }
.tl-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 10px; }
.tl-row:hover { background: #f8fafc; }
.tl-axis { border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-bottom: 6px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.tl-axis .tl-track { height: 18px; }
.tl-tick { position: absolute; top: 0; font-size: 11px; color: var(--muted); border-left: 1px solid var(--border); padding-left: 3px; white-space: nowrap; height: 100%; }
.tl-tick.is-year { border-left-color: var(--muted); color: var(--text); font-weight: 600; }

.tl-label { display: flex; align-items: baseline; gap: 6px; padding: 3px 0 3px 2px; overflow: hidden; color: var(--text); }
.tl-label:hover { text-decoration: none; color: var(--brand); }
.tl-code { font-weight: 600; font-size: 13px; white-space: nowrap; }
.tl-pct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.tl-track { position: relative; height: 20px; }
.tl-bar { position: absolute; top: 4px; height: 12px; background: #e2e8ef; border: 1px solid #d3dbe4; border-radius: 3px; overflow: hidden; }
.tl-fill { display: block; height: 100%; background: #8b98a6; }
.tl-fill.rag-green { background: var(--ok); }
.tl-fill.rag-amber { background: #c07800; }
.tl-fill.rag-red { background: var(--err); }
.tl-fill.rag-none { background: #8b98a6; }
.tl-nobar { position: absolute; left: 0; top: 3px; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--err); pointer-events: none; }
.tl-row.is-live .tl-bar { box-shadow: 0 0 0 2px rgba(240, 162, 2, 0.55); }
.tl-fill { transition: width 0.4s ease-out; }

.tl-group { border-top: 1px solid var(--border); }
.tl-group[open] { padding-bottom: 6px; }
.tl-group-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; padding: 7px 2px; list-style: none; }
.tl-group-head::-webkit-details-marker { display: none; }
.tl-group-head::before { content: "\25B8"; color: var(--muted); font-size: 11px; }
.tl-group[open] > .tl-group-head::before { content: "\25BE"; }
.tl-group-head:hover { background: #f2f6fa; }
.tl-group-name { font-weight: 600; font-size: 14px; }
.timeline-empty { border: 1px dashed var(--border); border-radius: var(--radius); background: #fbfcfd; }
.timeline-empty p { margin: 4px 0; }
.timeline-foot { margin: 8px 0 0; }

/* ---------- Dashboards: charts ---------- */
.chart-wrap { position: relative; height: 320px; }
.gantt-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.gantt-toolbar .btn.active { background: var(--brand); color: #fff; }
.gantt-hint { flex: 1 1 240px; }
.gantt-chart { overflow-x: auto; }
.gantt-container { max-height: 560px; }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.row-error { background: #fdeceb; }
.row-skip { background: #fdf3e0; }
.qr { display: block; margin: 12px auto; width: 200px; height: 200px; image-rendering: pixelated; }
.secret-key {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: #eef2f6;
  padding: 8px 10px;
  border-radius: var(--radius);
  word-break: break-all;
  text-align: center;
  font-size: 14px;
}
.htmx-request .htmx-indicator { visibility: visible; }
.htmx-indicator { visibility: hidden; color: var(--muted); font-size: 13px; }

/* ---------- Install app banner (PWA) ----------
   Deliberately slim: one line of chrome above the page, not a hero. Ships
   hidden -- static/js/install.js decides whether this browser sees it at all. */
.install-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 14px;
}
.install-card[hidden], .install-steps[hidden], [data-install-guide][hidden] { display: none; }
.install-row { display: flex; align-items: center; gap: 10px; }
.install-icon { border-radius: var(--radius); flex: 0 0 auto; }
.install-text { flex: 1 1 auto; min-width: 0; }
.install-text strong { display: block; font-size: 14px; }
.install-text p { margin: 2px 0 0; }
.install-dismiss {
  flex: 0 0 auto;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 20px;
  line-height: 1;
  padding: 2px 7px;
  border-radius: var(--radius);
  cursor: pointer;
}
.install-dismiss:hover { background: #eef2f6; color: var(--text); }
.install-steps {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fbfcfd;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.install-steps p { margin: 0 0 6px; }
.install-steps ol { margin: 0 0 6px; padding-left: 20px; font-size: 13px; }
.install-steps li { margin-bottom: 5px; }
.install-glyph { vertical-align: -2px; }

/* ---------- Field zone (offline PWA) ----------
   Mobile-first: single column, 48px touch targets, nothing that needs a mouse.
   These styles are additive -- the office pages never load a .field-shell. */
.badge.warn { background: #fdf0d5; color: var(--warn); }

.field-shell { max-width: 620px; margin: 0 auto; }

.field-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 20;
}
.net-dot { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.net-dot::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--muted);
  flex: 0 0 auto;
}
.net-dot[data-state="online"] { color: var(--ok); }
.net-dot[data-state="online"]::before { background: var(--ok); }
.net-dot[data-state="offline"] { color: var(--err); }
.net-dot[data-state="offline"]::before { background: var(--err); }
.field-outbox-link { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }

.field-sync-state { min-height: 18px; margin: 0 0 10px; color: var(--muted); }
.field-sync-state[data-state="error"], .field-sync-state[data-state="auth"] { color: var(--err); }
.field-sync-state[data-state="offline"] { color: var(--warn); }
.field-sync-state[data-state="done"] { color: var(--ok); }

.field-site-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.field-site-head h2 { margin-bottom: 2px; }
.field-site-progress { display: flex; align-items: center; gap: 10px; margin: 10px 0 12px; }
.field-site-progress .bar { flex: 1 1 auto; }
.field-actions { display: grid; gap: 8px; }
.field-help { padding-left: 18px; }
.field-help li { margin-bottom: 5px; }

/* Big touch targets: 48px is the smallest comfortable tap area with gloves on. */
.btn.big { padding: 14px 16px; font-size: 16px; min-height: 48px; }
.btn.primary-save { background: var(--ok); border-color: var(--ok); }
.btn.primary-save:hover { background: #10583a; border-color: #10583a; }
.field-form input.big, .field-form select.big { min-height: 48px; font-size: 16px; }
.field-form input.num { text-align: center; font-variant-numeric: tabular-nums; }
.label-like { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #33404e; }

.stepper { display: flex; gap: 8px; align-items: stretch; }
.stepper .step { min-width: 68px; min-height: 48px; font-size: 17px; }
.stepper input { flex: 1 1 auto; }
input[type="range"] { width: 100%; margin-top: 10px; height: 34px; accent-color: var(--brand); }

.file-btn { display: block; }
.gps-line { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.gps-line[data-state="ok"] { color: var(--ok); }
.gps-line[data-state="denied"], .gps-line[data-state="unavailable"] { color: var(--warn); }

.photo-staging { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.photo-staging li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  width: 104px;
}
.photo-staging img {
  width: 104px; height: 104px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.field-flash {
  padding: 10px 12px;
  border-radius: var(--radius);
  border-left: 4px solid var(--muted);
  background: #eef2f6;
  font-size: 14px;
  margin: 10px 0;
}
.field-flash.success { background: #e6f6ee; border-color: var(--ok); color: #10583a; }
.field-flash.error { background: #fdeceb; border-color: var(--err); color: #8c1c16; }
.field-flash.warning { background: #fdf3e0; border-color: var(--accent); color: #7a4a00; }

.outbox-actions { margin-bottom: 12px; }
.outbox-item.rejected { border-left-color: var(--err); background: #fdf6f5; }
.outbox-item.pending, .outbox-item.syncing { border-left-color: var(--accent); }
.outbox-item.accepted, .outbox-item.duplicate { border-left-color: var(--ok); }

/* Photo thumbnails in the office progress feed. */
.feed-photos { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; }
.feed-photos img {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  .unmapped-panel { max-height: none; }
}

@media (max-width: 640px) {
  .topbar-inner { min-height: 0; padding: 8px 12px; }
  .nav { order: 3; width: 100%; }
  .container { padding: 14px 12px 48px; }
  th, td { padding: 8px 7px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .actions .btn { width: auto; flex: 1 1 auto; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
  .stat-value { font-size: 20px; }
  .map { height: 320px; }
  .map-tall { height: 400px; }
  .tl-row { grid-template-columns: 130px minmax(0, 1fr); gap: 6px; }
  .chart-wrap { height: 260px; }
  .gantt-toolbar .btn { width: auto; }
  .unmapped-list .btn { width: auto; }
  /* Icon + wording on one line, a full-width tap target underneath. */
  .install-row { flex-wrap: wrap; }
  .install-text { flex: 1 1 140px; }
  .install-dismiss { order: 2; align-self: flex-start; }
  .install-row .btn { width: 100%; flex: 1 1 100%; order: 3; }
}

/* ------------------------------------------------------------- materials -- */
.materials-readiness {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.materials-readiness .stat-value { font-size: 24px; font-weight: 700; margin-right: 6px; }
.materials-table td { vertical-align: top; }
.materials-history td { padding-top: 0; }
.materials-history details summary { cursor: pointer; color: var(--brand-dark); }
.materials-forms { gap: 18px; align-items: start; }
.materials-form h3 { margin: 0 0 8px; font-size: 15px; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }

/* Field materials screen: one big tappable row per kit line. */
.material-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.material-row {
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.material-head {
  width: 100%;
  min-height: 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: none;
  border: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.material-head[aria-expanded="true"] { background: #eef2f6; }
.material-name { font-weight: 600; }
.material-figures { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.material-body { padding: 4px 14px 16px; border-top: 1px solid var(--border); }
.material-body hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.inspect-toggle { display: flex; gap: 16px; }
.inspect-toggle label { display: flex; align-items: center; gap: 6px; min-height: 44px; }

@media (max-width: 640px) {
  .materials-forms { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------- weather --
   Three bands, deliberately NOT the RAG palette: schedule health and weather
   are different questions and must not be mistaken for each other at a glance.
   Weather chips are outlined, RAG chips are solid. */
.badge.weather-severe { background: #fde2e1; color: var(--err); box-shadow: inset 0 0 0 1px rgba(179, 38, 30, 0.35); }
.badge.weather-rough  { background: #fdf0d5; color: var(--warn); box-shadow: inset 0 0 0 1px rgba(161, 92, 0, 0.30); }
.badge.weather-fair   { background: #d9f2e4; color: var(--ok); box-shadow: inset 0 0 0 1px rgba(23, 121, 76, 0.25); }

/* Site card: current conditions ------------------------------------------ */
.weather-now {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.weather-glyph { font-size: 40px; line-height: 1; flex: 0 0 auto; }
.weather-now-main { flex: 1 1 160px; min-width: 0; }
.weather-condition { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.weather-temp { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.weather-outlook { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.weather-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, auto));
  gap: 2px 18px;
  margin: 0;
  flex: 0 1 auto;
}
.weather-figures dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.weather-figures dd { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }

/* Site card: the 4-day strip --------------------------------------------- */
.weather-days {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}
.weather-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfcfd;
  text-align: center;
}
.weather-day.is-today { background: #eef3f8; border-color: #c6d5e4; }
.weather-day-name { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
.weather-day-glyph { font-size: 22px; line-height: 1.1; }
.weather-day-text { line-height: 1.25; }
.weather-day-temp { font-variant-numeric: tabular-nums; font-weight: 600; }
.weather-day-rain { color: var(--brand-dark); }
.weather-asof { margin: 10px 0 0; }

/* Dashboard: weather watch ------------------------------------------------ */
.weather-table td { vertical-align: middle; }
.weather-table td .small.muted { display: block; }
.weather-row.is-worst { background: #fdf6f5; }
.weather-row.is-worst.weather-fair { background: #f6fbf8; }
.weather-row.is-worst td:first-child { box-shadow: inset 3px 0 0 var(--err); }
.weather-row.is-worst.weather-rough td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.weather-row.is-worst.weather-fair td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.weather-more { margin: 10px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  .weather-figures { grid-template-columns: repeat(3, 1fr); flex: 1 1 100%; }
  .weather-days { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  .topbar, .filters, .gantt-toolbar, .actions { display: none; }
  .timeline-scroll { overflow: visible; }
  .tl-group { break-inside: avoid; }
  .card { box-shadow: none; break-inside: avoid; }
}
