/* VTG Assistant design system.
   Brand from vtgwaste.com.au: green #3baf28, Nunito. VTG's bright green fails WCAG AA as text on white, so it is
   used for the logo, focus and accents; text and filled buttons use --brand-ink (same hue, darker in light mode,
   lighter in dark mode). UI type is Inter with tabular figures; display headings are Nunito.
   Light and dark are both designed: dark values are selected, not inverted, and the chart palette is validated
   on each card surface (dataviz validator: light #ffffff, dark #161a17). */

:root {
  color-scheme: light;
  --brand: #3baf28;
  --brand-ink: #2c6b1d;
  --brand-fill: #2f7a20;
  --on-brand: #ffffff;
  --brand-soft: #edf7ea;
  --brand-ring: rgba(59, 175, 40, .28);

  --page: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #f9faf8;
  --hover: #f1f5ef;
  --ink: #101511;
  --ink-2: #454d46;
  --muted: #6b736b;
  --line: rgba(16, 26, 18, .09);
  --line-2: rgba(16, 26, 18, .15);

  --good: #1d7a33; --good-bg: #e9f6ec;
  --bad: #b42318; --bad-bg: #fdeeec;
  --warn: #8a5400; --warn-bg: #fff6e3; --warn-line: #f0c46b;

  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4;
  --grid: #e7e8e3; --axis: #8a8f87;

  --shadow-sm: 0 1px 2px rgba(16, 26, 18, .05);
  --shadow: 0 1px 2px rgba(16, 26, 18, .04), 0 4px 14px -6px rgba(16, 26, 18, .10);
  --shadow-lg: 0 24px 60px -20px rgba(16, 26, 18, .35), 0 2px 6px rgba(16, 26, 18, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --side: 248px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Nunito", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #4cc236; --brand-ink: #7fd86d; --brand-fill: #3baf28; --on-brand: #06140a;
    --brand-soft: rgba(76, 194, 54, .13); --brand-ring: rgba(76, 194, 54, .35);
    --page: #0c0f0d; --surface: #161a17; --surface-2: #1b201c; --hover: #20261f;
    --ink: #eef1ec; --ink-2: #c2c8bf; --muted: #8e968c;
    --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
    --good: #4cc26a; --good-bg: rgba(76, 194, 106, .12);
    --bad: #f28b82; --bad-bg: rgba(242, 139, 130, .12);
    --warn: #f0b45a; --warn-bg: rgba(240, 180, 90, .10); --warn-line: rgba(240, 180, 90, .35);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181;
    --grid: #2a302b; --axis: #8e968c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .06);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #4cc236; --brand-ink: #7fd86d; --brand-fill: #3baf28; --on-brand: #06140a;
  --brand-soft: rgba(76, 194, 54, .13); --brand-ring: rgba(76, 194, 54, .35);
  --page: #0c0f0d; --surface: #161a17; --surface-2: #1b201c; --hover: #20261f;
  --ink: #eef1ec; --ink-2: #c2c8bf; --muted: #8e968c;
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
  --good: #4cc26a; --good-bg: rgba(76, 194, 106, .12);
  --bad: #f28b82; --bad-bg: rgba(242, 139, 130, .12);
  --warn: #f0b45a; --warn-bg: rgba(240, 180, 90, .10); --warn-line: rgba(240, 180, 90, .35);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181;
  --grid: #2a302b; --axis: #8e968c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .06);
}

/* ---- base ---- */
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; background: var(--page) }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; text-wrap: balance; color: var(--ink) }
h1 { font-family: var(--font-head); font-weight: 800; font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1.2 }
h2 { font-size: 1rem } h3 { font-size: 0.92rem }
p { text-wrap: pretty }
a { color: var(--brand-ink); text-underline-offset: 2px }
.num, td, .dash-tile b, .tile b, .tcard b, .kpis b { font-variant-numeric: tabular-nums }
[hidden] { display: none !important }
button, input, textarea, select { font: inherit; color: inherit }
button { cursor: pointer }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px }
::selection { background: var(--brand-ring) }
.muted { color: var(--muted) }
.small { font-size: 0.8rem; margin: 0 }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow) }
.skip:focus { top: 12px }
kbd { font-family: var(--font); font-size: 0.7rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface) }
@keyframes pulse { 50% { opacity: .35 } }
@keyframes rise { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes shimmer { to { background-position: -200% 0 } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important } }

/* icons drawn inline: one stroke style everywhere */
:where(.side, .topbar, .tabbar, .btn, .icon-btn, .send, .cmdk, .cmdk-btn, .sample-banner, .auth-points, .page-bar, .head-actions) svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none
}

