@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --base: #131b20;
  --bar: #172229;
  --panel: #202a30;
  --line: #384b54;
  --muted: #a5b4bf;
  --ink: #f5f8fb;
  --accent: #63d5d8;
  --running: #7be289;
  --idle: #f7c55e;
  --alarm: #ff9690;
  --off: #9eafb9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--base); color: var(--ink); font: 400 15px/1.5 Inter, system-ui, sans-serif; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.bar { background: var(--bar); border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 1184px; padding: 0 28px; margin: auto; display: flex; justify-content: space-between; align-items: center; min-height: 72px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 400; letter-spacing: -.025em; }
.brand-mark { display: block; flex: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: #000; }
main { max-width: 1184px; margin: auto; padding: 42px 28px 110px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.08; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 18px; }
h3 { font-size: 14px; }
p, dt { color: var(--muted); }
.page-heading, .card-top, .card-footer, .activity-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-heading { margin-bottom: 24px; }
#fleet-summary { margin-top: 8px; }
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.panel, .login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.machine-card { padding: 20px; display: grid; gap: 19px; transition: border-color .15s, background-color .15s; }
.machine-card:hover, .machine-card:focus-visible { border-color: var(--accent); background: #23343b; }
.card-top { align-items: start; }
.card-top h2 { overflow-wrap: anywhere; }
.card-state { display: flex; align-items: center; gap: 10px; font-size: 24px; color: var(--state); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
dt, .card-footer { font-size: 12px; }
dd { margin-top: 4px; font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.card-footer { padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); }
.card-footer span:last-child { color: var(--accent); font-size: 20px; line-height: 1; }
.connection { flex-shrink: 0; border: 1px solid var(--line); color: var(--muted); background: #29333a; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 30px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.connection::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--alarm); }
.connection[data-connected="true"]::before { background: var(--running); }
.card-utilisation { display: grid; gap: 6px; min-height: 35px; }
.utilisation-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.utilisation-label strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.card-utilisation progress { width: 100%; height: 7px; appearance: none; color: var(--accent); accent-color: var(--accent); border: 0; border-radius: 10px; overflow: hidden; background: #34424a; }
.card-utilisation progress::-webkit-progress-bar { background: #34424a; }
.card-utilisation progress::-webkit-progress-value { background: var(--accent); border-radius: 10px; }
.card-utilisation progress::-moz-progress-bar { background: var(--accent); border-radius: 10px; }
.utilisation-note { margin-top: 15px; font-size: 12px; }
[data-state] { --state: var(--off); }
[data-state="running"] { --state: var(--running); }
[data-state="idle"] { --state: var(--idle); }
[data-state="alarm"] { --state: var(--alarm); }
.state-light, .event-dot { width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; background: var(--state); }
.back { display: inline-block; color: var(--accent); padding: 8px 0; font-size: 14px; font-weight: 600; }
.back:hover { text-decoration: underline; }
#detail { max-width: 880px; margin: auto; }
.detail-heading { margin: 14px 0 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.machine-state { padding: clamp(24px, 6vw, 56px) 16px; text-align: center; }
.state-pill { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 144px; padding: 8px 19px; border: 1px solid var(--state); border-radius: 100px; color: var(--state); background: color-mix(in srgb, var(--state) 13%, var(--base)); font-size: 16px; letter-spacing: .1em; text-transform: uppercase; }
.caption, .section-title, .reading h3 { text-transform: uppercase; letter-spacing: .11em; color: var(--muted); font-weight: 600; }
.caption { margin-top: 22px; font-size: 13px; }
.timer { margin-top: 6px; color: var(--ink); font-size: clamp(35px, 8vw, 64px); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.info-grid { margin-top: 13px; }
.info-grid > div { padding: 16px; }
.section-title { font-size: 14px; text-align: center; margin: 0 0 16px; }
.readings { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.reading { text-align: center; padding: 24px 10px; }
.reading.wide { grid-column: 1 / -1; }
.reading p { margin-top: 9px; color: var(--ink); font-size: clamp(22px, 5.5vw, 42px); font-weight: 700; font-variant-numeric: tabular-nums; }
.sample-time { margin-top: 14px; text-align: center; font-size: 13px; }
.activity-head { padding: 16px; }
.activity-head p { margin-top: 3px; font-size: 12px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
td, th { padding: 11px 16px; border-top: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--accent); background: var(--bar); }
td { font-size: 13px; }
.event-state { display: inline-flex; align-items: center; gap: 8px; }
.event-dot { width: 7px; height: 7px; }
.history-message:not(:empty) { padding: 14px 16px; }
.tabs { position: fixed; z-index: 1; inset: auto 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 168px)); justify-content: center; border-top: 1px solid var(--line); background: var(--bar); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { min-height: 67px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; color: var(--muted); border-top: 2px solid transparent; }
.tabs a span { font-size: 21px; line-height: 1.1; }
.tabs a:hover { background: #243239; }
.tabs a[aria-current="page"] { color: var(--accent); border-color: var(--accent); background: #203039; }
.quiet, .primary { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--ink); background: transparent; white-space: nowrap; }
.quiet:not(:disabled):hover { background: #2a3941; }
.primary { background: var(--accent); border-color: var(--accent); color: #16232a; margin-top: 8px; padding: 11px 12px; }
.login { max-width: 440px; margin: 6vh auto 0; }
.login-card { padding: 28px; }
.login p { margin: 10px 0 24px; }
form { display: grid; gap: 8px; }
label { font-size: 13px; color: var(--muted); }
input { font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--base); color: var(--ink); margin-bottom: 8px; width: 100%; }
.notice:empty { display: none; }
.notice { margin: 0 0 18px; color: var(--idle); font-size: 14px; }
#login:not([hidden]) + .notice { max-width: 440px; margin: 14px auto; }
@media (max-width: 600px) {
  main { padding: 23px 14px calc(92px + env(safe-area-inset-bottom)); }
  .bar-inner { padding: 0 14px; min-height: 60px; }
  .brand { font-size: 16px; gap: 7px; }
  .brand-mark { width: 34px; height: 34px; }
  td, th { padding: 10px; white-space: normal; }
  .tabs { grid-template-columns: repeat(3, 1fr); }
}
