/* Fonts: Space Grotesk and Space Mono (SIL Open Font License 1.1), self-hosted – no external requests. */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/space-grotesk-variable.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/space-mono-regular.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/space-mono-bold.woff2") format("woff2"); }
:root { color-scheme: dark; --bg: #0d1016; --card: #181c24; --card2: #1e222b; --line: #282d38; --line2: #343a47; --text: #f2f3f5; --muted: #9ba1ac; --dim: #878e9b; --accent: #e2001a; --accent-rgb: 226, 0, 26; --accent-hi: #ff6575; --accent-top: #f3213b; --accent-bot: #d4001b; --accent-top-h: #ff2f49; --accent-bot-h: #e0001d; --accent-text: #ffffff; --ok: #4ade80; --soon: #fbbf24; --overdue: #fa7a7a; --ok-rgb: 74, 222, 128; --soon-rgb: 251, 191, 36; --overdue-rgb: 250, 122, 122; --ok-bg: rgba(74,222,128,.12); --soon-bg: rgba(251,191,36,.12); --overdue-bg: rgba(250,122,122,.14); --radius: 12px; --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-surface: var(--r-l); --fg-rgb: 255, 255, 255; --strong: #fff; --shade-rgb: 0, 0, 0; --panel-rgb: 30, 34, 43; --panel-deep-rgb: 16, 19, 27; --glass: rgba(27,31,41,.68); --glass2: rgba(var(--fg-rgb),.055); --glass-b: rgba(var(--fg-rgb),.085); --hi-rgb: 255, 255, 255; --btn-edge: rgba(var(--fg-rgb), .2); --on-dark: #fff; --black: #000; --retro: #4f8cff; --on-ok: #06210f; --btn-hi: rgba(var(--hi-rgb), .14); --tabh: 58px; --sw: 84px; --safe-top: env(safe-area-inset-top); --safe-bottom: env(safe-area-inset-bottom); --ok-line: rgba(var(--ok-rgb), .3); --hover-fill: rgba(var(--fg-rgb), .105); --hover-line: rgba(var(--fg-rgb), .24); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }  /* no grey rectangle flashing behind a rounded card when it is tapped on a phone */
body { margin: 0; font: 15px/1.45 "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; min-height: 100vh; }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: none; }
main { margin: 0 auto; }
h3 { margin: .8rem 0 .4rem; }
small { font-weight: 400; color: var(--muted); }
.card.empty { text-align: center; padding: 28px 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.vehicle-card { display: block; color: inherit; margin: 0; }
.vehicle-card:hover { text-decoration: none; }
.vehicle-card img { width: 100%; height: 140px; object-fit: cover; border-radius: var(--r-s); margin-bottom: 8px; }
.vehicle-card .big { font-size: 1.4rem; font-weight: 600; margin: .2rem 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .88rem; }
.flash { padding: 10px 14px; margin: 10px 0; }
.flash.ok { color: var(--ok); }
.flash.err { background: var(--overdue-bg); color: var(--overdue); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; background: var(--line); color: var(--text); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.soon { background: var(--soon-bg); color: var(--soon); }
.badge.overdue { background: var(--overdue-bg); color: var(--overdue); }
.chip { border-radius: 999px; }
.tiles { display: grid; }
.tile { display: flex; flex-direction: column; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px; align-items: end; }
.grid .wide, fieldset.wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, select, textarea, button, .button { font: inherit; }
input[type=text], input[type=number], input[type=date], input[type=time], input:not([type]), select, textarea, input[type=file] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card2); color: var(--text); }
form.inline { display: inline; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 8px 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
fieldset { border: 1px solid var(--line); margin: 0; padding: 10px 12px; }
details > summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr.muted-row td { opacity: .6; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; align-items: start; margin: 0; }
.facts dt { line-height: 24px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; }
svg.chart, svg.route { width: 100%; height: auto; max-width: 100%; }
svg .line { fill: none; stroke: var(--accent); stroke-width: 2; }
svg circle { fill: var(--accent); }
svg .grid { stroke: var(--line); stroke-width: 1; }
svg text { fill: var(--muted); font-size: 10px; }
svg .start { fill: var(--ok); }
svg .end { fill: var(--overdue); }
footer { text-align: center; }
code { font-family: "Space Mono", ui-monospace, monospace; background: var(--card2); padding: 1px 6px; border-radius: var(--r-s); }
.mono, .chip, .tile .value { font-family: "Space Mono", ui-monospace, monospace; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line2); border-radius: 999px; transition: .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--on-dark); transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
body::before { inset: 0; }
html { scroll-behavior: smooth; }

/* Inside Home Assistant (an iframe) the app already sits below its header: no extra device margins. */
html.embedded { --safe-top: 0px; --safe-bottom: 0px; }
.ico { flex: none; }
.shell { min-height: 100vh; }
.content { min-width: 0; }
main { max-width: 820px; padding: calc(12px + var(--safe-top)) 16px calc(var(--tabh) + 44px + var(--safe-bottom)); }
footer { padding: 0 0 20px; font-size: .75rem; color: var(--dim); }

/* cards = glass */
.card { position: relative; overflow: hidden; background: var(--glass); border: 1px solid var(--glass-b); border-radius: var(--r-l); padding: var(--sp-card, 18px); margin: var(--sp-win, 14px) 0; box-shadow: 0 1px 0 rgba(var(--fg-rgb),.05) inset, 0 12px 32px rgba(0,0,0,.28); }
a.card.vehicle-card { transition: transform .14s ease; }
a.card.vehicle-card:hover { text-decoration: none; }
a.card.vehicle-card:active { transform: scale(.985); }
.card > h2:first-child, .card > .row-between:first-child h2 { margin-top: 0; }
h1 { font-size: 32px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin: 6px 0 14px; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: 0; margin: 0 0 12px; display: flex; align-items: center; gap: var(--ico-gap, 10px); }
h1 .ico, h2 .ico { color: var(--accent); vertical-align: -4px; }
h3 { font-size: 15px; font-weight: 600; }
.row-between h1 { margin-bottom: 14px; }

/* tiles = overview tiles */
.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.tile { position: relative; overflow: visible; background: var(--glass); border: 1px solid var(--glass-b); border-radius: var(--r-l); padding: 14px 15px; min-height: 92px; gap: 3px; box-shadow: none; }
.tile::before { display: none; }
.tile .label { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.tile .value { font-size: 20px; font-weight: 650; letter-spacing: -.015em; line-height: 1.15; margin-top: 3px; font-family: "Space Grotesk", system-ui, sans-serif; }
.tile .value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; font-family: "Space Mono", monospace; }
.tile .value.small { font-size: 15px; }

/* ONE button system (docs/design.md), glass like the cards: a translucent fill with a fine light edge.
   Variants: (default) glass, .primary = the red glass (the ONE main action of a page), .danger / .warn = red outline.
   Sizes: 44 px / --r-m (stand-alone), .small = 36 px / --r-s (rows, cards, panels). Round icon buttons are a separate component (.icon-btn). */
button, .button, .ghost-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: var(--r-m); border: 1px solid var(--btn-edge); background: linear-gradient(180deg, rgba(var(--fg-rgb),.11) 0%, rgba(var(--fg-rgb),.05) 100%), linear-gradient(var(--card), var(--card)); box-shadow: 0 1px 0 var(--btn-hi) inset; color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: .01em; text-transform: none; text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease; -webkit-tap-highlight-color: transparent; }
button:hover, .button:hover, .ghost-btn:hover { background: linear-gradient(180deg, rgba(var(--fg-rgb),.16) 0%, rgba(var(--fg-rgb),.08) 100%), linear-gradient(var(--card), var(--card)); border-color: rgba(var(--fg-rgb),.34); text-decoration: none; }
button:active, .button:active, .ghost-btn:active { transform: scale(.97); }
button.primary, .button.primary, .ghost-btn.primary { color: var(--accent-text); border-color: rgba(var(--accent-rgb), .85); background: linear-gradient(180deg, rgba(var(--accent-rgb), .92) 0%, rgba(var(--accent-rgb), .74) 100%); box-shadow: 0 1px 0 var(--btn-hi) inset, 0 6px 20px rgba(var(--accent-rgb), .28); text-shadow: 0 1px 0 rgba(0,0,0,.2); }
button.primary:hover, .button.primary:hover, .ghost-btn.primary:hover { background: linear-gradient(180deg, rgba(var(--accent-rgb), 1) 0%, rgba(var(--accent-rgb), .84) 100%); border-color: var(--accent); box-shadow: 0 1px 0 var(--btn-hi) inset, 0 8px 24px rgba(var(--accent-rgb), .4); }
button.primary:active, .button.primary:active, .ghost-btn.primary:active { box-shadow: 0 1px 0 rgba(0,0,0,.2) inset, 0 2px 8px rgba(var(--accent-rgb), .3); }
button.danger, .button.danger, .ghost-btn.danger, .ghost-btn.warn { color: var(--overdue); border-color: rgba(var(--overdue-rgb), .5); background: rgba(var(--overdue-rgb), .06); }

/* delete is always the danger red of the design (not its accent colour) */
button.danger:hover, .button.danger:hover, .ghost-btn.danger:hover, .ghost-btn.warn:hover { background: rgba(var(--overdue-rgb), .14); border-color: var(--overdue); }
button.small, .button.small, .ghost-btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: var(--r-s); }

