/* Belton Flushing: crew app. Made to be read outdoors on an iPad: high contrast, big type, big targets. */
:root {
  --ink: #17232e; --muted: #56626d; --subtle: #8a949d; --line: #e2e5e9; --line2: #cfd4da;
  --bg: #f2f3f5; --card: #ffffff; --soft: #f7f8fa;
  --blue: #2a78d6; --blue-d: #1d5fae; --blue-bg: #e9f2fc;
  --red: #d03b3b; --red-d: #b02a2a; --red-bg: #fdeeee;
  --green: #0ca30c; --green-t: #087a08; --green-bg: #e8f6e8;
  --amber: #b46900; --amber-bg: #fff4e2;
  --feed: #6ec1f5; --dead: #f29b9b;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(20,30,40,.06), 0 4px 14px rgba(20,30,40,.06);
  --top: env(safe-area-inset-top, 0px); --bot: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font: 17px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
#app { height: 100%; display: flex; flex-direction: column; }

.boot { margin: auto; text-align: center; color: var(--muted); }
.boot-mark { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 14px; background: var(--blue);
  -webkit-mask: url(/app/icons/drop.svg) center/60% no-repeat; }

/* ---- top bar ---- */
.top { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--top)) 16px 10px;
  background: var(--card); border-bottom: 1px solid var(--line); min-height: 64px; z-index: 5; }
.top .back { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-left: -6px; }
.top .back:active { background: var(--soft); }
.top .titles { flex: 1; min-width: 0; }
.top h1 { font-size: 20px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sub { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--blue); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 18px;
  font-size: 14px; font-weight: 650; white-space: nowrap; }
.pill.ok { background: var(--green-bg); color: var(--green-t); }
.pill.wait { background: var(--amber-bg); color: var(--amber); }
.pill.err { background: var(--red-bg); color: var(--red-d); }
.pill .dot { width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.iconbtn:active { background: var(--soft); }

/* ---- layout ---- */
.scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 20px calc(28px + var(--bot)); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 12px; }
.section-h h2 { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.section-h .aside { font-size: 15px; color: var(--muted); }

.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }

/* ---- home ---- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 22px 24px;
  background: var(--blue); color: #fff; border-radius: 18px; box-shadow: 0 6px 22px rgba(42,120,214,.28); }
.hero .k { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; opacity: .85; }
.hero h2 { font-size: 26px; font-weight: 760; margin: 4px 0 2px; letter-spacing: -.015em; }
.hero p { opacity: .92; font-size: 16px; }
.hero .go { background: #fff; color: var(--blue-d); font-weight: 750; height: 56px; padding: 0 26px; border-radius: 14px; font-size: 18px; }
.hero.done { background: var(--green-t); }
.overall { display: flex; gap: 22px; align-items: center; padding: 16px 20px; margin-top: 14px; }
.overall .num { font-size: 30px; font-weight: 780; letter-spacing: -.02em; }
.overall .lab { font-size: 14px; color: var(--muted); }
.overall .bar { flex: 1; }
.bar { height: 10px; border-radius: 5px; background: #e6e9ed; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar .g { background: var(--green); } .bar .r { background: var(--red); } .bar .a { background: #f0a020; }

.filters { display: flex; gap: 8px; }
.seg { display: inline-flex; background: #e6e9ed; border-radius: 12px; padding: 3px; }
.seg button { height: 38px; padding: 0 16px; border-radius: 9px; font-size: 15px; font-weight: 650; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.seq { position: relative; padding: 16px 18px 16px; text-align: left; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.seq:active { transform: scale(.985); }
.seq .row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seq .no { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.seq .big { font-size: 30px; font-weight: 780; line-height: 1; letter-spacing: -.02em; }
.seq .streets { font-size: 15px; color: var(--ink); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.seq .meta { font-size: 14px; color: var(--muted); margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seq.done { background: #f8fbf8; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.tag.call { background: var(--red-bg); color: var(--red-d); }
.tag.off { background: var(--green-bg); color: var(--green-t); }
.tag.dl { background: #eef1f4; color: var(--muted); }
.tag.done { background: var(--green-bg); color: var(--green-t); }
.tag.prog { background: var(--amber-bg); color: var(--amber); }
.tag.att { background: var(--red-bg); color: var(--red-d); }

/* ---- split screens (sequence, run) ---- */
.split { flex: 1; display: flex; min-height: 0; }
.side { width: 460px; flex: none; display: flex; flex-direction: column; min-height: 0; background: var(--bg);
  border-right: 1px solid var(--line); }
