/* Inerte Express — planning platform stylesheet (v3)
   Look and feel shared with Cement Inventory (v3.43): Geist, neutral greys, white cards on a light canvas with a
   hairline ring, compact controls (taller on touch screens), flat buttons with a dark primary, pill choices, a labelled
   sidebar with a hi-vis marker on the current page, side panels for forms and centred dialogs for confirmations.
   Everything in rem so the text-size control scales the whole UI. Mobile-first. */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens (v3.44) ----------
   Surfaces: --bg (canvas) · --sidebar · --panel (cards) · --raised (popovers, sheets, dialogs, the chat/Mondi panels)
   · --panel-2 (hover, tracks, quiet fills) · --paper (legacy quiet fill). Text: --fg · --text-2 (secondary) · --muted
   (captions, = text-3) · --faint (placeholder, disabled). One accent (--accent): only the sidebar's current-page
   marker, the "now" line on timelines and unread dots, never a tile fill or a text colour. Status: --ok/--warn/--bad/
   --info, each -fg (text, dot) and -bg (soft fill). Type roles (--fs-*, --lh-*, --ls-*), the 4pt spacing scale
   (--s-1…--s-10), one z-index scale (--z-*) and one focus ring (--focus-ring). Every older name keeps working. */
:root {
  --text-scale: 1;

  --bg: #F7F7F7;
  --sidebar: #F7F7F7;
  --panel: #FFFFFF;
  --raised: #FFFFFF;
  --seg-on: #FFFFFF;                    /* the chosen segment of a segmented control */
  --field-bg: #FFFFFF;                  /* text fields and selects */
  --panel-2: #F2F2F3;
  --paper: #F4F4F5;
  --line: #E9E9EB;
  --line-strong: #D6D6DA;
  --ring: rgba(0, 0, 0, 0.07);          /* the hairline around cards */
  --fg: #0A0A0A;
  --text-2: #525252;
  --muted: #6B6B6B;
  --text-3: var(--muted);
  --faint: #A1A1A1;

  --accent: #F2C230;                    /* hi-vis: the current page's marker, the "now" line, unread dots */
  --accent-fg: #111111;                 /* text on the accent */
  --accent-text: #8A6100;               /* legacy: no new use */
  --accent-soft: #FDF6DC;               /* legacy: no new use */

  --primary: #111111;
  --primary-fg: #FFFFFF;
  --primary-hover: #2B2B2B;
  --focus: #A3A3A3;                     /* legacy (pager) */

  --ok-fg: #15803D;   --ok-bg: #ECFDF3;
  --warn-fg: #B45309; --warn-bg: #FFF7E6;
  --bad-fg: #B42318;  --bad-bg: #FEF3F2;
  --info-fg: #1D4ED8; --info-bg: #EFF4FF;
  --chart: #2563EB;                     /* the one chart hue */
  --danger: #B42318; --danger-hover: #9A1C13; --danger-fg: #FFFFFF;   /* the fill of a destructive answer ("Fshi")*/

  /* the planner's Gantt phases */
  --load: #3F6A94;
  --go: #B8891B;
  --wait: #C23B2A;
  --pour: #277A4E;
  --back: #7F8A90;
  --setup: #6F58A8;
  --bar-text: #FFFFFF;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 8px 24px -8px rgba(0, 0, 0, 0.14), 0 0 0 1px var(--ring);
  --shadow-modal: 0 24px 56px -16px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--ring);
  --shadow-2: var(--shadow-pop);
  --backdrop: rgba(0, 0, 0, 0.4);

  --radius-xs: 0.375rem;   /* 6px: badges, plates, chips in tables */
  --radius-s: 0.5rem;      /* 8px: buttons, inputs */
  --radius: 0.75rem;       /* 12px: cards */
  --radius-l: 1rem;        /* 16px: sheets, dialogs, popovers */

  /* 4pt spacing scale */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.25rem;
  --s-6: 1.5rem; --s-7: 2rem; --s-8: 2.5rem; --s-9: 3rem; --s-10: 4rem;

  /* type roles: size / leading / tracking */
  --fs-display: 1.75rem;  --lh-display: 1.15; --ls-display: -0.025em;
  --fs-title: 1.5rem;     --lh-title: 1.2;    --ls-title: -0.02em;
  --fs-dialog: 1.0625rem; --lh-dialog: 1.4;   --ls-dialog: -0.015em;
  --fs-section: 0.9375rem; --lh-section: 1.35; --ls-section: -0.01em;
  --fs-body: 0.875rem;    --lh-body: 1.5;
  --fs-meta: 0.8125rem;   --lh-meta: 1.45;
  --fs-cell: 0.875rem;    --lh-cell: 1.45;
  --fs-head: 0.75rem;     --lh-head: 1.35;    --ls-head: 0.005em;
  --fs-label: 0.8125rem;  --lh-label: 1.35;
  --fs-badge: 0.75rem;    --lh-badge: 1.35;
  --fs-micro: 0.6875rem;  /* the label above a value in a phone card, chart ticks */
  --fs-kpi: 1.75rem;      --lh-kpi: 1.1;      --ls-kpi: -0.01em;
  --fs-btn: 0.875rem;     --fs-btn-sm: 0.8125rem;

  /* control heights: fine pointer / coarse pointer (below) */
  --h-btn: 2.25rem; --h-btn-sm: 2rem; --h-btn-xs: 1.75rem; --h-input: 2.25rem; --h-toolbar: 2rem;

  /* one layering scale */
  --z-sticky: 20;      /* table heads, sticky bars, the pager */
  --z-topbar: 60;
  --z-rail: 70;
  --z-backdrop: 75;
  --z-panel: 80;       /* chat / Mondi panels */
  --z-popover: 90;     /* menus, autocomplete */
  --z-toast: 100;

  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px color-mix(in srgb, var(--fg) 35%, transparent);
  --focus-ring-inset: inset 0 0 0 2px color-mix(in srgb, var(--fg) 45%, transparent);
  --input-ring: 0 0 0 3px color-mix(in srgb, var(--fg) 10%, transparent);

  /* the select chevron and the search magnifier, drawn in --muted */
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236B6B6B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236B6B6B' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='m10.5 10.5 3 3'/%3E%3C/svg%3E");
  --icon-clear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236B6B6B' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4.5 4.5l7 7M11.5 4.5l-7 7'/%3E%3C/svg%3E");

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}
/* touch screens: 15px body, 40px buttons, 44px fields with 16px text so iOS does not zoom */
@media (pointer: coarse) {
  :root { --fs-body: 0.9375rem; --h-btn: 2.5rem; --h-btn-sm: 2.25rem; --h-btn-xs: 2rem; --h-input: 2.75rem; --h-toolbar: 2.5rem; }
}

:root[data-theme="dark"] {
  --bg: #0A0A0A;
  --sidebar: #0E0E0E;
  --panel: #141414;
  --raised: #1C1C1C;
  --seg-on: #2E2E2E;
  --field-bg: rgba(255, 255, 255, 0.035);
  --panel-2: #1F1F1F;
  --paper: #181818;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --ring: rgba(255, 255, 255, 0.08);
  --fg: #EDEDED;
  --text-2: #B4B4B4;
  --muted: #8F8F8F;
  --faint: #5C5C5C;
  --accent: #F2C230;
  --accent-fg: #111111;
  --accent-text: #F2C94C;
  --accent-soft: #2A2410;
  --primary: #EDEDED;
  --primary-fg: #0A0A0A;
  --primary-hover: #D4D4D4;
  --focus: #737373;
  --ok-fg: #4ADE80;   --ok-bg: #0F2A1A;
  --warn-fg: #FBBF24; --warn-bg: #2A2108;
  --bad-fg: #F87171;  --bad-bg: #2C1513;
  --info-fg: #60A5FA; --info-bg: #0F1C33;
  --chart: #60A5FA;
  --danger: #D93A2F; --danger-hover: #E4544A; --danger-fg: #FFFFFF;
  --load: #6E99C2;
  --go: #D8AC45;
  --wait: #E2654F;
  --pour: #3FAE75;
  --back: #7C878D;
  --setup: #A38BD1;
  --bar-text: #10151A;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-pop: 0 8px 24px -8px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--ring);
  --shadow-modal: 0 24px 56px -16px rgba(0, 0, 0, 0.56), 0 0 0 1px var(--ring);
  --backdrop: rgba(0, 0, 0, 0.6);
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238F8F8F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238F8F8F' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='m10.5 10.5 3 3'/%3E%3C/svg%3E");
  --icon-clear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238F8F8F' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4.5 4.5l7 7M11.5 4.5l-7 7'/%3E%3C/svg%3E");
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0A;
    --sidebar: #0E0E0E;
    --panel: #141414;
    --raised: #1C1C1C;
    --seg-on: #2E2E2E;
    --field-bg: rgba(255, 255, 255, 0.035);
    --panel-2: #1F1F1F;
    --paper: #181818;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --ring: rgba(255, 255, 255, 0.08);
    --fg: #EDEDED;
    --text-2: #B4B4B4;
    --muted: #8F8F8F;
    --faint: #5C5C5C;
    --accent: #F2C230;
    --accent-fg: #111111;
    --accent-text: #F2C94C;
    --accent-soft: #2A2410;
    --primary: #EDEDED;
    --primary-fg: #0A0A0A;
    --primary-hover: #D4D4D4;
    --focus: #737373;
    --ok-fg: #4ADE80;   --ok-bg: #0F2A1A;
    --warn-fg: #FBBF24; --warn-bg: #2A2108;
    --bad-fg: #F87171;  --bad-bg: #2C1513;
    --info-fg: #60A5FA; --info-bg: #0F1C33;
    --chart: #60A5FA;
    --danger: #D93A2F; --danger-hover: #E4544A; --danger-fg: #FFFFFF;
    --load: #6E99C2;
    --go: #D8AC45;
    --wait: #E2654F;
    --pour: #3FAE75;
    --back: #7C878D;
    --setup: #A38BD1;
    --bar-text: #10151A;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-pop: 0 8px 24px -8px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--ring);
    --shadow-modal: 0 24px 56px -16px rgba(0, 0, 0, 0.56), 0 0 0 1px var(--ring);
    --backdrop: rgba(0, 0, 0, 0.6);
    --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238F8F8F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238F8F8F' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='m10.5 10.5 3 3'/%3E%3C/svg%3E");
    --icon-clear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238F8F8F' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4.5 4.5l7 7M11.5 4.5l-7 7'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
/* more contrast asked: stronger hairlines and a solid 2px focus ring */
@media (prefers-contrast: more) {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --line: var(--line-strong);
    --ring: var(--line-strong);
    --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg);
    --focus-ring-inset: inset 0 0 0 2px var(--fg);
    --input-ring: 0 0 0 2px var(--fg);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: calc(100% * var(--text-scale));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
p, li, dd { text-wrap: pretty; }
b, strong { font-weight: 600; }
button, input, output, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
/* figures line up in columns where they are compared: cells, KPI values, times, money */
td, .num, .tnum, .money, .amount, time, output, .kpi .v, .stepper input { font-variant-numeric: tabular-nums; }

button, [role="button"], .chip, .seg-btn, .dock button, .menu [role="menuitem"] {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
/* 16px in fields on touch screens so iOS does not zoom; the UI's text size with a mouse */
input, select, textarea { font-size: max(1rem, 16px); }
@media (pointer: fine) { input, select, textarea { font-size: var(--fs-body); } }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip {
  position: fixed;
  left: 1rem;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  z-index: calc(var(--z-toast) + 1);
  transform: translateY(calc(-100% - 2rem));
  background: var(--primary);
  color: var(--primary-fg);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-s);
  font-weight: 500;
  text-decoration: none;
}
.skip:focus { transform: none; }

/* one focus ring for the whole platform (keyboard only); the transparent outline shows in forced-colours mode */
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus-ring); }
:focus:not(:focus-visible) { outline: none; }
/* a heading or container focused by script (tabindex=-1) takes the reader there without drawing a ring */
:is(h1, h2, h3, h4, p, section, article, main, div, dialog, form)[tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }

/* less motion asked: no keyframe animation; components that move (sheets, dialogs, menus) fade instead */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Type (one scale: the --fs-* roles) ---------- */
.display { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: 600; letter-spacing: var(--ls-display); }
.page-title, .hero h1, .error-page h1 { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 600; letter-spacing: var(--ls-title); }
@media (max-width: 639px) { .page-title, .hero h1, .error-page h1 { font-size: 1.375rem; } }
.section-title { font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 600; letter-spacing: var(--ls-section); }
/* the old uppercase eyebrow is a plain caption now, in sentence case */
.eyebrow, .caption { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.hero { display: grid; gap: 0.375rem; padding: 0.25rem 0 0; }
.lead { color: var(--text-2); font-size: var(--fs-body); line-height: var(--lh-body); max-width: 62ch; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small, .meta { font-size: var(--fs-meta); line-height: var(--lh-meta); }
.meta { color: var(--text-2); }
.hint { font-size: var(--fs-meta); color: var(--muted); line-height: var(--lh-meta); }
/* a button that reads as a link inside a sentence ("dërgoje sërish") */
.btn-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--fg); text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; border-radius: 2px; }
.btn-link:hover { color: var(--text-2); }
.btn-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-link:disabled { color: var(--muted); cursor: default; text-decoration: none; }
/* a page's head: the title (and an optional one-line meta) on the left, its actions on the right */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1rem; min-width: 0; }
.page-head > :first-child { display: grid; gap: 0.25rem; min-width: 0; }
.page-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
/* phones, on the pages that share sub-tabs and the plain head: the title and its compact actions on one 40/44px row,
   the meta line under both, so the sub-tab row sits at the same height on sibling pages (Flota / Servisi,
   Financa / Kosto, Cilësia / Stoku, Prezenca / Performanca) whether a page has a key or not */
@media (max-width: 639px) {
  :is(.pg-fleet, .pg-service, .pg-attendance, .pg-performance, .pg-finance, .pg-costs, .pg-quality, .pg-stock, .pg-customers, .pg-chat, .pg-admin, .pg-reports) .page-head {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.25rem 0.75rem;
  }
  :is(.pg-fleet, .pg-service, .pg-attendance, .pg-performance, .pg-finance, .pg-costs, .pg-quality, .pg-stock, .pg-customers, .pg-chat, .pg-admin, .pg-reports) .page-head > :first-child { display: contents; }
  :is(.pg-fleet, .pg-service, .pg-attendance, .pg-performance, .pg-finance, .pg-costs, .pg-quality, .pg-stock, .pg-customers, .pg-chat, .pg-admin, .pg-reports) .page-head h1 { grid-column: 1; grid-row: 1; min-height: 2.75rem; display: flex; align-items: center; margin: 0; }
  :is(.pg-fleet, .pg-service, .pg-attendance, .pg-performance, .pg-finance, .pg-costs, .pg-quality, .pg-stock, .pg-customers, .pg-chat, .pg-admin, .pg-reports) .page-head > :first-child > :not(h1) { grid-column: 1 / -1; }
  :is(.pg-fleet, .pg-service, .pg-attendance, .pg-performance, .pg-finance, .pg-costs, .pg-quality, .pg-stock, .pg-customers, .pg-chat, .pg-admin, .pg-reports) .page-head-actions { grid-column: 2; grid-row: 1; justify-content: flex-end; }
}

/* ---------- Layout ---------- */
.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) calc(4rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* nothing inside can widen the page past the window (a larger text size) */
  gap: 1rem;
}
@media (min-width: 640px) { .page { padding: 1.5rem max(1.5rem, env(safe-area-inset-right, 0px)) calc(4rem + env(safe-area-inset-bottom, 0px)) max(1.5rem, env(safe-area-inset-left, 0px)); gap: 1.5rem; } }
.wrap { max-width: 72rem; margin: 0 auto; padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) 3rem max(1rem, env(safe-area-inset-left, 0px)); display: grid; gap: 1rem; }
@media (min-width: 640px) { .wrap { padding: 1.5rem max(1.5rem, env(safe-area-inset-right, 0px)) 3rem max(1.5rem, env(safe-area-inset-left, 0px)); gap: 1.5rem; } }
main:focus { outline: none; }
/* the content arrives with a short fade, nothing rises or staggers */
@keyframes ie-fade { from { opacity: 0; } to { opacity: 1; } }
main { animation: ie-fade 150ms ease-out backwards; }   /* backwards: no lasting stacking context on main */

/* ---------- Brand: the logo of the public pages' bar and the sign-in card (the bar itself: shell.css) ---------- */
.brand-link { display: inline-flex; align-items: center; border-radius: 0.25rem; min-width: 0; }
.brand-link:focus-visible { outline-offset: 4px; }
.logo { height: 1.75rem; width: auto; max-width: min(100%, 14rem); }
@media (min-width: 640px) { .logo { height: 2.125rem; max-width: 18rem; } }
.logo-light { display: block; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}

/* ---------- Buttons ----------
   Flat (no shadow), a 1px --line-strong edge on --panel, 8px corners. 36px with a mouse, 40px on touch; .btn-sm 32/36,
   .btn-xs 28/32 (inside tables). Feedback on pointer-down: scale .97 at once. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--h-btn);
  padding: 0 0.875rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--field-bg);   /* white in light, a faint lift over any surface in dark */
  color: var(--fg);
  font-size: var(--fs-btn);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  transition: transform 120ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); transition-duration: 0s; }
.btn:focus-visible { box-shadow: var(--focus-ring); }   /* .btn's box-shadow:none must not hide the ring */
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
/* the primary button: the same flat button, dark (light in dark mode), no edge */
.btn-primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn.danger, .btn.danger-text, .btn-danger { color: var(--bad-fg); }
/* a destructive primary (the confirm button of "Fshi …"): red fill */
.btn-primary.danger, .btn.primary.danger, .btn.ie-btn-danger { background: var(--danger); border-color: var(--danger); color: var(--danger-fg); }
@media (hover: hover) and (pointer: fine) { .btn-primary.danger:not(:disabled):hover, .btn.primary.danger:not(:disabled):hover, .btn.ie-btn-danger:not(:disabled):hover { background: var(--danger-hover); border-color: var(--danger-hover); color: var(--danger-fg); } }
.btn-sm { min-height: var(--h-btn-sm); padding: 0 0.75rem; font-size: var(--fs-btn-sm); }
.btn-xs { min-height: var(--h-btn-xs); padding: 0 0.625rem; font-size: var(--fs-btn-sm); gap: 0.375rem; border-radius: var(--radius-xs); }
.btn-xs svg { width: 0.875rem; height: 0.875rem; }
/* icon buttons are square */
.btn-icon, .btn.icon-only { width: var(--h-btn); min-width: var(--h-btn); height: var(--h-btn); min-height: var(--h-btn); padding: 0; }
.btn-sm.btn-icon, .btn-sm.icon-only { width: var(--h-btn-sm); min-width: var(--h-btn-sm); height: var(--h-btn-sm); min-height: var(--h-btn-sm); }
.btn-xs.btn-icon, .btn-xs.icon-only { width: var(--h-btn-xs); min-width: var(--h-btn-xs); height: var(--h-btn-xs); min-height: var(--h-btn-xs); }
.btn.wide, .btn-wide { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background: var(--panel-2); }
  .btn-primary:hover:not(:disabled), .btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
  .btn-primary.danger:hover:not(:disabled), .btn.primary.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad-fg) 88%, var(--fg)); border-color: transparent; }
  .btn-ghost:hover:not(:disabled) { border-color: transparent; }
}
.btn[aria-pressed="true"], .btn[aria-checked="true"] { background: var(--panel-2); border-color: var(--line-strong); }

