/* HIS OPS card design (docs/design/his-ops-preview.html), shared by every
   rebuilt screen. Navy app bar over a steel-blue work surface; white cards;
   red only for real problems and the brand stripe. */
:root {
  --ground: #C3D5EB;
  --navy: #082852;
  --navy-2: #16365C;
  --navy-3: #1B3A5E;
  --red: #E21A2D;
  --blue: #1F5CA8;
  --card: #FFFFFF;
  --soft: #EEF2F7;
  --line: #DCE5F0;
  --muted: #4A5B70;
  --grip: #6B7C93;
  --glass: rgba(255,255,255,0.40);
  --glass-2: rgba(255,255,255,0.62);
  --ring-track: rgba(8,40,82,0.10);
  --ok: #1D6A2B; --ok-bg: #DDF1E0;
  --warn: #7A4D08; --warn-bg: #F7EBD4;
  --bad: #A12D28; --bad-bg: #FBE0DE;
  --info: #174B8C; --info-bg: #DDEAFB;
  --lane: #8FB8E8; --eyebrow: #4A6A92;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r-card: 18px;
  --shadow: 0 1px 2px rgba(8,40,82,0.10), 0 8px 20px rgba(8,40,82,0.10);
  --shadow-lift: 0 28px 44px rgba(11,37,69,0.32), 0 6px 12px rgba(11,37,69,0.18);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--ground); }
