* {
    box-sizing: border-box;
}

:root {
    --line: #e3e2d9;
    --pine: #31564a;
    --pine-dark: #233f35;
    --coral: #d7604d;
    --sun: #e3b75b;
    --shadow: 0 14px 36px rgba(38, 48, 41, 0.07);
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f7f1 0%, var(--bg) 60%, #eef0e8 100%);
    color: var(--text);
    font-family: "Trebuchet MS", "Lucida Sans Unicode", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(215, 96, 77, 0.45);
    outline-offset: 3px;
}

button[hidden],
[hidden] {
    display: none !important;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    height: 72px;
    align-items: center;
    gap: 12px;
    padding: 0 clamp(18px, 4vw, 54px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 254, 250, 0.94);
    backdrop-filter: blur(14px);
}

.topbar-start,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-start {
    grid-column: 1;
    justify-self: start;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    grid-column: 2;
    justify-self: center;
    color: var(--text);
    font-size: 1.12rem;
    font-weight: 700;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px 11px 11px 3px;
    background: var(--coral);
    color: white;
    font-family: Georgia, serif;
    font-size: 1.35rem;
    font-style: italic;
}

.topbar-actions {
    grid-column: 3;
    justify-self: end;
}

.topbar button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    cursor: pointer;
}

.header-command,
.auth-login {
    padding: 0 12px;
    background: transparent;
    color: var(--text);
}

.header-command {
    font-size: 0.78rem;
    white-space: nowrap;
}

.new-trip-toggle {
    color: var(--pine);
    font-weight: 700;
}

.topbar-share {
    color: var(--muted);
}

.header-command svg,
.topbar-actions svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.topbar-share:hover,
.auth-login:hover {
    color: var(--coral);
}

.auth-create {
    padding: 0 16px;
    border-radius: 5px;
    background: var(--pine);
    color: white;
    font-weight: 700;
}

.auth-create:hover,
.action-button:hover {
    background: var(--pine-dark);
}

.notification-wrap {
    position: relative;
}

.icon-button {
    position: relative;
    width: 40px;
    padding: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
}

.icon-button:hover {
    background: #f0efe8;
}

.notification-count {
    position: absolute;
    top: 2px;
    right: 2px;
    display: grid;
    min-width: 16px;
    height: 16px;
    place-items: center;
    padding: 0 3px;
    border: 2px solid var(--panel);
    border-radius: 10px;
    background: var(--coral);
    color: white;
    font-size: 0.57rem;
    font-weight: 700;
}

.notification-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: -54px;
    z-index: 8;
    width: min(340px, calc(100vw - 24px));
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.notification-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.notification-heading h2 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 1.15rem;
    font-weight: 400;
}

.notification-heading button {
    border: 0;
    background: transparent;
    color: var(--pine);
    cursor: pointer;
    font-size: 0.68rem;
}

.notification-list {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.notification-item {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #eeede7;
}

.notification-item:last-child {
    padding-bottom: 2px;
    border-bottom: 0;
}

.notification-dot {
    width: 7px;
    height: 7px;
    margin-top: 6px;
    border-radius: 50%;
    background: transparent;
}

.notification-item.is-unread .notification-dot {
    background: var(--coral);
}

.notification-item div {
    display: grid;
    gap: 3px;
}

.notification-item strong {
    font-size: 0.75rem;
}

.notification-item small {
    color: var(--muted);
    font-size: 0.65rem;
}

.new-trip-panel {
    position: sticky;
    top: 72px;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(150px, 0.65fr) minmax(0, 2fr);
    align-items: center;
    gap: 20px;
    padding: 18px clamp(18px, 4vw, 54px);
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 8px 20px rgba(38, 48, 41, 0.06);
}

.new-trip-heading h2 {
    margin: 2px 0 0;
    font-family: Georgia, serif;
    font-size: 1.35rem;
    font-weight: 400;
}

.new-trip-form {
    display: grid;
    grid-template-columns: 1.25fr 1.25fr 0.9fr 0.9fr auto;
    align-items: end;
    gap: 10px;
}

.new-trip-form label {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.new-trip-form label span {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 700;
}

.new-trip-form input {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: white;
    color: var(--text);
    font-size: 0.72rem;
}

.new-trip-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.new-trip-actions p {
    display: none;
}

.new-trip-actions p:not(:empty) {
    display: block;
    position: absolute;
    top: 100%;
    right: 20px;
    margin: 0;
    padding: 7px 10px;
    background: var(--pine-dark);
    color: white;
    font-size: 0.7rem;
}

.new-trip-actions button {
    min-height: 38px;
    white-space: nowrap;
}

.cancel-trip {
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.7rem;
}

.workspace {
    display: block;
    min-height: calc(100vh - 72px);
}

.sidebar {
    position: sticky;
    top: 72px;
    display: flex;
    height: calc(100vh - 72px);
    min-height: 520px;
    flex-direction: column;
    padding: 30px 16px 18px;
    border-right: 1px solid var(--line);
    background: rgba(255, 254, 250, 0.62);
}

.sidebar-trip {
    display: grid;
    gap: 3px;
    margin: 0 5px 30px;
}

.sidebar-trip strong {
    margin-top: 5px;
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: 500;
}

.sidebar-trip > span:last-child {
    color: var(--muted);
    font-size: 0.79rem;
}

.eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.09em;
}

.section-nav {
    display: grid;
    gap: 5px;
}

.mobile-nav {
    display: none;
}

.nav-tab {
    display: flex;
    min-height: 45px;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #616d66;
    cursor: pointer;
    text-align: left;
}

.nav-tab:hover {
    background: rgba(49, 86, 74, 0.07);
}

.nav-tab.is-active {
    background: #e8eee8;
    color: var(--pine-dark);
    font-weight: 700;
}

.nav-number {
    color: #9aa39b;
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
}

.nav-tab.is-active .nav-number {
    color: var(--coral);
}

.nav-label {
    font-size: 0.86rem;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: auto 5px 0;
    padding-top: 17px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.76rem;
}

.avatar-stack {
    display: flex;
    padding-left: 4px;
}

.avatar-stack span,
.person-avatar {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid var(--panel);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
}

.avatar-stack span + span {
    margin-left: -7px;
}

.avatar-stack span:nth-child(1),
.avatar-coral {
    background: #f0c3b4;
    color: #834638;
}

.avatar-stack span:nth-child(2),
.avatar-green {
    background: #c5d6c6;
    color: #365341;
}

.avatar-stack span:nth-child(3),
.avatar-yellow {
    background: #efdfa9;
    color: #735d24;
}

.main-content {
    width: min(100%, 1420px);
    min-width: 0;
    margin: 0 auto;
    padding: 34px clamp(22px, 4vw, 58px) 60px;
}

.view-panel {
    animation: panel-in 220ms ease both;
}

@keyframes panel-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-heading {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.view-heading h1,
.modal-card h2 {
    margin: 2px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.75rem, 2.4vw, 2.35rem);
    font-weight: 400;
    line-height: 1.12;
}

.demo-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #e8d9c9;
    border-radius: 3px;
    background: #f8eee2;
    color: #8d5f42;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.trip-hero {
    position: relative;
    min-height: 335px;
    overflow: hidden;
    background: #435d4f;
    color: white;
}

