/* Viyro app styles. Colours are tokens on :root, redefined for dark mode. */
:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --surface-3: #e5e5df;
  --fg: #15171a;
  --fg-2: #33373d;
  --muted: #5c6067;
  --line: #e2e2dc;
  --line-2: #c9c9c1;
  --accent: #0b1f3a;
  --accent-ink: #ffffff;
  --accent-soft: #e8edf4;
  --accent-2: #1c3a63;
  --signal: #f2a93b;
  --good: #1e7a4c;
  --good-soft: #e5f1ea;
  --warn: #9a5b00;
  --warn-soft: #fbf1de;
  --bad: #b42318;
  --bad-soft: #fbe8e5;
  --neutral-soft: #eeeee9;
  --c2: #6b5ce7;
  --c3: #d48a12;
  --c4: #c04f8e;
  --c5: #16a3a3;
  /* sidebar (same in both themes) */
  --panel: #121418;
  --panel-2: #121418;
  --panel-fg: #e9e9e4;
  --panel-muted: #9b9fa7;
  --panel-line: rgba(255, 255, 255, 0.08);
  --panel-active: rgba(255, 255, 255, 0.09);
  --panel-accent: #f2a93b;
  --shadow-1: 0 1px 0 rgba(21, 23, 26, 0.04);
  --shadow-2: 0 6px 18px rgba(21, 23, 26, 0.08);
  --shadow-3: 0 24px 60px rgba(14, 26, 46, 0.22);
  --scrim: rgba(7, 13, 24, 0.55);
  --display: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 8px;
  --r-sm: 6px;
  --r-lg: 10px;
  --sidebar: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1013;
    --surface: #16191d;
    --surface-2: #1c2025;
    --surface-3: #252a31;
    --fg: #ecece8;
    --fg-2: #c9cacb;
    --muted: #9a9ea6;
    --line: #262a30;
    --line-2: #363b43;
    --accent: #9dbbe6;
    --accent-ink: #0b1220;
    --accent-soft: #1b2635;
    --accent-2: #bcd2f1;
    --signal: #f2a93b;
    --good: #5cc08e;
    --good-soft: #13291d;
    --warn: #e8a83e;
    --warn-soft: #30240f;
    --bad: #f07a6e;
    --bad-soft: #3a1a17;
    --neutral-soft: #1f2328;
    --c2: #9d92ff;
    --c3: #e8b04f;
    --c4: #e07fb5;
    --c5: #4fd1c5;
    --panel: #0a0c0f;
    --panel-2: #0a0c0f;
    --panel-line: rgba(255, 255, 255, 0.07);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.65);
    --scrim: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1013;
  --surface: #16191d;
  --surface-2: #1c2025;
  --surface-3: #252a31;
  --fg: #ecece8;
  --fg-2: #c9cacb;
  --muted: #9a9ea6;
  --line: #262a30;
  --line-2: #363b43;
  --accent: #9dbbe6;
  --accent-ink: #0b1220;
  --accent-soft: #1b2635;
  --accent-2: #bcd2f1;
  --signal: #f2a93b;
  --good: #5cc08e;
  --good-soft: #13291d;
  --warn: #e8a83e;
  --warn-soft: #30240f;
  --bad: #f07a6e;
  --bad-soft: #3a1a17;
  --neutral-soft: #1f2328;
  --c2: #9d92ff;
  --c3: #e8b04f;
  --c4: #e07fb5;
  --c5: #4fd1c5;
  --panel: #0a0c0f;
  --panel-2: #0a0c0f;
  --panel-line: rgba(255, 255, 255, 0.07);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.65);
  --scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  height: 100%;
}
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.has-modal {
  overflow: hidden;
}
h1,
h2,
h3,
h4 {
  font-family: var(--display);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 {
  font-size: 26px;
  font-weight: 600;
}
h2 {
  font-size: 17px;
  font-weight: 600;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
p {
  margin: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
img {
  max-width: 100%;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection {
  background: var(--accent-soft);
}
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  letter-spacing: -0.01em;
}
.num,
.r,
.kpi-value,
.tbl td.r {
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.center {
  text-align: center;
}
.lead {
  font-size: 15px;
  color: var(--fg-2);
  line-height: 1.55;
}
.kicker,
.eyebrow {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}
[hidden] {
  display: none !important;
}
.ic {
  width: 20px;
  height: 20px;
  flex: none;
}
.ic.big {
  width: 36px;
  height: 36px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Logo lockup */
.lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.lockup:hover {
  text-decoration: none;
}
.lockup img {
  width: 34px;
  height: 34px;
  flex: none;
}
.wordmark {
  display: inline-block;
  height: 15px;
  aspect-ratio: 902 / 177;
  background: currentColor;
  -webkit-mask: url("../brand/viyro-wordmark.svg") center / contain no-repeat;
  mask: url("../brand/viyro-wordmark.svg") center / contain no-repeat;
  flex: none;
}
.lockup.lg img {
  width: 46px;
  height: 46px;
}
.lockup.lg .wordmark {
  height: 20px;
}
.lockup.sm img {
  width: 20px;
  height: 20px;
}
.lockup.sm .wordmark {
  height: 10px;
}

/* App shell */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--panel);
  color: var(--panel-fg);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-2) transparent;
}
.sidebar .lockup {
  padding: 4px 10px 18px;
  color: #fff;
}
.orgcard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 0 0 12px;
  border-radius: var(--r);
  background: var(--panel-2);
  color: var(--panel-fg);
  min-width: 0;
  text-decoration: none;
}
.orgcard:hover {
  text-decoration: none;
  background: #15305a;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
}
.orgcard .brand-mark {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
  color: #fff;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-sub {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.orgcard .brand-sub {
  color: var(--panel-muted);
}
.orgcard > div:last-child {
  min-width: 0;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--panel-muted);
  font-weight: 500;
  font-size: 14px;
  position: relative;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: var(--panel-fg);
}
.nav a.active {
  background: var(--panel-active);
  color: #fff;
}
.nav a.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal);
}
.nav a .ic {
  width: 19px;
  height: 19px;
  opacity: 0.9;
}
.nav a.active .ic {
  color: var(--panel-accent);
}
.nav .badge {
  margin-left: auto;
  background: #e5484d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.nav .badge.warn {
  background: #c7861a;
}
.nav .badge.info {
  background: var(--signal);
  color: #04111f;
}
.nav-group {
  padding: 16px 12px 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--panel-muted);
  opacity: 0.8;
}
.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-line);
}
.trialchip {
  display: block;
  margin: 0 2px 4px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: rgba(18, 180, 238, 0.12);
  color: var(--panel-fg);
  font-size: 12.5px;
  line-height: 1.4;
}
.trialchip b {
  color: #fff;
}
.whoami {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  color: var(--panel-fg);
}
.whoami:hover {
  background: rgba(255, 255, 255, 0.05);
}
.whoami .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--panel-accent);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 12.5px;
  flex: none;
}
.whoami b {
  display: block;
  font-size: 13.5px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.whoami span {
  font-size: 12px;
  color: var(--panel-muted);
}
.whoami > div {
  min-width: 0;
}
.live {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--panel-muted);
  padding: 2px 10px;
}
.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4cc38a;
  box-shadow: 0 0 8px #4cc38a;
}
.live.off i {
  background: #f07167;
  box-shadow: none;
}
.poweredby {
  font-size: 11px;
  color: var(--panel-muted);
  padding: 4px 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.poweredby .wordmark {
  height: 8px;
  color: var(--panel-fg);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled {
  border-bottom-color: var(--line);
}
.topbar .mobile-brand {
  display: none;
}
.cmd-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 520px;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}
.cmd-trigger:hover {
  border-color: var(--accent);
}
.cmd-trigger .ic {
  width: 18px;
  height: 18px;
}
.cmd-trigger kbd,
kbd {
  margin-left: auto;
  font: 500 11.5px var(--mono);
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--surface-2);
}
.topbar .spacer {
  flex: 1;
}
.content {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 32px 56px;
}
.page-h {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-h .sub {
  color: var(--muted);
  margin-top: 4px;
  max-width: 72ch;
}
.page-h .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabbar {
  display: none;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background: var(--panel);
    color: #fff;
    border-bottom: 0;
  }
  .topbar .mobile-brand {
    display: inline-flex;
  }
  .topbar .mobile-brand img {
    width: 30px;
    height: 30px;
  }
  .topbar .mobile-brand .wordmark {
    height: 13px;
  }
  .topbar .cmd-trigger {
    display: none;
  }
  .topbar .iconbtn {
    color: #fff;
  }
  .topbar .iconbtn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }
  .topbar .btn.primary {
    background: var(--signal);
    border-color: var(--signal);
    color: #04111f;
  }
  .topbar .newlabel {
    display: none;
  }
  .content {
    padding: 18px 16px calc(88px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    box-shadow: 0 -4px 18px rgba(14, 26, 46, 0.06);
  }
  .tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 10px;
    position: relative;
    text-decoration: none;
  }
  .tabbar a.active {
    color: var(--accent);
  }
  .tabbar a .ic {
    width: 22px;
    height: 22px;
  }
  .tabbar .badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 20px);
    background: var(--bad);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    padding: 0 5px;
    min-width: 16px;
    text-align: center;
  }
  h1 {
    font-size: 23px;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--fg);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition:
    background 0.12s,
    border-color 0.12s,
    transform 0.08s,
    box-shadow 0.12s;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn .ic {
  width: 17px;
  height: 17px;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 1px 2px rgba(10, 91, 216, 0.25);
}
.btn.primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.btn.danger {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 55%, transparent);
  background: transparent;
}
.btn.danger:hover {
  background: var(--bad-soft);
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.ghost:hover {
  background: var(--surface-2);
}
.btn.ghost.danger {
  color: var(--bad);
}
.btn.sm {
  padding: 5px 10px;
  font-size: 13px;
  border-radius: 7px;
}
.btn.lg {
  padding: 11px 20px;
  font-size: 15px;
  border-radius: 9px;
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn.busy {
  position: relative;
  color: transparent !important;
}
.btn.busy::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  color: var(--fg);
}
.btn.primary.busy::after {
  color: var(--accent-ink);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.iconbtn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  display: inline-grid;
  place-items: center;
  color: var(--fg-2);
  flex: none;
}
.iconbtn:hover {
  background: var(--surface-2);
  color: var(--fg);
}
.iconbtn.danger:hover {
  background: var(--bad-soft);
  color: var(--bad);
}
.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Dropdown menu */
.menu {
  position: fixed;
  z-index: 55;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-3);
  padding: 6px;
  display: flex;
  flex-direction: column;
  animation: pop 0.14s ease-out;
}
.menu button,
.menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-weight: 500;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
}
.menu button:hover,
.menu a:hover,
.menu button:focus-visible {
  background: var(--surface-2);
  outline: none;
}
.menu .ic {
  color: var(--accent);
  width: 18px;
  height: 18px;
}
.menu small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.menu hr {
  margin: 4px 6px;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Chips & pills */
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip:hover {
  background: var(--surface-2);
}
.chip.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.chip .n {
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
}
.chip.active .n {
  background: color-mix(in srgb, var(--bg) 22%, transparent);
  color: inherit;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.5;
  vertical-align: middle;
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 22%, transparent);
}
.pill.nodot::before {
  display: none;
}
.pill.good {
  background: var(--good-soft);
  color: var(--good);
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.pill.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.pill.neutral {
  background: var(--neutral-soft);
  color: var(--muted);
}
.pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.pill.sm {
  font-size: 11.5px;
  padding: 1px 8px;
}

/* Segmented tabs (cost sheet: sensors / vehicles / all) */
.segtabs {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.segtabs button,
.segtabs a {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}
.segtabs button:hover,
.segtabs a:hover {
  color: var(--fg);
  text-decoration: none;
}
.segtabs .active {
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-1);
}
.segtabs .ic {
  width: 16px;
  height: 16px;
}

/* Cards & KPIs */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
  min-width: 0;
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-h h2 {
  font-size: 15.5px;
}
.card-h .right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  gap: 16px;
}
.grid.two {
  grid-template-columns: 1fr 1fr;
}
.grid.three {
  grid-template-columns: repeat(3, 1fr);
}
.grid.main-side {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}
@media (max-width: 960px) {
  .grid.two,
  .grid.three,
  .grid.main-side {
    grid-template-columns: 1fr;
  }
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.grid > *,
.stack > * {
  min-width: 0;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.kpi {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px 14px;
  min-width: 0;
  color: inherit;
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--line-2);
}
.kpi.good::after {
  background: var(--good);
}
.kpi.warn::after {
  background: var(--warn);
}
.kpi.bad::after {
  background: var(--bad);
}
.kpi.accent::after {
  background: var(--accent);
}
a.kpi:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.kpi-value {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.15;
  margin-top: 4px;
  letter-spacing: -0.02em;
}
.kpi-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}
.kpi.good .kpi-value {
  color: var(--good);
}
.kpi.warn .kpi-value {
  color: var(--warn);
}
.kpi.bad .kpi-value {
  color: var(--bad);
}
.kpi.accent .kpi-value {
  color: var(--accent);
}
.kpi.big .kpi-value {
  font-size: 31px;
}

/* Value summary (overview) */
.value {
  background: linear-gradient(120deg, var(--panel) 0%, var(--panel-2) 100%);
  color: var(--panel-fg);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr);
  gap: 22px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.value::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(60, 203, 255, 0.18);
  box-shadow:
    0 0 0 30px rgba(60, 203, 255, 0.04),
    0 0 0 60px rgba(60, 203, 255, 0.03);
  pointer-events: none;
}
.value h2 {
  color: #fff;
  font-size: 17px;
}
.value p {
  color: var(--panel-muted);
  font-size: 13.5px;
  margin-top: 6px;
}
.value .big {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 10px;
}
.value .big small {
  font-size: 14px;
  font-weight: 500;
  color: var(--panel-muted);
  letter-spacing: 0;
}
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  position: relative;
}
.value-grid div {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-line);
  border-radius: var(--r);
  padding: 12px 14px;
}
.value-grid b {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  color: #fff;
  font-weight: 600;
}
.value-grid span {
  font-size: 12.5px;
  color: var(--panel-muted);
}
@media (max-width: 760px) {
  .value {
    grid-template-columns: 1fr;
  }
}

/* Hero (overview) */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 28px;
}
.hero .date {
  color: var(--muted);
  font-weight: 500;
}
.hero-health {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 10px 16px 10px 10px;
  box-shadow: var(--shadow-1);
}
.hero-health .ring-txt b {
  font-size: 15px;
}