body { font-family: var(--font); color: var(--navy); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* App bar */
/* The header also fills the phone's status-bar area (clock, battery). */
.bar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #FFFFFF; border-bottom: 4px solid var(--red); padding-top: env(safe-area-inset-top, 0px); }
/* See keepBarsOnScreen() in core.js. */
html.view-shifted .bar, html.view-shifted .tabbar { transform: translateY(var(--view-shift, 0px)); }
html.typing .tabbar { display: none; }
.bar-in { max-width: 1720px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; white-space: nowrap; color: #FFFFFF; text-decoration: none; }
.brand b { font-size: 21px; font-weight: 800; letter-spacing: 0.04em; }
.brand .logo { width: 44px; height: 44px; border-radius: 11px; display: block; }
.brand small { font-family: var(--mono); font-size: 11px; font-weight: 700; background: var(--red); color: #FFFFFF; padding: 2px 7px; border-radius: 6px; letter-spacing: 0.04em; }
.topnav { display: flex; gap: 2px; flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.topnav a { height: 40px; padding: 0 12px; white-space: nowrap; border-radius: 999px; color: #FFFFFF; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; text-decoration: none; }
.topnav a[aria-current="page"] { background: #FFFFFF; color: var(--navy); font-weight: 800; }
.topnav a:hover:not([aria-current="page"]) { background: var(--navy-3); }
.bar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pick { display: flex; flex-direction: column; gap: 1px; }
.pick span { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #BFD5EE; }
.pick select { height: 34px; border-radius: 10px; border: 0; background: var(--navy-3); color: #FFFFFF; padding: 0 8px; font-weight: 700; font-size: 14px; max-width: 170px; }
.sync { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #D6E6F7; padding: 0 4px; white-space: nowrap; }
.sync i { width: 9px; height: 9px; border-radius: 99px; background: #F2B544; display: inline-block; }
.sync.live i { background: #5BD17A; }
.sync.error i { background: #FF6B78; }
.menu-btn { height: 34px; padding: 0 12px; border: 2px solid rgba(255,255,255,0.4); border-radius: 10px; background: transparent; color: #FFFFFF; font-weight: 700; font-size: 13px; white-space: nowrap; }
.menu-btn:hover { border-color: #FFFFFF; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--card); color: var(--navy); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 8px; display: flex; flex-direction: column; gap: 2px; z-index: 40; }
.menu-list p { margin: 4px 10px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.menu-list p b { display: block; color: var(--navy); font-size: 15px; }
.menu-list a, .menu-list button { all: unset; box-sizing: border-box; cursor: pointer; padding: 10px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.menu-list a:hover, .menu-list button:hover, .menu-list a:focus-visible, .menu-list button:focus-visible { background: var(--soft); }

/* Page */
main { max-width: 1320px; margin: 0 auto; padding-block: 26px 120px; padding-inline: 24px; display: flex; flex-direction: column; gap: 22px; }
.btn { height: 46px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--navy); color: #FFFFFF; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.ghost { background: var(--glass-2); color: var(--navy); border: 2px solid var(--navy); }
.btn.small { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hint { margin: 0; font-size: 13px; font-weight: 600; color: var(--navy-2); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.soft { background: var(--soft); color: var(--navy-2); }
.kchips { display: flex; gap: 6px; flex-wrap: wrap; }

/* Today banner */
.hero { position: relative; overflow: hidden; background: var(--navy); color: #FFFFFF; border-radius: 24px; padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow); --ring-track: rgba(255,255,255,0.16); }
.hero::before { content: ""; position: absolute; right: -120px; top: -150px; width: 560px; height: 300px; border-radius: 50%; border: 7px solid transparent; border-top-color: var(--red); transform: rotate(-10deg); pointer-events: none; }
.hero-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero-main { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hero-eyebrow { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #BFD5EE; }
.hero h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.1; }
.hero-ring { position: relative; display: flex; align-items: center; gap: 14px; color: #FFFFFF; }
.hero-ring span { display: flex; flex-direction: column; gap: 2px; }
.hero-ring b { font-size: 15px; font-weight: 800; }
.hero-ring small { font-size: 12px; font-weight: 600; color: #BFD5EE; max-width: 190px; }
.lanes { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.lane { box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; border-radius: 16px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); color: #FFFFFF; text-decoration: none; transition: background .15s ease; }
.lane:hover { background: rgba(255,255,255,0.14); }
.lane:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 2px; }
.lane-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.lane-l { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #BFD5EE; }
.lane-n { font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1; color: #FFFFFF; }
.lane-n small { font-size: 16px; font-weight: 700; color: #9DB7D6; }
.lane-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.15); overflow: hidden; }
.lane-bar i { display: block; height: 100%; border-radius: 99px; transition: width .3s ease; }

/* Sections */
.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; grid-auto-flow: dense; align-items: start; }
.w { position: relative; background: var(--card); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); min-width: 0; }
.w.full { grid-column: 1 / -1; }
.w-h { display: flex; align-items: flex-start; gap: 10px; padding-right: 52px; }
.w-h h2 { font-size: 20px; font-weight: 800; }
.w-eyebrow { margin: 0 0 2px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--eyebrow); }
.grip { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--grip); display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.grip:hover, .grip:focus-visible { background: var(--soft); color: var(--navy); }
.sortable-ghost { opacity: 1 !important; background: var(--glass-2) !important; box-shadow: none !important; outline: 3px dashed var(--navy); outline-offset: -3px; }
.sortable-ghost > * { visibility: hidden; }
.sortable-drag, .sortable-fallback { transform: rotate(-2.5deg); box-shadow: var(--shadow-lift) !important; opacity: 1 !important; }
.sortable-chosen .grip { background: var(--navy); color: #FFFFFF; }
.w-note { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--soft); font-weight: 600; color: var(--navy-2); }
.w-note.error { background: var(--bad-bg); color: var(--bad); }

/* Up next */
.att { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.att a { box-sizing: border-box; width: 100%; background: var(--soft); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; text-decoration: none; }
.att a:hover { background: #E4EBF4; }
.att b { display: block; font-size: 15px; font-weight: 800; }
.att small { font-size: 13px; font-weight: 600; color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 99px; margin-top: 5px; flex-shrink: 0; }
.dot.bad { background: var(--bad); } .dot.warn { background: #D69A2D; } .dot.info { background: var(--blue); } .dot.ok { background: var(--ok); }
.all-clear { background: var(--ok-bg); border-radius: 14px; padding: 16px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.tile { width: 36px; height: 36px; border-radius: 10px; color: #FFFFFF; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--ok); }

/* Sales and labor */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpi { background: var(--soft); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.kpi span { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kpi b { font-family: var(--mono); font-size: 22px; font-weight: 700; }
.kpi .chip { white-space: normal; }
.sbars { margin: 0; height: 150px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; padding: 0 2px 22px; border-bottom: 2px solid var(--line); position: relative; }
.sbar { all: unset; box-sizing: border-box; position: relative; height: 100%; cursor: pointer; border-radius: 10px; }
.sbar:hover .b { background: #7FA3CF; }
.sbar:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.sbar.sel small { color: var(--navy); font-weight: 800; }
.sbar .b { position: absolute; left: 14%; right: 14%; bottom: 0; background: #9DB9DA; border-radius: 8px 8px 3px 3px; }
.sbar.sel .b { background: var(--navy) !important; }
.sbar.empty .b { background: repeating-linear-gradient(45deg, #C9D8EA, #C9D8EA 5px, #E4ECF6 5px, #E4ECF6 10px); height: 6% !important; }
.sbar .ly { position: absolute; left: 4%; right: 4%; height: 0; border-top: 3px solid var(--red); }
.sbar small { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.sday { margin: -6px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.sday b { color: var(--navy); font-weight: 800; }
.legend { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin: 0 4px 0 2px; vertical-align: middle; }
.legend.b { background: var(--navy); }
.legend.ly { height: 0; border-top: 3px solid var(--red); border-radius: 0; margin-left: 10px; }

/* Coming up */
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tl a { display: flex; align-items: center; gap: 14px; background: var(--soft); border-radius: 14px; padding: 10px 14px 10px 10px; text-decoration: none; }
.tl a:hover { background: #E4EBF4; }
.tl-d { width: 52px; height: 52px; border-radius: 12px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 6px rgba(8,40,82,0.1); }
.tl-d b { font-size: 20px; font-weight: 800; line-height: 1; }
.tl-d small { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--eyebrow); }
.tl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-t b { font-weight: 800; overflow-wrap: anywhere; }
.tl-t small { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Shift notes (handoffs) */
.handoff { background: var(--soft); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.handoff-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--muted); }
.handoff dl { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.handoff dt { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.handoff dd { margin: 0; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Performance coach */
.coach { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ci { background: var(--soft); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; border-top: 5px solid var(--grip); }
.ci.ok { border-top-color: var(--ok); } .ci.warn { border-top-color: #D69A2D; } .ci.bad { border-top-color: var(--red); }
.ci h3 { font-size: 17px; font-weight: 800; }
.ci .finding { margin: 0; font-weight: 700; }
.ci dl { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.ci dt { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.ci dd { margin: 0; font-weight: 600; }
.ci .btn { margin-top: auto; }

/* Loading */
.skeleton { background: linear-gradient(90deg, var(--soft), #F7F9FC, var(--soft)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 14px; }
.hero .skeleton { background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,255,255,0.16), rgba(255,255,255,0.08)); background-size: 200% 100%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Forms and dialogs */
dialog.sheet { border: 0; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lift); color: var(--navy); }
dialog.sheet::backdrop { background: rgba(8,40,82,0.45); }
dialog.sheet form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
dialog.sheet h2 { font-size: 22px; font-weight: 800; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field span { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea { height: 44px; border: 2px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--card); font-weight: 600; }
.field textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy); outline: none; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-error { margin: 0; color: var(--bad); font-weight: 700; min-height: 1.2em; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--navy); color: #FFFFFF; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lift); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Sign-in card (shown by ../auth.js) */
#authOverlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; background: linear-gradient(160deg, var(--navy) 0%, #0F3C73 100%); }
.auth-card { width: min(440px, 100%); background: var(--card); border-radius: 24px; padding: 28px 28px 24px; box-shadow: var(--shadow-lift); display: flex; flex-direction: column; gap: 10px; border-top: 6px solid var(--red); }
.auth-card .auth-logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto; display: block; }
.auth-card h2 { text-align: center; font-size: 26px; font-weight: 800; }
.auth-subtitle { margin: 0; text-align: center; font-weight: 700; color: var(--muted); }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card #authMessage { margin: 0; font-size: 14px; font-weight: 600; color: var(--navy-2); }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.auth-card input, .auth-card select { height: 46px; border: 2px solid var(--line); border-radius: 12px; padding: 0 12px; font-size: 16px; font-weight: 600; letter-spacing: normal; text-transform: none; color: var(--navy); background: var(--card); }
.auth-card input:focus, .auth-card select:focus { border-color: var(--navy); outline: none; }
.auth-card button[type="submit"] { height: 48px; border: 0; border-radius: 14px; background: var(--red); color: #FFFFFF; font-weight: 800; font-size: 16px; }
.auth-card button[type="submit"]:disabled { opacity: 0.6; }
.auth-secondary { height: 46px; border: 2px solid var(--navy); border-radius: 14px; background: transparent; color: var(--navy); font-weight: 700; }
.auth-text-button { border: 0; background: transparent; color: var(--muted); text-decoration: underline; font-weight: 600; }
.auth-card .hint { text-align: center; font-size: 12px; color: var(--muted); }
.auth-language-tools { display: flex; justify-content: flex-end; }
.auth-language-button { border: 2px solid var(--line); border-radius: 999px; background: var(--card); padding: 4px 10px; font-size: 12px; font-weight: 700; }

/* Bottom tabs on smaller screens */
.tabbar { display: none; }
/* The app bar fits the full menu only on wide screens (as in the design). */
@media (max-width: 1700px) {
  .topnav { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--navy); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); gap: 2px; }
  .tabbar a { height: 56px; border-radius: 14px; color: #FFFFFF; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 700; text-decoration: none; min-width: 0; }
  .tabbar a[aria-current="page"] { background: #FFFFFF; color: var(--navy); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 1020px) {
  .widgets { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .bar-in { padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .bar-tools { margin-left: 0; width: 100%; flex-wrap: wrap; row-gap: 10px; }
  .pick { flex: 1 1 140px; min-width: 0; }
  .pick span { white-space: nowrap; }
  .pick select { max-width: none; width: 100%; }
  .sync { margin-right: auto; }
  .brand small { display: none; }
  main { padding-inline: 16px; padding-block: 18px 110px; }
  .hero { padding: 22px 18px; }
  .hero-ring svg { width: 92px; height: 92px; }
  .lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lane { padding: 12px; }
  .lane-n { font-size: 24px; }
  .lane-l { font-size: 11px; }
  .w { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Screen pages (Checklists and the screens that follow) ---------- */
.head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.head > div:first-child { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.eyebrow { margin: 0; font-size: 14px; font-weight: 700; color: var(--navy-2); }
.head h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; letter-spacing: -0.01em; line-height: 1.12; }
.lede { margin: 0; font-size: 15px; font-weight: 600; color: var(--navy-2); max-width: 62ch; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--card); color: var(--navy); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.tabs button[aria-selected="true"] { background: var(--navy); color: #FFFFFF; }
.tabs .count { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--soft); color: var(--navy-2); }
.tabs button[aria-selected="true"] .count { background: var(--navy-3); color: #FFFFFF; }
.seg { display: flex; background: var(--glass-2); border-radius: 14px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { min-height: 40px; padding: 4px 14px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; font-size: 14px; color: var(--navy); text-align: left; }
.seg button small { font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); box-shadow: 0 2px 8px rgba(11,37,69,0.14); }

.progress { background: var(--card); border-radius: var(--r-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.progress-top b { font-size: 18px; font-weight: 800; }
.big { font-family: var(--mono); font-size: 22px; font-weight: 700; }
.meter { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; transition: width .3s ease; }
.toolrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; cursor: pointer; }
.toggle input { width: 20px; height: 20px; }

.group { display: flex; flex-direction: column; gap: 10px; }
.group-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 4px; }
.group-h h2 { font-size: 17px; font-weight: 800; }
.group-h span { font-size: 13px; font-weight: 700; color: var(--navy-2); }
.list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .list.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.item { background: var(--card); border-radius: 14px; display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; box-shadow: 0 3px 10px rgba(11,37,69,0.08); min-height: 64px; flex-wrap: wrap; }
.item label { display: flex; align-items: center; gap: 14px; flex: 1 1 220px; min-width: 0; padding: 10px 0 10px 10px; cursor: pointer; }
.item input[type="checkbox"] { appearance: none; width: 28px; height: 28px; border-radius: 9px; border: 2.5px solid var(--grip); background: var(--card); flex-shrink: 0; display: grid; place-items: center; cursor: pointer; margin: 0; }
.item input[type="checkbox"]:checked { background: var(--ok); border-color: var(--ok); }
.item input[type="checkbox"]:checked::after { content: ""; width: 12px; height: 7px; border-left: 3px solid #FFFFFF; border-bottom: 3px solid #FFFFFF; transform: rotate(-45deg) translate(1px, -1px); }
.item .txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item .txt b { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.item .txt small { font-size: 12px; font-weight: 600; color: var(--muted); }
.item.done { background: #F6FAF6; box-shadow: none; }
.item.done .txt b { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(29,106,43,0.5); }
.item.pushed:not(.done) { box-shadow: inset 4px 0 0 var(--blue), 0 3px 10px rgba(11,37,69,0.08); }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 0 8px 52px; }
.item-actions .btn { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.item-actions .btn.ghost { border-width: 2px; }
.empty { background: var(--glass-2); border: 3px dashed rgba(11,37,69,0.35); border-radius: 16px; padding: 22px; text-align: center; font-weight: 700; color: var(--navy-2); }

/* More sheet, camera and photo */
.more-sheet { width: min(720px, calc(100vw - 24px)); }
.sheet-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#moreList { display: flex; flex-direction: column; gap: 18px; }
#moreList h3 { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--eyebrow); margin-bottom: 8px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.more-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--soft); text-decoration: none; color: var(--navy); }
.more-item:hover { background: #E4EBF4; }
.more-item b { display: block; font-weight: 800; font-size: 14px; }
.more-item small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.qr-video { width: 100%; max-height: 50vh; border-radius: 14px; background: #000; object-fit: cover; }
.photo-preview { max-width: 100%; max-height: 40vh; border-radius: 14px; object-fit: contain; align-self: flex-start; }
@media (max-width: 760px) {
  .head h1 { font-size: 28px; }
  .head > .actions { width: 100%; flex-wrap: nowrap; }
  .head > .actions .btn { flex: 1 1 0; height: 44px; padding: 0 10px; font-size: 14px; }
  .tabs { gap: 6px; }
  .tabs button { height: 40px; padding: 0 12px; }
  .item-actions { padding-left: 10px; }
}

/* ---------- Temperatures ---------- */
.trow { background: var(--card); border-radius: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name st" "entry entry"; gap: 8px 12px; align-items: center; padding: 12px 14px; box-shadow: 0 3px 10px rgba(11,37,69,0.08); }
.trow .name { grid-area: name; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trow .name b { font-weight: 800; overflow-wrap: anywhere; }
.trow .name small { font-size: 12px; font-weight: 600; color: var(--muted); }
.trow .name small.reading { color: var(--navy-2); }
.trow .name small.reading.bad { color: var(--bad); }
.trow .st { grid-area: st; justify-self: end; }
.trow .tentry { grid-area: entry; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.trow.out { box-shadow: inset 0 0 0 2px var(--bad); }
.trow.out .tin { border-color: var(--bad); }
.trow:not(.out).has-reading { background: #F6FAF6; box-shadow: none; }
.tin { display: flex; align-items: center; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); height: 44px; flex: 1 1 140px; max-width: 220px; }
.tin input { width: 100%; border: 0; outline: none; padding: 0 8px; text-align: right; font-family: var(--mono); font-size: 17px; font-weight: 700; background: transparent; min-width: 0; }
.tin > span { padding: 0 10px 0 2px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tin:focus-within { border-color: var(--navy); }
.tin .neg { height: 100%; width: 40px; border: 0; border-right: 2px solid var(--line); background: var(--soft); font-size: 20px; font-weight: 800; color: var(--muted); }
.tin .neg.on { background: var(--navy); color: #FFFFFF; }
.tentry .btn.small { height: 44px; }
@media (min-width: 1280px) { .list.tlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* Choice lists (corrective actions) */
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { min-height: 52px; text-align: left; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: 15px; color: var(--navy); }
.choice:hover, .choice:focus-visible { border-color: var(--navy); }

/* ---------- Inbox board ---------- */
.search { max-width: 520px; }
.search input { height: 44px; border: 2px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--card); font-weight: 600; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.col-h { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.col-h h2 { font-size: 19px; font-weight: 800; flex: 1; }
.col-h .count { font-family: var(--mono); font-size: 13px; font-weight: 700; background: var(--card); border-radius: 99px; padding: 3px 10px; }
.drop { display: flex; flex-direction: column; gap: 10px; min-height: 120px; border-radius: 16px; padding: 2px; }
.drop:empty::after { content: attr(data-empty); border: 3px dashed rgba(11,37,69,0.35); border-radius: 16px; padding: 24px 12px; text-align: center; font-size: 14px; font-weight: 700; color: var(--navy-2); }
.kcard { background: var(--card); border-radius: 16px; padding: 12px 14px 12px 4px; display: flex; gap: 6px; box-shadow: var(--shadow); }
.kcard[data-tone="critical"], .kcard[data-tone="high"], .kcard[data-tone="emergency"] { box-shadow: inset 4px 0 0 var(--red), var(--shadow); }
.kcard.needs-owner { background: #FFFDF7; }
.kgrip { width: 36px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--grip); display: flex; align-items: center; justify-content: center; cursor: grab; flex-shrink: 0; touch-action: none; }
.kgrip:hover { background: var(--soft); color: var(--navy); }
.sortable-chosen .kgrip { background: var(--navy); color: #FFFFFF; }
.kbody { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; padding-left: 8px; }
.kcard:not(:has(.kgrip)) .kbody { padding-left: 10px; }
.kbody h3 { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.kdetail { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.kmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); flex-wrap: wrap; }
.kactions { display: flex; gap: 6px; flex-wrap: wrap; }
.kactions .btn { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.kactions .btn.ghost { border-width: 2px; }
.handoff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr); gap: 14px; padding: 12px 4px; border-top: 1px solid var(--line); }
.tl-when b { display: block; font-size: 13px; font-weight: 800; }
.tl-when small, .tl-what small { font-size: 12px; font-weight: 600; color: var(--muted); }
.tl-what b { display: block; font-weight: 800; overflow-wrap: anywhere; }
.tl-what p { margin: 4px 0; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 900px) { .board { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .timeline li { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* ---------- History, incidents, notices ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.addform { background: var(--card); border-radius: var(--r-card); padding: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; box-shadow: var(--shadow); }
.addform.flat { box-shadow: none; padding: 0; }
.addform .field { flex: 1 1 160px; }
.compliance { display: flex; flex-direction: column; gap: 8px; }
.compliance-row { background: var(--soft); border-radius: 14px; }
.compliance-row summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.compliance-row summary::-webkit-details-marker { display: none; }
.compliance-row summary b { display: block; font-weight: 800; }
.compliance-row summary small { font-size: 13px; font-weight: 600; color: var(--muted); }
.compliance-detail { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.report-lines { list-style: none; margin: 0; padding: 0; }
.report-lines li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.report-lines li.done b { color: var(--muted); }
.report-lines .mark { width: 22px; flex-shrink: 0; font-weight: 800; text-align: center; }
.report-lines b { display: block; font-weight: 700; overflow-wrap: anywhere; }
.report-lines small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.report-lines small.bad { color: var(--bad); }
.report-area { font-size: 15px; font-weight: 800; margin: 10px 0 2px; }
.history-day label { flex: 1 1 260px; }
.incident h3, .notice h3 { font-size: 19px; font-weight: 800; }
.incident p, .notice p { margin: 0; }
.incident[data-tone="critical"], .incident[data-tone="high"] { box-shadow: inset 5px 0 0 var(--red), var(--shadow); }
.notice.unread { box-shadow: inset 5px 0 0 var(--blue), var(--shadow); }
.notice-text { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; }
.danger-text { color: var(--bad); border-color: var(--bad) !important; }
.checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checks legend { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* Maintenance */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { position: relative; overflow: hidden; background: var(--card); border: 0; border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; box-shadow: var(--shadow); color: var(--navy); text-align: left; cursor: pointer; }
.stat[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--navy), var(--shadow); }
.stat-n { font-size: 26px; font-weight: 800; }
.stat-l { font-size: 13px; font-weight: 700; color: var(--navy-2); }
.stat i { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.cards .kactions a { font-size: 13px; font-weight: 700; align-self: center; }
.eq { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.eqc { background: var(--card); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.eqc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eqc-top > div { flex: 1; min-width: 0; }
.eqc h3 { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.eqc small { font-size: 12px; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.eqc .actions { gap: 6px; align-items: center; }
.eqc .actions a:not(.btn) { font-size: 13px; font-weight: 700; }
.tile.eq { display: flex; background: var(--blue); width: 44px; height: 44px; }
.pmrow { background: var(--card); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: 0 3px 10px rgba(11,37,69,0.08); }
.pmrow > div { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pmrow b { font-size: 15px; font-weight: 800; }
.pmrow small { font-size: 12px; font-weight: 600; color: var(--muted); }
.pmrow .actions { gap: 6px; }
.sheet-h { font-size: 16px; font-weight: 800; margin: 6px 0 0; }
dialog.sheet:has(form.wide) { width: min(820px, calc(100vw - 32px)); }
dialog.sheet form.wide { padding-bottom: 8px; }
dialog.sheet .update-form { border-top: 2px solid var(--line); background: var(--soft); }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }
fieldset.field { border: 0; padding: 0; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.checks input[type="checkbox"] { width: 20px; height: 20px; padding: 0; border-radius: 4px; }
.logday .eqc-top b { font-size: 18px; font-weight: 800; }
.logday b { font-size: 13px; font-weight: 800; }
.logtimes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0; }
.logtimes dt { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.logtimes dd { margin: 0; font-size: 13px; font-weight: 700; }
.eqc.sensor[data-tone="bad"] { box-shadow: inset 4px 0 0 var(--red), var(--shadow); }
.eqc.sensor[data-tone="warn"] { box-shadow: inset 4px 0 0 #D69A2D, var(--shadow); }
.big-reading { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big-reading b { font-size: 30px; font-weight: 800; }
.snap { aspect-ratio: 16 / 9; border-radius: 12px; background: var(--soft); overflow: hidden; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.snap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.readings { max-height: 320px; overflow: auto; border-radius: 12px; border: 1px solid var(--line); }
.readings table { width: 100%; border-collapse: collapse; font-size: 13px; }
.readings th, .readings td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.readings th { position: sticky; top: 0; background: var(--card); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.readings p { margin: 0; padding: 12px; }
.pmrow .when { flex: 0 0 150px; }
.pmrow .when b { font-size: 14px; }
.pmrow a b { color: var(--navy); }
details.eqc summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; }

/* Store operations */
.fpc-record > summary, details.eqc > summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; list-style: none; }
.fpc-record > summary::-webkit-details-marker, details.eqc > summary::-webkit-details-marker { display: none; }
.fpc-record > summary span:first-child { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.fpc-record > summary small, details.eqc > summary small { font-size: 12px; font-weight: 600; color: var(--muted); }
.fpc-record[open] > summary { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.fpc-item { background: var(--soft); border-radius: 12px; padding: 12px; display: flex; flex-wrap: wrap; gap: 12px; }
.fpc-item[data-tone="bad"] { box-shadow: inset 4px 0 0 var(--red); }
.fpc-main { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fpc-main > b { font-size: 15px; overflow-wrap: anywhere; }
.fpc-actions { flex: 0 1 300px; display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.fpc-actions select, .comment input { height: 40px; border: 2px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--card); font-weight: 600; }
.comment { display: flex; gap: 6px; flex: 1 1 100%; }
.comment input { flex: 1; min-width: 0; }
.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.comments small { color: var(--muted); font-weight: 600; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs a { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--card); display: grid; place-items: center; font-size: 10px; font-weight: 700; text-align: center; padding: 2px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.done-items > summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.score-chart { width: 100%; height: auto; }
.score-chart text { font-size: 12px; font-weight: 700; fill: var(--muted); }
.score-chart .grid { stroke: var(--line); }
.score-chart .avg { stroke: var(--blue); stroke-dasharray: 6 5; stroke-width: 2; }
.score-chart .line { fill: none; stroke: var(--navy); stroke-width: 3; }
.score-chart .dot { stroke: #FFFFFF; stroke-width: 2; }
.score-chart .dot.ok { fill: var(--ok); } .score-chart .dot.warn { fill: #D69A2D; } .score-chart .dot.bad { fill: var(--red); }
.answers li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.answers li span { display: flex; flex-direction: column; gap: 2px; }
.answers li small { color: var(--muted); font-size: 12px; }
.answers li.bad b { color: var(--bad); } .answers li.warn b { color: var(--warn); }
.score-live { display: flex; align-items: baseline; gap: 10px; }
.score-live b { font-size: 28px; font-weight: 800; }
.visit-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.visit-items .cat { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 6px; }
.visit-item { background: var(--soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.visit-item p { margin: 0; font-weight: 700; }
.visit-item .field-row input { height: 40px; border: 2px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--card); min-width: 0; }
.seg.answer label { position: relative; }
.seg.answer input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg.answer span { display: block; min-height: 40px; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.seg.answer input:checked + span { background: var(--card); box-shadow: 0 2px 8px rgba(11,37,69,0.14); }
.seg.answer input:focus-visible + span { outline: 3px solid var(--blue); }

/* Reviews, challenges, rollout */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.metric-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.metric-table th, .metric-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.metric-table thead th { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.metric-table tbody th { font-weight: 800; }
.metric-table small { font-weight: 600; color: var(--muted); }
.metric-table .muted { color: var(--muted); font-weight: 600; }
.metric-table tr.mine { background: var(--soft); }
.insight h3 { font-size: 17px; font-weight: 800; }
.insight-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; font-size: 13px; }
.insight-lists ul { margin: 4px 0 0; padding-left: 18px; }
.review .star { color: #D69A2D; }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; text-align: center; }
.versus .side { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 12px; background: var(--soft); min-width: 0; }
.versus .side.leading { box-shadow: inset 0 0 0 3px var(--ok); }
.versus .side b { overflow-wrap: anywhere; }
.versus .score { font-size: 24px; font-weight: 800; }
.versus .vs { font-weight: 800; color: var(--red); }
.chip.ghosted { visibility: hidden; }

/* Training: the classic Danger Zone Drill, restyled */
.drill { display: flex; flex-direction: column; gap: 14px; }
.drill .card, .drill .danger-zone-hero { background: var(--card); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.drill .danger-zone-hero { flex-direction: row; align-items: center; gap: 14px; }
.drill .danger-zone-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--red); color: #FFFFFF; font-weight: 800; font-size: 18px; display: grid; place-items: center; flex-shrink: 0; }
.drill h2, .drill h3 { margin: 0; font-weight: 800; }
.drill h3 { font-size: 17px; }
.drill p { margin: 0; }
.drill .status { align-self: flex-start; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: var(--soft); color: var(--navy-2); }
.drill button { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--navy); color: #FFFFFF; font-weight: 700; font-size: 14px; cursor: pointer; }
.drill button.ghost { background: var(--glass-2); color: var(--navy); border: 2px solid var(--navy); }
.drill button:disabled { opacity: 0.5; cursor: default; }
.drill .danger-zone-nav { display: flex; background: var(--glass-2); border-radius: 14px; padding: 4px; gap: 4px; align-self: flex-start; }
.drill .danger-zone-nav button { background: transparent; color: var(--navy); min-height: 40px; }
.drill .danger-zone-nav button.active { background: var(--card); box-shadow: 0 2px 8px rgba(11,37,69,0.14); }
.drill .quiz-track-grid, .drill .danger-zone-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.drill .quiz-track-card { background: var(--card); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.drill .quiz-track-icon { font-size: 28px; }
.drill .quiz-length-actions, .drill .quiz-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.drill .danger-zone-retry { align-self: flex-start; }
.drill .maintenance-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.drill .danger-zone-activity { display: flex; flex-direction: column; }
.drill .danger-zone-activity-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.drill .score-safe { color: var(--ok); }
.drill .score-caution { color: var(--warn); }
.drill .score-danger { color: var(--bad); }
.drill .score-bg-safe { background: var(--ok); }
.drill .score-bg-caution { background: #D69A2D; }
.drill .score-bg-danger { background: var(--red); }
.drill .danger-zone-facts div { background: var(--soft); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.drill .section-title { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; font-size: 13px; font-weight: 700; color: var(--navy-2); }
.drill .danger-zone-chapters { display: flex; flex-direction: column; gap: 8px; }
.drill .danger-zone-chapters summary { display: flex; justify-content: space-between; font-weight: 800; cursor: pointer; list-style: none; }
.drill .danger-zone-chapters ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.drill .quiz-progress-label { display: flex; justify-content: space-between; font-size: 14px; }
.drill .quiz-progress { height: 10px; border-radius: 99px; background: var(--glass-2); overflow: hidden; }
.drill .quiz-progress span { display: block; height: 100%; background: var(--ok); }
.drill .danger-zone-question-meta { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); }
.drill .quiz-category { background: var(--info-bg); color: var(--info); padding: 3px 10px; border-radius: 99px; }
.drill .quiz-question { font-size: 19px; line-height: 1.35; }
.drill .quiz-options { display: flex; flex-direction: column; gap: 8px; }
.drill .quiz-option { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 56px; padding: 10px 14px; background: var(--soft); color: var(--navy); border: 2px solid transparent; }
.drill .quiz-option.selected { border-color: var(--navy); background: var(--card); }
.drill .quiz-option.correct { border-color: var(--ok); background: var(--ok-bg); opacity: 1; }
.drill .quiz-option.incorrect { border-color: var(--bad); background: var(--bad-bg); opacity: 1; }
.drill .quiz-letter { width: 30px; height: 30px; border-radius: 99px; background: var(--card); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.drill .quiz-feedback { background: var(--ok-bg); box-shadow: none; }
.drill .quiz-feedback.incorrect { background: var(--bad-bg); }
.drill .quiz-score-card { align-items: center; text-align: center; }
.drill .quiz-score-ring { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ok) var(--score), var(--soft) 0); }
.drill .quiz-score-ring b { width: 100px; height: 100px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 28px; }
.drill .danger-zone-domains { display: flex; flex-direction: column; gap: 10px; }
.drill .danger-zone-domains > div > div:first-child { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.drill .domain-bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.drill .domain-bar span { display: block; height: 100%; }
.drill .danger-zone-review { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.drill .wrong-answer { color: var(--bad); font-weight: 700; }
.drill .training-storage-message, .drill .quiz-empty { font-size: 13px; font-weight: 600; color: var(--muted); }
.drill .danger-zone-hero { display: none; }
.menu-list [hidden] { display: none; }

/* Settings */
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--navy-2); text-decoration: none; align-self: flex-start; }
.back svg { transform: rotate(180deg); }
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.hub-card { background: var(--card); border-radius: 16px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--shadow); color: var(--navy); text-decoration: none; }
.hub-card:hover { box-shadow: inset 0 0 0 2px var(--navy), var(--shadow); }
.hub-card .tile { background: var(--navy); }
.hub-card > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.hub-card b { font-size: 15px; }
.hub-card small { font-size: 13px; font-weight: 600; color: var(--muted); }
.person .avatar { width: 40px; height: 40px; border-radius: 99px; background: var(--navy); color: #FFFFFF; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.setup-code { background: var(--ok-bg); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.setup-code strong { font-size: 34px; letter-spacing: 0.2em; }
.settings-form { display: flex; flex-direction: column; gap: 12px; }
.settings-form h3 { font-size: 16px; font-weight: 800; }
.pref { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.pref input[type="time"] { height: 40px; border: 2px solid var(--line); border-radius: 10px; padding: 0 10px; align-self: flex-start; }
.channels { padding-left: 28px; }
.checklist-admin .actions { margin: 4px 0; }
.par { align-items: center; }
.par label { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }
.par input { width: 110px; height: 44px; border: 2px solid var(--line); border-radius: 12px; padding: 0 12px; font-weight: 700; font-size: 16px; text-align: right; }
.temp-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.temp-item { background: var(--soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.delivery { padding: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.sticky-save { position: sticky; bottom: 84px; background: var(--glass-2); padding: 10px; border-radius: 14px; backdrop-filter: blur(6px); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline input { height: 38px; }
ul.errors { margin: 0; padding-left: 20px; color: var(--bad); font-size: 13px; font-weight: 600; }
details.eqc > summary > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.w-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.w-list .pop { background: var(--soft); border-radius: 12px; padding: 12px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.w-list .pop > div { flex: 1 1 220px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.w-list .pop small { font-size: 12px; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.btn.danger-fill { background: var(--red); }
.bad-text { color: var(--bad); font-weight: 700; }
.metric-table select { height: 38px; border: 2px solid var(--line); border-radius: 10px; padding: 0 8px; background: var(--card); font-weight: 600; max-width: 220px; }
.matrix th:not(:first-child) { white-space: normal; min-width: 90px; font-size: 10px; }
.matrix td { text-align: center; }
.matrix input { width: 20px; height: 20px; }
.features { flex-direction: column; }
.toggle.feature { align-items: flex-start; }
.toggle.feature span { display: flex; flex-direction: column; }
.toggle.feature small { font-weight: 600; color: var(--muted); font-size: 12px; }
.feedback { list-style: none; }
/* Classic sensor setup markup (../sensors.js), restyled */
.classic-kit .card { background: var(--card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.classic-kit .maintenance-log-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.classic-kit .eyebrow { font-size: 12px; font-weight: 700; color: var(--muted); margin: 0; }
.classic-kit h3 { font-size: 16px; font-weight: 800; margin: 0; }
.classic-kit .status { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: var(--soft); }
.classic-kit .camera-online { background: var(--ok-bg); color: var(--ok); }
.classic-kit .camera-offline { background: var(--warn-bg); color: var(--warn); }
.classic-kit form { display: flex; flex-direction: column; gap: 10px; }
.classic-kit .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.classic-kit label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--muted); }
.classic-kit label.sensor-check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--navy); font-weight: 700; }
.classic-kit input:not([type="checkbox"]), .classic-kit select { height: 44px; border: 2px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--card); font-weight: 600; color: var(--navy); }
.classic-kit input[type="checkbox"] { width: 20px; height: 20px; }
.classic-kit fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.classic-kit legend { font-weight: 800; font-size: 13px; padding: 0 4px; }
.classic-kit .sensor-channels { display: flex; flex-wrap: wrap; gap: 12px; }
.classic-kit .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.classic-kit button { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--navy); color: #FFFFFF; font-weight: 700; font-size: 14px; }
.classic-kit button.ghost { background: var(--glass-2); color: var(--navy); border: 2px solid var(--navy); }
.classic-kit button:disabled { opacity: 0.5; }
.classic-kit details.sensor-gateway summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 800; }
.classic-kit .hint { font-size: 13px; font-weight: 600; color: var(--navy-2); margin: 0; }

/* Store tablet alarm */
.store-alarm { position: fixed; inset: 0; z-index: 100; background: rgba(120, 8, 20, 0.92); display: grid; place-items: center; padding: 16px; overflow: auto; }
.store-alarm[hidden] { display: none; }
body.alarm-open { overflow: hidden; }
.store-alarm-panel { background: var(--card); color: var(--navy); border-radius: 22px; border-top: 8px solid var(--red); padding: 24px; width: min(640px, 100%); display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-lift); }
.store-alarm-beacon { width: 64px; height: 64px; border-radius: 50%; background: var(--red); color: #FFFFFF; font-size: 40px; font-weight: 800; display: grid; place-items: center; animation: alarm-pulse 1.2s ease-in-out infinite; }
@keyframes alarm-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 26, 45, 0.6); } 50% { box-shadow: 0 0 0 16px rgba(226, 26, 45, 0); } }
.store-alarm-eyebrow { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); }
.store-alarm h1 { font-size: 26px; font-weight: 800; line-height: 1.2; }
.store-alarm p { margin: 0; font-weight: 600; }
.store-alarm-summary { font-weight: 800 !important; }
.store-alarm ul { margin: 0; padding-left: 20px; max-height: 220px; overflow: auto; font-size: 14px; font-weight: 600; }
.store-alarm-note { font-size: 13px; color: var(--muted); }
.store-alarm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.store-alarm-actions .btn:first-child { background: var(--red); flex: 1 1 260px; min-height: 56px; font-size: 17px; }
.sales-scope { align-self: flex-start; margin-bottom: 4px; }
.sales-switches { display: flex; flex-wrap: wrap; gap: 8px; }
.period-stores { display: grid; gap: 2px; font-size: 14px; }
.period-stores .ps-row { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(64px, 1fr)); gap: 8px; padding: 6px 8px; border-radius: 8px; }
.period-stores .ps-row:nth-child(even) { background: var(--glass-2); }
.period-stores .ps-row.head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.period-stores .ps-row span { text-align: right; }
.period-stores .ps-row > :first-child { text-align: left; }
.period-stores .ps-row b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.challenge-today { background: var(--soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.challenge-today .side { background: var(--card); }
.today-tools { justify-content: center; }
