:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #1d4ed8;
  --brand-ink: #ffffff;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --card: #131c31;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --line: #23314f;
    --brand: #3b82f6;
    --ok: #4ade80;
    --ok-bg: #0f2e1d;
    --warn: #fbbf24;
    --warn-bg: #3a2a0a;
    --danger: #f87171;
    --danger-bg: #3b1212;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
a { color: var(--brand); }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: #0f172a; color: #fff;
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand span { color: #60a5fa; }
.who { font-size: .85rem; opacity: .85; text-align: right; }

main { max-width: 720px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 > * { min-width: 0; }
@media (max-width: 340px) { .grid2 { grid-template-columns: 1fr; } }

label { display: block; font-size: .85rem; font-weight: 600; margin: 10px 0 4px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.field { position: relative; }
.field input { padding-right: 52px; }
.field .mic-mini {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; font-size: 1.15rem; cursor: pointer;
}
.field input.filled { border-color: var(--ok); }
.field input.missing { border-color: var(--warn); background: var(--warn-bg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; font: inherit; font-weight: 700; border-radius: 12px; border: 1px solid transparent;
  background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.big { padding: 18px; font-size: 1.1rem; border-radius: 16px; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.mic { background: #dc2626; color: #fff; }
.icon-btn { background: transparent; border: 0; color: inherit; font-size: 1.2rem; cursor: pointer; padding: 6px 10px; }
.link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; padding: 11px 6px; background: var(--bg); color: var(--text); border: 0; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--brand); color: #fff; }

.badge { display: inline-block; font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--line); color: var(--text); letter-spacing: .03em; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }

.plate {
  display: inline-block; font-family: "SF Mono", Menlo, monospace; font-weight: 800; letter-spacing: .08em;
  background: #fff; color: #0f172a; border: 2px solid #0f172a; border-left: 14px solid #1d4ed8; border-radius: 6px; padding: 2px 10px;
}
.plate.xl { font-size: 2rem; padding: 6px 18px; border-left-width: 22px; }

.vehicle-pick { display: grid; gap: 10px; }
.vehicle-pick button {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); font: inherit; cursor: pointer;
}
.vehicle-pick button:disabled { opacity: .5; }
.vehicle-icon { display: inline-flex; line-height: 0; }
.vicon { display: block; }
.icon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.icon-grid button, .swatch { background: var(--bg); color: var(--text); border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font: inherit; }
.icon-grid button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; }
.icon-grid button small { font-size: .72rem; font-weight: 600; text-align: center; }
.icon-grid button.on, .swatch.on { border-color: var(--brand); background: var(--card); }
.swatch { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: .85rem; font-weight: 600; }
.swatch i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); }

.confirm-vehicle { text-align: center; padding: 24px 16px; }
.confirm-vehicle .vehicle-icon { margin-bottom: 8px; }

.status-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.ride { border-left: 4px solid var(--line); padding: 10px 12px; margin: 8px 0; background: var(--bg); border-radius: 10px; cursor: pointer; }
.ride.open { border-left-color: var(--warn); }
.ride.closed { border-left-color: var(--ok); }
.stops-ed { display: flex; flex-direction: column; gap: 6px; }
.stop-row { display: flex; gap: 6px; align-items: center; }
.stop-row .st-addr { flex: 1; min-width: 0; }
.stop-row .st-time { width: 118px; flex: none; padding-left: 8px; padding-right: 6px; }
.stop-n { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.st-del { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; }
.small-btn { margin-top: 6px; padding: 8px 12px; font-size: .9rem; }
.stops-list { margin: 2px 0 0; padding-left: 20px; font-weight: 700; }
.stops-list li { margin: 2px 0; }
.stops-list li span { display: inline; font-weight: 600; }
em.todo { color: var(--warn); font-style: normal; font-weight: 800; }
.later { color: var(--warn); }
.todo-box { border: 2px solid var(--warn); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.ride.leg-deleted { border: 2px dashed var(--line); border-left: 4px solid var(--muted); background: var(--card); cursor: default; }
.ride .route { font-weight: 700; }

.empty { text-align: center; color: var(--muted); padding: 20px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a { flex: 1; text-align: center; padding: 8px 2px 10px; font-size: .7rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.tabs a .ico { display: block; font-size: 1.3rem; }
.tabs a.on { color: var(--brand); }

.modal { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.modal-card { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { .modal { align-items: center; } .modal-card { border-radius: 18px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; }

.help { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.5); background: transparent; color: #fff; font-weight: 800; font-size: 1rem; cursor: pointer; flex: none; }
.sub.demo { background: #fef9c3; color: #713f12; }
/* guida a slide */
.guide { position: fixed; inset: 0; z-index: 60; background: rgba(2, 6, 23, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.g-card { position: relative; background: var(--card); color: var(--text); width: 100%; max-width: 440px; border-radius: 22px; padding: 22px 20px 18px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.g-card h2 { font-size: 1.3rem; margin: 14px 0 8px; }
.g-card p { margin: 0 0 10px; color: var(--muted); line-height: 1.5; }
.g-card p strong { color: var(--text); }
.g-skip { position: absolute; top: 12px; right: 14px; background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.g-art { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--bg); border-radius: 16px; padding: 16px 10px; }
.g-hero { font-size: 2.2rem; font-weight: 900; letter-spacing: -.03em; }
.g-hero span { color: var(--brand); }
.g-stack { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 300px; }
.g-ask, .g-say { padding: 8px 12px; border-radius: 14px; font-size: .9rem; text-align: left; }
.g-ask { background: var(--card); border: 1px solid var(--line); align-self: flex-start; }
.g-say { background: var(--brand); color: #fff; align-self: flex-end; }
.g-card > .g-say { display: inline-block; margin-bottom: 10px; }
.g-row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.g-badge { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: .9rem; }
.g-leg { display: flex; flex-direction: column; gap: 4px; border: 2px dashed var(--line); border-left: 5px solid var(--muted); border-radius: 12px; padding: 12px 18px; background: var(--card); }
.g-leg span { font-weight: 700; color: var(--muted); }
.g-sheet { width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: left; position: relative; }
.g-sheet > div:first-child { display: flex; justify-content: space-between; font-size: .7rem; border-bottom: 2px solid var(--text); padding-bottom: 6px; }
.g-lines i { display: block; height: 8px; border-radius: 4px; background: var(--line); margin: 8px 0; }
.g-lines i:nth-child(2) { width: 70%; } .g-lines i:nth-child(3) { width: 85%; }
.g-pdf { position: absolute; right: -10px; bottom: -10px; background: var(--danger); color: #fff; font-weight: 800; font-size: .8rem; padding: 6px 10px; border-radius: 10px; }
.g-dots { display: flex; justify-content: center; gap: 6px; margin: 6px 0 14px; }
.g-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.g-dots i.on { width: 20px; border-radius: 4px; background: var(--brand); }
.g-nav { display: flex; justify-content: space-between; gap: 10px; }
.g-nav .btn { flex: 1; }
.sub { padding: 9px 16px; font-size: .85rem; font-weight: 600; text-align: center; }
.sub a { color: inherit; font-weight: 800; margin-left: 6px; }
.sub.trial { background: #e0f2fe; color: #075985; }
.sub.expired { background: var(--danger-bg); color: var(--danger); }
.net { position: sticky; top: 0; z-index: 9; padding: 10px 16px; font-size: .85rem; font-weight: 700; text-align: center; }
.net.off { background: #7c2d12; color: #fff; }
.net.sync { background: var(--warn-bg); color: var(--warn); }
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 50;
  background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 12px; max-width: 92vw; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.toast.err { background: var(--danger); }

/* modalità guida: schermo scuro, scritte grandi, sotto le finestre delle domande */
.drive-btn { background: #0f172a; color: #fff; }
.drive-btn small { font-weight: 600; opacity: .75; }
.drive { position: fixed; inset: 0; z-index: 25; background: #020617; color: #e2e8f0; display: flex; flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); gap: 18px; text-align: center; }
.drive-top { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; text-align: left; }
.drive-top #drive-state { flex: 1; }
.drive-dot { width: 14px; height: 14px; border-radius: 50%; background: #22c55e; flex: none; animation: drivedot 2s infinite; }
.drive[data-mode="wake"] .drive-dot, .drive[data-mode="busy"] .drive-dot { background: #ef4444; }
.drive[data-mode="paused"] .drive-dot { background: #f59e0b; animation: none; }
@keyframes drivedot { 50% { opacity: .35; } }
.drive-exit { background: transparent; color: #94a3b8; border: 1px solid #334155; border-radius: 10px; padding: 8px 14px; font: inherit; cursor: pointer; }
.drive-clock { font-size: 4.5rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; margin-top: 4vh; }
.drive-ride { background: #0f172a; border: 1px solid #1e293b; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.dr-label { color: #94a3b8; font-size: .95rem; }
.dr-big { font-size: 1.7rem; font-weight: 800; color: #fff; }
.dr-route { font-size: 1.15rem; font-weight: 700; }
.drive-help { margin-top: auto; color: #94a3b8; line-height: 1.6; }
.drive-help strong { color: #fff; font-size: 1.15rem; }
.drive-tap { background: #f59e0b; color: #111827; border: 0; border-radius: 16px; padding: 22px; font: inherit; font-size: 1.2rem; font-weight: 800; cursor: pointer; }
body.driving { overflow: hidden; }
.listening { position: fixed; inset: 0; z-index: 40; background: rgba(2, 6, 23, .88); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; }
.listening #listening-text { font-size: 1.3rem; font-weight: 700; max-width: 520px; }
.listening .interim { min-height: 3em; font-size: 1.05rem; opacity: .85; max-width: 520px; }
.listening .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.pulse { width: 110px; height: 110px; border-radius: 50%; background: #dc2626; display: grid; place-items: center; font-size: 3rem; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.6); } 70% { box-shadow: 0 0 0 28px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }

.auth { max-width: 420px; margin: 6vh auto 0; }
.auth .brand { font-size: 2rem; text-align: center; margin-bottom: 4px; color: var(--text); }
.auth .tagline { text-align: center; color: var(--muted); margin-bottom: 20px; }

table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; }
.table-wrap { overflow-x: auto; }

.list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
/* dati della corsa con etichetta */
.kv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 10px; }
.kv { min-width: 0; }
.kv.wide { grid-column: span 4; }
.kv.half { grid-column: span 2; }
.kv span { display: flex; align-items: center; gap: 5px; font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.kv strong { display: block; font-size: .95rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kv.wide strong { font-size: 1.05rem; }
@media (max-width: 420px) { .kv-grid { grid-template-columns: repeat(2, 1fr); } .kv.wide, .kv.half { grid-column: span 2; } }
.authority { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-color: var(--brand); }
label.check { display: flex; align-items: flex-start; gap: 10px; color: var(--text); font-weight: 600; font-size: .9rem; }
label.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }

/* storico a giornata */
.sr-only { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.day-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.day-title { flex: 1; text-align: center; position: relative; }
.day-title h1 { margin: 2px 0 4px; font-size: 1.35rem; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; flex: none; }
.round:disabled { opacity: .35; cursor: default; }
.day-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 6px; scrollbar-width: none; }
.day-chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 8px 6px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer; line-height: 1.15; }
.chip span { font-size: .7rem; color: var(--muted); }
.chip strong { font-size: 1.25rem; }
.chip em { font-style: normal; font-size: .66rem; color: var(--muted); margin-top: 3px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on span, .chip.on em { color: rgba(255,255,255,.85); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.stats > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.stats strong { display: block; font-size: 1.15rem; letter-spacing: -.02em; white-space: nowrap; }
.stats span { font-size: .72rem; color: var(--muted); }
@media (max-width: 420px) { .stats { gap: 6px; } .stats > div { padding: 10px 4px; } .stats strong { font-size: 1rem; } .stats span { font-size: .66rem; } }
/* intestazione del foglio di servizio giornaliero */
.sheet-head { padding-bottom: 12px; border-bottom: 2px solid var(--text); }
.sheet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-co { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.sheet-no { text-align: right; flex: none; border: 2px solid var(--text); border-radius: 10px; padding: 6px 10px; line-height: 1.15; }
.sheet-no span { display: block; font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sheet-no strong { font-size: 1.15rem; }
.sheet-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0 8px; }
.sheet-grid > div { background: var(--bg); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.sheet-grid .c3 { grid-column: span 3; }
.sheet-grid .c2 { grid-column: span 2; }
.sheet-grid .sheet-vehicle { grid-column: span 6; }
.sheet-grid dt { font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.sheet-grid dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet-vehicle dd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (min-width: 640px) { .sheet-grid .c3 { grid-column: span 1; } .sheet-grid .sheet-vehicle { grid-column: span 4; } .sheet-grid { grid-template-columns: repeat(6, 1fr); } .sheet-grid .c2 { grid-column: span 2; } }
.sheet-depots { color: var(--text); }
.shift-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.shift-sum { text-align: right; flex: none; }
.shift-sum strong { display: block; font-size: 1.1rem; }
.shift-sum span { font-size: .75rem; color: var(--muted); }
.tl-start, .tl-end { padding: 10px 0 4px 64px; }
.tl-end { padding-top: 4px; border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 8px 0; }
.tl-time { text-align: right; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; padding-top: 10px; }
.tl-time strong { font-size: 1rem; }
.tl-time span { font-size: .8rem; color: var(--muted); }
.tl-body { position: relative; background: var(--bg); border-radius: 12px; padding: 10px 12px; border-left: 4px solid var(--ok); }
.tl-item.open .tl-body { border-left-color: var(--warn); }
.tl-body::before { content: ''; position: absolute; left: -15px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 3px solid var(--ok); }
.tl-item.open .tl-body::before { border-color: var(--warn); }
.tl-client { font-size: 1.02rem; }
.tl-route { margin: 6px 0 2px; font-weight: 600; }
.tl-route div { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.from { background: var(--ok); }
.dot.to { background: var(--danger); }
.tl-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sheet-actions .btn { flex: 1 1 140px; padding: 10px 12px; font-size: .9rem; }
.pill { white-space: nowrap; font-size: .75rem; padding: 3px 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.pill.muted { color: var(--muted); }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.type-t { background: #dbeafe; color: #1d4ed8; }
.badge.type-d { background: #ede9fe; color: #6d28d9; }
@media (prefers-color-scheme: dark) { .badge.type-t { background: #1e3a8a; color: #bfdbfe; } .badge.type-d { background: #3b0764; color: #ddd6fe; } }
.empty-day { text-align: center; padding: 28px 16px; }
.tl-item.leg .tl-body { background: none; border: 1.5px dashed var(--line); border-left: 4px solid var(--muted); }
.tl-item.leg .tl-body::before { border-color: var(--muted); }
.tl-note { padding: 8px 0 8px 64px; }
.out-box { text-align: left; background: var(--bg); border-radius: 12px; padding: 4px 12px 12px; margin: 12px 0; }
details.card summary { cursor: pointer; }
.transcript { font-style: italic; color: var(--muted); font-size: .85rem; margin-top: 8px; }
.hint { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: .85rem; color: var(--muted); }

@media print {
  .topbar, .tabs, .no-print { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card { border: 0; box-shadow: none; }
  .tl-body { background: none; border: 1px solid #ccc; border-left-width: 4px; }
  .shift-card { break-inside: avoid; }
  .day-chips, #stats, #filters, .day-nav .round { display: none !important; }
  body.print-one .shift-card:not(.print-target), body.print-one .day-nav, body.print-one #stats { display: none !important; }
  .sheet-grid > div { background: none; border: 1px solid #bbb; }
}