/* Lists */
.rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rowcard {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1.1fr) 150px 120px 90px;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: border-color 0.12s;
}
.rowcard:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.rowcard > div {
  min-width: 0;
}
.rowcard .tag {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rowcard .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rowcard .sub {
  font-size: 12.5px;
  color: var(--muted);
}
.rowcard .lbl {
  display: none;
}
.rowcard .cost {
  text-align: right;
  font-weight: 600;
  font-family: var(--display);
}
.rowhead {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1.1fr) 150px 120px 90px;
  gap: 14px;
  padding: 0 16px 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.rowhead .r {
  text-align: right;
}
.rowcard.veh {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, 0.8fr) 170px 130px 100px 100px;
}
.rowhead.veh {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, 0.8fr) 170px 130px 100px 100px;
}
@media (max-width: 960px) {
  .rowhead {
    display: none;
  }
  .rowcard,
  .rowcard.veh {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
  }
  .rowcard > div:first-child {
    grid-column: 1 / -1;
  }
  .rowcard .lbl {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 1px;
  }
  .rowcard .cost {
    text-align: left;
  }
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .spacer {
  flex: 1;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 12px;
  flex: 1 1 240px;
  min-width: 0;
  max-width: 420px;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search input {
  border: 0;
  background: transparent;
  outline: 0;
  flex: 1;
  min-width: 0;
  padding: 0;
}
.search .ic {
  color: var(--muted);
  width: 18px;
  height: 18px;
}
.sel {
  border: 1px solid var(--line-2);
  background-color: var(--surface);
  color: var(--fg);
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 500;
  font-size: 14px;
}
select.sel {
  padding-right: 32px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238D9CB3' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

/* Attention list */
.att {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
}
a.att:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.att .stripe {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--line-2);
  flex: none;
}
.att.s3 .stripe {
  background: var(--bad);
  box-shadow:
    0 0 0 3px var(--bad-soft),
    0 0 8px var(--bad);
}
.att.s2 .stripe {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}
.att.s1 .stripe {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.att.s0 .stripe {
  background: var(--line-2);
}
.att .body {
  flex: 1;
  min-width: 0;
}
.att .title {
  font-weight: 600;
}
.att .detail {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.att .meta {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
}
.att .acts {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.att .state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 6px;
}
.att .state .ic {
  width: 15px;
  height: 15px;
}

/* Empty */
.empty {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty .ic.big {
  color: var(--accent);
  opacity: 0.85;
}
.empty h3 {
  color: var(--fg);
  font-size: 17px;
}
.empty p {
  max-width: 46ch;
}
.empty .btn,
.empty .btn-row {
  margin-top: 8px;
}

/* Detail pages */
.detail-h {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.detail-h .back {
  margin-top: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.detail-h h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-h .sub {
  color: var(--muted);
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.detail-h .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wcard {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}
.wcard.good {
  background: linear-gradient(135deg, var(--good-soft), var(--surface) 70%);
}
.wcard.warn {
  background: linear-gradient(135deg, var(--warn-soft), var(--surface) 70%);
}
.wcard.bad {
  background: linear-gradient(135deg, var(--bad-soft), var(--surface) 70%);
}
.wcard .big {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
}
.wcard.good .big {
  color: var(--good);
}
.wcard.warn .big {
  color: var(--warn);
}
.wcard.bad .big {
  color: var(--bad);
}
.wcard .small {
  color: var(--muted);
  margin-top: 2px;
}
.dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px 18px;
  margin: 0;
}
.dl > div {
  min-width: 0;
}
.dl dt {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.dl dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}
.dl .full {
  grid-column: 1 / -1;
}

/* fault status stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 2px 0 4px;
  flex-wrap: wrap;
}
.stepper .st {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.stepper .st i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1.5px solid var(--line-2);
  font-style: normal;
}
.stepper .st i .ic {
  width: 13px;
  height: 13px;
}
.stepper .st.done {
  color: var(--fg);
}
.stepper .st.done i {
  background: var(--good);
  border-color: var(--good);
  color: #fff;
}
.stepper .st.cur {
  color: var(--accent);
}
.stepper .st.cur i {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.stepper .ln {
  width: 36px;
  height: 2px;
  background: var(--line-2);
  margin: 0 8px;
}
.stepper .ln.done {
  background: var(--good);
}
.stepper small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 26px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--line);
}
.ev {
  position: relative;
  padding: 10px 0 18px;
}
.ev::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 15px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--line);
}
.ev.replacement::before {
  background: var(--warn);
}
.ev.fault::before {
  background: var(--bad);
  box-shadow: 0 0 0 2px var(--bad-soft);
}
.ev.callout::before {
  background: var(--muted);
}
.ev.inspection::before,
.ev.calibration::before {
  background: var(--good);
}
.ev .top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-right: 80px;
}
.ev .date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.ev .desc {
  margin: 5px 0;
  line-height: 1.5;
}
.ev .meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}
.ev .meta b {
  color: var(--fg);
  font-family: var(--display);
}
.ev .evacts {
  position: absolute;
  right: 0;
  top: 6px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s;
}
.ev:hover .evacts,
.ev:focus-within .evacts {
  opacity: 1;
}
@media (hover: none) {
  .ev .evacts {
    opacity: 1;
  }
}
.atts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.atts a {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px 4px 4px;
  font-size: 12.5px;
  color: var(--fg-2);
  background: var(--surface-2);
  max-width: 220px;
}
.atts a img {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  object-fit: cover;
}
.atts a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.atts .ic {
  width: 16px;
  height: 16px;
}
.lineage {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--mono);
  font-size: 12.5px;
}
.lineage .ic {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.form-grid .full {
  grid-column: 1 / -1;
}
.form-grid.three {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 560px) {
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.field > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
}
.field > span .req {
  color: var(--bad);
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--fg);
  border-radius: 8px;
  padding: 9px 12px;
  width: 100%;
  min-width: 0;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
.field input::placeholder,
.field textarea::placeholder,
.search input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input[type="file"] {
  padding: 6px;
}
.field textarea {
  min-height: 72px;
  resize: vertical;
}
.field .help {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
}
.money-in {
  position: relative;
}
.money-in input {
  padding-left: 26px;
}
.money-in::before {
  content: attr(data-sym);
  position: absolute;
  left: 11px;
  top: 9px;
  color: var(--muted);
  font-weight: 600;
}
.checkrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-weight: 500;
}
.checkrow input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: none;
}
.checkrow.boxed {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  background: var(--surface-2);
}
.form-error {
  background: var(--bad-soft);
  color: var(--bad);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 12px;
  font-weight: 600;
  font-size: 14px;
}
.hint-box {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--fg-2);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.hint-box .ic {
  color: var(--accent);
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.hint-box.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.hint-box.warn .ic {
  color: var(--warn);
}
.hint-box.good {
  background: var(--good-soft);
  color: var(--good);
}
.hint-box.good .ic {
  color: var(--good);
}
.hint-box.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.hint-box.bad .ic {
  color: var(--bad);
}
.hint-box a {
  font-weight: 600;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  border: 0;
  background: var(--surface);
  padding: 7px 12px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--fg-2);
  border-right: 1px solid var(--line);
}
.seg button:last-child {
  border-right: 0;
}
.seg button.active {
  background: var(--accent-soft);
  color: var(--accent);
}
datalist {
  display: none;
}
.catgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 6px;
}
.catgrid label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  text-align: center;
}
.catgrid label .ic {
  color: var(--muted);
}
.catgrid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.catgrid label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.catgrid label:has(input:checked) .ic {
  color: var(--accent);
}
.catgrid label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Modal */
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.18s;
}
.modal-wrap.open {
  opacity: 1;
}
.modal-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(3px);
}
.modal {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-3);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.18s;
  border: 1px solid var(--line);
}
.modal-wrap.open .modal {
  transform: none;
}
.modal.sm {
  max-width: 440px;
}
.modal.lg {
  max-width: 860px;
}
.modal.xl {
  max-width: 1100px;
}
.modal-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 12px;
}
.modal-h h2 {
  font-size: 18px;
}
.modal-h .kicker {
  margin-bottom: 2px;
}
.modal-b {
  padding: 6px 22px 20px;
  overflow-y: auto;
}
.modal-f {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.modal-f .left {
  margin-right: auto;
}
@media (max-width: 560px) {
  .modal-wrap {
    padding: 0;
    align-items: end;
  }
  .modal {
    max-height: 94vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .modal-f {
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

/* Command palette */
.modal-wrap.cmd {
  place-items: start center;
  padding-top: 12vh;
}
.modal.cmd {
  max-width: 600px;
  overflow: hidden;
}
.cmd-in {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.cmd-in .ic {
  color: var(--muted);
}
.cmd-in input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: 0;
  font-size: 16px;
  min-width: 0;
}
.cmd-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 6px;
}
.cmd-list .grp {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 10px 4px;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
}
.cmd-item:hover {
  text-decoration: none;
}
.cmd-item.sel {
  background: var(--accent-soft);
}
.cmd-item .ic {
  color: var(--muted);
  width: 18px;
  height: 18px;
}
.cmd-item.sel .ic {
  color: var(--accent);
}
.cmd-item b {
  font-weight: 600;
}
.cmd-item span {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cmd-item em {
  margin-left: auto;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.cmd-foot {
  display: flex;
  gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 560px) {
  .modal-wrap.cmd {
    padding-top: 0;
    place-items: start stretch;
  }
  .modal.cmd {
    border-radius: 0 0 var(--r-lg) var(--r-lg);
  }
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 10px);
  background: var(--fg);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 9px;
  font-weight: 600;
  z-index: 60;
  box-shadow: var(--shadow-2);
  opacity: 0;
  transition:
    opacity 0.18s,
    transform 0.18s;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.bad {
  background: var(--bad);
  color: #fff;
}
.toast.good {
  background: var(--good);
  color: #fff;
}
:root[data-theme="dark"] .toast.good,
:root[data-theme="dark"] .toast.bad {
  color: #04111f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .toast.good,
  :root:not([data-theme="light"]) .toast.bad {
    color: #04111f;
  }
}
@media (max-width: 960px) {
  .toast {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
}

/* Tables */
.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tbl {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
}
.tbl th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface);
}
.tbl td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tbl tbody tr:last-child td {
  border-bottom: 0;
}
.tbl tbody tr:hover td {
  background: var(--surface-2);
}
.tbl td.r,
.tbl th.r {
  text-align: right;
  white-space: nowrap;
}
.tbl tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--line-2);
  font-family: var(--display);
}
.tbl .t {
  display: inline-block;
  max-width: 36ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.tbl a.row-link {
  color: inherit;
  font-weight: 700;
}
.tbl.compact td {
  padding: 7px 8px;
}
.linkbtn {
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.linkbtn .ic {
  width: 15px;
  height: 15px;
}

/* Charts */
.chart {
  width: 100%;
}
.chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.barchart .grid {
  stroke: var(--line);
  stroke-width: 1;
}
.barchart .axis {
  font-size: 11px;
  fill: var(--muted);
  font-family: var(--body);
}
.barchart .bar-val {
  font-size: 11px;
  fill: var(--fg-2);
  font-family: var(--display);
  font-weight: 600;
}
.tbl td.nw,
.tbl th.nw {
  white-space: nowrap;
}
.bar.s-accent,
.sw.s-accent,
.split-bar i.s-accent {
  fill: var(--accent);
  background: var(--accent);
}
.bar.s-c2,
.sw.s-c2,
.split-bar i.s-c2 {
  fill: var(--c2);
  background: var(--c2);
}
.bar.s-c3,
.sw.s-c3,
.split-bar i.s-c3 {
  fill: var(--c3);
  background: var(--c3);
}
.bar.s-c4,
.sw.s-c4,
.split-bar i.s-c4 {
  fill: var(--c4);
  background: var(--c4);
}
.bar.s-c5,
.sw.s-c5,
.split-bar i.s-c5 {
  fill: var(--c5);
  background: var(--c5);
}
.bar.s-good,
.sw.s-good,
.split-bar i.s-good {
  fill: var(--good);
  background: var(--good);
}
.bar.s-warn,
.sw.s-warn,
.split-bar i.s-warn {
  fill: var(--warn);
  background: var(--warn);
}
.bar.s-bad,
.sw.s-bad,
.split-bar i.s-bad {
  fill: var(--bad);
  background: var(--bad);
}
.bar.s-muted,
.sw.s-muted,
.split-bar i.s-muted {
  fill: var(--line-2);
  background: var(--line-2);
}
.bar.hi {
  stroke: var(--fg);
  stroke-width: 0.5;
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
}
.sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}
.split-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-2);
  gap: 2px;
}
.split-bar i {
  display: block;
  height: 100%;
  min-width: 3px;
}
.split-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.split-legend b {
  color: var(--fg);
  font-family: var(--display);
}
.ring {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
}
.ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ring-bg {
  fill: none;
  stroke: var(--surface-2);
}
.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}
.ring.good .ring-fg {
  stroke: var(--good);
}
.ring.warn .ring-fg {
  stroke: var(--warn);
}
.ring.bad .ring-fg {
  stroke: var(--bad);
}
.ring.neutral .ring-fg {
  stroke: var(--line-2);
}
.ring-txt {
  text-align: center;
  line-height: 1.1;
}
.ring-txt b {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  display: block;
}
.ring-txt span {
  font-size: 11px;
  color: var(--muted);
}
.budget-track {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: var(--surface-2);
  overflow: visible;
  margin-top: 26px;
}
.budget-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--good);
  transition: width 0.5s;
}
.budget.warn .budget-fill {
  background: var(--warn);
}
.budget.bad .budget-fill {
  background: var(--bad);
}
.budget-proj {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--fg);
  border-radius: 1px;
}
.budget-proj::after {
  content: "forecast";
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.budget-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  gap: 10px;
  flex-wrap: wrap;
}
.budget-row b {
  color: var(--bad);
}