.trip-hero::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(19, 34, 29, 0.76), rgba(19, 34, 29, 0.12) 76%), linear-gradient(0deg, rgba(19, 34, 29, 0.26), transparent 50%);
    content: "";
}

.trip-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 52%;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 335px;
    max-width: 510px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 34px clamp(24px, 5vw, 62px);
}

.hero-date {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.hero-content h2 {
    margin: 9px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.7rem, 5vw, 4.5rem);
    font-weight: 400;
    line-height: 0.98;
}

.hero-content p {
    margin: 9px 0 19px;
    font-size: 1rem;
}

.hero-link {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 18px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
}

.hero-link:hover {
    background: rgba(255, 255, 255, 0.22);
}

.hero-weather {
    position: absolute;
    z-index: 1;
    top: 20px;
    right: 22px;
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    column-gap: 6px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(24, 44, 37, 0.32);
    font-size: 0.9rem;
}

.hero-weather > span {
    color: #f4d378;
}

.hero-weather small {
    grid-column: 2;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.62rem;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 20px 0 24px;
    border: 1px solid var(--line);
    background: rgba(255, 254, 250, 0.65);
}

.stat-item {
    display: grid;
    gap: 3px;
    padding: 15px 20px;
}

.stat-item + .stat-item {
    border-left: 1px solid var(--line);
}

.stat-item > span {
    color: var(--muted);
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.stat-item strong {
    font-size: 0.98rem;
}

.stat-item strong small {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 400;
}

.stat-item > small {
    color: var(--muted);
    font-size: 0.72rem;
}

.overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr);
    gap: 18px;
    align-items: start;
}

.side-stack {
    display: grid;
    gap: 16px;
}

.surface {
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel);
}

.itinerary-surface,
.crew-surface,
.packing-surface,
.route-surface,
.planner-surface,
.checklist-surface,
.budget-surface,
.balance-surface,
.expense-surface {
    padding: 20px;
}

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

.surface-heading h2,
.checklist-summary h2 {
    margin: 2px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 400;
}

