:root {
  --bg: #f5f8fe; --card: #ffffff; --text: #14213d; --muted: #5a6478; --line: #dfe5f0;
  --accent: #1f5fd6; --accent-soft: #e3ecfd; --good: #1f7a4d; --warn: #b3261e; --used: #1f5fd6; --empty: #e7ecf5;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1522; --card: #182033; --text: #e8eefb; --muted: #9eabc4; --line: #2a3550;
    --accent: #7ea8ff; --accent-soft: #22325a; --good: #6fd39f; --warn: #ff8a80; --used: #7ea8ff; --empty: #26314a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Segoe UI", Roboto, sans-serif; }
main { overflow-wrap: anywhere; max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
header .lang { float: right; font-size: 14px; }
h1 { font-size: 28px; line-height: 1.25; margin: 8px 0 8px; }
h2 { font-size: 21px; margin: 36px 0 10px; }
h3 { font-size: 17px; margin: 20px 0 6px; }
p.lead { color: var(--muted); margin-top: 0; }
a { color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 16px 0; }
.trip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; align-items: end;
  padding: 12px 0; border-bottom: 1px solid var(--line); }
.trip:last-of-type { border-bottom: 0; }
.trip > div { min-width: 0; }
.trip input[type=date], .check input { min-width: 0; max-width: 100%; }
.trip label { font-size: 13px; color: var(--muted); display: block; }
.trip input[type=date] { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); }
.trip .opts { grid-column: 1 / -1; display: flex; gap: 4px 16px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }
.trip .opts label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
button { font: inherit; border-radius: 999px; border: 0; padding: 10px 18px; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; font-weight: 600; }
button.ghost { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
button.remove { background: none; color: var(--muted); padding: 8px; font-size: 20px; line-height: 1; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.check label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.check input { font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
.big { font-size: 44px; font-weight: 800; line-height: 1.1; }
.big small { font-size: 18px; font-weight: 600; color: var(--muted); }
.results p { margin: 6px 0; }
.ok { color: var(--good); font-weight: 600; } .ng { color: var(--warn); font-weight: 600; }
.timeline { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; margin: 12px 0 4px; }
.timeline span { aspect-ratio: 1; border-radius: 3px; background: var(--empty); }
.timeline span.used { background: var(--used); }
.timeline span.over { background: var(--warn); }
.timeline span.today { outline: 2px solid var(--text); outline-offset: 1px; }
.legend { font-size: 13px; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); }
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { font-weight: 600; cursor: pointer; }
footer { margin-top: 48px; font-size: 13px; color: var(--muted); }
.trip .opts .remove { margin-left: auto; }

[hidden] { display: none !important; }