.switch .on, .switch .off { display: none; }
.switch[aria-checked="true"] .on { display: inline; }
.switch[aria-checked="false"] .off { display: inline; }
.switch .sun { display: block; }
.switch .moon { display: none; }
.switch[aria-checked="true"] .sun { display: none; }
.switch[aria-checked="true"] .moon { display: block; }

.avatar {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--fg);
  font-size: var(--fs-badge);
  font-weight: 600;
}

/* Segmented control, iOS style: a --panel-2 track, 2px inset, the chosen segment raised on --panel.
   .seg with .seg-btn; the older button groups (.tr-seg, .rp-presets) look the same. */
.seg, .tr-seg[role="group"], .rp-presets[role="group"] {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 2px;
  max-width: 100%;
  padding: 2px;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--panel-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar, .tr-seg::-webkit-scrollbar, .rp-presets::-webkit-scrollbar { display: none; }
/* a long group of choices on a phone wraps inside its track instead of hiding its last choices */
@media (max-width: 639px) { .tr-seg[role="group"], .rp-presets[role="group"] { flex-wrap: wrap; overflow: visible; } }
.seg-btn, :is(.tr-seg, .rp-presets)[role="group"] > .btn {
  flex: 0 0 auto;
  min-width: 2rem;
  min-height: calc(var(--h-toolbar) - 4px);
  padding: 0 0.75rem;
  border: 0;
  border-radius: calc(var(--radius-s) - 2px);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-btn-sm);
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 120ms var(--ease-out);
}
.seg-btn[aria-pressed="true"], .seg-btn[aria-checked="true"], .seg-btn[aria-selected="true"], .seg-btn[aria-current],
:is(.tr-seg, .rp-presets)[role="group"] > .btn[aria-pressed="true"] {
  background: var(--seg-on);
  color: var(--fg);
  border-color: transparent;
  box-shadow: var(--shadow-1), 0 0 0 1px var(--ring);
}
/* touch screens: a 44px track (40px segments in the 2px inset) */
@media (pointer: coarse) { .seg-btn, :is(.tr-seg, .rp-presets)[role="group"] > .btn { min-height: calc(2.75rem - 4px); } }
.seg-btn:active:not(:disabled) { transform: scale(0.96); transition-duration: 0s; }
.seg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.seg-btn:focus-visible, :is(.tr-seg, .rp-presets)[role="group"] > .btn:focus-visible { box-shadow: var(--focus-ring-inset); }
.seg-btn svg { width: 1rem; height: 1rem; }
.seg output { display: none; align-items: center; justify-content: center; min-width: 3.25rem; padding: 0 0.25rem; font-size: var(--fs-btn-sm); font-weight: 500; color: var(--fg); }
@media (min-width: 640px) { .seg output { display: inline-flex; } }
.seg.daynav output { display: inline-flex; }   /* the day stepper always says which day is shown */
/* dark, on a raised surface (a dialog, a sheet, the floating panels) the --panel-2 track would vanish into --raised:
   the canvas under it and a hairline instead */
:root[data-theme="dark"] :is(dialog, .float-panel) .seg { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(dialog, .float-panel) .seg { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); } }
.ts-small { font-size: var(--fs-meta); }
.ts-big { font-size: var(--fs-dialog); }
@media (hover: hover) and (pointer: fine) {
  .seg-btn:not([aria-pressed="true"]):not(:disabled):hover,
  :is(.tr-seg, .rp-presets)[role="group"] > .btn:not([aria-pressed="true"]):hover { background: transparent; color: var(--fg); }
}

/* Chips: pill choices and filters. Chosen = a quiet tint with an --fg edge, never the primary's black. */
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: var(--h-btn-sm);
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--field-bg);
  color: var(--text-2);
  font-size: var(--fs-btn-sm);
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  transition: transform 120ms var(--ease-out), background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
span.chip { min-height: 1.5rem; padding: 0 0.5rem; font-size: var(--fs-badge); border-color: var(--line); }   /* a chip that is only a label */
button.chip:active { transform: scale(0.96); transition-duration: 0s; }
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--fg) 6%, var(--panel)); color: var(--fg); border-color: var(--fg); }
.chip .count, .chip-count { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { button.chip:hover { background: var(--panel-2); color: var(--fg); } button.chip[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--fg) 9%, var(--panel)); } }

/* ---------- Cards ----------
   --panel with a 1px --ring, 12px corners, no shadow; 20px 24px inside on a desk, 16px on a phone. */
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  padding: 1rem;
  min-width: 0;
}
@media (min-width: 640px) { .card, .panel { padding: 1.25rem 1.5rem; } }
.card-head, .panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem 1rem;
  margin-bottom: 1rem;
  min-width: 0;
}
/* a card's (or a section's) title; an h2.eyebrow there is a section title too, in sentence case */
.card-head h2, .panel-head h2, .panel-title, .card-head .eyebrow, .panel-head .eyebrow {
  font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 600; letter-spacing: var(--ls-section); color: var(--fg); text-transform: none;
}
.panel-title { margin-bottom: 1rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; min-width: 0; }

/* An empty, loading or failed list: one calm sentence, a muted second line, the next action. Replaces the table or
   list (never a row inside it). .is-error for a failure ("Provo sërish"); role="status" while loading. */
.empty-state { display: grid; justify-items: center; align-content: center; gap: var(--s-2); min-height: 9rem; padding: var(--s-7) var(--s-4); text-align: center; }
.empty-state > svg, .empty-state > .ie-icon { width: 1.5rem; height: 1.5rem; margin-bottom: var(--s-1); color: var(--muted); }
.empty-state > b, .empty-state > strong, .empty-state > h3 { margin: 0; font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 500; letter-spacing: var(--ls-section); color: var(--fg); text-wrap: balance; }
.empty-state > p { margin: 0; max-width: 40ch; font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--muted); text-wrap: pretty; }
.empty-state > .btn, .empty-state > .empty-actions { margin-top: var(--s-2); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
.empty-state.is-error > svg, .empty-state.is-error > .ie-icon { color: var(--bad-fg); }

/* ---------- Toolbar: one row of filters, every control the same height, no labels above them ----------
   <div class="toolbar"> search (.search-input or .search-field), selects whose first option says "Kategoria: Të
   gjitha", .check-inline toggles or filter chips, then buttons. It wraps on a phone and the search grows.
   The older .att-filters rows (labels above) line their controls up at the bottom. */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-width: 0; }
.att-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; margin-bottom: 0.75rem; min-width: 0; }
.att-filters .field { min-width: 9rem; }
.toolbar > .search-input, .toolbar > .search-field, .toolbar > input[type="search"], .toolbar > .grow, .att-filters > .it-search { flex: 1 1 14rem; max-width: 24rem; }
.toolbar > .search-field > input, .toolbar > input[type="search"], .toolbar > .search-input, .att-filters > .it-search input { width: 100%; }
:is(.toolbar, .card-actions, .att-filters) :is(.btn:not(.btn-icon):not(.icon-only):not(.btn-xs), button.chip, .search-input, select, input:not([type="checkbox"]):not([type="radio"])) { min-height: var(--h-toolbar); }
:is(.toolbar, .card-actions, .att-filters) :is(.check-inline, .option-row) { min-height: var(--h-toolbar); }
@media (pointer: fine) {
  :is(.toolbar, .card-actions, .att-filters) :is(.search-input, select, input:not([type="checkbox"]):not([type="radio"])) { font-size: var(--fs-btn-sm); padding-top: 0.25rem; padding-bottom: 0.25rem; }
  :is(.toolbar, .card-actions, .att-filters) :is(.btn:not(.btn-icon):not(.icon-only):not(.btn-xs)) { font-size: var(--fs-btn-sm); padding-inline: 0.75rem; }
}

/* ---------- Forms ---------- */
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 0.75rem;
  align-items: end;   /* a label that wraps does not push its field below the neighbour's */
}
@media (min-width: 640px) { .fields { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; } }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.75rem; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; } }
.field { display: grid; gap: 0.375rem; min-width: 0; align-content: start; }
.fields > .field:has(> .hint, > .err) { align-self: start; }
.field-wide, .field.wide { grid-column: 1 / -1; }
@media (min-width: 640px) { .field-wide, .field.wide { grid-column: span 2; } }
.field label, .field > .label { font-size: var(--fs-label); font-weight: 500; line-height: var(--lh-label); color: var(--fg); }
.field label .unit, .field label small { color: var(--muted); font-weight: 400; font-size: var(--fs-label); }   /* long hints wrap: a hint wider than its column ran under the next field on phones */

/* every text field and select looks the same: 36px with a mouse, 44px on touch, a 1px --line-strong edge on --panel,
   no shadow; focus = an --fg edge and a soft 3px ring. Radios and checkboxes stay native (below). */
.field input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="hidden"])),
.field select, .field textarea, .input, .select, .textarea, .search-input, input[type="search"], .dash-tools input[type="date"],
.pf-flagform input, .pf-box textarea, .pace-fit input[type="time"], .time24 select, .fi-lines input,
.ins-resolve input, .qu-mpa, .gps-link select, .sp-compose textarea, .suggest-pref input {
  min-height: var(--h-input);
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background-color: var(--field-bg);
  color: var(--fg);
  font-weight: 400;
  line-height: 1.4;
  min-width: 0;
  box-shadow: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.field input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="hidden"])), .field select, .field textarea, .input, .select, .textarea { width: 100%; }
.field textarea, .textarea, .pf-box textarea, .sp-compose textarea { min-height: 6rem; padding: 0.5rem 0.75rem; line-height: 1.5; resize: vertical; }
/* the chevron of a select, drawn in --muted */
.field select, .select, select.input, select.search-input, .time24 select, .gps-link select, td .cell-select {
  background-image: var(--icon-chevron);
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  background-size: 1rem 1rem;
  padding-right: 2rem;
  cursor: pointer;
}
/* a search field: a 16px magnifier at the start; the browser's own clear button in the platform's grey */
input[type="search"], input.search-input, .search-field > input {
  background-image: var(--icon-search);
  background-repeat: no-repeat;
  background-position: 0.6875rem center;
  background-size: 1rem 1rem;
  padding-left: 2.125rem;
}
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 1rem; height: 1rem; margin-left: 0.25rem; background: var(--icon-clear) center / 0.875rem no-repeat; cursor: pointer; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
.search-input { width: 18rem; max-width: 100%; }
.search-field { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.search-field > input { width: 100%; }
.search-field > .search-clear { position: absolute; right: 0.25rem; width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--muted); }
.search-field > .search-clear svg { width: 0.875rem; height: 0.875rem; }
::placeholder { color: var(--faint); opacity: 1; font-weight: 400; }
.field input:where(:not([type="checkbox"], [type="radio"])):focus-visible, .field select:focus-visible, .field textarea:focus-visible,
.input:focus-visible, .select:focus-visible, .textarea:focus-visible, .search-input:focus-visible, input[type="search"]:focus-visible, .dash-tools input:focus-visible, .pf-flagform input:focus-visible,
.pf-box textarea:focus-visible, .pace-fit input:focus-visible, .time24 select:focus-visible, .fi-lines input:focus-visible, .ins-resolve input:focus-visible,
.qu-mpa:focus-visible, .gps-link select:focus-visible, .sp-compose textarea:focus-visible, .suggest-pref input:focus-visible {
  border-color: var(--fg); outline: 2px solid transparent; outline-offset: 0; box-shadow: var(--input-ring);
}
@media (hover: hover) and (pointer: fine) {
  .field input:where(:not([type="checkbox"], [type="radio"])):hover:not(:focus):not(:disabled), .field select:hover:not(:focus):not(:disabled), .field textarea:hover:not(:focus),
  .input:hover:not(:focus), .search-input:hover:not(:focus), input[type="search"]:hover:not(:focus) { border-color: color-mix(in srgb, var(--fg) 24%, var(--panel)); }
}
.field input:disabled, .field select:disabled, .field textarea:disabled, .input:disabled { background-color: var(--panel-2); color: var(--muted); cursor: not-allowed; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"], .input[aria-invalid="true"] { border-color: var(--bad-fg); }
.field input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad-fg) 16%, transparent); }
.err { color: var(--bad-fg); font-size: var(--fs-meta); font-weight: 500; line-height: var(--lh-meta); }

/* radios and checkboxes: native, 18px, in the text colour; never the text-field look (also inside a .field) */
input[type="checkbox"], input[type="radio"] {
  width: 1.125rem; height: 1.125rem; min-height: 0; margin: 0; padding: 0; flex: 0 0 auto;
  -webkit-appearance: auto; appearance: auto; accent-color: var(--fg); box-shadow: none; cursor: pointer;
}
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { box-shadow: var(--focus-ring); }
.field:has(> .check-inline, > label > input[type="radio"], > label > input[type="checkbox"]) { align-content: start; }

/* Number steppers */
.stepper {
  display: flex;
  align-items: stretch;
  min-height: var(--h-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--field-bg);
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.stepper:focus-within { border-color: var(--fg); box-shadow: var(--input-ring); }
.field .stepper input, .stepper input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field .stepper input:focus-visible, .stepper input:focus-visible { outline: none; box-shadow: none; border: 0; }
.stepper button {
  flex: 0 0 2.5rem;
  border: 0;
  background: transparent;
  color: var(--text-2);
  display: grid;
  place-items: center;
  transition: background-color 120ms ease;
}
.stepper button svg { width: 1rem; height: 1rem; }
.stepper button:active { background: var(--panel-2); transition-duration: 0s; }
.stepper button:focus-visible { box-shadow: var(--focus-ring-inset); }
.stepper .inc { border-left: 1px solid var(--line); }
.stepper .dec { border-right: 1px solid var(--line); }
@media (hover: hover) and (pointer: fine) { .stepper button:hover { background: var(--panel-2); color: var(--fg); } }

fieldset { border: 0; padding: 0; margin: 1.25rem 0 0; min-width: 0; }
fieldset:first-child { margin-top: 0; }
legend { padding: 0; margin-bottom: 0.5rem; font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--fg); }
.note { color: var(--muted); font-size: var(--fs-meta); margin-top: 1rem; line-height: var(--lh-meta); }
.form-status, .auth-error {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-s);
  background: var(--bad-bg);
  border: 1px solid color-mix(in srgb, var(--bad-fg) 20%, transparent);
  color: var(--bad-fg);
  font-weight: 500;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.form-status { margin-top: 1rem; }

/* Autocomplete: a popover under its field, on the raised surface */
.ac-wrap { position: relative; }
.ac {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 0.375rem);
  z-index: var(--z-popover);
  background: var(--raised);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  max-height: 16rem;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.25rem;
  transform-origin: top left;
  transition: opacity 100ms ease, transform 100ms ease, display 100ms allow-discrete;
}
.ac:not([hidden]) { transition-duration: 150ms; transition-timing-function: var(--ease-out); @starting-style { opacity: 0; transform: scale(0.96); } }
.ac[hidden] { opacity: 0; transform: scale(0.96); }
.ac [role="option"] {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.625rem;
  border: 0;
  border-radius: calc(var(--radius) - 0.25rem);
  background: transparent;
  color: var(--fg);
  text-align: left;
  font-size: var(--fs-body);
  line-height: 1.35;
}
@media (pointer: coarse) { .ac [role="option"] { min-height: 2.75rem; } }
.ac [role="option"] svg { width: 1rem; height: 1rem; flex: 0 0 auto; color: var(--muted); }
.ac [role="option"][aria-selected="true"], .ac [role="option"]:focus-visible { background: var(--panel-2); outline: none; box-shadow: none; }
.ac .ac-empty { padding: 0.75rem; color: var(--muted); font-size: var(--fs-meta); }
@media (prefers-reduced-motion: reduce) { .ac, .ac:not([hidden]), .ac[hidden] { transform: none; @starting-style { transform: none; } } }

/* Route card */
.route-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 1rem; }
.route-actions .hint { flex: 1 1 14rem; }
.route-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
@media (min-width: 640px) { .route-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: transparent; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.75rem 0.875rem; min-width: 0; }
.stat .v { font-size: var(--fs-dialog); font-weight: 600; letter-spacing: var(--ls-dialog); margin-top: 0.125rem; font-variant-numeric: tabular-nums; }
.stat .s { font-size: var(--fs-meta); color: var(--muted); margin-top: 0.125rem; }
.map { height: 16rem; margin-top: 1rem; border-radius: var(--radius-s); border: 1px solid var(--line); overflow: hidden; background: var(--panel-2); isolation: isolate; }
@media (min-width: 640px) { .map { height: 20rem; } }
.map .leaflet-control-attribution { font-size: var(--fs-micro); }
.route-applied { margin-top: 0.75rem; }

/* ---------- KPIs ----------
   Neutral tiles (no accent fill, no wide tile): a .8125rem label, a 1.75rem value that shrinks in a narrow tile instead
   of breaking inside the number, an optional sub-line. Colour only when the number carries a state (.kpi-bad: red
   value + dot). A unit after the value: <span class="unit">lekë</span>. */
