/* The site's one hand-written stylesheet (brief F). Colours, radii, spacing and fonts come from tokens.css only.
   Phone first (390 px), then ≥ 768 px (header menu) and ≥ 1024 px (two columns). No shadows: border + surface. */

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-text);
  font-size: var(--size-md);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
body::before {                                   /* the faint teal / violet light at the top */
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 560px;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(640px 360px at 12% -12%, var(--glow-teal), transparent 70%),
    radial-gradient(720px 420px at 92% -18%, var(--glow-violet), transparent 70%);
}
body.bare { padding-bottom: 0; }
img, svg { display: block; max-width: 100%; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-hover); }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--space-4); top: -48px; z-index: 50; padding: var(--space-2) var(--space-4);
  background: var(--teal); color: var(--on-teal); border-radius: var(--radius-pill); }
.skip:focus { top: var(--space-2); }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto;
  padding: 0 var(--gutter); }
.muted { color: var(--text-2); }
.mono { font-variant-numeric: tabular-nums; }

/* icons (Lucide, through the sprite) */
.i { width: var(--icon); height: var(--icon); flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }
.i-xl { width: 28px; height: 28px; }

/* ---------------------------------------------------------------- buttons, chips, pills */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5);
  border-radius: var(--radius-pill); border: var(--line) solid transparent;
  font-size: var(--size-md); font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: var(--on-teal); }
.btn-primary:hover { background: var(--teal-hover); color: var(--on-teal); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--teal-line); color: var(--teal); }
.btn-ghost { background: transparent; color: var(--teal); border-color: var(--teal-line); }
.btn-ghost:hover { background: var(--teal-soft); color: var(--teal); }
.btn-sm { min-height: 36px; padding: 0 var(--space-4); font-size: var(--size-sm); }
.btn-wide { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: progress; }
.btn-round { width: 40px; min-height: 40px; padding: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 var(--space-3);
  border-radius: var(--radius-pill); border: var(--line) solid var(--border);
  background: var(--surface-2); color: var(--text-2);
  font-size: var(--size-xs); font-weight: 600; line-height: 1; white-space: nowrap;
}
.chip .i { width: 14px; height: 14px; }
.chip-ok { color: var(--ok); background: var(--ok-soft); border-color: var(--teal-line); }
.chip-idle { color: var(--idle); background: var(--idle-soft); border-color: var(--idle-line); }
.chip-critical { color: var(--critical); background: var(--critical-soft); border-color: var(--critical-line); }
.chip-important { color: var(--important); background: var(--important-soft); border-color: var(--important-line); }
button.chip { cursor: pointer; min-height: 36px; padding: 0 var(--space-4); font-size: var(--size-sm); }
button.chip:hover { color: var(--text); border-color: var(--border-strong); }
button.chip.is-on { color: var(--teal); background: var(--teal-soft); border-color: var(--teal-line); }

.eyebrow { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--teal);
  font-size: var(--size-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

/* ---------------------------------------------------------------- header */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg-veil); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--line) solid var(--border);
}
.topbar-in { display: flex; align-items: center; gap: var(--space-4); height: var(--topbar-h); }
.brand { display: flex; align-items: center; flex: none; }
.brand-logo { height: 44px; width: auto; }
.menu { display: none; align-items: stretch; gap: var(--space-1); height: 100%; margin: 0 auto; }
.menu-item {
  position: relative; display: flex; align-items: center; padding: 0 var(--space-4);
  color: var(--text-2); font-size: var(--size-md); font-weight: 500;
}
.menu-item:hover { color: var(--text); }
.menu-item.is-active { color: var(--teal); }
.menu-item.is-active::after {
  content: ""; position: absolute; left: var(--space-4); right: var(--space-4); bottom: 12px;
  height: 2px; border-radius: 2px; background: var(--teal);
}
.topbar-end { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }
.menu + .topbar-end { margin-left: 0; }