/* Label sheets (print) */
.labels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.label {
  border: 1px solid #c8d2df;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  color: #111;
  break-inside: avoid;
}
.label svg {
  width: 84px;
  height: 84px;
  flex: none;
}
.label .lt {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
}
.label .ls {
  font-size: 11.5px;
  color: #444;
  margin-top: 3px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.label .lm {
  font-family: var(--mono);
  font-size: 10.5px;
  color: #333;
  margin-top: 3px;
}
.label.sm {
  padding: 8px;
}
.label.sm svg {
  width: 64px;
  height: 64px;
}
.label.sm .lt {
  font-size: 15px;
}
.label.lg svg {
  width: 120px;
  height: 120px;
}
.label.lg .lt {
  font-size: 22px;
}

/* Import */
.drop {
  border: 2px dashed var(--line-2);
  border-radius: var(--r-lg);
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  transition:
    border-color 0.12s,
    background 0.12s;
  display: block;
  cursor: pointer;
}
.drop h3 {
  color: var(--fg);
}
.drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.drop input {
  display: none;
}
.map-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px 12px;
  align-items: center;
}
.map-grid .arrow {
  color: var(--muted);
}
.steps {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.steps span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
  font-size: 13.5px;
}
.steps span i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}
.steps span.done i {
  background: var(--good-soft);
  color: var(--good);
}
.steps span.cur {
  color: var(--fg);
}
.steps span.cur i {
  background: var(--accent);
  color: var(--accent-ink);
}
.steps .sep {
  width: 24px;
  height: 1px;
  background: var(--line-2);
}

/* Settings */
.taglist {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.taglist .tg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px 6px 4px 10px;
  font-size: 13px;
  font-weight: 600;
}
.taglist .tg button {
  border: 0;
  background: transparent;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 0;
}
.taglist .tg button:hover {
  background: var(--bad-soft);
  color: var(--bad);
}
.taglist .tg .ic {
  width: 13px;
  height: 13px;
}
.audit {
  display: flex;
  flex-direction: column;
}
.audit > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.audit > div:last-child {
  border-bottom: 0;
}
.audit .when {
  color: var(--muted);
  font-size: 12.5px;
  font-family: var(--mono);
}
.audit .who {
  font-weight: 700;
}

/* Utility */
.gap {
  height: 16px;
}
.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rightbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.notice {
  border-radius: var(--r);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.notice b {
  font-weight: 700;
}
.notice.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.notice.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.notice.good {
  background: var(--good-soft);
  color: var(--good);
}
.notice .ic {
  flex: none;
}
.notice .btn {
  margin-left: auto;
}
.fade-in {
  animation: fade 0.22s ease both;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 10px;
  height: 64px;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Print */
@media print {
  .sidebar,
  .topbar,
  .tabbar,
  .toolbar,
  .page-h .actions,
  .no-print,
  .toast,
  .evacts,
  .iconbtn,
  .actingbar,
  .segtabs {
    display: none !important;
  }
  .shell {
    display: block;
  }
  .content {
    max-width: none;
    padding: 0;
  }
  :root {
    --bg: #fff;
    --surface: #fff;
    --fg: #000;
    --muted: #444;
    --line: #ccc;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card,
  .kpi,
  .rowcard,
  .att {
    box-shadow: none;
    border-color: #bbb;
    break-inside: avoid;
  }
  .value {
    background: #fff;
    color: #000;
    border: 1px solid #bbb;
  }
  .value h2,
  .value .big,
  .value-grid b {
    color: #000;
  }
  .value p,
  .value-grid span {
    color: #444;
  }
  .labels-grid {
    gap: 6mm;
  }
  a {
    color: inherit;
  }
}

/* Sign-in screens */
.shell.auth-mode {
  grid-template-columns: 1fr;
}
.shell.auth-mode .sidebar,
.shell.auth-mode .topbar,
.shell.auth-mode .actingbar {
  display: none;
}
.actingbar {
  position: sticky;
  top: 0;
  z-index: 21;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 32px;
  background: var(--signal);
  color: #04111f;
  font-size: 13.5px;
  font-weight: 500;
}
.actingbar[hidden] {
  display: none;
}
.actingbar span {
  flex: 1;
  min-width: 0;
}
.actingbar .btn {
  background: rgba(4, 17, 31, 0.08);
  border-color: rgba(4, 17, 31, 0.35);
  color: inherit;
  flex: none;
}
.actingbar .btn:hover {
  background: rgba(4, 17, 31, 0.16);
}
@media (max-width: 960px) {
  .actingbar {
    padding: 10px 16px;
    position: static;
  }
}
.shell.auth-mode .content {
  max-width: none;
  padding: 0;
}
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--bg);
}
.auth-side {
  background: var(--panel);
  color: var(--panel-fg);
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-side .lockup {
  color: #fff;
}
.auth-side h2 {
  font-size: clamp(24px, 2.6vw, 34px);
  color: #fff;
  font-weight: 600;
  line-height: 1.2;
  max-width: 18ch;
  letter-spacing: -0.02em;
}
.auth-side p {
  color: var(--panel-muted);
  margin-top: 14px;
  max-width: 46ch;
}
.auth-side ul {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  display: grid;
  gap: 12px;
}
.auth-side li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--panel-fg);
  font-size: 14.5px;
}
.auth-side li i {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal);
  flex: none;
}
.auth-side .trace {
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(60, 203, 255, 0.16);
  box-shadow:
    0 0 0 46px rgba(60, 203, 255, 0.035),
    0 0 0 92px rgba(60, 203, 255, 0.025);
  pointer-events: none;
}
.auth-side small {
  color: var(--panel-muted);
  font-size: 12.5px;
  position: relative;
}
.auth-main {
  display: grid;
  place-items: center;
  padding: 32px 18px;
  position: relative;
}
.auth-main .theme-corner {
  position: absolute;
  top: 14px;
  right: 14px;
}
.auth-wrap.single {
  grid-template-columns: 1fr;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-card.boxed {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow-1);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-h {
  font-size: 24px;
  margin-bottom: 6px;
}
.auth-mobile-brand {
  display: none;
  margin-bottom: 26px;
}
.auth-foot {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.auth-foot a {
  color: var(--muted);
}
.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 600;
  flex-wrap: wrap;
}
@media (max-width: 860px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }
  .auth-side {
    display: none;
  }
  .auth-mobile-brand {
    display: inline-flex;
    color: var(--fg);
  }
  .auth-main {
    place-items: start center;
    padding-top: 48px;
  }
}