.text-action {
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: var(--pine);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.text-action:hover {
    color: var(--coral);
}

.timeline-row {
    display: grid;
    grid-template-columns: 48px 11px minmax(0, 1fr) auto;
    min-height: 72px;
    align-items: center;
    gap: 11px;
    border-top: 1px solid #eeede7;
}

.timeline-time {
    color: var(--muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.timeline-dot {
    width: 9px;
    height: 9px;
    border: 2px solid var(--coral);
    border-radius: 50%;
}

.timeline-row:nth-of-type(3) .timeline-dot {
    border-color: var(--sun);
}

.timeline-row div,
.crew-row div {
    display: grid;
    gap: 2px;
}

.timeline-row strong,
.crew-row strong {
    font-size: 0.82rem;
}

.timeline-row small,
.crew-row small {
    color: var(--muted);
    font-size: 0.7rem;
}

.timeline-state {
    color: var(--pine);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.timeline-state.is-optional {
    color: #9a7a32;
}

.count-badge {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    background: #e8eee8;
    color: var(--pine);
    font-size: 0.73rem;
    font-weight: 700;
}

.crew-row {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 10px;
}

.crew-row .person-avatar {
    border: 0;
}

.presence-dot {
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-radius: 50%;
    background: #6a9a70;
}

.presence-dot.is-away {
    background: #c6c8c0;
}

.packing-surface .surface-heading {
    margin-bottom: 15px;
}

.progress-copy,
.budget-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.72rem;
}

.progress-copy strong {
    color: var(--text);
    font-size: 0.76rem;
}

.progress-track,
.budget-track {
    height: 7px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 10px;
    background: #e8e9e1;
}

.progress-track span,
.budget-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--pine);
    transition: width 180ms ease;
}

.muted-copy {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.5;
}

.action-button {
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 4px;
    background: var(--pine);
    color: white;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
    gap: 18px;
    align-items: stretch;
}

.map-stage {
    position: relative;
    min-height: 510px;
    overflow: hidden;
    border: 1px solid #d8ded1;
    background-color: #e9eee4;
    background-image: linear-gradient(28deg, transparent 47%, rgba(255, 254, 250, 0.8) 48%, rgba(255, 254, 250, 0.8) 51%, transparent 52%), linear-gradient(112deg, transparent 46%, rgba(255, 254, 250, 0.8) 47%, rgba(255, 254, 250, 0.8) 50%, transparent 51%), repeating-linear-gradient(0deg, transparent 0 59px, rgba(75, 111, 84, 0.07) 60px), repeating-linear-gradient(90deg, transparent 0 59px, rgba(75, 111, 84, 0.07) 60px);
}

.map-stage svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.map-road {
    fill: none;
    stroke: rgba(255, 254, 250, 0.84);
    stroke-linecap: round;
    stroke-width: 13;
}

.map-route {
    fill: none;
    stroke: var(--coral);
    stroke-dasharray: 4 9;
    stroke-linecap: round;
    stroke-width: 4;
}

.map-route-query {
    fill: none;
    stroke: var(--pine-dark);
    stroke-dasharray: 2 7;
    stroke-linecap: round;
    stroke-width: 3;
    opacity: 0.78;
}

.map-stop {
    fill: var(--panel);
    stroke: var(--coral);
    stroke-width: 4;
}

.map-stop-end {
    fill: var(--coral);
    stroke: var(--panel);
}

.map-label {
    position: absolute;
    z-index: 1;
    padding: 4px 7px;
    border: 1px solid rgba(49, 86, 74, 0.13);
    border-radius: 3px;
    background: rgba(255, 254, 250, 0.9);
    color: var(--pine-dark);
    font-size: 0.67rem;
    font-weight: 700;
}

.label-la-spezia { left: 8%; bottom: 23%; }
.label-riomaggiore { left: 29%; bottom: 43%; }
.label-manarola { left: 46%; bottom: 54%; }
.label-vernazza { right: 21%; top: 21%; }
.label-levanto { right: 4%; top: 38%; }

.map-compass {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    width: 34px;
    height: 42px;
    place-content: center;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--pine);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
}

.route-surface {
    align-self: stretch;
}

.route-list {
    display: grid;
    gap: 0;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.route-list li {
    display: flex;
    min-height: 68px;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #eeede7;
}

.route-number {
    color: var(--coral);
    font-size: 0.7rem;
    font-weight: 700;
}

.route-list li div {
    display: grid;
    gap: 2px;
}

.route-list strong {
    font-size: 0.82rem;
}

.route-list small {
    color: var(--muted);
    font-size: 0.7rem;
}

.day-selector {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    overflow-x: auto;
}

.day-button {
    display: grid;
    min-width: 145px;
    min-height: 64px;
    align-content: center;
    gap: 3px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
    cursor: pointer;
    text-align: left;
}

.day-button span {
    color: var(--muted);
    font-size: 0.59rem;
    font-weight: 700;
    letter-spacing: 0.07em;
}

.day-button strong {
    font-size: 0.8rem;
}

.day-button.is-selected {
    border-color: var(--pine);
    background: #e8eee8;
    color: var(--pine-dark);
}

.planner-day-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
}

.day-number {
    color: var(--coral);
    font-family: Georgia, serif;
    font-size: 2.4rem;
    line-height: 1;
}

.planner-day-label div {
    display: grid;
    gap: 2px;
}

.planner-day-label strong {
    font-size: 0.86rem;
}

.planner-day-label small,
.weather-note {
    color: var(--muted);
    font-size: 0.72rem;
}

.weather-note {
    margin-left: auto;
}

.planner-event {
    display: grid;
    grid-template-columns: 49px 12px minmax(0, 1fr) 32px;
    min-height: 94px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #eeede7;
}

.planner-event time {
    color: var(--muted);
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
}

.event-marker {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--coral);
    box-shadow: 0 0 0 4px #f7e9e4;
}