/* icon-only: a button that shows just its icon (add +, delete, save, cancel, edit); the text stays in the page for screen readers (.sr), there is no hover tooltip */
label.button, label.ghost-btn { flex-direction: row; text-transform: none; }  /* a file picker is a label: the global label style (column, capitals) does not apply to it */
button.ib, .button.ib, .ghost-btn.ib { padding: 0; width: 44px; flex: 0 0 auto; }
button.ib.small, .button.ib.small, .ghost-btn.ib.small { width: 36px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
button:disabled, .button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* fields */
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], input[type=url], input:not([type]), select, textarea, input[type=file] { background: rgba(var(--fg-rgb),.06); border: 1px solid var(--glass-b); border-radius: var(--r-s); color: var(--text); padding: 10px 14px; font-size: 16px; min-height: 46px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(var(--ok-rgb), .55); box-shadow: 0 0 0 3px rgba(var(--ok-rgb), .14); }
select { -webkit-appearance: none; appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%239BA1AC' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; }
select option { background: var(--card2); color: var(--text); }
label { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; gap: 6px; }
label.check { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 400; }

fieldset { border-color: var(--glass-b); border-radius: var(--r-m); }
.chip { background: var(--glass2); border: 1px solid var(--glass-b); font-size: 12px; padding: 5px 11px; color: var(--muted); }
.badge { font-weight: 600; letter-spacing: .02em; }
.flash { border-radius: var(--r-l); }

/* hero: centered (plate, name, odometer, flat car) */
.vehicle-hero { position: relative; text-align: center; padding: calc(var(--sp-top) + var(--safe-top)) 0 2px; }
.plate { display: inline-block; padding: 5px 14px 4px; border-radius: var(--r-s); background: rgba(var(--fg-rgb),.07); border: 1px solid rgba(var(--fg-rgb),.18); color: var(--text); font: 700 15px/1.2 "Space Mono", ui-monospace, monospace; letter-spacing: .12em; }
.vehicle-hero .plate { margin-bottom: 10px; }
.vehicle-hero h1 { display: block; text-align: center; font-size: clamp(24px, 6vw, 30px); font-weight: 600; letter-spacing: -.01em; margin: 0; }
.hero-fresh { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.hero-fresh i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.hero-car.photo { max-width: 380px; max-height: 240px; object-fit: contain; filter: none; }
.hero-car { display: block; width: 100%; max-width: 340px; height: auto; filter: drop-shadow(0 18px 24px rgba(var(--accent-rgb), .18)); }

/* vehicle switcher */
.switcher { position: relative; }
.switcher summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--glass-b); border-radius: 999px; background: var(--glass); font-weight: 600; font-size: 13px; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher[open] summary, .switcher summary:hover { border-color: var(--line2); }
.switcher .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: rgba(var(--panel-rgb),.97); border: 1px solid var(--line2); border-radius: var(--r-m); padding: 6px; z-index: 60; box-shadow: 0 16px 40px rgba(0,0,0,.55); }
.switcher .menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-s); }
.switcher .menu a:hover { background: rgba(var(--fg-rgb),.06); text-decoration: none; }
.switcher .menu a.current { color: var(--accent); }

