:root {
    --paper: #f1ece0;
    --panel: rgba(255, 251, 243, 0.96);
    --panel-strong: #fff8ec;
    --ink: #17313b;
    --muted: #566c75;
    --accent: #1f6f62;
    --accent-strong: #0f5447;
    --accent-soft: rgba(31, 111, 98, 0.12);
    --line: rgba(23, 49, 59, 0.12);
    --water: #3b8dad;
    --route: #d45c2c;
    --poi: #143944;
    --danger: #a02f2f;
    --shadow: 0 20px 52px rgba(23, 49, 59, 0.16);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --sans: "Segoe UI", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink);
    background: linear-gradient(180deg, #ebf4f6 0%, #e5ecdf 100%);
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

label {
    display: grid;
    gap: 8px;
}

label > span {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(31, 111, 98, 0.48);
    box-shadow: 0 0 0 4px rgba(31, 111, 98, 0.12);
}

textarea {
    resize: vertical;
    min-height: 96px;
}

.app-shell {
    --drawer-width: 0px;
    display: grid;
    grid-template-columns: var(--drawer-width) minmax(0, 1fr);
    height: 100vh;
    width: 100vw;
    transition: grid-template-columns 220ms ease;
}

.app-shell.drawer-open {
    --drawer-width: 380px;
}

.control-drawer {
    min-width: 0;
    height: 100vh;
    overflow: hidden;
}

.drawer-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 18px;
    padding: 20px;
    background: var(--panel);
    border-right: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.drawer-header,
.drawer-actions,
.action-stack,
.map-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-header {
    justify-content: space-between;
}

.drawer-header h1,
.section-heading h2,
.itinerary-drawer-header h2 {
    margin: 0;
    letter-spacing: -0.03em;
}

.drawer-header h1 {
    font-size: 1.8rem;
}

.drawer-header .drawer-day-title {
    font-size: 1.18rem;
    line-height: 1.2;
}


.drawer-form,
.drawer-section {
    display: grid;
    gap: 14px;
    align-content: start;
}

.drawer-section {
    min-height: 0;
}

.section-heading p,
#route-points-hint,
.route-point-note,
.route-point-meta,
.route-status,
.itinerary-summary,
.card-footnote {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    font-weight: 700;
}

.field-grid {
    display: grid;
    gap: 12px;
}

.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.section-heading > div {
    min-width: 0;
}

.day-time-field,
.day-select-field {
    min-width: 132px;
}

.day-time-field input,
.day-select-field select {
    min-width: 120px;
}

.route-day-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
}

.drawer-day-title {
    font-size: 1.02rem;
    line-height: 1.2;
}

.route-day-heading {
    align-items: flex-start;
}

.day-plan-controls {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.day-sync-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(20, 57, 68, 0.05);
}

.day-sync-toggle > input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.day-sync-toggle > span {
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
}

.compact-field > span {
    font-size: 0.74rem;
    letter-spacing: 0.08em;
}
.route-points-list {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-content: start;
    align-items: start;
    min-height: 0;
    overflow: auto;
    padding: 8px 4px 8px 0;
}

.route-point-card {
    position: relative;
    width: 100%;
    border: 1px solid rgba(23, 49, 59, 0.08);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.76);
    padding: 14px;
    display: grid;
    align-content: start;
    gap: 10px;
}

.route-point-card-draggable {
    cursor: grab;
}

.route-point-card.is-dragging {
    opacity: 0.52;
}

.route-point-card.route-point-conflict {
    border-color: rgba(160, 47, 47, 0.44);
    box-shadow: 0 0 0 2px rgba(197, 58, 44, 0.14);
    animation: route-point-conflict-flash 360ms ease 2;
}

.route-point-card.route-point-drop-before::before,
.route-point-card.route-point-drop-after::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    z-index: 2;
    height: 3px;
    border-radius: 999px;
    background: var(--accent-strong);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72);
    pointer-events: none;
}

.route-point-card.route-point-drop-invalid.route-point-drop-before::before,
.route-point-card.route-point-drop-invalid.route-point-drop-after::after {
    background: var(--danger);
}

