:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #6e7773;
  --paper: #f4f1eb;
  --card: #fffefa;
  --line: #d9ddd8;
  --green: #143d37;
  --green-2: #2f675d;
  --mint: #d9eee7;
  --orange: #e8913a;
  --sand: #f2dfc6;
  --red: #a6453c;
  --shadow: 0 18px 50px rgba(25, 52, 46, .10);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; font-size: 18px; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: Verdana, Geneva, sans-serif; font-size: 18px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(232,145,58,.45); outline-offset: 2px; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 .35rem; color: var(--green-2); font-size: .72rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .5rem; font-family: Verdana, Geneva, sans-serif; font-size: clamp(2rem, 7vw, 3.6rem); line-height: 1.05; letter-spacing: -.035em; }
h2 { margin-bottom: .25rem; font-size: 1.18rem; }
small { color: var(--muted); }

.app-header { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: .65rem; padding: max(.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .75rem max(1rem, env(safe-area-inset-left)); background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(23,33,31,.07); }
.header-left { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.menu-button { position: relative; flex: 0 0 auto; }
.menu-button span, .menu-button::before, .menu-button::after { position: absolute; left: 50%; display: block; width: 1.15rem; height: 2px; border-radius: 2px; background: currentColor; content: ""; transform: translate(-50%, -50%); }
.menu-button span { top: 50%; }
.menu-button::before { top: calc(50% - 6px); }
.menu-button::after { top: calc(50% + 6px); }
.trip-switcher { display: flex; align-items: center; gap: .65rem; min-width: 0; padding: .25rem; background: none; border: 0; text-align: left; cursor: pointer; }
.trip-switcher > span:nth-child(2) { display: grid; min-width: 0; }
.trip-switcher small { font-size: .62rem; font-weight: 800; letter-spacing: .1em; }
.trip-switcher strong { max-width: min(47vw, 270px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.trip-mark { display: grid; place-items: center; width: 2.25rem; aspect-ratio: 1; border-radius: 50%; background: var(--green); color: white; font-size: 1.15rem; }
.header-actions { display: flex; align-items: center; gap: .45rem; }
.status-pill { padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--green-2); font-size: .7rem; font-weight: 750; white-space: nowrap; }
.status-pill.offline { color: var(--red); }
.round-button { display: grid; place-items: center; width: 2.55rem; height: 2.55rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); cursor: pointer; }

main { width: min(100%, 840px); min-height: calc(100dvh - 7rem); margin: 0 auto; padding: 1rem 1rem calc(6rem + var(--safe-bottom)); }
.view { display: none; animation: rise .25s ease both; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.hero-card { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: end; gap: 1rem; min-height: 260px; padding: clamp(1.4rem, 5vw, 2.4rem); border-radius: 30px; background: var(--green); color: #f8f5ef; box-shadow: var(--shadow); }
.hero-card::before { content: ""; position: absolute; right: -65px; top: -85px; width: 230px; height: 230px; border-radius: 50%; background: var(--orange); opacity: .92; }
.hero-card::after { content: ""; position: absolute; right: 76px; top: 36px; width: 85px; height: 85px; border: 2px solid rgba(255,255,255,.22); border-radius: 50%; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card .eyebrow { color: #b7e3d7; }
.hero-card h1 { max-width: 560px; }
.hero-route { margin: 0; color: #dce8e4; }
.countdown { display: grid; min-width: 80px; text-align: center; }
.countdown strong { font-size: 2.7rem; line-height: 1; }
.countdown span { color: #dce8e4; font-size: .75rem; font-weight: 700; }
.section-heading, .page-title { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: 2rem .2rem .85rem; }
.page-title { align-items: center; margin-top: .65rem; }
.page-title h1 { margin: 0; font-size: clamp(2rem, 8vw, 3.4rem); }
.section-heading h2 { margin: 0; font-size: 1.35rem; }
.text-button { border: 0; background: none; color: var(--green-2); font-size: .84rem; font-weight: 800; cursor: pointer; }
.add-button { padding: .7rem .9rem; border: 0; border-radius: 14px; background: var(--mint); color: var(--green); font-weight: 850; cursor: pointer; white-space: nowrap; }
.primary-button, .secondary-button { min-height: 3rem; padding: .75rem 1rem; border-radius: 15px; font-weight: 850; cursor: pointer; }
.primary-button { border: 0; background: var(--green); color: white; }
.secondary-button { border: 1px solid var(--line); background: var(--card); }
.full { width: 100%; margin-top: .65rem; }

.alerts { display: grid; gap: .5rem; margin-top: .75rem; }
.alert { display: flex; gap: .75rem; align-items: center; padding: .8rem 1rem; border-radius: 16px; background: var(--sand); color: #66431f; font-size: .86rem; }
.feature-card, .empty-card { padding: 1.15rem; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 8px 28px rgba(24,49,44,.05); }
.feature-card { display: grid; grid-template-columns: auto 1fr auto; gap: .85rem; align-items: center; }
.date-badge { display: grid; place-items: center; width: 3.1rem; height: 3.1rem; border-radius: 15px; background: var(--mint); color: var(--green); font-weight: 900; line-height: 1.05; text-align: center; }
.date-badge small { color: inherit; font-size: .6rem; }
.feature-card p, .empty-card p { margin: .2rem 0 0; color: var(--muted); font-size: .86rem; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.quick-grid button { display: grid; gap: .2rem; min-height: 130px; padding: 1rem; border: 1px solid var(--line); border-radius: 22px; background: var(--card); text-align: left; cursor: pointer; }
.quick-grid button > span { display: grid; place-items: center; width: 2.45rem; height: 2.45rem; border-radius: 13px; background: var(--mint); color: var(--green); font-weight: 900; }
.quick-grid button:nth-child(2n) > span { background: var(--sand); color: #7b4e20; }
.quick-grid strong { margin-top: auto; }

.stack-list, .balance-list { display: grid; gap: .65rem; }
.list-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .8rem; align-items: center; padding: 1rem; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.list-card .icon { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 14px; background: var(--mint); color: var(--green); font-weight: 900; }
.list-card h3 { margin: 0; font-size: 1rem; }
.list-card p { margin: .18rem 0 0; color: var(--muted); font-size: .82rem; }
.list-card .amount { font-weight: 900; white-space: nowrap; }
.list-card button.card-main { display: contents; border: 0; background: none; text-align: left; cursor: pointer; }
.card-actions { display: flex; gap: .2rem; }
.icon-action { width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.day-group { margin-bottom: 1.2rem; }
.day-group > h2 { position: sticky; top: 67px; z-index: 3; padding: .55rem .2rem; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); }
.chips { display: flex; gap: .5rem; overflow-x: auto; margin: .2rem 0 1rem; padding-bottom: .2rem; scrollbar-width: none; }
.chip { padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .78rem; white-space: nowrap; cursor: pointer; }
.chip.active { background: var(--green); color: white; border-color: var(--green); }
.state { display: inline-block; margin-top: .3rem; padding: .22rem .48rem; border-radius: 999px; background: var(--mint); color: var(--green); font-size: .68rem; font-weight: 800; }
.state.pending { background: var(--sand); color: #74471b; }

.finance-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.metric { padding: 1rem .75rem; border-radius: 18px; background: var(--green); color: white; }
.metric:nth-child(2) { background: var(--green-2); }
.metric:nth-child(3) { background: var(--orange); color: #2f2417; }
.metric strong { display: block; overflow-wrap: anywhere; font-size: clamp(1rem, 4vw, 1.45rem); }
.metric small { color: inherit; opacity: .8; font-size: .66rem; }
.balance-row { display: grid; grid-template-columns: 1fr auto; gap: .4rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.balance-row small { grid-column: 1 / -1; }
.positive { color: var(--green-2); }
.negative { color: var(--red); }

.tool-menu { overflow: hidden; border: 1px solid var(--line); border-radius: 23px; background: var(--card); }
.tool-menu button { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .85rem; width: 100%; padding: 1rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.tool-menu button:last-child { border-bottom: 0; }
.tool-menu button > span { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 14px; background: var(--mint); color: var(--green); font-weight: 900; }
.tool-menu small { display: block; margin-top: .15rem; }
.tool-menu b { font-size: 1.5rem; color: var(--muted); }
.detail-view { animation: rise .25s ease both; }
.check-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.check-row input { width: 1.3rem; height: 1.3rem; accent-color: var(--green); }
.check-row.done span { color: var(--muted); text-decoration: line-through; }
.doc-open { color: var(--green-2); font-weight: 800; text-decoration: none; }
.settings-card { padding: 1rem; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.settings-card + .settings-card { margin-top: .75rem; }
.settings-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.danger-button { padding: .7rem .9rem; border: 1px solid #d9aaa5; border-radius: 14px; background: #fff7f6; color: var(--red); font-weight: 800; cursor: pointer; }

.bottom-nav { position: fixed; z-index: 25; left: 50%; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); width: min(100%, 840px); padding: .45rem max(.5rem, env(safe-area-inset-right)) calc(.45rem + var(--safe-bottom)) max(.5rem, env(safe-area-inset-left)); transform: translateX(-50%); background: rgba(255,254,250,.94); backdrop-filter: blur(18px); border-top: 1px solid rgba(23,33,31,.09); }
.bottom-nav button { display: grid; place-items: center; gap: .1rem; min-height: 3.25rem; border: 0; border-radius: 14px; background: transparent; color: var(--muted); cursor: pointer; }
.bottom-nav button span { font-weight: 900; }
.bottom-nav button small { color: inherit; font-size: .66rem; }
.bottom-nav button.active { background: var(--mint); color: var(--green); }

.empty-state { display: grid; place-items: center; min-height: calc(100dvh - 9rem); padding: 2rem 1rem; text-align: center; }
.empty-state h1 { max-width: 650px; }
.empty-state > p:not(.eyebrow) { max-width: 520px; color: var(--muted); }
.empty-state .primary-button { min-width: 230px; margin-top: .8rem; }
.empty-illustration { position: relative; width: 170px; height: 125px; margin-bottom: 1rem; }
.empty-illustration span { position: absolute; display: grid; place-items: center; border-radius: 50%; }
.empty-illustration span:nth-child(1) { left: 0; bottom: 0; width: 100px; height: 100px; background: var(--green); color: white; font-size: 2rem; }
.empty-illustration span:nth-child(2) { right: 0; top: 0; width: 92px; height: 92px; background: var(--orange); color: white; font-size: 2rem; }
.empty-illustration span:nth-child(3) { right: 48px; bottom: 4px; width: 48px; height: 48px; background: var(--mint); color: var(--green); }

.app-dialog { width: min(calc(100% - 1.2rem), 620px); max-height: min(88dvh, 820px); padding: 0; border: 0; border-radius: 26px; background: var(--paper); box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.app-dialog::backdrop { background: rgba(12,27,24,.55); backdrop-filter: blur(3px); }
.app-dialog > form, .app-dialog > div, .app-dialog > button { margin-inline: 1rem; }
.app-dialog > form { margin: 0; }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1rem .8rem; background: var(--paper); }
.dialog-header h2 { margin: 0; font-size: 1.5rem; }
.form-fields { display: grid; gap: .9rem; padding: .2rem 1rem 1rem; }
.field { display: grid; gap: .32rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .7rem; }
.field label { color: var(--green); font-size: .76rem; font-weight: 850; }
.field input, .field select, .field textarea { width: 100%; min-height: 3rem; padding: .7rem .75rem; border: 1px solid #cfd5d1; border-radius: 13px; background: var(--card); color: var(--ink); }
.field textarea { min-height: 96px; resize: vertical; }
.dialog-actions { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1.5fr; gap: .65rem; padding: .8rem 1rem calc(.8rem + var(--safe-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
.trip-list { display: grid; gap: .6rem; max-height: 55dvh; overflow-y: auto; }
.trip-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; padding: .85rem; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.trip-row button:first-child { border: 0; background: none; text-align: left; cursor: pointer; }
.trip-row.active { border-color: var(--green-2); box-shadow: inset 0 0 0 1px var(--green-2); }
.install-help { display: grid; gap: .8rem; padding: .25rem 1rem 1.25rem; line-height: 1.55; }
.install-help p { margin: 0; }
.install-note { padding: .85rem; border-radius: 14px; background: var(--mint); color: var(--green); font-size: .9rem; }
.side-menu { position: fixed; inset: 0 auto 0 0; width: min(92vw, 430px); max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0 28px 28px 0; background: var(--paper); box-shadow: 20px 0 70px rgba(0,0,0,.28); }
.side-menu::backdrop { background: rgba(12,27,24,.55); backdrop-filter: blur(3px); }
.side-menu-sheet { min-height: 100%; padding-bottom: calc(1rem + var(--safe-bottom)); }
.drawer-menu { display: grid; gap: .55rem; padding: .35rem 1rem 1rem; }
.drawer-menu button { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .8rem; width: 100%; padding: .9rem; border: 1px solid var(--line); border-radius: 17px; background: var(--card); text-align: left; cursor: pointer; }
.drawer-menu button > span { display: grid; place-items: center; width: 2.65rem; height: 2.65rem; border-radius: 13px; background: var(--mint); color: var(--green); font-weight: 900; }
.drawer-menu button div { display: grid; gap: .12rem; }
.drawer-menu button b { color: var(--muted); font-size: 1.35rem; }
.drawer-menu .drawer-feature { border-color: var(--green); background: var(--green); color: white; }
.drawer-menu .drawer-feature > span { background: var(--orange); color: #2f2417; }
.drawer-menu .drawer-feature small { color: #dce8e4; }
.drawer-menu button:disabled { opacity: .45; cursor: not-allowed; }

.destination-dialog { width: min(calc(100% - .8rem), 760px); max-height: 94dvh; }
.destination-wizard { display: grid; gap: 1rem; padding: .25rem 1rem calc(1.2rem + var(--safe-bottom)); }
.wizard-progress { display: grid; gap: .45rem; }
.wizard-progress div { overflow: hidden; height: .55rem; border-radius: 999px; background: #dfe4df; }
.wizard-progress span { display: block; height: 100%; border-radius: inherit; background: var(--orange); transition: width .25s ease; }
.wizard-progress small { color: var(--green-2); font-weight: 800; }
.answer-summary { display: flex; flex-wrap: wrap; gap: .45rem; }
.answer-summary button { padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--green); font-size: .78rem; cursor: pointer; }
.question-card { padding: 1.1rem; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.question-card h3 { margin-bottom: .35rem; font-size: 1.25rem; }
.question-card > p { margin-bottom: 1rem; color: var(--muted); }
.custom-answer { display: grid; gap: .45rem; margin-bottom: 1rem; padding: .85rem; border: 1px solid #b7d6cc; border-radius: 17px; background: var(--mint); }
.custom-answer label { color: var(--green); font-weight: 850; }
.custom-answer > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .5rem; }
.custom-answer input { min-width: 0; min-height: 3rem; padding: .7rem .75rem; border: 1px solid #aec8c0; border-radius: 13px; background: white; color: var(--ink); }
.custom-answer button { white-space: nowrap; }
.answer-separator { display: flex; align-items: center; gap: .65rem; margin: .7rem 0; color: var(--muted); font-size: .78rem; font-weight: 800; }
.answer-separator::before, .answer-separator::after { flex: 1; height: 1px; background: var(--line); content: ""; }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.answer-option { min-height: 4.4rem; padding: .8rem; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: left; font-weight: 800; cursor: pointer; }
.answer-option:hover, .answer-option:focus-visible { border-color: var(--green-2); background: var(--mint); }
.result-intro { padding: 1rem; border-radius: 20px; background: var(--sand); }
.result-intro h3 { margin-bottom: .35rem; }
.result-intro p { margin: 0; }
.destination-results { display: grid; gap: .75rem; }
.destination-result { display: grid; gap: .7rem; padding: 1rem; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 8px 28px rgba(24,49,44,.06); }
.destination-result header { display: flex; justify-content: space-between; align-items: start; gap: .75rem; }
.destination-result h3 { margin: 0; font-size: 1.3rem; }
.destination-result .match { padding: .35rem .55rem; border-radius: 999px; background: var(--mint); color: var(--green); font-size: .75rem; font-weight: 900; white-space: nowrap; }
.destination-result p { margin: 0; color: var(--muted); }
.destination-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.destination-tags span { padding: .3rem .5rem; border-radius: 999px; background: #eef1ed; color: var(--green-2); font-size: .72rem; }
.destination-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.destination-actions a, .destination-actions button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.7rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 13px; background: var(--card); color: var(--green); font-weight: 800; text-decoration: none; cursor: pointer; }
.destination-actions .primary-button { border-color: var(--green); background: var(--green); color: white; }
.wizard-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(5.7rem + var(--safe-bottom)); max-width: calc(100% - 2rem); padding: .75rem 1rem; transform: translate(-50%, 20px); border-radius: 13px; background: var(--ink); color: white; opacity: 0; pointer-events: none; transition: .2s ease; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  main { padding-inline: 1.5rem; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-grid button { min-height: 145px; }
  .hero-card { min-height: 320px; }
}

@media (max-width: 520px) {
  .status-pill { display: none; }
  .trip-mark { display: none; }
  .trip-switcher strong { max-width: 40vw; }
  .answer-grid { grid-template-columns: 1fr; }
  .custom-answer > div { grid-template-columns: 1fr; }
  .destination-actions > * { flex: 1 1 44%; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

