/* Xtreme AssetCollect v1.1.1 — AssetCollect style tokens v1.1 (Field Sheet, Signal Blue) */
/* Barlow + Barlow Condensed: still loaded from Google Fonts until the font files are added to www/fonts. */
@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700&display=swap");
/* JetBrains Mono ships inside the app (www/fonts, SIL Open Font License). */
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-Regular.ttf") format("truetype"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-Bold.ttf") format("truetype"); font-weight: 600 800; font-style: normal; font-display: swap; }

:root {
  --ac-paper: #E8ECE3;
  --ac-sheet: #FAFBF7;
  --ac-raised: #EEF1EA;
  --ac-rule: #C6D0C2;
  --ac-line-strong: #6F8577;
  --ac-ink: #17201C;
  --ac-muted: #56655C;
  --ac-blue: #1D4ED8;
  --ac-blue-hover: #1E40AF;
  --ac-blue-soft: #DBE6FB;
  --ac-on-blue: #FFFFFF;
  --ac-ok: #1E7A3E;
  --ac-warn: #C2410C;
  --ac-error: #B91C1C;
  --ac-chrome: #1B2520;
  --ac-gridline: rgba(237, 242, 235, .055);
  --ac-water: #3B82F6;
  --ac-sewer: #22C55E;
  --ac-storm: #14B8A6; /* kept from v1.0 so storm reads apart from sanitary */
  --ac-reclaimed: #A855F7;
  --ac-sign: #F3BB28;
  --ac-tree: #4D9A52;
  --ac-font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --ac-font-body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --ac-font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ac-radius: 7px;
  --ac-touch: 48px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* Dark grid band: header bars, footers, map controls */
.band {
  --ac-paper: #1B2520;
  --ac-sheet: #222E28;
  --ac-raised: #26332C;
  --ac-rule: #2E3B34;
  --ac-line-strong: #7A8D82;
  --ac-ink: #EDF2EB;
  --ac-muted: #98A99F;
  --ac-blue: #60A5FA;
  --ac-blue-hover: #93C5FD;
  --ac-blue-soft: #26332C;
  --ac-on-blue: #0B1526;
  --ac-ok: #4CC27A;
  --ac-warn: #FB923C;
  --ac-error: #F87171;
  background-color: var(--ac-chrome);
  color: var(--ac-ink);
  background-image:
    linear-gradient(var(--ac-gridline) 1px, transparent 1px),
    linear-gradient(90deg, var(--ac-gridline) 1px, transparent 1px),
    linear-gradient(rgba(237, 242, 235, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 242, 235, .05) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 200px 200px, 200px 200px;
}

/* Night: optional dark mode for the paper sections (Settings > Night mode) */
.ac-night {
  --ac-paper: #0E1311;
  --ac-sheet: #151C18;
  --ac-raised: #1B2420;
  --ac-rule: #2A352F;
  --ac-line-strong: #7A8D82;
  --ac-ink: #E3E9E2;
  --ac-muted: #9DAFA4;
  --ac-blue: #60A5FA;
  --ac-blue-hover: #93C5FD;
  --ac-blue-soft: #1B2A3D;
  --ac-on-blue: #0B1526;
  --ac-ok: #4CC27A;
  --ac-warn: #FB923C;
  --ac-error: #F87171;
  --ac-chrome: #090D0B;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ac-paper); color: var(--ac-ink); font-family: var(--ac-font-body); font-size: 16px; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ac-blue); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--ac-sheet); padding: 8px; }
.mono { font-family: var(--ac-font-mono); }

#app { height: 100%; }
.view, .dialog { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--ac-paper); color: var(--ac-ink); }
.dialog { z-index: 20; }
.bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 14px 10px; border-bottom: 1px solid var(--ac-rule); }
.foot { display: flex; gap: 10px; padding: 12px 14px calc(14px + var(--safe-b)); }
.foot .btn { flex: 1; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad { padding: 14px 16px 28px; max-width: 760px; width: 100%; margin: 0 auto; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; }
.center { text-align: center; }
.muted { color: var(--ac-muted); } .small { font-size: 13px; } .strong { font-weight: 600; } .w64 { width: 64px; flex: none; }
h1, h2, h3 { margin: 0; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; }
.brand h1, .h-bar { font-family: var(--ac-font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.brand h1 { font-size: 22px; } .h-bar { font-size: 20px; }
.logo { width: 34px; height: 34px; border-radius: var(--ac-radius); background: var(--ac-blue); color: var(--ac-on-blue); display: grid; place-items: center; font-family: var(--ac-font-display); font-weight: 700; font-size: 20px; }
.h2 { font-size: 18px; font-weight: 600; margin: 2px 0; }
.eyebrow { font-family: var(--ac-font-mono); font-size: 11px; letter-spacing: .06em; color: var(--ac-muted); text-transform: uppercase; }
.label-caps { font-family: var(--ac-font-display); font-size: 15px; font-weight: 700; letter-spacing: .08em; color: var(--ac-muted); margin: 20px 0 8px; text-transform: uppercase; }

.icon-btn { width: 44px; height: 44px; flex: none; border-radius: var(--ac-radius); border: 1px solid var(--ac-line-strong); background: var(--ac-sheet); color: var(--ac-ink); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.solid { width: var(--ac-touch); height: var(--ac-touch); }
.icon-btn.danger { color: var(--ac-error); }
.btn { min-height: 50px; border-radius: var(--ac-radius); padding: 0 14px; font-weight: 600; font-size: 16px; cursor: pointer; border: 1px solid var(--ac-line-strong); background: var(--ac-sheet); color: var(--ac-ink); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; }
.btn small { font-size: 11px; font-weight: 500; }
.btn.primary { background: var(--ac-blue); border-color: var(--ac-blue); color: var(--ac-on-blue); font-weight: 700; }
.btn.primary:hover { background: var(--ac-blue-hover); }
.btn.outline { border-color: var(--ac-blue); }
.btn.tall { min-height: 56px; }
.btn.block { width: 100%; margin-top: 16px; }
.btn.danger { border-color: var(--ac-error); color: var(--ac-error); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.stat { background: var(--ac-sheet); border: 1px solid var(--ac-rule); border-radius: var(--ac-radius); padding: 8px 10px; }
.stat b { display: block; font-family: var(--ac-font-mono); font-weight: 500; font-size: 20px; } .stat span { font-size: 12px; color: var(--ac-muted); }
.stat.warn b { color: var(--ac-warn); } .stat.ok b { color: var(--ac-ok); } .stat.bad b { color: var(--ac-error); }
.hero-band { padding: 4px 16px 16px; }

.layer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.layer-list button { width: 100%; text-align: left; min-height: 56px; background: var(--ac-sheet); color: var(--ac-ink); border: 1px solid var(--ac-rule); border-radius: var(--ac-radius); padding: 8px 12px 8px 8px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.layer-list button:hover { border-color: var(--ac-line-strong); }
.swatch { width: 6px; align-self: stretch; border-radius: 3px; flex: none; }
.layer-list .count { font-family: var(--ac-font-mono); font-size: 14px; }

.card { background: var(--ac-sheet); border: 1px solid var(--ac-rule); border-radius: var(--ac-radius); padding: 12px; margin-bottom: 10px; }
.card.opt.on { border: 2px solid var(--ac-blue); }
.badge { width: 44px; height: 44px; border-radius: var(--ac-radius); display: grid; place-items: center; font-family: var(--ac-font-mono); font-size: 12px; font-weight: 500; flex: none; }
.badge.green { background: #DCEFE2; color: #14532D; } .badge.blue { background: var(--ac-blue-soft); color: #1E3A8A; }
.ac-night .badge.green { background: #14532D; color: #BBF7D0; } .ac-night .badge.blue { background: #1E3A8A; color: #BFDBFE; }
.toggle { min-width: 64px; min-height: 44px; border-radius: var(--ac-radius); border: 1px solid var(--ac-line-strong); background: var(--ac-raised); color: var(--ac-ink); font-weight: 700; cursor: pointer; }
.toggle[aria-pressed="true"] { background: var(--ac-blue); border-color: var(--ac-blue); color: var(--ac-on-blue); }
.bul { margin: 10px 0; padding-left: 18px; color: var(--ac-muted); font-size: 14px; line-height: 1.5; }
.radios { border: 0; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--ac-rule); border-radius: var(--ac-radius); background: var(--ac-raised); cursor: pointer; }
.radio input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ac-blue); flex: none; }
.radio span { display: flex; flex-direction: column; gap: 2px; }

/* Forms */
.form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.lbl, .form label.lbl, .form legend { font-size: 15px; font-weight: 600; margin: 6px 0 4px; display: block; }
.req::after { content: " *"; color: var(--ac-error); }
input[type=text], input[type=number], input[type=url], select, textarea { width: 100%; min-height: var(--ac-touch); border-radius: var(--ac-radius); border: 1px solid var(--ac-line-strong); background: var(--ac-sheet); color: var(--ac-ink); padding: 0 12px; font-size: 16px; }
input[type=number] { font-family: var(--ac-font-mono); }
textarea { padding: 10px 12px; min-height: 84px; resize: vertical; }
.select-inline { min-height: 40px; font-weight: 600; font-size: 15px; padding: 0 8px; }
.select-inline.narrow { width: 42%; max-width: 230px; font-size: 13px; }
.err { color: var(--ac-error); font-size: 13px; font-weight: 600; }
[aria-invalid="true"] { border-color: var(--ac-error) !important; border-width: 2px !important; }
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.chips.sub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chips button, .checks label { min-height: var(--ac-touch); border-radius: var(--ac-radius); border: 1px solid var(--ac-line-strong); background: var(--ac-sheet); color: var(--ac-ink); cursor: pointer; font-weight: 600; padding: 4px; }
.chips:not(.sub) button { font-family: var(--ac-font-mono); font-weight: 500; font-size: 17px; min-height: 56px; }
.chips button small { display: block; font-family: var(--ac-font-body); font-size: 10px; font-weight: 500; }
.chips button[aria-pressed="true"] { background: var(--ac-blue); border: 2px solid var(--ac-blue-hover); color: var(--ac-on-blue); }
.chips.sub button[aria-pressed="true"] { background: var(--ac-blue-soft); color: var(--ac-ink); border: 2px solid var(--ac-blue); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.checks label { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; font-weight: 500; font-size: 14px; min-height: 44px; }
.checks input { width: 18px; height: 18px; accent-color: var(--ac-blue); }
.auto { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-family: var(--ac-font-mono); font-size: 13px; }
.auto span { display: block; font-family: var(--ac-font-body); font-size: 11px; color: var(--ac-muted); }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-slot { position: relative; height: 104px; border-radius: var(--ac-radius); border: 1.5px dashed var(--ac-line-strong); background: var(--ac-sheet); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; color: var(--ac-muted); overflow: hidden; cursor: pointer; }
.photo-slot.req { border-color: var(--ac-blue); color: var(--ac-blue); font-weight: 600; }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-slot .rm { position: absolute; top: 4px; right: 4px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; }
.section { border-top: 1px solid var(--ac-rule); margin-top: 18px; padding-top: 6px; }
.sign-item { display: flex; gap: 10px; align-items: center; }
.sign-code { width: 52px; height: 52px; border-radius: var(--ac-radius); background: var(--ac-raised); border: 1px solid var(--ac-rule); display: grid; place-items: center; font-family: var(--ac-font-mono); font-size: 11px; flex: none; text-align: center; }

/* Map */
.map { position: relative; flex: 1; overflow: hidden; background: var(--ac-chrome); }
.map-overlay { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.map-overlay > * { pointer-events: auto; }
.map-overlay.top { top: 10px; left: 10px; right: 10px; }
.map-overlay.right { right: 10px; top: 132px; }
.gps-card { background: var(--ac-sheet); color: var(--ac-ink); border: 1px solid var(--ac-rule); border-radius: var(--ac-radius); padding: 8px 12px; display: flex; align-items: center; gap: 10px; }
#gps-line1 { font-family: var(--ac-font-mono); font-weight: 500; font-size: 14px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ac-line-strong); flex: none; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #1B2520; border: 1px solid #2E3B34; border-radius: var(--ac-radius); padding: 5px 10px; font-size: 12px; color: #EDF2EB; }
.credit { position: absolute; left: 6px; bottom: 6px; z-index: 2; background: #1B2520; color: #EDF2EB; font-size: 11px; padding: 2px 7px; border-radius: 5px; }
.map-panel { padding: 10px 14px calc(12px + var(--safe-b)); border-top: 1px solid var(--ac-rule); display: flex; flex-direction: column; gap: 9px; }
.seg { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.seg button { min-height: 44px; border-radius: var(--ac-radius); border: 1px solid var(--ac-rule); background: var(--ac-sheet); color: var(--ac-muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { border: 2px solid var(--ac-blue); color: var(--ac-ink); background: var(--ac-raised); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.issue { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--ac-rule); }
.issue:last-child { border-bottom: 0; }
.issue .sev { font-family: var(--ac-font-mono); font-size: 11px; padding: 2px 6px; border-radius: 4px; flex: none; color: #FFFFFF; }
.sev.e { background: var(--ac-error); } .sev.w { background: var(--ac-warn); }
.issue button { margin-left: auto; min-height: 36px; border-radius: var(--ac-radius); border: 1px solid var(--ac-line-strong); background: var(--ac-raised); color: var(--ac-ink); padding: 0 10px; cursor: pointer; flex: none; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + var(--safe-b)); z-index: 50; background: #1B2520; color: #EDF2EB; border: 1px solid #7A8D82; border-radius: var(--ac-radius); padding: 10px 16px; max-width: 90vw; font-size: 14px; }

@media (min-width: 900px) {
  .map-panel { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .map-panel .row { flex: 1 1 380px; }
  .map-panel .grid3 { flex: 1 1 420px; }
}