/* ---- navigation: floating glass capsule with a gliding marker (phones) ---- */
.side { display: contents; }
.side .sb-brand, .side .sb-foot { display: none; }
.tabbar { position: fixed; left: 26px; right: 26px; bottom: max(10px, calc(var(--safe-bottom) - 14px)); z-index: 2000; height: var(--tabh); padding: 5px; display: flex; border-radius: calc(var(--r-l) + 5px); isolation: isolate; background: rgba(var(--panel-rgb),.56); -webkit-backdrop-filter: blur(28px) saturate(185%); backdrop-filter: blur(28px) saturate(185%); border: 1px solid rgba(var(--fg-rgb),.11); box-shadow: 0 16px 38px rgba(0,0,0,.52), inset 0 1px 0 rgba(var(--fg-rgb),.16), inset 0 -1px 0 rgba(0,0,0,.28); }
.tab-ind { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / var(--n, 4)); border-radius: var(--r-l); z-index: -1; transform: translateX(calc(var(--i, 0) * 100%)); }
.tab { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: var(--r-l); color: rgba(var(--fg-rgb),.66); font: 600 10px/1 "Space Grotesk", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
.tab:hover { text-decoration: none; color: var(--strong); }
.tab .ico { width: 27px; height: 27px; transition: transform .35s cubic-bezier(.3,1.5,.5,1); }

/* the colour never fades (a fade from grey to red passed through light red): the active icon is the accent red from the first frame */
.tab:active .ico { transform: scale(.86); }
.tab.on { color: var(--strong); }
.tab.on .ico { color: var(--accent); transform: scale(1.08); }
.tab .tl { display: none; }
.tabbar.n1 { --n: 1; }
.tabbar.n2 { --n: 2; }
.tabbar.n3 { --n: 3; }
.tabbar.n4 { --n: 4; }
.tabbar.n5 { --n: 5; }
.tabbar.n6 { --n: 6; }
.tabbar.n7 { --n: 7; }
.tabbar.i1 { --i: 1; }
.tabbar.i2 { --i: 2; }
.tabbar.i3 { --i: 3; }
.tabbar.i4 { --i: 4; }
.tabbar.i5 { --i: 5; }
.tabbar.i6 { --i: 6; }

/* ---- tablets and desktops: glass sidebar with the same marker, vertical ---- */
@media (min-width: 760px) {
  .side { display: flex; flex-direction: column; align-items: stretch; position: fixed; left: 0; top: 0; bottom: 0; width: var(--sw, 84px); z-index: 2000; padding: 18px 12px 16px; background: rgba(var(--panel-deep-rgb),.88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-right: 1px solid var(--glass-b); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side .sb-brand { align-items: center; justify-content: center; gap: 12px; padding: 0 0 18px; color: inherit; display: flex; }
  .side .sb-brand:hover { text-decoration: none; }
  .side .sb-brand .brand-mark { flex-shrink: 0; }
  .side .sb-brand span { display: none; }

  /* an empty flex item would still add the gap and push the logo off-centre */
  .tabbar { position: relative; left: auto; right: auto; bottom: auto; height: auto; padding: 0; border-radius: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; flex-direction: column; gap: 6px; z-index: auto; }
  .tab { flex: none; width: 100%; height: 54px; border-radius: var(--r-m); }
  .tab-ind { left: 0; right: 0; top: 0; width: auto; height: 54px; border-radius: var(--r-m); transform: translateY(calc(var(--id, var(--i, 0)) * 60px)); }
  .side .sb-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: auto; padding-top: 14px; font-size: 11px; color: var(--dim); }
  .side .sb-foot .sb-ver { display: none; }
  .content { margin-left: var(--sw, 84px); }
  main { padding-bottom: 40px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  :root { --sw: 248px; }
  .side { padding: 22px 16px 18px; }
  .side .sb-brand { justify-content: flex-start; padding: 2px 6px 22px; }
  .side .sb-brand span { display: block; }
  .side .sb-brand b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
  .side .sb-brand small { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 0 18px; height: 50px; }
  .tab .ico { width: 24px; height: 24px; }
  .tab .tl { display: inline; font: 600 15px "Space Grotesk", system-ui, sans-serif; margin: 0; }
  .tab-ind { height: 50px; transform: translateY(calc(var(--id, var(--i, 0)) * 56px)); }
  .side .sb-foot { justify-content: flex-start; padding-left: 8px; }
  .side .sb-foot .sb-ver { display: inline; }
  main { max-width: 1000px; }
}
@media (prefers-reduced-motion: reduce) {
  .tab-ind { transition: none; }
  html { scroll-behavior: auto; }
}

/* ================= 0.3.1 – green + red, tinted gradients ================= */

/* segmented control: active = green */

/* sidebar foot dot */
.side .sb-foot .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--ok); box-shadow: 0 0 0 3px rgba(var(--ok-rgb), .16); }
.side .sb-foot .sb-ver { font-family: "Space Mono", monospace; }

/* hero */
.hero-fresh i { box-shadow: 0 0 8px rgba(var(--ok-rgb), .7); }
.hero-chips { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.schip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 14px; border-radius: var(--r-s); background: var(--glass2); border: 1px solid var(--glass-b); min-width: 120px; text-align: left; }
.schip span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.schip b { font-size: 13px; font-weight: 650; }
.schip.ok { border-color: var(--ok-line); background: rgba(var(--ok-rgb), .07); }
.schip.ok b { color: var(--ok); }
.schip.soon { border-color: rgba(var(--soon-rgb), .35); background: rgba(var(--soon-rgb), .07); }
.schip.soon b { color: var(--soon); }
.schip.bad { border-color: rgba(var(--overdue-rgb), .45); background: rgba(var(--overdue-rgb), .09); }
.schip.bad b { color: var(--overdue); }
.vhome .hero-car { filter: drop-shadow(0 22px 28px rgba(var(--accent-rgb), .22)); }
.hero-car { margin: 20px auto 6px; }
.range-block { text-align: left; margin: 16px 4px 6px; }
.range-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.range-km { font-size: 64px; font-weight: 300; line-height: 1; letter-spacing: -.03em; }
.range-km .unit { font-size: 20px; font-weight: 400; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.range-pct { font-size: 15px; color: var(--muted); white-space: nowrap; }
.bar { width: 100%; height: 8px; border-radius: 999px; background: rgba(var(--fg-rgb),.08); overflow: hidden; margin-top: 12px; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, rgba(var(--ok-rgb), .72), var(--ok)); }
.range-sub { font-size: 12px; color: var(--muted); margin-top: 8px; }

.tiles .tile { display: none; }

/* cards: icon heads and tint on the first KPI */
.card h2 .ico { width: var(--ico-slot, 20px); height: var(--ico-slot, 20px); flex: 0 0 auto; }
.badge { border: 1px solid transparent; }
.badge.ok { border-color: rgba(var(--ok-rgb), .3); }
.badge.soon { border-color: rgba(var(--soon-rgb), .3); }
.badge.overdue { border-color: rgba(var(--overdue-rgb), .35); }
.card .big, .vehicle-card .big { font-weight: 700; letter-spacing: -.02em; }

/* two column home on wide screens */
.vpage { max-width: 1000px; margin: 0 auto; }
.vpage > .vehicle-hero, .vpage > main { max-width: none; }
.vsub .vehicle-hero { padding-bottom: 0; }
.vsub .vehicle-hero .hero-car { display: none; }
.vsub .vehicle-hero h1 { font-size: 24px; }
.vsub .vehicle-hero .hero-chips { margin-top: 10px; }
@media (min-width: 1100px) {
  .vpage.vhome { max-width: 1240px; display: grid; grid-template-columns: minmax(360px, .85fr) minmax(0, 1.15fr); column-gap: 14px; align-items: start; }
  .vhome .vehicle-hero { grid-column: 1; grid-row: 1 / span 6; position: sticky; top: 0; padding: 24px 12px 12px; }
  .vhome main { grid-column: 2; }
  .vhome .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.vpage > * { min-width: 0; }
.vehicle-hero { padding-left: 16px; padding-right: 16px; }

.icon-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--glass-b); }

.icon-row .inline-form { margin: 6px 0 0; }
.icon-prev { width: 64px; height: 64px; border-radius: var(--r-m); flex: none; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.icon-row input[type=file] { width: auto; flex: 1 1 200px; min-width: 0; }
.icon-row .inline-form { align-items: center; flex-wrap: nowrap; }
@media (max-width: 520px) {
  .icon-row .inline-form { flex-wrap: wrap; }
}

/* login, setup, account */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card { width: 100%; max-width: 380px; text-align: left; }
.login-card h1 { display: block; text-align: center; font-size: 24px; margin: 8px 0 2px; }
.login-logo { display: block; margin: 0 auto; border-radius: var(--r-m); box-shadow: 0 8px 22px rgba(0,0,0,.45); }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.login-card label { margin-bottom: 12px; }
button.block { width: 100%; margin-top: 6px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin: 16px 0 10px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--glass-b); }
.linkb { display: block; width: 100%; background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; min-height: 36px; font-size: 13px; margin-top: 8px; }
#ext-fields { display: none; }
.setup-form:has(input[value=external]:checked) #ext-fields { display: block; }
ul.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
ul.codes li { padding: 10px 14px; border-radius: var(--r-s); background: rgba(var(--fg-rgb),.06); border: 1px solid var(--glass-b); font-size: 15px; letter-spacing: .06em; }