/* ---- buttons and inputs ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 550; font-size: 0.9rem; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, transform .1s, box-shadow .15s }
.btn:hover { background: var(--hover) }
.btn:active { transform: translateY(1px) }
.btn.primary { background: var(--brand-fill); border-color: transparent; color: var(--on-brand); box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 4px 14px -6px var(--brand-ring) }
.btn.primary:hover { filter: brightness(1.08) }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--ink-2) }
.btn.ghost:hover { background: var(--hover); color: var(--ink) }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 0.84rem }
.btn.lg { min-height: 46px; font-size: 0.98rem }
.btn[disabled] { opacity: .55; cursor: default; transform: none }
.btn.stop { background: var(--bad); border-color: var(--bad); color: #fff }
a.btn { color: var(--ink) } a.btn.primary { color: var(--on-brand) }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--ink-2); transition: background .15s, color .15s }
.icon-btn:hover { background: var(--hover); color: var(--ink) }
.field { display: grid; gap: 6px }
.field label { font-size: 0.78rem; font-weight: 600; color: var(--ink-2) }
.input, select.input { min-height: 38px; padding: 7px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s }
.input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring) }
.pill { display: inline-flex; align-items: center; font-size: 0.7rem; font-weight: 650; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); letter-spacing: .01em }
.form-error { background: var(--bad-bg); color: var(--bad); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; font-size: 0.9rem }
.sample-banner { display: none; align-items: center; justify-content: center; gap: 8px; background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--warn-line); font-size: 0.82rem; font-weight: 500; padding: 7px 16px }
.sample-banner svg { width: 16px; height: 16px }
body.on-sample .sample-banner { display: flex }

/* ---- app shell: sidebar on desktop, top bar + tab bar on phones ---- */
body.shell { height: 100dvh; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); overflow: hidden }
.side { grid-row: 1 / -1; display: flex; flex-direction: column; gap: 14px; padding: 18px 14px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto }
.side-brand { padding: 4px 8px 6px; display: block }
.side-brand img { height: 26px; width: auto; display: block }
.cmdk-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 0.86rem; text-align: left; transition: border-color .15s, background .15s }
.cmdk-btn:hover { border-color: var(--brand); color: var(--ink-2) }
.cmdk-btn span { flex: 1 }
.cmdk-btn svg { width: 16px; height: 16px }
.side-nav { display: grid; gap: 2px }
.side-label { font-size: 0.68rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px }
.side-nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: 0.92rem; transition: background .15s, color .15s }
.side-nav a:hover { background: var(--hover); color: var(--ink) }
.side-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink) }
.side-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand) }
.side-foot { margin-top: auto; display: grid; gap: 8px }
.side-theme { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 0.84rem; text-transform: none }
.side-theme:hover { background: var(--hover); color: var(--ink-2) }
.i-moon { display: none }
:root[data-theme="dark"] .i-sun { display: none } :root[data-theme="dark"] .i-moon { display: block }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: none } :root:not([data-theme="light"]) .i-moon { display: block } }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line) }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; color: var(--on-brand); background: linear-gradient(135deg, var(--brand), var(--brand-fill)) }
.me-text { flex: 1; min-width: 0; display: grid; gap: 1px }
.me-text b { font-size: 0.88rem; font-weight: 600; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.me-text .pill { justify-self: start }
.topbar, .tabbar { display: none }
.main { min-width: 0; height: 100dvh; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth }
.page-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 12px 28px; background: color-mix(in srgb, var(--page) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line) }
.page-bar-title { font-family: var(--font); font-size: 0.98rem; font-weight: 650; letter-spacing: -0.01em }
.spacer { flex: 1 }