.conn { display: inline-flex; align-items: center; gap: 6px; font-size: var(--size-xs); color: var(--text-2); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.conn-text { display: none; }
.conn[data-state="wait"] .conn-wait, .conn[data-state="on"] .conn-on, .conn[data-state="off"] .conn-off { display: inline; }
.conn[data-state="on"] .conn-dot { background: var(--ok); }
.conn[data-state="off"] { color: var(--critical); }
.conn[data-state="off"] .conn-dot { background: var(--critical); animation: pulse 1.4s ease-in-out infinite; }

.user-pill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 3px var(--space-3) 3px 3px; border-radius: var(--radius-pill);
  border: var(--line) solid var(--border); background: var(--surface);
}
.avatar {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal); font-weight: 700; font-size: var(--size-sm);
  border: var(--line) solid var(--teal-line);
}
.user-meta { display: none; flex-direction: column; line-height: 1.15; }
.user-name { font-size: var(--size-sm); font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.user-role { font-size: 11px; color: var(--text-2); }
.logout { display: none; margin: 0; }
.logout-icon { display: inline-flex; margin: 0; }

/* ---------------------------------------------------------------- phone tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-veil); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: var(--line) solid var(--border);
}
.tab-form { display: contents; }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--text-2); font-size: 11px; font-weight: 500;
}
.tab .i { width: 22px; height: 22px; }
.tab.is-current { color: var(--teal); }
.tab.is-current .i { stroke-width: 2.4; }
.tab-label { white-space: nowrap; }

@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .menu { display: flex; }
  .user-meta { display: flex; }
  .logout { display: block; }
  .logout-icon { display: none; }
  .brand-logo { height: 54px; }
  :root { --gutter: 24px; --topbar-h: 76px; }
}

/* ---------------------------------------------------------------- banner (teal gradient) */
.banner-slot:empty { display: none; }
.banner {
  display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
  margin-top: var(--space-4); padding: var(--space-4);
  border-radius: var(--radius-card); border: var(--line) solid var(--teal-line);
  background: var(--banner-bg);
}
.banner-icon {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: var(--teal); color: var(--on-teal);
}
.banner-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 200px; min-width: 0; }
.banner-title { color: var(--teal); font-size: var(--size-lg); font-weight: 700; }
.banner-line { color: var(--text); font-size: var(--size-sm); opacity: .88; }
.banner .btn { flex: none; }
.banner-limit { border-color: var(--important-line); }
.banner-limit .banner-icon { background: var(--important); }
.banner-limit .banner-title { color: var(--important); }
@media (max-width: 559px) {
  .banner { gap: var(--space-3); padding: var(--space-3) var(--space-4); }
  .banner-icon { width: 40px; height: 40px; }
  .banner-title { font-size: var(--size-md); }
  .banner .btn { width: 100%; min-height: 40px; }
}

/* ---------------------------------------------------------------- hero */
.hero { display: grid; gap: var(--space-5); padding-top: var(--space-6); padding-bottom: var(--space-5); }
.hero-copy { display: flex; flex-direction: column; gap: var(--space-3); justify-content: center; min-width: 0; }
.hero-title {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(46px, 13vw, 104px); line-height: .9; letter-spacing: .01em;
  display: flex; flex-direction: column;
}
.grad {
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--teal);
}
.hero-lead { color: var(--text-2); font-size: var(--size-md); max-width: 36ch; }
.hero-map { height: 190px; }
.hero-compact .hero-title { font-size: clamp(48px, 12vw, 88px); }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: stretch; padding-top: var(--space-12); }
  .hero-map { height: 300px; }
  .hero-lead { font-size: var(--size-lg); }
}

/* the logo gradient as a thin accent line */
.accent-line { height: 2px; width: 64px; border-radius: 2px; background: var(--grad); }

/* ---------------------------------------------------------------- KPI strip */
.kpis {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border: var(--line) solid var(--border); border-radius: var(--radius-card); background: var(--surface);
  overflow: hidden;
}
.kpi { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); min-width: 0; }
.kpi:nth-child(odd) { border-right: var(--line) solid var(--border); }
.kpi:nth-child(-n+2) { border-bottom: var(--line) solid var(--border); }
.kpi-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  color: var(--teal); background: var(--teal-soft); }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-value { font-family: var(--font-display); font-weight: 400; font-size: 40px; line-height: 1; color: var(--teal); }
.kpi-label { color: var(--text-2); font-size: var(--size-sm); line-height: 1.25; overflow-wrap: anywhere; }
.kpi-sub { color: var(--text-2); font-size: var(--size-xs); }
.kpi.is-critical .kpi-icon { color: var(--critical); background: var(--critical-soft); }
.kpi.is-critical .kpi-value { color: var(--critical); }
@media (min-width: 900px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: var(--space-2) 0; }
  .kpi { padding: var(--space-3) var(--space-6); }
  .kpi:nth-child(-n+2) { border-bottom: 0; }
  .kpi:nth-child(odd) { border-right: 0; }
  .kpi + .kpi { border-left: var(--line) solid var(--border); }
  .kpi-value { font-size: 48px; }
}

/* ---------------------------------------------------------------- search + filter chips */
.toolbar { display: flex; flex-direction: column; gap: var(--space-3); margin: var(--space-6) 0 var(--space-4); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.section-title { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1;
  letter-spacing: .02em; text-transform: uppercase; }
.search {
  position: relative; display: flex; align-items: center;
}
.search .i { position: absolute; left: var(--space-4); color: var(--text-2); pointer-events: none; }
.search input {
  width: 100%; min-height: 48px; padding: 0 var(--space-4) 0 calc(var(--space-4) * 2 + var(--icon));
  border-radius: var(--radius-input); border: var(--line) solid var(--border); background: var(--surface-2);
  font-size: var(--size-md); outline: none;
}
.search input::placeholder { color: var(--text-2); }
.search input:focus { border-color: var(--teal-line); }
.search input::-webkit-search-cancel-button { filter: grayscale(1) brightness(2); }
.chips { display: flex; gap: var(--space-2); flex-wrap: wrap; min-width: 0; }
.filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter); }
.filters::-webkit-scrollbar { display: none; }
@media (min-width: 900px) {
  .toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .search { flex: 0 1 380px; order: 2; }
  .filters { margin: 0; padding: 0; overflow: visible; }
}