/* Faults & vehicles */
.sev {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: 1px;
  margin-right: 7px;
}
.sev.low {
  background: var(--muted);
}
.sev.medium {
  background: var(--c3);
}
.sev.high {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}
.sev.critical {
  background: var(--bad);
  box-shadow: 0 0 0 3px var(--bad-soft);
}
.thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
}
.msg .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  font-family: var(--display);
  color: var(--fg-2);
}
.msg .bubble {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0;
}
.msg .bubble.status {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.msg .who {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.msg .body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 12px;
}
.composer textarea {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--fg);
  border-radius: 8px;
  padding: 9px 12px;
  resize: vertical;
}
.composer textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.check-item .seg button {
  padding: 5px 9px;
  font-size: 12.5px;
}
.check-item.defect {
  border-color: var(--bad);
  background: var(--bad-soft);
}
.reg {
  white-space: nowrap;
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #ffd500;
  color: #111;
  border-radius: 4px;
  padding: 1px 9px;
  border: 1px solid #c9a800;
  font-size: 0.95em;
}
.dmg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dmg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.dmg img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}
.dmg .b {
  flex: 1;
  min-width: 0;
}
.dmg.repaired {
  opacity: 0.75;
}
.sigpad {
  border: 1.5px dashed #c8d2df;
  border-radius: 12px;
  background: #fff;
  touch-action: none;
  width: 100%;
  height: 160px;
  display: block;
}
.doc {
  white-space: pre-wrap;
  line-height: 1.6;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 16px 18px;
  max-height: 50vh;
  overflow: auto;
  font-size: 14.5px;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.tool-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.tool-toggle input {
  accent-color: var(--accent);
}
.tool-toggle.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.person {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.person:last-child {
  border-bottom: 0;
}
.person .meta {
  font-size: 12.5px;
  color: var(--muted);
}
.person .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
@media (max-width: 640px) {
  .person {
    grid-template-columns: 1fr;
  }
  .person > .stack {
    align-items: flex-start !important;
  }
}

/* Companies console */
.pending-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.pending-card + .pending-card {
  margin-top: 10px;
}
.pending-card .who {
  font-weight: 600;
}
.pending-card .facts {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.pending-card .msgq {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--fg-2);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 10px;
}
@media (max-width: 760px) {
  .pending-card {
    grid-template-columns: 1fr;
  }
}

/* Home and hubs */
.bad-t {
  color: var(--bad);
}
.btn.block {
  width: 100%;
}
.iconbtn.flip .ic {
  transform: rotate(180deg);
}
.inline-in {
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}
.inline-in > input {
  flex: 1;
  min-width: 0;
}
.inline-in > select {
  width: auto;
  flex: 0 0 auto;
}
.seg.block {
  display: flex;
  width: 100%;
}
.seg.block button {
  flex: 1;
}
.seg button .ic {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 2px;
}
.btn-row.wrap2 > .btn {
  flex: 1 1 calc(50% - 4px);
}
.chip .n.warn {
  color: var(--warn);
}
.sticky-side {
  align-self: start;
}
@media (min-width: 961px) {
  .sticky-side {
    position: sticky;
    top: 76px;
  }
}

/* home */
.home-h {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.home-h h1 {
  font-size: 28px;
  margin-top: 2px;
}
.home-h .sub {
  color: var(--muted);
  margin-top: 6px;
  max-width: 64ch;
}
.home-h .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.areas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.areas.one {
  grid-template-columns: minmax(0, 640px);
}
.area-card {
  position: relative;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 176px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.area-card:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.area-art {
  box-shadow: inset -1px 0 0 rgba(127, 184, 255, 0.12);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(77, 163, 255, 0.16), transparent 70%),
    linear-gradient(165deg, var(--panel) 0%, var(--panel-2) 100%);
  color: var(--panel-accent);
  display: grid;
  place-items: center;
  padding: 18px;
  position: relative;
}
/* faint blueprint grid behind the drawing */
.area-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(127, 184, 255, 0.22) 1px, transparent 1.3px);
  background-size: 12px 12px;
  background-position: 6px 6px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
}
.art {
  width: 100%;
  max-width: 150px;
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
}
.art .art-dot {
  color: var(--signal);
}
.area-body {
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.area-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.area-kicker .ic {
  width: 17px;
  height: 17px;
}
.area-body h2 {
  font-size: 21px;
}
.area-stats {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
  color: var(--muted);
}
.area-stats li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.area-stats li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-2);
  flex: none;
}
.area-stats li b {
  color: var(--fg);
  font-family: var(--display);
  font-weight: 600;
  min-width: 1.4em;
}
.area-stats li.warn::before {
  background: var(--warn);
}
.area-stats li.warn b {
  color: var(--warn);
}
.area-stats li.bad::before {
  background: var(--bad);
  box-shadow: 0 0 0 3px var(--bad-soft);
}
.area-stats li.bad b {
  color: var(--bad);
}
.area-go {
  position: absolute;
  right: 18px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
}
.area-go .ic {
  width: 16px;
  height: 16px;
  transition: transform 0.15s;
}
.area-card:hover .area-go .ic {
  transform: translateX(3px);
}

/* tool tiles (home and hubs) */
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.tool {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: inherit;
  box-shadow: var(--shadow-1);
  min-width: 0;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.tool:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.tool-ic {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.tool-ic .ic {
  width: 20px;
  height: 20px;
}
.tool.warn .tool-ic {
  background: var(--warn-soft);
  color: var(--warn);
}
.tool.bad .tool-ic {
  background: var(--bad-soft);
  color: var(--bad);
}
.tool-t {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.tool-t b {
  font-weight: 600;
  font-size: 14.5px;
}
.tool-t span {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool .tool-go {
  width: 16px;
  height: 16px;
  color: var(--muted);
  opacity: 0.6;
}
.tool.busy {
  opacity: 0.6;
  pointer-events: none;
}

/* area hubs */
.hub-h {
  display: flex;
  align-items: center;
  gap: 14px 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.hub-h .back {
  border: 1px solid var(--line);
  background: var(--surface);
}
.hub-art {
  box-shadow: inset 0 0 0 1px rgba(127, 184, 255, 0.2);
  width: 84px;
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  color: var(--panel-accent);
  display: grid;
  place-items: center;
  padding: 6px 10px;
  flex: none;
}
.hub-art .art {
  max-width: 70px;
  filter: none;
}
.hub-t {
  min-width: 0;
  flex: 1 1 260px;
}
.hub-t .sub {
  color: var(--muted);
  margin-top: 2px;
}
.hub-h .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hub-kpis {
  margin-bottom: 16px;
}
.site-grid,
.veh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}
.site-card,
.veh-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--good);
  border-radius: var(--r);
  padding: 12px 14px;
  color: inherit;
  background: var(--surface);
  min-width: 0;
}
.site-card:hover,
.veh-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  border-left-color: var(--accent);
}
.site-card.warn {
  border-left-color: var(--warn);
}
.site-card.bad {
  border-left-color: var(--bad);
}
.site-n {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.site-n b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-n .ic {
  color: var(--muted);
  width: 18px;
  height: 18px;
}
.site-s,
.veh-s {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.site-s b {
  color: var(--fg);
  font-weight: 600;
}
.site-s .w b,
.veh-s .w {
  color: var(--warn);
}
.site-s .b b,
.veh-s .b {
  color: var(--bad);
}
.site-s .g {
  color: var(--good);
  font-weight: 600;
}
.veh-card {
  border-left-color: var(--line-2);
}
.veh-card.off {
  border-left-color: var(--warn);
}
.veh-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.veh-m {
  font-size: 13px;
  color: var(--fg-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.veh-s span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.veh-s .ic {
  width: 14px;
  height: 14px;
}

/* sidebar: area switch */
.area-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 10px 2px 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
}
.nav .area-switch a {
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  font-size: 13px;
  border-radius: 7px;
}
.nav .area-switch a.on {
  background: var(--panel-active);
  color: #fff;
}
.nav .area-switch a.on .ic {
  color: var(--panel-accent);
}
.nav .area-switch a::before {
  display: none;
}
.nav .area-switch .ic {
  width: 17px;
  height: 17px;
}
.nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-group .ic {
  width: 14px;
  height: 14px;
}

/* "More" sheet (mobile) */
.more-g {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 2px 8px;
}
.more-g:first-child {
  margin-top: 0;
}
.more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.more-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--fg);
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  min-width: 0;
}
.more-tile:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.more-tile .ic {
  color: var(--accent);
  width: 19px;
  height: 19px;
}
.more-tile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.more-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--panel);
  color: var(--panel-fg);
}
.more-switch:hover {
  text-decoration: none;
}
.more-switch .ic {
  color: var(--panel-accent);
}
.more-switch span {
  flex: 1;
}
.more-switch b {
  color: #fff;
}

/* offline bar */
.offbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 32px;
  font-size: 13.5px;
  position: sticky;
  top: 0;
  z-index: 19;
}
.offbar span {
  flex: 1;
  min-width: 0;
}
.offbar.off {
  background: #3a2a06;
  color: #fce7b5;
}
.offbar.off .ic {
  color: #f5b83d;
}
.offbar.wait {
  background: var(--accent-soft);
  color: var(--accent);
}
.offbar .btn {
  flex: none;
}
.offbar.off .btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: inherit;
}
@media (max-width: 960px) {
  .offbar {
    padding: 10px 16px;
    position: static;
  }
}