.sum, .kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 640px) { .sum, .kpis { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; } }
/* more than five numbers: even rows on a desk, 3 + 3 or 4 + 3 (a page should show four; the rest under "Më shumë") */
@media (min-width: 900px) {
  .sum:has(> :nth-child(6):last-child), .kpis:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sum:has(> :nth-child(7)), .kpis:has(> :nth-child(7)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.kpi {
  container-type: inline-size;
  display: grid;
  align-content: start;
  gap: 0.25rem;
  background: var(--panel);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  min-width: 0;
}
@media (max-width: 639px) { .kpi { padding: 0.875rem 1rem; } }
.kpi .label { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.kpi .v {
  font-size: clamp(1.375rem, 16cqi, var(--fs-kpi));
  font-weight: 600;
  line-height: var(--lh-kpi);
  letter-spacing: var(--ls-kpi);
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  overflow-wrap: normal;
  word-break: normal;
}
.kpi .v :is(.unit, .of, small) { font-size: var(--fs-meta); font-weight: 500; letter-spacing: 0; color: var(--muted); }
.kpi.main { grid-column: auto; background: var(--panel); border-color: var(--ring); }
.kpi.main .v { font-size: clamp(1.375rem, 18cqi, 2rem); color: var(--fg); }
.kpi .s { font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--muted); }
.kpi .proc-bar, .kpi .dp-bar { margin-top: 0.375rem; }
sup.day { font-size: 0.5em; font-weight: 600; color: var(--muted); margin-left: 0.125em; vertical-align: super; }
.chip.ok, .chip.bad {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  width: fit-content;
  margin-top: 0.375rem;
  min-height: 0;
  font-size: var(--fs-badge);
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  line-height: var(--lh-badge);
  border: 0;
}
.chip.ok::before, .chip.bad::before { content: ''; width: 0.375rem; height: 0.375rem; border-radius: 999px; background: currentColor; flex: 0 0 auto; }
.chip.ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip.bad { background: var(--bad-bg); color: var(--bad-fg); }

/* ---------- Legend + Gantt ---------- */
.legend { list-style: none; margin: 0 0 0.875rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.375rem 1rem; font-size: var(--fs-meta); color: var(--muted); }
.legend i { display: inline-block; width: 0.625rem; height: 0.625rem; border-radius: 2px; vertical-align: -1px; margin-right: 0.375rem; }
.sw-setup { background: var(--setup); } .sw-load { background: var(--load); } .sw-go { background: var(--go); }
.sw-wait { background: var(--wait); } .sw-pour { background: var(--pour); } .sw-back { background: var(--back); }

.chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--panel);
}
.gantt { position: relative; display: inline-block; min-width: 100%; --labelw: 7rem; }
.gantt-row { display: flex; height: 2.375rem; }
.gantt-row.axis { height: 1.75rem; }
.gantt-label {
  position: sticky; left: 0; z-index: 2;
  flex: 0 0 var(--labelw); width: var(--labelw);
  display: flex; align-items: center;
  padding: 0 0.625rem;
  font-size: var(--fs-meta); font-weight: 500;
  background: var(--panel);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gantt-row:last-child .gantt-label, .gantt-row:last-child .gantt-track { border-bottom: 0; }
.gantt-track {
  position: relative; flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to right, var(--line-strong) 1px, transparent 1px), linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-repeat: repeat-x;
}
.axis .gantt-track { background-image: none; }
.tick { position: absolute; top: 0.3rem; transform: translateX(-50%); font-size: var(--fs-micro); font-weight: 500; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar {
  position: absolute; top: 0.4375rem; height: calc(100% - 0.875rem);
  border: 0; border-radius: 4px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-micro); font-weight: 600; color: var(--bar-text);
  overflow: hidden; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.bar:focus-visible, .bar.selected { outline: 2px solid var(--fg); outline-offset: 1px; box-shadow: none; z-index: 1; }
.bar-setup { background: var(--setup); } .bar-load { background: var(--load); } .bar-go { background: var(--go); }
.bar-wait { background: var(--wait); } .bar-pour { background: var(--pour); } .bar-back { background: var(--back); }
/* the closing line in --fg, the "now" line in the accent (the accent's job on a timeline) */
.vline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed color-mix(in srgb, var(--fg) 55%, transparent); z-index: 1; pointer-events: none; }
.vline.now { border-left: 2px solid var(--accent); }
.vline span { position: absolute; top: 0.125rem; left: 0.25rem; font-size: var(--fs-micro); font-weight: 600; padding: 0 0.3rem; border-radius: 3px; background: var(--fg); color: var(--bg); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vline.now span { background: var(--accent); color: var(--accent-fg); }
.chart-detail { margin-top: 0.75rem; font-size: var(--fs-meta); min-height: 1.5em; color: var(--muted); }
.chart-detail b { color: var(--fg); font-weight: 600; }
.zoom { display: inline-flex; }

/* ---------- Tables ----------
   One table for the whole platform: sentence-case heads (.75rem 500 --muted) on no fill with a hairline under them,
   cells .875rem with 44px rows, numbers right-aligned (td.num), the actions column right-aligned (td.actions,
   .actions-cell, .cell-actions, .dp-act), a clickable row (tr[data-href], tr.row-link) with a pointer and a focus ring.
   Controls inside a table: .8125rem at 28px (32px on touch). On a phone every row becomes a card (below). */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; }   /* relative: hidden labels inside a wide table stay in its scroll box */
table { border-collapse: collapse; width: 100%; font-size: var(--fs-cell); line-height: var(--lh-cell); }
th, td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
th { padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: var(--fs-head); line-height: var(--lh-head); font-weight: 500; letter-spacing: var(--ls-head); text-transform: none; color: var(--muted); background: transparent; }
tbody td { height: 2.75rem; }
tbody tr:last-child > td { border-bottom: 0; }
@media (hover: hover) and (pointer: fine) { tbody tr:hover > td { background: color-mix(in srgb, var(--panel-2) 50%, transparent); } }
th.num, td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* the actions column hugs its buttons (1%); min-width keeps that from collapsing the cell when a page lays its rows out
   as a grid or a flex row (the 1% would then be of the row): in a table row it changes nothing */
th:is(.actions, .actions-cell, .cell-actions, .dp-act), td:is(.actions, .actions-cell, .cell-actions, .dp-act) { text-align: right; white-space: nowrap; width: 1%; min-width: fit-content; }
td:is(.actions, .actions-cell, .dp-act) .row-actions { justify-content: flex-end; }
tr[data-href], tr.row-link { cursor: pointer; }
tr[data-href]:focus-visible, tr.row-link:focus-visible { outline: 2px solid color-mix(in srgb, var(--fg) 35%, transparent); outline-offset: -2px; box-shadow: none; }
td .btn:not(.btn-icon):not(.icon-only) { min-height: var(--h-btn-xs); padding: 0 0.625rem; font-size: var(--fs-btn-sm); border-radius: var(--radius-xs); }
td.dep { font-weight: 600; }
td .w { color: var(--bad-fg); font-weight: 600; }
td small, td .small, td .muted.small { font-size: var(--fs-meta); }
@media (min-width: 640px) and (max-width: 1023px) { th, td { padding-left: 0.5rem; padding-right: 0.5rem; } }

/* Phones: one card per row. Two columns of label-over-value; the row's title (td.head) spans the card without a
   label; wide cells (.wrap-ok) and the actions span a row of their own; an empty value shows "–". A table that
   needs another phone layout opts out with .table-custom-phone. */
@media (max-width: 639px) {
  table:not(.table-custom-phone), table:not(.table-custom-phone) > tbody { display: block; }
  table:not(.table-custom-phone) > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table:not(.table-custom-phone) > tbody { display: grid; gap: 0.5rem; }
  table:not(.table-custom-phone) > tbody > tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem 1rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    min-width: 0;
  }
  table:not(.table-custom-phone) > tbody > tr > td {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 2px;
    min-width: 0;
    max-width: none;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  table:not(.table-custom-phone) > tbody > tr > td::before {
    content: attr(data-label);
    font-size: var(--fs-micro);
    line-height: 1.3;
    font-weight: 500;
    letter-spacing: 0.005em;
    text-transform: none;
    color: var(--muted);
    font-family: inherit;
  }
  table:not(.table-custom-phone) > tbody > tr > td:is(.head, [data-label=""], :not([data-label]))::before { content: none; }
  table:not(.table-custom-phone) > tbody > tr > td.head {
    order: -1;   /* the card's title first, whatever column it was on a desk */
    grid-column: 1 / -1;
    font-size: var(--fs-section);
    line-height: var(--lh-section);
    font-weight: 600;
    letter-spacing: var(--ls-section);
  }
  table:not(.table-custom-phone) > tbody > tr > td:is(.it-cell, .removed-cell, .span-2) { grid-column: 1 / -1; }
  table:not(.table-custom-phone) > tbody > tr > td:is(.actions, .actions-cell, .cell-actions, .dp-act, [data-label="Veprime"]) {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    white-space: normal;
  }
  table:not(.table-custom-phone) > tbody > tr > td:is(.actions, .actions-cell, .cell-actions, .dp-act, [data-label="Veprime"])::before { content: none; }
  table:not(.table-custom-phone) > tbody > tr > td:empty::after { content: "–"; color: var(--faint); }
  table:not(.table-custom-phone) > tbody > tr > td:is([data-label=""], :not([data-label])):empty { display: none; }
  table:not(.table-custom-phone) > tbody > tr > td .row-actions { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- Dock (floating actions) ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: calc(0.875rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: var(--z-sticky);
  display: flex;
  align-items: stretch;
  max-width: calc(100vw - 1.5rem);
  background: var(--raised);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
@media (min-width: 900px) { .dock { left: auto; right: 1.5rem; transform: none; } }
.dock button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: var(--fs-btn-sm);
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.dock button + button { border-left: 1px solid var(--line); }
.dock button svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.dock button:active { transform: scale(0.97); transition-duration: 0s; }
.dock button:focus-visible { box-shadow: var(--focus-ring-inset); }
@media (hover: hover) and (pointer: fine) { .dock button:hover { background: var(--panel-2); } }
@media (max-width: 359px) { .dock button span { display: none; } }

/* ---------- Popover menu: from its trigger's corner, 150ms in, 100ms out ---------- */
.usermenu { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.375rem);
  min-width: 15rem;
  background: var(--raised);
  border: 0;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-pop);
  padding: 0.375rem;
  z-index: var(--z-popover);
  display: grid;
  transform-origin: top right;
  transition: opacity 100ms ease, transform 100ms ease, display 100ms allow-discrete;
}
.menu:not([hidden]) {
  transition-duration: 150ms;
  transition-timing-function: var(--ease-out);
  @starting-style { opacity: 0; transform: scale(0.96); }
}
.menu[hidden] { opacity: 0; transform: scale(0.96); }
.menu-head { padding: 0.5rem 0.625rem 0.625rem; border-bottom: 1px solid var(--line); margin-bottom: 0.25rem; display: grid; gap: 0.125rem; }
.menu-head b { font-weight: 600; font-size: var(--fs-body); }
.menu-head span { font-size: var(--fs-meta); color: var(--muted); overflow-wrap: anywhere; }
.menu [role="menuitem"] {
  display: flex; align-items: center; gap: 0.625rem;
  width: 100%; text-align: left;
  background: none; border: 0;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-s);
  font: inherit; font-size: var(--fs-body); font-weight: 500;
  color: inherit; text-decoration: none;
  cursor: pointer; min-height: 2.25rem;
  transition: background-color 120ms ease;
}
@media (pointer: coarse) { .menu [role="menuitem"] { min-height: 2.75rem; } }
.menu [role="menuitem"] svg { width: 1rem; height: 1rem; color: var(--muted); }
.menu [role="menuitem"]:active { background: var(--panel-2); }
.menu [role="menuitem"]:focus-visible { background: var(--panel-2); outline: none; box-shadow: none; }
.menu .danger { color: var(--bad-fg); }
.menu .danger svg { color: inherit; }
@media (hover: hover) and (pointer: fine) { .menu [role="menuitem"]:hover { background: var(--panel-2); } }

/* ---------- Dialogs and sheets ----------
   dialog.dlg (a question, a confirmation): centred from 768px, 28rem, 24px inside, 16px corners, on the raised surface
   with the modal shadow; a bottom sheet on a phone. dialog.sheet (a form, a record): a 30rem side panel from 768px that
   slides in from the right and leaves the same way (300ms in, 200ms out); a bottom sheet on a phone. Both sit in the
   top layer (showModal), above a dimmed, slightly blurred page. Less motion: they only fade. */
dialog.sheet, dialog.dlg {
  border: 0;
  background: var(--raised);
  color: var(--fg);
  padding: 0;
  margin: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  position: fixed;
  inset: auto 0 0 0;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: var(--shadow-modal);
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform 200ms var(--ease-drawer), opacity 200ms ease, overlay 200ms allow-discrete, display 200ms allow-discrete;
}
dialog.sheet[open], dialog.dlg[open] {
  transform: none;
  opacity: 1;
  transition-duration: 300ms, 200ms, 300ms, 300ms;
  @starting-style { transform: translateY(100%); }
}
dialog.sheet::backdrop, dialog.dlg::backdrop {
  background: var(--backdrop);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 200ms ease, overlay 200ms allow-discrete, display 200ms allow-discrete;
}
dialog.sheet[open]::backdrop, dialog.dlg[open]::backdrop { opacity: 1; @starting-style { opacity: 0; } }
/* a dialog carries its own padding (its title, its form, its actions straight inside) */
dialog.dlg { padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); max-height: 92dvh; overflow: auto; }
dialog.dlg[open] { display: grid; gap: 1rem; align-content: start; }
dialog.dlg > .sheet-inner { padding: 0; max-height: none; overflow: visible; }
.sheet-inner {
  --sheet-pad-top: 0.75rem;
  max-height: 88dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: var(--sheet-pad-top) 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 1rem;
}
.sheet-handle { width: 2.25rem; height: 0.3125rem; border-radius: 999px; background: var(--line-strong); margin: 0 auto 0.25rem; }
dialog.sheet h2, dialog.dlg h2 { font-size: var(--fs-dialog); line-height: var(--lh-dialog); font-weight: 600; letter-spacing: var(--ls-dialog); }
dialog.dlg > h2:first-child { padding-right: 2rem; }
@media (min-width: 768px) {
  dialog.sheet {
    inset: 0 0 0 auto;
    margin: 0;
    width: min(92vw, 30rem);
    height: 100dvh;
    border-radius: 0;
    transform: translateX(100%);
  }
  dialog.sheet[open] { transform: none; @starting-style { transform: translateX(100%); } }
  dialog.sheet .sheet-inner { --sheet-pad-top: 1.5rem; max-height: 100dvh; height: 100%; padding: var(--sheet-pad-top) 1.5rem 1.5rem; align-content: start; }
  dialog.sheet.pf-sheet { width: min(96vw, 48rem); }
  dialog.dlg {
    inset: 0;
    margin: auto;
    width: min(92vw, 28rem);
    max-height: 85dvh;
    padding: 1.5rem;
    border-radius: var(--radius-l);
    transform: scale(0.96);
    opacity: 0;
    transition: transform 150ms var(--ease-out), opacity 150ms ease, overlay 150ms allow-discrete, display 150ms allow-discrete;
  }
  dialog.dlg[open] { transform: none; opacity: 1; transition-duration: 200ms; @starting-style { transform: scale(0.96); opacity: 0; } }
  .sheet-handle { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.sheet, dialog.dlg, dialog.sheet[open], dialog.dlg[open] { transform: none; transition-property: opacity, overlay, display; }
  dialog.sheet:not([open]), dialog.dlg:not([open]) { opacity: 0; }
  dialog.sheet[open], dialog.dlg[open] { @starting-style { transform: none; opacity: 0; } }
  .menu, .menu:not([hidden]), .menu[hidden] { transform: none; @starting-style { transform: none; } }
}
dialog form { display: grid; gap: 1rem; }
.dlg-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.dlg-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .dlg-actions .btn { flex: 0 0 auto; } }
/* a sheet's actions stay at its foot while its content scrolls ("Anulo · Ruaj ndryshimet"): .sheet-foot, last in .sheet-inner */
.sheet-inner:has(> .sheet-foot) { display: flex; flex-direction: column; }
.sheet-inner:has(> .sheet-foot) > * { flex: 0 0 auto; }
.sheet-inner > .sheet-foot {
  --sheet-pad-x: 1.25rem; --sheet-pad-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  position: sticky; bottom: calc(-1 * var(--sheet-pad-bottom)); z-index: 2;
  margin: auto calc(-1 * var(--sheet-pad-x)) calc(-1 * var(--sheet-pad-bottom));
  padding: 0.75rem var(--sheet-pad-x) var(--sheet-pad-bottom);
  display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  background: var(--raised); box-shadow: 0 -1px 0 var(--line);
}
.sheet-inner > .sheet-foot .btn { flex: 1 1 auto; }
@media (min-width: 640px) { .sheet-inner > .sheet-foot .btn { flex: 0 0 auto; } }
@media (min-width: 768px) { dialog.sheet .sheet-inner > .sheet-foot { --sheet-pad-x: 1.5rem; --sheet-pad-bottom: 1.5rem; } }
/* a choice in a list (settings, the kind of a problem, the cookie preferences): a plain row with a hairline between
   rows, never a grey box. In a filter row it is an inline toggle. */
.option-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.625rem 0; border: 0; border-radius: 0; background: none; font-size: var(--fs-body); line-height: 1.45; cursor: pointer; min-width: 0; }
.option-row + .option-row { border-top: 1px solid var(--line); }
.option-row input[type="checkbox"], .option-row input[type="radio"] { margin-top: 0.0625rem; }
.option-row span small { display: block; color: var(--muted); font-size: var(--fs-meta); line-height: var(--lh-meta); margin-top: 0.125rem; }
:is(.toolbar, .att-filters, .card-actions, .card-head) .option-row { align-items: center; gap: 0.5rem; padding: 0; border: 0; font-size: var(--fs-meta); color: var(--text-2); white-space: nowrap; }
:is(.toolbar, .att-filters, .card-actions, .card-head) .option-row input { margin-top: 0; }
.stack { display: grid; gap: 0.625rem; }
.summary-box { background: var(--panel-2); border: 0; border-radius: var(--radius-s); padding: 0.875rem 1rem; font-size: var(--fs-body); line-height: var(--lh-body); }
.summary-box b { font-weight: 600; }
.qr-box { display: grid; place-items: center; gap: 0.75rem; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); }
.qr-box svg { width: min(100%, 14rem); height: auto; }
.link-box { display: flex; align-items: center; gap: 0.5rem; font-size: var(--fs-meta); color: var(--muted); overflow-wrap: anywhere; word-break: break-all; }

/* ---------- Login page ---------- */
.auth-body { display: flex; flex-direction: column; min-height: 100dvh; }
.auth-wrap { margin: auto; width: 100%; max-width: 26rem; padding: max(1.5rem, env(safe-area-inset-top, 0px)) 1rem max(1.5rem, env(safe-area-inset-bottom, 0px)); display: grid; gap: 1rem; }
.auth-card { background: var(--panel); border: 1px solid var(--ring); border-radius: var(--radius-l); padding: 1.75rem 1.25rem 1.5rem; display: grid; gap: 0.625rem; }   /* the sign-in card */
@media (min-width: 640px) { .auth-card { padding: 2.25rem 2rem 1.75rem; box-shadow: var(--shadow-1); } }
.auth-logo { width: min(100%, 13rem); height: auto; margin: 0 auto 0.75rem; }
.auth-title { font-size: 1.375rem; line-height: var(--lh-title); font-weight: 600; text-align: center; letter-spacing: var(--ls-title); }
.auth-sub { color: var(--text-2); text-align: center; font-size: var(--fs-body); }
.auth-card form { display: grid; gap: 1rem; margin-top: 0.5rem; }
.pw { position: relative; }
.pw input { padding-right: 3.25rem; }
.pw-toggle { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); width: 2.25rem; height: 2.25rem; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--muted); border-radius: var(--radius-xs); display: grid; place-items: center; }
.pw-toggle svg { width: 1.125rem; height: 1.125rem; }
.pw-toggle[aria-pressed="true"] { color: var(--fg); background: transparent; border: 0; }
.auth-note { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-2); }
.auth-foot { text-align: center; font-size: var(--fs-meta); color: var(--muted); margin-top: 0.75rem; }
.auth-controls { display: flex; justify-content: center; }

