:root {
  --ink: #003082;
  --blue: #0063d3;
  --yellow: #ffc917;
  --muted: #596575;
  --line: #d9dce2;
  --bg: #f3f4f5;
  --white: #fff;
  --radius: 4px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Frutiger, "Segoe UI", Arial, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 38px; font-weight: 400; line-height: 1.2; letter-spacing: -.4px; margin-bottom: 12px; }
h2 { font-size: 26px; font-weight: 400; margin: 0; }
h3 { font-size: 22px; font-weight: 400; line-height: 1.3; margin-bottom: 16px; }
.site-header { background: white; box-shadow: 0 2px 5px #0030820d; border-bottom: 1px solid #e5e7eb; }
.header-inner { max-width: 1200px; min-height: 100px; margin: auto; padding: 0 20px; display: flex; align-items: center; gap: 38px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--ink); font-size: 24px; font-weight: 600; }
.brand:hover { text-decoration: none; }
.brandmark { width: 36px; height: 40px; }
.site-header nav { display: flex; align-self: stretch; gap: 28px; align-items: stretch; }
.site-header nav a { position: relative; display: flex; align-items: center; color: var(--ink); font-size: 16px; font-weight: 600; white-space: nowrap; }
.site-header nav a::after { content: ""; position: absolute; height: 4px; left: 0; right: 0; bottom: 0; background: transparent; }
.site-header nav a.selected::after { background: var(--yellow); }
.site-header nav a:hover { text-decoration: none; color: var(--blue); }
.site-header nav a:hover::after { background: var(--blue); }
.header-label { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
main { max-width: 1200px; margin: 0 auto; padding: 0 20px 30px; }
.topbar { min-height: 50px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.breadcrumb-arrow { padding: 0 12px; color: var(--ink); }
.local-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; position: relative; isolation: isolate; padding: 34px 0 36px; margin-bottom: 30px; background: var(--yellow); }
.page-heading::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: calc((100% - 100vw) / 2); right: calc((100% - 100vw) / 2); background: var(--yellow); }
.page-heading p { margin-bottom: 0; }
.page-heading .muted { color: var(--ink); }
.muted { color: var(--muted); }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 400; margin-bottom: 14px; letter-spacing: 0; }
.button { border: 1px solid var(--blue); border-radius: 3px; background: white; color: var(--blue); display: inline-flex; align-items: center; justify-content: center; padding: 11px 18px; font-size: 14px; font-weight: 400; white-space: nowrap; min-height: 42px; box-shadow: 0 2px 0 #0053b017; transition: background .15s, color .15s; }
.button:hover { background: #eef5ff; text-decoration: none; }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; box-shadow: 0 2px 0 #004ba0; }
.button.primary:hover { background: #004ba0; border-color: #004ba0; }
.button.small { padding: 7px 12px; min-height: 34px; font-size: 13px; }
.button.full { width: 100%; margin-top: 16px; }
.button:disabled { opacity: .6; cursor: progress; }
.textbutton { border: 0; background: none; padding: 0; font-size: 13px; text-decoration: underline; }
.danger { color: #b21e32; }
.monthbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0 22px; }
.monthswitch { display: flex; align-items: center; gap: 20px; }
.monthswitch h2 { text-transform: capitalize; }
.iconbutton { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--blue); font-size: 22px; }
.iconbutton:hover { background: #e6effb; text-decoration: none; }
.segmented { display: flex; border-bottom: 1px solid #bcc4d0; }
.segmented a { padding: 9px 13px; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.segmented a.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0; margin: 24px 0; background: white; border-radius: 3px; box-shadow: 0 2px 4px #00308209; overflow: hidden; }
.metric { display: flex; flex-direction: column; gap: 10px; padding: 23px 24px; border-right: 1px solid #e7e9ed; }
.metric:last-child { border-right: 0; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 32px; line-height: 1.2; font-weight: 400; font-variant-numeric: tabular-nums; }
.metric small { font-size: 11px; color: var(--muted); }
.metric.saving { background: #fff2bf; }
.metric.saving span, .metric.saving small { color: var(--ink); }
.workspace { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 24px; }
.card { background: white; border-radius: var(--radius); padding: 26px; margin-bottom: 24px; border: 1px solid #e6e8ec; box-shadow: 0 2px 4px #00308208; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.card-heading h3 { margin: 0; }
.card-heading > span { font-size: 12px; }
.calendar { padding: 24px 0 0; overflow: hidden; }
.calendar .card-heading { padding: 0 24px; }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.weekdays { text-align: center; font-size: 11px; color: var(--muted); padding: 13px 0; background: #f8f9fb; }
.day { min-height: 106px; border-top: 1px solid #e4e7ed; border-right: 1px solid #e4e7ed; padding: 8px 6px; overflow: hidden; }
.day:nth-child(7n) { border-right: 0; background: #fcfcfd; }
.day:nth-child(7n-1) { background: #fcfcfd; }
.day.outside { background: #f5f6f8; }
.day.outside .daynumber { color: #7d899c; }
.daynumber { display: grid; place-items: center; height: 28px; width: 28px; color: var(--ink); font-size: 12px; }
.day.today .daynumber { background: var(--yellow); border-radius: 50%; font-weight: 600; }
.trip-chip { display: block; padding: 4px 5px; margin-top: 5px; font-size: 10px; background: #e3efff; border-left: 2px solid var(--blue); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-chip.planned { background: #fff3c8; border-left-color: #b28a00; }
.trip-chip.cancelled { background: #f0f1f3; color: #687181; border-left-color: #a1a9b5; text-decoration: line-through; }
.calendar-legend { display: flex; gap: 18px; padding: 16px 24px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.legend { display: inline-block; width: 7px; height: 7px; border-radius: 1px; background: var(--blue); margin-right: 5px; }
.legend.planned { background: #ba9000; }
.legend.cancelled { background: #8c95a3; }
.subscription-symbol { width: 43px; color: var(--ink); margin: 20px 0; }
.subscription-card h3 { font-size: 23px; }
.subscription-card p { color: var(--muted); font-size: 14px; }
.subscription-card .button { width: 100%; }
.subscription-card .smalltext { font-size: 11px; margin: 18px 0 0; }
.insight { border: 0; background: var(--yellow); }
.insight .eyebrow, .insight p, .insight small { color: var(--ink); }
.insight p { font-size: 14px; }
.insight-amount { display: block; font-size: 32px; font-weight: 400; margin-bottom: 18px; }
.insight a { color: var(--ink); font-size: 14px; text-decoration: underline; }
.insight small { display: block; font-size: 11px; margin-top: 16px; }
.journey-row { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); padding: 20px 0; }
.route-icon { width: 32px; height: 32px; display: grid; place-items: center; color: var(--blue); font-size: 23px; flex-shrink: 0; }
.journey-info { flex: 1; min-width: 0; }
.journey-info strong { font-size: 14px; font-weight: 600; }
.journey-info p { color: var(--muted); font-size: 12px; margin: 5px 0; }
.journey-info small { color: var(--muted); font-size: 11px; }
.journey-cost { display: flex; flex-direction: column; text-align: right; white-space: nowrap; }
.journey-cost strong { font-size: 18px; font-weight: 400; }
.journey-cost small, .journey-cost a { font-size: 11px; }
.journey-cost small { color: var(--muted); }
.badge { display: inline-block; background: #e8f1ff; color: var(--ink); font-size: 11px; padding: 3px 7px; border-radius: 2px; white-space: nowrap; }
.badge.planned { background: #fff2bb; }
.badge.cancelled { background: #eceef2; color: #596575; }
.formcard label { display: block; font-size: 13px; font-weight: 600; margin-top: 16px; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: 6px; border: 1px solid #a9b1bf; border-radius: 3px; padding: 10px 11px; color: var(--ink); background: white; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
input::placeholder { color: #677384; }
.formpair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 12px 0 0; }
.formcard details { margin: 18px 0; }
.formcard summary { color: var(--blue); font-size: 13px; cursor: pointer; }
.empty { text-align: center; padding: 36px 18px; color: var(--muted); }
.empty > div { font-size: 38px; color: var(--blue); margin-bottom: 16px; }
.empty h3 { color: var(--ink); }
.empty p { font-size: 14px; max-width: 400px; margin: 0 auto 24px; }
.notice { margin: 20px 0; padding: 20px 24px; border-radius: 3px; border-left: 4px solid var(--yellow); background: #fff6d6; }
.notice.error { border-left-color: #b21e32; background: #fff1f2; color: #8c2330; }
.notice p { margin: 7px 0; font-size: 13px; }
footer { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 32px; font-size: 11px; color: var(--muted); }
.rangeform { display: flex; align-items: end; gap: 16px; }
.rangeform label { flex: 1; font-size: 13px; font-weight: 600; }
.rangeform .button { min-height: 44px; }
.quickranges { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 22px; font-size: 13px; }
.quickranges a::before { content: "›"; margin-right: 8px; color: var(--ink); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 18px 14px; border-bottom: 1px solid #dde2eb; text-align: right; vertical-align: top; }
th:first-child, td:first-child { text-align: left; }
th { background: #f4f7fb; color: var(--ink); font-size: 12px; font-weight: 600; }
td:first-child { min-width: 180px; }
tbody tr:hover { background: #f9fbfe; }
td strong { font-weight: 600; }
.comparison-note { display: block; margin-top: 6px; max-width: 500px; color: var(--muted); font-size: 11px; }
.breakdown { margin: 20px 0 0; max-width: 800px; }
.breakdown > div { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e2e6ed; padding: 12px 0; font-size: 14px; }
.breakdown dd { margin: 0; font-weight: 600; white-space: nowrap; }
.breakdown .net { padding: 17px 12px; margin-top: 8px; background: #fff2bf; border: 0; }
.settings-grid > * { min-width: 0; }
.settings-grid { display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 24px; }
.timeline article { position: relative; border-left: 2px solid #cad8ed; margin-left: 6px; padding: 0 0 30px 25px; }
.timeline article:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.timeline p { font-size: 14px; }
.timeline .eyebrow { font-size: 12px; }
.timeline small { color: var(--muted); font-size: 12px; }
.timeline-actions { display: flex; gap: 20px; align-items: center; margin-top: 16px; }
.promo-label { color: var(--ink); font-weight: 600; }
.promotion-explainer { background: #fff2bf; border: 0; }
.promotion-explainer p { font-size: 14px; }
.yearpicker { display: flex; align-items: end; gap: 12px; margin: 20px 0 24px; }
.yearpicker label { width: 110px; font-size: 13px; }
.wrapped-hero { position: relative; overflow: hidden; padding: 54px; border-radius: 4px; background: var(--yellow); color: var(--ink); }
.wrapped-hero .eyebrow { color: var(--ink); }
.wrapped-hero h1 { font-size: 58px; line-height: 1.1; }
.wrapped-hero h1 span { font-weight: 600; }
.wrapped-hero p { font-size: 16px; }
.wrapped-number { font-size: 144px; font-weight: 600; line-height: 1.1; letter-spacing: -5px; margin: 30px 0 8px; }
.wrapped-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.wrapped-card { padding: 36px; min-height: 230px; border-radius: 4px; }
.wrapped-card h2 { font-size: 32px; line-height: 1.3; margin: 20px 0; }
.wrapped-card p { font-size: 14px; }
.lime { background: #fff2bf; }
.blue { background: #dfecff; }
.peach { background: white; }
.dark { background: var(--ink); color: white; }
.dark .eyebrow { color: #c9dcf8; }
.dark .breakdown > div { border-color: #49699f; }
.dark .breakdown .net { color: var(--ink); }
.monthstories { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-top: 24px; }
.monthstories a { display: flex; flex-direction: column; padding: 18px; background: #f0f5fc; border-radius: 2px; color: var(--ink); font-size: 13px; border-left: 3px solid var(--yellow); }
.monthstories strong { font-size: 22px; font-weight: 400; margin: 10px 0; }
.quote-results { margin-top: 14px; font-size: 13px; }
.quote-option { display: block; width: 100%; text-align: left; border: 1px solid #b8ccec; background: #f0f6ff; color: var(--ink); border-radius: 3px; padding: 12px; margin: 10px 0; }
.quote-option:hover { border-color: var(--blue); background: #e4efff; }
.quote-option small { display: block; margin-top: 5px; color: var(--muted); }
.htmx-indicator { opacity: 0; }
.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { opacity: 1; }
@media (max-width: 1100px) {
  .header-inner { gap: 24px; }
  .header-label { display: none; }
  .site-header nav { gap: 24px; margin-left: auto; }
  .workspace { grid-template-columns: minmax(0,1fr) 290px; }
  .metric { padding: 20px; }
  .metric strong { font-size: 28px; }
  .card-heading > span { display: none; }
  .rangeform { flex-wrap: wrap; }
  .rangeform label { flex-basis: 20%; }
}
@media (max-width: 850px) {
  .header-inner { flex-wrap: wrap; gap: 0; min-height: 0; padding-top: 18px; }
  .brand { margin-bottom: 12px; }
  .header-label { display: block; margin-bottom: 12px; }
  .site-header nav { order: 1; width: 100%; margin: 0; min-height: 52px; justify-content: space-between; gap: 12px; }
  .site-header nav a { font-size: 14px; }
  .workspace, .settings-grid { grid-template-columns: minmax(0,1fr); }
  .rightcolumn { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .rightcolumn .formcard { grid-column: 1 / -1; }
  .monthbar { flex-wrap: wrap; }
  .monthstories { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 600px) {
  .header-inner, main { padding-left: 16px; padding-right: 16px; }
  .brand { font-size: 22px; }
  .brandmark { width: 30px; height: 34px; }
  .header-label { font-size: 10px; }
  .site-header nav { gap: 8px; min-height: 48px; }
  .site-header nav a { font-size: 11px; }
  .topbar { min-height: 46px; font-size: 11px; }
  .local-status { font-size: 10px; }
  .local-status svg { display: none; }
  .breadcrumb-arrow { padding: 0 5px; }
  .page-heading { align-items: start; flex-direction: column; padding: 28px 0; gap: 20px; margin-bottom: 24px; }
  h1 { font-size: 31px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }
  .page-heading p { font-size: 14px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 18px 16px; border-bottom: 1px solid #e7e9ed; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(n+3) { border-bottom: 0; }
  .metric strong { font-size: 27px; }
  .metric span { font-size: 12px; }
  .metric small { font-size: 10px; }
  .monthswitch { gap: 14px; }
  .card { padding: 20px; }
  .calendar { padding: 20px 0 0; }
  .calendar .card-heading { padding: 0 16px; }
  .day { min-height: 82px; padding: 4px 2px; }
  .daynumber { font-size: 11px; width: 25px; height: 25px; }
  .trip-chip { font-size: 9px; padding: 3px 2px; }
  .trip-chip span { display: none; }
  .calendar-legend { gap: 12px; padding: 14px; font-size: 10px; }
  .rightcolumn { display: block; }
  .route-icon { display: none; }
  .journey-info strong { font-size: 12px; }
  .journey-info p, .journey-info small { font-size: 10px; }
  .journey-row { gap: 10px; }
  .journey-cost strong { font-size: 15px; }
  .journey-cost small { font-size: 10px; }
  .journey-row .button { font-size: 11px; padding: 6px; }
  .rangeform { gap: 16px 12px; }
  .rangeform label { flex-basis: 40%; }
  .rangeform .button { width: 100%; }
  .quickranges { gap: 12px 18px; font-size: 12px; }
  th, td { padding: 14px 10px; }
  .breakdown > div { font-size: 12px; gap: 12px; }
  .wrapped-hero { padding: 30px; }
  .wrapped-hero h1 { font-size: 44px; }
  .wrapped-number { font-size: 112px; }
  .wrapped-grid { grid-template-columns: 1fr; }
  .wrapped-card { padding: 28px; }
  .monthstories { grid-template-columns: 1fr 1fr; }
  .formcard { scroll-margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}

[hidden] { display: none !important; }
.dialog-open { overflow: hidden; }
.journey-dialog { width: min(620px, calc(100% - 32px)); max-height: calc(100dvh - 48px); margin: auto; border: 0; border-radius: 5px; padding: 30px; color: var(--ink); background: white; box-shadow: 0 15px 70px #001c4d40; }
.journey-dialog::backdrop { background: #001f52a6; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.dialog-heading .eyebrow { margin: 0; }
.dialog-close { background: none; border: 0; color: var(--ink); font-size: 30px; width: 40px; height: 40px; }
.journey-dialog h2 { margin: 8px 0 24px; }

.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; border-top: 1px solid var(--line); padding-top: 20px; }
.dialog-error { margin: 0 0 20px; }
.price-status { background: #f1f5fc; padding: 14px 16px; margin-top: 18px; font-size: 13px; border-left: 3px solid var(--blue); }
.price-status.ready { background: #eaf4ff; }
.price-status.fallback { background: #fff5d2; border-left-color: var(--yellow); }
.price-status .textbutton { color: var(--blue); margin-top: 8px; }
input[readonly] { background: #f5f7fa; color: var(--ink); }
.quote-results summary { color: var(--blue); font-size: 13px; cursor: pointer; }
.quote-option[aria-pressed="true"] { border: 2px solid var(--blue); background: #e4efff; }
.notice.success { background: #eaf4ff; border-left-color: var(--blue); }
.backup-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.backup-card h3 { margin-bottom: 8px; }
.backup-card p { margin: 0; font-size: 14px; }
@media (max-width: 600px) {
  .journey-dialog { padding: 22px 20px; max-height: calc(100dvh - 24px); }
  .backup-card { display: block; }
  .backup-card .button { margin-top: 20px; }
}
.login-card { max-width: 440px; margin: 40px auto; }
.login-card h2 { margin-bottom: 16px; }
.logout-form { margin-left: auto; }
.logout-form .textbutton { color: var(--ink); white-space: nowrap; }
@media (max-width: 850px) { .logout-form { margin-bottom: 12px; } }

.formcard .roundtrip-toggle { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.roundtrip-toggle input { width: 20px; min-height: 20px; height: 20px; margin: 0; accent-color: var(--blue); }
.leg-heading, .return-pricing legend { font-size: 18px; font-weight: 500; color: var(--ink); }
.leg-heading { margin: 24px 0 0; }
.return-pricing { min-width: 0; border: 0; border-top: 1px solid #dce1e9; padding: 16px 0 0; margin: 24px 0 0; }
.return-pricing legend { padding-right: 12px; }
