/* Dingo Customer Despatch Portal. Tokens follow the Dingo Driver app (orange accent, charcoal dark mode). */
:root {
  --accent: #E8771E; --accent-strong: #D45F12; --on-accent: #fff; --accent-soft: #FDEEDF; --accent-line: #F6C9A2;
  --ink: #1E1F21; --ink-soft: #45474A; --muted: #6B6C6E;
  --bg: #F3F2EF; --surface: #fff; --surface-alt: #F7F6F3; --line: #E5E1DC; --line-strong: #D6D1CB;
  --header: #1E1F21; --on-header: #fff; --header-muted: #A9A7A3;
  --ok: #1E7B43; --ok-bg: #E5F3EA; --warn: #8A5300; --warn-bg: #FFF2D9; --bad: #B3261E; --bad-bg: #FCEAE8;
  --info: #2B5785; --info-bg: #E8F0F9;
  --driver-bubble: #fff; --driver-line: #E5E1DC; --me-bubble: #FDEEDF; --me-line: #F6C9A2;
  --other-bubble: #FFF7EF; --priority-bg: #FFF4E8;
  --shadow-sm: 0 1px 2px rgba(20, 20, 22, .06);
  --shadow: 0 1px 2px rgba(20, 20, 22, .05), 0 6px 24px rgba(20, 20, 22, .07);
  --shadow-lg: 0 24px 64px rgba(20, 20, 22, .22);
  --radius: 14px; --radius-sm: 10px; --bubble-radius: 16px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #F08A35; --accent-strong: #EE8A3A; --on-accent: #1A1208; --accent-soft: #3A2716; --accent-line: #6A4320;
    --ink: #F1F0EE; --ink-soft: #D2CFCA; --muted: #A3A09B;
    --bg: #131416; --surface: #1D1F22; --surface-alt: #24262A; --line: #2F3236; --line-strong: #3B3F44;
    --header: #0D0E10; --on-header: #F1F0EE; --header-muted: #8E8B86;
    --ok: #7FD39B; --ok-bg: #17301F; --warn: #F2C46D; --warn-bg: #392D14; --bad: #FF9B91; --bad-bg: #3A1C19;
    --info: #9CC3F0; --info-bg: #18283A;
    --driver-bubble: #24262A; --driver-line: #33363B; --me-bubble: #3A2716; --me-line: #5A3B1E;
    --other-bubble: #2C2219; --priority-bg: #33241A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #F08A35; --accent-strong: #EE8A3A; --on-accent: #1A1208; --accent-soft: #3A2716; --accent-line: #6A4320;
  --ink: #F1F0EE; --ink-soft: #D2CFCA; --muted: #A3A09B;
  --bg: #131416; --surface: #1D1F22; --surface-alt: #24262A; --line: #2F3236; --line-strong: #3B3F44;
  --header: #0D0E10; --on-header: #F1F0EE; --header-muted: #8E8B86;
  --ok: #7FD39B; --ok-bg: #17301F; --warn: #F2C46D; --warn-bg: #392D14; --bad: #FF9B91; --bad-bg: #3A1C19;
  --info: #9CC3F0; --info-bg: #18283A;
  --driver-bubble: #24262A; --driver-line: #33363B; --me-bubble: #3A2716; --me-line: #5A3B1E;
  --other-bubble: #2C2219; --priority-bg: #33241A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--info); }
.sprite { display: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.fine { font-size: 12px; color: var(--muted); }
kbd { font: 11px/1 var(--font); padding: 2px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-alt); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer;
  transition: background .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease), opacity .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.primary:hover:not(:disabled) { background: var(--accent); }
.btn.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn.secondary:hover:not(:disabled) { background: var(--surface-alt); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-alt); }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0;
  background: transparent; cursor: pointer; position: relative; color: var(--muted); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-alt); color: var(--ink); }
.icon-btn.hdr { color: var(--header-muted); }
.icon-btn.hdr:hover { background: rgba(255,255,255,.08); color: var(--on-header); }
.icon-btn.hdr.on { color: var(--accent); }
.icon-btn .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--header); }