/* ---- command palette ---- */
.cmdk { position: fixed; inset: 0; z-index: 50; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 9, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px) }
.cmdk-panel { position: relative; width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s var(--ease) }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line) }
.cmdk-input svg { color: var(--muted) }
.cmdk-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1.02rem; min-width: 0 }
.cmdk-list { overflow-y: auto; padding: 6px }
.cmdk-head { font-size: 0.7rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none }
.cmdk-item[aria-selected="true"] { background: var(--brand-soft) }
.cmdk-item[aria-selected="true"] .cmdk-ic { color: var(--brand-ink); border-color: var(--brand-ring) }
.cmdk-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line-2); color: var(--muted); background: var(--surface) }
.cmdk-ic svg { width: 16px; height: 16px }
.cmdk-txt { display: grid; min-width: 0 }
.cmdk-txt b { font-weight: 550; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.cmdk-txt small { color: var(--muted); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.cmdk-empty { color: var(--muted); padding: 18px 12px; margin: 0; font-size: 0.9rem }
.cmdk-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 0.74rem; color: var(--muted); background: var(--surface-2) }
.cmdk-foot kbd { margin-right: 3px }
body.cmdk-open { overflow: hidden }

/* ---- sign in ---- */
body.auth { min-height: 100dvh }
.auth-grid { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) }
.auth-brand { position: relative; overflow: hidden; color: #eef7ec; background: radial-gradient(1200px 600px at -10% -10%, #3baf28 0%, transparent 55%), radial-gradient(900px 600px at 110% 110%, #1b5d12 0%, transparent 60%), linear-gradient(160deg, #123d0c, #0a1f07); display: grid; align-items: center; padding: 56px }
.auth-brand::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent) }
.auth-brand-inner { position: relative; z-index: 1; max-width: 480px; display: grid; gap: 26px }
.auth-logo-light { height: 30px; width: auto; filter: brightness(0) invert(1); opacity: .95 }
.auth-brand h2 { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; color: #fff }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px }
.auth-points li { display: flex; gap: 14px; align-items: flex-start }
.auth-points svg { width: 22px; height: 22px; padding: 8px; box-sizing: content-box; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: #c7f0bd }
.auth-points span { display: grid; gap: 2px; color: rgba(238,247,236,.78); font-size: 0.92rem }
.auth-points b { color: #fff; font-weight: 600 }
.auth-fine { margin: 0; font-size: 0.8rem; color: rgba(238,247,236,.6) }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--page) }
.auth-card { width: min(400px, 100%); display: grid; gap: 22px; animation: rise .4s var(--ease) }
.auth-card .logo { height: 36px; width: auto; justify-self: start }
.auth-card h1 { font-size: 1.9rem; margin-bottom: 4px }
.auth-card p { margin: 0 }
.auth-card form { display: grid; gap: 14px }
.auth-card .input { width: 100%; min-height: 46px; font-size: 1rem }
.signin-foot { display: grid; gap: 2px; font-size: 0.78rem; color: var(--muted); padding-top: 18px; border-top: 1px solid var(--line) }

/* ---- chat ---- */
.chat-main { display: flex; flex-direction: column; overflow: hidden }
.chat-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth }
.chat-col { max-width: 860px; margin-inline: auto; padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 22px }
.greet { display: grid; gap: 2px; animation: rise .35s var(--ease) }
.greet-kicker { font-size: 0.9rem; font-weight: 600; color: var(--brand-ink) }
.greet h1 { font-size: clamp(1.6rem, 3vw, 2.1rem) }
.msg { max-width: 100%; min-width: 0; animation: rise .25s var(--ease) }
.msg.user { align-self: flex-end; max-width: 78%; background: var(--brand-fill); color: var(--on-brand); padding: 10px 15px; border-radius: 18px 18px 6px 18px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--shadow-sm) }
.msg.bot { align-self: stretch; overflow-wrap: anywhere; position: relative; padding-left: 40px }
.msg.bot::before { content: ""; position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--brand-fill)); box-shadow: 0 2px 8px -2px var(--brand-ring) }
.msg.bot::after { content: "V"; position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 0.85rem; color: var(--on-brand) }
.msg.bot p { margin: 0 0 10px } .msg.bot p:last-child { margin-bottom: 0 }
.msg.bot h4 { font-size: 0.95rem; margin: 12px 0 4px }
.msg.bot ul, .msg.bot ol { margin: 0 0 10px; padding-left: 20px }
.msg.bot li { margin: 2px 0 }
.msg.bot code { font-size: 0.85em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px }
.msg.bot .err { color: var(--bad); background: var(--bad-bg); border-radius: var(--radius-sm); padding: 9px 12px; margin-top: 6px }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px }
.step { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px }
.step::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good) }
.step.running::before { background: var(--brand); animation: pulse 1.2s ease-in-out infinite }
.typing { display: inline-flex; gap: 5px; padding: 8px 0 }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .6; animation: pulse 1s ease-in-out infinite }
.typing span:nth-child(2) { animation-delay: .15s } .typing span:nth-child(3) { animation-delay: .3s }
.hello { display: grid; gap: 4px }
.hello h2 { font-size: 0.78rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted) }
.hello p { margin: 0 0 6px; color: var(--ink-2); font-size: 0.9rem }
.suggest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px }
.suggest button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 13px 15px; display: grid; gap: 3px; align-content: start; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s }
.suggest button:hover { border-color: var(--brand); transform: translateY(-1px); box-shadow: var(--shadow) }
.suggest small { font-size: 0.68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-ink) }
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px }
.msg-actions button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 11px; font-size: 0.76rem; color: var(--ink-2); transition: background .15s, border-color .15s }
.msg-actions button:hover { background: var(--hover); border-color: var(--line-2) }
.chat-form { padding: 0 28px calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent, var(--page) 30%) }
.chat-form-inner { max-width: 860px; margin-inline: auto; display: grid; gap: 7px }
.composer { display: flex; gap: 6px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s }
.composer:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring), var(--shadow) }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; min-height: 26px; max-height: 180px; padding: 7px 0; background: transparent; line-height: 1.45; font-size: 0.98rem }
.composer textarea::placeholder { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.send { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--brand-fill); color: var(--on-brand); transition: transform .12s, filter .15s, opacity .15s }
.send:hover { filter: brightness(1.08) }
.send:active { transform: scale(.94) }
.send[disabled] { opacity: .4; cursor: default }
.send.stop { background: var(--ink); color: var(--surface) }
.send svg { width: 18px; height: 18px; stroke-width: 2.2 }
.chat-foot { margin: 0; font-size: 0.72rem; color: var(--muted); text-align: center }
#chatMic.on { color: var(--bad); background: var(--bad-bg) }
#chatMic.on svg { animation: pulse 1.2s ease-in-out infinite }
#chatTalk.on { color: var(--brand-ink); background: var(--brand-soft) }
/* Talk mode: one bar above the composer says what the assistant is doing; tap it to interrupt or talk again. */
.talk-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px }
.talk-bar[hidden] { display: none }
.talk-state { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 22px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer; box-shadow: var(--shadow) }
.talk-wave { display: inline-flex; align-items: center; gap: 3px; height: 18px }
.talk-wave i { width: 3px; height: 6px; border-radius: 2px; background: var(--muted); transition: background .2s }
.talk-bar[data-state="listening"] .talk-wave i { background: var(--bad); animation: talkwave 0.9s ease-in-out infinite }
.talk-bar[data-state="speaking"] .talk-wave i { background: var(--brand); animation: talkwave 0.7s ease-in-out infinite }
.talk-bar[data-state="thinking"] .talk-wave i { background: var(--brand); animation: pulse 1.2s ease-in-out infinite }
.talk-wave i:nth-child(2) { animation-delay: .15s } .talk-wave i:nth-child(3) { animation-delay: .3s } .talk-wave i:nth-child(4) { animation-delay: .45s }
@keyframes talkwave { 0%, 100% { height: 5px } 50% { height: 18px } }
@media (prefers-reduced-motion: reduce) { .talk-wave i { animation: none !important; height: 10px } }

/* ---- pages, cards, tables ---- */
.page { max-width: 1240px; margin-inline: auto; padding: 32px 32px 56px; display: grid; gap: 22px; align-content: start }
.page-head { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; justify-content: space-between }
.page-head p { margin: 6px 0 0 }
.head-actions, .run-report { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.run-report select { min-height: 38px; padding: 7px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink) }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 12px; align-content: start; min-width: 0; box-shadow: var(--shadow-sm) }
.card h2 { font-size: 1rem; font-weight: 650 }
.card h3 { font-size: 0.92rem }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 4px 0 8px; background: var(--surface) }
table { border-collapse: collapse; width: 100%; font-size: 0.86rem }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap }
th { font-size: 0.7rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); position: sticky; top: 0 }
tbody tr { transition: background .12s }
tbody tr:hover td { background: var(--hover) }
tr:last-child td { border-bottom: 0 }
td.wrap { white-space: normal; text-align: left; min-width: 140px }
details summary { cursor: pointer; font-size: 0.82rem; color: var(--brand-ink); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px }
details summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s }
details[open] summary::before { transform: rotate(45deg) }
details summary::-webkit-details-marker { display: none }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.78rem; color: var(--ink-2) }
.legend span, .tip-rows span { display: inline-flex; align-items: center; gap: 6px }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px }