/* ---------------------------------------------------------------- unit cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: var(--space-4);
  padding-bottom: var(--space-10); }
.ucard {
  position: relative; display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-5) var(--space-4) var(--space-4); min-width: 0;
  border-radius: var(--radius-card); border: var(--line) solid var(--border); background: var(--surface);
  color: var(--text); overflow: hidden;
  transition: border-color .15s, background-color .15s, transform .15s;
}
.ucard:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3);
  transform: translateY(-2px); }
.ucard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--idle); }
.ucard.stripe-critical::before { background: var(--critical); }
.ucard.stripe-important::before { background: var(--important); }
.ucard.stripe-ok::before { background: var(--ok); }
.ucard.is-bumped { border-color: var(--teal-line); }
.ucard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.ucard-id { display: flex; flex-direction: column; min-width: 0; }
.ucard-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; color: var(--text-2); text-transform: uppercase; }
.ucard-num { font-family: var(--font-display); font-weight: 400; font-size: 48px; line-height: .95; letter-spacing: .02em; }
.ucard-driver { color: var(--text-2); font-size: var(--size-sm); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.fresh-dot {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.fresh-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.fresh-dot.is-fresh { color: var(--ok); }
.fresh-dot.is-fresh::before { background: var(--ok); }
.fresh-dot.is-busy { color: var(--important); }
.fresh-dot.is-busy::before { background: var(--important); animation: pulse 1.2s ease-in-out infinite; }
.ucard-route { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--size-sm);
  font-weight: 600; }
.ucard-route .place { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.ucard-route .place span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ucard-route .i { color: var(--teal); width: 16px; height: 16px; }
.ucard-route .arrow { color: var(--text-2); }
.ucard-route .more { color: var(--text-2); font-weight: 500; font-size: var(--size-xs); }
.ucard-eta {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2) var(--space-3);
  padding-top: var(--space-3); border-top: var(--line) solid var(--border); margin-top: auto;
}
.ucard-eta-label { display: block; font-size: 11px; color: var(--text-2); letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucard-eta-value { display: flex; align-items: baseline; gap: 6px; }
.ucard-eta-time { font-family: var(--font-display); font-weight: 400; font-size: 40px; line-height: 1; color: var(--teal); }
.ucard-eta > div { min-width: 0; }
.ucard-eta-zone { font-size: var(--size-xs); color: var(--text-2); font-weight: 600; white-space: nowrap; }
.ucard-eta.is-late .ucard-eta-time { color: var(--critical); }
.ucard-eta-plan { font-size: var(--size-sm); font-weight: 600; }
.ucard-summary { color: var(--text-2); font-size: var(--size-sm); display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.ucard-foot { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--size-xs); }
.ucard-foot .i { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- empty states, skeletons */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3);
  padding: var(--space-10) var(--space-4); text-align: center; color: var(--text-2);
  border: var(--line) dashed var(--border-strong); border-radius: var(--radius-card);
}
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal); }
.empty-sm { padding: var(--space-6) var(--space-4); border-style: solid; border-color: var(--border); }
.grid > .empty { grid-column: 1 / -1; }
.skel {
  display: block; border-radius: var(--radius-sm); min-height: 12px;
  background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 50%, var(--skeleton-a) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.skel-line { height: 12px; margin: var(--space-2) 0; }
.skel-line.w-60 { width: 60%; }
.skel-line.w-80 { width: 80%; }
.skel-fill { position: absolute; inset: 0; border-radius: 0; z-index: 0; }
.is-reloading { opacity: .72; transition: opacity .2s; }

/* ---------------------------------------------------------------- badges (how fresh a block is) */
.badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 var(--space-3);
  border-radius: var(--radius-pill); border: var(--line) solid var(--border);
  font-size: var(--size-xs); font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge-fresh { color: var(--ok); background: var(--ok-soft); border-color: var(--teal-line); }
.badge-busy { color: var(--important); background: var(--important-soft); border-color: var(--important-line);
  white-space: normal; }
.badge-busy::before { animation: pulse 1.2s ease-in-out infinite; }
.badge-saved { color: var(--idle); background: var(--idle-soft); border-color: var(--idle-line); }
.badge-reason { margin-top: var(--space-2); color: var(--text-2); font-size: var(--size-xs); }

/* ---------------------------------------------------------------- notices (login messages) */
.notice {
  display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-input); border: var(--line) solid var(--border); background: var(--surface-2);
  font-size: var(--size-sm);
}
.notice-error { color: var(--critical); border-color: var(--critical-line); background: var(--critical-soft); }
.notice .i { margin-top: 1px; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: flex; flex-direction: column; }
.login-main { flex: 1; display: grid; gap: var(--space-6); align-content: center;
  grid-template-areas: "copy" "card" "features"; padding-top: var(--space-8); padding-bottom: var(--space-8); }