/* no white flash between pages: the old page stays until the new one is ready; the navigation does not move */
html { background: var(--bg); scrollbar-gutter: stable; }  /* with classic scrollbars a short page and a long page keep the same width: nothing jumps sideways between pages */

/* More: grouped menu with tinted icon chips */
.mgroup-wrap { margin-top: var(--sp-label-top); }  /* a group (its label and its rows): the label opens it, so the air above is the one of every section label */
.mgroup-wrap:first-child { margin-top: 0; }
.mg-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 var(--sp-label-bottom); padding: 0 var(--sp-label-x); }  /* THE section label with an action (the plus): 11 px, the air of the heading rule */
.mg-head h2 { margin: 0; font-size: 11px; line-height: calc(var(--lab-h) - var(--sp-label-bottom)); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.mg-add { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(var(--ok-rgb), .14); color: var(--ok); border: 1px solid rgba(var(--ok-rgb), .3); }
.mi { display: flex; align-items: center; gap: var(--mi-gap, 14px); padding: 12px var(--mi-pad-x, 14px); min-height: 58px; color: var(--text); border-top: 1px solid var(--glass-b); -webkit-tap-highlight-color: transparent; }
.mi:first-child { border-top: 0; }
.mi:hover { text-decoration: none; background: rgba(var(--fg-rgb),.04); }
.mi-ic { width: var(--mi-chip, 32px); height: var(--mi-chip, 32px); border-radius: var(--r-s); display: grid; place-items: center; flex-shrink: 0; color: var(--on-dark); }
.mi-t { flex: 1; font-weight: 500; font-size: 16px; min-width: 0; }
.mi-v { font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.mi .ico { color: var(--dim); opacity: .6; flex-shrink: 0; }
.mi-ic .ico { color: var(--on-dark); opacity: 1; }

/* settings: navigation editor */
.navset { display: flex; flex-direction: column; gap: 10px; }
.navrow { display: flex; align-items: center; gap: 12px; position: relative; }
.navrow select { flex: 1; }
.navrow.fixed { opacity: .7; }
.navrow.fixed small { margin-left: auto; }
.iconpick summary { list-style: none; cursor: pointer; }
.iconpick summary::-webkit-details-marker { display: none; }
.iconpick .mi-ic { width: 46px; height: 46px; border-radius: var(--r-s); background: rgba(var(--fg-rgb),.1); border: 1px solid var(--glass-b); }
.pickgrid { position: absolute; z-index: 30; left: 0; top: 54px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 10px; width: min(330px, calc(100vw - 48px)); border-radius: var(--r-m); background: rgba(var(--panel-rgb),.97); border: 1px solid var(--line2, rgba(var(--fg-rgb),.14)); box-shadow: 0 16px 40px rgba(0,0,0,.55); }
.pickgrid label { margin: 0; cursor: pointer; }
.pickgrid input { position: absolute; opacity: 0; pointer-events: none; }
.pickgrid span { display: grid; place-items: center; height: 42px; border-radius: var(--r-s); color: var(--muted); }
.pickgrid input:checked + span { background: rgba(var(--ok-rgb), .18); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(var(--ok-rgb), .4); }
.pickgrid span:hover { background: rgba(var(--fg-rgb),.08); color: var(--strong); }

/* Login: the same look as the start page of a locked app - soft red / green light, glass card, the logo with its moving lines */
.login-body { background-image: radial-gradient(60% 55% at 8% 0%, rgba(var(--accent-rgb), .30), transparent 70%), radial-gradient(55% 50% at 100% 100%, rgba(var(--ok-rgb), .15), transparent 70%); background-attachment: fixed; }
.login-body::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--accent), var(--ok)); }
.login-card { box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 0 70px rgba(var(--accent-rgb), .12); }
.login-card h1 span { color: var(--accent); }
.login-logo.big { width: 132px; height: 132px; border-radius: 0; box-shadow: none; }
.login-slogan { margin: 0 0 14px; text-align: center; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--ok); }