/* ---- audit log and usage insights ---- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end }
.filters .btn { min-height: 38px }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 3px; box-shadow: var(--shadow-sm) }
.tile b { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15 }
.tile span { color: var(--ink-2); font-size: 0.84rem }
.tile small { color: var(--muted); font-size: 0.76rem }
.tile.hero { background: linear-gradient(140deg, var(--brand-soft), var(--surface) 70%); border-color: var(--brand-ring) }
.tile.hero b { color: var(--brand-ink) }
.audit-table td { text-align: left; white-space: normal; vertical-align: top; font-size: 0.86rem }
.audit-table th { text-align: left }
.audit-table td:first-child { white-space: nowrap; color: var(--muted) }
.audit-table tr.q td { background: var(--brand-soft) }
.audit-table tr.fbrow td { background: var(--warn-bg) }
.audit-table details { margin-top: 4px }
.tag { display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand-soft); padding: 1px 7px; border-radius: 999px; margin-right: 6px }
.tag.tool { color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line) }
.bad { color: var(--bad); font-weight: 650 }
.answer-snip { white-space: pre-wrap; font-size: 0.8rem; color: var(--ink-2); max-height: 200px; overflow: auto; border-left: 3px solid var(--line-2); padding-left: 10px; margin-top: 6px }
.section-title { font-size: 1.05rem; margin-top: 6px }
.section-title .muted { font-weight: 400; font-size: 0.9rem }
.digest-links { margin: 0; font-size: 0.86rem }
.insights { display: grid; gap: 14px }
.ins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px }
.daychart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-bottom: 20px }
.daychart .day { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0 }
.daychart .stack { background: var(--grid); border-radius: 4px 4px 0 0; display: flex; flex-direction: column; justify-content: flex-end; min-height: 1px }
.daychart .stack .q { display: block; background: var(--brand); border-radius: 4px 4px 0 0 }
.daychart .day span { position: absolute; bottom: -20px; left: 0; font-size: 0.66rem; color: var(--muted); white-space: nowrap }
.legend .sw.q { background: var(--brand) } .legend .sw.l { background: var(--grid) }
table.mini { font-size: 0.84rem } table.mini td, table.mini th { padding: 6px 8px }
table.mini td:first-child, table.mini th:first-child { text-align: left; white-space: normal }
.needs { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 0.84rem }

/* ---- answer tables: chart, copy for Excel, CSV ---- */
.answer-table { margin: 10px 0 12px; display: grid; gap: 8px }
.answer-table .tablewrap { margin: 0 }
.ttools { display: flex; flex-wrap: wrap; gap: 6px }
.ttools button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 11px; font-size: 0.76rem; color: var(--ink-2) }
.ttools button:hover { background: var(--hover); border-color: var(--line-2) }
.ttools button[aria-pressed="true"] { background: var(--brand-fill); border-color: transparent; color: var(--on-brand) }
.mini-chart { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 7px; background: var(--surface) }
.mini-title { font-size: 0.7rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.mini-row { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 0.82rem }
.mini-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.mini-track { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden }
.mini-track i { display: block; height: 100%; background: var(--series-1); border-radius: 4px }
.mini-track i.neg { background: var(--bad) }
.mini-val { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums }

/* ---- feedback, follow-ups, saved questions ---- */
.msg-actions .fb { padding: 3px 9px; font-size: 0.8rem; line-height: 1.4 }
.msg-actions .fb[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand) }
.fb-thanks { font-size: 0.76rem; color: var(--muted); align-self: center; margin-left: 4px }
.fb-box { display: flex; gap: 8px; margin-top: 10px; max-width: 560px }
.fb-box .input { flex: 1; min-width: 0 }
.followups { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px }
.followups button { border: 1px solid var(--brand-ring); background: var(--brand-soft); color: var(--brand-ink); border-radius: 999px; padding: 5px 13px; font-size: 0.8rem; font-weight: 550; transition: transform .12s, border-color .15s }
.followups button:hover { border-color: var(--brand); transform: translateY(-1px) }
.msg-user-row { align-self: flex-end; display: flex; gap: 6px; align-items: center; max-width: 85% }
.msg-user-row .msg.user { max-width: 100% }
.star { border: 0; background: none; font-size: 1.1rem; line-height: 1; color: var(--line-2); padding: 4px; opacity: 0; transition: opacity .15s }
.msg-user-row:hover .star, .star:focus-visible, .star[aria-pressed="true"] { opacity: 1 }
.star[aria-pressed="true"] { color: #d4a106 }
@media (hover: none) { .star { opacity: 1 } }
.saved { margin: 4px 0 0 }
.saved h3 { font-size: 0.78rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px }
.saved-list { display: flex; flex-wrap: wrap; gap: 7px }
.saved-item { display: inline-flex; align-items: stretch; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 999px; overflow: hidden }
.saved-item .ask { border: 0; background: none; padding: 5px 4px 5px 13px; font-size: 0.84rem; text-align: left; color: var(--ink) }
.saved-item .unsave { border: 0; background: none; padding: 0 11px; color: var(--muted); font-size: 1rem }
.saved-item .ask:hover, .saved-item .unsave:hover { background: color-mix(in srgb, var(--warn-line) 30%, transparent) }

/* ---- Today at VTG briefing (chat home) ---- */
.today { display: grid; gap: 12px }
.today-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline }
.today-head h2 { font-size: 0.78rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted) }
.today-head .muted { font-size: 0.78rem }
.today-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px }
.tcard { position: relative; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 16px 15px; display: grid; gap: 3px; cursor: pointer; box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; animation: rise .35s var(--ease) both }
.tcard:nth-child(2) { animation-delay: .04s } .tcard:nth-child(3) { animation-delay: .08s } .tcard:nth-child(4) { animation-delay: .12s } .tcard:nth-child(5) { animation-delay: .16s }
.tcard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--line-2) }
.tcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2) }
.tcard b { font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em }
.tcard .t { font-weight: 600; font-size: 0.86rem; line-height: 1.35 }
.tcard .d { font-size: 0.78rem; color: var(--muted) }
.tcard.warn::before { background: #e08a00 } .tcard.warn b { color: var(--warn) }
.tcard.ok::before { background: var(--brand) } .tcard.ok b { color: var(--brand-ink) }
.tcard.info::before { background: var(--series-1) }
.tcard.skel, .skel { min-height: 104px; background: linear-gradient(90deg, var(--surface), var(--hover), var(--surface)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; cursor: default; border-color: var(--line) }

/* ---- operations dashboard ----
   Categorical slots 1-5 in fixed order; light and dark steps validated on each card surface (adjacent CVD ΔE ≥ 8.4).
   Aqua, yellow and magenta are under 3:1 on white, so charts carry a legend, hover figures and a table view. */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px }
.dash-tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; align-content: start; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; animation: rise .35s var(--ease) both }
.dash-tile:nth-child(2) { animation-delay: .03s } .dash-tile:nth-child(3) { animation-delay: .06s } .dash-tile:nth-child(4) { animation-delay: .09s } .dash-tile:nth-child(5) { animation-delay: .12s } .dash-tile:nth-child(6) { animation-delay: .15s }
.dash-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2) }
.dash-tile .label { display: flex; align-items: center; gap: 7px; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted) }
.dash-tile .label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none }
.dash-tile b { font-size: 1.85rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.03em }
.dash-tile .of { font-size: 0.95rem; font-weight: 500; color: var(--muted); letter-spacing: 0 }
.dash-tile small { color: var(--ink-2); font-size: 0.8rem; line-height: 1.4 }
.dash-tile.hero { background: linear-gradient(140deg, var(--brand-soft), var(--surface) 75%); border-color: var(--brand-ring) }
.dash-tile.hero b { color: var(--brand-ink) }
.dash-tile.hero .label::before, .dash-tile.ok .label::before { background: var(--brand) }
.dash-tile.warn .label::before { background: #e08a00; box-shadow: 0 0 0 3px rgba(224,138,0,.18) }
.meter { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: 4px 0 2px }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-fill)); border-radius: 999px; transition: width .6s var(--ease) }
.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px }
.chart svg { width: 100%; height: auto; display: block; overflow: visible }
.chart .grid { stroke: var(--grid); stroke-width: 1 }
.chart .axis { fill: var(--axis); font-size: 12px; font-family: var(--font) }
.chart .axis.strong { fill: var(--ink); font-weight: 650 }
.chart .value { fill: var(--ink-2); font-size: 12px; font-weight: 650; font-family: var(--font) }
.chart .hit { fill: transparent; cursor: default; outline: none }
.chart .hit:hover, .chart .hit:focus { fill: color-mix(in srgb, var(--ink) 4%, transparent) }
.s-general { fill: var(--series-1); background: var(--series-1) }
.s-recycling { fill: var(--series-2); background: var(--series-2) }
.s-skips { fill: var(--series-3); background: var(--series-3) }
.s-industrial { fill: var(--series-4); background: var(--series-4) }
.s-hazardous { fill: var(--series-5); background: var(--series-5) }
.s-age { fill: var(--series-1) }
.truck, .hbar { display: grid; align-items: center; gap: 10px; padding: 5px 6px; outline: none; border-radius: 8px; transition: background .12s }
.truck { grid-template-columns: 76px minmax(0, 1fr) 64px }
.hbar { grid-template-columns: minmax(70px, 34%) minmax(0, 1fr) auto }
.truck:hover, .truck:focus, .hbar:hover, .hbar:focus { background: var(--hover) }
.truck .name, .hbar .name { font-weight: 600; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.truck .track { display: block; height: 10px; min-width: 8px; background: var(--brand-soft); border-radius: 999px; overflow: hidden }
.truck .track i { display: block; height: 100%; background: var(--brand); border-radius: 999px }
.hbar .track { display: block; height: 10px; min-width: 4px; background: var(--series-1); border-radius: 999px }
.truck .count, .hbar .count { text-align: right; font-size: 0.82rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap }
.tip { position: fixed; z-index: 30; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 0.8rem; padding: 9px 11px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 260px; display: grid; gap: 4px }
.tip[hidden] { display: none }
.tip .muted { color: color-mix(in srgb, var(--surface) 70%, transparent) }
.tip-rows { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px }
.kpis div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px }
.kpis span { display: block; font-size: 0.68rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em }
.kpis b { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em }
.save { color: var(--good); font-weight: 700 }
#overdue td:first-child, #overdue th:first-child, #overdue td:nth-child(2), #overdue th:nth-child(2), #overdue td:nth-child(3), #overdue th:nth-child(3) { text-align: left }
#overdue td { white-space: normal }
#routes td:first-child, #routes th:first-child, #fleetTable td:first-child, #fleetTable th:first-child { text-align: left }
.alloc { margin: 4px 0 0; padding-left: 18px; font-size: 0.86rem; display: grid; gap: 4px }
#costs { display: grid; gap: 10px } #costs p { margin: 0 }
.report #costs td, .report #costs th { text-align: left } .report #costs td:last-child, .report #costs th:last-child { text-align: right }
.report #opps td:first-child, .report #opps th:first-child, .report #prod th:first-child, .report #prod td:first-child, .report #routeTop td, .report #routeTop th { text-align: left }

/* search box on the dashboard */
.search { position: relative }
.search input { width: 100%; font-size: 1rem; padding: 14px 16px 14px 46px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238e968c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 17px 50%; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s }
.search input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring), var(--shadow) }
.search-results { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; max-height: 70vh; overflow: auto; animation: pop .14s var(--ease) }
.search-results[hidden] { display: none }
.search-results h3 { font-size: 0.7rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 10px 10px 4px }
.search-results a { display: block; padding: 9px 11px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none }
.search-results a:hover, .search-results a.active { background: var(--brand-soft) }
.search-results .cust { padding: 8px 11px 10px; border-bottom: 1px solid var(--line) }
.search-results .cust b { display: block }
.search-results .cust .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px }
.search-results .cust .chips a { display: inline-block; padding: 4px 11px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 0.8rem }
.search-results .ask-all { font-weight: 650; color: var(--brand-ink) }

/* ---- responsive ---- */
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 900px) {
  .dash-grid, .ins-grid { grid-template-columns: minmax(0, 1fr) }
  .auth-grid { grid-template-columns: 1fr }
  .auth-brand { display: none }
}
@media (max-width: 860px) {
  body.shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto }
  .side { display: none }
  .topbar { grid-row: 1 }
  .main { grid-row: 2 }
  .tabbar { grid-row: 3 }
  .chat-foot { display: none }
  .topbar { display: flex; align-items: center; gap: 2px; padding: 8px 8px 8px 16px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line) }
  .topbar img { height: 22px; width: auto; display: block }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)) }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 0.68rem; font-weight: 600 }
  .tabbar svg { width: 22px; height: 22px }
  .tabbar a[aria-current="page"] { color: var(--brand-ink) }
  .tabbar a[aria-current="page"] svg { background: var(--brand-soft); border-radius: 999px; padding: 3px 14px; box-sizing: content-box; width: 22px; margin: -3px 0 }
  .main { height: auto }
  .page { padding: 20px 16px 32px; gap: 18px }
  .page-bar { padding: 10px 16px }
  .chat-col { padding: 20px 16px 16px }
  .chat-form { padding: 0 12px 10px }
  h1 { font-size: 1.45rem }
}
@media (max-width: 640px) {
  .hide-sm { display: none !important }
  .suggest { grid-template-columns: 1fr }
  .msg.user { max-width: 88% }
  .msg.bot { padding-left: 0; padding-top: 36px }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .today-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px }
  .tcard { padding: 13px 12px }
  .tcard b { font-size: 1.55rem }
  .tcard .t { font-size: 0.8rem }
  .tcard .d { display: none }
  .audit-table th:nth-child(3), .audit-table td:nth-child(3) { display: none }
  .audit-table td:first-child { white-space: normal; min-width: 64px }
  .cmdk { padding: 8px }
  .cmdk-panel { max-height: 86vh; border-radius: 16px }
  .cmdk-foot { display: none }
}
@media (max-width: 560px) {
  .hide-xs { display: none }
  .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
  .dash-tile { padding: 13px 14px }
  .dash-tile b { font-size: 1.45rem }
}

