:root {
  font-family:system-ui,-apple-system,"Segoe UI","Microsoft YaHei",sans-serif;
  color:#193332;
  background:#f2f5f4;
  font-synthesis:none;
  line-height:1.6
}
.ledger-page { max-width: 1600px; margin: 0 auto; }
.ledger-filters { display: grid; grid-template-columns: repeat(4,minmax(160px,1fr)); gap: 18px; padding: 24px; }
.ledger-filters label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.ledger-filters [hidden] { display: none; }
.ledger-actions { display: flex; align-items: end; gap: 10px; }
.ledger-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 18px 0; }
.ledger-scroll { overflow-x: auto; padding: 0; }
.ledger-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.ledger-table th { background: #e3eeea; text-align: left; white-space: nowrap; color: #204c42; }
.ledger-table td,.ledger-table th { border-bottom: 1px solid #dce5e1; padding: 14px 12px; vertical-align: top; }
.ledger-table td { min-width: 95px; max-width: 330px; overflow-wrap: anywhere; white-space: pre-wrap; }
.ledger-table tr:hover td { background: #f6f9f7; }
.ledger-detail { width: max-content; min-width: 100%; }
.ledger-detail td { min-width: 170px; max-width: 450px; }
.ledger-sections { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.ledger-sections a { background: #e3eeea; padding: 6px 12px; border-radius: 6px; }
.ledger-page section { scroll-margin-top: 20px; margin: 32px 0; }
.ledger-history-card { padding: 20px; margin: 14px 0; }
.ledger-history-card dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px 26px; margin: 0; }
.ledger-history-card dt { font-size: 13px; color: #546f66; margin-bottom: 5px; }
.ledger-history-card dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media(min-width: 1200px) { main:has(.ledger-page) { max-width: 1640px; } }
@media(max-width: 850px) { .ledger-filters { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 16px; } .ledger-history-card dl { grid-template-columns: repeat(2,minmax(0,1fr)); } }
* {
  box-sizing:border-box
}
body {
  margin:0
}
a {
  color:#12665b;
  text-decoration:none
}
button,input,select,textarea {
  font:inherit
}
button,.button {
  display:inline-block;
  background:#11695c;
  color:white;
  border:1px solid #11695c;
  border-radius:8px;
  padding:10px 18px;
  cursor:pointer;
  text-align:center;
  font-weight:600
}
button:hover,.button:hover {
  filter:brightness(.93)
}
button:disabled {
  opacity:.45;
  cursor:default
}
button.secondary {
  background:white;
  color:#12665b;
  border-color:#b8ceca
}
.warehouse-list { display: grid; gap: 10px; }
.warehouse-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #dbe5e1; }
.warehouse-row span { overflow-wrap: anywhere; min-width: 0; }
.warehouse-row button { flex-shrink: 0; }
button.warehouse-delete { color: #a32424; background: white; border-color: #d9aaaa; }
.warehouse-row [hidden] { display: none; }
.warehouse-confirmation { width: 100%; }
.warehouse-confirmation button { margin-right: 8px; }
button.quiet {
  background:transparent;
  color:#314d49;
  border-color:#d6dfdc;
  padding:6px 12px
}
button:focus-visible,a:focus-visible {
  outline:3px solid #dda749;
  outline-offset:3px
}
.topbar {
  background:white;
  border-bottom:1px solid #dbe5e1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 5%;
  gap:14px
}
.brand {
  font-size:19px;
  font-weight:750;
  color:#193332;
  display:flex;
  align-items:center;
  gap:10px
}
.brand-mark {
  display:inline-grid;
  place-items:center;
  background:#11695c;
  color:white;
  border-radius:9px;
  width:36px;
  height:36px
}
.brand small {
  font-size:11px;
  color:#687d77;
  font-weight:500
}
nav {
  display:flex;
  align-items:center;
  gap:18px;
  font-size:14px
}
main {
  max-width:1180px;
  margin:0 auto;
  padding:36px 24px 60px;
  min-height:78vh
}
footer {
  text-align:center;
  font-size:12px;
  color:#6c8179;
  padding:20px
}
h1 {
  font-size:30px;
  line-height:1.25;
  margin:10px 0 16px;
  letter-spacing:-.5px
}
h2 {
  font-size:20px;
  margin:0 0 18px
}
p {
  margin:10px 0
}
.eyebrow {
  font-size:12px;
  letter-spacing:1px;
  color:#648078;
  font-weight:650
}
.page-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:22px
}
.page-heading p {
  color:#5f756c
}
.panel {
  background:#fff;
  border:1px solid #dce6e1;
  border-radius:14px;
  padding:26px;
  margin-bottom:24px;
  box-shadow:0 3px 12px #1b493305
}
.muted {
  font-size:13px;
  color:#62766e
}
.badge {
  background:#e3ece8;
  border-radius:30px;
  padding:6px 15px;
  font-size:13px;
  white-space:nowrap
}
.search {
  display:flex;
  align-items:end;
  gap:16px
}
.search label {
  flex:1
}
.search button {
  margin-bottom:16px
}
.vehicle-grid {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px
}
.vehicle-card {
  display:block;
  border:1px solid #dce6e1;
  border-radius:10px;
  padding:20px;
  color:#193332;
  transition:border-color .15s
}
.vehicle-card:hover {
  border-color:#168f7d
}
.vehicle-card h2 {
  margin:8px 0
}
.vehicle-card p {
  font-size:13px;
  color:#667d74
}
.status {
  font-size:13px;
  display:inline-block;
  padding:5px 12px;
  border-radius:6px;
  font-weight:650;
  white-space:nowrap
}
.available {
  background:#e5f4ec;
  color:#176841
}
.suspended {
  background:#fff0dc;
  color:#965516
}
.retired {
  background:#f0e9eb;
  color:#844958
}
.two-columns {
  display:grid;
  grid-template-columns:1.3fr 1fr;
  gap:24px
}
.two-columns>.panel {
  align-self:start
}
label {
  display:block;
  font-size:14px;
  font-weight:600;
  margin-bottom:16px
}
input,select,textarea {
  display:block;
  width:100%;
  border:1px solid #cbd9d2;
  border-radius:7px;
  background:#fff;
  padding:10px 12px;
  margin-top:6px;
  color:#18332b;
  min-height:44px
}
textarea {
  min-height:88px;
  resize:vertical
}
input:focus,select:focus,textarea:focus {
  outline:2px solid #97cfc2;
  outline-offset:1px
}
.form-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 16px
}
.message {
  color:#b13832;
  font-size:14px;
  overflow-wrap:anywhere
}
.message:empty {
  display:none
}
.empty {
  color:#6b7f77;
  grid-column:1/-1;
  padding:30px 0
}
.pager {
  display:flex;
  justify-content:end;
  gap:12px;
  margin-top:24px
}
.back {
  display:inline-block;
  margin-bottom:20px;
  font-size:14px
}
.facts {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px
}
.facts dt {
  font-size:12px;
  color:#70847b
}
.facts dd {
  margin:4px 0;
  overflow-wrap:anywhere
}
.facts .wide {
  grid-column:1/-1
}
.mono {
  font-family:ui-monospace,monospace;
  font-size:12px;
  overflow-wrap:anywhere
}
.notice {
  background:#f3f7f5;
  border-left:3px solid #99b7aa;
  padding:14px 16px;
  margin:22px 0;
  color:#4d655a;
  font-size:13px
}
.status-note {
  font-size:14px;
  color:#5c7166
}
.history-row {
  padding:16px 0;
  border-bottom:1px solid #e6ece9
}
.history-row small {
  color:#798b83
}
.history-row p {
  font-size:14px
}
.login-shell {
  display:grid;
  grid-template-columns:1fr 420px;
  align-items:center;
  gap:70px;
  max-width:970px;
  margin:60px auto
}
.login-intro h1 {
  font-size:44px;
  line-height:1.3
}
.login-intro p {
  max-width:350px
}
.login-shell form button {
  width:100%
}
.login-shell form {
  padding:34px
}
.account {
  max-width:500px;
  margin:35px auto
}
.qr-sheet {
  background:#fff;
  border:1px solid #dce6e1;
  padding:35px;
  text-align:center;
  max-width:540px;
  margin:20px auto;
  border-radius:12px
}
.qr-sheet img {
  max-width:100%;
  height:auto
}
.qr-sheet h1 {
  font-size:34px
}
.scan-url {
  font-size:11px;
  overflow-wrap:anywhere
}
.print-controls {
  display:flex;
  justify-content:space-between;
  gap:20px
}
@media(max-width:760px) {
  .topbar {
    padding:12px 16px;
    flex-wrap:wrap
  }
  .brand {
    font-size:16px
  }
  .brand small {
    display:none
  }
  nav {
    gap:14px;
    font-size:12px;
    margin-left:auto
  }
  main {
    padding:24px 16px 40px
  }
  h1 {
    font-size:27px
  }
  .panel {
    padding:20px;
    border-radius:12px
  }
  .vehicle-grid,.two-columns {
    grid-template-columns:1fr
  }
  .search {
    flex-wrap:wrap;
    gap:0
  }
  .search label {
    flex-basis:100%
  }
  .search button {
    width:100%
  }
  .form-grid {
    grid-template-columns:1fr
  }
  .login-shell {
    grid-template-columns:1fr;
    gap:22px;
    margin:12px auto
  }
  .login-intro h1 {
    font-size:31px
  }
  .login-intro h1 br {
    display:none
  }
  .login-shell form {
    padding:24px
  }
  .page-heading {
    align-items:start
  }
  .vehicle-detail .page-heading {
    display:block
  }
  .facts {
    gap:16px
  }
  .status {
    white-space:normal
  }
  .qr-sheet {
    padding:20px
  }
  .qr-sheet h1 {
    font-size:28px
  }
  .print-controls {
    flex-wrap:wrap
  }
}
[hidden] {display:none !important}
.check-item {border:1px solid #cdd9e5;border-radius:12px;margin:18px 0;padding:16px}
.check-item legend {font-weight:700;padding:0 6px}
.check-choices {display:flex;gap:12px;flex-wrap:wrap}
.check-choices label {display:flex;align-items:center;gap:8px;padding:10px;background:#f0f5fa;border-radius:8px}
.check-choices input {width:auto;margin:0;min-height:24px}
.check-choices label:has(input:checked) {background:#d9eee7;outline:2px solid #146b61}
.check-choices label:has(input[value=abnormal]:checked) {background:#fff0ed;outline-color:#b42318}
.inspection-progress {position:sticky;top:0;z-index:2;background:#edf6f2;border:1px solid #bbd8ca;padding:12px;border-radius:8px}
.check-record {padding:16px 0;border-bottom:1px solid #dde5ed;overflow-wrap:anywhere}
.check-record>span {float:right}
.photo-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px;margin:16px 0}
.photo-grid img {max-width:100%;max-height:360px;object-fit:contain;border-radius:8px}
.danger {border-left:4px solid #b42318;background:#fff1ef;color:#8a2018}
@media print {
  body {
    background:white;
    color:black
  }
  .topbar,footer,.print-controls {
    display:none!important
  }
  main {
    padding:0;
    min-height:0
  }
  .qr-sheet {
    border:2px solid #111;
    break-inside:avoid;
    box-shadow:none;
    width:100mm;
    max-width:100mm;
    margin:15mm auto;
    padding:8mm
  }
  .qr-sheet img {
    width:65mm;
    height:65mm
  }
  .qr-sheet p {
    font-size:10pt
  }
  .qr-sheet .mono,.qr-sheet .scan-url {
    font-size:7pt
  }
  @page {
    margin:12mm
  }
}

#fault-record h1 { overflow-wrap:anywhere; font-size:1.65rem; } .fault-description { white-space:pre-wrap; overflow-wrap:anywhere; } #fault-record img { max-width:100%; height:auto; } #fault-list .panel { overflow-wrap:anywhere; }

/* Stage 4B read-only management statistics. */
.stats-metrics {display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:12px;margin:20px 0;}
.stats-card {text-align:left;background:#fff;color:#173c35;border:1px solid #cadbd6;border-radius:12px;padding:18px;min-height:110px;}
.stats-card:hover {background:#ecf6f2;} .stats-card span {display:block;font-size:14px;font-weight:normal;} .stats-card strong {display:block;font-size:30px;margin-top:8px;}
#inspection-statistics td {white-space:pre-line;} #inspection-statistics summary {cursor:pointer;font-weight:700;} #stats-rules li {margin:12px 0;line-height:1.6;}
@media(max-width:1050px) {.stats-metrics {grid-template-columns:repeat(3,minmax(110px,1fr));}}
@media(max-width:550px) {.stats-metrics {grid-template-columns:repeat(2,minmax(100px,1fr));}}

/* Stage 4C keeps the complete statistic service behind a calmer overview. */
#stats-metrics {grid-template-columns:repeat(4,minmax(130px,1fr));}
#stats-issues {grid-template-columns:repeat(3,minmax(130px,1fr));margin-bottom:0;}
#usage-cards {grid-template-columns:repeat(5,minmax(130px,1fr));}
#driver-management td,#usage-duration td {white-space:pre-line;}
#driver-events pre {white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;}
#driver-management td button {margin:0 8px 8px 0;}
#driver-management .ledger-filters > button {align-self:end;}
#usage-duration summary,#driver-management summary {cursor:pointer;font-weight:700;}
#usage-rules li {margin:12px 0;line-height:1.6;}
@media(max-width:850px) {#stats-metrics,#stats-issues,#usage-cards {grid-template-columns:repeat(2,minmax(120px,1fr));}}

/* Driver-only shell; PC management retains its existing layout. */
.driver-mobile {font-size:17px;overflow-wrap:anywhere;}
.driver-mobile main {max-width:600px;margin:0 auto;padding:20px 16px;min-height:calc(100dvh - 160px);}
.driver-top {max-width:600px;margin:auto;display:flex;align-items:center;gap:12px;padding:18px 20px;border-bottom:1px solid #dbe5e0;}
.driver-mobile .panel {padding:22px;margin-bottom:20px;min-width:0;}
.driver-mobile h1 {font-size:30px;line-height:1.3;margin:12px 0;}
.driver-mobile h2 {font-size:22px;}.driver-mobile input,.driver-mobile textarea,.driver-mobile select {font-size:17px;max-width:100%;min-width:0;}
.driver-mobile button,.driver-mobile .button {min-height:52px;touch-action:manipulation;}
.driver-primary-actions {display:grid;gap:16px;}
.driver-primary-actions .driver-action {display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding:24px;min-height:116px;width:100%;text-align:left;border-radius:18px;}
.driver-action strong {font-size:28px;}.driver-action span {font-size:16px;font-weight:400;margin-top:6px;}
.driver-record-link {text-align:center;margin:24px 0;}.driver-footer {max-width:600px;margin:auto;display:flex;justify-content:space-around;align-items:center;padding:12px 16px calc(12px + env(safe-area-inset-bottom));}
.driver-footer a {padding:12px;}.driver-mobile .notice {padding:14px;font-size:16px;}.driver-mobile .eyebrow {font-size:14px;}
.driver-mobile .check-item {min-width:0;padding:14px 12px;}.driver-mobile .check-choices {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.driver-mobile .check-choices label {min-height:58px;font-size:19px;justify-content:center;margin:0;}
.driver-mobile .check-item legend {font-size:18px;}.driver-mobile .inspection-progress {font-size:15px;max-height:130px;overflow:auto;}
.driver-mobile #pre-submit,.driver-mobile #confirm-use,.driver-mobile #fault-submit,.driver-mobile #scan-start {width:100%;margin:12px 0;}
.driver-mobile #edit-inspection {width:100%;}.driver-mobile .back {display:inline-block;padding:10px 0;}
.driver-mobile .notice > a {display:block;min-height:44px;padding:10px 0;margin-top:6px;}
#scan-video {width:100%;max-height:420px;object-fit:cover;border-radius:14px;background:#193332;}
#driver-scanner summary {padding:12px 0;cursor:pointer;}#confirmation-items p {margin:8px 0;}#inspection-confirmation {scroll-margin:16px;}
@media(max-width:360px) {.driver-mobile .panel {padding:16px;}.driver-mobile main {padding:16px 12px;}.driver-mobile h1 {font-size:27px;}}
#driver-new-account:not([hidden]) { grid-column:1 / -1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; padding:18px; border:1px solid var(--line,#d9e5e2); border-radius:12px; }
#driver-new-account > p { grid-column:1 / -1; margin:0; }
@media(max-width:760px) { #driver-new-account:not([hidden]) { grid-template-columns:1fr; } }

/* Stage 5A-4 PC management only; driver workflow remains unchanged. */
.ledger-advanced{grid-column:1/-1}.business-timeline{list-style:none;padding-left:20px;border-left:2px solid #b9d6d0}.business-timeline li{position:relative;margin:0 0 28px;padding-left:12px}.business-timeline li::before{content:"";position:absolute;left:-27px;top:8px;width:12px;height:12px;background:#176e63;border-radius:50%}.business-timeline time{color:#526c76;font-size:14px}.business-timeline h3{margin:6px 0}.business-timeline p{white-space:pre-wrap;overflow-wrap:anywhere}.ledger-page details>summary{cursor:pointer;padding:10px 0}.stats-card strong{overflow-wrap:anywhere}
#monthly-query .ledger-actions{grid-column:span 2;flex-wrap:wrap}#monthly-query button{white-space:nowrap;min-width:110px}

/* Stage 5A-6: one consolidated safety notice, touch friendly. */
#fault-notice-dialog {border:1px solid #bed4ce;border-radius:16px;padding:20px;max-width:540px;width:calc(100% - 32px);max-height:85dvh;overflow:auto;color:#173f37;box-sizing:border-box;}
#fault-notice-dialog::backdrop {background:#163d36aa;}
#fault-notice-dialog button {min-height:48px;margin:6px 0;width:100%;}
.fault-description {white-space:pre-wrap;overflow-wrap:anywhere;}
.repair-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:0;list-style:none}.repair-steps li{border:1px solid #d4e3de;border-radius:8px;padding:12px;background:#f5f9f7}.repair-steps strong,.repair-steps span{display:block}.repair-steps span{font-size:14px;margin-top:6px}.repair-primary-action{margin:12px 0 20px}.advanced-fault-actions{margin-top:18px}@media(max-width:650px){.repair-steps{grid-template-columns:1fr}}