/* ---------- Administration ---------- */
/* Status: a 6px dot and a word on the soft fill. .status-pill.on / .ok · .warn · .bad · .info; plain = neutral */
.status-pill, .pill {
  display: inline-flex; align-items: center; gap: 0.375rem; width: fit-content;
  padding: 0.125rem 0.5rem; border-radius: 999px;
  font-size: var(--fs-badge); line-height: var(--lh-badge); font-weight: 500; letter-spacing: 0; text-transform: none; white-space: nowrap;
  background: var(--panel-2); color: var(--text-2);
}
.status-pill::before, .pill::before { content: ''; width: 0.375rem; height: 0.375rem; border-radius: 999px; background: currentColor; flex: 0 0 auto; }
.status-pill.on, .status-pill.ok, .pill.ok { background: var(--ok-bg); color: var(--ok-fg); }
.status-pill.warn, .pill.warn { background: var(--warn-bg); color: var(--warn-fg); }
.status-pill.bad, .pill.bad { background: var(--bad-bg); color: var(--bad-fg); }
.status-pill.info, .pill.info { background: var(--info-bg); color: var(--info-fg); }
.status-pill.off { background: var(--panel-2); color: var(--muted); }
.row-actions { display: flex; gap: 0.375rem; flex-wrap: wrap; align-items: center; }
.row-actions .btn { min-height: var(--h-btn-sm); padding: 0 0.75rem; font-size: var(--fs-btn-sm); }
.actions-cell .row-actions { flex-wrap: nowrap; }
@media (min-width: 640px) {
  .actions-cell .cell-select { min-width: 7.5rem; max-width: 8.5rem; }
  td.wrap-ok { white-space: normal; min-width: 10rem; }
}

/* ---------- Fleet ---------- */
.fleet { display: grid; gap: 0.625rem; margin-top: 1rem; }
.fleet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem 0.75rem;
  align-items: end;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--panel);
}
.fleet-row .fleet-name { grid-column: 1 / -1; font-size: var(--fs-meta); font-weight: 600; letter-spacing: 0; }
.fleet-row .field label { font-size: var(--fs-label); color: var(--muted); }
@media (min-width: 640px) {
  .fleet-row { grid-template-columns: 7rem minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
  .fleet-row .fleet-name { grid-column: auto; padding-bottom: 0.875rem; }
}
input.plate { text-transform: uppercase; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 0.375rem; width: fit-content; padding: 0.125rem 0.5rem; border-radius: 999px; background: var(--panel-2); color: var(--text-2); font-size: var(--fs-badge); line-height: var(--lh-badge); font-weight: 500; }
.mail-box { display: grid; gap: 0.75rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: transparent; }
.it-search { max-width: 24rem; }
.it-name { font-weight: 600; }
.it-meta { color: var(--muted); font-size: var(--fs-meta); }
@media (max-width: 639px) {
  td.it-cell br { display: none; }
  td.it-cell .it-meta { display: block; margin-top: 0.125rem; }
}

/* ---------- Live location (coming soon) ---------- */
.live-card { position: relative; overflow: hidden; padding: 0; min-height: 16rem; isolation: isolate; }
.live-card.tall { min-height: 24rem; }
.live-map { position: absolute; inset: 0; background: url("/brand/map-preview.jpg") center / cover no-repeat; filter: blur(5px) saturate(0.85); transform: scale(1.06); }
:root[data-theme="dark"] .live-map { filter: blur(5px) saturate(0.7) brightness(0.55); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .live-map { filter: blur(5px) saturate(0.7) brightness(0.55); } }
.live-overlay {
  position: relative;
  z-index: 1;
  min-height: inherit;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem 1.25rem;
  background: color-mix(in srgb, var(--bg) 42%, transparent);
}
.live-overlay > div { display: grid; gap: 0.5rem; justify-items: center; max-width: 30rem; }
.live-overlay .pill { background: var(--primary); color: var(--primary-fg); padding: 0.25rem 0.75rem; }
.live-overlay h2 { font-size: 1.375rem; line-height: var(--lh-title); font-weight: 600; letter-spacing: var(--ls-title); }
.live-overlay p { color: var(--fg); font-size: var(--fs-body); line-height: var(--lh-body); }
.live-overlay .attrib { font-size: var(--fs-micro); color: var(--muted); margin-top: 0.5rem; }
.live-plates { display: flex; flex-wrap: wrap; gap: 0.375rem; justify-content: center; margin-top: 0.25rem; }
.live-plates span { background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-xs); padding: 0.0625rem 0.375rem; font-size: var(--fs-badge); font-weight: 600; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.sheet-inner .live-card { min-height: 14rem; border-radius: var(--radius-s); border: 1px solid var(--line); }

/* ---------- Editable schedule (editors) ---------- */
/* controls inside a table: 28px with a mouse (.8125rem), 32px on touch with 16px text */
td .cell-select, td .cell-time, td .cell-num {
  min-height: var(--h-btn-xs);
  padding: 0 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background-color: var(--field-bg);
  color: var(--fg);
  font-size: max(1rem, 16px);
  font-weight: 400;
  line-height: 1.3;
  max-width: 100%;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
@media (pointer: fine) { td .cell-select, td .cell-time, td .cell-num { font-size: var(--fs-btn-sm); } }
td .cell-select { padding-right: 1.75rem; background-position: right 0.375rem center; }
td .cell-time { font-weight: 500; width: 8.5rem; font-variant-numeric: tabular-nums; }
td .cell-num { width: 5.25rem; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
td .cell-num::-webkit-inner-spin-button, td .cell-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
td .cell-select:focus-visible, td .cell-time:focus-visible, td .cell-num:focus-visible { border-color: var(--fg); outline: 2px solid transparent; box-shadow: var(--input-ring); }
@media (min-width: 640px) { td .cell-select { max-width: 11rem; } }
tr.manual td.dep-cell { box-shadow: inset 2px 0 0 var(--info-fg); }   /* a time changed by hand */
.cell-edit { display: inline-flex; align-items: center; gap: 0.25rem; }
.cell-reset { width: var(--h-btn-xs); height: var(--h-btn-xs); border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--muted); display: inline-grid; place-items: center; }
.cell-reset svg { width: 0.875rem; height: 0.875rem; }
.cell-reset:active { background: var(--panel-2); }
@media (hover: hover) and (pointer: fine) { .cell-reset:hover { background: var(--panel-2); color: var(--fg); } }
.cell-warn { display: block; color: var(--bad-fg); font-size: var(--fs-meta); font-weight: 500; margin-top: 0.125rem; white-space: normal; }
.edit-note { font-size: var(--fs-meta); color: var(--muted); margin-top: 0.75rem; }
.edit-note b { color: var(--fg); font-weight: 600; }
.cell-actions .cell-reset + .cell-reset { margin-left: 0.125rem; }
.cell-rm:hover, .cell-rm:focus-visible { color: var(--bad-fg); }
.cell-tag { display: block; font-size: var(--fs-badge); font-weight: 500; color: var(--info-fg); letter-spacing: 0; }
tr.removed td { color: var(--muted); background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
tr.removed .linklike { color: var(--fg); font-weight: 500; }

/* ---------- Settings sheet ---------- */
/* plain rows with a hairline between them (settings, people to pick), never grey boxes */
.set-list { display: grid; gap: 0; }
.set-row { display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; padding: 0.375rem 0; border: 0; border-radius: 0; background: none; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row span { flex: 1 1 auto; min-width: 0; font-size: var(--fs-body); }
.set-row .mv { width: var(--h-btn-xs); height: var(--h-btn-xs); border: 1px solid var(--line-strong); border-radius: var(--radius-xs); background: var(--panel); display: inline-grid; place-items: center; color: var(--text-2); }
.set-row .mv svg { width: 0.875rem; height: 0.875rem; }
.set-row .mv:disabled { opacity: 0.3; }
.set-group { display: grid; gap: 0.5rem; }
.set-group h3 { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }

/* ---------- Presence (check-in / check-out) ---------- */
.presence { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.75rem 1rem; border: 1px solid var(--ring); border-radius: var(--radius); background: var(--panel); }
.presence-main { display: grid; gap: 0.125rem; min-width: 0; }
.presence-main b { font-weight: 600; font-size: var(--fs-section); }
.presence-main span { font-size: var(--fs-meta); color: var(--muted); }
.presence .btn { min-width: 8rem; }

/* ---------- Attendance (admin) ---------- */
.att-filters { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: end; margin-bottom: 0.75rem; }
.att-filters .field { min-width: 9rem; }

/* ---------- Fleet sections in the planner ---------- */
.fleet-section { margin-top: 1rem; }
.fleet-section:first-of-type { margin-top: 0; }
.fleet-sechead { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; }
.fleet-sechead h3 { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.fleet-row.pump { grid-template-columns: minmax(0, 1fr) auto; }
.fleet-row .rm { width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--muted); display: inline-grid; place-items: center; align-self: end; margin-bottom: 0.125rem; }
.fleet-row .rm svg { width: 1rem; height: 1rem; }
.fleet-row .rm:active { background: var(--line); }
.fleet-row .fleet-meta { grid-column: 1 / -1; font-size: var(--fs-meta); color: var(--muted); }
.fleet-row .field { position: relative; }
.fleet-row .ac { font-size: var(--fs-body); }
@media (min-width: 640px) {
  .fleet-row { grid-template-columns: 7rem minmax(0, 1fr) minmax(0, 1fr) auto; }
  .fleet-row.pump { grid-template-columns: 7rem minmax(0, 1fr) auto; }
}
/* a licence plate: Geist (never monospace), a hairline plate shape */
.plate-chip { display: inline-block; padding: 0.0625rem 0.375rem; border: 1px solid var(--line-strong); border-radius: var(--radius-xs); font-family: inherit; font-size: var(--fs-badge); line-height: var(--lh-badge); font-weight: 600; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--panel); color: var(--fg); }
td.vin { font-family: inherit; font-size: var(--fs-meta); letter-spacing: 0.02em; color: var(--text-2); font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; }
.exp-warn { color: var(--bad-fg); font-weight: 600; }
tr.inactive-row td { opacity: 0.55; }

/* ---------- Simple pages ---------- */
.error-page { margin-top: 2rem; display: grid; gap: 0.75rem; justify-items: start; }
.foot { color: var(--muted); font-size: var(--fs-meta); text-align: center; padding: 0.5rem 0 0; }
.print-meta { display: none; }
noscript .card { border-color: var(--bad-fg); }

/* Legacy header used by admin/login pages */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; }
.brand { display: grid; gap: 0.5rem; min-width: 0; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

/* ---------- Order head, live execution ---------- */
.order-head { font-size: var(--fs-meta); color: var(--muted); margin-right: 0.25rem; }
.order-more .linklike { font-size: var(--fs-meta); color: var(--fg); font-weight: 500; padding: 0.25rem 0.25rem; }
.live-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.live-on { border-color: var(--bad-fg); color: var(--bad-fg); }
.live-on .live-dot { background: var(--bad-fg); animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad-fg) 45%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
@media (prefers-reduced-motion: reduce) { .live-on .live-dot { animation: none; } }
/* the state of a load or an order: the same pill as .status-pill (a dot and a word), never a border */
.st-chip { display: inline-flex; align-items: center; gap: 0.375rem; width: fit-content; padding: 0.125rem 0.5rem; border-radius: 999px; font-size: var(--fs-badge); line-height: var(--lh-badge); font-weight: 500; white-space: nowrap; background: var(--panel-2); color: var(--text-2); border: 0; }
.st-chip::before { content: ''; width: 0.375rem; height: 0.375rem; border-radius: 999px; background: currentColor; flex: 0 0 auto; }
.st-chip.st-pending { background: var(--panel-2); color: var(--muted); }
.st-chip.st-active { background: var(--info-bg); color: var(--info-fg); }
.st-chip.st-overdue { background: var(--bad-bg); color: var(--bad-fg); }
.st-chip.st-overdue::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }   /* overdue: a ring, late: a dot */
.st-chip.st-ok { background: var(--ok-bg); color: var(--ok-fg); }
.st-chip.st-late { background: var(--bad-bg); color: var(--bad-fg); }
.st-cell { display: grid; gap: 0.25rem; justify-items: start; }
.st-by { font-size: var(--fs-meta); color: var(--muted); }
/* only a late row is tinted, lightly; a done row needs no colour */
tbody tr.st-late { background: color-mix(in srgb, var(--bad-bg) 45%, transparent); }
.bar-pour.st-ok { background: var(--ok-fg); }
.bar-pour.st-late { background: var(--bad-fg); }
.bar-pour.st-overdue { outline: 2px dashed var(--bad-fg); outline-offset: -2px; }
@media (max-width: 639px) { .st-cell { display: flex; flex-wrap: wrap; gap: 0.375rem 0.5rem; align-items: center; } }

/* ---------- Driver view, execution steps, account tags ---------- */
.st-chip.st-arrived { background: var(--info-bg); color: var(--info-fg); }
.st-steps { display: flex; flex-wrap: wrap; gap: 0.125rem 0.625rem; font-size: var(--fs-meta); color: var(--muted); font-style: normal; font-variant-numeric: tabular-nums; }
.st-steps .step { font-style: normal; white-space: nowrap; }
.st-steps .step-ok { color: var(--ok-fg); font-weight: 600; }
.st-steps .step-late { color: var(--bad-fg); font-weight: 600; }
.drv-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; }
.drv-vehicle { display: grid; gap: 0.125rem; min-width: 0; }
.drv-vehicle b { font-size: var(--fs-dialog); font-weight: 600; letter-spacing: 0.02em; }
.drv-vehicle span { font-size: var(--fs-meta); color: var(--muted); }
.daynav output { min-width: 9rem; text-align: center; font-size: var(--fs-btn-sm); font-weight: 600; }
.drv-list { display: grid; gap: 1rem; }
.drv-it { display: grid; gap: 0.75rem; }
.drv-it-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: var(--fs-body); }
.drv-load { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.875rem 1rem; display: grid; gap: 0.75rem; background: var(--panel); }
.drv-load.st-ok { border-color: var(--ok-fg); background: color-mix(in srgb, var(--ok-bg) 70%, var(--panel)); }
.drv-load.st-late { border-color: var(--bad-fg); background: color-mix(in srgb, var(--bad-bg) 70%, var(--panel)); }
.drv-load.st-overdue { border: 1px dashed var(--bad-fg); }
.drv-load.st-active, .drv-load.st-arrived { border-color: var(--info-fg); }
.drv-load-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.drv-load-top b { font-size: var(--fs-dialog); font-weight: 600; letter-spacing: var(--ls-dialog); }
.drv-plan { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; font-size: var(--fs-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.drv-plan span { display: block; color: var(--muted); font-size: var(--fs-micro); font-weight: 500; text-transform: none; letter-spacing: 0; margin-bottom: 0.125rem; }
.drv-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.drv-btns.one { grid-template-columns: 1fr; }
.drv-btn { min-height: 3.5rem; display: grid; gap: 0.125rem; place-items: center; line-height: 1.2; font-size: var(--fs-section); padding: 0.375rem 0.5rem; }
.drv-btn small { font-size: var(--fs-badge); font-weight: 500; opacity: 0.8; }
.drv-btn.done-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-fg); opacity: 1; }
.drv-btn.done-late { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-fg); opacity: 1; }
.drv-status { margin-top: 0.25rem; }
@media (max-width: 480px) { .drv-plan { grid-template-columns: repeat(3, minmax(0, 1fr)); } .drv-btns { grid-template-columns: 1fr; } .drv-btn { grid-template-columns: auto auto; justify-content: space-between; min-height: 3.25rem; } }

/* ---------- Field dashboard: presence first, route, read-only chart and table, big chat bubble ---------- */
.presence.big { padding: 1.25rem; gap: 0.75rem 1.25rem; }
.presence.big .presence-main b { font-size: var(--fs-dialog); letter-spacing: var(--ls-dialog); }
.presence.big .presence-main span { font-size: var(--fs-body); }
.presence.big .btn { min-height: 3rem; min-width: 11rem; font-size: var(--fs-section); }
@media (max-width: 639px) { .presence.big .btn { width: 100%; } }
.drv-route { display: grid; gap: 0.625rem; }
.drv-route-text { font-size: var(--fs-body); line-height: var(--lh-body); display: grid; gap: 0.125rem; }
.drv-map { height: 15rem; border-radius: var(--radius-s); border: 1px solid var(--line); overflow: hidden; background: var(--panel-2); }
.drv-pin { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fg); color: var(--bg); font-weight: 600; font-size: 0.75rem; border: 2px solid var(--panel); box-shadow: var(--shadow-1); }
.drv-nav { justify-self: start; min-height: 3rem; }
.drv-nav svg { width: 1.125rem; height: 1.125rem; }
.drv-sub { font-size: var(--fs-section); font-weight: 600; letter-spacing: var(--ls-section); }
.drv-loads { display: grid; gap: 0.625rem; }
.drv-list, .drv-it, .drv-it > *, .drv-more, .drv-more > *, .drv-chat { min-width: 0; max-width: 100%; }
.drv-chart, .drv-more .table-wrap { max-width: 100%; overflow-x: auto; }
.drv-more > summary { cursor: pointer; list-style: none; font-weight: 600; font-size: var(--fs-section); min-height: 2.75rem; display: flex; align-items: center; gap: 0.625rem; -webkit-tap-highlight-color: transparent; }
.drv-more > summary::-webkit-details-marker { display: none; }
.drv-more > summary::before { content: ''; width: 0.4375rem; height: 0.4375rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 150ms var(--ease-out); flex: 0 0 auto; }
.drv-more[open] > summary::before { transform: rotate(45deg); }
.drv-more .table-wrap { margin-top: 0.5rem; }
.drv-chart .bar { cursor: default; }
.gantt-row.mine .gantt-label { font-weight: 600; color: var(--fg); background: var(--panel-2); }
.drv-table tbody tr.mine { background: var(--panel-2); }
.drv-table tbody tr.mine.st-ok { background: color-mix(in srgb, var(--ok-bg) 70%, transparent); }
.drv-table tbody tr.mine.st-late { background: color-mix(in srgb, var(--bad-bg) 70%, transparent); }
.drv-planb { border-top: 1px solid var(--line); padding-top: 0.625rem; }
.drv-chat .chat { height: min(36rem, calc(100dvh - 12rem)); min-height: 24rem; }
@media (prefers-reduced-motion: reduce) { .drv-more > summary::before { transition: none; } }

