:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #000000;
  --face: #c0c0c0;
  --face-light: #dfdfdf;
  --face-dark: #808080;
  --shade: #eeeeee;
  --link: #0000cc;
  --link-visited: #551a8b;
  --link-active: #cc0000;
  --ok: #006600;
  --ok-bg: #e6f2e6;
  --warn: #996600;
  --warn-bg: #fdf6e3;
  --bad: #cc0000;
  --bad-bg: #fdeaea;
  --info: #000080;
  --info-bg: #e8e8f4;
  --muted: #555555;
  --hover: #ffffcc;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Verdana, Geneva, Tahoma, Arial, sans-serif;
  --mono: "Courier New", Courier, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1c1c1c;
  --ink: #e6e6e6;
  --face: #3c3c3c;
  --face-light: #4b4b4b;
  --face-dark: #707070;
  --shade: #262626;
  --link: #8ab4ff;
  --link-visited: #c3a2ff;
  --link-active: #ff7a7a;
  --ok: #74d17c;
  --ok-bg: #16301b;
  --warn: #e8b552;
  --warn-bg: #352a10;
  --bad: #ff6e6e;
  --bad-bg: #3b1717;
  --info: #a3b4ff;
  --info-bg: #1f2444;
  --muted: #a3a3a3;
  --hover: #2e2c1c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #1c1c1c;
    --ink: #e6e6e6;
    --face: #3c3c3c;
    --face-light: #4b4b4b;
    --face-dark: #707070;
    --shade: #262626;
    --link: #8ab4ff;
    --link-visited: #c3a2ff;
    --link-active: #ff7a7a;
    --ok: #74d17c;
    --ok-bg: #16301b;
    --warn: #e8b552;
    --warn-bg: #352a10;
    --bad: #ff6e6e;
    --bad-bg: #3b1717;
    --info: #a3b4ff;
    --info-bg: #1f2444;
    --muted: #a3a3a3;
    --hover: #2e2c1c;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
}
a { color: var(--link); text-decoration: underline; }
a:visited { color: var(--link-visited); }
a:active { color: var(--link-active); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
h1 { font-family: var(--serif); font-size: 20px; font-weight: bold; margin: 0 0 4px; }
h2 { font-family: var(--serif); font-size: 15px; font-weight: bold; margin: 0; }

.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--face);
  border-bottom: 2px solid var(--ink);
}
.brand {
  font-family: var(--serif); font-weight: bold; font-size: 19px; letter-spacing: 1px;
  color: var(--ink); text-decoration: none; text-transform: uppercase;
}
.brand:visited { color: var(--ink); }
.brand span { color: var(--link); }
.topbar nav { display: flex; flex: 1; flex-wrap: wrap; gap: 0; }
.topbar nav a {
  padding: 3px 10px;
  color: var(--link);
  border-right: 1px solid var(--face-dark);
  font-size: 12px;
}
.topbar nav a:first-child { border-left: 1px solid var(--face-dark); }
.topbar nav a.on { background: var(--ink); color: var(--paper); text-decoration: none; font-weight: bold; }
.topbar nav a.on:visited { color: var(--paper); }
.who { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.who a { display: flex; flex-direction: column; line-height: 1.3; }
.who-menu { position: relative; }
.who-menu summary { display: flex; flex-direction: column; line-height: 1.3; cursor: pointer; list-style: none; color: var(--link); }
.who-menu summary::-webkit-details-marker { display: none; }
.who-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1200; min-width: 170px; background: var(--paper); border: 1px solid var(--face-dark); padding: 4px 0; display: flex; flex-direction: column; }
.who-panel a, .who-panel button.link { display: block; width: 100%; text-align: left; padding: 7px 12px; font-size: 12px; }
.who-panel a.on { font-weight: bold; }
.who-panel form { border-top: 1px solid var(--face-dark); margin-top: 4px; padding-top: 4px; }
.role { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: 1px; }
button.link {
  background: none; border: 0; color: var(--link); cursor: pointer;
  font: inherit; font-size: 11px; padding: 0; text-decoration: underline;
}
.switcher { margin: 0; }
.switcher-static {
  font-size: 11px; font-weight: bold; padding: 2px 8px;
  border: 1px solid var(--face-dark); background: var(--paper);
}

