:root {
  color-scheme: light;
  --ink: #172637;
  --muted: #40536a;
  --line: #abbccd;
  --surface: #fff;
  --canvas: #f6f8fc;
  --nav: #142b42;
  --nav-text: #a9bdc8;
  --mint: #aecdff;
  --primary: #1e5488;
  --on-primary: #fff;
  --primary-container: #dceaff;
  --on-primary-container: #163654;
  --header: #dceaff;
  --header-text: #163654;
  --header-subtitle: #365270;
  --container: #eaf0f7;
  --green: #256443;
  --green-bg: #d0f0dc;
  --warning: #854400;
  --warning-bg: #ffdfc5;
  --danger: #b81827;
  --danger-bg: #ffdad9;
  font-family: Roboto, system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
}
:root[data-size="large"] { font-size: 18px; }
:root[data-theme="dark"], :root[data-theme="system"].system-dark {
  color-scheme: dark;
  --ink: #e0e8f2;
  --muted: #becad9;
  --line: #63758a;
  --surface: #17232f;
  --canvas: #101821;
  --primary: #aecdff;
  --on-primary: #0b2d57;
  --primary-container: #213a57;
  --on-primary-container: #d9e8ff;
  --header: #142b42;
  --header-text: #fff;
  --header-subtitle: #bdcddc;
  --container: #263341;
  --green: #8cdfab;
  --green-bg: #1f402f;
  --warning: #ffb77d;
  --warning-bg: #482b13;
  --danger: #ffb4ab;
  --danger-bg: #690005;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--green); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong, p, small, dd { overflow-wrap: anywhere; }
h1 { font-size: clamp(1.85rem, 4vw, 3rem); letter-spacing: -.055em; line-height: 1.07; }
h2 { font-size: 1.3rem; letter-spacing: -.025em; }
h3 { font-size: 1.05rem; }
p { line-height: 1.55; }
small, .muted { color: var(--muted); }
svg { width: 1.2rem; height: 1.2rem; flex: none; }
.loading { padding: 2rem; }
.layout { min-height: 100dvh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { height: 100dvh; position: sticky; top: 0; background: var(--nav); color: #fff; display: flex; flex-direction: column; padding: 26px 17px 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.21rem; letter-spacing: -.035em; font-weight: 800; }
.brand img { width: 44px; height: 44px; border: 1px solid #35515e; border-radius: 13px; }
.sidebar .brand { padding-inline: 6px; }
.workspace-label { color: var(--nav-text); font-size: .69rem; letter-spacing: .15em; font-weight: 750; margin: 38px 12px 10px; text-transform: uppercase; }
.nav-links { display: grid; gap: 5px; }
.nav-button { border: 0; background: transparent; color: var(--nav-text); border-radius: 11px; padding: 11px 12px; min-height: 44px; display: flex; align-items: center; text-align: left; gap: 11px; width: 100%; }
.nav-button:hover { background: #213a57; color: #fff; }
.nav-button[aria-current="page"] { background: #213a57; color: var(--mint); font-weight: 700; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid #29404e; }
.sidebar-foot small { color: var(--nav-text); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 11px; background: #28454b; color: var(--mint); font-size: .85rem; font-weight: 800; }
.account-link { min-width: 0; display: grid; gap: 3px; }
.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 clamp(16px, 4vw, 48px); min-height: 68px; background: var(--surface); border-bottom: 1px solid var(--line); }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-inline: 16px 4px; background: var(--header); color: var(--header-text); }
.app-title { display: grid; min-width: 0; gap: 2px; padding-block: 6px; }
.app-title strong { font-size: 1.05rem; }
.app-title small { color: var(--header-subtitle); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.app-header .button.flat { color: inherit; }
.topbar .app-title, .topbar .mobile-menu { display: none; }
.crumb { font-size: .87rem; font-weight: 650; color: var(--muted); }
.connection { display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; font-size: .8rem; color: var(--muted); }
.connection::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1f9c73; }
.connection.offline::before { background: #d58827; }
.content { max-width: 1550px; padding: 29px clamp(16px, 4vw, 48px) 50px; margin: auto; }
.content > * + * { margin-top: 23px; }
.hero { background: var(--primary-container); color: var(--on-primary-container); border-radius: 12px; padding: 16px; }
.hero p { margin-top: 6px; color: var(--muted); max-width: 54ch; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 9px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }
.hero .eyebrow { color: var(--primary); }
.intro p { margin-top: 8px; color: var(--muted); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 152px), 1fr)); }
.stat { padding: 14px 16px; display: flex; gap: 11px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; }
.stat > div { display: grid; gap: 3px; }
.stat strong { font-size: 1.45rem; line-height: 1; }
.stat small { font-size: .77rem; }
.symbol { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--primary-container); color: var(--on-primary-container); }
.symbol.good { background: var(--green-bg); color: var(--green); }
.symbol.warn { background: var(--warning-bg); color: var(--warning); }
.symbol.bad { background: var(--danger-bg); color: var(--danger); }
.section-head, .split { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-head { margin-bottom: 13px; }
.section-head p { margin-top: 4px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.button { min-height: 42px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 8px 12px; font-weight: 650; display: inline-flex; gap: 7px; align-items: center; justify-content: center; text-decoration: none; }
.button:hover { background: var(--container); }
.button.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.button.primary:hover { filter: brightness(.92); }
.button.danger { color: var(--danger); }
.button.icon { min-width: 42px; padding: 8px; }
.button.flat { background: transparent; border-color: transparent; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--container); font-size: .75rem; font-weight: 750; }
.badge.good, .banner.good { color: var(--green); background: var(--green-bg); }
.badge.warn, .banner.warn { color: var(--warning); background: var(--warning-bg); }
.badge.bad, .banner.bad { color: var(--danger); background: var(--danger-bg); }
.banner { padding: 11px 14px; border-radius: 10px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr)); }
.stack { display: grid; gap: 11px; }
.card, .panel { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 15px; min-width: 0; }
.card { display: grid; gap: 10px; align-content: start; }
.card-button { width: 100%; text-align: left; color: inherit; }
.card-button:hover { border-color: var(--primary); }
.card-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-title > div { min-width: 0; }
.card-title small { display: block; margin-top: 4px; }
.card-title > svg:last-child { margin-left: auto; }
.route-card { gap: 4px; padding: 8px 12px; }
.plate { padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--on-primary-container); font-weight: 800; }
.date-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px; background: var(--primary-container); color: var(--on-primary-container); }
.date-bar .button { color: inherit; }
.date-caption { display: grid; justify-items: center; padding-block: 4px; }
.date-caption .date-input { min-height: 32px; text-align: center; background: transparent; border: 0; padding: 4px; }
.empty { border: 1px dashed #c9d8de; border-radius: 14px; padding: 30px 16px; text-align: center; display: grid; justify-items: center; gap: 8px; background: #ffffff85; }
.empty p { color: var(--muted); }
.date-input { width: 153px; min-height: 42px; }
.filters { margin-bottom: 12px; }
.filters input { flex: 1 1 150px; max-width: 370px; }
.point { border-left: 4px solid #aabec7; }
.point.good { border-left-color: #26a17d; }
.point.bad { border-left-color: #d46663; }
.point.pickup { background: var(--container); }
.point-copy { white-space: pre-wrap; }
.point-num { font-variant-numeric: tabular-nums; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 196px), 1fr)); gap: 10px; }
.fields, form { display: grid; gap: 13px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 750; }
.check { display: flex; gap: 8px; align-items: center; min-height: 40px; }
input:not([type=checkbox]), select, textarea { min-width: 0; width: 100%; border: 1px solid #c6d4d9; border-radius: 9px; padding: 9px 10px; color: var(--ink); background: #fff; min-height: 42px; }
input[type=date].date-input { width: 153px; }
input[type=file] { max-width: 100%; }
input[type=checkbox] { accent-color: var(--primary); width: 18px; height: 18px; }
:root.system-dark[data-theme="system"] :is(input:not([type=checkbox]), select, textarea),
:root[data-theme="dark"] :is(input:not([type=checkbox]), select, textarea) { background: var(--canvas); }
:is(:root[data-theme="dark"], :root[data-theme="system"].system-dark) .empty { background: var(--surface); }
:is(:root[data-theme="dark"], :root[data-theme="system"].system-dark) .date-caption .date-input { background: transparent; }
textarea { resize: vertical; }
.form-error { color: var(--danger); font-size: .9rem; }
dialog { padding: 0; border: 1px solid var(--line); border-radius: 16px; width: min(560px, calc(100% - 28px)); max-height: calc(100dvh - 32px); color: var(--ink); background: var(--surface); }
dialog.wide { width: min(810px, calc(100% - 28px)); }
dialog::backdrop { background: #0a1928a6; }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dialog-body { padding: 16px; }
.editor-point summary, .import-route summary { cursor: pointer; font-weight: 700; padding-block: 5px; }
.editor-point[open] summary, .import-route[open] summary { margin-bottom: 10px; }
.history-list { padding-left: 22px; margin: 0; }
.history-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.history-list li:last-child { border-bottom: 0; }
.media-preview { max-width: 100%; max-height: 65dvh; border-radius: 10px; }
audio { max-width: 100%; }
.login .app-header { min-height: 48px; }
.login-body { display: grid; gap: 16px; max-width: 510px; margin-inline: auto; padding: 24px; }
.login-body h1 { font-size: 1.85rem; }
.login-body form { gap: 16px; }
.login-body .primary { width: 100%; min-height: 52px; border-radius: 12px; }
.login-body .primary svg { display: none; }
#notice { position: fixed; z-index: 10; right: 18px; bottom: 18px; display: none; align-items: center; gap: 9px; width: fit-content; max-width: calc(100% - 36px); padding: 12px 16px; border-radius: 12px; color: white; background: #125b49; box-shadow: 0 8px 24px #0f293633; }
#notice.visible { display: flex; }
#notice.error { background: #8b3033; }
.mobile-nav { display: none; }
@media (max-width: 760px) {
  .loading { padding-top: calc(22px + env(safe-area-inset-top)); }
  .app-header { padding-top: env(safe-area-inset-top); }
  .layout { display: block; }
  .sidebar { display: none; }
  .topbar { min-height: 48px; border-bottom: 0; }
  .topbar .app-title { display: grid; }
  .topbar .mobile-menu { display: inline-flex; }
  .topbar .actions { flex-wrap: nowrap; gap: 2px; }
  .topbar .connection { font-size: 0; }
  .topbar .button { min-width: 36px; }
  .crumb { display: none; }
  .content { padding: 4px 12px calc(24px + env(safe-area-inset-bottom)); }
  .content > * + * { margin-top: 10px; }
  .content > .hero:first-child, .content > .stats { display: none; }
  .content h1 { font-size: 1.45rem; }
  .mobile-nav { display: flex; align-items: center; gap: 8px; padding: 6px 16px; overflow-x: auto; }
  .mobile-nav .nav-button { width: auto; flex: none; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); min-height: 36px; }
  .mobile-nav .nav-button[aria-current="page"] { color: var(--on-primary-container); background: var(--primary-container); border-color: transparent; }
  .mobile-nav .nav-button:hover { background: var(--primary-container); }
  #notice { bottom: calc(18px + env(safe-area-inset-bottom)); }
  .button, .nav-button { min-height: 44px; }
  input, select, textarea { font-size: max(16px, 1rem); }
}