/* ---------- Processes view ---------- */
.proc-root { display: grid; gap: 1rem; }
.proc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.proc-order .card-head h2 { display: inline; }
.proc-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.75rem; font-size: var(--fs-body); }
/* a progress bar: --fg on a --panel-2 track, 4px, round */
.proc-bar { flex: 1 1 10rem; height: 0.25rem; border-radius: 999px; background: var(--panel-2); border: 0; overflow: hidden; }
.proc-bar i { display: block; height: 100%; background: var(--fg); border-radius: 999px; transition: width 300ms var(--ease-out); }
.proc-plan { color: var(--muted); font-variant-numeric: tabular-nums; }
.proc-table td.proc-ok b, .proc-table td.proc-ok .proc-mark { color: var(--ok-fg); }
.proc-table td.proc-late b, .proc-table td.proc-late .proc-mark { color: var(--bad-fg); }
/* a feed of events: a dot in the state's colour before each line, no stripes */
.proc-feed { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.25rem; font-size: var(--fs-body); }
.proc-feed li { position: relative; padding: 0.25rem 0 0.25rem 1rem; }
.proc-feed li::before { content: ''; position: absolute; left: 0.125rem; top: 0.8em; width: 0.375rem; height: 0.375rem; border-radius: 999px; background: var(--line-strong); }
.proc-feed li.proc-ok::before { background: var(--ok-fg); }
.proc-feed li.proc-late::before { background: var(--bad-fg); }
@media (prefers-reduced-motion: reduce) { .proc-bar i { transition: none; } }

/* ---------- Dispatch board: one group per saved order ---------- */
tbody tr.order-row td.order-cell { background: var(--panel-2); padding: 0.75rem 0.875rem; white-space: normal; border-top: 1px solid var(--line-strong); }
tbody tr.order-row.current td.order-cell { box-shadow: inset 2px 0 0 var(--fg); }
.order-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; }
.order-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; min-width: 0; }
.order-title b { font-size: var(--fs-section); font-weight: 600; letter-spacing: var(--ls-section); }
.order-title .muted { font-size: var(--fs-meta); }
.order-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.board-empty { padding: 1.25rem 0 0.5rem; }
@media (max-width: 639px) {
  table:not(.table-custom-phone) > tbody > tr.order-row { grid-template-columns: 1fr; background: var(--panel-2); border-color: transparent; }
  table:not(.table-custom-phone) > tbody > tr.order-row > td.order-cell { border-top: 0; padding: 0; background: none; }
  table:not(.table-custom-phone) > tbody > tr.order-row > td.order-cell::before { content: none; }
  table:not(.table-custom-phone) > tbody > tr.order-row.current { border-color: var(--fg); }
  table:not(.table-custom-phone) > tbody > tr.order-row.current > td.order-cell { box-shadow: none; }
}

/* ---------- Order lifecycle: crew presence, new-order badge ---------- */
.crew-row { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.crew-chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.125rem 0.5rem; border-radius: 999px; font-size: var(--fs-badge); line-height: var(--lh-badge); border: 1px solid transparent; background: var(--panel-2); color: var(--fg); }
.crew-chip b { font-weight: 600; }
.crew-chip.crew-in { color: var(--ok-fg); background: var(--ok-bg); }
.crew-chip.crew-out { color: var(--bad-fg); background: var(--bad-bg); }
.crew-chip.crew-none { color: var(--muted); background: transparent; border: 1px dashed var(--line-strong); }
/* v3.54.1: the crew's confirmation of an order, the same words and tones on every office page: "konfirmoi 14:32"
   (ok), "pa konfirmuar" (warning), and on the order "Ekipi 3/5 konfirmuan" */
.crew-ack, .crew-acks { font-variant-numeric: tabular-nums; white-space: nowrap; }
.crew-ack.ok, .crew-acks.ok { color: var(--ok-fg); }
.crew-ack.warn, .crew-acks.warn { color: var(--warn-fg); }
.crew-ack.off { color: var(--muted); }
.crew-chip .crew-ack { margin-left: 0.125rem; padding-left: 0.375rem; border-left: 1px solid var(--line-strong); }
.drv-it.drv-new { border-color: var(--bad-fg); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad-fg) 30%, transparent); cursor: pointer; }
.new-badge { margin-right: 0.375rem; }

/* ---------- Incidents, alerts, pump ready, five-step buttons ---------- */
.inc-row { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.5rem 0; }
.inc-chip { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.625rem; border-radius: var(--radius-s); background: var(--bad-bg); color: var(--bad-fg); border: 0; font-size: var(--fs-meta); font-weight: 500; }
.inc-chip.inc-done { background: var(--ok-bg); color: var(--ok-fg); }
.drv-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.drv-problem { border-color: var(--bad-fg); color: var(--bad-fg); min-height: 3rem; }
.drv-tools .drv-btn { min-width: 11rem; }
.drv-btns.five { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.proc-alerts { display: grid; gap: 0.375rem; padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.proc-alerts-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.proc-alerts-head b { margin-right: auto; }
.proc-alert { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.375rem 0.625rem; border: 0; background: var(--bad-bg); color: var(--bad-fg); border-radius: var(--radius-s); font-size: var(--fs-body); }
.proc-alert.warn { background: var(--warn-bg); color: var(--warn-fg); }
.proc-alert .linklike { color: inherit; font-size: var(--fs-meta); }
@media (max-width: 480px) { .drv-btns.five { grid-template-columns: 1fr 1fr; } }

/* ---------- Mondi (his panel: shell.css): the spinner shared with .ai-wait, the "Pyet Mondin" button ---------- */
@keyframes mira-spin { to { transform: rotate(360deg); } }
.dash-mira { display: inline-flex; align-items: center; gap: 0.5rem; }

/* ---------- Weather card, route-time adjustment ---------- */
.wx-card { display: grid; gap: 0.75rem; }
.wx-card .card-head { margin-bottom: 0; }
.wx-now { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.5rem 0.875rem; align-items: center; }
@media (min-width: 720px) { .wx-now { grid-template-columns: auto minmax(10rem, 1fr) minmax(0, 1.6fr); } }
.wx-icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: var(--radius); background: var(--panel-2); border: 0; }
.wx-icon .wx-ico { width: 2.125rem; height: 2.125rem; }
.wx-ico { width: 1.25rem; height: 1.25rem; flex: none; color: var(--muted); }
.wx-ico.wx-sun, .wx-ico.wx-cloud-sun { color: var(--warn-fg); }
.wx-ico.wx-moon, .wx-ico.wx-cloud-moon { color: var(--setup); }
.wx-ico.wx-drizzle, .wx-ico.wx-rain, .wx-ico.wx-rain-heavy, .wx-ico.wx-sleet, .wx-ico.wx-hail, .wx-ico.wx-snow { color: var(--load); }
.wx-ico.wx-thunder { color: var(--wait); }
.wx-main { display: grid; line-height: 1.25; }
.wx-temp { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: 600; letter-spacing: var(--ls-display); font-variant-numeric: tabular-nums; }
.wx-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.125rem 0.75rem; margin: 0; grid-column: 1 / -1; }
@media (min-width: 720px) { .wx-facts { grid-column: auto; } }
.wx-facts dt { grid-row: 1; font-size: var(--fs-badge); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.wx-facts dd { grid-row: 2; margin: 0; font-size: var(--fs-body); font-variant-numeric: tabular-nums; }
/* advice lines: a dot in the state's colour, no stripes */
.wx-advice { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.wx-advice li { position: relative; padding: 0.25rem 0 0.25rem 1rem; font-size: var(--fs-body); }
.wx-advice li::before { content: ''; position: absolute; left: 0.125rem; top: 0.8em; width: 0.375rem; height: 0.375rem; border-radius: 999px; background: var(--ok-fg); }
.wx-advice li.wx-warn::before { background: var(--warn-fg); }
.wx-advice li.wx-bad::before { background: var(--bad-fg); }
.wx-hours { list-style: none; margin: 0; padding: 0 0 0.25rem; display: flex; gap: 0.375rem; overflow-x: auto; scrollbar-width: thin; }
.wx-hours li { flex: 1 0 3.5rem; display: grid; justify-items: center; gap: 0.125rem; padding: 0.375rem 0.25rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: transparent; font-size: var(--fs-meta); min-height: 5.25rem; align-content: start; font-variant-numeric: tabular-nums; }
.wx-h-icon { display: grid; place-items: center; height: 1.625rem; }
.wx-h-icon .wx-ico { width: 1.375rem; height: 1.375rem; }
.wx-day { display: inline-flex; align-items: center; gap: 0.35rem; }
.wx-day .wx-ico { width: 1.0625rem; height: 1.0625rem; }
.wx-wet { color: var(--info-fg); font-weight: 600; }
.wx-days { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; }
.adjust-box { margin-top: 0.75rem; padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: transparent; display: grid; gap: 0.5rem; }
.adjust-box[hidden] { display: none; }
.adj-weather { margin: 0; font-size: var(--fs-body); }
.adj-weather .wx-ico { vertical-align: -0.25rem; margin-right: 0.4rem; }
.adj-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; font-size: var(--fs-body); }
.adj-list .muted { font-size: var(--fs-meta); }

/* ---------- Live page: facts, operation band ---------- */
.dot { display: inline-block; width: 0.625rem; height: 0.625rem; border-radius: 2px; background: var(--c); flex: 0 0 auto; align-self: center; }
.fact .label { font-size: var(--fs-badge); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.facts { display: grid; gap: 0.625rem 1rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.fact { display: grid; gap: 0.125rem; min-width: 0; }
.fact .value { font-size: var(--fs-body); overflow-wrap: anywhere; }
.op-band { width: 100%; height: 3.25rem; display: block; }
.op-band .op-off { fill: var(--line); }
.op-band .op-idle { fill: var(--warn-fg); }
.op-band .op-move { fill: var(--ok-fg); }
.op-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.op-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.375rem 1.25rem; font-size: var(--fs-meta); color: var(--text-2); }
.op-legend li { display: inline-flex; align-items: center; gap: 0.375rem; }
.dot.op-move { background: var(--ok-fg); } .dot.op-idle { background: var(--warn-fg); } .dot.op-off { background: var(--line-strong); }
.ai-wait { display: flex; align-items: center; gap: 0.625rem; }
.ai-wait::before { content: ''; flex: 0 0 auto; width: 1rem; height: 1rem; border: 2px solid var(--line); border-top-color: var(--fg); border-radius: 50%; animation: mira-spin 0.9s linear infinite; }

/* ---------- Fleet table (dashboard) ---------- */
.fleet-kpis { margin-bottom: 0.875rem; }
/* a dense table (many columns): the same type, tighter sides */
.fleet-table th, .fleet-table td { padding-left: 0.5rem; padding-right: 0.5rem; }
.fleet-table .fuel-bar { width: 2.25rem; }
@media (min-width: 640px) { .fleet-table td.wrap-ok { white-space: normal; min-width: 7.5rem; max-width: 11rem; } }
.th-sort { border: 0; background: transparent; color: inherit; font: inherit; font-weight: 500; letter-spacing: inherit; text-transform: none; padding: 0; cursor: pointer; white-space: nowrap; border-radius: 2px; }
th[aria-sort] .th-sort { color: var(--fg); }
.fl-fuel { display: inline-flex; align-items: center; gap: 0.375rem; }

/* ---------- Day dashboard ---------- */
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.dash-root { display: grid; gap: 1rem; transition: opacity 150ms ease; }
.dash-root.is-loading { opacity: 0.45; }
/* .kpi-accent is neutral now (the accent never fills a tile); .kpi-bad carries a state: a red value and a red dot */
.kpi.kpi-bad .v { color: var(--bad-fg); }
.kpi.kpi-bad .label::before { content: ''; display: inline-block; width: 0.375rem; height: 0.375rem; margin-right: 0.375rem; border-radius: 999px; background: var(--bad-fg); vertical-align: 0.125em; }
.dash-chart-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dash-chart { width: 100%; min-width: 36rem; height: auto; display: block; margin-top: 0.5rem; }
.dash-grid { stroke: var(--line); stroke-width: 1; }
.dash-axis { fill: var(--muted); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.dash-bar.planned { fill: color-mix(in srgb, var(--fg) 12%, transparent); }
.dash-bar.done { fill: var(--chart); }
.dash-now { stroke: var(--accent); stroke-width: 2; }
.dash-now-label { fill: var(--fg); font-weight: 600; }
.dash-legend { display: inline-flex; align-items: center; gap: 0.25rem; font-size: var(--fs-meta); color: var(--muted); }
.dash-legend i { display: inline-block; width: 0.75rem; height: 0.5rem; border-radius: 2px; }
.dash-legend i.planned { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.dash-legend i.done { background: var(--chart); }
.dash-orders { display: grid; gap: 0.75rem; }
.dash-progress { margin: 0; }
.dash-progress i { width: 0; }
.dash-workers { display: grid; gap: 0.75rem; }
.dash-wgroup h3, .dash-fleet h3 { font-size: var(--fs-label); font-weight: 600; margin: 0 0 0.25rem; }
.dash-wgroup ul, .dash-vlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; font-size: var(--fs-body); }
.dash-fleet { display: grid; gap: 0.75rem; }

/* ---------- Fuel bar ---------- */
.fuel-bar { display: inline-block; width: 4.5rem; height: 0.25rem; border-radius: 999px; background: var(--panel-2); overflow: hidden; vertical-align: middle; }
.fuel-bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--ok-fg); border-radius: 999px; }
.fuel-bar.low i { background: var(--bad-fg); }
.live-meta .muted + .muted { margin-top: 0; }

/* ---------- Plants and site, step navigation, final step ---------- */
.plants-title { font-size: var(--fs-section); font-weight: 600; letter-spacing: var(--ls-section); margin: 1rem 0 0.25rem; }
.plants { display: grid; gap: 0.75rem; margin-top: 0.75rem; }
.plant-row { display: grid; gap: 0.5rem 0.75rem; grid-template-columns: minmax(0, 1fr); padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); }
@media (min-width: 720px) { .plant-row { grid-template-columns: minmax(10rem, 1fr) minmax(0, 2fr); } .plant-row .plant-stat, .plant-row .option-row { grid-column: 1 / -1; } }
.plant-row .plant-title { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; font-weight: 600; }
.plant-row .plant-title small { font-weight: 400; color: var(--muted); }
.plant-row .field input:disabled { opacity: 0.6; }
.plant-stat { font-size: var(--fs-meta); color: var(--muted); min-height: 1.2em; margin: 0; }
.plant-stat.has-route { color: var(--ok-fg); font-weight: 500; }
@media (min-width: 640px) { .fleet-row:not(.pump) { grid-template-columns: 7rem minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; } }
.card-details > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.card-details > summary::-webkit-details-marker { display: none; }
.card-details > summary h2 { display: inline; font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 600; letter-spacing: var(--ls-section); }
.card-details > summary .hint { font-size: var(--fs-meta); flex: 1 1 16rem; }
/* the whole card is the tap target: the summary spreads over the card's padding */
.card-details > summary { margin: -1rem; padding: 1rem; border-radius: inherit; }
@media (min-width: 640px) { .card-details > summary { margin: -1.25rem -1.5rem; padding: 1.25rem 1.5rem; } }
.card-details[open] > summary { margin-bottom: 0; padding-bottom: 0.75rem; }
/* the same chevron as the folds inside the cards; it turns over when open */
.card-details > summary::after { content: ''; align-self: center; flex: 0 0 auto; width: 1rem; height: 1rem; background: var(--muted); -webkit-mask: var(--icon-chevron) center / 1rem no-repeat; mask: var(--icon-chevron) center / 1rem no-repeat; transition: transform 150ms var(--ease-out); }
.card-details[open] > summary::after { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .card-details > summary::after { transition: none; } }
.pane-nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; }
.pane-nav .btn { min-height: var(--h-btn); }
.pane-nav .spacer { flex: 1; }
body[data-ptab] .dock { display: none; }
.finish-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.375rem 1rem; margin: 0 0 1rem; font-size: var(--fs-body); }
.finish-dl dt { color: var(--muted); font-weight: 500; }
.finish-dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.finish-primary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem; padding: 1rem; border: 0; border-radius: var(--radius); background: var(--panel-2); margin-bottom: 1rem; }
.finish-primary .hint { flex-basis: 100%; margin: 0; }
.btn-lg { min-height: 2.75rem; padding: 0 1.25rem; font-size: var(--fs-section); }
.finish-sub { font-size: var(--fs-section); font-weight: 600; letter-spacing: var(--ls-section); margin: 0 0 0.5rem; }
.finish-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.5rem; }
.finish-actions .btn { justify-content: flex-start; min-height: 2.75rem; }
.finish-foot { margin-top: 0.75rem; }
.chip-plant { background: var(--panel-2); color: var(--text-2); }
@media print { .pane-nav, .finish-actions, .finish-primary { display: none !important; } }