/* ---------- sign in / name ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; }
.auth-brand {
  position: relative; overflow: hidden; color: #F1F0EE; display: flex; align-items: center; justify-content: center; padding: 48px;
  background:
    radial-gradient(1200px 600px at -10% 110%, rgba(232,119,30,.35), transparent 60%),
    radial-gradient(800px 500px at 120% -10%, rgba(232,119,30,.18), transparent 60%),
    linear-gradient(160deg, #1E1F21 0%, #141517 100%);
}
.auth-brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 14px);
}
.auth-brand-inner { position: relative; z-index: 1; max-width: 440px; animation: rise .6s var(--ease) both; }
.auth-emblem { width: 88px; height: auto; display: block; margin-bottom: 22px; filter: drop-shadow(0 8px 24px rgba(0,0,0,.4)); }
.auth-wordmark { display: block; width: 260px; height: auto; filter: invert(1); }
.auth-company { margin-top: 6px; letter-spacing: .42em; text-transform: uppercase; font-size: 13px; font-weight: 600; color: #CFCBC5; }
.auth-rule { width: 56px; height: 4px; border-radius: 4px; background: var(--accent); margin: 28px 0 22px; }
.auth-title { font-size: 30px; font-weight: 700; line-height: 1.2; }
.auth-lede { margin-top: 10px; color: #C9C6C1; font-size: 16px; }
.auth-points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; color: #DCD9D4; }
.auth-points li { display: flex; align-items: center; gap: 12px; }
.auth-points svg { color: #F08A35; width: 22px; height: 22px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 36px;
  box-shadow: var(--shadow); display: grid; gap: 16px; animation: rise .5s .05s var(--ease) both;
}
.auth-card h2 { font-size: 24px; }
.auth-card-emblem { display: none; width: 56px; height: auto; }
.field { display: grid; gap: 6px; }
.field > span:first-child { font-weight: 600; font-size: 14px; }
.field input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; font-size: 16px;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 52px; }
.pw-wrap .icon-btn { position: absolute; right: 4px; top: 4px; }
.form-error { color: var(--bad); background: var(--bad-bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.notice { color: var(--info); background: var(--info-bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.preview { font-size: 14px; color: var(--muted); background: var(--surface-alt); border: 1px dashed var(--line-strong); padding: 10px 12px; border-radius: 10px; }
.preview strong { color: var(--ink); }
.auth-brand.slim .auth-title { font-size: 34px; }

/* ---------- app shell ---------- */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px;
  padding-top: max(10px, env(safe-area-inset-top)); background: var(--header); color: var(--on-header);
  border-bottom: 3px solid var(--accent);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 36px; height: auto; }