/* planned maintenance calendar */
.cal-card {
  padding: 14px 16px;
}
.cal-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.cal-h h2 {
  min-width: 160px;
  text-align: center;
  font-size: 16px;
}
.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cal-dow {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding: 2px 0 4px;
}
.cal-day {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  color: var(--fg);
  min-width: 0;
}
.cal-day.blank {
  background: transparent;
  border-color: transparent;
}
.cal-day b {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.cal-day.today {
  border-color: var(--accent);
}
.cal-day.today b {
  color: var(--accent);
}
.cal-day.sel {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.cal-day:hover:not(.blank) {
  border-color: var(--accent);
}
.cal-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cal-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cal-chip .ic {
  width: 12px;
  height: 12px;
}
.cal-chip.soon {
  background: var(--warn-soft);
  color: var(--warn);
}
.cal-chip.late {
  background: var(--bad-soft);
  color: var(--bad);
}
.cal-chip.done {
  background: var(--good-soft);
  color: var(--good);
}
.cal-items .more {
  font-size: 11px;
  color: var(--muted);
  padding-left: 4px;
}
.cal-dots {
  display: none;
  gap: 3px;
  justify-content: center;
}
.cal-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-dots i.late {
  background: var(--bad);
}
.cal-dots i.soon {
  background: var(--warn);
}
.cal-dots i.done {
  background: var(--good);
}

/* stock cupboard */
.rowcard.stock {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.9fr) 100px auto;
}
.rowcard.stock.low {
  border-left: 3px solid var(--warn);
}
.rowcard .acts {
  justify-content: flex-end;
}

/* fuel */
.tbl tr.flag td {
  background: color-mix(in srgb, var(--warn-soft) 55%, transparent);
}
.tbl .ic {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

/* handover */
.handover-text {
  white-space: pre-wrap;
  font: 12.5px/1.55 var(--mono);
  background: var(--surface-2);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 0;
  max-height: 420px;
  overflow: auto;
  color: var(--fg-2);
}
details.ho {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
}
details.ho summary {
  cursor: pointer;
}
details.ho .handover-text {
  margin: 10px 0;
}
.card-h h2 .n {
  display: inline-block;
  min-width: 22px;
  padding: 0 7px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  font-weight: 600;
  vertical-align: 2px;
}
.card-h h2 .n.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

/* settings */
.esc-stage {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.esc-n {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 30px;
}
.conn-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.conn-row .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  background: var(--line-2);
  flex: none;
}
.conn-row .dot.on {
  background: var(--good);
  box-shadow: 0 0 0 3px var(--good-soft);
}

/* damage photos & expired attachments */
.dmg-ph {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex: none;
  display: block;
}
.dmg-ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.dmg-ph span {
  position: absolute;
  right: 3px;
  bottom: 3px;
  background: rgba(4, 17, 31, 0.75);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 5px;
  padding: 0 5px;
}
.dmg-ph.none {
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.dmg-acts {
  flex: none;
}
.att-gone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--muted);
}
.att-gone .ic {
  width: 15px;
  height: 15px;
}
.label .lm.cta {
  font-family: var(--body);
  font-weight: 600;
  color: #0a1a33;
  letter-spacing: 0.01em;
}

/* Mobile layout */
@media (max-width: 960px) {
  .tabbar a span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .areas {
    grid-template-columns: 1fr;
  }
  .cal-day {
    min-height: 74px;
  }
}
@media (max-width: 760px) {
  .content {
    padding-left: 14px;
    padding-right: 14px;
  }
  .card {
    padding: 14px 14px;
    border-radius: 12px;
  }
  .page-h,
  .home-h {
    margin-bottom: 16px;
  }
  h1,
  .home-h h1 {
    font-size: 22px;
  }
  .page-h .sub,
  .home-h .sub {
    font-size: 14px;
  }
  /* header buttons */
  .page-h .actions,
  .detail-h .actions,
  .home-h .actions,
  .hub-h .actions {
    width: 100%;
    margin-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .page-h .actions > .btn,
  .detail-h .actions > .btn,
  .home-h .actions > .btn,
  .hub-h .actions > .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
  .page-h .actions > .btn.primary,
  .detail-h .actions > .btn.primary,
  .hub-h .actions > .btn.primary {
    flex-basis: 100%;
    order: -1;
  }
  /* long labels wrap instead of being clipped on narrow phones */
  .page-h .actions > .btn,
  .detail-h .actions > .btn,
  .home-h .actions > .btn,
  .hub-h .actions > .btn {
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }
  .detail-h .actions > .iconbtn {
    border: 1px solid var(--line);
    background: var(--surface);
  }
  .detail-h {
    gap: 10px 12px;
  }
  .detail-h > div:nth-child(2) {
    flex: 1 1 calc(100% - 60px);
  }
  /* KPI tiles scroll horizontally */
  .kpis {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    margin: 0 -14px;
    padding: 2px 14px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .kpis::-webkit-scrollbar {
    display: none;
  }
  .kpis > .kpi {
    flex: 0 0 auto;
    width: 152px;
    scroll-snap-align: start;
    padding: 11px 13px;
  }
  .kpi-value {
    font-size: 22px;
  }
  .kpi-hint {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .kpis.hub-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 0 14px;
    padding: 0;
    overflow: visible;
  }
  .kpis.hub-kpis > .kpi {
    width: auto;
  }
  /* home & hubs */
  .area-card {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 0;
  }
  .area-art {
    padding: 10px 8px;
  }
  .area-body {
    padding: 14px 14px 40px;
    gap: 6px;
  }
  .area-body h2 {
    font-size: 18px;
  }
  .area-stats {
    font-size: 13.5px;
  }
  .area-go {
    right: 14px;
    bottom: 12px;
  }
  .tools {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .tool {
    padding: 10px;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
  }
  .tool .tool-go {
    display: none;
  }
  .tool-ic {
    width: 34px;
    height: 34px;
  }
  .tool-t b {
    font-size: 14px;
    line-height: 1.25;
  }
  .tool-t span {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .hub-art {
    width: 64px;
    height: 48px;
  }
  .hub-h .back {
    display: none;
  }
  .site-grid,
  .veh-grid {
    grid-template-columns: 1fr;
  }
  /* toolbars */
  .toolbar {
    gap: 8px;
  }
  .toolbar .search {
    flex-basis: 100%;
    max-width: none;
    order: -1;
  }
  .toolbar .sel,
  .toolbar input[type="date"] {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
  .toolbar .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    margin: 0 -14px;
    padding: 0 40px 2px 14px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
  }
  .toolbar .chips::-webkit-scrollbar {
    display: none;
  }
  .toolbar .chip {
    flex: none;
  }
  .toolbar .seg {
    max-width: 100%;
    overflow-x: auto;
  }
  .toolbar .spacer {
    display: none;
  }
  /* lists */
  .att {
    padding: 11px 12px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .att .body {
    flex: 1 1 calc(100% - 24px);
  }
  .att .detail {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .att .meta {
    order: 2;
    flex-basis: 100%;
    text-align: left;
    white-space: normal;
    padding-left: 18px;
    margin-top: -6px;
    font-size: 12px;
  }
  .att .meta:empty {
    display: none;
  }
  .att .acts .btn {
    flex: 1 1 auto;
    min-width: 0;
  }
  .att .acts .btn.markoff {
    flex: 1 1 100%;
  }
  .rowcard.stock {
    grid-template-columns: 1fr 1fr;
  }
  .rowcard.stock .acts {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .rowcard.stock .acts .btn {
    flex: 1;
  }
  /* tables scroll horizontally */
  .tbl-wrap {
    margin: 0 -14px;
    padding: 0 14px;
  }
  .tbl {
    min-width: 640px;
  }
  .tbl.compact {
    min-width: 600px;
  }
  .tbl.fuel {
    min-width: 680px;
  }
  /* fault stepper */
  .stepper {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: start;
  }
  .stepper .st {
    flex-direction: column;
    text-align: center;
    gap: 6px;
    font-size: 12px;
  }
  .stepper .ln {
    width: 18px;
    margin: 11px 2px 0;
  }
  .stepper small {
    font-size: 11px;
  }
  /* notes */
  .composer {
    flex-wrap: wrap;
  }
  .composer textarea {
    flex: 1 1 100%;
  }
  /* iPhones zoom the page into any field under 16px when it is tapped */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select,
  textarea {
    font-size: max(16px, 1em) !important;
  }
  .composer .btn.primary {
    flex: 1;
  }
  /* damage rows */
  .dmg {
    flex-wrap: wrap;
  }
  .dmg .b {
    flex: 1 1 calc(100% - 70px);
  }
  .dmg .dmg-acts {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
  /* dashboard pieces */
  .hero {
    margin-bottom: 14px;
  }
  .hero .rightbar,
  .hero-health {
    width: 100%;
  }
  .value {
    padding: 16px;
    gap: 14px;
  }
  .value .big {
    font-size: 28px;
  }
  .value-grid {
    grid-template-columns: 1fr 1fr;
  }
  .value-grid div {
    padding: 10px;
  }
  .value-grid b {
    font-size: 17px;
  }
  .dl {
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
  }
  .audit > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .esc-stage {
    grid-template-columns: 1fr;
  }
  .esc-n {
    padding-top: 0;
  }
  .cal-h h2 {
    min-width: 0;
    flex: 1;
    font-size: 15px;
  }
  .cal {
    gap: 2px;
  }
  .cal-dow {
    font-size: 11px;
  }
  .cal-day {
    min-height: 46px;
    padding: 4px 2px;
    align-items: center;
    border-radius: 6px;
  }
  .cal-items {
    display: none;
  }
  .cal-dots {
    display: flex;
  }
  .modal-b {
    padding: 6px 16px 18px;
  }
  .modal-h {
    padding: 16px 16px 10px;
  }
  .modal-f {
    padding-left: 16px;
    padding-right: 16px;
  }
  .modal-f > .btn {
    flex: 1 1 auto;
  }
  .modal-f > .left {
    flex: 1 1 100%;
    order: 2;
  }
  .check-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 380px) {
  .tools {
    grid-template-columns: 1fr;
  }
  .tool {
    flex-direction: row;
    align-items: center;
  }
  .area-card {
    grid-template-columns: 1fr;
  }
  .area-art {
    height: 96px;
    padding: 10px;
  }
  .area-art .art {
    width: auto;
    height: 100%;
  }
}
@media print {
  .offbar,
  .hub-h .actions,
  .home-h .actions {
    display: none !important;
  }
}

/* Mobile nav drawer */
.burger {
  display: none;
  position: relative;
}
.burger .dot-badge {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--panel);
}
.drawer-wrap {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}
.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 20, 0.5);
  opacity: 0;
  transition: opacity 0.22s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 62vw;
  min-width: 270px;
  max-width: 360px;
  background: var(--panel);
  color: var(--panel-fg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition:
    transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0.26s;
  visibility: hidden;
  border-left: 1px solid var(--panel-line);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer-wrap.open {
  pointer-events: auto;
}
.drawer-wrap.open .drawer-scrim {
  opacity: 1;
}
.drawer-wrap.open .drawer {
  transform: none;
  visibility: visible;
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.35);
}
body.has-drawer {
  overflow: hidden;
}
.drawer-h {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 8px 12px;
}
.drawer-h .orgcard {
  flex: 1;
  margin: 0;
  min-width: 0;
}
.drawer-h .iconbtn,
.drawer-f .iconbtn {
  color: var(--panel-fg);
}
.drawer-h .iconbtn:hover,
.drawer-f .iconbtn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.drawer-b {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 12px;
  overscroll-behavior: contain;
}
.drawer-b .nav a {
  padding: 10px 12px;
  font-size: 15px;
}
.drawer-b .nav a.active::before {
  left: -10px;
}
.drawer-b .area-switch {
  margin-top: 8px;
}
.drawer-f {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--panel-line);
}
.drawer-f .whoami {
  flex: 1;
  min-width: 0;
}
@media (max-width: 960px) {
  .tabbar {
    display: none !important;
  }
  .burger {
    display: inline-grid;
  }
  .topbar .desk-only {
    display: none;
  }
  .content {
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }
  .toast {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

/* Mobile tiles (sensors, vehicles) */
.drows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mtiles {
  display: none;
}
.mtile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px 12px 11px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--good);
  border-radius: var(--r);
  background: var(--surface);
  color: inherit;
  box-shadow: var(--shadow-1);
}
.mtile:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.mtile b {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mtile .reg {
  align-self: flex-start;
}
.mtile .mt-sub {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mtile .mt-st {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--good);
  margin-top: 2px;
  min-width: 0;
}
.mtile .mt-st i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.mtile.warn {
  border-top-color: var(--warn);
}
.mtile.warn .mt-st {
  color: var(--warn);
}
.mtile.bad {
  border-top-color: var(--bad);
}
.mtile.bad .mt-st {
  color: var(--bad);
}
.mtile.neutral {
  border-top-color: var(--line-2);
}
.mtile.neutral .mt-st {
  color: var(--muted);
}
@media (max-width: 760px) {
  .drows {
    display: none;
  }
  .mtiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* Visitors & hand-outs */
.chipline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.hchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}
.hchip .ic {
  width: 14px;
  height: 14px;
}
.hold {
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hold .ic {
  width: 15px;
  height: 15px;
}
.handout-box {
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  padding: 12px;
  background: var(--surface-2);
}
.handout-box .eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
}
.handout-box .eyebrow .ic {
  width: 16px;
  height: 16px;
}
.co-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px 12px 10px;
}
.co-item .checkrow .ic {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.holder {
  display: flex;
  gap: 12px;
  align-items: center;
}
.holder .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
}
@media (max-width: 760px) {
  .att.visitor .acts .btn.primary {
    flex-basis: 100%;
  }
  .att.visitor .acts .iconbtn {
    flex: none;
  }
}

/* Visitor picker and on-device NDA */
.who-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  background: var(--surface-2);
}
.who-card .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex: none;
}
.who-card .who-b {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.who-card .who-b > div:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.nda-sheet .nda-doc {
  max-height: 38vh;
  font-size: 14px;
}
.nda-sheet .sigpad {
  height: 180px;
}
.modal-f .btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 760px) {
  .nda-sheet .nda-doc {
    max-height: 32vh;
    font-size: 13.5px;
    padding: 12px 14px;
  }
  .modal-f #footBtns {
    flex: 1;
  }
  .modal-f #footBtns .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* 17px inputs on phones: avoids iOS focus zoom at 0.95 initial scale */
@media (max-width: 760px) {
  .field input,
  .field select,
  .field textarea,
  .search input,
  .sel,
  .cmd-in input {
    font-size: 17px;
  }
}

/* Attention mark-off */
.att.leaving {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.15s;
}
details.marked-off {
  padding: 14px 18px;
}
details.marked-off summary {
  cursor: pointer;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  list-style: none;
}
details.marked-off summary::-webkit-details-marker {
  display: none;
}
details.marked-off summary::before {
  content: "▸";
  color: var(--muted);
  transition: transform 0.15s;
}
details.marked-off[open] summary::before {
  transform: rotate(90deg);
}
details.marked-off summary .mo-note {
  font-weight: 400;
  flex-basis: 100%;
  padding-left: 18px;
}
details.marked-off .att .title a {
  color: inherit;
}

/* Cost sheet time frame */
.period-bar {
  align-items: flex-end;
}
.period-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
}
.period-custom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.period-custom[hidden] {
  display: none;
}
@media (max-width: 760px) {
  .period-pick,
  .period-custom {
    flex: 1 1 100%;
  }
  .period-custom .sel {
    flex: 1;
  }
}

/* Attention: boxed mark-off button */
.btn.markoff {
  background: var(--surface-2);
}

/* Home live strip */
.live-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
  margin-bottom: 16px;
}
.live-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  min-width: 0;
  flex: 1 1 200px;
}
.live-chip .ic {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex: none;
}
.live-chip span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.live-chip small {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-chip.in .ic {
  color: var(--good);
}
.live-chip.out .ic {
  color: var(--warn);
}
.live-chip.bad {
  border-color: var(--bad);
}
.live-chip.bad .ic {
  color: var(--bad);
}
.live-chip.new {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.live-strip > .btn {
  align-self: center;
}
.notice-strip {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}
.notice-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--r);
  background: var(--surface);
  padding: 10px 14px;
}
.notice-card.imp {
  border-left-color: var(--bad);
  background: var(--bad-soft);
}
.nc-h {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.nc-b {
  white-space: pre-wrap;
  margin-top: 4px;
  font-size: 14px;
}
.nc-f {
  margin-top: 6px;
}
.linkbtn {
  border: 0;
  background: none;
  color: var(--bad);
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* Patrols */
.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.card.route {
  padding: 16px 18px;
}
.card.route.late {
  border-color: var(--bad);
}
.card.route.dim {
  opacity: 0.7;
}
.route-h {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.route-h h3 {
  margin: 0;
}
.route-ic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: none;
}
.route-s {
  margin-bottom: 2px;
}
.scan-btn {
  margin: 4px 0 16px;
  padding: 16px;
  font-size: 17px;
}
.progress-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.progress-line .bar {
  flex: 1 1 160px;
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress-line .bar span {
  display: block;
  height: 100%;
  background: var(--good);
}
.att.cp .ok-ic {
  width: 16px;
  height: 16px;
  color: var(--good);
  margin-right: 6px;
  vertical-align: -3px;
}
.scanner {
  position: relative;
  background: #000;
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-height: 60vh;
  margin: 0 auto;
}
.scanner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scanner.off {
  display: none;
}
.scan-frame {
  position: absolute;
  inset: 18%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35);
}
.scan-msg {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
}
.scan-msg.good {
  background: var(--good-soft);
  color: var(--good);
}
.scan-msg.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.scan-msg .ic {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

/* Occurrence log */
.day-h {
  margin: 18px 0 8px;
}
.day-h:first-child {
  margin-top: 0;
}
.filters .sel {
  min-width: 150px;
}

/* Movements */
.res-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.res-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.res-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px var(--good-soft);
  flex: none;
}
.res-card.out .res-dot {
  background: var(--warn);
  box-shadow: 0 0 0 4px var(--warn-soft);
}
.res-b {
  flex: 1;
  min-width: 0;
}
.res-name {
  font-weight: 700;
}
.res-state {
  font-size: 14px;
}
.chk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Equipment */
.kit-id {
  font-family: var(--mono, ui-monospace, Menlo, Consolas, monospace);
  font-weight: 700;
}
.holder-line {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--fg-2);
}
.holder-line .ic {
  width: 15px;
  height: 15px;
  vertical-align: -3px;
  color: var(--accent);
}

/* Team board */
.duty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.duty-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.duty-card .avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex: none;
}
.duty-card > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.contact {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.contact:last-child {
  border-bottom: 0;
}

/* Handovers */
.ho-list {
  display: grid;
  gap: 10px;
}
.ho-file {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
.ho-file.unread {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.ho-ic {
  width: 40px;
  height: 46px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex: none;
}
.ho-b {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.ho-snip {
  font-size: 13.5px;
  color: var(--fg-2);
}
.ho-r {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ho-r .ic {
  width: 14px;
  height: 14px;
}
.doc-view {
  max-height: 60vh;
  overflow: auto;
}

/* On-site NDA: who the signer becomes */
.kind-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.kind-opt input {
  position: absolute;
  opacity: 0;
}
.kind-opt span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r);
  font-weight: 700;
  cursor: pointer;
  height: 100%;
}
.kind-opt small {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}
.kind-opt input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.kind-opt input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dna-box {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px dashed var(--bad);
  border-radius: var(--r);
}
@media (max-width: 560px) {
  .kind-pick {
    grid-template-columns: 1fr;
  }
}
a.notice {
  text-decoration: none;
  margin-bottom: 14px;
}

@media (max-width: 760px) {
  .live-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .live-chip {
    padding: 9px 10px;
    gap: 8px;
  }
  .live-chip b {
    font-size: 13.5px;
  }
  .live-chip small {
    font-size: 11.5px;
  }
  .live-strip > .btn {
    grid-column: 1 / -1;
  }
}

/* Set-up and delete controls are for administrators only (also enforced in the database) */
body:not(.is-admin) .admin-only,
body:not(.is-admin) .manage-only {
  display: none !important;
}

/* ====================================================================================================
   2026 look: calm, professional, no decoration for its own sake.
   One ink colour for actions, amber only for "act now", red only for overdue or high.
   ==================================================================================================== */
body {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.card,
.kpi,
.att,
.rowcard,
.tool,
.site-card,
.veh-card,
.mtile,
.notice-card {
  box-shadow: none;
}
.card {
  border-radius: var(--r-lg);
}

/* Labels read as labels, not shouting */
.kicker,
.eyebrow,
.area-kicker,
.more-g,
.esc-n {
  text-transform: none;
  letter-spacing: 0;
}
.eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

/* Sidebar: flat charcoal, quiet groups, amber marker on the current page */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--panel-line);
}
.orgcard {
  background: transparent;
  border: 1px solid var(--panel-line);
  box-shadow: none;
}
.nav a {
  border-radius: 6px;
  padding: 7px 12px;
}
.nav a.active {
  background: var(--panel-active);
  color: #fff;
}
.nav a.active::before {
  left: -10px;
  width: 2px;
  border-radius: 0;
  background: var(--panel-accent);
  box-shadow: none;
}
.nav a.active .ic {
  color: #fff;
}
.nav-group {
  padding: 18px 12px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--panel-muted);
  opacity: 1;
}
.nav-group.quiet {
  font-weight: 500;
  opacity: 0.85;
}
.nav .badge {
  background: transparent;
  color: var(--panel-fg);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  padding: 0 2px;
  min-width: 0;
}
.nav .badge:not(.warn):not(.info) {
  color: #ff9b8f;
}
.nav .badge.warn {
  background: transparent;
  color: var(--panel-accent);
}
.nav .badge.info {
  background: transparent;
  color: var(--panel-muted);
}

/* Buttons: ink for the main action, plain outline for the rest */
.btn {
  border-radius: 6px;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.pill {
  border-radius: 4px;
}

/* Figures: no coloured edges, the number carries the status */
.kpi {
  border-radius: var(--r);
}
.kpi::after {
  display: none;
}
.kpi-label {
  text-transform: none;
  letter-spacing: 0;
}

/* Needs-attention rows: a small square marker, no glow */
.att {
  border-radius: var(--r);
}
.att .stripe {
  border-radius: 1px;
  box-shadow: none !important;
}
.att.s1 .stripe {
  background: var(--muted);
}

/* Former gradient panels are flat */
.value,
.area-art,
.hub-art {
  background: var(--panel);
}
.wcard.good,
.wcard.warn,
.wcard.bad {
  background: var(--surface);
}
.area-art::after {
  display: none;
}

/* Counts next to headings */
.count {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.85em;
  color: var(--muted);
  margin-left: 4px;
}
.warn-t {
  color: var(--warn);
}
.mono {
  font-family: var(--mono);
}

/* Status line along the top of Today */
.statusline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  padding: 11px 16px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 13.5px;
  color: var(--fg-2);
}
.statusline .st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.statusline b {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  color: var(--fg);
}
.statusline i {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: var(--line-2);
}
.statusline .bad i {
  background: var(--bad);
}
.statusline .warn i {
  background: var(--signal);
}
.statusline .bad b {
  color: var(--bad);
}

/* Today layout: main column and a side column that drops below on narrow screens */
.today-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}
.today-main {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.today-side {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.today-main > .card,
.today-side > .card {
  margin: 0;
}

/* Today's log */
.livelog {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
.livelog li {
  display: flex;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.livelog li:first-child {
  border-top: 0;
  padding-top: 2px;
}
.livelog time {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  width: 42px;
  flex: none;
  padding-top: 1px;
}

/* With you / out now */
.kit-list {
  display: flex;
  flex-direction: column;
}
.kit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.kit-row:first-child {
  border-top: 0;
  padding-top: 2px;
}
.kit-ic {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--fg-2);
}
.kit-ic .ic {
  width: 19px;
  height: 19px;
}
.kit-t {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.kit-t small {
  color: var(--muted);
  font-size: 12.5px;
}
.card-h .btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Choosing a vehicle */
.pick-list {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pick-list legend {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  padding: 0;
}
.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
}
.pick:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--accent-soft);
}
.pick.off {
  opacity: 0.55;
  cursor: not-allowed;
}
.pick input {
  accent-color: var(--accent);
}
.pick-t {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.pick-t small {
  color: var(--muted);
  font-size: 12.5px;
}

/* The shift: jobs now, later, done */
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  margin: -6px 0 22px;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--good);
}
.jobs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.jobs > .eyebrow {
  margin: 0 2px 2px;
  font-size: 13px;
  font-weight: 600;
}
.job {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.job-t {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.job-t b {
  font-size: 16px;
  font-weight: 600;
}
.job-t span {
  color: var(--muted);
  font-size: 14px;
}
.job .btn {
  min-height: 44px;
  padding: 0 18px;
}
.later,
.done,
.dated,
.plain {
  list-style: none;
  margin: 0;
  padding: 0;
}
.later {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.later li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.later li:first-child {
  border-top: 0;
}
.later time,
.dated time {
  font-family: var(--mono);
  font-size: 13px;
  width: 50px;
  flex: none;
  color: var(--fg-2);
}
.later li > span {
  flex: 1;
  min-width: 0;
}
.later a,
.later .linkbtn {
  font-weight: 600;
  white-space: nowrap;
}
.done li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  color: var(--muted);
  font-size: 14px;
}
.done li .ic {
  color: var(--good);
  width: 18px;
  height: 18px;
  flex: none;
}
.done li span {
  flex: 1;
}
.done time {
  font-family: var(--mono);
  font-size: 12.5px;
}
.dated li {
  display: flex;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.dated li:first-child {
  border-top: 0;
  padding-top: 2px;
}
.dated time {
  width: 96px;
}
.plain li {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.plain li:first-child {
  border-top: 0;
  padding-top: 0;
}

/* Client report */
.report .report-h {
  margin-bottom: 18px;
  max-width: 760px;
}
.report h1 {
  font-size: 30px;
  letter-spacing: -0.01em;
  margin: 2px 0 8px;
}
.report .lede {
  font-size: 18px;
  line-height: 1.55;
  margin: 0;
  color: var(--fg);
}
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin: 0 0 22px;
  border-top: 2px solid var(--fg);
  border-bottom: 1px solid var(--line);
}
.figures > div {
  padding: 14px 16px 16px 0;
}
.figures > div + div {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.figures dt {
  font-size: 13px;
  color: var(--muted);
}
.figures dd {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 500;
  font-family: var(--display);
}
.figures dd small {
  font-size: 15px;
  color: var(--muted);
}

/* Phone bottom bar: Today, a section, New, With you, Menu */
@media (max-width: 960px) {
  .topbar #newBtn,
  .topbar #burger {
    display: none !important;
  }
  .shell:not(.auth-mode) ~ .tabbar:not([hidden]) {
    display: grid !important;
  }
  .tabbar {
    align-items: end;
    box-shadow: none;
  }
  .tabbar a.active {
    color: var(--fg);
  }
  .tabbar .tab-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: 0;
  }
  .tabbar .tab-menu .ic {
    width: 22px;
    height: 22px;
  }
  .tabbar .tab-new {
    justify-self: center;
    width: 54px;
    height: 54px;
    margin-top: -18px;
    border-radius: 14px;
    border: 0;
    background: var(--panel);
    color: var(--signal);
    display: grid;
    place-items: center;
  }
  .tabbar .tab-new .ic {
    width: 26px;
    height: 26px;
  }
  .tabbar .badge {
    background: var(--bad);
  }
  .statusline {
    gap: 4px 18px;
    padding: 10px 12px;
    font-size: 13px;
  }
  .job {
    padding: 14px;
  }
  .job .btn {
    flex: 1 1 100%;
  }
  .figures dd {
    font-size: 24px;
  }
}

/* Status is shown by the words and the small marker, not coloured edges */
.mtile,
.mtile.warn,
.mtile.bad,
.mtile.neutral {
  border-top: 1px solid var(--line);
}
.site-card,
.site-card.warn,
.site-card.bad,
.rowcard.stock.low,
.notice-card {
  border-left-width: 1px;
  border-left-color: var(--line);
}
.value::before,
.value::after {
  display: none;
}
.value {
  border-color: var(--panel);
}
.pick input[type="radio"] {
  width: auto;
  height: auto;
  flex: none;
  margin: 0;
  min-height: 0;
  padding: 0;
}
.pick .reg {
  flex: none;
}
.pick-t {
  flex: 1;
  min-width: 0;
}