/* ---------- Planner steps (tabs) ---------- */
/* the planner's steps: the current one has an --fg edge and a filled number (never a white slab in dark mode) */
.ptabs { position: sticky; top: calc(var(--topbar-h, 3.5rem) + env(safe-area-inset-top, 0px)); z-index: calc(var(--z-sticky) + 2); display: flex; gap: 0.375rem; overflow-x: auto; scrollbar-width: none; padding: 0.5rem 0; margin: -0.5rem 0; background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); }
.ptabs::-webkit-scrollbar { display: none; }
.ptab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.5rem; padding: 0.25rem 0.875rem 0.25rem 0.5rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text-2); font: inherit; font-weight: 500; font-size: var(--fs-body); cursor: pointer; white-space: nowrap; transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
.ptab .ptab-n { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 999px; background: var(--panel-2); border: 0; font-size: var(--fs-badge); font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ptab .ptab-s { font-weight: 400; color: var(--muted); font-size: var(--fs-meta); }
.ptab .ptab-s:empty { display: none; }
.ptab[aria-pressed="true"] { background: var(--panel); color: var(--fg); border-color: var(--fg); }
.ptab[aria-pressed="true"] .ptab-n { background: var(--fg); color: var(--bg); }
.ptab[aria-pressed="true"] .ptab-s { color: var(--text-2); }
@media (hover: hover) and (pointer: fine) { .ptab:not([aria-pressed="true"]):hover { background: var(--panel-2); color: var(--fg); } }
body[data-ptab="client"] [data-pane]:not([data-pane="client"]),
body[data-ptab="order"] [data-pane]:not([data-pane="order"]),
body[data-ptab="fleet"] [data-pane]:not([data-pane="fleet"]),
body[data-ptab="plan"] [data-pane]:not([data-pane="plan"]),
body[data-ptab="finish"] [data-pane]:not([data-pane="finish"]) { display: none; }
body[data-ptab="finish"] #saveBtn3 { display: none; }
.pane-next { display: flex; justify-content: flex-end; margin: 1rem 0 0; }
body[data-ptab="plan"] #stripSchedule { display: none; }
@media print { .ptabs, .pane-next { display: none !important; } body[data-ptab] [data-pane] { display: block !important; } }

/* ---------- Reports, learned defaults, extra vehicles, GPS tracker tool ---------- */
.rp-fields { align-items: end; }
.rp-tables { display: grid; gap: 1rem; margin-top: 1rem; }
@media (min-width: 640px) { .rp-table td.head { white-space: normal; min-width: 8rem; } }
.learned { margin-top: 0.75rem; padding: 0.625rem 0.75rem; border-radius: var(--radius-s); background: var(--panel-2); color: var(--fg); }
.learned .linklike { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.chips .plate-chip { display: inline-flex; align-items: center; gap: 0.375rem; }
.chips .plate-chip button { border: 0; background: transparent; color: inherit; font: inherit; font-size: 1.1em; cursor: pointer; padding: 0 0.125rem; line-height: 1; }
.gps-link { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.gps-link select { max-width: 14rem; }

/* ---------- Offline queue, install card ---------- */
.drv-btn.done-pending { background: var(--warn-bg); color: var(--warn-fg); border-color: color-mix(in srgb, var(--warn-fg) 40%, transparent); opacity: 1; }
.drv-install, .drv-push { display: grid; gap: 0.5rem; }
.drv-install .card-head, .drv-push .card-head { margin-bottom: 0.25rem; }
[data-push-toggle][data-push-state="on"] { border-color: var(--ok-fg); color: var(--ok-fg); }

/* ---------- ETA chips ---------- */
.st-eta { display: inline-block; font-size: var(--fs-badge); line-height: var(--lh-badge); font-weight: 500; color: var(--info-fg); background: var(--info-bg); padding: 0.125rem 0.5rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.st-eta.late { color: var(--bad-fg); background: var(--bad-bg); }
.crew-eta { font-weight: 500; }
.crew-chip.crew-late { color: var(--bad-fg); background: var(--bad-bg); }
.drv-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; justify-content: flex-end; }

/* ---------- Live GPS: map, vehicle list, pins ---------- */
.plan-live { display: grid; gap: 0.375rem; }
.live-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.625rem; padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); color: var(--fg); text-align: left; font: inherit; width: 100%; }
button.live-item { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { button.live-item:hover { background: var(--panel-2); } }
.live-item.selected { border-color: var(--fg); }
.live-main, .live-meta { display: grid; gap: 0.125rem; min-width: 0; }
.live-main b { font-weight: 600; } .live-main .muted, .live-meta .muted { font-size: var(--fs-badge); }
.live-meta { text-align: right; font-size: var(--fs-meta); white-space: nowrap; font-variant-numeric: tabular-nums; }
.live-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.live-item.st-moving .live-dot { background: var(--ok-fg); }
.live-item.st-stopped .live-dot { background: var(--warn-fg); }
.live-item.st-offline { opacity: 0.75; }
.live-item.st-none .live-dot { background: transparent; border: 1px dashed var(--muted); }
.veh-pin { position: relative; }
.veh-pin i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: #8a8a8a; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); box-sizing: border-box; }
.veh-stopped i { background: #C4913F; }
.veh-moving i { background: #277A4E; border-radius: 50% 50% 50% 0; transform: rotate(calc(var(--h, 0deg) - 225deg)); }
.veh-moving i::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(39, 122, 78, 0.6); animation: veh-pulse 1.6s ease-out infinite; }
.veh-selected i { box-shadow: 0 0 0 3px #191919, 0 1px 4px rgba(0, 0, 0, 0.45); }
.veh-selected span { background: #191919; color: #fff; border-color: #191919; }
@keyframes veh-pulse { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .veh-moving i::after { animation: none; display: none; } }
.veh-pin span { position: absolute; left: 10px; top: -9px; white-space: nowrap; font: 600 11px/1.5 "Geist", system-ui, sans-serif; background: rgba(255, 255, 255, 0.94); color: #191919; padding: 0 5px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.15); }
/* Named places on the maps (v3.40): a diamond in the kind's colour with its name always shown, the company's plants in black */
.place-pin { position: relative; }
.place-pin i { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 3px; transform: rotate(45deg); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); box-sizing: border-box; background: #C4913F; }
.place-pin b { position: absolute; left: 10px; top: -9px; white-space: nowrap; font: 600 11px/1.5 "Geist", system-ui, sans-serif; background: rgba(255, 255, 255, 0.94); color: #191919; padding: 0 5px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.15); }
.place-impiant i { background: #191919; }
.place-kantier i { background: #1F7A4D; }
.place-parkim i { background: #2f6fed; }
.place-tjeter i { background: #C4913F; }
.place-plant b { background: #191919; color: #fff; border-color: #191919; }
.place-plant i { width: 16px; height: 16px; left: -8px; top: -8px; }
/* a checkbox or radio with its words, inline, no box around it (filters, toggles) */
.check-inline { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--fs-meta); color: var(--text-2); cursor: pointer; }
.check-inline input { flex: 0 0 auto; }
#itLiveMap { margin-top: 0.5rem; }

/* ---------- Maps (Leaflet): the platform's type and controls (leaflet.css loads later, hence the longer selectors) ---------- */
.leaflet-container.leaflet-container { font-family: inherit; font-size: var(--fs-meta); }
.leaflet-container .leaflet-control.leaflet-bar { border: 0; border-radius: var(--radius-s); box-shadow: var(--shadow-pop); overflow: hidden; }
.leaflet-container .leaflet-control.leaflet-bar a {
  width: 2rem; height: 2rem; line-height: 2rem;
  background: var(--raised); color: var(--fg); border-bottom: 1px solid var(--line);
  font: 400 1.125rem/2rem "Geist", system-ui, sans-serif; text-indent: 0;
}
.leaflet-container .leaflet-control.leaflet-bar a:last-child { border-bottom: 0; }
.leaflet-container .leaflet-control.leaflet-bar a:hover, .leaflet-container .leaflet-control.leaflet-bar a:focus-visible { background: var(--panel-2); color: var(--fg); }
.leaflet-container .leaflet-control.leaflet-bar a.leaflet-disabled { color: var(--faint); background: var(--raised); }
.leaflet-container .leaflet-popup-content-wrapper.leaflet-popup-content-wrapper, .leaflet-container .leaflet-popup-tip.leaflet-popup-tip { background: var(--raised); color: var(--fg); box-shadow: var(--shadow-pop); }
.leaflet-container .leaflet-popup-content-wrapper.leaflet-popup-content-wrapper { border-radius: var(--radius); }
.leaflet-container .leaflet-popup-content.leaflet-popup-content { font: var(--fs-meta)/1.45 "Geist", system-ui, sans-serif; margin: 0.625rem 0.875rem; }
.leaflet-container a.leaflet-popup-close-button.leaflet-popup-close-button { color: var(--muted); font: 400 1.125rem/1.5rem "Geist", system-ui, sans-serif; }
.leaflet-container .leaflet-control-attribution.leaflet-control-attribution { font-family: inherit; font-size: var(--fs-micro); color: var(--muted); background: color-mix(in srgb, var(--bg) 82%, transparent); }
.leaflet-container .leaflet-control-attribution.leaflet-control-attribution a { color: var(--text-2); }

/* ---------- Footer links, legal page, cookie consent ---------- */
.foot-links { margin-top: 0.25rem; line-height: 1.8; }
.foot-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-color: var(--line-strong); }
/* a link that looks like text: --fg, a quiet underline; in a table (a name, a number) no underline until hovered */
.linklike { color: var(--fg); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-color: var(--line-strong); }
.foot-links a:hover, .linklike:hover, .foot-links a:focus-visible, .linklike:focus-visible { color: var(--fg); text-decoration-color: currentColor; }
.linklike { display: inline; background: none; border: 0; padding: 0; margin: 0; font: inherit; cursor: pointer; min-height: 0; -webkit-tap-highlight-color: transparent; border-radius: 2px; text-align: inherit; }
td .linklike, td a:not(.btn):not(.tk-chip) { font-weight: 500; text-decoration: none; }
td .linklike:hover, td a:not(.btn):not(.tk-chip):hover { text-decoration: underline; text-decoration-color: currentColor; }
.auth-legal { text-align: center; font-size: var(--fs-meta); color: var(--muted); margin: -0.25rem 0 0; }
.stack-tight { display: grid; gap: 0.125rem; font-size: var(--fs-meta); line-height: var(--lh-meta); }
.stack-tight a { color: var(--fg); }

.legal .hero { padding-bottom: 0; }
.legal-toc { display: grid; gap: 0.25rem; font-size: var(--fs-body); }
.legal-toc a { color: var(--fg); text-decoration: none; padding: 0.375rem 0; border-bottom: 1px solid var(--line); min-height: 2.75rem; display: flex; align-items: center; }
.legal-toc a:last-child { border-bottom: 0; }
.legal-toc a:hover, .legal-toc a:focus-visible { color: var(--fg); text-decoration: underline; text-underline-offset: 0.18em; }
.legal-body { display: grid; gap: 0.75rem; font-size: var(--fs-body); line-height: 1.6; color: var(--text-2); max-width: 70ch; }
.legal-body h2 { font-size: var(--fs-dialog); line-height: var(--lh-dialog); font-weight: 600; letter-spacing: var(--ls-dialog); color: var(--fg); margin-top: 1rem; scroll-margin-top: 5rem; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body ul { padding-left: 1.25rem; display: grid; gap: 0.5rem; }
.legal-body a { color: var(--fg); text-decoration: underline; text-underline-offset: 0.18em; }
@media (min-width: 640px) {
  .legal-toc { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; }
  .legal-toc a:nth-last-child(2) { border-bottom: 0; }
}

.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-popover);
  margin: 0 auto;
  width: 100%;
  max-width: 44rem;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: var(--raised);
  color: var(--fg);
  border: 0;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  box-shadow: var(--shadow-modal);
  display: grid;
  gap: 0.75rem;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  transition: transform 300ms var(--ease-drawer), opacity 200ms var(--ease-out);
  @starting-style { transform: translateY(100%); opacity: 0; }
}
.cookie-text b { display: block; font-weight: 600; margin-bottom: 0.125rem; }
.cookie-text a { color: var(--fg); text-decoration: underline; text-underline-offset: 0.18em; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cookie-actions .btn { flex: 1 1 auto; }
@media (min-width: 640px) {
  .cookie-banner { bottom: 1rem; left: 1rem; right: 1rem; border-radius: var(--radius-l); padding-bottom: 1rem; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; }
  .cookie-actions { justify-content: flex-end; }
  .cookie-actions .btn { flex: 0 0 auto; }
}
@media (prefers-reduced-motion: reduce) { .cookie-banner { transition: opacity 150ms ease; @starting-style { transform: none; } } }
.option-row.muted { opacity: 0.65; cursor: default; }
@media print { .cookie-banner, .foot-links { display: none !important; } }

/* ---------- v3.29: worker performance ---------- */
.pf-day { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 3px; border: 1px solid var(--line); background: transparent; vertical-align: middle; flex: none; }
.pf-day.none { background: var(--line); border-color: var(--line-strong); }
.pf-day.green { background: var(--ok-fg); border-color: var(--ok-fg); }
.pf-day.red { background: var(--bad-fg); border-color: var(--bad-fg); }
.pf-day.manual { border-radius: 50%; outline: 2px solid var(--fg); outline-offset: 1px; }
a.pf-day { margin-right: 0.4rem; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: center; }
.pf-legend .pf-day { margin-left: 0.5rem; }
.pf-legend .pf-day:first-child { margin-left: 0; }
.pf-list { display: grid; gap: 0.5rem; }
.pf-row { display: grid; gap: 0.5rem 1rem; align-items: center; padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); }
@media (min-width: 900px) { .pf-row { grid-template-columns: minmax(13rem, 1.2fr) minmax(12rem, 2fr) minmax(11rem, 1fr) auto; } }
.pf-who { min-width: 0; }
.pf-flags { display: flex; flex-wrap: wrap; gap: 0.375rem 0.5rem; align-items: center; margin-top: 0.25rem; }
.pf-flag { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.125rem 0.5rem; border-radius: 999px; font-size: var(--fs-badge); line-height: var(--lh-badge); font-weight: 500; border: 0; background: var(--panel-2); font-variant-numeric: tabular-nums; }
.pf-flag i, .pf-give i { width: 0.375rem; height: 0.375rem; border-radius: 999px; display: inline-block; }
.pf-flag.green i, .pf-give.green i { background: var(--ok-fg); }
.pf-flag.red i, .pf-give.red i { background: var(--bad-fg); }
.pf-strip { display: flex; flex-wrap: wrap; gap: 2px; }
.pf-strip.big { gap: 3px; margin-bottom: 0.75rem; }
.pf-strip.big .pf-day { width: 1rem; height: 1rem; }
.pf-nums { display: grid; gap: 0.125rem; font-size: var(--fs-meta); color: var(--muted); }
.pf-nums b { color: var(--fg); font-variant-numeric: tabular-nums; }
.pf-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.pf-kpis { margin-bottom: 0.25rem; }
.pf-box { border-top: 1px solid var(--line); padding-top: 1rem; display: grid; gap: 0.75rem; }
.pf-box h3 { font-size: var(--fs-section); font-weight: 600; letter-spacing: var(--ls-section); margin: 0; }
.pf-flagform { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.pf-flagform input[type="date"] { width: auto; }
.pf-flagform input[type="text"] { flex: 1 1 14rem; }
.pf-give { display: inline-flex; align-items: center; gap: 0.375rem; }
/* records under a person: plain rows with a hairline between them */
.pf-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; font-size: var(--fs-body); }
.pf-items li { padding: 0.5rem 0; border: 0; border-radius: 0; background: none; }
.pf-items li + li { border-top: 1px solid var(--line); }
.pf-items .pf-day { margin-right: 0.4rem; }
.pf-comments li p { margin: 0 0 0.25rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.pf-del { margin-left: 0.5rem; font-size: var(--fs-meta); }
@media (min-width: 640px) { .pf-table td.wrap-ok { white-space: normal; min-width: 9rem; } }
.pf-box textarea { width: 100%; min-height: 4.5rem; }

/* ---------- v3.29: fleet editing and carbon on the panel ---------- */
.fleet-table .row-actions { flex-wrap: nowrap; flex-direction: row; }

/* ---------- v3.30: line charts of the company's days ---------- */
.tr-card { display: grid; gap: 0.75rem; }
.tr-card[hidden] { display: none; }
.tr-card .card-head { margin-bottom: 0; }
/* charts in one hue (--chart); the plan as a dashed grey line */
.tr-wrap { position: relative; border: 1px solid var(--line); border-radius: var(--radius-s); background: transparent; padding: 0.5rem 0.5rem 0.25rem; }
.tr-chart { display: block; width: 100%; height: auto; --tr: var(--chart); }
.tr-grid { stroke: var(--line); stroke-width: 1; }
.tr-grid.base { stroke: var(--line-strong); }
.tr-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tr-area { fill: color-mix(in srgb, var(--tr) 16%, transparent); stroke: none; }
.tr-line { fill: none; stroke: var(--tr); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.tr-plan { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: 0.8; }
.tr-dot { fill: var(--panel); stroke: var(--tr); stroke-width: 2; transition: r 120ms ease; }
.tr-dot.today { fill: var(--tr); }
.tr-dot.mark { stroke: var(--fg); stroke-width: 2.5; r: 5px; }
.tr-dot.on { r: 5px; fill: var(--tr); }
.tr-guide { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.tr-hit { fill: transparent; outline: none; }
.tr-hit.can-open { cursor: pointer; }
.tr-hit:focus-visible { fill: color-mix(in srgb, var(--fg) 6%, transparent); }
.tr-tip { position: absolute; top: 0.625rem; left: var(--at, 50%); transform: translateX(0.75rem); z-index: 2; display: grid; gap: 0.125rem; min-width: 11rem; padding: 0.5rem 0.75rem; border: 0; border-radius: var(--radius-s); background: var(--raised); box-shadow: var(--shadow-pop); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; pointer-events: none; }
.tr-tip.left { transform: translateX(calc(-100% - 0.75rem)); }
.tr-tip[hidden] { display: none; }
.tr-tip-main { font-weight: 600; font-size: var(--fs-section); }
.tr-key { display: inline-block; width: 1rem; height: 0; margin-right: 0.4rem; vertical-align: middle; border-top: 2.5px solid var(--tr, var(--chart)); }
.tr-key.plan { border-top: 2px dashed var(--muted); }
.tr-tip .tr-key.main { border-top-color: var(--fg); }
.tr-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; font-size: var(--fs-meta); color: var(--muted); --tr: var(--chart); }
/* the measures' short names on a phone ("Beton", "Km"); the full ones on a desk */
.tr-seg .tr-short { display: none; }
@media (max-width: 639px) { .tr-seg .tr-long { display: none; } .tr-seg .tr-short { display: inline; } }

/* ---------- v3.29: road difficulty in the planner ---------- */
.diff-box { display: grid; gap: 0.5rem; padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); }
.diff-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.diff-head h3 { font-size: var(--fs-section); font-weight: 600; letter-spacing: var(--ls-section); margin: 0; }
.diff-score { font-weight: 600; font-variant-numeric: tabular-nums; padding: 0.125rem 0.5rem; border-radius: 999px; background: var(--panel-2); border: 0; font-size: var(--fs-meta); }
.diff-score.low { background: var(--ok-bg); color: var(--ok-fg); }
.diff-score.mid { background: var(--warn-bg); color: var(--warn-fg); }
.diff-score.high { background: var(--bad-bg); color: var(--bad-fg); }
.diff-info { display: grid; gap: 0.375rem; font-size: var(--fs-body); }
.diff-info p { margin: 0; }
.diff-plant { display: grid; gap: 0.25rem; }
.diff-profile { width: 100%; max-width: 22rem; height: 2.75rem; display: block; }
.diff-profile .area { fill: color-mix(in srgb, var(--chart) 16%, transparent); }
.diff-profile .line { fill: none; stroke: var(--chart); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.diff-fields { margin-top: 0.25rem; }
.adj-source { margin: 0; font-size: var(--fs-body); }
.adj-source .st-chip { margin-right: 0.35rem; }

/* a map keeps its layers to itself, so nothing of it rises above the top bar, a panel or a menu */
.leaflet-container { isolation: isolate; }

/* ---------- v3.31: which order is open, the way back, the pace of the pour ---------- */
.pace { margin-top: 0.75rem; padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); display: grid; gap: 0.5rem; }
.pace[hidden] { display: none; }
.pace-line { margin: 0; font-size: var(--fs-body); }
.pace-warn { margin: 0; padding: 0.5rem 0.75rem; border: 0; background: var(--warn-bg); color: var(--warn-fg); border-radius: var(--radius-s); font-size: var(--fs-body); }
.pace-warn[hidden] { display: none; }
.pace-fit { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; font-size: var(--fs-body); }
.pace-fit label { font-weight: 500; }
.pace-fit label.check-inline { font-weight: 400; }
.pace-fit input[type="time"] { width: auto; font-variant-numeric: tabular-nums; }
.pace .hint { margin: 0; }
@media print { .pace-fit, .pace .hint { display: none !important; } }
/* hours : minutes, two selects of the field's height that share its column */
.time24 { display: inline-flex; align-items: center; gap: 0.375rem; font-weight: 600; min-width: 0; }
.time24 select { min-width: 4.75rem; font-variant-numeric: tabular-nums; }
.field .time24 { display: flex; }
.field .time24 select { flex: 1 1 0; min-width: 0; width: auto; }
.field input[hidden], .pace-fit input[hidden] { display: none; }

/* ---------- v3.32: sub-tabs of the fleet, the service page ---------- */
/* Underline tabs (sub-pages, in-page tabs): a row with a hairline under it; the current tab in --fg with a 2px bar;
   it scrolls sideways on a phone instead of wrapping; a count is a small --panel-2 pill (.tab-count) */
.subtabs { display: flex; flex-wrap: nowrap; gap: 1.5rem; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--line); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent); }
@media (min-width: 640px) { .subtabs { -webkit-mask-image: none; mask-image: none; } }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a, .subtabs button {
  position: relative; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 0.375rem;
  min-height: 2.5rem; padding: 0; border: 0; border-radius: 0; background: none;
  color: var(--muted); text-decoration: none; font: inherit; font-size: var(--fs-body); font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: color 150ms ease;
}
.subtabs a::after, .subtabs button::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: transparent; transition: background-color 150ms ease; }
.subtabs a[aria-current="page"], .subtabs a[aria-current="true"], .subtabs a[aria-selected="true"], .subtabs button[aria-selected="true"], .subtabs button[aria-pressed="true"] { color: var(--fg); }
.subtabs a[aria-current="page"]::after, .subtabs a[aria-current="true"]::after, .subtabs a[aria-selected="true"]::after, .subtabs button[aria-selected="true"]::after, .subtabs button[aria-pressed="true"]::after { background: var(--fg); }
.subtabs a:focus-visible, .subtabs button:focus-visible { box-shadow: var(--focus-ring-inset); border-radius: var(--radius-xs); }
@media (hover: hover) and (pointer: fine) { .subtabs a:hover, .subtabs button:hover { color: var(--fg); } }
.tab-count { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.375rem; border-radius: 999px; background: var(--panel-2); color: var(--text-2); font-size: var(--fs-badge); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.tab-count.urgent, .tab-count.bad { background: var(--bad-bg); color: var(--bad-fg); }
@media (min-width: 640px) { .sv-table td.wrap-ok { white-space: normal; min-width: 9rem; } }
/* alert lines: a dot in the state's colour, no stripes */
.sv-alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; font-size: var(--fs-body); }
.sv-alerts li { position: relative; padding: 0.25rem 0 0.25rem 1rem; }
.sv-alerts li::before { content: ''; position: absolute; left: 0.125rem; top: 0.8em; width: 0.375rem; height: 0.375rem; border-radius: 999px; background: var(--warn-fg); }
.sv-alerts li.bad::before { background: var(--bad-fg); }
.sv-bar { fill: var(--chart); }
.sv-bar:hover, .sv-bar:focus-visible { fill: var(--fg); outline: none; }
.sv-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.25rem 1rem; margin: 0; font-size: var(--fs-body); }
@media (min-width: 720px) { .sv-facts { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); } }
.sv-facts dt { color: var(--muted); }
.sv-facts dd { margin: 0; overflow-wrap: anywhere; }
.sv-status { margin: 0; font-size: var(--fs-meta); color: var(--muted); }
.sv-fields { margin: 0; }
.pf-box .field input, .pf-box .field select { width: 100%; }
@media print { .subtabs { display: none !important; } }

/* ---------- v3.32: the cost page ---------- */
.co-prices { margin-top: 0.5rem; border-top: 1px solid var(--line); padding-top: 0.625rem; }
.co-prices summary { cursor: pointer; font-weight: 600; font-size: var(--fs-section); }
.co-prices[open] summary { margin-bottom: 0.75rem; }
.co-fields { margin: 0 0 0.5rem; }
.co-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.375rem; }
.co-rank li { display: grid; grid-template-columns: minmax(9rem, 14rem) minmax(4rem, 1fr) auto; align-items: center; gap: 0.25rem 0.75rem; font-size: var(--fs-body); }
.co-rank .co-who { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-rank .co-per { grid-column: 3; text-align: right; }
.co-rank .co-total { text-align: right; font-variant-numeric: tabular-nums; }
.co-bar { display: flex; height: 0.75rem; border-radius: 3px; overflow: hidden; background: var(--panel-2); grid-row: span 2; }
.co-bar i { display: block; height: 100%; width: var(--w, 0%); }
.co-bar .fuel, .co-key.fuel, .co-part.fuel { --c: var(--go); }
.co-bar .driver, .co-key.driver, .co-part.driver { --c: var(--load); }
.co-bar .maint, .co-key.maint, .co-part.maint { --c: var(--setup); }
.co-bar .fixed, .co-key.fixed, .co-part.fixed { --c: var(--back); }
.co-bar i { background: var(--c); }
.co-key { display: inline-block; width: 0.625rem; height: 0.625rem; border-radius: 2px; margin-right: 0.375rem; vertical-align: 0; background: var(--c); }
.co-legend { margin-top: 0.75rem; }
@media (max-width: 639px) { .co-rank li { grid-template-columns: minmax(0, 1fr) auto; } .co-bar { grid-column: 1 / -1; grid-row: auto; } .co-rank .co-per { grid-column: 2; } }
.co-one-kpis { margin-bottom: 0.75rem; }
.co-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.5rem; margin-bottom: 0.25rem; }
/* a part of a cost: its category's colour as a small square at the top right (no stripe) */
.co-part { display: grid; gap: 0.125rem; padding: 0.5rem 1.5rem 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel) linear-gradient(var(--c), var(--c)) no-repeat calc(100% - 0.625rem) 0.75rem / 0.625rem 0.625rem; font-size: var(--fs-body); }
.co-part b { font-size: var(--fs-section); font-variant-numeric: tabular-nums; }
@media (min-width: 640px) { .co-table td.wrap-ok { white-space: normal; min-width: 9rem; } }
.co-h3 { font-size: var(--fs-section); font-weight: 600; letter-spacing: var(--ls-section); margin: 0.75rem 0 0.25rem; }
.co-why li { font-size: var(--fs-body); }

/* ---------- v3.33: customers ---------- */
.cu-first { border-top: 0; padding-top: 0; }
.pf-items a.pf-del { font-size: var(--fs-meta); }
.pf-box .ac-wrap { position: relative; }

/* ---------- v3.33: the order in five steps ---------- */
.wiz-head { display: grid; gap: 0.25rem; margin-top: 0.25rem; }
.wiz-head h2 { font-size: var(--fs-dialog); line-height: var(--lh-dialog); font-weight: 600; letter-spacing: var(--ls-dialog); margin: 0; outline: none; }
.wiz-help { margin: 0; color: var(--text-2); font-size: var(--fs-body); max-width: 46rem; }
.ptab.is-done .ptab-n { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.wiz-card .fields { margin: 0; }
.wiz-nav { position: sticky; bottom: 0; z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.625rem 0.75rem calc(0.625rem + env(safe-area-inset-bottom, 0px)); margin: 0 -0.25rem; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: color-mix(in srgb, var(--panel) 85%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); }
.wiz-nav .btn { min-height: var(--h-btn); }
.wiz-nav #wizNext { margin-left: auto; padding: 0 1.25rem; }
.wiz-nav [hidden] { display: none; }
.wiz-examples { font-size: var(--fs-body); color: var(--muted); }
.wiz-examples summary { cursor: pointer; width: fit-content; }
.wiz-examples .card-head { margin: 0.5rem 0 0; }
.ac .ac-new { border-top: 1px solid var(--line); color: var(--fg); font-weight: 500; }
#custInfo .st-chip { margin-right: 0.25rem; }
.avail { display: grid; gap: 0.5rem; padding: 0.75rem 0.875rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: transparent; margin-bottom: 0.75rem; }
.avail-line { margin: 0; font-size: var(--fs-body); }
/* availability under a vehicle row: a dot in the state's colour, no stripe */
.fleet-avail { position: relative; grid-column: 1 / -1; font-size: var(--fs-meta); padding: 0.125rem 0 0.125rem 1rem; border: 0; background: none; color: var(--text-2); }
.fleet-avail::before { content: ''; position: absolute; left: 0.125rem; top: 0.75em; width: 0.375rem; height: 0.375rem; border-radius: 999px; background: var(--line-strong); }
.fleet-avail.ok { color: var(--ok-fg); } .fleet-avail.ok::before { background: var(--ok-fg); }
.fleet-avail.warn::before { background: var(--warn-fg); }
.fleet-avail.bad { color: var(--bad-fg); } .fleet-avail.bad::before { background: var(--bad-fg); }
.avail-flag { color: var(--bad-fg); }
.plants-box { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.625rem 0.875rem; margin-bottom: 0.75rem; }
.plants-box summary { cursor: pointer; font-weight: 600; font-size: var(--fs-section); }
.plants-box[open] summary { margin-bottom: 0.625rem; }
details.card-details > summary { cursor: pointer; }
@media print { .wiz-nav, .wiz-head, .wiz-examples, .avail { display: none !important; } }

/* ---------- Dispatch ---------- */
/* .dp-table is the one platform table (see Tables); only its helpers remain here */
.dp-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dp-name { font-weight: 600; color: var(--fg); }
.dp-over { color: var(--bad-fg); font-weight: 600; }
.dp-bar { display: block; width: 100%; min-width: 6rem; height: 0.25rem; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin: 0.375rem 0 0.25rem; }
.dp-bar i { display: block; height: 100%; border-radius: 999px; background: var(--fg); }
.dp-now { stroke: var(--accent); stroke-width: 2; }
.dp-now-label { fill: var(--fg); font-weight: 600; }
.dp-count { min-width: 1.5rem; padding: 0 0.375rem; border-radius: 999px; background: var(--panel); border: 0; text-align: center; font-size: var(--fs-badge); letter-spacing: 0; color: var(--fg); font-variant-numeric: tabular-nums; }
.dp-none { margin: 0; font-size: var(--fs-meta); color: var(--muted); }
.dp-idle { margin: 0.75rem 0 0; }
.order-note { margin: 0.375rem 0 0; padding: 0.375rem 0.625rem; border: 0; border-radius: var(--radius-s); background: var(--panel-2); font-size: var(--fs-body); }
.drv-site { margin: 0.25rem 0 0; font-weight: 600; }

.live-job { display: block; margin-top: 0.125rem; font-size: var(--fs-meta); color: var(--muted); }
.live-job.busy { color: var(--fg); font-weight: 500; }
.fl-job { display: block; margin-top: 0.125rem; font-size: var(--fs-badge); color: var(--muted); text-decoration: none; }
.fl-job.busy { color: var(--fg); font-weight: 500; }

/* ---------- Public pages: the customer's order, the customer's own page, a delivery ticket ---------- */
.pub { max-width: 60rem; }
.pub-foot { max-width: 60rem; margin: 0 auto; padding: 1rem 1rem 2rem; font-size: var(--fs-meta); color: var(--muted); }
.pub-foot a { color: inherit; }
.pub-bar { height: 0.25rem; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin: 1rem 0 0.25rem; }
.pub-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--fg); transition: width 400ms ease; }
.pub-timeline { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.pub-timeline li { position: relative; padding-left: 1.5rem; color: var(--muted); }
.pub-timeline li::before { content: ""; position: absolute; left: 0.2rem; top: 0.4rem; width: 0.6rem; height: 0.6rem; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--panel); }
.pub-timeline li.done { color: var(--fg); }
.pub-timeline li.done::before { background: var(--ok-fg); border-color: var(--ok-fg); }
.pub-timeline li.now { color: var(--fg); }
.pub-timeline li.now::before { border-color: var(--accent); }
.pub-map { height: 20rem; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; isolation: isolate; }
.pub-pin span { display: block; width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); background: #C98A1A; }
.pub-pin.site span { background: #1F7A4D; border-radius: 4px; }
.pub-tip { font: 600 0.75rem/1.2 "Geist", system-ui, sans-serif; }
.pub-reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.pub-error, .form-error { margin: 0.75rem 0 0; color: var(--bad-fg); font-weight: 500; }
.tk-page { max-width: 48rem; }
.tk { display: grid; gap: 1.25rem; }
.tk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 1rem; border-bottom: 2px solid var(--fg); }
.tk-logo { height: 2rem; width: auto; }
.tk-title { display: grid; justify-items: end; gap: 0.1rem; text-align: right; }
.tk-title b { font-size: 1.375rem; font-weight: 600; letter-spacing: var(--ls-title); font-variant-numeric: tabular-nums; }
.tk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem 1.25rem; align-items: start; }
.tk-fact { display: grid; gap: 0.125rem; align-content: start; }   /* the values of a row stay on one line, whatever wraps beside them */
.tk-label { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.tk-value { font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 500; overflow-wrap: break-word; }
.tk-fact.strong .tk-value { font-size: 1.375rem; line-height: var(--lh-title); font-weight: 600; letter-spacing: var(--ls-title); font-variant-numeric: tabular-nums; }
.tk-times { padding: 0.875rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: transparent; }
.tk-times .tk-value { font-variant-numeric: tabular-nums; }
.tk-note p { margin: 0.25rem 0 0; }
.tk-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.tk-receiver { margin: 0.25rem 0; font-weight: 600; min-height: 1.5rem; }
.tk-signature { display: block; width: 100%; max-width: 16rem; height: 6rem; object-fit: contain; object-position: left bottom; border-bottom: 1px solid var(--fg); background: #fff; border-radius: 4px 4px 0 0; }
.tk-signature.empty { background: transparent; }
@media (max-width: 520px) { .tk-sign { grid-template-columns: 1fr; } .tk-title { justify-items: start; text-align: left; } }
@media print {
  .no-print, .pub-foot, #toast { display: none !important; }
  .tk-page { max-width: none; padding: 0; }
  .tk { border: 0; box-shadow: none; padding: 0; }
  .tk-times { background: none; }
  .tk-logo.logo-dark { display: none !important; }
  .tk-logo.logo-light { display: block !important; }
}
/* signing on the driver's phone */
.sig-pad { display: block; width: 100%; height: 11rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-s); background: #fff; touch-action: none; }
.sig-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.375rem; }
.drv-ticket { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--line); font-size: var(--fs-body); }
.tk-chip { display: inline-flex; align-items: center; gap: 0.25rem; font-size: var(--fs-badge); color: var(--muted); text-decoration: none; }
.tk-chip.signed { color: var(--ok-fg); }
.proc-table .tk-chip { display: flex; margin-top: 0.125rem; font-weight: 500; }
.rq-items li { display: block; }
.rq-items .row-actions { margin-top: 0.375rem; }
.cu-notify { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.75rem 0 0; font-size: var(--fs-body); }
.cust-credit.over { color: var(--bad-fg); }

/* ---------- Finance ---------- */
.fi-lines input { width: 100%; min-height: var(--h-btn-sm); padding: 0 0.5rem; }
@media (min-width: 640px) { .fi-lines .fi-desc { min-width: 16rem; } }
.fi-lines .fi-num { width: 6.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.fi-lines .fi-vat { width: 4.5rem; }
.fi-lines .missing { border-color: var(--bad-fg); }
.fi-totals, .iv-totals { display: grid; gap: 0.25rem; justify-content: end; margin: 1rem 0 0; }
.fi-totals div, .iv-totals div { display: flex; justify-content: space-between; gap: 2.5rem; font-variant-numeric: tabular-nums; }
.fi-totals .grand, .iv-totals .grand { padding-top: 0.375rem; border-top: 2px solid var(--fg); font-size: var(--fs-dialog); font-weight: 600; }
.fi-orders li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.fi-orders .check-inline { flex: 1 1 20rem; align-items: flex-start; }
.fi-void td { color: var(--muted); text-decoration: line-through; }
.fi-void td:last-child, .fi-void td:nth-last-child(2) { text-decoration: none; }
.iv-co { margin: 0.5rem 0 0; max-width: 22rem; }
.iv-lines { margin-top: 0.25rem; }
@media (max-width: 639px) {
  .fi-lines .fi-num, .fi-lines .fi-vat { width: 100%; text-align: left; }
  table:not(.table-custom-phone) > tbody > tr > td:has(> .fi-desc) { grid-column: 1 / -1; }
}

div[data-panel]:not([hidden]) { display: grid; gap: 1rem; min-width: 0; }

/* ---------- The driver's daily check of the vehicle ---------- */
.drv-inspect.done { padding-block: 0.875rem; }
.drv-inspect.bad { border-color: var(--bad-fg); }
/* the daily check: plain rows with a hairline between them; the answer is a segmented control */
.ins-list { list-style: none; margin: 0.5rem 0; padding: 0; display: grid; gap: 0; }
.ins-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; border: 0; border-radius: 0; background: none; }
.ins-list li + li { border-top: 1px solid var(--line); }
.ins-list li.bad { color: var(--bad-fg); }
.ins-seg { flex: none; }
.ins-seg .seg-btn { min-height: 2.25rem; padding: 0 0.75rem; }
.ins-seg .seg-btn.bad[aria-pressed="true"] { background: var(--bad-bg); color: var(--bad-fg); box-shadow: 0 0 0 1px color-mix(in srgb, var(--bad-fg) 35%, transparent); }
.ins-open li { display: block; }
.ins-plates { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.375rem 0 0; }
.ins-resolve { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.375rem; }
.ins-resolve input { flex: 1 1 14rem; }

/* ---------- Quality ---------- */
.qu-due li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem; }
.qu-enter { display: inline-flex; gap: 0.375rem; margin-left: auto; }
.qu-mpa { width: 6rem; min-height: var(--h-btn-sm); padding: 0 0.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.dp-plus { color: var(--ok-fg); }
/* ---------- Quotes ---------- */
dialog form.qt-form { display: block; }
.qt-form > * + * { margin-top: 1rem; }
.qt-form .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.75rem 1rem; }
.qt-form .dlg-actions { justify-content: flex-start; }
.qt-form > .dlg-actions:last-child { justify-content: flex-end; }