.marker-stay { background: var(--pine); box-shadow: 0 0 0 4px #e8eee8; }
.marker-walk { background: #c39b45; box-shadow: 0 0 0 4px #f5efd9; }
.marker-food { background: #bd7953; box-shadow: 0 0 0 4px #f6e8df; }

.event-type {
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.07em;
}

.planner-event h2 {
    margin: 2px 0;
    font-size: 0.88rem;
}

.planner-event p {
    margin: 0;
    color: var(--muted);
    font-size: 0.73rem;
}

.event-menu {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.event-menu:hover {
    background: #f1f0e9;
}

.checklist-switch {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.checklist-tab {
    display: inline-flex;
    min-height: 43px;
    align-items: center;
    gap: 8px;
    padding: 0 2px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.84rem;
}

.checklist-tab span {
    display: grid;
    min-width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 50%;
    background: #eeeee7;
    font-size: 0.65rem;
}

.checklist-tab.is-selected {
    border-color: var(--coral);
    color: var(--text);
    font-weight: 700;
}

.checklist-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.check-summary-count {
    color: var(--pine);
    font-size: 0.83rem;
    font-weight: 700;
}

.check-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    min-height: 66px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #eeede7;
    cursor: pointer;
}

.check-item input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.check-box {
    display: grid;
    width: 19px;
    height: 19px;
    place-items: center;
    border: 1px solid #bdc5bb;
    border-radius: 3px;
    background: var(--panel);
}

.check-item input:checked + .check-box {
    border-color: var(--pine);
    background: var(--pine);
}

.check-item input:checked + .check-box::after {
    width: 8px;
    height: 5px;
    border-bottom: 2px solid white;
    border-left: 2px solid white;
    content: "";
    transform: translateY(-1px) rotate(-45deg);
}

.check-item input:focus-visible + .check-box {
    outline: 3px solid rgba(215, 96, 77, 0.45);
    outline-offset: 2px;
}

.check-item > span:nth-of-type(2) {
    display: grid;
    gap: 2px;
}

.check-item strong {
    font-size: 0.83rem;
}

.check-item small {
    color: var(--muted);
    font-size: 0.7rem;
}

.check-item.is-done strong {
    color: #889088;
    text-decoration: line-through;
}

.check-owner {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    background: #e8eee8;
    color: var(--pine);
    font-size: 0.67rem;
    font-weight: 700;
}

.task-priority {
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.check-item:has(input:checked) .task-priority {
    color: var(--pine);
}

.cost-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.budget-surface,
.balance-surface {
    min-height: 185px;
}

.budget-surface .eyebrow span {
    margin-left: 5px;
    color: var(--coral);
}

.budget-amount {
    margin-top: 7px;
    font-family: Georgia, serif;
    font-size: 2.25rem;
    line-height: 1.2;
}

.budget-amount small {
    color: var(--muted);
    font-family: "Trebuchet MS", "Lucida Sans Unicode", sans-serif;
    font-size: 0.76rem;
}

.budget-track span {
    width: 40%;
    background: var(--coral);
}

.budget-legend {
    margin-top: 8px;
}

.budget-legend span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-planned {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--coral);
}

.balance-note {
    margin: 7px 0 4px;
    color: var(--pine);
    font-size: 0.74rem;
}

.filter-button {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    font-size: 0.75rem;
}

.expense-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 70px;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #eeede7;
}

.expense-symbol {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 4px;
    font-family: Georgia, serif;
    font-size: 1.05rem;
}

.symbol-stay { background: #f3e5dc; color: #a45b40; }
.symbol-travel { background: #e4ede7; color: var(--pine); }
.symbol-food { background: #f2ecd5; color: #92782c; }

.expense-row div {
    display: grid;
    gap: 3px;
}

.expense-row div strong,
.expense-value {
    font-size: 0.81rem;
}

.expense-row small {
    color: var(--muted);
    font-size: 0.68rem;
}

.modal-layer {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    background: rgba(23, 33, 28, 0.58);
    backdrop-filter: blur(5px);
}

.modal-layer.is-open {
    animation: modal-in 150ms ease both;
}

@keyframes modal-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    position: relative;
    width: min(100%, 620px);
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    background: var(--panel);
    box-shadow: 0 24px 70px rgba(14, 24, 18, 0.28);
}

.modal-card h2 {
    margin-top: 6px;
    font-size: 1.9rem;
}

.modal-close {
    position: absolute;
    top: 17px;
    right: 17px;
    min-height: 34px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.74rem;
}

.modal-intro {
    max-width: 440px;
    margin: 9px 0 20px;
    color: var(--muted);
    font-size: 0.84rem;
}

.share-content {
    display: grid;
    grid-template-columns: 184px minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: #f5f4ee;
}

.share-qr {
    width: 184px;
    height: 184px;
    padding: 8px;
    background: white;
}

.share-qr img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.share-details {
    display: grid;
    justify-items: start;
    gap: 12px;
    min-width: 0;
}

.share-link {
    color: var(--pine);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.pin-label {
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.pin-code {
    color: var(--coral);
    font-family: Georgia, serif;
    font-size: 1.8rem;
    letter-spacing: 0.08em;
}

.join-form,
.account-form {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.join-form label,
.account-form label {
    font-size: 0.75rem;
    font-weight: 700;
}

.join-form > div {
    display: flex;
    gap: 8px;
}

.join-form input,
.account-form input {
    width: 100%;
    min-width: 0;
    min-height: 43px;
    padding: 0 12px;
    border: 1px solid #d9dbd2;
    border-radius: 3px;
    background: white;
    color: var(--text);
}

.join-form button {
    min-width: 108px;
    border: 0;
    border-radius: 3px;
    background: var(--pine);
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
}

.account-card {
    width: min(100%, 420px);
}

.account-form {
    gap: 8px;
    margin-top: 20px;
}

.account-form label:not(:first-child) {
    margin-top: 8px;
}

.account-form .action-button {
    width: 100%;
    margin-top: 8px;
}

.form-message {
    min-height: 1.25em;
    margin: 2px 0 0;
    color: var(--pine);
    font-size: 0.75rem;
}

@media (max-width: 1000px) {
    .workspace {
        grid-template-columns: 184px minmax(0, 1fr);
    }

    .sidebar {
        padding-right: 10px;
        padding-left: 10px;
    }

    .main-content {
        padding-right: 22px;
        padding-left: 22px;
    }

    .overview-grid,
    .map-layout {
        grid-template-columns: minmax(0, 1.25fr) minmax(245px, 0.85fr);
        gap: 12px;
    }

    .itinerary-surface,
    .crew-surface,
    .packing-surface,
    .route-surface {
        padding: 16px;
    }

    .timeline-row {
        grid-template-columns: 42px 10px minmax(0, 1fr);
        gap: 8px;
    }

    .timeline-state {
        display: none;
    }
}

@media (max-width: 800px) {
    .workspace {
        display: block;
        min-height: calc(100vh - 66px);
    }

    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
        padding: 26px 22px 36px;
    }

    .new-trip-panel {
        position: relative;
        top: auto;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 16px 22px;
    }

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

    .new-trip-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .mobile-nav {
        position: fixed;
        z-index: 10;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0;
        padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: rgba(255, 254, 250, 0.97);
        box-shadow: 0 -7px 24px rgba(30, 43, 35, 0.08);
        backdrop-filter: blur(12px);
    }

    .mobile-nav .nav-tab {
        min-width: 0;
        min-height: 54px;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        padding: 4px 2px;
        border-radius: 4px;
        text-align: center;
    }

    .mobile-nav .nav-number {
        display: none;
    }

    .mobile-nav .nav-label {
        max-width: 100%;
        font-size: 0.62rem;
        line-height: 1.16;
        overflow-wrap: anywhere;
    }

    .mobile-nav .nav-tab:nth-child(4) .nav-label {
        max-width: 74px;
    }

    .overview-grid,
    .map-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .side-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .map-stage {
        min-height: 420px;
    }
}

@media (max-width: 560px) {
    .topbar {
        height: 62px;
        gap: 4px;
        padding: 0 8px;
    }

    .topbar-start,
    .topbar-actions {
        gap: 2px;
    }

    .header-command,
    .topbar-actions button {
        width: 34px;
        min-width: 34px;
        min-height: 36px;
        padding: 0;
    }

    .button-label,
    .brand-name {
        display: none;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .auth-create {
        max-width: none;
        border-radius: 4px;
    }

    .main-content {
        padding: 22px 14px 36px;
    }

    .view-heading {
        min-height: 48px;
        margin-bottom: 16px;
    }

    .view-heading h1 {
        font-size: 1.8rem;
    }

    .demo-tag {
        padding: 6px 7px;
        font-size: 0.53rem;
    }

    .trip-hero,
    .hero-content {
        min-height: 310px;
    }

    .trip-hero img {
        object-position: 57% center;
    }

    .hero-content {
        padding: 26px 22px;
    }

    .hero-content h2 {
        font-size: 3rem;
    }

    .hero-weather {
        top: 12px;
        right: 12px;
        padding: 7px 9px;
    }

    .stats-strip {
        margin: 13px 0 16px;
    }

    .stat-item {
        gap: 2px;
        padding: 11px 8px;
    }

    .stat-item > span {
        min-height: 25px;
        font-size: 0.52rem;
        line-height: 1.2;
    }

    .stat-item strong {
        font-size: 0.76rem;
    }

    .stat-item strong small {
        display: block;
        font-size: 0.62rem;
    }

    .stat-item > small {
        font-size: 0.59rem;
    }

    .side-stack {
        grid-template-columns: minmax(0, 1fr);
    }

    .itinerary-surface,
    .crew-surface,
    .packing-surface,
    .route-surface,
    .planner-surface,
    .checklist-surface,
    .budget-surface,
    .balance-surface,
    .expense-surface {
        padding: 15px;
    }

    .timeline-row {
        grid-template-columns: 39px 9px minmax(0, 1fr);
        min-height: 68px;
        gap: 8px;
    }

    .timeline-row strong {
        font-size: 0.75rem;
    }

    .timeline-row small {
        font-size: 0.64rem;
    }

    .surface-heading h2,
    .checklist-summary h2 {
        font-size: 1.2rem;
    }

    .map-stage {
        min-height: 340px;
    }

    .map-label {
        padding: 3px 5px;
        font-size: 0.57rem;
    }

    .day-button {
        min-width: 130px;
    }

    .planner-day-label {
        gap: 8px;
    }

    .weather-note {
        font-size: 0.62rem;
        text-align: right;
    }

    .planner-event {
        grid-template-columns: 40px 10px minmax(0, 1fr) 28px;
        min-height: 90px;
        gap: 8px;
    }

    .planner-event h2 {
        font-size: 0.77rem;
    }

    .planner-event p {
        font-size: 0.65rem;
    }

    .cost-overview {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .budget-surface,
    .balance-surface {
        min-height: 0;
    }

    .modal-layer {
        align-items: flex-end;
        padding: 10px;
    }

    .modal-card {
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        padding: 24px 18px 20px;
        border-radius: 7px 7px 4px 4px;
    }

    .modal-card h2 {
        font-size: 1.65rem;
    }

    .share-content {
        grid-template-columns: 126px minmax(0, 1fr);
        gap: 12px;
        padding: 10px;
    }

    .share-qr {
        width: 126px;
        height: 126px;
        padding: 5px;
    }

    .pin-code {
        font-size: 1.5rem;
    }

    .join-form > div {
        flex-direction: column;
    }

    .join-form button {
        min-height: 42px;
    }
}

html[data-device="tablet"] .workspace {
    display: block;
}

html[data-device="tablet"] .mobile-nav {
    display: none;
}

html[data-device="tablet"] .main-content {
    padding-right: 18px;
    padding-left: 18px;
}

html[data-device="tablet"] .side-stack {
    grid-template-columns: minmax(0, 1fr);
}

html[data-device="phone"] .workspace {
    display: block;
}

html[data-device="phone"] .sidebar {
    display: none;
}

html[data-device="phone"] .main-content {
    padding-bottom: 36px;
}

html[data-device="phone"] .mobile-nav {
    position: fixed;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 254, 250, 0.97);
    box-shadow: 0 -7px 24px rgba(30, 43, 35, 0.08);
    backdrop-filter: blur(12px);
}

html[data-device="phone"] .mobile-nav .nav-tab {
    min-width: 0;
    min-height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    text-align: center;
}

html[data-device="phone"] .mobile-nav .nav-number {
    display: none;
}

html[data-device="phone"] .mobile-nav .nav-label {
    max-width: 100%;
    font-size: 0.62rem;
    line-height: 1.16;
    overflow-wrap: anywhere;
}

html[data-device="phone"] .topbar {
    height: 62px;
    gap: 4px;
    padding: 0 8px;
}

html[data-device="phone"] .topbar-start,
html[data-device="phone"] .topbar-actions {
    gap: 2px;
}

html[data-device="phone"] .header-command,
html[data-device="phone"] .topbar-actions button {
    width: 34px;
    min-width: 34px;
    min-height: 36px;
    padding: 0;
}

html[data-device="phone"] .button-label,
html[data-device="phone"] .brand-name {
    display: none;
}

html[data-device="phone"] .brand-mark {
    width: 30px;
    height: 30px;
}

html[data-device="tablet"] .topbar {
    padding-right: 22px;
    padding-left: 22px;
}

.trip-menu-wrap {
    position: relative;
}

.trip-menu-toggle {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 3px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--pine-dark);
    cursor: pointer;
    text-align: left;
}

.trip-menu-toggle:hover {
    background: #f0efe8;
}

.hamburger-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.trip-switch-copy {
    display: grid;
    gap: 1px;
}

.trip-switch-copy > span {
    color: var(--muted);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.trip-switch-copy strong {
    font-size: 0.77rem;
}

.trip-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 9;
    width: min(290px, calc(100vw - 20px));
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.trip-menu-current {
    display: grid;
    gap: 3px;
    padding: 2px 3px 12px;
    border-bottom: 1px solid var(--line);
}

.trip-menu-current strong {
    font-family: Georgia, serif;
    font-size: 1.2rem;
    font-weight: 400;
}

.trip-menu-current > span {
    color: var(--muted);
    font-size: 0.69rem;
}

.trip-menu-links {
    display: grid;
    gap: 3px;
    padding-top: 9px;
}

.trip-menu-links button {
    min-height: 38px;
    padding: 0 8px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 0.76rem;
    text-align: left;
}

.trip-menu-links button:hover {
    background: #eff1e9;
    color: var(--pine);
}

.auth-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 18px 0 14px;
    border-bottom: 1px solid var(--line);
}

.auth-mode-switch button {
    min-height: 42px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.8rem;
}

.auth-mode-switch button.is-selected {
    border-color: var(--coral);
    color: var(--text);
    font-weight: 700;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.shared-notice {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: -7px 0 14px;
    color: var(--pine);
    font-size: 0.74rem;
    font-weight: 700;
}

.shared-notice span {
    color: var(--muted);
    font-weight: 400;
}

.shared-tag {
    padding: 4px 7px;
    border-radius: 3px;
    background: #e8eee8;
    color: var(--pine);
    font-size: 0.57rem;
    font-weight: 700;
    letter-spacing: 0.07em;
}

.planner-ideas,
.shared-budget-surface,
.settlement-surface {
    margin-top: 16px;
    padding: 20px;
}

.idea-list {
    display: grid;
}

.idea-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 36px;
    min-height: 58px;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #eeede7;
}

.idea-avatar {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 700;
}

.avatar-you {
    background: #e7e2d3;
    color: #665a3e;
}

.idea-item > div {
    display: grid;
    gap: 2px;
}

.idea-item strong {
    font-size: 0.79rem;
}

.idea-item small {
    color: var(--muted);
    font-size: 0.66rem;
}

.idea-vote {
    display: flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.7rem;
}

.idea-vote.is-voted,
.idea-vote[aria-pressed="true"] {
    border-color: #e2bdb2;
    background: #f8ebe7;
    color: var(--coral);
}

.idea-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.idea-form input,
.chat-form textarea {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: white;
    color: var(--text);
    font: inherit;
    font-size: 0.77rem;
}

.idea-form input {
    min-height: 40px;
}

.idea-form .action-button,
.chat-form .action-button {
    min-height: 40px;
    white-space: nowrap;
}

.chat-layout {
    display: grid;
    grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1.8fr);
    gap: 16px;
    align-items: start;
}

.chat-people {
    display: grid;
    gap: 4px;
    padding: 17px;
}

.chat-people > .eyebrow {
    margin: 0 0 5px 3px;
}

.chat-person {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 8px;
    min-height: 49px;
    align-items: center;
    gap: 9px;
}

.chat-person div {
    display: grid;
    gap: 2px;
}

.chat-person strong {
    font-size: 0.76rem;
}

.chat-person small {
    color: var(--muted);
    font-size: 0.65rem;
}

.chat-thread {
    display: flex;
    min-height: 520px;
    flex-direction: column;
    padding: 16px;
}

.chat-messages {
    display: grid;
    flex: 1 1 auto;
    align-content: start;
    gap: 12px;
    max-height: 470px;
    min-height: 300px;
    overflow-y: auto;
    padding: 2px 2px 16px;
}

.chat-message {
    width: fit-content;
    max-width: min(86%, 520px);
    padding: 10px 12px;
    border: 1px solid #eeede7;
    border-radius: 5px 5px 5px 1px;
    background: #f7f6f0;
}

.chat-message.is-own {
    justify-self: end;
    border-color: #dce7dc;
    border-radius: 5px 5px 1px 5px;
    background: #eaf0e9;
}

.chat-message-meta {
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.chat-message-meta strong {
    color: var(--pine);
    font-size: 0.7rem;
}

.chat-message-meta time {
    color: var(--muted);
    font-size: 0.59rem;
}

.chat-message p {
    margin: 4px 0 0;
    font-size: 0.77rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.chat-form textarea {
    min-height: 42px;
    max-height: 110px;
    resize: vertical;
}

.chat-poll-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #f8f7f1;
}

.poll-form-heading,
.poll-form-actions {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.poll-form-heading strong {
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 400;
}

.chat-poll-form label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 700;
}

.chat-poll-form label:first-of-type {
    grid-column: 1 / -1;
}

.chat-poll-form label > span {
    font-weight: 400;
}

.chat-poll-form input {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: white;
    color: var(--text);
    font: inherit;
    font-size: 0.73rem;
}

.poll-form-actions output {
    flex: 1 1 auto;
    color: var(--coral);
    font-size: 0.68rem;
}

.chat-polls {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.chat-poll {
    width: min(100%, 520px);
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fffefa;
}

.chat-poll-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.chat-poll-heading h2 {
    margin: 2px 0 0;
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 400;
}

.poll-total {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.62rem;
}

.poll-options {
    display: grid;
    gap: 6px;
}

.poll-option {
    display: grid;
    width: 100%;
    gap: 5px;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: #fffefa;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.poll-option:hover,
.poll-option.is-selected {
    border-color: #9fb3a1;
    background: #eff3ed;
}

.poll-option-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.poll-option-label {
    min-width: 0;
    font-size: 0.73rem;
    overflow-wrap: anywhere;
}

.poll-option-heading strong {
    color: var(--pine);
    font-size: 0.68rem;
}

.poll-option-track {
    display: block;
    height: 4px;
    overflow: hidden;
    border-radius: 4px;
    background: #e8e9e1;
}

.poll-option-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--pine);
    transition: width 180ms ease;
}

.poll-option small {
    color: var(--muted);
    font-size: 0.58rem;
}

.budget-category-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
    max-width: 650px;
    margin-bottom: 14px;
}

.budget-category-list > div {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #eeede7;
    font-size: 0.74rem;
}

.budget-category-list > div span {
    color: var(--muted);
}

.budget-category-total {
    font-weight: 700;
}

.budget-category-total span {
    color: var(--text) !important;
}

.budget-people-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
}

.budget-person-row,
.settlement-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    min-height: 60px;
    align-items: center;
    gap: 9px;
    padding: 5px 10px 5px 0;
}

.budget-person-row > div,
.settlement-row > div {
    display: grid;
    gap: 2px;
}

.budget-person-row strong,
.settlement-row strong {
    font-size: 0.75rem;
}

.budget-person-row small,
.settlement-row small {
    color: var(--muted);
    font-size: 0.63rem;
}

.settlement-share {
    color: var(--muted);
    font-size: 0.68rem;
}

.settlement-row {
    border-top: 1px solid #eeede7;
}

.balance-positive {
    color: var(--pine);
}

.balance-due {
    color: var(--coral);
}

@media (max-width: 800px) {
    .chat-layout {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .chat-people > .eyebrow {
        grid-column: 1 / -1;
    }

    .budget-people-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

html[data-device="phone"] .trip-switch-copy {
    display: none;
}

html[data-device="phone"] .trip-menu-toggle {
    width: 34px;
    min-height: 36px;
    justify-content: center;
    padding: 0;
}

html[data-device="phone"] .chat-thread {
    min-height: 65vh;
    padding: 12px;
}

html[data-device="phone"] .chat-messages {
    min-height: 260px;
}

html[data-device="phone"] .chat-poll-form {
    grid-template-columns: minmax(0, 1fr);
}

html[data-device="phone"] .poll-form-heading,
html[data-device="phone"] .poll-form-actions,
html[data-device="phone"] .chat-poll-form label:first-of-type {
    grid-column: 1;
}

html[data-device="phone"] .budget-category-list {
    gap: 0 12px;
}

html[data-device="phone"] .budget-category-list > div {
    font-size: 0.68rem;
}

.map-added-stops {
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
}

.map-added-marker {
    position: absolute;
    max-width: 120px;
    padding: 4px 7px 4px 18px;
    border: 1px solid rgba(49, 86, 74, 0.2);
    border-radius: 3px;
    background: var(--panel);
    color: var(--pine-dark);
    font-size: 0.62rem;
    font-weight: 700;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.map-added-marker::before {
    position: absolute;
    top: 50%;
    left: 6px;
    width: 7px;
    height: 7px;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--coral);
    box-shadow: 0 0 0 1px var(--coral);
    content: "";
    transform: translateY(-50%);
}

.destination-form,
.route-query {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

.destination-form > label,
.route-query label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 700;
}

.destination-form > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 6px;
}

.destination-form select,
.route-query select {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0 7px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: white;
    color: var(--text);
    font: inherit;
    font-size: 0.7rem;
}

.destination-form button {
    border: 0;
    border-radius: 3px;
    background: var(--pine);
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
}

.route-query {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.route-query label:last-of-type {
    grid-column: 1 / -1;
}

.route-query .action-button {
    grid-column: 1 / -1;
    min-height: 36px;
    font-size: 0.72rem;
}

.route-result {
    display: block;
    margin-top: 10px;
    padding: 10px;
    border-left: 3px solid var(--pine);
    background: #eaf0e9;
    color: var(--pine-dark);
    font-size: 0.77rem;
    font-weight: 700;
}

.route-optimize {
    margin-top: 7px;
}

.route-surface > .muted-copy {
    margin-top: 5px;
}

.route-list li {
    grid-template-columns: 25px minmax(0, 1fr) 30px;
}

.remove-stop {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
}

.remove-stop:hover {
    background: #f7e9e4;
    color: var(--coral);
}

.planner-cost {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid #eeede7;
}

.planner-cost > div {
    display: grid;
    gap: 1px;
}

.planner-cost > div strong {
    color: var(--pine-dark);
    font-size: 0.72rem;
}

.planner-cost > div small {
    color: var(--muted);
    font-size: 0.6rem;
}

.planner-cost label {
    display: grid;
    gap: 2px;
    color: var(--muted);
    font-size: 0.58rem;
}

.planner-cost label span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.planner-cost input {
    width: 62px;
    height: 28px;
    padding: 0 5px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: white;
    color: var(--text);
    font: inherit;
    font-size: 0.66rem;
}

.planner-cost output {
    color: var(--pine);
    font-size: 0.61rem;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.planner-cost output[data-over-limit="true"] {
    color: var(--coral);
}

.section-expense-form {
    display: grid;
    grid-template-columns: minmax(145px, 1.1fr) minmax(120px, 1fr) minmax(100px, 0.8fr) minmax(95px, 0.7fr) minmax(125px, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel);
}

.section-expense-form > div {
    grid-column: 1 / -1;
}

.section-expense-form > div strong {
    font-family: Georgia, serif;
    font-size: 1.1rem;
    font-weight: 400;
}

.section-expense-form label {
    display: grid;
    min-width: 0;
    gap: 4px;
    color: var(--muted);
    font-size: 0.63rem;
    font-weight: 700;
}

.section-expense-form input,
.section-expense-form select {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: white;
    color: var(--text);
    font: inherit;
    font-size: 0.7rem;
}

.section-expense-form .action-button {
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
}

.section-expense-form output {
    grid-column: 1 / -1;
    min-height: 1em;
    color: var(--pine);
    font-size: 0.68rem;
}

.planner-cost [data-expenses-for] {
    display: grid;
    gap: 2px;
}

.section-expense-item {
    color: var(--muted);
    font-size: 0.6rem;
}

@media (max-width: 560px) {
    .planner-cost {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
    }

    .planner-cost output {
        grid-column: 1 / -1;
        text-align: left;
    }

    .map-added-marker {
        max-width: 94px;
        padding: 3px 4px 3px 15px;
        font-size: 0.53rem;
    }
}

@media (max-width: 800px) {
    .section-expense-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        padding: 13px;
    }

    .section-expense-form .action-button {
        grid-column: 1 / -1;
    }
}

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