.route-point-card.route-point-drop-before::before {
    top: -7px;
}

.route-point-card.route-point-drop-after::after {
    bottom: -7px;
}

.route-point-card.route-point-warning {
    border-color: rgba(160, 47, 47, 0.34);
    background: rgba(160, 47, 47, 0.08);
}

.route-point-card.route-point-card-selected {
    border-color: rgba(24, 88, 115, 0.34);
    box-shadow: 0 0 0 2px rgba(59, 141, 173, 0.14);
}

.route-point-card.route-point-warning .route-point-badge {
    background: rgba(160, 47, 47, 0.16);
    color: var(--danger);
}

.route-point-card.route-point-warning .route-point-meta,
.route-point-card.route-point-warning .route-point-travel {
    color: var(--danger);
}

.route-point-card.route-point-warning .route-point-travel {
    background: rgba(160, 47, 47, 0.08);
}

.route-point-warning-note {
    color: var(--danger);
    font-weight: 600;
}

.route-point-top,
.route-point-actions,
.route-point-travel {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.route-point-actions {
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
}

.route-point-action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.route-point-move,
.route-point-remove {
    min-width: 92px;
    justify-content: center;
}

.route-points-list.is-reordering {
    cursor: grabbing;
}

.route-point-remove:hover {
    text-decoration: none;
}

.popup-route-count-note {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.route-point-popup-card-fixed {
    align-content: start;
}

.route-point-popup-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.route-point-popup-nav-button {
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    justify-content: center;
}

.route-point-popup-nav-button:disabled {
    opacity: 0.45;
    transform: none;
    cursor: default;
}

.route-point-popup-nav-status,
.route-point-popup-current {
    text-align: center;
}

.route-point-popup-nav-status {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--accent-strong);
}

.route-point-popup-current {
    font-weight: 700;
}

@keyframes route-point-conflict-flash {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    50% {
        transform: translateX(4px);
    }
    75% {
        transform: translateX(-2px);
    }
    100% {
        transform: translateX(0);
    }
}

.route-point-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(20, 57, 68, 0.08);
    color: var(--poi);
    font-weight: 800;
    font-size: 0.75rem;
}

.route-point-card h3,
.route-point-card p,
.metric-card p,
.guidance-card h3,
.guidance-card p,
.itinerary-card h3,
.itinerary-card p,
.alert-card h3,
.alert-card p,
.stop-card h3,
.stop-card p,
.popup-card h3,
.popup-card p,
.popup h3,
.popup p {
    margin: 0;
}

.route-point-stay,
.popup-field {
    display: grid;
    gap: 8px;
}

.route-point-stay label,
.popup-field {
    display: grid;
    justify-self: start;
    gap: 6px;
    width: max-content;
    max-width: 100%;
}

.route-point-stay input,
.popup-field input {
    max-width: 132px;
}

.route-point-travel {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(59, 141, 173, 0.09);
    color: var(--poi);
    font-size: 0.92rem;
}

.panel {
    background: var(--panel);
    backdrop-filter: blur(12px);
}

.map-stage {
    --itinerary-height: min(46vh, 430px);
    --map-control-offset-top: 18px;
    --map-control-offset-right: 18px;
    --map-nav-width: 40px;
    --map-control-gap: 10px;
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 100vh;
}

#map {
    position: absolute;
    inset: 0;
}

.trip-toolbar {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, calc(100% - 184px));
    z-index: 21;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 92px 170px;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow);
}

.trip-toolbar-field {
    min-width: 0;
}

.trip-toolbar input,
.trip-toolbar select {
    min-height: 42px;
}

.trip-days-field input {
    text-align: center;
}

