:root {
  color-scheme: light;
  --ink: #17292c; --muted: #516565; --fine: #6c7c7e; --line: #dbe5e3;
  --ground: #f5f7f6; --paper: #fff; --soft: #edf3f1;
  --accent: #12654f; --accent-dark: #084d3d; --accent-soft: #dff3e8;
  --amber: #82521e; --amber-bg: #fff1dd; --red: #a1323b; --red-bg: #fcebee;
  --radius: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: var(--ground); color: var(--ink); font: 15px/1.5 system-ui, "Microsoft YaHei", sans-serif; letter-spacing: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 32px; line-height: 1.18; font-weight: 740; overflow-wrap: anywhere; }
h2 { font-size: 18px; line-height: 1.35; }
h3 { font-size: 15px; }
b, strong { font-weight: 710; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button, a, input, select { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { flex: none; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: min(1080px, calc(100% - 64px)); margin-inline: auto; }
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner { min-height: 65px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; color: #16342f; font-size: 18px; font-weight: 760; white-space: nowrap; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; color: white; background: #12473e; border-radius: 7px; }
.top nav { display: flex; align-items: center; gap: 23px; color: var(--muted); font-size: 13px; }
.top nav a { display: grid; min-height: 64px; place-items: center; padding-inline: 4px; border-bottom: 2px solid transparent; }
.top nav a:hover, .top nav a[aria-current] { color: var(--accent-dark); border-bottom-color: var(--accent); }
main { padding-block: 33px 48px; }
.loading { padding-block: 35px; color: var(--muted); }
.crumb { display: inline-flex; gap: 7px; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 15px; min-height: 28px; }
.crumb:hover { color: var(--accent-dark); }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 730; margin-bottom: 7px; }
.eyebrow:empty { display: none; }
.head { padding-bottom: 20px; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.head .sub { margin-top: 8px; }
.sub { color: var(--muted); font-size: 13px; }
.section { padding-block: 20px 25px; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 13px; }
.section-head svg { color: var(--accent); }
.empty { color: var(--muted); padding: 15px 0; font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; width: fit-content; padding: 2px 8px; border-radius: 4px; color: #4c5e63; background: #eaf0ef; font-size: 12px; font-weight: 690; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.online, .pill.ready, .pill.charging, .pill.replied { color: var(--accent-dark); background: var(--accent-soft); }
.pill.occupied, .pill.starting, .pill.stopping, .pill.start_unknown, .pill.stop_unknown, .pill.pending, .pill.unconnected, .pill.unknown { color: var(--amber); background: var(--amber-bg); }
.pill.fault { color: var(--red); background: var(--red-bg); }
.fleet-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--soft); border-block: 1px solid var(--line); margin-bottom: 12px; }
.fleet-summary .metric + .metric { border-left: 1px solid var(--line); }
.metric { min-width: 0; min-height: 76px; padding: 12px 16px; font-variant-numeric: tabular-nums; }
.metric .label { display: block; margin-bottom: 4px; font-weight: 630; }
.metric span { font-size: 12px; color: var(--muted); }
.metric strong { font-size: 25px; line-height: 1.15; overflow-wrap: anywhere; }
.fleet-row { display: grid; grid-template-columns: minmax(0, 1fr) 145px 125px 24px; align-items: center; gap: 16px; padding: 12px 15px; min-height: 74px; border-bottom: 1px solid var(--line); }
.fleet-list { border-top: 1px solid var(--line); }
.fleet-caption { min-height: 37px; padding-block: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
a.fleet-row { background: var(--paper); }
a.fleet-row:hover { background: #eff8f3; }
.fleet-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fleet-name b, .unit b { display: block; overflow-wrap: anywhere; }
.fleet-row small, .unit small { display: block; font-size: 12px; color: var(--fine); margin-top: 2px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.fleet-ports, .arrow { color: var(--muted); font-size: 13px; }
.device-tabs { display: flex; align-items: stretch; gap: 21px; border-bottom: 1px solid var(--line); }
.device-tabs a { display: inline-flex; align-items: center; gap: 7px; min-height: 41px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 650; }
.device-tabs a:hover, .device-tabs a[aria-current] { color: var(--accent-dark); border-bottom-color: var(--accent); }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.unit { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px; background: var(--paper); border: 1px solid var(--line); min-height: 79px; border-radius: var(--radius); }
.unit:hover { border-color: #85b2a4; background: #f4fbf7; }
.unit b { margin-bottom: 3px; }
.plug { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-dark); }
.settings-row { display: flex; min-height: 69px; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding-block: 11px; border-block: 1px solid var(--line); }
.settings-row p { margin-top: 3px; }
.gun-select { width: 115px; }
.gun-select select { min-height: 37px; padding-block: 4px; }
.charge-wrap { width: min(100%, 720px); margin-inline: auto; }
.charge-band { padding: 20px 22px 17px; background: #edf3f1; border-block: 1px solid #d1e0dc; }
.charge-band.ready, .charge-band.charging { background: #e9f5ef; border-color: #c5e4d3; }
.charge-band.start_unknown, .charge-band.stop_unknown, .charge-band.offline_pending, .charge-band.fault { background: #faf1e5; border-color: #efe2ce; }
.charge-state { display: flex; align-items: center; gap: 13px; }
.charge-state h2 { font-size: 23px; }
.charge-state p { font-size: 13px; color: var(--muted); }
.state-icon { display: grid; place-items: center; flex: none; width: 52px; height: 52px; color: var(--accent-dark); background: var(--paper); border: 1px solid #c5ddd2; border-radius: 8px; }
.charge-band.charging .state-icon { color: white; background: #17725a; border-color: #17725a; }
.status-note { padding-top: 10px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0 4px; background: #ffffffa8; }
.metrics .metric { padding-inline: 12px; }
.metrics .metric + .metric { border-left: 1px solid var(--line); }
.soc { margin: 14px 0 0; }
.soc div { display: flex; justify-content: space-between; font-size: 13px; color: #245b4c; }
.soc progress { display: block; width: 100%; height: 12px; accent-color: var(--accent); }
.charge-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 17px; }
.charge-action { min-width: min(100%, 182px); min-height: 47px; }
.updated { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.charge-history { padding-top: 25px; }
.list { display: grid; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 10px 3px; border-bottom: 1px solid var(--line); }
.row strong, .row span { overflow-wrap: anywhere; }
.row-sub { display: block; color: var(--muted); font-size: 12px; }
.right { flex: 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; border: 1px solid #cbdad8; border-radius: 6px; padding: 7px 12px; background: white; color: var(--ink); font-weight: 670; text-align: center; font-size: 14px; line-height: 1.25; }
.button:hover, .icon-button:hover { background: var(--soft); border-color: #7ea998; }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-dark); }
.button.stop { background: #fff; color: var(--red); border-color: #d6a7aa; }
.button.stop:hover { background: var(--red-bg); }
.button.subtle { min-height: 36px; }
.button.small { min-height: 34px; padding-inline: 9px; font-size: 13px; }
.button:disabled { cursor: not-allowed; color: #5c7070; background: #e6eceb; border-color: #d4e0de; }
.icon-button { width: 37px; min-height: 37px; padding: 0; }
.auth-view { background: #edf4f0; }
.auth-view main { padding-top: 54px; }
.auth-view .top nav a { display: none; }
.auth-shell { width: min(100%, 448px); margin-inline: auto; padding: 29px 32px 22px; background: var(--paper); border: 1px solid #d0e0d9; border-radius: 8px; box-shadow: 0 16px 36px #123e2d0d; }
.auth-header { display: grid; justify-items: start; gap: 7px; margin-bottom: 21px; }
.auth-icon { display: grid; width: 44px; height: 44px; place-items: center; color: var(--accent-dark); background: var(--accent-soft); border-radius: 7px; margin-bottom: 4px; }
.auth-header .eyebrow { margin: 0; }
.auth-header h1 { font-size: 29px; }
.auth-switch { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; margin-bottom: 19px; padding: 3px; background: var(--soft); border-radius: 6px; }
.auth-switch button { background: transparent; border: 1px solid transparent; border-radius: 4px; font-weight: 650; color: var(--muted); min-height: 38px; }
.auth-switch button[aria-pressed="true"] { background: white; color: var(--accent-dark); border-color: #d2e0db; }
.auth-shell form, .dialog-form { display: grid; gap: 12px; }
.auth-shell form { gap: 13px; }
.auth-shell form > label[for="auth-password"] { margin-bottom: -8px; }
.auth-shell form > .primary { min-height: 45px; margin-top: 4px; justify-content: space-between; padding-inline: 15px; }
.auth-shell .error:empty { display: none; }
.auth-shell input::placeholder { font-weight: 400; color: #647777; }
.password-field { position: relative; }
.password-field input { padding-right: 47px; }
.password-field .icon-button { position: absolute; top: 3px; bottom: 3px; right: 3px; min-height: 0; height: auto; border-color: transparent; color: var(--muted); }
.guest-label { color: var(--muted); font-size: 13px; font-weight: 650; }
.input-label { display: grid; gap: 5px; font-size: 13px; font-weight: 670; }
input, select { width: 100%; min-height: 43px; border: 1px solid #b8cbc7; border-radius: 6px; background: white; padding: 7px 10px; color: var(--ink); }
.error { color: var(--red); min-height: 1.5em; font-size: 13px; }
dialog { width: min(440px, calc(100% - 28px)); max-height: calc(100% - 28px); border: 1px solid var(--line); border-radius: 8px; padding: 18px; color: var(--ink); box-shadow: 0 14px 46px #14232235; }
dialog::backdrop { background: #152426a6; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 12px; }
.dialog-actions { justify-content: flex-end; }
.qr-img { display: block; width: min(100%, 200px); height: auto; aspect-ratio: 1; margin-inline: auto; background: white; }
.toast { position: fixed; z-index: 2; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 8px 13px; border-radius: 6px; background: #173d37; color: white; overflow-wrap: anywhere; }
.sr-only { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
@media (max-width: 680px) {
  .wrap { width: calc(100% - 32px); }
  main { padding-block: 21px 33px; }
  .top-inner { min-height: 54px; gap: 7px; }
  .brand { gap: 6px; font-size: 15px; }
  .brand-mark { width: 28px; height: 28px; }
  .top nav { gap: 9px; font-size: 12px; }
  .top nav a { min-height: 53px; padding-inline: 0; }
  .top .exit { width: 32px; min-height: 32px; }
  h1 { font-size: 25px; }
  .auth-view main { padding-top: 25px; }
  .auth-shell { padding: 21px 19px 19px; }
  .auth-header h1 { font-size: 25px; }
  .head { padding-bottom: 14px; }
  .fleet-caption { display: none; }
  .fleet-row { grid-template-columns: minmax(0, 1fr) auto 16px; gap: 5px 8px; padding: 10px; }
  .fleet-name { grid-column: span 2; }
  .fleet-row > .arrow { grid-column: 3; grid-row: 1; }
  .fleet-ports { font-size: 12px; }
  .fleet-summary .metric { padding-inline: 9px; min-height: 66px; }
  .metric strong { font-size: 20px; }
  .charge-band { padding: 14px 12px; }
  .charge-state h2 { font-size: 20px; }
  .metrics .metric { padding-inline: 7px; }
  .metrics .metric span { font-size: 11px; }
  .metrics .metric strong { font-size: 19px; }
  .charge-action { width: 100%; }
  .charge-bottom .updated { margin-left: auto; }
}