.login-copy { grid-area: copy; }
.login-card { grid-area: card; }
.login-main > .features { grid-area: features; }
.login-logo { width: 180px; height: auto; }
.login-copy { display: flex; flex-direction: column; gap: var(--space-4); }
.login-card {
  display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6);
  border-radius: var(--radius-card); border: var(--line) solid var(--border); background: var(--surface);
  position: relative; overflow: hidden;
}
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--grad); }
.login-card h2 { font-size: 20px; line-height: 1.25; }
.login-card-head { display: flex; align-items: center; gap: var(--space-4); }
.login-card .lead { color: var(--text-2); font-size: var(--size-sm); }
.login-steps { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; counter-reset: step; }
.login-steps li { display: flex; gap: var(--space-3); align-items: center; font-size: var(--size-sm); }
.login-steps li > span { min-width: 0; }
.login-steps li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: var(--line) solid var(--teal-line); color: var(--teal); font-weight: 700; font-size: var(--size-xs);
}
.login-card-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: var(--teal); color: var(--on-teal); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: var(--line) solid var(--border);
  padding-top: var(--space-4); gap: var(--space-2); }
.feature { display: flex; flex-direction: column; gap: var(--space-2); padding-right: var(--space-2); min-width: 0; }
.feature + .feature { border-left: var(--line) solid var(--border); padding-left: var(--space-3); }
.feature .i { color: var(--teal); }
.feature strong { font-size: var(--size-sm); }
.feature span { color: var(--text-2); font-size: var(--size-xs); }
.login-foot { color: var(--text-2); font-size: var(--size-xs); padding-bottom: var(--space-6); }
@media (min-width: 960px) {
  .login-main { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); grid-template-areas: "copy card" "features card";
    align-items: center; column-gap: var(--space-16); row-gap: var(--space-6); }
  .login-main > .features { align-self: start; }
  .login-logo { width: 220px; }
}

/* ---------------------------------------------------------------- blocks (unit page) */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) 0; }
.back { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--text-2); font-size: var(--size-sm);
  font-weight: 600; }
.back:hover { color: var(--teal); }
.two-col { display: flex; flex-direction: column; gap: var(--space-4); padding-bottom: var(--space-10); }
.col { display: contents; }
.block {
  position: relative; display: flex; flex-direction: column; gap: var(--space-4); min-width: 0;
  padding: var(--space-4); border-radius: var(--radius-card); border: var(--line) solid var(--border);
  background: var(--surface);
}
.block-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  flex-wrap: wrap; }
.block-title { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--size-md);
  font-weight: 700; letter-spacing: .01em; }
.block-title .i { color: var(--teal); }
.block[data-block="head"] { order: 1; }
.block[data-block="load"] { order: 2; }
.block[data-block="next"] { order: 3; }
.block[data-block="map"] { order: 4; }
.block[data-block="muhim"] { order: 5; }
.block[data-block="chat"] { order: 6; }
.block[data-block="extra"] { order: 7; }
.block[data-block="history"] { order: 8; }
@media (min-width: 1024px) {
  .two-col { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: start;
    gap: var(--space-6); }
  .col { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
  .col-side { position: sticky; top: calc(var(--topbar-h) + var(--space-4)); }
  .block { padding: var(--space-5); }
}

/* the unit's head */
.unit-head { overflow: hidden; }
.unit-head::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--grad); }
.unit-id { display: flex; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; }
.unit-num { font-family: var(--font-display); font-weight: 400; font-size: 72px; line-height: .85; letter-spacing: .02em; }
.unit-who { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; min-width: 0; }
.unit-driver { font-size: var(--size-lg); font-weight: 600; }
.unit-phone { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--size-sm); }
.unit-summary { font-size: var(--size-md); color: var(--text); }
.unit-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  flex-wrap: wrap; }

/* facts row (load id, trailer, BOL) */
.facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); color: var(--text-2);
  font-size: var(--size-sm); }
.facts > span { display: inline-flex; align-items: center; gap: 6px; }
.facts .i { width: 16px; height: 16px; color: var(--teal); }
.facts strong { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- stops stepper */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.step { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--space-3);
  padding-bottom: var(--space-5); }