.map-toolbar {
    position: absolute;
    top: var(--map-control-offset-top);
    right: calc(var(--map-control-offset-right) + var(--map-nav-width) + var(--map-control-gap));
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.map-stage .maplibregl-ctrl-top-right {
    top: var(--map-control-offset-top);
    right: var(--map-control-offset-right);
}

.map-stage .maplibregl-ctrl-top-right .maplibregl-ctrl {
    margin: 0;
}

.drawer-toggle,
.icon-button,
.ghost-button,
.file-button,
.text-button,
.segmented-control button,
.popup-action {
    border: 0;
    border-radius: 999px;
    padding: 11px 16px;
    line-height: 1;
    transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.drawer-toggle,
.segmented-control button,
.ghost-button,
.file-button,
.icon-button,
.popup-action {
    background: rgba(255, 250, 242, 0.92);
    color: var(--accent-strong);
    box-shadow: 0 10px 28px rgba(23, 49, 59, 0.14);
}

.drawer-toggle:hover,
.segmented-control button:hover,
.ghost-button:hover,
.file-button:hover,
.icon-button:hover,
.popup-action:hover {
    transform: translateY(-1px);
}

.segmented-control {
    display: flex;
    gap: 10px;
}

.basemap-toggle,
.map-share-button {
    min-width: 104px;
    padding: 9px 12px;
    font-size: 0.86rem;
    justify-content: center;
}

.map-share-button {
    opacity: 1;
    transition: opacity 180ms ease, transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
}

.map-share-button.is-confirmed {
    background: rgba(31, 111, 98, 0.16);
    color: var(--accent-strong);
}

.map-share-button.is-fading {
    opacity: 0;
}

.segmented-control button.is-active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: white;
}

.drawer-toggle {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 22;
}

.itinerary-toggle {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 22;
    min-width: 144px;
    justify-content: center;
    transition: bottom 220ms ease, transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.icon-button {
    padding: 10px 12px;
    font-size: 1.1rem;
}

.file-button {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
}

.file-button input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.action-stack {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.drawer-actions {
    justify-content: flex-start;
}

.text-button {
    background: transparent;
    color: var(--accent-strong);
    padding-inline: 0;
}

.text-button:hover,
.inline-link:hover {
    text-decoration: underline;
}

.inline-link {
    color: var(--accent-strong);
    text-decoration: none;
}

.danger-text {
    color: var(--danger);
}

.drawer-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

#storage-badge,
.route-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 250, 242, 0.92);
    border: 1px solid rgba(23, 49, 59, 0.08);
    box-shadow: 0 10px 28px rgba(23, 49, 59, 0.14);
}

.route-status {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 20;
    max-width: min(520px, calc(100% - 36px));
    transition: bottom 220ms ease;
}

.itinerary-drawer {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 21;
    pointer-events: none;
}

.itinerary-drawer-inner {
    display: grid;
    gap: 14px;
    max-height: var(--itinerary-height);
    overflow: auto;
    padding: 20px 22px 22px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow);
    transform: translateY(calc(100% + 20px));
    opacity: 0;
    transition: transform 220ms ease, opacity 180ms ease;
    pointer-events: none;
}

.itinerary-drawer.is-open {
    pointer-events: auto;
}

.itinerary-drawer.is-open .itinerary-drawer-inner {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.itinerary-drawer-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.itinerary-day-bar {
    display: grid;
    gap: 8px;
}

.itinerary-day-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.itinerary-day-controls h2 {
    margin: 0;
    font-size: 1.24rem;
    line-height: 1.1;
}

.itinerary-day-button {
    min-width: 34px;
    min-height: 34px;
}

.itinerary-day-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.itinerary-summary {
    margin: 0;
}

.map-stage.itinerary-open .route-status,
.map-stage.itinerary-open .itinerary-toggle {
    bottom: calc(var(--itinerary-height) + 30px);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 12px;
}

.metric-card,
.guidance-card,
.itinerary-card,
.alert-card,
.stop-card {
    border: 1px solid rgba(23, 49, 59, 0.08);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.78);
    padding: 14px 16px;
}

.metric-card,
.guidance-card,
.itinerary-card,
.alert-card,
.stop-card,
.card-grid,
.card-footnote,
.sequence-row,
.guidance-grid,
.itinerary-list {
    display: grid;
    gap: 10px;
}

.metric-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.metric-value {
    font-size: 1.05rem;
    font-weight: 800;
}