main { max-width: 1000px; margin: 0 auto; padding: 16px 12px 60px; }
main.wide { max-width: 1300px; }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 14px;
  flex-wrap: wrap; margin-bottom: 14px;
  border-bottom: 2px solid var(--ink); padding-bottom: 8px;
}
.page-head p { margin: 0; color: var(--muted); font-size: 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 16px; }
.stat { background: var(--shade); border: 1px solid var(--face-dark); padding: 8px 10px; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: bold; }
.stat-value { font-family: var(--serif); font-size: 24px; font-weight: bold; margin-top: 2px; }
.stat-hint { color: var(--muted); font-size: 11px; }
.stat.bad { border-left: 4px solid var(--bad); }
.stat.bad .stat-value { color: var(--bad); }
.stat.warn { border-left: 4px solid var(--warn); }
.stat.warn .stat-value { color: var(--warn); }

.panel { border: 1px solid var(--face-dark); margin-bottom: 16px; background: var(--paper); }
.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 10px; background: var(--face); border-bottom: 1px solid var(--face-dark);
}
.panel > p, .panel > form, .panel > div.pad { padding: 10px; margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 4px 8px; border: 1px solid var(--face-dark); white-space: nowrap; vertical-align: top; }
th {
  background: var(--face); font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; font-weight: bold;
}
tbody tr:nth-child(even) { background: var(--shade); }
tbody tr:hover { background: var(--hover); }
td.right, th.right { text-align: right; }
.empty { padding: 14px 10px; color: var(--muted); font-style: italic; }