.step:last-child { padding-bottom: 0; }
.step::before {                                  /* the line to the next stop */
  content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; border-radius: 2px;
  background: var(--border-strong);
}
.step:last-child::before { display: none; }
.step.is-done::before { background: var(--teal-line); }
.step-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: var(--line) solid var(--border-strong); background: var(--surface-2); color: var(--text-2);
}
.step-mark .i { width: 18px; height: 18px; }
.step.is-done .step-mark { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.step.is-current .step-mark { border: 2px solid var(--teal); color: var(--teal); background: var(--teal-soft); }
.step-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 2px; }
.step-kind { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--text-2); text-transform: uppercase; }
.step-title { font-size: var(--size-md); font-weight: 700; }
.step-lines { color: var(--text-2); font-size: var(--size-sm); }
.step-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  margin-top: var(--space-2); font-size: var(--size-sm); }
.step-meta .i { width: 16px; height: 16px; }
.step-when { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.step-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-2); }
.step.is-done .step-state { color: var(--teal); }
.step-eta {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3);
  margin-top: var(--space-2); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-input); background: var(--surface-2); border: var(--line) solid var(--border);
}
.step-eta-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--text-2); }
.step-eta-time { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1; color: var(--teal); }
.step-eta-zone { font-size: var(--size-xs); color: var(--text-2); font-weight: 600; }
.step-eta.is-late .step-eta-time { color: var(--critical); }
.step-eta-note { color: var(--text-2); font-size: var(--size-xs); width: 100%; }

/* ---------------------------------------------------------------- rows (Muhim, Qo'shimcha, history) */
.rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--space-3); align-items: start;
  padding: var(--space-3) 0; border-top: var(--line) solid var(--border); }
.row:first-child { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }
.row-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--teal);
  background: var(--teal-soft); }
.row-icon .i { width: 16px; height: 16px; }
.row-icon.is-critical { color: var(--critical); background: var(--critical-soft); }
.row-icon.is-important { color: var(--important); background: var(--important-soft); }
.row-icon.is-idle { color: var(--idle); background: var(--idle-soft); }
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: var(--size-sm); }
.row-main strong { font-weight: 600; font-size: var(--size-md); overflow-wrap: anywhere; }
.row-sub { color: var(--text-2); font-size: var(--size-xs); overflow-wrap: anywhere; }
.row-link { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: var(--line) solid var(--border); color: var(--text-2); }
.row-link:hover { color: var(--teal); border-color: var(--teal-line); }
.row-link .i { width: 16px; height: 16px; }
.more-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--size-sm); font-weight: 600; }

/* ---------------------------------------------------------------- maps */
.map {
  position: relative; overflow: hidden; border-radius: var(--radius-card);
  border: var(--line) solid var(--border); background: var(--surface-2); z-index: 0;
}
.map-unit { height: 260px; }
@media (min-width: 1024px) { .map-unit { height: 300px; } }
.map .leaflet-container, .map.leaflet-container { background: var(--surface-2); font-family: var(--font-text); }
.leaflet-tile-pane { filter: var(--map-tiles); }
.map .leaflet-control-attribution {
  background: var(--map-veil); color: var(--text-2); font-size: 10px; border-top-left-radius: var(--radius-sm);
}
.map .leaflet-control-attribution a { color: var(--teal); }
.map .leaflet-bar { border: var(--line) solid var(--border-strong); border-radius: var(--radius-input); overflow: hidden; }
.map .leaflet-bar a { background: var(--surface); color: var(--text); border-bottom-color: var(--border); }
.map .leaflet-bar a:hover { background: var(--surface-3); color: var(--teal); }
.map .leaflet-popup-content-wrapper, .map .leaflet-popup-tip { background: var(--surface); color: var(--text);
  border: var(--line) solid var(--border-strong); }
.map .leaflet-popup-content { margin: var(--space-3) var(--space-4); font-size: var(--size-sm); line-height: 1.4; }
.map .leaflet-container a.leaflet-popup-close-button { color: var(--text-2); }
.map-empty {
  position: absolute; left: var(--space-3); right: var(--space-3); bottom: var(--space-3); z-index: 500;
  display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-input); background: var(--map-veil); border: var(--line) solid var(--border);
  color: var(--text-2); font-size: var(--size-xs);
}
.map-legend { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pin {
  display: grid; place-items: center; min-width: 34px; height: 26px; padding: 0 var(--space-2);
  border-radius: var(--radius-pill); background: var(--surface); color: var(--text);
  border: 2px solid var(--idle); font-weight: 700; font-size: 12px; white-space: nowrap;
  transform: translate(-50%, -50%);
}
.pin-ok { border-color: var(--ok); color: var(--ok); }
.pin-critical { border-color: var(--critical); color: var(--critical); }
.pin-important { border-color: var(--important); color: var(--important); }
.pin-truck { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.pin-stop { min-width: 26px; width: 26px; padding: 0; border-color: var(--text-2); color: var(--text-2); font-size: 11px; }
.pin-stop.is-done { border-color: var(--teal); background: var(--teal); color: var(--on-teal); }
.pin-stop.is-del { border-color: var(--grad-to); }

/* ---------------------------------------------------------------- chat feed */
.block-chat { gap: var(--space-3); }
.feed {
  display: flex; flex-direction: column; gap: var(--space-2);
  max-height: 68vh; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 calc(-1 * var(--space-2)); padding: var(--space-1) var(--space-2);
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
@media (min-width: 1024px) { .feed { max-height: 560px; } }
.older { align-self: center; margin-bottom: var(--space-2); }
.day-sep { display: flex; justify-content: center; margin: var(--space-2) 0; }
.day-sep span { padding: 2px var(--space-3); border-radius: var(--radius-pill); background: var(--surface-2);
  border: var(--line) solid var(--border); color: var(--text-2); font-size: 11px; font-weight: 600; }
.bubble {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  max-width: 86%; padding: var(--space-2) var(--space-3) 6px;
  border-radius: var(--radius-card); border: var(--line) solid var(--border); background: var(--surface-2);
  font-size: var(--size-sm); overflow-wrap: anywhere;
}
.bubble.is-left { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.is-right { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--teal-soft);
  border-color: var(--teal-line); }
.bubble.is-new { border-color: var(--teal); }
.bubble-head { display: flex; align-items: baseline; gap: var(--space-2); font-size: var(--size-xs); }
.bubble-name { font-weight: 700; color: var(--teal); max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.bubble.is-left .bubble-name { color: var(--text); }
.bubble-role { color: var(--text-2); }
.bubble-text { white-space: pre-wrap; }
.bubble-voice { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-weight: 600;
  font-size: var(--size-xs); }
.bubble-voice .i { width: 16px; height: 16px; }
.bubble-transcript { font-style: italic; white-space: pre-wrap; }
.bubble-desc { color: var(--text-2); font-size: var(--size-xs); }
.thumb { width: 100%; max-width: 260px; max-height: 260px; object-fit: cover; border-radius: var(--radius-input);
  border: var(--line) solid var(--border); background: var(--surface); }
.media-ph { display: flex; align-items: center; gap: var(--space-2); color: var(--text-2); font-size: var(--size-xs); }
.bubble-time { align-self: flex-end; color: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.feed-empty { margin: auto; }

/* status pills in lists */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px var(--space-2); border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; border: var(--line) solid var(--border); color: var(--text-2); white-space: nowrap; }
.pill .i { width: 12px; height: 12px; }
.pill-ok { color: var(--ok); border-color: var(--teal-line); background: var(--ok-soft); }
.pill-idle { color: var(--idle); border-color: var(--idle-line); background: var(--idle-soft); }

.zone-note { color: var(--text-2); font-size: var(--size-xs); text-align: center; padding: var(--space-6) 0 var(--space-8); }

/* ---------------------------------------------------------------- motion */
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Leaflet markers and the route line (map.js) */
.pin-wrap { background: none; border: 0; }
.leaflet-overlay-pane .route-line { stroke: var(--teal); stroke-opacity: .75; fill: none; }


/* ================================================================ inner pages: alerts, loads, map, admin (ticket 05) */
.inner-page { padding-top: var(--space-6); padding-bottom: var(--space-10); }
.page-title { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); min-width: 0; }
.page-h1 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em;
  font-size: clamp(44px, 11vw, 68px); line-height: .92; }
.page-lead { color: var(--text-2); font-size: var(--size-md); }

/* filter bar, fields */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4);
  padding: var(--space-4); margin-bottom: var(--space-4); border: var(--line) solid var(--border);
  border-radius: var(--radius-card); background: var(--surface); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 100%; }
.field-label { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.input { width: 100%; min-height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-input);
  border: var(--line) solid var(--border); background: var(--surface-2); color: var(--text); font-size: var(--size-md);
  outline: none; }
.input:focus { border-color: var(--teal-line); }
.input::placeholder { color: var(--text-2); }
.input-sm { min-height: 36px; font-size: var(--size-sm); }
.filter-bar .btn { flex: 1 1 100%; }
.quick-times { margin-bottom: var(--space-2); }
a.chip-link { min-height: 36px; padding: 0 var(--space-4); font-size: var(--size-sm); }
a.chip-link:hover { color: var(--text); border-color: var(--border-strong); }
a.chip-link.is-on { color: var(--teal); background: var(--teal-soft); border-color: var(--teal-line); }
.chip-count { margin-left: 2px; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--surface-3);
  color: var(--text-2); font-size: 11px; }
.is-on .chip-count { color: var(--teal); }
.btn-danger:hover { color: var(--critical); border-color: var(--critical-line); }
@media (min-width: 640px) {
  .field { flex: 0 1 200px; }
  .field-chips { flex: 1 1 auto; }
  .field-chips .chips { min-height: 44px; align-items: center; }
  .filter-bar .btn { flex: 0 0 auto; }
}

/* alerts */
.alert-group { margin-top: var(--space-6); }
.group-title { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-display); font-weight: 400;
  font-size: 34px; letter-spacing: .04em; line-height: 1; }
.group-critical .group-title { color: var(--critical); }
.group-important .group-title { color: var(--important); }
.count { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 var(--space-2);
  border-radius: var(--radius-pill); border: var(--line) solid var(--border-strong); color: var(--text);
  font-family: var(--font-text); font-size: var(--size-sm); font-weight: 700; letter-spacing: 0; }
.alert-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--space-4);
  margin-top: var(--space-3); }
.alert-unit { position: relative; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; overflow: hidden;
  padding: var(--space-5) var(--space-4) var(--space-4); border: var(--line) solid var(--border);
  border-radius: var(--radius-card); background: var(--surface); }
.alert-unit::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--idle); }
.group-critical .alert-unit::before { background: var(--critical); }
.group-important .alert-unit::before { background: var(--important); }
.alert-unit-head { display: flex; align-items: center; justify-content: space-between; color: var(--text);
  font-family: var(--font-display); font-size: 30px; letter-spacing: .04em; line-height: 1; }
.alert-unit-head strong { font-weight: 400; }
.alert-unit-head .i { color: var(--text-2); }
.alert-unit-head:hover { color: var(--teal); }
.alert-row.is-new { background: var(--teal-soft); border-radius: var(--radius-input); }
.quote { font-style: italic; }
.alert-list > .empty { margin-top: var(--space-6); }

/* loads */
.loads-filters { align-items: center; justify-content: space-between; }
.filters-wrap { flex: 1 1 100%; }
.loads-unit { flex: 1 1 200px; max-width: 260px; }
.loads-unit .field { flex: 1 1 100%; }
.loads-filters > .btn { margin-left: auto; }
.c-id a { color: var(--text); }
.c-id a:hover { color: var(--teal); }
.table-wrap { border: var(--line) solid var(--border); border-radius: var(--radius-card); background: var(--surface);
  overflow: hidden; }
.ltable { width: 100%; border-collapse: collapse; font-size: var(--size-sm); }
.ltable th { padding: var(--space-3) var(--space-4); text-align: left; font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); border-bottom: var(--line) solid var(--border); }
.ltable td { padding: var(--space-3) var(--space-4); vertical-align: middle; border-top: var(--line) solid var(--border); }
.ltable tbody tr:first-child td { border-top: 0; }
.ltable tbody tr:hover td { background: var(--surface-2); }
.c-unit strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1;
  letter-spacing: .03em; color: var(--text); }
.c-unit a:hover strong { color: var(--teal); }
.c-sub { display: block; color: var(--text-2); font-size: var(--size-xs); }
.c-id { font-weight: 600; font-variant-numeric: tabular-nums; }
.route-line-text { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.route-line-text .i { color: var(--teal); }
.c-when { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 767px) {
  .ltable thead { display: none; }
  .ltable, .ltable tbody { display: block; }
  .ltable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-3);
    padding: var(--space-4); border-top: var(--line) solid var(--border); }
  .ltable tbody tr:first-child { border-top: 0; }
  .ltable td, .ltable tbody tr:first-child td { display: flex; justify-content: space-between; align-items: center;
    gap: var(--space-3); padding: 0; border: 0; background: none; grid-column: 1 / -1; min-width: 0; }
  .ltable tbody tr:hover td { background: none; }
  .ltable td::before { content: attr(data-label); color: var(--text-2); font-size: 11px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; flex: none; }
  .ltable td.c-unit { grid-column: 1; display: block; }
  .ltable td.c-unit::before, .ltable td.c-state::before, .ltable td.c-link::before { content: none; }
  .ltable td.c-state { grid-column: 2; grid-row: 1; }
  .ltable td.c-link { justify-content: flex-end; }
  .ltable td.c-link, .ltable tbody tr:first-child td.c-link { display: none; }
  .route-cell { display: flex; flex-direction: column; align-items: flex-end; }
}

/* map page */
.map-head { padding-bottom: 0; }
.map-head .page-title { margin-bottom: 0; }
.map-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--space-3) var(--space-5); padding-bottom: var(--space-4); }
.map-legend { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.legend { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 var(--space-3);
  border-radius: var(--radius-pill); border: var(--line) solid var(--idle-line); background: var(--idle-soft);
  color: var(--idle); font-size: var(--size-xs); font-weight: 600; }
.legend .i { width: 14px; height: 14px; }
.legend-critical { color: var(--critical); border-color: var(--critical-line); background: var(--critical-soft); }
.legend-important { color: var(--important); border-color: var(--important-line); background: var(--important-soft); }
.legend-ok { color: var(--ok); border-color: var(--teal-line); background: var(--ok-soft); }
.page-map .container { max-width: calc(1560px + 2 * var(--gutter)); }
.map-layout { display: grid; gap: var(--space-4); padding-bottom: var(--space-6); --map-h: 56vh; }
.map-full { height: var(--map-h); min-height: 320px; }
.truck-panel { min-width: 0; }
.truck-list { display: flex; flex-direction: column; gap: var(--space-2); }
.truck-row { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-3);
  text-align: left; cursor: pointer; border: var(--line) solid var(--border); border-left: 3px solid var(--idle);
  border-radius: var(--radius-input); background: var(--surface); color: var(--text); }
.truck-row:hover, .truck-row.is-picked { background: var(--surface-3); border-color: var(--border-strong); }
.truck-row.tone-critical { border-left-color: var(--critical); }
.truck-row.tone-important { border-left-color: var(--important); }
.truck-row.tone-ok { border-left-color: var(--ok); }
.truck-num { flex: none; min-width: 58px; font-family: var(--font-display); font-size: 32px; line-height: 1; letter-spacing: .03em; }
.truck-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.truck-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-width: 0; }
.truck-driver { font-size: var(--size-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.truck-sub { color: var(--text-2); font-size: var(--size-xs); overflow-wrap: anywhere; }
.truck-note { color: var(--text-2); font-size: var(--size-xs); text-align: center; padding: var(--space-2) 0; }
@media (min-width: 1024px) {
  .map-layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; --map-h: calc(100vh - var(--topbar-h) - 190px); }
  .map-full { min-height: 480px; }
  .truck-panel { max-height: max(var(--map-h), 480px); overflow-y: auto; padding-right: var(--space-1);
    scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
}

/* admin */
.runbox { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-4); padding: var(--space-5);
  margin-bottom: var(--space-5); border-radius: var(--radius-card); border: var(--line) solid var(--teal-line);
  background: var(--banner-bg); }
.runbox-icon { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%;
  background: var(--teal); color: var(--on-teal); }
.runbox-text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.runbox-title { font-family: var(--font-display); font-weight: 400; font-size: 36px; line-height: 1; letter-spacing: .03em; color: var(--teal); }
.runbox-line { color: var(--text); font-size: var(--size-sm); opacity: .88; }
.run-progress { color: var(--teal); font-size: var(--size-sm); font-weight: 600; min-height: 20px; }
.btn-big { min-height: 56px; padding: 0 var(--space-8); font-size: var(--size-lg); }
@media (max-width: 559px) { .runbox .btn-big { width: 100%; } }

.status-panel { display: grid; grid-template-columns: minmax(0, 1fr); margin: var(--space-4) 0 0; overflow: hidden;
  border: var(--line) solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.status-item { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); min-width: 0;
  border-top: var(--line) solid var(--border); }
.status-item:first-child { border-top: 0; }
.status-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
  color: var(--idle); background: var(--idle-soft); }
.status-item.is-ok .status-icon { color: var(--teal); background: var(--teal-soft); }
.status-item.is-bad .status-icon { color: var(--critical); background: var(--critical-soft); }
.status-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.status-name { font-size: var(--size-md); font-weight: 700; }
.status-word { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--idle); }
.status-word::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-item.is-ok .status-word { color: var(--ok); }
.status-item.is-bad .status-word { color: var(--critical); }
.status-line { color: var(--text-2); font-size: var(--size-sm); overflow-wrap: anywhere; }
@media (min-width: 640px) {
  .status-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-item:nth-child(2) { border-top: 0; }
  .status-item:nth-child(even) { border-left: var(--line) solid var(--border); }
}
@media (min-width: 1000px) {
  .status-panel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .status-item { border-top: 0; flex-direction: column; padding: var(--space-5); }
  .status-item + .status-item { border-left: var(--line) solid var(--border); }
}

.admin-grid { display: grid; gap: var(--space-4); margin-top: var(--space-5); align-items: start; }
@media (min-width: 1100px) { .admin-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); } }
.count-note { font-size: var(--size-sm); }
.user-list, .run-list { display: flex; flex-direction: column; }
.user-row, .run-row { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) 0;
  border-top: var(--line) solid var(--border); }
.user-row:first-child, .run-row:first-child { border-top: 0; padding-top: 0; }
.user-row:last-child, .run-row:last-child { padding-bottom: 0; }
.user-main { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.user-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.user-who { font-size: var(--size-md); overflow-wrap: anywhere; }
.user-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.units-edit { flex: 1 1 100%; }
.admin-note { min-height: 20px; color: var(--teal); font-size: var(--size-sm); font-weight: 600; }
.run-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.run-title { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--size-md); }
.run-title .i { color: var(--teal); }
.run-row .row-sub { display: flex; align-items: center; gap: 6px; }
.digest summary { cursor: pointer; color: var(--teal); font-size: var(--size-sm); font-weight: 600; }
.digest-text { margin: var(--space-2) 0 0; padding: var(--space-3); max-height: 320px; overflow: auto;
  white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-text); font-size: var(--size-xs);
  border-radius: var(--radius-input); background: var(--surface-2); border: var(--line) solid var(--border); }
@media (min-width: 640px) { .units-edit { flex: 0 1 220px; } }
.chip-busy { color: var(--important); background: var(--important-soft); border-color: var(--important-line); }