.sequence-row {
    --timeline-node-size: 16px;
    --timeline-label-width: 118px;
    --timeline-time-width: 78px;
    align-content: start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 38px 8px 30px;
    scrollbar-gutter: stable both-edges;
}

.timeline-track {
    display: inline-flex;
    align-items: center;
    gap: 0;
    min-width: max-content;
}

.timeline-item {
    position: relative;
    flex: 0 0 auto;
}

.timeline-node {
    width: var(--timeline-node-size);
    height: var(--timeline-node-size);
}

.timeline-name {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    width: var(--timeline-label-width);
    transform: translateX(-50%);
    overflow-wrap: anywhere;
    text-align: center;
    font-size: 0.76rem;
    line-height: 1.15;
    font-weight: 800;
    color: #111111;
}

.timeline-marker {
    display: block;
    width: var(--timeline-node-size);
    height: var(--timeline-node-size);
    border-radius: 50%;
    background: #111111;
}

.timeline-time {
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    width: var(--timeline-time-width);
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.74rem;
    line-height: 1.1;
    font-weight: 700;
    color: #4c5d66;
    white-space: nowrap;
}

.timeline-segment {
    width: var(--timeline-segment-width, 112px);
    height: var(--timeline-node-size);
}

.timeline-line {
    position: absolute;
    left: calc(var(--timeline-node-size) / -2);
    top: calc(50% - 1px);
    width: calc(100% + var(--timeline-node-size));
    height: 0;
    border-top: 2px solid #111111;
}

.timeline-segment-stay .timeline-line {
    border-top-style: dotted;
}

.timeline-duration {
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    font-size: 0.72rem;
    line-height: 1.1;
    font-weight: 800;
    color: #111111;
    white-space: nowrap;
}

.timeline-item-warning .timeline-marker {
    background: var(--danger);
}

.timeline-item-warning .timeline-name,
.timeline-item-warning .timeline-time,
.timeline-item-warning .timeline-duration {
    color: #8f221a;
}

.timeline-item-warning .timeline-line {
    border-top-color: rgba(160, 47, 47, 0.9);
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.guidance-grid,
.itinerary-list {
    align-content: start;
}

.guidance-bridge-fail {
    border-color: rgba(160, 47, 47, 0.34);
    background: rgba(160, 47, 47, 0.10);
}

.guidance-bridge-fail h3 {
    color: #8f221a;
}

.guidance-bridge-pass {
    border-color: rgba(15, 125, 95, 0.30);
    background: rgba(15, 125, 95, 0.10);
}

.guidance-bridge-pass h3 {
    color: #0f7d5f;
}

.guidance-bridge-advisory {
    border-color: rgba(173, 114, 24, 0.34);
    background: rgba(173, 114, 24, 0.1);
}

.guidance-bridge-advisory h3 {
    color: #8d6114;
}

.itinerary-card-warning {
    border-color: rgba(160, 47, 47, 0.34);
    background: rgba(160, 47, 47, 0.1);
}

.itinerary-card-warning h3,
.itinerary-card-warning .card-grid,
.itinerary-card-warning .card-footnote,
.itinerary-card-warning ul {
    color: #8f221a;
}

.guidance-card ul,
.itinerary-card ul,
.alert-card ul,
.stop-card ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.route-point-marker {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.route-point-marker-stack,
.route-point-marker-badge {
    grid-area: 1 / 1;
}

.route-point-marker-stack {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #fff6eb;
    background: var(--route);
    box-shadow: 0 8px 18px rgba(23, 49, 59, 0.16);
    transform: translate(4px, 4px);
    pointer-events: none;
    z-index: 0;
}

.route-point-marker-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid #fff6eb;
    background: var(--route);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.75rem;
    box-shadow: 0 10px 22px rgba(23, 49, 59, 0.22);
    pointer-events: none;
    z-index: 1;
}

.route-point-marker.is-hidden-duplicate {
    visibility: hidden;
    pointer-events: none;
}

.route-point-marker.marker-start .route-point-marker-badge,
.route-point-marker.marker-start .route-point-marker-stack {
    background: #0f7d5f;
}

.route-point-marker.marker-end .route-point-marker-badge,
.route-point-marker.marker-end .route-point-marker-stack {
    background: #a8431b;
}

.route-point-marker.has-clearance-warning .route-point-marker-badge,
.route-point-marker.has-clearance-warning .route-point-marker-stack {
    background: #c53a2c;
}

.route-point-marker:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.route-point-marker.is-selected .route-point-marker-badge {
    transform: scale(1.12);
    box-shadow: 0 0 0 3px rgba(59, 141, 173, 0.2), 0 10px 22px rgba(23, 49, 59, 0.22);
}

.maplibregl-popup.poi-hover-popup,
.maplibregl-popup.poi-hover-popup .maplibregl-popup-content,
.maplibregl-popup.route-point-popup,
.maplibregl-popup.route-point-popup .maplibregl-popup-content {
    pointer-events: auto;
}

.popup-card {
    display: grid;
    gap: 10px;
    min-width: 190px;
}

.popup {
    display: grid;
    gap: 10px;
    min-width: 220px;
}

.popup-cluster {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, auto);
    gap: 12px;
    align-items: start;
    max-width: min(82vw, 760px);
    overflow-x: auto;
    padding-bottom: 2px;
}