/* ---- print / save as PDF ---- */
.print-head { display: none }
@media print {
  @page { margin: 16mm 14mm }
  :root { color-scheme: light }
  html, body, body.shell { background: #fff !important; color: #111 !important; display: block !important; height: auto !important; overflow: visible !important; font-size: 11pt }
  .main, .chat-main { height: auto !important; overflow: visible !important; display: block !important }
  .side, .topbar, .tabbar, .cmdk, .page-bar, .chat-form, .sample-banner, .msg-actions, .fb-box, .followups, .ttools, .steps, .today, .suggest, .typing, .greet, .hello, .search, .run-report, .head-actions, .dash details, .tip { display: none !important }
  .print-head { display: flex; gap: 16px; align-items: center; border-bottom: 3px solid #3baf28; padding-bottom: 10px; margin-bottom: 14px; font-size: 9.5pt; color: #444 }
  .print-head img { height: 26px; width: auto }
  .chat-log { overflow: visible }
  .chat-col { max-width: none; padding: 0; gap: 12px }
  .msg.user { background: none; color: #111; border: 1px solid #ccc; align-self: flex-start; max-width: 100%; font-weight: 700; box-shadow: none }
  .msg.bot { padding-left: 0; break-inside: avoid-page }
  .msg.bot::before, .msg.bot::after { display: none }
  .card, .dash-tile, .tile { box-shadow: none; break-inside: avoid; border-color: #ddd }
  .dash-tiles { grid-template-columns: repeat(3, 1fr) }
  .dash-grid { grid-template-columns: 1fr 1fr }
  .tablewrap { overflow: visible; break-inside: avoid }
  table { font-size: 9.5pt }
  th { position: static }
  .mini-chart, .chart { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact }
  * { animation: none !important }
}

/* ---- alerts (dashboard): one bar, opens into the list ---- */
.alerts { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; animation: rise .3s var(--ease) both }
.alerts.high { border-left-color: var(--bad) }
.alerts.warn { border-left-color: var(--warn-line) }
.alerts-bar { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 14px; border: 0; background: transparent; color: var(--ink); text-align: left; transition: background .15s }
.alerts-bar:hover { background: var(--hover) }
.alerts-bar svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
.alerts.high .bell { color: var(--bad) } .alerts.warn .bell { color: var(--warn) } .alerts.info .bell { color: var(--brand-ink) }
.alerts-bar b { font-weight: 650; font-size: 0.92rem; white-space: nowrap }
.alerts-counts { display: flex; gap: 6px; flex: none }
.alerts-first { flex: 1; min-width: 0; color: var(--ink-2); font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.alerts-first::before { content: "·"; margin-right: 8px; color: var(--muted) }
.alerts-bar .chev { color: var(--muted); transition: transform .2s var(--ease) }
.alerts-bar[aria-expanded="true"] .chev { transform: rotate(180deg) }
.alert-list { display: grid; gap: 6px; padding: 4px 10px 10px; max-height: 50vh; overflow-y: auto; border-top: 1px solid var(--line) }
.alert-list:first-child { border-top: 0 }
.alert { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; transition: background .15s }
.alert:first-child { margin-top: 6px }
.alert:hover { background: var(--hover) }
.sev { flex: none; font-size: 0.66rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap }
.sev.high { color: var(--bad); background: var(--bad-bg); border-color: transparent } .sev.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line) } .sev.info { color: var(--brand-ink); background: var(--brand-soft); border-color: transparent }
.alert-txt { flex: 1; min-width: 0; display: grid; gap: 1px }
.alert-txt b { font-weight: 650; font-size: 0.9rem }
.alert-txt small { color: var(--ink-2); font-size: 0.8rem }
.alert > svg { width: 16px; height: 16px; flex: none; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 2 }
@media (max-width: 640px) {
  .alerts-first { display: none }
  .alerts-counts { flex: 1; justify-content: flex-end }
  .alerts-counts .sev:not(:first-child) { display: none }
}

/* ---- trend: is VTG getting better? ---- */
.trend { gap: 16px }
.trend-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px }
.trend-head h2 { font-size: 1.15rem }
.trend-head > div:first-child { flex: 1 1 320px }
.trend-worth { display: grid; justify-items: end; text-align: right; gap: 1px; margin-left: auto }
.trend-worth .label, .trend-item .label { font-size: 0.7rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.trend-worth b { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums }
.trend-worth small { color: var(--muted); font-size: 0.78rem }
.good { color: var(--good) } b.bad, .delta.bad { color: var(--bad) }
.trend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px }
.trend-item { display: grid; gap: 6px; padding: 12px 14px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s var(--ease) }
.trend-item:hover { border-color: var(--line-2); transform: translateY(-1px) }
.trend-item .label small { text-transform: none; letter-spacing: 0; font-weight: 500 }
.trend-now { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px }
.trend-now b { font-size: 1.3rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums }
.delta { font-size: 0.78rem; font-weight: 600; color: var(--muted) }
.delta.good { color: var(--good) }
.spark { width: 100%; height: auto; display: block; overflow: visible }
.spark .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round }
.spark .area { fill: color-mix(in srgb, var(--series-1) 12%, transparent) }
.spark circle { fill: var(--series-1); stroke: var(--surface-2); stroke-width: 1.5 }
.spark circle.hit { fill: transparent; stroke: none }
.spark circle.hit:hover { fill: var(--series-1) }
.spark.empty { height: auto; padding: 18px 0 }
@media (max-width: 560px) { .trend-worth { justify-items: start; text-align: left } }

/* ---- live runs map ---- */
.map-main { display: flex; flex-direction: column; overflow: hidden }
.map-page { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 20px 24px 20px }
.map-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px }
.map-title { flex: 1; min-width: 220px }
.map-title h1 { font-size: 1.5rem }
.map-title p { margin-top: 3px }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2) }
.seg button { border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 0.86rem; padding: 6px 14px; border-radius: 9px; transition: background .15s, color .15s }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm) }
.map-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px }
.mk { position: relative; display: grid; gap: 1px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); min-width: 0 }
.mk span { font-size: 0.7rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.mk b { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2 }
.mk small { font-size: 0.74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.mk.good b { color: var(--good) } .mk.bad b { color: var(--bad) } .mk.warn b { color: var(--warn) }
.map-body { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px }
.map-list { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden }
.map-list-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; border-bottom: 1px solid var(--line) }
.map-list-head .input { width: 100%; min-height: 36px; font-size: 0.86rem }
.truck-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1 }
.truck-list .empty { padding: 14px 10px }
.truck-row { width: 100%; display: grid; gap: 6px; text-align: left; border: 1px solid transparent; background: transparent; color: var(--ink); border-radius: var(--radius-sm); padding: 10px 11px; transition: background .15s, border-color .15s }
.truck-row:hover { background: var(--hover) }
.truck-row[aria-current="true"] { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 40%, transparent) }
.tr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.tr-top b { font-weight: 650; font-size: 0.92rem }
.tr-sub { font-size: 0.76rem; color: var(--muted) }
.save-chip { font-size: 0.72rem; font-weight: 700; color: var(--good); background: var(--good-bg); padding: 1px 8px; border-radius: 999px; font-variant-numeric: tabular-nums }
.bar { display: block; height: 5px; border-radius: 999px; background: var(--grid); overflow: hidden }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--good) }
.map-wrap { position: relative; min-height: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: var(--surface-2) }
.map { position: absolute; inset: 0; background: var(--surface-2); font-family: var(--font) }
.map-legend { position: absolute; left: 12px; top: 12px; z-index: 500; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 7px 11px; font-size: 0.74rem; color: var(--ink-2); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm) }
.map-legend span { display: inline-flex; align-items: center; gap: 6px }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--surface) }
.dot.done { background: var(--good) } .dot.todo { background: var(--series-1) } .dot.failed { background: var(--bad) } .dot.none { background: var(--series-4) }
.map-legend .dash { display: inline-block; width: 18px; border-top: 3px dashed var(--series-2) }
.map-detail { position: absolute; right: 12px; top: 12px; max-height: calc(100% - 24px); z-index: 600; width: min(340px, calc(100% - 24px)); overflow-y: auto; display: grid; gap: 12px; align-content: start; padding: 16px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: rise .2s var(--ease) }
.md-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px }
.md-head h2 { font-size: 1.3rem; font-family: var(--font-head); font-weight: 800 }
.md-kicker { font-size: 0.7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink) }
.md-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.md-stats div { display: grid; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line) }
.md-stats b { font-size: 1.1rem; font-variant-numeric: tabular-nums }
.md-stats span { font-size: 0.72rem; color: var(--muted) }
.md-save { display: grid; gap: 3px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--good-bg); font-size: 0.84rem; color: var(--ink-2) }
.md-save .good { color: var(--good) }
.md-toggle { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--ink-2) }
.md-toggle input { accent-color: var(--series-2); width: 16px; height: 16px }
.map-detail h3 { font-size: 0.74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted) }
.md-next { margin: 0; padding-left: 20px; display: grid; gap: 7px; font-size: 0.86rem }
.md-next li span { display: block; color: var(--muted); font-size: 0.76rem }
.truck-badge { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; padding: 3px 8px 3px 5px; border-radius: 999px; font: 650 11px/1.2 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow) }
.truck-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round }
.truck-badge.on { color: var(--on-brand); background: var(--brand-fill); border-color: transparent; transform: scale(1.08) }
.stop-num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 700 10.5px/1 var(--font); color: #fff; background: var(--series-1); border: 2px solid var(--surface); box-shadow: var(--shadow) }
.stop-num.done { background: var(--good) } .stop-num.failed { background: var(--bad) }
.pop { display: grid; gap: 3px; font: 0.84rem/1.4 var(--font); color: var(--ink) }
.pop .st { font-weight: 650 } .pop .st.done { color: var(--good) } .pop .st.todo { color: var(--series-1) } .pop .st.failed { color: var(--bad) } .pop .st.none { color: var(--warn) }
.map.dim .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.85) saturate(.6) }
.map .leaflet-popup-content-wrapper, .map .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg) }
.map .leaflet-popup-content-wrapper { border-radius: 12px; border: 1px solid var(--line-2) }
.map .leaflet-popup-close-button { color: var(--muted) }
.map .leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line) }
.map .leaflet-bar a:hover { background: var(--hover) }
.map .leaflet-bar { border: 1px solid var(--line-2); box-shadow: var(--shadow) }
.map .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); font-size: 10px }
.map .leaflet-control-attribution a { color: var(--ink-2) }
.map .leaflet-container a.leaflet-popup-close-button { color: var(--muted) }
.map-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)) }
.mk-opt { text-align: left; cursor: pointer; border-color: color-mix(in srgb, var(--series-2) 45%, var(--line)); background: linear-gradient(140deg, color-mix(in srgb, var(--series-2) 12%, var(--surface)), var(--surface) 75%); transition: transform .15s var(--ease), box-shadow .15s }
.mk-opt:hover { transform: translateY(-1px); box-shadow: var(--shadow) }
.mk-opt b { color: var(--series-2) }
.list-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 10px 12px 0; padding: 3px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2) }
.list-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 0.86rem; padding: 6px 10px; border-radius: 9px }
.list-tabs button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2 }
.list-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm) }
.list-panel { display: flex; flex-direction: column; min-height: 0; flex: 1 }
.list-panel[hidden] { display: none }
.opt-panel { overflow-y: auto; padding: 12px; gap: 6px }
.opt-panel .truck-list { overflow: visible; padding: 0; flex: none }
.opt-empty { padding: 14px 4px; margin: 0 }
.opt-sum { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius-sm); background: linear-gradient(150deg, color-mix(in srgb, var(--series-2) 14%, var(--surface)), var(--surface-2)); border: 1px solid color-mix(in srgb, var(--series-2) 30%, var(--line)) }
.opt-kicker { font-size: 0.7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.opt-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px }
.opt-big b { font-size: 1.9rem; font-weight: 750; letter-spacing: -0.03em; color: var(--series-2); font-variant-numeric: tabular-nums }
.opt-big span { color: var(--ink-2); font-size: 0.86rem }
.opt-money { font-size: 0.86rem; color: var(--ink-2) }
.opt-money b { color: var(--good); font-size: 1rem }
.opt-break { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.82rem }
.opt-break li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px dashed var(--line-2) }
.opt-break b { font-variant-numeric: tabular-nums }
.opt-sum p { margin: 0 }
.opt-h { font-size: 0.72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 12px 4px 2px }
.opt-panel > .btn { margin-top: 10px }
.stop-num.plan { background: var(--series-2) }
.stop-num.moved { background: var(--series-5); box-shadow: 0 0 0 3px color-mix(in srgb, var(--series-5) 35%, transparent), var(--shadow) }
.md-actions { display: flex; flex-wrap: wrap; gap: 8px }
.md-actions .btn { flex: 1 }
.md-next.plan { list-style: none; padding: 0; gap: 0; counter-reset: plan }
.md-next.plan li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); counter-increment: plan }
.md-next.plan .eta { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--series-2) }
.md-next.plan .pl b::before { content: counter(plan) ". "; color: var(--muted); font-weight: 600 }
.md-next.plan em { display: inline-block; margin-top: 2px; font-style: normal; font-size: 0.7rem; font-weight: 700; color: var(--series-5) }
@media print {
  body.print-plan .map-page > *:not(.map-body), body.print-plan .map-list, body.print-plan .map-wrap, body.print-plan .md-actions, body.print-plan #closeDetail { display: none !important }
  body.print-plan .map-body { display: block }
  body.print-plan .map-detail { position: static; width: auto; max-height: none; overflow: visible; box-shadow: none; border: 0; background: #fff; backdrop-filter: none }
  body.print-plan .md-next.plan li { break-inside: avoid }
}
@media (max-width: 1100px) { .map-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) } }
@media (max-width: 860px) {
  .map-main { overflow-y: auto }
  .map-page { padding: 14px 16px 18px; flex: none }
  .map-title h1 { font-size: 1.25rem }
  .map-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .map-kpis .mk-opt { grid-column: 1 / -1 }
  .map-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto }
  .map-wrap { order: -1; height: 58vh; min-height: 340px }
  .map-list { max-height: none }
  .truck-list { overflow: visible }
  .map-detail { position: static; width: auto; max-height: none; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); box-shadow: var(--shadow-sm); animation: up .2s var(--ease) }
  .map-list { order: 1 }
  .map-legend { left: 8px; top: 8px; font-size: 0.7rem }
}
@keyframes up { from { transform: translateY(16px); opacity: 0 } to { transform: none; opacity: 1 } }
