:root {
  color-scheme: light;
  --bg: #f5f5f2;
  --panel: #fff;
  --ink: #171a1b;
  --muted: #535b61;
  --line: #dfe2e0;
  --accent: #e8a521;
  --link: #7d4d00;
  --hero: #fff5d5;
  --hero-edge: #eadbbb;
  --error: #9a2424;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141618;
  --panel: #202326;
  --ink: #f5f4f0;
  --muted: #bac0c5;
  --line: #3b4044;
  --link: #f7c663;
  --hero: #2e271b;
  --hero-edge: #4a3e29;
  --error: #ff9a95;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #141618;
    --panel: #202326;
    --ink: #f5f4f0;
    --muted: #bac0c5;
    --line: #3b4044;
    --link: #f7c663;
    --hero: #2e271b;
    --hero-edge: #4a3e29;
    --error: #ff9a95;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.55 "Inter", system-ui, sans-serif; }
a { color: var(--link); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -4rem; padding: .5rem; background: var(--panel); z-index: 4; }
.skip:focus { top: .5rem; }
.wrap { max-width: 1160px; width: calc(100% - 3rem); margin: 0 auto; }
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: clamp(.75rem, 3vw, 2.75rem); min-height: 4.5rem; }
.brand { color: var(--ink); white-space: nowrap; font-size: 1.25rem; font-weight: 650; letter-spacing: -.055em; text-decoration: none; }
.brand span { color: var(--link); font-size: 1.5rem; margin-right: .2rem; }
.brand strong { color: var(--link); }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 650; font-size: .92rem; }
.nav-link:hover, .dropdown a:hover { color: var(--link); }
.nav-end { margin-left: auto; }
.menu { position: relative; }
.menu summary { cursor: pointer; display: flex; gap: .6rem; align-items: center; list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--accent); color: #211709; font-weight: 750; }
.dropdown { position: absolute; z-index: 2; top: calc(100% + .7rem); right: 0; min-width: 12rem; padding: .45rem; background: var(--panel); border: 1px solid var(--line); border-radius: .7rem; box-shadow: 0 12px 30px #0002; }
.dropdown a, .dropdown button { display: block; text-align: left; background: none; color: var(--ink); padding: .55rem .65rem; text-decoration: none; width: 100%; font-weight: 550; }
.dropdown button:hover, .dropdown a:hover { background: var(--bg); }
main { padding: clamp(1.4rem, 4vw, 3.5rem) 0 4rem; }
h1, h2 { margin: 0; line-height: 1.12; letter-spacing: -.042em; }
h1 { font-size: clamp(2rem, 5.6vw, 4.25rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); margin-bottom: 1rem; }
p { margin: .7rem 0 1.15rem; }
.hero { padding: clamp(1.25rem, 5vw, 3.6rem); border: 1px solid var(--hero-edge); background: linear-gradient(115deg, var(--hero), var(--panel)); border-radius: 1.3rem; }
.hero p { color: var(--muted); }
.log-form { max-width: 37rem; margin-top: 1.8rem; }
label { display: block; font-size: .9rem; font-weight: 700; margin-bottom: .3rem; }
.log-row, .location-row, .vehicle-top, .tabs { display: flex; gap: .6rem; align-items: center; }
.log-row input { flex: 1; min-width: 0; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.location-row { flex-wrap: wrap; margin: .75rem 0 .35rem; font-size: .9rem; }
small, time, .row-detail span, .helptext { color: var(--muted); }
button, .button { display: inline-block; cursor: pointer; border: 1px solid transparent; border-radius: .55rem; padding: .63rem .9rem; background: var(--accent); color: #211709; font: inherit; font-weight: 750; text-decoration: none; white-space: nowrap; }
button:hover, .button:hover { filter: brightness(.94); }
button:disabled { cursor: wait; opacity: .65; }
.secondary { color: var(--ink); background: var(--panel); border-color: var(--line); }
.small { padding: .36rem .65rem; font-size: .87rem; }
input:not([type="checkbox"]):not([type="radio"]), select { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: .5rem; padding: .64rem .8rem; font: inherit; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.columns.single { grid-template-columns: minmax(0, 1fr); }
.rows { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: .8rem; background: var(--panel); overflow: hidden; }
.rows li { padding: .8rem .95rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.rows li + li { border-top: 1px solid var(--line); }
.rows .empty { color: var(--muted); }
.row-detail { text-align: right; overflow-wrap: anywhere; }
.row-detail span { display: block; font-size: .84rem; }
.plate { display: inline-block; white-space: nowrap; border-radius: .3rem; padding: .12rem .44rem; background: #f6ca51; border: 1px solid #b68a28; color: #211709; font-family: ui-monospace, monospace; font-weight: 850; letter-spacing: .045em; text-decoration: none; }
a.plate:hover { background: #ffdc79; }
.plate.large { font-size: clamp(1.6rem, 7vw, 4.2rem); padding: .25em .42em; }
.vehicle-top { justify-content: space-between; flex-wrap: wrap; }
.car-name { font-size: 1.3rem; }
.stats { display: flex; gap: .65rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.stats div { background: var(--panel); border: 1px solid var(--line); padding: .55rem 1rem; border-radius: .6rem; }
.stats strong, .money { font-size: 1.4rem; margin-right: .3rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: .9rem; padding: clamp(1.1rem, 4vw, 2.25rem); }
.narrow { max-width: 38rem; margin: 0 auto; }
.narrow h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin-bottom: 1rem; }
.narrow input:not([type="checkbox"]):not([type="radio"]), .narrow select, [data-share-fallback] input { display: block; width: 100%; }
.notice { border: 1px solid var(--line); border-radius: .65rem; padding: .65rem .9rem; background: var(--panel); }
.error, .errorlist { color: var(--error); }
.tabs { margin-top: 1rem; }
.tabs a { padding: .45rem .75rem; border-radius: .5rem; text-decoration: none; color: var(--ink); }
.tabs a[aria-current] { background: var(--accent); color: #211709; font-weight: 750; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }
.account-links { padding-left: 1.15rem; }
@media (max-width: 640px) {
  .wrap { width: calc(100% - 1.5rem); }
  .columns { grid-template-columns: 1fr; }
  .menu-name { display: none; }
}
@media (max-width: 360px) {
  .log-row { align-items: stretch; flex-direction: column; }
}
.avatar { object-fit: cover; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.section-head h2 { margin-bottom: 0; }
.search, .periods { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.search input { width: 9.4rem; }
.periods { margin: 0 0 .85rem; font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 640px) {
  .optional { display: none; }
}