.popup-cluster-item {
    min-width: 0;
    display: grid;
    gap: 10px;
    align-content: start;
}

.popup-add-action {
    justify-self: stretch;
    text-align: center;
    background: rgba(31, 111, 98, 0.14);
    color: var(--accent-strong);
}

.popup-venue-media {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
}

.popup-venue-copy {
    display: grid;
    gap: 4px;
}

.popup-thumb {
    width: 68px;
    height: 68px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(23, 49, 59, 0.08);
}

.popup-hours-list {
    display: grid;
    gap: 4px;
    font-size: 0.92rem;
}

.popup-hours-list div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
}

.popup-action {
    justify-self: start;
    background: rgba(160, 47, 47, 0.12);
    color: var(--danger);
    box-shadow: none;
}

[hidden] {
    display: none !important;
}

@media (hover: none) and (pointer: coarse) {
    input,
    select,
    textarea {
        font-size: 16px;
        min-height: 48px;
    }

    .drawer-toggle,
    .icon-button,
    .ghost-button,
    .file-button,
    .popup-action {
        min-height: 46px;
        padding: 12px 18px;
    }

    .route-point-marker {
        width: 48px;
        height: 48px;
    }

    .route-point-marker-stack {
        width: 34px;
        height: 34px;
    }

    .route-point-marker-badge {
        width: 30px;
        height: 30px;
        font-size: 0.82rem;
    }

}
@media (max-width: 900px) {
    .app-shell.drawer-open {
        --drawer-width: min(86vw, 360px);
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .section-heading {
        grid-template-columns: 1fr;
        display: grid;
    }

    .trip-toolbar {
        top: 12px;
        left: 12px;
        right: 12px;
        transform: none;
        width: auto;
        max-width: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trip-clearance-field {
        grid-column: 1 / -1;
    }

    .day-plan-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .day-sync-toggle {
        align-items: flex-start;
    }

    .day-select-field,
    .day-time-field {
        min-width: 0;
    }

    .action-stack {
        flex-direction: column;
        align-items: stretch;
    }

    .segmented-control {
        flex-wrap: wrap;
    }

    .drawer-toggle {
        top: 116px;
        left: 12px;
    }

    .map-stage {
        --map-control-offset-top: 116px;
        --map-control-offset-right: 12px;
    }

    .map-toolbar {
        align-items: stretch;
    }

    .map-stage {
        --itinerary-height: min(56vh, 470px);
    }

    .itinerary-drawer {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .route-status,
    .itinerary-toggle {
        max-width: calc(100% - 36px);
    }

    .map-stage.itinerary-open .route-status,
    .map-stage.itinerary-open .itinerary-toggle {
        bottom: calc(var(--itinerary-height) + 24px);
    }
}



