.badge {
  display: inline-block; padding: 0 5px; font-size: 11px; font-weight: bold;
  border: 1px solid var(--ink); background: var(--paper); text-transform: uppercase;
  letter-spacing: .5px; white-space: nowrap;
}
.badge.ok { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.badge.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.badge.bad { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
.badge.info { border-color: var(--info); color: var(--info); background: var(--info-bg); }
.badge.muted { border-color: var(--face-dark); color: var(--muted); background: var(--shade); }

.btn {
  display: inline-block; padding: 3px 12px; cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: bold;
  color: var(--ink); background: var(--face);
  border: 2px outset var(--face);
  text-decoration: none;
}
.btn:visited { color: var(--ink); }
.btn:hover { background: var(--face-light); text-decoration: none; }
.btn:active { border-style: inset; }
.btn[disabled] { color: var(--face-dark); cursor: default; }
.btn.ghost { background: var(--paper); border: 2px outset var(--face); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 1px 8px; font-size: 11px; }
form.inline { display: inline; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.field > span { font-weight: bold; }
.field em { color: var(--muted); font-style: italic; font-size: 11px; }
.field.full { grid-column: 1 / -1; }
input, select, textarea {
  font-family: var(--sans); font-size: 12px; padding: 3px 5px; width: 100%;
  color: var(--ink); background: var(--paper);
  border: 2px inset var(--face);
}
textarea { min-height: 60px; resize: vertical; font-family: var(--sans); }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }

.flash { padding: 6px 10px; margin-bottom: 12px; border: 1px solid var(--ink); font-size: 12px; }
.flash.info { border-color: var(--info); background: var(--info-bg); color: var(--info); }
.flash.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.flash.bad { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.flash.warn { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }

.filters { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { min-width: 140px; }
.detail-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; padding: 10px; }
.detail-list div span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.detail-list div strong { font-weight: bold; font-size: 13px; }

body.auth {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  padding: 20px; background: var(--face);
}
.auth-card { background: var(--paper); border: 2px outset var(--face); padding: 18px; width: 100%; max-width: 380px; }
.auth-brand {
  font-family: var(--serif); font-weight: bold; font-size: 22px; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 12px;
  border-bottom: 2px solid var(--ink); padding-bottom: 8px;
}
.auth-brand span { color: var(--link); }
.auth-card h1 { font-size: 16px; margin-bottom: 10px; }
.auth-card .field { margin-bottom: 10px; }
.auth-card .btn { width: 100%; text-align: center; padding: 5px 12px; }
.h-captcha { margin-bottom: 10px; min-height: 78px; }
.captcha { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.captcha img { border: 1px solid var(--face-dark); max-width: 100%; height: auto; }
.captcha a { font-size: 11px; white-space: nowrap; }
.auth-note { color: var(--muted); font-size: 11px; margin-top: 12px; }
.code-input { letter-spacing: 8px; font-size: 20px; text-align: center; font-weight: bold; font-family: var(--mono); }
.checkbox { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 12px; }
.checkbox input { width: auto; border-width: 1px; }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
.rowlink { font-weight: bold; }
.subtle { font-size: 11px; color: var(--muted); white-space: normal; }
.actions-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.timeline { list-style: none; margin: 0; padding: 10px; display: grid; gap: 10px; }
.timeline li { border-left: 3px solid var(--face-dark); padding-left: 10px; }
.timeline .when { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.shop-head { padding: 10px 10px 0; }
.shop-head p { margin: 0 0 8px; }
#shop-map {
  height: 320px; margin: 0 10px 10px;
  border: 1px solid var(--face-dark); background: var(--shade);
}
.leaflet-container { font-family: var(--sans); font-size: 11px; }
.shop-pick {
  margin: 0 10px 10px; padding: 8px 10px;
  border: 1px solid var(--info); background: var(--info-bg); color: var(--info);
}
.shop-list { margin: 0; padding: 0 10px 4px 30px; }
.shop-list li { margin-bottom: 12px; }
.shop-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shop-name { font-weight: bold; font-family: var(--serif); font-size: 14px; }
.shop-history { font-size: 11px; color: var(--ok); }
.shop-note { font-size: 12px; border-left: 3px solid var(--face-dark); padding-left: 8px; margin-top: 3px; }
.shop-list .btn { margin-top: 4px; }

.shop-where { display: flex; gap: 6px; padding: 10px 10px 6px; flex-wrap: wrap; }
.shop-where input {
  flex: 1; min-width: 220px; padding: 3px 6px;
  border: 2px inset var(--face); background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 13px;
}
.shop-origin { padding: 0 10px 8px; margin: 0; }

#fleet-map {
  height: 400px; margin: 0 10px 8px;
  border: 1px solid var(--face-dark); background: var(--shade);
}
.map-legend { padding: 0 10px 10px; margin: 0; }
.dot { display: inline-block; width: 9px; height: 9px; border: 1px solid var(--ink); margin: 0 2px 0 8px; vertical-align: middle; }
.dot.bad { background: #dd8888; }
.dot.warn { background: #ccaa66; }
.dot.ok { background: #66aa66; }
.map-popup { font-family: var(--sans); font-size: 12px; min-width: 170px; }
.map-popup-unit { font-family: var(--serif); font-weight: bold; font-size: 15px; }
.map-popup-driver { font-weight: bold; }
.map-popup-flags { color: var(--bad); margin-top: 3px; }
.map-popup a { display: inline-block; margin-top: 5px; }

.guide p { max-width: 70ch; }
.guide-urgency { padding: 6px 10px; border: 1px solid var(--ink); }
.guide-urgency.stop_now { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.guide-urgency.soon { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.guide-urgency.next_service, .guide-urgency.watch { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.nowrap { white-space: nowrap; }
fieldset.outside { border: 2px groove var(--face-light); padding: 6px 10px 10px; margin: 0; }
fieldset.outside legend { font-weight: bold; padding: 0 4px; }
.form-grid .full, fieldset.full { grid-column: 1 / -1; }
.chat-log { max-height: 420px; overflow-y: auto; padding: 0 10px; display: grid; gap: 8px; }
.chat-log:empty { display: none; }
.chat-msg { border: 1px solid var(--face-dark); padding: 6px 8px; max-width: 80ch; }
.chat-msg.user { background: var(--shade); justify-self: end; }
.chat-msg.assistant { background: var(--paper); }
.chat-who { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.chat-text { white-space: pre-wrap; }
.chat-msg .btn { margin-top: 4px; }
.chat-starters { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 0; }
.oil-table { border-collapse: collapse; margin: 6px 0 10px; }
.oil-table th { text-align: left; padding: 3px 12px 3px 0; vertical-align: top; white-space: nowrap; }
.oil-table td { padding: 3px 0; }
.shop-hours { font-size: 11px; color: var(--muted); }
.total-row td { border-top: 2px solid var(--ink); }
.add-company { font-size: 11px; white-space: nowrap; }

.progress { padding-top: 8px; padding-bottom: 4px; }
.progress-track { height: 14px; border: 2px inset var(--face-dark); background: var(--paper); }
.progress-fill { height: 100%; width: 0; background: var(--info); transition: width 0.12s linear; }
.progress-text { font-size: 11px; margin-top: 3px; }
.shop-address { font-size: 12px; margin-top: 2px; }
.shop-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.shop-actions .btn { margin-top: 0; }
.shop-list li.active { outline: 2px solid var(--info); outline-offset: 3px; }
.shop-popup { font-size: 12px; min-width: 190px; }
.shop-popup div { margin-top: 3px; }

body.pti-public { background: var(--shade); margin: 0; padding: 12px; }
.pti-card { background: var(--paper); border: 2px outset var(--face); padding: 14px; max-width: 640px; margin: 0 auto; }
.pti-card h1 { font-size: 20px; margin: 6px 0 2px; }
.pti-block { display: grid; gap: 10px; margin: 12px 0; }
.pti-block input, .pti-block select, .pti-block textarea { font-size: 16px; }
.pti-hint { font-size: 12px; border-left: 3px solid var(--face-dark); padding-left: 8px; }
.pti-section { border: 1px solid var(--face-dark); margin: 0 0 12px; padding: 4px 8px 8px; }
.pti-section legend { font-weight: bold; font-family: var(--serif); font-size: 15px; padding: 0 4px; }
.pti-item { padding: 8px 0; border-bottom: 1px dotted var(--face-dark); }
.pti-item:last-child { border-bottom: 0; }
.pti-item.is-defect { background: var(--bad-bg); margin: 0 -8px; padding: 8px; }
.pti-label { font-size: 14px; margin-bottom: 4px; }
.pti-states { display: flex; gap: 6px; flex-wrap: wrap; }
.pti-states label { display: flex; align-items: center; gap: 4px; border: 2px outset var(--face); background: var(--face-light); padding: 6px 12px; font-size: 14px; cursor: pointer; }
.pti-states label:has(input:checked) { border-style: inset; background: var(--ink); color: var(--paper); }
.pti-states label.defect:has(input:checked) { background: var(--bad); border-color: var(--bad); }
.pti-defect { display: grid; gap: 6px; margin-top: 6px; }
.pti-defect input[type=text], .pti-defect input:not([type]) { font-size: 16px; padding: 6px; }
.pti-photo { display: inline-block; border: 2px outset var(--face); background: var(--face-light); padding: 5px 10px; font-size: 13px; cursor: pointer; width: fit-content; }
.pti-photo input { display: block; font-size: 12px; margin-top: 4px; max-width: 100%; }
.pti-photo[data-count]:not([data-count=""])::after { content: " · " attr(data-count); color: var(--ok); font-weight: bold; }
.pti-form > .btn { width: 100%; font-size: 16px; padding: 10px; }
.pti-previous { border: 1px solid var(--ink); padding: 8px 10px; margin: 10px 0; font-size: 13px; }
.pti-previous.bad { border-color: var(--bad); background: var(--bad-bg); }
.pti-previous.ok { border-color: var(--ok); background: var(--ok-bg); }
.pti-previous ul { margin: 6px 0; padding-left: 18px; }
.pti-sign { font-size: 18px; font-style: italic; }
.pti-group th { background: var(--shade); text-align: left; }
.pti-thumb { width: 96px; height: 96px; object-fit: cover; border: 1px solid var(--face-dark); margin: 4px 4px 0 0; vertical-align: top; }
body.pti-print { background: #fff; padding: 12px; }
.pti-print-note { font-size: 12px; }
.pti-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pti-sticker { border: 2px dashed var(--ink); padding: 10px; text-align: center; break-inside: avoid; }
.pti-sticker svg { width: 180px; height: 180px; }
.pti-sticker-title { font-family: var(--serif); font-weight: bold; font-size: 18px; }
@media print { .pti-print-note { display: none; } body.pti-print { padding: 0; } }
.pti-states input { width: auto; margin: 0; }
.pti-card [hidden] { display: none !important; }
.pti-all { min-height: 220px; font-family: var(--mono); }
.pti-code { font-size: 16px; border: 1px dashed var(--ink); padding: 6px 10px; display: inline-block; }
.pti-proof { display: block; width: auto; margin: 4px 0 8px; border-color: var(--ink); background: var(--warn-bg); }
.pti-video { width: 240px; max-width: 100%; border: 1px solid var(--face-dark); margin: 4px 4px 0 0; vertical-align: top; }
.req { color: var(--bad); font-weight: bold; }
tr.clickrow { cursor: pointer; }
tr.clickrow:hover td { background: var(--info-bg); }
.theme-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-option { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px outset var(--face); padding: 8px 12px; cursor: pointer; background: var(--shade); }
.theme-option:has(input:checked) { border-style: inset; outline: 2px solid var(--info); }
.theme-option input { width: auto; }
.theme-swatch { display: flex; width: 90px; height: 50px; border: 1px solid var(--face-dark); }
.theme-swatch span { flex: 1; }
.theme-light .theme-swatch span:nth-child(1) { background: #ffffff; }
.theme-light .theme-swatch span:nth-child(2) { background: #c0c0c0; }
.theme-light .theme-swatch span:nth-child(3) { background: #0000cc; }
.theme-dark .theme-swatch span:nth-child(1) { background: #1c1c1c; }
.theme-dark .theme-swatch span:nth-child(2) { background: #3c3c3c; }
.theme-dark .theme-swatch span:nth-child(3) { background: #8ab4ff; }
.theme-auto .theme-swatch span:nth-child(1) { background: #ffffff; }
.theme-auto .theme-swatch span:nth-child(2) { background: #808080; }
.theme-auto .theme-swatch span:nth-child(3) { background: #1c1c1c; }
.detail-list em { display: block; }
#saved-map { height: 460px; border-top: 1px solid var(--face-dark); border-bottom: 1px solid var(--face-dark); }
.dot.saved { background: #60a5fa; border-color: #1d4ed8; }
.dot.truck { background: #ffcc00; }
.table-search { width: 260px; max-width: 60%; }
.shop-drive { padding: 6px 10px; margin: 8px 10px 0; border: 1px solid var(--face-dark); background: var(--shade); }
.shop-ask p { margin: 0 0 8px; }

.notif { position: relative; }
.notif-button {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 8px; min-height: 26px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--face-dark);
  font: inherit; font-size: 11px; cursor: pointer;
}
.notif-button:hover { background: var(--hover); }
.notif-button[aria-expanded="true"] { border-color: var(--ink); }
@media (prefers-color-scheme: dark) {
}
.notif-count {
  min-width: 16px; padding: 0 4px;
  background: var(--bad); color: #ffffff;
  font-weight: bold; text-align: center; line-height: 16px;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 2000;
  width: 320px; max-width: calc(100vw - 24px);
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--face-dark);
}
.notif-panel::before {
  content: ""; position: absolute; top: -10px; left: 14px;
  border: 4px solid transparent; border-bottom: 6px solid var(--ink);
}
.notif-empty { margin: 0; padding: 10px 12px; color: var(--muted); }
.notif-panel.full .notif-empty { display: none; }
.notif-item { padding: 10px 12px; border-bottom: 1px solid var(--face-dark); font-family: var(--serif); }
.notif-item:last-child { border-bottom: 0; }
.notif-item ~ .notif-item { display: none; }
.notif-hi { margin: 0 0 4px; font-weight: bold; font-size: 14px; }
.notif-text { margin: 0 0 8px; font-size: 13px; white-space: pre-line; line-height: 1.45; max-height: 50vh; overflow-y: auto; }
.notif-history { border-top: 2px solid var(--ink); max-height: 40vh; overflow-y: auto; }
.notif-history-head {
  margin: 0; padding: 6px 12px 2px;
  font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
}
.notif-history ul { list-style: none; margin: 0; padding: 0 0 4px; }
.notif-history li { padding: 6px 12px; border-bottom: 1px solid var(--shade); }
.notif-history li:last-child { border-bottom: 0; }
.notif-when { display: block; font-size: 10px; color: var(--muted); }
.notif-old { margin: 2px 0 0; font-family: var(--serif); font-size: 12px; white-space: pre-line; line-height: 1.4; }
.notif-panel.full .notif-history, .notif-panel.past .notif-empty { border-top-width: 2px; }
.notif-panel.past .notif-empty { display: none; }
@media (max-width: 640px) {
  .notif-label { display: none; }
  .notif-panel { position: fixed; left: 12px; right: 12px; width: auto; }
  .notif-panel::before { left: var(--notif-arrow, 14px); }
}
@media (prefers-reduced-motion: reduce) {
}

.updated-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: var(--warn-bg);
  color: var(--ink);
  border-bottom: 2px solid var(--warn);
  font-weight: bold;
}
.form-section { margin: 18px 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--face-dark); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.form-section:first-of-type { margin-top: 0; }
.parts-table input { width: 100%; min-width: 70px; }
.parts-table td { vertical-align: middle; }
.parts-add { margin: 8px 0 14px; }
.file-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.file-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wo-summary .stat-value.small { font-size: 16px; word-break: break-word; }
input[readonly] { background: var(--shade); }
.notif-bell { width: 18px; height: 18px; flex: none; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--face-dark); font-weight: bold; font-size: 12px; }
.notif-all, .notif-more { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--link); cursor: pointer; text-decoration: underline; }
.notif-more { display: block; padding: 6px 12px 8px; }
.notif-history li[hidden] { display: none; }
.access-chip { display: inline-block; margin: 2px 6px 2px 0; padding: 1px 6px; border: 1px solid var(--face-dark); font-size: 12px; white-space: nowrap; }
.source-tag { display: inline-block; padding: 0 5px; border: 1px solid var(--face-dark); font-size: 11px; white-space: nowrap; color: var(--muted); }
.source-tag.source-samsara { color: #1d5fbf; border-color: #1d5fbf; }
.source-tag.source-horizon, .source-tag.source-horizoneld { color: #8a4b00; border-color: #8a4b00; }
.hos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; padding: 12px; }
.hos-cell { display: flex; flex-direction: column; gap: 4px; }
.hos-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hos-clock { font-size: 22px; font-variant-numeric: tabular-nums; }
.hos-clock.warn { color: var(--warn); }
.hos-clock.bad { color: var(--bad); }
.hos-cell em { font-size: 11px; color: var(--muted); font-style: normal; }
.hos-mini { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hos-clock-mini.warn { color: var(--warn); font-weight: bold; }
.hos-clock-mini.bad { color: var(--bad); font-weight: bold; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
html.splash body::before {
  content: "KAIDO"; position: fixed; inset: 0; z-index: 6000; display: flex; align-items: center; justify-content: center;
  background: var(--bg, var(--paper)); color: var(--ink); font-family: var(--serif, Georgia, serif); font-size: 30px; font-weight: 700;
  letter-spacing: .5em; text-indent: .5em; animation: kaido-word 1.1s ease both;
}
html.splash body::after {
  content: ""; position: fixed; z-index: 6001; left: 50%; top: calc(50% + 32px); width: 140px; height: 2px; margin-left: -70px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--link)), transparent); background-size: 50% 100%; background-repeat: no-repeat;
  animation: kaido-sweep .9s ease-in-out infinite;
}
html.splash-out body::before, html.splash-out body::after { animation: kaido-fade .35s ease forwards; }
@keyframes kaido-word { from { color: transparent; letter-spacing: .9em; } to { letter-spacing: .5em; } }
@keyframes kaido-sweep { from { background-position: -100% 0; } to { background-position: 200% 0; } }
@keyframes kaido-fade { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html.splash body::before, html.splash body::after { animation: none; }
}
.bill-now { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px; }
.bill-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.bill-amount { font-family: var(--serif); font-size: 36px; font-weight: bold; line-height: 1.15; }
.bill-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.bill-now-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions-row.end { justify-content: flex-end; flex-wrap: nowrap; }
.rate-input { width: 90px; }
.invoice-sheet { background: var(--paper); border: 1px solid var(--face-dark); padding: 28px; max-width: 760px; margin: 0 auto 16px; }
.invoice-top { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.invoice-brand { font-size: 24px; font-weight: bold; letter-spacing: 3px; color: var(--link); }
.invoice-title { text-align: right; font-size: 20px; font-weight: bold; letter-spacing: 2px; }
.invoice-title .subtle { font-size: 12px; font-weight: normal; letter-spacing: 0; }
.invoice-parties { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.invoice-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.invoice-facts { display: grid; grid-template-columns: auto auto; gap: 4px 24px; margin: 0; }
.invoice-facts dt { color: var(--muted); }
.invoice-facts dd { margin: 0; text-align: right; font-weight: bold; }
.invoice-lines { width: 100%; border-collapse: collapse; }
.invoice-lines th, .invoice-lines td { padding: 8px 6px; border-bottom: 1px solid var(--face-dark); text-align: left; }
.invoice-lines .right { text-align: right; }
.invoice-total { display: flex; justify-content: flex-end; gap: 32px; align-items: baseline; margin: 16px 6px 4px; font-size: 16px; }
.invoice-total strong { font-size: 20px; }
.invoice-paid { text-align: right; color: var(--ok); margin: 0 6px 12px; }
.note-cell { min-width: 280px; }
#saved-table input[name=name] { min-width: 190px; width: 100%; }
#saved-table input[name=phone] { min-width: 130px; width: 100%; }
#saved-table .actions-row { flex-wrap: nowrap; }
.note-cell textarea { width: 100%; min-height: 0; resize: vertical; field-sizing: content; line-height: 1.4; }
.note-text, .shop-note, .shop-history { white-space: pre-line; overflow-wrap: anywhere; }
@media print { .topbar, .page-head, .invoice-sheet ~ .panel { display: none; } .invoice-sheet { border: 0; } }