.side .scroll { padding: 16px 16px calc(24px + var(--bot)); }
.mapcol { flex: 1; position: relative; min-width: 0; background: #e8eae6; }
.mapbox { position: absolute; inset: 0; }
.udfmap-canvas { display: block; }
@media (orientation: portrait), (max-width: 900px) {
  .split { flex-direction: column-reverse; }
  .side { width: auto; flex: 1; border-right: 0; border-top: 1px solid var(--line); }
  .mapcol { flex: none; height: 44vh; }
}

/* map controls */
.mapui { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.mapui button { width: 48px; height: 48px; border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: var(--shadow);
  display: grid; place-items: center; color: var(--ink); }
.mapui button.on { background: var(--blue); color: #fff; }
.tabs { position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; background: rgba(255,255,255,.96);
  border-radius: 12px; padding: 4px; box-shadow: var(--shadow); }
.tabs button { height: 40px; padding: 0 16px; border-radius: 9px; font-weight: 650; font-size: 15px; color: var(--muted); }
.tabs button.on { background: var(--ink); color: #fff; }
.legend { position: absolute; left: 12px; bottom: 12px; z-index: 2; background: rgba(255,255,255,.96); border-radius: 12px;
  box-shadow: var(--shadow); padding: 10px 14px; font-size: 13px; display: grid; grid-template-columns: auto auto; gap: 5px 16px; }
.legend span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.lg { display: inline-block; flex: none; }
.lg.x { width: 16px; height: 16px; border-radius: 8px; background: var(--red); position: relative; }
.lg.x::before, .lg.x::after { content: ''; position: absolute; left: 7px; top: 3px; width: 2px; height: 10px; background: #fff; transform: rotate(45deg); }
.lg.x::after { transform: rotate(-45deg); }
.lg.o { width: 16px; height: 16px; border-radius: 8px; border: 3.5px solid var(--green); background: #fff; }
.lg.h { width: 16px; height: 16px; border-radius: 8px; background: var(--blue); }
.lg.ln { width: 22px; height: 5px; border-radius: 3px; background: var(--blue); }
.lg.ln.f { background: var(--feed); } .lg.ln.d { background: var(--dead); }
.lg.ln.t { background: repeating-linear-gradient(90deg, var(--blue) 0 5px, transparent 5px 8px); height: 3px; }
.gpsnote { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 3; background: var(--ink); color: #fff;
  padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.viewer { position: absolute; inset: 0; background: #fff; display: flex; flex-direction: column; }
.viewer .vbox { flex: 1; position: relative; }
.viewer .caption { flex: none; max-height: 34%; overflow: auto; padding: 10px 16px 14px; border-top: 1px solid var(--line); background: var(--soft); }
.cu-strip { position: absolute; top: 64px; left: 12px; z-index: 3; display: flex; gap: 6px; }
.cu-strip button { min-width: 44px; height: 44px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.96); box-shadow: var(--shadow);
  font-weight: 800; font-size: 18px; }
.cu-strip button.on { background: var(--ink); color: #fff; }
.noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 30px; }

/* ---- sequence run list ---- */
.seqhead { padding: 18px 18px 16px; }
.seqhead .bar { margin: 12px 0 6px; }
.seqhead .stats { display: flex; justify-content: space-between; font-size: 15px; color: var(--muted); }
.runcard { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; width: 100%; text-align: left; margin-top: 10px; }
.runcard:active { background: var(--soft); }
.runcard .n { flex: none; width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; font-weight: 800; font-size: 17px;
  background: var(--blue); color: #fff; }
.runcard .n.done { background: var(--green); } .runcard .n.prog { background: #f0a020; } .runcard .n.stop { background: var(--red); }
.runcard .body { flex: 1; min-width: 0; }
.runcard .t { font-weight: 700; font-size: 17px; line-height: 1.25; }
.runcard .m { font-size: 14px; color: var(--muted); margin-top: 3px; }
.runcard .w { font-size: 14px; color: var(--amber); margin-top: 6px; font-weight: 600; }
.runcard .c { font-size: 14px; color: var(--red-d); margin-top: 6px; font-weight: 650; }
.runcard .chev { color: var(--subtle); margin-top: 8px; }
.runcard.next { box-shadow: 0 0 0 2.5px var(--blue), var(--shadow); }
details.more { margin-top: 14px; }
details.more summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary .chev { transform: rotate(90deg); }
details.more .in { padding: 0 16px 14px; font-size: 15px; }
details.more li { margin: 4px 0; }
.offline-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; margin-top: 10px; font-size: 15px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px; border-radius: 13px;
  font-weight: 700; font-size: 17px; background: var(--blue); color: #fff; }
.btn:active { filter: brightness(.93); }
.btn.sm { height: 40px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn.ghost { background: #eef1f4; color: var(--ink); }
.btn.red { background: var(--red); } .btn.green { background: var(--green-t); }
.btn.outline { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line2); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; }

/* ---- run steps ---- */
.runhead { padding: 14px 16px; margin-bottom: 12px; }
.runhead .hy { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.alert { border-radius: 12px; padding: 12px 14px; margin-top: 10px; font-size: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { flex: none; margin-top: 2px; }
.alert.call { background: var(--red-bg); color: var(--red-d); font-weight: 700; border: 1.5px solid #f2c5c5; }
.alert.caution { background: #fff; color: var(--red-d); border: 1.5px solid #f2c5c5; }
.alert.warn { background: var(--amber-bg); color: #7a4800; }
.alert.info { background: var(--blue-bg); color: #164c8c; }
.alert .grow { flex: 1; }

.step { margin-top: 10px; overflow: hidden; }
.step-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; text-align: left; }
.step-n { flex: none; width: 34px; height: 34px; border-radius: 17px; display: grid; place-items: center; font-weight: 800; font-size: 16px;
  background: #e3e7eb; color: var(--muted); }
.step.cur .step-n { background: var(--ink); color: #fff; }
.step.ok .step-n { background: var(--green); color: #fff; }
.step-t { flex: 1; min-width: 0; }
.step-t b { display: block; font-size: 17px; font-weight: 750; letter-spacing: -.005em; }
.step-t span { display: block; font-size: 14px; color: var(--muted); }
.step:not(.cur) .step-t b { font-size: 16px; }
.step-b { padding: 0 16px 16px; }
.step-b > p { color: var(--muted); font-size: 15px; margin-bottom: 8px; }
.rule { background: var(--red-bg); color: var(--red-d); font-weight: 650; font-size: 15px; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.vrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.vrow:first-of-type { border-top: 0; }
.vrow .vt { flex: none; min-width: 46px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff; }
.vt.c { background: var(--red); } .vt.o { background: var(--green); } .vt.i { background: var(--green); } .vt.s { background: var(--feed); color: var(--blue-d); } .vt.h { background: var(--blue); }
.vrow .vi { flex: 1; min-width: 0; text-align: left; }
.vrow .vi b { font-size: 17px; font-weight: 750; letter-spacing: .01em; }
.vrow .vi .wh { font-size: 15px; color: var(--ink); line-height: 1.3; }
.vrow .vi .nt { font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.vrow .cu { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 6px; border: 1.5px dashed var(--ink);
  border-radius: 6px; font-size: 13px; font-weight: 800; margin-left: 6px; vertical-align: 1px; background: #fff; }
.vrow.next { background: var(--blue-bg); margin: 0 -16px; padding: 10px 16px; border-top-color: transparent; }
.vrow.next + .vrow { border-top-color: transparent; }
.tick { flex: none; width: 56px; height: 56px; border-radius: 14px; border: 2.5px solid var(--line2); background: #fff; display: grid; place-items: center; }
.tick svg { opacity: 0; }
.tick.on { background: var(--green); border-color: var(--green); }
.tick.on svg { opacity: 1; }
.tick.on.red { background: var(--red); border-color: var(--red); }
.wont { font-size: 14px; color: var(--red-d); font-weight: 700; padding: 6px 2px; margin-top: 3px; }
.step-foot { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.done-line { font-size: 14px; color: var(--green-t); font-weight: 650; }

/* hydrant */
.hyd { display: flex; gap: 16px; align-items: center; margin: 4px 0 8px; }
.hyd svg { flex: none; }
.hyd .what { font-size: 19px; font-weight: 750; line-height: 1.3; }
.hyd .where { font-size: 15px; color: var(--muted); margin-top: 4px; }

/* timer */
.timer { display: flex; gap: 20px; align-items: center; margin: 6px 0 4px; }
.ring { position: relative; width: 150px; height: 150px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .tm { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .tm b { font-size: 36px; font-weight: 780; letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: block; line-height: 1; }
.ring .tm span { font-size: 13px; color: var(--muted); font-weight: 600; }
.timer .msg { flex: 1; font-size: 17px; line-height: 1.35; }
.timer .msg b { display: block; font-size: 19px; margin-bottom: 3px; }
.slow { margin-top: 10px; }
.slow .bar { height: 14px; border-radius: 7px; margin: 8px 0; }
.slow .bar i { background: var(--blue); transition: width 1s linear; }

.record { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 16px; margin: 4px 0 12px; }
.record dt { color: var(--muted); }
.record dd { margin: 0; font-weight: 650; }
.yn { display: inline-flex; gap: 8px; }
.yn button { height: 40px; min-width: 70px; border-radius: 10px; font-weight: 700; background: #eef1f4; }
.yn button.on.y { background: var(--green-t); color: #fff; } .yn button.on.n { background: var(--red); color: #fff; }
textarea.notes { width: 100%; min-height: 84px; border-radius: 12px; border: 1.5px solid var(--line2); padding: 10px 12px; resize: vertical; background: #fff; }

/* ---- sheets (dialogs) ---- */
.sheet-bg { position: fixed; inset: 0; background: rgba(15,22,30,.42); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.sheet { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 20px; padding: 22px 22px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.sheet h2 { font-size: 22px; font-weight: 780; letter-spacing: -.01em; }
.sheet .lead { font-size: 17px; margin: 8px 0 12px; }
.sheet .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.reasons button { display: block; width: 100%; text-align: left; padding: 14px 14px; border-radius: 12px; background: #f2f4f6; margin-top: 8px; font-weight: 650; }
.reasons button.on { background: var(--ink); color: #fff; }

/* ---- sign in ---- */
.signin { margin: auto; width: min(440px, 92vw); padding: 30px 0; text-align: center; }
.signin .logo { width: 76px; height: 76px; border-radius: 20px; background: var(--blue); display: grid; place-items: center; margin: 0 auto 16px; }
.signin h1 { font-size: 28px; font-weight: 780; letter-spacing: -.02em; }
.signin .sub { color: var(--muted); margin: 6px 0 22px; }
.crewlist button { display: block; width: 100%; height: 60px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); margin-top: 10px; font-weight: 700; font-size: 19px; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 18px 0 20px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 8px; border: 2px solid var(--line2); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 0 auto; }
.pad button { height: 68px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); font-size: 26px; font-weight: 650; }
.pad button:active { background: var(--soft); }
.err { color: var(--red-d); font-weight: 650; min-height: 24px; margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--bot)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px;
  border-radius: 12px; font-weight: 650; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 90vw; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }
