:root {
  color-scheme: dark;
  --navy: #152238;
  --navy-2: #1e304c;
  --orange: #d9772a;
  --cream: #f6f2e9;
  --ink: #eaf0f5;
  --muted: #afbdca;
  --line: #3a4b62;
  --panel: #1b2a40;
  --panel-2: #233650;
  --danger: #c94c4c;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: linear-gradient(150deg, #0d1726, var(--navy) 48%, #101b2a); color: var(--ink); font-family: Inter, Aptos, system-ui, sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(100%, 680px); min-height: 100vh; margin: 0 auto; padding: 24px 18px 48px; }
.topbar, .section-heading, .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar { margin-bottom: 18px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.65rem, 6vw, 2.15rem); letter-spacing: -0.04em; }
h2 { margin-bottom: 3px; font-size: 1.35rem; letter-spacing: -0.025em; }
h3 { margin-bottom: 8px; font-size: 1.05rem; }
.eyebrow { margin-bottom: 5px; color: #f3ab68; font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.save-state { color: var(--muted); font-size: .78rem; text-align: right; }
.active-card, .record-card { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: linear-gradient(145deg, rgba(35,54,80,.98), rgba(25,40,61,.98)); box-shadow: 0 16px 38px rgba(0,0,0,.14); }
.active-card h2 { color: var(--cream); }
.active-card p:last-child, .section-heading > p, .record-card p, .fine-print { color: var(--muted); line-height: 1.55; }
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 22px 0 18px; }
.tab-button { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: .9rem; font-weight: 700; }
.tab-button.is-active { border-color: var(--orange); background: #402a1c; color: #ffe1c8; }
.view-panel { display: none; }
.view-panel.is-active { display: block; }
.section-heading { align-items: flex-end; margin-bottom: 17px; }
.section-heading > p { max-width: 240px; margin-bottom: 0; text-align: right; font-size: .88rem; }
.stack-form { display: grid; gap: 14px; }
.share-card { display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: rgba(35,54,80,.58); }
.share-card h3 { margin-bottom: -2px; }
.share-card > p { margin-bottom: 0; color: var(--muted); line-height: 1.45; font-size: .86rem; }
.small-note { font-size: .78rem !important; }
label { display: grid; gap: 7px; color: var(--cream); font-size: .9rem; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: rgba(8,17,29,.65); color: var(--ink); outline: none; font-weight: 400; }
input:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(217,119,42,.18); }
textarea { resize: vertical; line-height: 1.45; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.primary-button, .quiet-button, .danger-button { min-height: 44px; border-radius: 10px; padding: 10px 15px; font-weight: 800; }
.primary-button { border: 1px solid #ed974b; background: var(--orange); color: #1e140d; }
.guide-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.quiet-button { border: 1px solid var(--line); background: transparent; color: var(--muted); }
.danger-button { border: 1px solid #e87878; background: #4b2528; color: #ffdada; }
.note-composer { display: grid; gap: 10px; }
.notes-list { display: grid; gap: 10px; margin-top: 16px; }
.note-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: rgba(20,34,56,.72); }
.note-item p { margin-bottom: 9px; white-space: pre-wrap; line-height: 1.45; }
.note-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .77rem; }
.delete-note { border: 0; padding: 0; background: transparent; color: #f2a2a2; font-size: .77rem; font-weight: 800; }
.empty-state { margin: 0; border: 1px dashed var(--line); border-radius: 12px; padding: 18px; color: var(--muted); text-align: center; }
.record-card { margin-bottom: 14px; }
.caution-card { border-color: #754242; background: linear-gradient(145deg, #37242c, #251d28); }
.fine-print { margin-top: 26px; font-size: .78rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 480px) { .app-shell { padding: 18px 14px 38px; } .two-columns { grid-template-columns: 1fr; } .section-heading { display: block; } .section-heading > p { margin-top: 8px; text-align: left; } .form-actions { align-items: stretch; flex-direction: column; } }

.mileage-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: linear-gradient(145deg, rgba(35,54,80,.98), rgba(25,40,61,.98)); box-shadow: 0 16px 38px rgba(0,0,0,.14); }
.mileage-week-label { margin: 14px 0 12px; color: var(--muted); font-size: .86rem; }
.mileage-days { display: grid; gap: 8px; }
.mileage-day { display: grid; grid-template-columns: minmax(0, 1fr) 116px; align-items: center; gap: 12px; border-bottom: 1px solid rgba(58,75,98,.72); padding: 10px 0; }
.mileage-day:last-child { border-bottom: 0; }
.mileage-day-name { color: var(--cream); font-size: .92rem; font-weight: 800; }
.mileage-day-date { display: block; margin-top: 2px; color: var(--muted); font-size: .76rem; font-weight: 400; }
.mileage-day input { padding: 10px; text-align: right; }
.mileage-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 16px; border-top: 1px solid var(--orange); padding-top: 15px; color: var(--muted); font-weight: 800; }
.mileage-total strong { color: #ffe1c8; font-size: 1.55rem; letter-spacing: -.03em; }
@media (max-width: 480px) { .tabbar { grid-template-columns: repeat(2, 1fr); } .mileage-day { grid-template-columns: minmax(0, 1fr) 105px; } }
.receipt-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.receipt-choice { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: rgba(8,17,29,.38); color: var(--cream); text-align: center; font-size: .84rem; }
.receipt-choice:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(217,119,42,.18); }
.receipt-choice input { width: 100%; margin-top: 8px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: .76rem; }
@media (max-width: 480px) { .receipt-actions { grid-template-columns: 1fr; } }
.privacy-note { margin: 0; border-left: 3px solid var(--orange); padding: 8px 0 8px 11px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.privacy-note strong { color: #ffe1c8; }

.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; box-shadow: 0 7px 18px rgba(0,0,0,.23); }

.feedback-card { border-color: #526781; }
.feedback-card .quiet-button { width: 100%; margin-top: 4px; }

.app-dialog { width: min(calc(100% - 32px), 420px); border: 0; padding: 0; border-radius: 18px; color: var(--ink); background: transparent; }
.app-dialog::backdrop { background: rgba(5, 11, 19, .72); }
.dialog-card { margin: 0; border: 1px solid var(--line); border-radius: 18px; padding: 22px; background: linear-gradient(145deg, #233650, #182a42); box-shadow: 0 22px 60px rgba(0,0,0,.4); }
.dialog-card h2 { margin-bottom: 10px; color: var(--cream); }
.dialog-card p:not(.eyebrow) { margin-bottom: 21px; color: var(--muted); line-height: 1.5; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }