@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Newsreader:opsz,wght@6..72,400..800&family=Noto+Serif+TC:wght@400;500;600;700;900&display=swap");
:root {
    --font-sans: "Manrope", "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
    --font-cjk: "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", serif;
    --font-display: "Newsreader", "Noto Serif TC", "Songti TC", serif;
    --font-serif: "Newsreader", "Noto Serif TC", "Songti TC", serif;

    color-scheme: dark;
    --bg: #070912;
    --panel: rgba(13, 17, 31, 0.82);
    --panel-solid: #11172a;
    --panel-soft: rgba(255, 255, 255, 0.08);
    --ink: #f7f8ff;
    --soft: rgba(247, 248, 255, 0.72);
    --muted: rgba(247, 248, 255, 0.48);
    --line: rgba(255, 255, 255, 0.14);
    --brand: #ff7a59;
    --brand-2: #ffd166;
    --brand-3: #7aa7ff;
    --danger: #ff5d73;
    --ok: #78d9c4;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
    --glass-border: rgba(255, 255, 255, 0.24);
    --glass-fill: rgba(255, 255, 255, 0.075);
}

* {
    box-sizing: border-box;
}

html,
body,
#root {
    min-height: 100%;
}

body {
    margin: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 14%, rgba(255, 122, 89, 0.22), transparent 24rem),
        radial-gradient(circle at 78% 28%, rgba(122, 167, 255, 0.2), transparent 26rem),
        linear-gradient(130deg, rgba(255, 122, 89, 0.12), transparent 28%),
        linear-gradient(232deg, rgba(122, 167, 255, 0.14), transparent 34%),
        var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 82px 82px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 84%);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    color: inherit;
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.studio-return {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 5000;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 6px 16px 6px 7px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
        rgba(12, 16, 30, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        0 18px 54px rgba(0, 0, 0, 0.3),
        0 0 28px rgba(255, 122, 89, 0.18);
    color: #fff;
    font-size: 14px;
    font-weight: 820;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.studio-return:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 22px 62px rgba(0, 0, 0, 0.34),
        0 0 42px rgba(255, 209, 102, 0.24);
}

.studio-return img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.app {
    position: relative;
    height: 100svh;
    overflow: hidden;
}

.shell-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, 0.09) 44%, transparent 50%),
        linear-gradient(68deg, transparent 54%, rgba(255, 122, 89, 0.12) 62%, transparent 74%);
    opacity: 0.72;
}

.topbar {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 800;
    width: min(1180px, calc(100% - 28px));
    min-height: 58px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 8px 10px 8px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.28), transparent 32%),
        linear-gradient(118deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.055) 54%, rgba(255, 255, 255, 0.13)),
        rgba(12, 16, 30, 0.66);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    transform: translateX(-50%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-badge {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.22)),
        linear-gradient(135deg, var(--brand-2), var(--brand));
    color: #17110d;
    font-weight: 900;
}

.back-badge {
    font-size: 22px;
    line-height: 1;
}

.brand strong {
    display: block;
    font-size: 15px;
}

.brand span:last-child {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.tabs {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(0, 120px));
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.tab {
    min-width: 0;
    min-height: 40px;
    border-radius: 22px;
    background: transparent;
    color: var(--soft);
    font-size: 13px;
    font-weight: 760;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.tab.is-active {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)),
        rgba(255, 122, 89, 0.16);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.top-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 8px;
}

.icon-button,
.text-button,
.primary-button,
.danger-button,
.ghost-button {
    min-height: 38px;
    border-radius: 22px;
    font-weight: 780;
}

.icon-button {
    width: 38px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
}

.text-button,
.ghost-button {
    padding: 0 13px;
    background: rgba(255, 255, 255, 0.08);
}

.primary-button {
    padding: 0 16px;
    color: #1d1209;
    background: linear-gradient(135deg, #ffe1b0, #ff8f66);
    box-shadow: 0 10px 28px rgba(255, 122, 89, 0.22);
}

.danger-button {
    padding: 0 13px;
    color: #fff;
    background: rgba(255, 93, 115, 0.18);
}

.main {
    position: relative;
    height: 100svh;
    padding-top: 88px;
    overflow: hidden;
}

.view-panel {
    position: absolute;
    inset: 88px 0 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(20px, 0, 0) scale(0.992);
    transition: opacity 220ms ease, transform 320ms cubic-bezier(.2, .8, .2, 1), visibility 0ms linear 320ms;
}

.view-panel.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) scale(1);
    transition-delay: 0ms;
}

.map-page,
.route-page,
.budget-page {
    height: calc(100svh - 88px);
}

.map-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 14px;
    width: min(1440px, calc(100% - 28px));
    margin: 0 auto;
    padding-bottom: 14px;
}

.map-wrap {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    background: #101522;
}

#travel-map {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #101522;
}

.leaflet-container {
    font-family: inherit;
}

.leaflet-control-attribution {
    background: rgba(7, 9, 18, 0.76) !important;
    color: rgba(255, 255, 255, 0.62) !important;
    backdrop-filter: blur(12px);
}

.map-overlay {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 14px;
    z-index: 500;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    pointer-events: none;
}

.search-box,
.day-picker,
.panel,
.bottom-sheet,
.modal-card,
.summary-card,
.expense-card,
.timeline-card,
.metric-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.28), transparent 34%),
        linear-gradient(125deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.052) 50%, rgba(255, 255, 255, 0.12)),
        rgba(10, 14, 26, 0.72);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.search-box::before,
.day-picker::before,
.panel::before,
.bottom-sheet::before,
.modal-card::before,
.summary-card::before,
.expense-card::before,
.timeline-card::before,
.metric-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(112deg, transparent 0 16%, rgba(255, 255, 255, 0.36) 22%, transparent 32%),
        linear-gradient(68deg, transparent 56%, rgba(255, 209, 102, 0.12), transparent 74%);
    opacity: 0.46;
}

.search-box > *,
.day-picker > *,
.panel > *,
.bottom-sheet > *,
.modal-card > *,
.summary-card > *,
.expense-card > *,
.timeline-card > *,
.metric-card > * {
    position: relative;
    z-index: 2;
}

.search-box {
    position: relative;
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    min-height: 50px;
    padding: 0 8px 0 2px;
    pointer-events: auto;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
}

.search-box input::placeholder {
    color: var(--muted);
}

.search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    max-height: 310px;
    overflow: auto;
    padding: 6px;
    border-radius: 22px;
    background: rgba(10, 14, 26, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: var(--shadow);
}

.result-row {
    width: 100%;
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 8px;
    padding: 9px;
    border-radius: 8px;
    background: transparent;
    text-align: left;
}

.result-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.result-row strong,
.result-row span {
    display: block;
}

.result-row span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.day-picker {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    pointer-events: auto;
    overflow-x: auto;
}

.chip {
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--soft);
    white-space: nowrap;
    font-size: 13px;
    font-weight: 780;
}

.chip.is-active {
    color: #1b120d;
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
}

.map-side {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 12px;
    overflow: hidden;
}

.panel {
    padding: 14px;
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.panel-title h2,
.panel-title h3,
.page-title h1,
.budget-total h1 {
    margin: 0;
    letter-spacing: 0;
}

.panel-title h2 {
    font-size: 24px;
}

.panel-title h3 {
    font-size: 16px;
}

.panel-title p,
.page-title p,
.empty-state,
.field span,
.small-copy {
    color: var(--muted);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.metric-card {
    min-height: 82px;
    padding: 12px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.metric-card strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.legend-button {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 9px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.075);
    color: var(--soft);
    font-size: 13px;
    font-weight: 720;
    text-align: left;
}

.legend-dot,
.marker-pin {
    display: inline-grid;
    place-items: center;
    color: #101014;
}

.legend-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.legend-button.is-off {
    opacity: 0.38;
}

.mini-list {
    min-height: 0;
    overflow: auto;
}

.mini-stop {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.065);
    text-align: left;
}

.mini-stop + .mini-stop {
    margin-top: 8px;
}

.mini-stop strong,
.mini-stop span {
    display: block;
}

.mini-stop span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.bottom-sheet {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 520;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: 14px;
}

.place-title {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 0;
}

.place-title h3 {
    margin: 0;
    font-size: 20px;
}

.place-title p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
}

.field {
    display: grid;
    gap: 5px;
}

.field span {
    font-size: 11px;
    font-weight: 820;
    text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    outline: 0;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.08);
    padding: 0 10px;
}

.field textarea {
    min-height: 76px;
    padding: 10px;
    resize: vertical;
}

.existing-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    color: var(--soft);
    font-size: 12px;
    font-weight: 740;
}

.sheet-actions {
    display: grid;
    align-content: end;
    gap: 8px;
    min-width: 138px;
}

.marker-pin {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.35);
    font-size: 15px;
}

.marker-pin.is-planned {
    width: 38px;
    height: 38px;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.18), 0 14px 28px rgba(0, 0, 0, 0.38);
}

.marker-order {
    position: absolute;
    right: -7px;
    top: -7px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #0b0d14;
    background: #fff;
    font-size: 10px;
    font-weight: 900;
}

.route-page,
.budget-page {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 14px;
    padding-bottom: 14px;
}

.page-title,
.budget-total {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    background:
        linear-gradient(125deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.055)),
        rgba(10, 14, 26, 0.68);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
}

.page-title h1,
.budget-total h1 {
    font-size: 34px;
}

.route-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 14px;
}

.day-summary {
    min-height: 0;
    overflow: auto;
    padding: 14px;
}

.timeline {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 12px;
    align-content: start;
}

.timeline-group {
    display: grid;
    gap: 10px;
}

.timeline-date {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    background: linear-gradient(180deg, rgba(7, 9, 18, 0.96), rgba(7, 9, 18, 0.72));
}

.timeline-date i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.timeline-card {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 14px;
}

.timeline-time {
    color: var(--brand-2);
    font-size: 22px;
    font-weight: 900;
}

.timeline-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.timeline-actions {
    display: flex;
    align-items: start;
    gap: 7px;
}

.budget-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
}

.budget-list {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 12px;
    align-content: start;
}

.expense-group {
    display: grid;
    gap: 8px;
}

.expense-date {
    color: var(--muted);
    font-weight: 820;
    font-size: 13px;
}

.expense-card {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    text-align: left;
}

.expense-card strong,
.expense-card span {
    display: block;
}

.expense-card span {
    color: var(--muted);
    font-size: 12px;
}

.amount {
    color: var(--brand-2);
    font-size: 18px;
    font-weight: 900;
}

.budget-side {
    min-height: 0;
    display: grid;
    gap: 12px;
    align-content: start;
}

.category-bars {
    display: grid;
    gap: 10px;
}

.bar-row {
    display: grid;
    gap: 5px;
}

.bar-row > div:first-child {
    display: flex;
    justify-content: space-between;
    color: var(--soft);
    font-size: 13px;
}

.bar-track {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.bar-fill {
    height: 100%;
    border-radius: inherit;
}

.fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 820;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: #1d1209;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.18)),
        linear-gradient(135deg, var(--brand-2), var(--brand));
    box-shadow: 0 20px 48px rgba(255, 122, 89, 0.35);
    font-size: 28px;
    font-weight: 760;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.54);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.modal-card {
    width: min(430px, 100%);
    padding: 16px;
}

.modal-card h2 {
    margin: 0 0 14px;
}

.form-grid {
    display: grid;
    gap: 10px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

.empty-state {
    min-height: 220px;
    display: grid;
    place-items: center;
    padding: 24px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    text-align: center;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1400;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(7, 9, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: translateX(-50%);
    box-shadow: var(--shadow);
}

@media (max-width: 1060px) {
    .map-page {
        grid-template-columns: 1fr;
    }

    .map-side {
        display: none;
    }

    .map-wrap {
        min-height: calc(100svh - 102px);
    }

    .route-layout,
    .budget-layout {
        grid-template-columns: 1fr;
    }

    .day-summary,
    .budget-side {
        display: none;
    }
}

@media (max-width: 720px) {
    body {
        overflow: hidden;
    }

    .topbar {
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        grid-template-columns: 1fr;
        gap: 8px;
        min-height: 0;
        padding: 7px;
        transform: none;
    }

    .brand {
        padding-right: 70px;
    }

    .brand span:last-child {
        display: block;
    }

    .brand span:last-child span {
        display: none;
    }

    .tabs {
        position: static;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 6px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 8px;
        background: rgba(11, 15, 28, 0.86);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        box-shadow: none;
    }

    .tab {
        min-height: 42px;
        padding: 0 4px;
        font-size: 11px;
    }

    .top-actions .text-button {
        display: none;
    }

    .top-actions {
        position: absolute;
        top: 7px;
        right: 7px;
    }

    .top-actions .lang-toggle {
        display: inline-flex;
        min-height: 34px;
    }

    .main {
        padding-top: 126px;
    }

    .view-panel {
        inset: 126px 0 0;
    }

    .map-page,
    .route-page,
    .budget-page {
        height: calc(100svh - 126px);
        width: calc(100% - 20px);
        padding-bottom: 10px;
    }

    .map-wrap {
        min-height: calc(100svh - 136px);
    }

    .map-overlay {
        top: 10px;
        left: 10px;
        right: 10px;
        grid-template-columns: 1fr;
    }

    .day-picker {
        max-width: 100%;
    }

    .bottom-sheet {
        left: 10px;
        right: 10px;
        bottom: 14px;
        grid-template-columns: 1fr;
        max-height: 54svh;
        overflow: auto;
    }

    .field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sheet-actions {
        grid-template-columns: 1fr 1fr;
    }

    .page-title,
    .budget-total {
        align-items: start;
        flex-direction: column;
        padding: 14px;
    }

    .page-title h1,
    .budget-total h1 {
        font-size: 28px;
    }

    .timeline-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .timeline-actions {
        justify-content: stretch;
    }

    .timeline-actions button {
        flex: 1;
    }

    .fab {
        right: 18px;
        bottom: 18px;
    }
}

@media (max-width: 430px) {
    .brand strong {
        font-size: 13px;
    }

    .brand-badge {
        width: 34px;
        height: 34px;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .sheet-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .topbar {
        left: 10px;
        right: auto;
        width: calc(100vw - 20px);
        max-width: 370px;
        transform: none;
    }

    .map-page,
    .route-page,
    .budget-page {
        width: calc(100vw - 20px);
        max-width: 370px;
        margin-left: 10px;
        margin-right: 10px;
    }
}

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

.panel-title h2, .panel-title h3, .page-title h1, .budget-total h1 { font-family: var(--font-serif); }