.brand-text { display: grid; line-height: 1.2; min-width: 0; }
.brand-co { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--header-muted); font-weight: 600; white-space: nowrap; }
.brand-store { font-family: var(--font-display); font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.07); color: var(--on-header); margin-right: 6px; white-space: nowrap;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: #8E8B86; }
.pill[data-state="connected"] i { background: #4CC97A; box-shadow: 0 0 0 3px rgba(76,201,122,.2); }
.pill[data-state="reconnecting"] i, .pill[data-state="connecting"] i { background: #F2C46D; animation: pulse 1.2s infinite; }
.pill[data-state="offline"] i { background: #FF6B5E; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; margin: 0 4px; border-radius: 999px; background: rgba(255,255,255,.07); font-weight: 600; font-size: 14px; }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #1A1208; font-weight: 700; font-size: 13px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 14px; font-weight: 500; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.inline { margin: 0 16px 8px; border-radius: 10px; padding: 10px 14px; }

.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; padding: 20px; max-width: 1440px; width: 100%; margin: 0 auto; }
.workspace.with-drivers { grid-template-columns: 320px minmax(0, 1fr) 280px; max-width: 1680px; }
.drivers { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.drivers[hidden] { display: none; }
.drivers-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.drivers-head h2 { font-size: 17px; }
.drivers .drivers-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 16px; }
.drivers-body { display: grid; gap: 6px; align-content: start; }
.dv-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 12px 0 2px; display: flex; justify-content: space-between; }
.dv-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; animation: rise .25s var(--ease); }
.dv-row.at_store { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.dv-row.returning { border-style: dashed; }
.dv-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; }
.dv-time.none { color: var(--muted); font-weight: 500; font-size: 13px; }
.dv-who { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.dv-state { grid-column: 2; font-size: 12px; color: var(--muted); }
.dv-state.on { color: var(--ink); font-weight: 600; }
.dv-docs { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.dv-doc { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--accent-strong); text-decoration: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 10px; min-height: 28px; }
.dv-doc:hover { background: var(--surface-alt); }
.dv-doc:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.dv-doc svg { width: 14px; height: 14px; }
.dv-empty { font-size: 13px; color: var(--muted); padding: 6px 2px; }
.btn.small { padding: 6px 12px; font-size: 13px; min-height: 32px; }
.subnav { display: flex; gap: 4px; padding: 0 20px; min-height: 34px; align-items: center; border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.subnav-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; min-height: 30px; }
.subnav-btn:hover { background: var(--surface-alt); color: var(--ink); }
.subnav-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
.subnav-btn[hidden] { display: none; }
.subnav-btn[aria-selected="true"] { color: var(--ink); background: var(--surface-alt); box-shadow: inset 0 -2px 0 var(--accent); }
.page[hidden] { display: none !important; }
section.page { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; max-width: 1180px; width: 100%; margin: 0 auto; display: grid; gap: 16px; align-content: start; }
.page-head h1 { font-size: 22px; margin-bottom: 4px; }
.page-head p { max-width: 760px; }
.search-field { max-width: 420px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.guide-card { padding: 18px; display: grid; gap: 8px; align-content: start; }
.guide-card h2 { font-size: 16px; }
.guide-card ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.guide-card.wide { grid-column: 1 / -1; }
.guide-card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 6px; }
.guide-table { min-width: 0; } .guide-table td { font-size: 13px; }
.eta-win { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.st.preparing { background: #14532D; color: #E8F5EC; }
.st.on_route { background: #1D78D6; color: #fff; box-shadow: 0 0 10px 2px rgba(64, 156, 255, .5); }
.st.delivered { background: var(--surface-alt); color: var(--muted); }
.st.preloaded { background: #7C4A12; color: #FFF4E5; }
.st.attempted { background: #8A5A00; color: #FFF4DE; }
tr.provisional td { color: var(--muted); font-style: italic; }
.st.cancelled { background: var(--surface-alt); color: var(--muted); text-decoration: line-through; }
.eta-win.delivered, .eta-win.cancelled { color: var(--muted); font-weight: 600; }
.eta-win.attempted { color: #E8A317; }
.slot-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.slot { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.slot strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.slot span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
/* time slots (Graeme 4/11/2026): heavy and light apart; a new row where starts are an hour or more apart */
.slot-kind + .slot-kind { margin-top: 26px; padding-top: 20px; border-top: 3px solid var(--line); }
.slot-kind h3 { margin: 4px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.slot-group + .slot-group { margin-top: 16px; padding-top: 14px; border-top: 2px solid var(--line); }
.slot-group h4 { margin: 0 0 8px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.subnav-btn svg { width: 15px; height: 15px; }
.clock { flex-direction: column; align-items: flex-start; gap: 0; }
.clock-time { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; line-height: 1.1; }
.clock-date { font-size: 13px; color: var(--muted); font-weight: 500; }
.dv-sub { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dv-tag { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; line-height: 1.3; }
.dv-tag.here { background: #1FA85A; color: #fff; box-shadow: 0 0 10px 2px rgba(46, 204, 113, .55); animation: glow-green 2.4s ease-in-out infinite; }
.dv-tag.start { background: #14532D; color: #E8F5EC; }
.dv-tag.back { background: #1D78D6; color: #fff; box-shadow: 0 0 10px 2px rgba(64, 156, 255, .55); }
.dv-note { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.dv-row.at_store { border-color: rgba(46, 204, 113, .55); background: rgba(46, 204, 113, .07); }
.dv-row.returning { border-color: rgba(64, 156, 255, .45); border-style: solid; }
@keyframes glow-green { 50% { box-shadow: 0 0 16px 4px rgba(46, 204, 113, .75); } }
.weather-card { gap: 10px; }
.wx-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.wx-day { display: grid; grid-template-columns: 46px 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.wx-day svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wx-day .ic-sun { color: #E8A317; } .wx-day .ic-partly { color: #D9A441; } .wx-day .ic-cloud, .wx-day .ic-fog { color: var(--muted); }
.wx-day .ic-rain, .wx-day .ic-showers, .wx-day .ic-storm { color: #FF4D4D; filter: drop-shadow(0 0 4px rgba(255, 64, 64, .85)); }
/* rain days glow red (Graeme 1/11/2026) */
.wx-day.wet .wx-text { color: #FF6B6B; font-weight: 700; text-shadow: 0 0 8px rgba(255, 64, 64, .6); }
.wx-label { font-weight: 600; }
.wx-text { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-temp { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wx-temp .lo { color: var(--muted); }
.online-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.online-btn svg { width: 18px; height: 18px; }
.online-btn[hidden] { display: none; }
.badge.alert { background: var(--bad); color: #fff; }
.drawer { border: 0; padding: 0; margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(380px, 100vw); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.drawer::backdrop { background: rgba(10, 10, 12, .4); }
.drawer[open] { animation: slide-in .25s var(--ease); }
.drawer-inner { padding: 20px; display: grid; gap: 12px; align-content: start; }
.online-body { display: grid; gap: 6px; }
.ol-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.ol-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.ol-row.moving .dot { background: var(--ok); } .ol-row.stopped .dot { background: var(--warn); }
.ol-row.alert { border-color: var(--bad); background: var(--bad-bg); }
.ol-row.alert .dot { background: var(--bad); }
.ol-who { font-weight: 600; overflow-wrap: anywhere; }
.ol-sub { grid-column: 2 / 4; font-size: 12px; color: var(--muted); }
.ol-row.alert .ol-sub { color: var(--bad); font-weight: 600; }
.ol-start { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.chat { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.chat-head h1 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.chat-head h1::before { content: "#"; color: var(--accent); font-weight: 800; }
.badge { background: var(--accent-strong); color: var(--on-accent); font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; animation: pop .3s var(--ease); }
.chat-body { position: relative; flex: 1; min-height: 0; display: flex; }
.messages { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px 16px; scroll-behavior: auto; }
.messages:focus { outline: none; }
.older { text-align: center; font-size: 12px; color: var(--muted); padding: 10px 0 4px; min-height: 30px; }
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 64px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--accent); margin-bottom: 6px; }
.empty strong { color: var(--ink); font-size: 16px; }

/* ---------- messages ---------- */
.day { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.unread-line { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--accent-strong); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.unread-line::before, .unread-line::after { content: ""; flex: 1; height: 2px; background: var(--accent); border-radius: 2px; opacity: .6; }
.msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; margin-top: 12px; position: relative; animation: rise .28s var(--ease) both; }
.msg.cont { margin-top: 3px; }
.msg.cont .who, .msg.cont .av { visibility: hidden; height: 0; }
.msg.cont .av { height: 0; }
.av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-alt); display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; }
.who { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.who .name { font-weight: 700; font-size: 14px; }
.who .tag { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); background: var(--surface-alt); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.who .tag.ops { color: var(--info); background: var(--info-bg); border-color: transparent; }
.who time, .meta time { font-size: 12px; color: var(--muted); }
.bubble {
  position: relative; display: inline-block; max-width: min(640px, 100%); padding: 10px 14px; border-radius: 4px var(--bubble-radius) var(--bubble-radius) var(--bubble-radius);
  background: var(--driver-bubble); border: 1px solid var(--driver-line); box-shadow: var(--shadow-sm); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}
.msg.cont .bubble { border-radius: var(--bubble-radius); }
.bubble .edited { font-size: 11px; color: var(--muted); margin-left: 4px; }
.bubble.deleted { font-style: italic; color: var(--muted); }
.bubble a { overflow-wrap: anywhere; }
.mention { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-strong); font-weight: 700; border-radius: 4px; padding: 0 3px; }
.msg.priority .bubble { background: var(--priority-bg); border-color: var(--accent); border-left-width: 4px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.tag-priority { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--on-accent); background: var(--accent-strong); padding: 2px 7px; border-radius: 6px; }
.tag-priority svg { width: 12px; height: 12px; stroke-width: 2.6; }
.quote { display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--muted); margin: 0 0 4px; padding-left: 10px; border-left: 3px solid var(--line-strong); cursor: pointer; max-width: min(640px, 100%); overflow: hidden; }
.quote strong { color: var(--ink-soft); white-space: nowrap; }
.quote span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.atts img { max-width: min(320px, 100%); max-height: 260px; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; background: var(--surface-alt); object-fit: cover; }
.file { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); background: var(--surface-alt); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.file svg { width: 16px; height: 16px; }
.actions { position: absolute; top: -14px; right: 8px; display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 2px; opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s, transform .15s var(--ease); }
.actions button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.actions button:hover { background: var(--surface-alt); color: var(--ink); }
.actions svg { width: 16px; height: 16px; }
.msg:hover .actions, .msg.show-actions .actions, .msg:focus-within .actions { opacity: 1; pointer-events: auto; transform: none; }
.msg.flash .bubble { animation: flash 1.6s var(--ease); }

/* Bunnings (right side) */
.msg.cust { grid-template-columns: minmax(0, 1fr); justify-items: end; }
.msg.cust .av { display: none; }
.msg.cust .who { justify-content: flex-end; }
.msg.cust .bubble { background: var(--other-bubble); border-color: var(--me-line); border-radius: var(--bubble-radius) 4px var(--bubble-radius) var(--bubble-radius); }
.msg.cust.mine .bubble { background: var(--me-bubble); }
.msg.cust.cont .bubble { border-radius: var(--bubble-radius); }
.msg.cust .quote { margin-left: auto; }
.msg.cust .actions { right: auto; left: 8px; }
.meta { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 3px; font-size: 12px; color: var(--muted); }
.meta svg { width: 14px; height: 14px; }
.meta .ok { color: var(--ok); display: inline-flex; align-items: center; gap: 3px; }
.meta .sending { display: inline-flex; align-items: center; gap: 3px; }
.meta .fail { color: var(--bad); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.meta .retry { border: 0; background: var(--bad-bg); color: var(--bad); font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 6px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.msg.pending .bubble { opacity: .75; }
.msg.failed .bubble { border-color: var(--bad); border-style: dashed; }
.msg.system { grid-template-columns: 1fr; justify-items: center; }
.msg.system .bubble { background: var(--surface-alt); font-size: 13px; color: var(--muted); border-radius: 10px; }

.jump {
  position: absolute; right: 20px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-weight: 700; font-size: 13px; cursor: pointer; animation: pop .25s var(--ease);
}
.jump.has-new { background: var(--accent-strong); color: var(--on-accent); border-color: transparent; }

/* ---------- composer ---------- */
.composer { position: relative; flex: none; border-top: 1px solid var(--line); padding: 12px 16px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--surface); }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; min-height: 52px; max-height: 200px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface-alt); font-size: 16px; line-height: 1.45; transition: border-color .15s, box-shadow .15s, background .15s;
}
.composer textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.btn.send { min-height: 52px; padding: 0 22px; border-radius: 12px; }
.composer-hint { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); }
.composer-hint .over { color: var(--bad); font-weight: 700; }
.reply-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 8px 8px 8px 12px; border-radius: 10px; background: var(--surface-alt); border-left: 3px solid var(--accent); }
.reply-chip > svg { color: var(--accent); }
.reply-chip-text { flex: 1; min-width: 0; display: grid; font-size: 13px; }
.reply-chip-text span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- side ---------- */
.side { display: grid; gap: 20px; align-content: start; overflow-y: auto; }
.side-card { padding: 18px; display: grid; gap: 12px; }
.side-card h2 { font-size: 15px; }
.howto { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--ink-soft); font-size: 14px; }
.nstat { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.nstat .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-alt); color: var(--muted); }
.nstat.on .ic { background: var(--ok-bg); color: var(--ok); }
.nstat.blocked .ic { background: var(--bad-bg); color: var(--bad); }
.nstat strong { display: block; }

/* ---------- dialogs ---------- */
.dialog { border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(10, 10, 12, .5); backdrop-filter: blur(2px); }
.dialog[open] { animation: rise .25s var(--ease); }
.dialog-inner { padding: 24px; display: grid; gap: 16px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { font-size: 20px; }
.status-rows { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.status-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; font-size: 14px; }
.status-row + .status-row { border-top: 1px solid var(--line); }
.status-row strong.good { color: var(--ok); }
.status-row strong.bad { color: var(--bad); }
.help { font-size: 14px; background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 14px; }
.help ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.toggles { display: grid; gap: 12px; }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; font-weight: 500; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .2s; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.toggle input:checked + .track { background: var(--accent-strong); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.toggle input:disabled + .track { opacity: .4; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; }
.lightbox::backdrop { background: rgba(0,0,0,.85); }
.lightbox img { display: block; max-width: 96vw; max-height: 92vh; border-radius: 10px; }
.lb-close { position: fixed; top: 14px; right: 14px; background: rgba(255,255,255,.12); color: #fff; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #1E1F21; color: #F1F0EE; padding: 12px 18px;
  border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; z-index: 50; animation: rise .25s var(--ease); max-width: calc(100vw - 32px);
}
/* event code pop-up (Graeme 4/11/2026): stays until dismissed */
.ev-pop {
  position: fixed; top: 84px; right: 20px; z-index: 60; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-left: 5px solid #B45309; border-radius: 14px; box-shadow: var(--shadow-lg); padding: 16px 18px;
  animation: rise .25s var(--ease); max-height: calc(100dvh - 100px); display: flex; flex-direction: column;
}
.ev-pop h2 { margin: 0 0 8px; font-size: 16px; }
.ev-pop ul { margin: 0 0 14px; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; overflow-y: auto; min-height: 0; flex: 1 1 auto; align-content: start; }
.ev-pop li.more { list-style: none; margin-left: -18px; color: var(--muted); }
.ev-pop-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 600px) { .ev-pop { top: auto; bottom: 16px; left: 16px; right: 16px; width: auto; max-height: calc(100dvh - 32px); } }
.noscript { padding: 24px; text-align: center; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: var(--shadow-sm); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* three columns need room: below 1320px the drivers panel stays, the help column goes */
@media (max-width: 1320px) {
  .workspace.with-drivers { grid-template-columns: 300px minmax(0, 1fr); }
  .workspace.with-drivers .side { display: none; }
}
/* ---------- tablet / phone ---------- */
@media (max-width: 1080px) {
  .workspace, .workspace.with-drivers { grid-template-columns: 1fr; padding: 14px; }
  .side, .drivers { display: none; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 36px 24px 28px; }
  .auth-brand .auth-points, .auth-brand .auth-lede { display: none; }
  .auth-emblem { width: 56px; margin-bottom: 14px; }
  .auth-wordmark { width: 180px; }
  .auth-rule { margin: 18px 0 14px; }
  .auth-title { font-size: 24px; }
  .auth-panel { align-items: flex-start; padding: 20px 16px 32px; }
  .auth-card { padding: 24px; }
}
@media (max-width: 640px) {
  .topbar { padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); gap: 6px; }
  .brand img { width: 30px; }
  .brand-co { font-size: 9px; letter-spacing: .1em; }
  .brand-store { font-size: 15px; }
  .pill { padding: 0 9px; margin-right: 2px; }
  .pill span { display: none; }
  .user-chip { padding: 2px; margin: 0; }
  .user-chip > span:last-child { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  .workspace { padding: 0; }
  .chat.card { border-radius: 0; border: 0; box-shadow: none; }
  .chat-head { padding: 12px 14px 10px; }
  .messages { padding: 4px 12px 12px; }
  .msg { grid-template-columns: 32px minmax(0, 1fr); gap: 8px; }
  .av { width: 32px; height: 32px; font-size: 13px; }
  .msg.cust { grid-template-columns: minmax(0, 1fr); }
  .bubble { max-width: 100%; }
  .composer { padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .composer-hint > span:first-child { display: none; }
  .btn.send span { display: none; }
  .btn.send { padding: 0 16px; }
  .jump { right: 12px; }
  .banner { padding: 8px 12px; font-size: 13px; }
}
@media (max-width: 380px) {
  .brand-co { display: none; }
}

/* ---------- @driver picker ---------- */
.mention-pop {
  position: absolute; left: 16px; right: 16px; bottom: calc(100% - 4px); max-height: 300px; overflow-y: auto; z-index: 5;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
  animation: rise .15s var(--ease);
}
.mention-pop .mp-head { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px; }
.mention-opt { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.mention-opt .av { width: 30px; height: 30px; font-size: 12px; }
.mention-opt .mo-name { font-weight: 600; font-size: 14px; }
.mention-opt .mo-sub { font-size: 12px; color: var(--muted); }
.mention-opt[aria-selected="true"], .mention-opt:hover { background: var(--accent-soft); }
.mention-pop .mp-empty { padding: 10px; font-size: 13px; color: var(--muted); }
.mention.driver { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
@media (max-width: 640px) { .mention-pop { left: 8px; right: 8px; } }

/* ---------- emoji (5/11/2026) ---------- */
.emo { width: 1.45em; height: 1.45em; vertical-align: -.35em; object-fit: contain; margin: 0 .05em; }
.emoji-pop {
  position: absolute; left: 16px; bottom: calc(100% - 4px); width: min(380px, calc(100% - 32px)); max-height: 340px; overflow-y: auto; z-index: 6;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px 8px 10px;
  animation: rise .15s var(--ease);
}
.emoji-pop .ep-head { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 8px 4px 4px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; }
.ep-btn { height: 40px; border: 0; border-radius: 8px; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.ep-btn:hover, .ep-btn:focus-visible { background: var(--accent-soft); }
.ep-btn.dingo .emo { width: 30px; height: 30px; vertical-align: 0; margin: 0; }
@media (max-width: 640px) { .emoji-pop { left: 8px; width: calc(100% - 16px); } }

/* ---------- photos in the composer ---------- */
.photo-btn { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-alt); flex: none; }
.photo-btn:hover { color: var(--accent-strong); border-color: var(--accent); }
.photo-strip { display: flex; gap: 8px; margin-bottom: 8px; overflow-x: auto; }
.photo-thumb { position: relative; flex: none; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-alt); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-thumb button svg { width: 14px; height: 14px; }
.chat.dragging .chat-body { outline: 3px dashed var(--accent); outline-offset: -8px; }
.atts img.local { opacity: .8; }
@media (max-width: 640px) { .photo-btn { width: 46px; height: 52px; } }

/* ---------- reactions / acknowledgements ---------- */
.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.msg.cust .reacts { justify-content: flex-end; }
.react { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-soft); transition: background .15s, border-color .15s; }
.react:hover:not(:disabled) { border-color: var(--accent); }
.react:disabled { cursor: default; }
.react.mine { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.react-e { font-size: 15px; line-height: 1; }
.meta .ack { color: var(--ok); display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.actions .quick { font-size: 16px; padding: 4px 7px; line-height: 1; }

/* ---------- documents ---------- */
.photo-thumb.doc { width: 150px; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 6px; padding: 8px 28px 8px 10px; }
.photo-thumb.doc > svg { grid-row: 1 / 3; align-self: center; color: var(--accent-strong); }
.photo-thumb.doc .doc-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-thumb.doc .doc-size { font-size: 11px; color: var(--muted); }
.photo-thumb.doc button { background: var(--line-strong); color: var(--ink); }
a.file.doc, span.file.doc { display: inline-flex; align-items: center; gap: 8px; max-width: 320px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); font-size: 13px; }
a.file.doc:hover { border-color: var(--accent); }
.file.doc > svg:first-child { color: var(--accent-strong); width: 20px; height: 20px; }
.file.doc .doc-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.file.doc .doc-size { color: var(--muted); white-space: nowrap; }

/* ---------- machine translation ---------- */
.bubble .translated { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); white-space: normal; }
.bubble .translated .link { border: 0; background: none; padding: 0; color: var(--info); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* "click to turn on alert sounds" (browsers only allow sound after a click in the page) */
.sound-hint { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px);
  padding: 10px 18px; border: 0; border-radius: 999px; background: var(--accent-strong); color: var(--on-accent);
  font: 600 14px/1.3 var(--font); cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.sound-hint:hover { background: var(--accent); }

/* ---------- event codes (29/10/2026) ---------- */
.codes-dialog { width: min(820px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
.codes-stage h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.codes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.code { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.code h4 { font-size: 15px; margin: 0 0 8px; }
.code ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-soft); }
/* today's runs (side card; the truck button opens the same list where the side panel is hidden) */
.runs { width: 100%; border-collapse: collapse; font-size: 13px; }
.runs th { text-align: left; font-weight: 600; font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.runs td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.runs td.t { font-variant-numeric: tabular-nums; white-space: nowrap; }
.runs td.pre { white-space: normal; overflow-wrap: normal; color: var(--muted); font-size: 12px; }
.runs a { color: var(--accent-strong); text-underline-offset: 2px; }
@media (min-width: 1081px) { .runs-btn { display: none; } }

/* ---------- event codes: Live events tab (31/10/2026) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px;
  padding: 8px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs [role="tab"]:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.codes-dialog .dialog-inner, .codes-panel { grid-template-columns: minmax(0, 1fr); }
.codes-panel { display: grid; gap: 14px; }
.codes-panel[hidden] { display: none; }
.periods { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: transparent; color: var(--ink-soft); border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; min-height: 32px; }
.chip[aria-pressed="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.events-feed .dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--ok); }
.events-feed .dot.stale { background: var(--warn); }
.events-feed .dot.none { background: var(--bad); }
.ev-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.ev-stat { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.ev-stat strong { font-size: 20px; overflow-wrap: anywhere; }
.ev-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ev-sub { font-size: 12px; color: var(--muted); }
.ev-stage { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin: 4px 0 0; }
.ev-codes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ev-code { width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px;
  border-radius: 10px; padding: 6px 8px; cursor: pointer; display: grid; gap: 4px; }
.ev-code:hover { background: var(--surface-alt); }
.ev-code.on { background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--accent); }
.ev-top { display: flex; justify-content: space-between; gap: 10px; }
.ev-track { display: block; height: 6px; border-radius: 999px; background: var(--surface-alt); }
.ev-bar { display: block; height: 6px; border-radius: 999px; background: var(--accent-strong); }
.ev-bar.delivery { background: var(--ink-soft); }
.ev-table { overflow-x: auto; }
.ev-table .runs { min-width: 640px; }
/* Load history (5/11/2026): Loader column, times on the far right, totals, rankings panel */
.dv-timer { display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 2px; font-variant-numeric: tabular-nums; }
.dv-timer .on { font-weight: 700; color: var(--ink); }
.hist-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.exports { display: flex; flex-wrap: wrap; gap: 8px; }
.exports .btn { text-decoration: none; }
.hist-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.hist-main { display: grid; gap: 10px; min-width: 0; }
.ev-table .runs.hist { min-width: 980px; }
#page-history { max-width: 1680px; }          /* ten columns + the rankings panel need the width on big screens */
.runs .num { text-align: right; }
.runs td.strong { font-weight: 600; }
.runs tfoot th, .runs tfoot td { padding: 9px 6px; font-weight: 600; border-bottom: 0; }
.runs tfoot tr.tot th, .runs tfoot tr.tot td { border-top: 2px solid var(--line-strong); }
.runs tfoot tr.avg th, .runs tfoot tr.avg td { color: var(--muted); font-weight: 500; }
.runs tfoot th { text-align: left; text-transform: none; font-size: inherit; letter-spacing: 0; color: inherit; }
.runs td.loader { min-width: 150px; }
.loader-name { all: unset; cursor: pointer; border-bottom: 1px dashed var(--line-strong); padding: 2px 0; }
.loader-name:hover { border-bottom-color: currentColor; }
.loader-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.loader-add { min-height: 28px; padding: 2px 10px; margin: -4px 0 -4px -10px; }
.loader-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.loader-edit input { width: 150px; min-height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: inherit; font: inherit; }
.loader-edit input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.hist-side { display: grid; gap: 16px; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rank li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--line); }
.rank li:last-child { border-bottom: 0; }
.rank .pos { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.rank .nm { display: grid; min-width: 0; }
.rank .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank strong { font-variant-numeric: tabular-nums; }
@media (max-width: 1200px) { .hist-grid { grid-template-columns: minmax(0, 1fr); } .hist-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