/* ---------- Day panel, reorganised (v3.39): a short head, four numbers, two columns, the fleet folded at the foot ---------- */
.dash-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.dash-tools input[type="date"] { font-variant-numeric: tabular-nums; }
.dash-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 900px) { .dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; } }
/* one column on a phone, in the order a day is read; two columns on a wide screen */
.dash-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.dash-main, .dash-aside { display: contents; }
@media (min-width: 1280px) {
  .dash-layout { grid-template-columns: minmax(0, 1fr) 23rem; align-items: start; }
  .dash-main, .dash-aside { display: grid; gap: 1rem; min-width: 0; align-content: start; }
  .dash-layout > * > .card { order: 0; }
}
.dash-sub { margin: -0.375rem 0 0.75rem; }
/* an order of the day */
.do-name { font-size: var(--fs-section); font-weight: 600; letter-spacing: var(--ls-section); color: var(--fg); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .do-name:hover { text-decoration: underline; } }
.do-time { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.do-meta { margin: -0.375rem 0 0; font-size: var(--fs-meta); color: var(--muted); }
.dash-charts { display: grid; gap: 0.875rem; }
.dash-hours { display: grid; gap: 0.5rem; }
.dash-hours[hidden] { display: none; }
.dash-hours .dash-legend { margin: 0; }
.dash-hours .dash-chart { margin-top: 0; }
.dash-charts { position: relative; }
.dash-charts .tr-card { gap: 0.75rem; }
.dash-charts .tr-card > .card-head { margin: 0; }
.dash-charts .tr-card > .card-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 640px) { .dash-charts .tr-card > .card-head { position: absolute; top: 1.25rem; right: 1.5rem; } }
/* what waits today: short rows, each a link */
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.375rem; }
/* the text and the chevron of a row of what waits */
.todo-text { grid-column: 2; }
.todo-chev { grid-column: 3; grid-row: 1 / span 2; width: 1rem; height: 1rem; color: var(--muted); }
/* weather in the side column */
.wx-compact { gap: 0.625rem; }
.wx-compact .card-head .btn { min-height: var(--h-btn-sm); padding: 0 0.625rem; font-size: var(--fs-btn-sm); }
.wx-compact .wx-icon { width: 2.75rem; height: 2.75rem; border-radius: var(--radius-s); }
.wx-compact .wx-icon .wx-ico { width: 1.625rem; height: 1.625rem; }
.wx-compact .wx-temp { font-size: var(--fs-title); }
.wx-compact .wx-main span { font-size: var(--fs-meta); color: var(--muted); }
.wx-compact .wx-facts { display: none; }
.wx-compact .wx-advice li { padding: 0.125rem 0 0.125rem 1rem; font-size: var(--fs-body); }
.wx-compact .wx-hours { overflow: hidden; padding: 0; }
.wx-compact .wx-hours li { flex: 1 1 0; }
.wx-compact .wx-hours li:nth-child(n+6) { display: none; }
.wx-compact .wx-days { font-size: var(--fs-badge); gap: 0.125rem 0.75rem; }
/* the fleet at the foot: a quiet strip of numbers, the first rows, the rest on demand */
.dash-fleet-card { display: grid; gap: 0.875rem; }
.dash-fleet-card .card-head { margin-bottom: 0; align-items: flex-start; }
.dash-fleet-title { display: grid; gap: 0.125rem; min-width: 0; }
.dash-fleet-title p { margin: 0; }
/* a quiet strip of numbers in one card, hairlines between them */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; overflow: hidden; }
.stat-strip .stat { min-width: 0; padding: 0.625rem 0.875rem; border: 0; border-radius: 0; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.stat-strip dt { font-size: var(--fs-badge); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.stat-strip dd { margin: 0.125rem 0 0; font-size: var(--fs-dialog); font-weight: 600; letter-spacing: var(--ls-dialog); font-variant-numeric: tabular-nums; }
.stat-strip dd small { display: block; font-size: var(--fs-badge); font-weight: 400; letter-spacing: 0; color: var(--muted); }
@media print { .dash-tools { display: none !important; } }

/* ---------- v3.40: the planner's step bar; sheets close from the top too ----------
   The step buttons may shrink (short labels on phones); the bar stays at the foot of the window beside the sidebar. */
.wiz-nav .btn { min-width: 0; }
/* the step bar stays at the foot of the window on every step, also when a step is short or scrolled to its end */
body[data-ptab] .wiz-nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 0; border-width: 1px 0 0;
  padding-left: max(1rem, env(safe-area-inset-left, 0px), calc((100% - 72rem) / 2 + 1rem));
  padding-right: max(1rem, env(safe-area-inset-right, 0px), calc((100% - 72rem) / 2 + 1rem)); }
@media (min-width: 900px) { :is(body.has-rail, body.has-shell)[data-ptab] .wiz-nav { left: var(--rail-w, 14.5rem); padding-left: max(1.5rem, calc((100% - 76rem) / 2 + 1.5rem)); padding-right: max(1.5rem, calc((100% - 76rem) / 2 + 1.5rem)); } }
.wiz-nav .wl-short { display: none; }
@media (max-width: 599px) { .wiz-nav .wl-long { display: none; } .wiz-nav .wl-short { display: inline; } }
/* the close button of a sheet: 32px, quiet, top right */
.sheet-x { position: absolute; top: 0.875rem; right: 0.875rem; z-index: 3; width: 2rem; height: 2rem; min-height: 0; padding: 0; display: grid; place-items: center; border-radius: var(--radius-s); border: 0; background: var(--raised); color: var(--muted); cursor: pointer; transition: background-color 150ms ease, color 150ms ease; }
.sheet-x svg { width: 1rem; height: 1rem; }
.sheet-x:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .sheet-x:hover { background: var(--panel-2); color: var(--fg); } }
@media (min-width: 768px) { .sheet-x { top: 1.25rem; right: 1.25rem; } }
/* touch screens: a 44px target, like every other control of the sheet */
@media (pointer: coarse) { .sheet-x { width: 2.75rem; height: 2.75rem; top: 0.5rem; right: 0.5rem; } }
@media (pointer: coarse) and (min-width: 768px) { .sheet-x { top: 0.875rem; right: 0.875rem; } }
dialog.sheet:has(.sheet-x) .sheet-inner > h2:first-of-type, dialog.sheet:has(.sheet-x) .sheet-inner > .sheet-handle + h2 { padding-right: 2.75rem; }
/* once the content scrolls, the pinned ✕ gets an opaque strip over the whole width (with a hairline), so no text or
   field is ever cut by the button; at the top nothing changes. Browsers without scroll timelines keep the old look. */
@supports (animation-timeline: scroll()) {
  dialog.sheet:has(> .sheet-x) { timeline-scope: --sheet-scroll; }
  dialog.sheet:has(> .sheet-x) > .sheet-inner { scroll-timeline: --sheet-scroll block; }
  dialog.sheet:has(> .sheet-x)::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; z-index: 2; height: 3.75rem; pointer-events: none;
    border-radius: inherit; background: var(--raised); box-shadow: 0 1px 0 var(--line); opacity: 0;
    animation: sheet-x-band linear both; animation-timeline: --sheet-scroll; animation-range: 0 2.5rem;
  }
  @media (min-width: 768px) { dialog.sheet:has(> .sheet-x)::before { height: 4.5rem; } }
}
@keyframes sheet-x-band { from { opacity: 0; } to { opacity: 1; } }
/* a sheet's header stays on top while its content scrolls, covering the padding above it (nothing shows through) */
.sheet-inner .pf-head { position: sticky; top: calc(-1 * var(--sheet-pad-top, 0px)); z-index: 2; margin-top: calc(-1 * var(--sheet-pad-top, 0px)); padding: var(--sheet-pad-top, 0.375rem) 0 0.75rem; background: var(--raised); box-shadow: 0 1px 0 var(--line); }

/* the suggestion on the fleet step: one line, why, apply; the other options folded */
.suggest { border: 1px solid var(--line-strong); background: var(--panel); border-radius: var(--radius); padding: 0.875rem 1rem; margin-bottom: 0.875rem; display: grid; gap: 0.5rem; }
.suggest-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.375rem 0.625rem; }
.suggest-tag { font-size: var(--fs-badge); line-height: var(--lh-badge); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-2); background: var(--panel-2); padding: 0.125rem 0.5rem; border-radius: 999px; }
.suggest-main { margin: 0; font-size: var(--fs-body); line-height: 1.45; }
.suggest-why { margin: 0; font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--muted); max-width: 80ch; }
.suggest-options { display: grid; gap: 0.625rem; padding-top: 0.25rem; border-top: 1px solid var(--line); }
.suggest-prefs { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.suggest-pref { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--fs-meta); color: var(--muted); }
.suggest-pref input { width: 4.5rem; min-height: var(--h-btn-sm); }
.suggest-rows { display: grid; gap: 0.25rem; }
.suggest-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; padding: 0.375rem 0.5rem; border-radius: var(--radius-s); }
.suggest-row > span { display: grid; min-width: 0; }
.suggest-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-row.is-rec { background: var(--panel-2); }
@media (max-width: 479px) { .suggest-row { grid-template-columns: minmax(0, 1fr) auto; } .suggest-row > span:nth-child(2) { grid-column: 1; } .suggest-row > button { grid-row: 1 / span 2; grid-column: 2; } }

/* ---------- v3.40: the customers' space (orders.inerteexpress.al): a code to sign in, three steps to ask, a conversation ---------- */
.sp-card { width: min(28rem, 100%); display: grid; gap: 0.875rem; }
.sp-card h1 { margin: 0; }
.sp-card .lead { margin: 0; }
.sp-wide { width: 100%; margin-top: 0.5rem; }
.sp-code { font-size: 1.75rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.sp-row { justify-content: space-between; margin-top: 0.5rem; }
.sp-help { margin: 0; }
.sp-who { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 479px) { .sp-who { display: none; } }
.sp-hero { padding-bottom: 0.25rem; }
.sp-steps { display: flex; flex-wrap: wrap; gap: 0.375rem; list-style: none; margin: 0 0 1rem; padding: 0; counter-reset: sp; }
.sp-steps li { counter-increment: sp; display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.75rem 0.25rem 0.375rem; border-radius: 999px; border: 1px solid var(--line); font-size: var(--fs-meta); color: var(--muted); }
.sp-steps li::before { content: counter(sp); display: grid; place-items: center; width: 1.375rem; height: 1.375rem; border-radius: 50%; background: var(--panel-2); font-weight: 600; font-size: var(--fs-badge); }
.sp-steps li[aria-current="step"] { color: var(--fg); border-color: var(--fg); font-weight: 500; }
.sp-steps li[aria-current="step"]::before { background: var(--fg); color: var(--panel); }
.sp-steps li.done::before { background: var(--ok-bg); color: var(--ok-fg); }
.sp-step .hint { margin-top: 0; }
.sp-mapbox { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.sp-map { height: min(55vh, 22rem); border-radius: var(--radius-s); border: 1px solid var(--line); isolation: isolate; }
.sp-map .leaflet-container, .sp-map.leaflet-container { cursor: crosshair; }
.sp-nav { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 1rem; }
.sp-nav .btn-primary { margin-left: auto; }
.sp-summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.375rem 1rem; margin: 0 0 1rem; padding: 0.875rem 1rem; border-radius: var(--radius-s); background: var(--panel-2); }
.sp-summary dt { color: var(--muted); font-size: var(--fs-meta); }
.sp-summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sp-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem; }
.sp-list li { padding: 0.625rem 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem; }
.sp-list li > div { flex-basis: 100%; }
.sp-sub { margin-top: 0.5rem; }
.sp-thread { display: grid; gap: 0.625rem; align-content: start; max-height: min(60vh, 32rem); min-height: 10rem; overflow: auto; padding: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); overscroll-behavior: contain; }
.sp-msg { max-width: min(36rem, 88%); padding: 0.5rem 0.75rem; border-radius: 0.875rem 0.875rem 0.875rem 0.25rem; background: var(--panel-2); border: 0; justify-self: start; }
.sp-msg.mine { justify-self: end; border-radius: 0.875rem 0.875rem 0.25rem 0.875rem; background: var(--primary); color: var(--primary-fg); }
.sp-msg.mine .muted { color: inherit; opacity: 0.75; }
.sp-msg.auto { background: var(--ok-bg); color: var(--ok-fg); }
.sp-msg-meta { font-size: var(--fs-badge); margin-bottom: 0.125rem; }
.sp-msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.sp-empty { margin: auto; text-align: center; max-width: 30rem; }
.sp-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; margin-top: 0.75rem; align-items: end; }
.sp-compose textarea { min-height: 2.875rem; resize: vertical; }

/* the office's conversations with customers: the list on the left, the open one on the right (one at a time on a phone) */
.cm-layout { display: grid; grid-template-columns: minmax(14rem, 20rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.cm-threads { display: grid; gap: 0.25rem; max-height: min(65vh, 36rem); overflow: auto; }
.cm-thread { display: grid; gap: 0.125rem; text-align: left; width: 100%; padding: 0.625rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); color: inherit; font: inherit; cursor: pointer; }
/* unread: an accent dot at the top right (the accent's job), the name in 600 */
.cm-thread.unread { padding-right: 1.5rem; background: var(--panel) radial-gradient(circle at calc(100% - 0.75rem) 0.875rem, var(--accent) 0.25rem, transparent 0.28rem) no-repeat; }
.cm-thread.unread .cm-name { font-weight: 600; }
.cm-thread.is-open { border-color: var(--fg); background-color: var(--panel-2); }
@media (hover: hover) and (pointer: fine) { .cm-thread:not(.is-open):hover { background-color: var(--panel-2); } }
.cm-name { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.cm-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-view { display: grid; gap: 0.5rem; }
.cm-head { display: flex; align-items: center; gap: 0.5rem; }
.cm-head h3 { margin: 0; flex: 1; font-size: var(--fs-section); letter-spacing: var(--ls-section); }
.cm-back { display: none; }
.rq-src { margin-left: 0.375rem; }
@media (max-width: 759px) {
  .cm-layout { grid-template-columns: minmax(0, 1fr); }
  .cm-layout.has-view .cm-threads { display: none; }
  .cm-back { display: inline-flex; }
}
.ac-tag { margin-left: auto; flex: 0 0 auto; font-size: var(--fs-badge); font-weight: 500; padding: 0 0.4375rem; border-radius: 999px; background: var(--ok-bg); color: var(--ok-fg); }

/* an order of several grades (v3.42): the extra lines under the first grade */
.grade-line { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0.5rem; align-items: end; padding: 0.625rem 0; border-top: 1px solid var(--line); }
.grade-line .field { margin: 0; }
.grade-line .err { grid-column: 1 / -1; }
.grade-remove { width: var(--h-input); min-width: var(--h-input); height: var(--h-input); font-size: 1.125rem; line-height: 1; }
@media (max-width: 599px) { .grade-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .grade-line .field:nth-child(3) { grid-column: 1; } .grade-remove { grid-column: 2; justify-self: end; } }
.cell-grade { display: inline-block; margin-left: 0.375rem; font-size: var(--fs-badge); color: var(--muted); }
.sp-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0.5rem; align-items: end; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.sp-line .field { margin: 0; }

/* ---------- Less transparency asked: solid bars and panels ---------- */
@media (prefers-reduced-transparency: reduce) {
  .ptabs { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .wiz-nav, body[data-ptab] .wiz-nav { background: var(--panel); -webkit-backdrop-filter: none; backdrop-filter: none; }
  dialog.sheet::backdrop, dialog.dlg::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .leaflet-container .leaflet-control-attribution.leaflet-control-attribution { background: var(--bg); }
}

/* ---------- Print: always on white paper, whatever the device's theme ----------
   Last in the file so these tokens win over the dark blocks (also the "follow the device" one); the shell, panels,
   toasts and tools are not printed. Anything else that must not print carries .no-print. */
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --bg: #fff; --sidebar: #fff; --panel: #fff; --raised: #fff; --seg-on: #fff; --field-bg: #fff; --panel-2: #f3f3f3; --paper: #fff;
    --line: #c8c8c8; --line-strong: #8a8a8a; --ring: rgba(0, 0, 0, 0.18);
    --fg: #000; --text-2: #333; --muted: #4a4a4a; --faint: #777;
    --primary: #111; --primary-fg: #fff; --primary-hover: #111;
    --accent-text: #6B4A16; --accent-soft: #fff;
    --ok-fg: #15803D; --ok-bg: #ECFDF3; --warn-fg: #B45309; --warn-bg: #FFF7E6;
    --bad-fg: #B42318; --bad-bg: #FEF3F2; --info-fg: #1D4ED8; --info-bg: #EFF4FF; --chart: #2563EB; --danger: #B42318; --danger-fg: #fff;
    --load: #3F6A94; --go: #B8891B; --wait: #C23B2A; --pour: #277A4E; --back: #7F8A90; --setup: #6F58A8; --bar-text: #fff;
    --shadow-1: none; --shadow-pop: none; --shadow-modal: none;
    --icon-chevron: none; --icon-search: none; --icon-clear: none;
    color-scheme: light;
  }
  html { font-size: 11pt; }
  body { background: #fff; color: #000; padding: 0 !important; }
  main { animation: none; }
  .topbar, .sidebar, .sidebar-backdrop, .acct-menu, .float-panel, .float-sheet, .skip, .dock, #toast, .ie-toasts, .ie-more,
  .cookie-banner, .pager, .subtabs, .sheet-x, .legacy-hidden, .no-print, .foot-links, .presets, .card-actions, .zoom, .note,
  .chart-detail, .form-status, .route-actions, .ac, .hero .lead, .toolbar, .att-filters { display: none !important; }
  .logo-dark, .tk-logo.logo-dark { display: none !important; }
  .logo-light, .tk-logo.logo-light { display: block !important; }
  .page, .wrap { max-width: none; padding: 0; gap: 0.75rem; }
  .card, .panel, .kpi { box-shadow: none; break-inside: avoid; }
  .sum, .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .field input { border-color: #999; min-height: 2rem; }
  .stepper button { display: none; }
  .chart-scroll { overflow: visible; border: 0; }
  .gantt { display: block; }
  .bar, .legend i, .chip, .vline span, .status-pill, .st-chip, .pill, .plate-chip { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  table { font-size: 10pt; }
  tbody tr { break-inside: avoid; }
  .print-meta { display: block; color: var(--muted); font-size: 9pt; }
  .map { display: none; }
  a[href]::after { content: none; }
}
