:root {
    --green: #1f5f55;
    --green-dark: #164740;
    --green-soft: #e3eee9;
    --cream: #f7f3ea;
    --paper: #fffdf8;
    --ink: #1d2623;
    --muted: #5f6b66;
    --line: #ddd5c4;
    --amber: #b7791f;
    --amber-soft: #fbf0da;
    --red: #a63a32;
    --blue: #2f5d8a;
    --blue-soft: #e3ecf5;
    --lavender: #6b4f8a;
    --lavender-soft: #efeaf5;
    --radius: 10px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--cream);
    line-height: 1.45;
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .25rem; }
h1 { font-size: 1.8rem; font-family: Georgia, "Times New Roman", serif; }
h2 { font-size: 1.25rem; font-family: Georgia, "Times New Roman", serif; }
h3 { font-size: 1rem; }
p { margin: .25rem 0; }
a { color: var(--green); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 3px solid var(--amber);
    outline-offset: 2px;
}

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; color: var(--muted); margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: .75rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px; flex: none; background: var(--paper); border-right: 1px solid var(--line);
    padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1rem;
    position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.brand-mark { display: block; width: 1.85rem; height: 1.85rem; flex: none; }
.brand-name { letter-spacing: -.01em; }
.brand-accent { color: var(--green); }
.side-nav { display: flex; flex-direction: column; gap: .15rem; }
.side-nav a { padding: .5rem .65rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.side-nav a.active, .side-nav a:hover { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.side-note { background: var(--cream); border-radius: var(--radius); padding: .75rem; font-size: .875rem; }
.family-photo { display: block; width: 100%; height: auto; border-radius: calc(var(--radius) - 4px); margin-bottom: .6rem; }
.family-banner { display: none; }
.side-user { margin-top: auto; border-top: 1px solid var(--line); padding-top: .75rem; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .75rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar-crumb { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mobile { display: none; }
.avatar { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; }
.content { padding: 1.5rem; max-width: 1400px; width: 100%; }
.mobile-footer { display: none; }
body.bare .content { margin: 0 auto; max-width: 560px; padding-top: 10vh; }

/* Controls */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    min-height: 2.5rem; padding: .45rem 1rem; border-radius: 8px; border: 1px solid var(--line);
    background: var(--paper); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { border-color: var(--green); }
.button.primary { background: var(--green); border-color: var(--green); color: #fff; }
.button.primary:hover { background: var(--green-dark); }
.button.danger { color: var(--red); border-color: var(--red); }
.button.small { min-height: 2.1rem; padding: .3rem .7rem; font-size: .875rem; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--green); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.push-right { margin-left: auto; }
.inline-form { display: inline-flex; gap: .35rem; align-items: center; margin: 0; }

input, select, textarea {
    font: inherit; color: inherit; width: 100%; min-height: 2.5rem; padding: .45rem .6rem;
    border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
input[type="radio"], input[type="checkbox"] { width: auto; min-height: 0; }
textarea { resize: vertical; }
.inline-form select, .inline-form input { width: auto; }
label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .9rem; }
label .muted { font-weight: 400; }
label.checkbox { flex-direction: row; align-items: flex-start; gap: .5rem; font-weight: 400; }
label.checkbox > input { flex: none; margin-top: calc((1lh - 13px) / 2); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; margin: 0; }
legend { font-weight: 700; padding: 0 .25rem; }
.radio-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.endpoint { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; align-items: start; }
.stay-grid { align-items: start; }
.rental-end { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.maps-field { display: flex; flex-direction: column; gap: .35rem; }
.maps-status { margin: 0; padding: .4rem .6rem; border-radius: var(--radius); background: var(--cream, #f6f1e4); }
.maps-status.warn { color: var(--red); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: 900px; }
.span-2 { grid-column: 1 / -1; }
.form-grid .solo { grid-column: 1 / -1; max-width: calc(50% - .5rem); }
.hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
.field-error { color: var(--red); font-weight: 600; font-size: .85rem; }
.field-error:empty { display: none; }
.errors { color: var(--red); }
.errors ul { margin: 0; padding-left: 1.1rem; }
.errors.validation-summary-valid { display: none; }
.form-grid .errors { grid-column: 1 / -1; }
.input-validation-error { border-color: var(--red); }

.notice { background: var(--green-soft); border-left: 4px solid var(--green); padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.notice.warn { background: var(--amber-soft); border-left-color: var(--amber); }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.count { display: inline-block; min-width: 1.4rem; padding: 0 .35rem; margin-left: .25rem; border-radius: 999px; background: var(--cream); font-size: .75rem; text-align: center; }
.copyable { font-family: ui-monospace, Consolas, monospace; background: var(--cream); padding: .15rem .4rem; border-radius: 6px; word-break: break-all; }

/* Headings */
.page-head, .trip-head, .section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head { margin-top: 1.75rem; }
.trip-description { max-width: 70ch; margin-bottom: 1rem; }
.trip-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.25rem; }
.toolbar-group { display: flex; flex-direction: column; gap: .3rem; }
.toolbar-group + .toolbar-group { border-left: 1px solid var(--line); padding-left: 1.25rem; }
.toolbar-label { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* Trips list */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--green-dark); border-bottom-color: var(--green); font-weight: 700; }
.trip-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.trip-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; }
.trip-card:hover { border-color: var(--green); }
.trip-card-art { height: 90px; background: linear-gradient(135deg, var(--green) 0%, #3f8a7c 55%, var(--amber) 140%); }
.trip-card-body { padding: 1rem; }
.empty { text-align: center; padding: 2.5rem 1rem; }

/* My trips calendar: Monday–Sunday month grid with trip bars wrapped per week. */
.trip-calendar { margin-top: 1.5rem; padding: 1.25rem 1.25rem 1rem; }
.cal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-heading { display: flex; align-items: baseline; gap: .4rem 1rem; flex-wrap: wrap; }
.cal-heading h2 { margin: .15rem 0 0; padding-right: 1rem; border-right: 1px solid var(--line); }
.cal-nav { display: flex; align-items: center; gap: .4rem; }
.cal-nav .icon-button { width: 2.5rem; height: 2.5rem; font-size: 1.35rem; line-height: 1; text-decoration: none; }
.cal-nav .button { min-height: 2.5rem; }
.cal-grid { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal-weekdays, .cal-days, .cal-lane { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekdays { background: var(--cream); border-bottom: 1px solid var(--line); }
.cal-weekdays span { padding: .45rem .3rem; text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cal-week { position: relative; min-height: 5rem; }
.cal-week + .cal-week { border-top: 1px solid var(--line); }
.cal-days { position: absolute; inset: 0; }
.cal-day { padding: .35rem .5rem; }
.cal-day + .cal-day { border-left: 1px solid var(--line); }
.cal-day.outside { background: var(--cream); }
.cal-day.outside .cal-num { color: var(--muted); font-weight: 400; }
.cal-day.today .cal-num { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .3rem; border-radius: 999px; background: var(--green); color: #fff; }
.cal-num { font-size: .85rem; font-weight: 600; }
.cal-lanes { position: relative; padding: 1.95rem 0 .4rem; }
.cal-lane + .cal-lane { margin-top: .25rem; }
.cal-bar {
    display: flex; align-items: center; gap: .3rem; min-width: 0; min-height: 1.6rem; margin: 0 .3rem; padding: .15rem .55rem;
    border: 1px solid; border-radius: 999px; font-size: .8rem; font-weight: 600; line-height: 1.2; text-decoration: none;
}
.cal-bar:hover { filter: brightness(.96); text-decoration: underline; }
.cal-bar:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; }
.cal-bar.cont-before { margin-left: 0; border-left-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.cont-after { margin-right: 0; border-right-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-bar.narrow .cal-bar-title { white-space: normal; overflow-wrap: anywhere; }
.cal-arrow { flex: none; font-size: 1rem; line-height: 1; opacity: .75; }
.trip-color-0 { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, transparent); color: var(--green-dark); }
.trip-color-1 { background: var(--lavender-soft); border-color: color-mix(in srgb, var(--lavender) 35%, transparent); color: var(--lavender); }
.trip-color-2 { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 45%, transparent); color: #7a4f12; }
.trip-color-3 { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 35%, transparent); color: var(--blue); }
.cal-col-1 { grid-column-start: 1; } .cal-col-2 { grid-column-start: 2; } .cal-col-3 { grid-column-start: 3; } .cal-col-4 { grid-column-start: 4; }
.cal-col-5 { grid-column-start: 5; } .cal-col-6 { grid-column-start: 6; } .cal-col-7 { grid-column-start: 7; }
.cal-span-1 { grid-column-end: span 1; } .cal-span-2 { grid-column-end: span 2; } .cal-span-3 { grid-column-end: span 3; } .cal-span-4 { grid-column-end: span 4; }
.cal-span-5 { grid-column-end: span 5; } .cal-span-6 { grid-column-end: span 6; } .cal-span-7 { grid-column-end: span 7; }

/* Workspace */
.stats { display: flex; flex-wrap: wrap; gap: .75rem; }
.stats > div { min-width: 9rem; }
.stats > div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; display: flex; flex-direction: column; }
.stats strong { font-size: 1.6rem; font-family: Georgia, serif; color: var(--green-dark); }
.stats span { color: var(--muted); font-size: .8rem; }

.date-strip { display: none; }
.day-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .75rem; align-items: start; }
.day { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; display: flex; flex-direction: column; gap: .5rem; scroll-margin-top: 1rem; }
.day.today { border: 2px solid var(--green); }
.day > header { display: grid; grid-template-columns: 1fr auto; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: .4rem; }
.day > header .eyebrow { grid-column: 1 / -1; }
.day-number { font-size: 1.8rem; font-family: Georgia, serif; }

.entry { border-radius: 8px; padding: .55rem .65rem; border-left: 4px solid var(--green); background: var(--green-soft); }
.entry.just-saved { box-shadow: 0 0 0 3px var(--green); transition: box-shadow 1s ease; }
.entry.just-saved.just-saved-fade { box-shadow: 0 0 0 3px transparent; }
.airport-field { position: relative; }
.airport-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; min-width: 18rem; max-height: 16rem; overflow-y: auto; margin: .15rem 0 0; padding: .25rem 0; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); font-weight: 400; }
.airport-list li { padding: .35rem .6rem; cursor: pointer; font-size: .9rem; }
.airport-list li strong { display: inline-block; min-width: 2.6rem; }
.airport-list li[aria-selected="true"], .airport-list li:hover { background: var(--green-soft); }
.entry h3 { font-size: .95rem; margin: .1rem 0; }
.entry h3 a { color: var(--ink); text-decoration: none; }
.entry h3 a:hover { text-decoration: underline; }
.entry-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.entry-label .type-icon { vertical-align: -2px; margin-right: .35em; stroke-width: 2.2; }
.entry-meta { font-size: .82rem; color: var(--muted); }
.entry-candidate { background: var(--green-soft); border: 1px dashed var(--line); border-left: 0; }
.entry-transport { background: var(--blue-soft); border-left-color: var(--blue); }
.entry-flight { background: var(--blue-soft); border-left-color: var(--blue); }
.entry-hotel { background: var(--amber-soft); border-left-color: var(--amber); }
.entry-hotel.entry-continuation { border-left-style: dotted; }
.entry-rental { background: var(--lavender-soft); border-left-color: var(--lavender); }
.entry-meta a { margin-right: .6rem; }
.segment-line { margin: .2rem 0; }
.segment-line p { margin: 0; }
.leg-time span[aria-hidden] { display: inline-block; width: 1.4em; }
.booking { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }

.quick-links { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 0; }
.icon-button {
    display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 10px;
    border: 1px solid var(--line); background: var(--paper); color: var(--green-dark);
}
.icon-button:hover { border-color: var(--green); background: var(--green-soft); }
.icon-button.primary { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.icon-button.primary:hover { background: var(--green); border-color: var(--green); }
.icon-button.tile-flight, .icon-button.tile-transport { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.icon-button.tile-hotel { background: var(--amber-soft); border-color: var(--amber); color: #7a4f12; }
.icon-button.tile-rental { background: var(--lavender-soft); border-color: var(--lavender); color: var(--lavender); }
.icon-button.tile-activity { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.icon-button[class*="tile-"]:hover { box-shadow: inset 0 0 0 1px currentColor; filter: brightness(.96); }
.quick-links .icon-button { width: 2.5rem; height: 2.5rem; }
.icon-actions { gap: .4rem; }

.segment { display: grid; gap: 1rem; position: relative; }
.segment .leg-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem .75rem; align-items: start; }
.segment .leg-end { border-top: 1px solid var(--line); padding-top: .6rem; }
.segment .leg-end-title { grid-column: 1 / -1; margin: 0; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.segment .field-name { min-height: 1.35em; }
.segment .leg-code { grid-column: span 2; }
.segment .leg-name { grid-column: span 4; }
.segment .airport-name { background: var(--surface-muted, #f3efe6); color: var(--ink); cursor: default; }
.segment .leg-clock { grid-column: span 2; }
.segment .leg-zone { grid-column: span 2; }
.segment .remove-leg { position: absolute; top: -1.15rem; right: .75rem; background: var(--paper); }
.add-connection { display: flex; flex-wrap: wrap; gap: .5rem; }
.segment .span-2 { grid-column: span 2; }
.segment .span-3 { grid-column: span 3; }
.iata { text-transform: uppercase; }
.booking-ref { text-transform: uppercase; }
.copy-icon {
    display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; cursor: pointer;
    border: 1px solid transparent; border-radius: 8px; background: none; color: var(--green-dark);
}
.copy-icon:hover { border-color: var(--green); background: var(--green-soft); }
.copy-icon .icon-check, .copy-icon.copied .icon-copy { display: none; }
.copy-icon.copied .icon-check { display: block; }
.copy-icon.copied { color: var(--green); }

.costs { margin-top: 1.75rem; max-width: 900px; }
.cost-total { text-align: right; margin: 0; display: flex; flex-direction: column; }
.cost-total strong { font-size: 1.6rem; font-family: Georgia, serif; color: var(--green-dark); }
.cost-categories { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: .75rem 0 .25rem; }
.cost-categories div { display: flex; flex-direction: column; }
.cost-categories dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cost-categories dd { margin: 0; font-weight: 700; }
.cost-details summary { cursor: pointer; color: var(--green); font-weight: 600; font-size: .875rem; }
.cost-table { width: 100%; border-collapse: collapse; font-size: .875rem; margin-top: .5rem; }
.cost-table th, .cost-table td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.cost-table .num { text-align: right; white-space: nowrap; }

/* Picking a day for the "Add to trip" toolbar: hover only hints; a click, tap or Enter/Space selects. */
.day-select { position: relative; grid-column: 1; display: grid; justify-items: start; margin: -.25rem 0 0 -.35rem; padding: .25rem .35rem; border: 1px solid transparent; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.day-select .eyebrow { grid-column: auto; }
.day > header:has(.day-select) .eyebrow { grid-column: auto; }
.day-select:hover { background: var(--cream, #f7f2e7); border-color: var(--line); }
.day-select:hover::after, .day.day-selected .day-select::after { position: absolute; bottom: .45rem; right: .4rem; }
.day-select:hover::after { content: "Add here"; font-size: .7rem; font-weight: 600; color: var(--amber); }
.day-select:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }
.day.day-selected { box-shadow: 0 0 0 3px var(--amber); }
.day.day-selected .day-select { background: #fbefd9; border-color: var(--amber); }
.day.day-selected .day-select::after { content: "✓ Adding here"; font-size: .7rem; font-weight: 700; color: #7a4f0f; }
.add-toolbar.has-target .toolbar-label { color: #7a4f0f; }
.add-toolbar.has-target .toolbar-label [data-target-text] { background: #fbefd9; border: 1px solid var(--amber); border-radius: 999px; padding: 0 .45rem; text-transform: none; letter-spacing: 0; }
.toolbar-hint { margin: 0; font-size: .75rem; }
.toolbar-clear { align-self: flex-start; }
.toolbar-clear[hidden], .toolbar-hint[hidden] { display: none; }
.quick-entry { margin: 0 0 1rem; padding: .75rem; background: var(--paper); border: 1px solid var(--amber); border-radius: var(--radius); }
.quick-entry[hidden] { display: none; }
.quick-entry-title { margin: 0 0 .5rem; font-size: 1rem; }
.quick-entry .quick-form { max-width: 720px; }
.quick-entry .place-menu { position: static; }
.entry-estimate { text-transform: none; letter-spacing: 0; }
.estimate { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; align-items: start; }
.estimate[hidden] { display: none; }
.estimate .span-all { grid-column: 1 / -1; }
.drive-time-status { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; margin: -.25rem 0 0; }
.drive-time-status .hint { margin: 0; }
.drive-time-status [hidden] { display: none; }
.drive-time-status.is-error .drive-time-mode { color: var(--red); }
.drive-time-attribution { color: var(--muted); font-size: .75rem; }
.estimate input.is-estimate { color: var(--muted); font-style: italic; }
.drive-hidden[hidden] { display: none; }
.quick-form { display: flex; flex-wrap: wrap; gap: .4rem; }
.quick-form select { flex: 0 0 auto; width: auto; }
.quick-form input { flex: 1 1 8rem; }

.ideas { margin-top: 1rem; }
.idea-form { max-width: 640px; margin-bottom: .75rem; }
.place-picker { position: relative; display: block; min-width: 0; }
.quick-form .place-picker { flex: 1 1 8rem; }
/* In a day card the list is a full-width row in the flow, so the scrolling day grid can't clip it. */
.quick-form > .place-menu, .quick-form > .place-status { flex: 1 0 100%; order: 1; }
.day .place-menu { position: static; }
.place-picker input { width: 100%; }
.place-menu { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); font-weight: 400; }
.place-menu ul { list-style: none; margin: 0; padding: .25rem 0; max-height: 16rem; overflow-y: auto; }
.place-menu li { display: flex; flex-direction: column; padding: .5rem .7rem; cursor: pointer; min-height: 44px; justify-content: center; }
.place-menu li strong { font-weight: 600; overflow-wrap: anywhere; }
.place-menu li span { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.place-menu li[aria-selected="true"], .place-menu li:hover { background: var(--green-soft); }
.place-attribution { margin: 0; padding: .3rem .7rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; text-align: right; }
.place-status { display: block; color: var(--muted); font-weight: 400; }
.place-status:empty { display: none; }
.idea-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }
.idea-card { background: var(--green-soft); border: 1px dashed var(--line); border-left: 0; border-radius: 8px; padding: .5rem .65rem; min-width: 0; }
.idea-card h3 { font-size: .95rem; margin: .1rem 0; overflow-wrap: anywhere; }
.idea-card h3 a { color: var(--ink); text-decoration: none; }
.idea-card h3 a:hover { text-decoration: underline; }
.idea-card .move-menu { margin-top: .15rem; }

/* Today */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.today-context { margin-bottom: 1rem; }
.today-picker { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.today-picker select { min-height: 2.1rem; max-width: 100%; }
.today-section { margin: 1.25rem 0; }
.today-section h2 { margin-bottom: .5rem; }
.today-entries { display: grid; gap: .5rem; }
.next-up { border-left: 5px solid var(--amber); margin-bottom: 1rem; }
.next-up-time { font-size: 1.3rem; }
.tonight { display: flex; gap: .75rem; flex-wrap: wrap; align-items: baseline; }

/* Family links */
.share-new { border-left: 5px solid var(--green); margin-bottom: 1rem; }
.copy-row { display: flex; gap: .5rem; margin-top: .5rem; }
.copy-row input { flex: 1; min-width: 0; min-height: 2.5rem; font-family: ui-monospace, monospace; font-size: .85rem; }
.share-create fieldset { border: 0; padding: 0; margin: 0 0 .75rem; }
.share-create legend { font-weight: 700; margin-bottom: .5rem; }
.radio { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .5rem; cursor: pointer; }
.radio input { margin-top: .3rem; }
.share-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.share-link { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .9rem; }
.share-link .actions { display: flex; gap: .4rem; }
.share-link form { margin: 0; }
.share-expired, .share-revoked { opacity: .7; }
.share-expired .badge, .share-revoked .badge { background: #eee; color: var(--muted); }

/* Itinerary (print + family summary) */
.print-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.print-sheet { max-width: 860px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.print-header { border-bottom: 2px solid var(--green); padding-bottom: .75rem; margin-bottom: 1rem; }
.itinerary-day { margin-bottom: 1rem; }
.itinerary-day h2 { font-size: 1.05rem; border-bottom: 1px solid var(--line); padding-bottom: .2rem; margin-bottom: .4rem; }
.itinerary-lines { list-style: none; margin: 0; padding: 0; }
.itinerary-lines li { display: grid; grid-template-columns: 6.5rem 7rem 1fr; gap: .5rem; padding: .25rem 0; }
.it-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.it-category { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--green-dark); padding-top: .15rem; }
.it-ref { display: block; font-weight: 700; }
.it-ref strong { font-weight: 800; letter-spacing: .03em; }
.it-notes { display: block; white-space: pre-line; font-size: .9rem; }
.guest-unavailable { max-width: 520px; margin: 3rem auto; }

/* Tablet: beside the sidebar, four- and six-column field rows get too narrow for labels and zone names */
@media (min-width: 761px) and (max-width: 1100px) {
    .endpoint, .endpoint.rental-end { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rental-end .rental-place { grid-column: 1 / -1; }
    .segment .leg-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .segment .leg-row > .span-2, .segment .leg-code, .segment .leg-clock { grid-column: span 1; }
    .segment .leg-name, .segment .leg-zone { grid-column: 1 / -1; }
}
/* Phone */
@media (max-width: 760px) {
    .sidebar, .hide-mobile { display: none; }
    .trip-calendar { padding: 1rem .75rem .75rem; }
    .cal-head { align-items: flex-start; flex-wrap: nowrap; }
    .cal-heading { display: block; }
    .cal-heading h2 { padding-right: 0; border-right: 0; font-size: 1.2rem; white-space: nowrap; }
    .cal-heading .muted { font-size: .8rem; }
    .cal-nav { gap: .3rem; }
    .cal-nav .icon-button, .cal-nav .button { min-height: 2.7rem; height: 2.7rem; }
    .cal-nav .icon-button { width: 2.7rem; }
    .cal-nav .button { padding: .35rem .7rem; }
    .cal-weekdays span { padding: .4rem 0; font-size: .64rem; letter-spacing: .02em; }
    .cal-day { padding: .3rem .25rem; }
    .cal-num { font-size: .78rem; }
    .cal-day.outside .cal-num { font-size: .68rem; }
    .cal-week { min-height: 4.5rem; }
    .cal-lanes { padding-top: 1.75rem; }
    .cal-bar { margin: 0 .15rem; padding: .15rem .35rem; gap: .15rem; font-size: .7rem; border-radius: 8px; }
    .cal-bar-days { display: none; }
    .cal-bar .cal-bar-title { white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
    .cal-bar.narrow { padding: .15rem .25rem; }
    .cal-bar.cal-span-1 { margin: 0 .1rem; padding: .15rem .2rem; font-size: .62rem; }
    .family-banner { display: flex; align-items: center; gap: .85rem; background: var(--cream); border-radius: var(--radius); padding: .6rem; margin-bottom: 1rem; font-size: .875rem; }
    .family-banner .family-photo { width: 84px; height: 84px; object-fit: cover; object-position: 50% 45%; margin: 0; flex: none; }
    .family-banner p { margin: 0; }
    .brand-mobile { display: inline-flex; margin-right: auto; }
    .topbar { padding: .6rem 1rem; position: sticky; top: 0; z-index: 2; }
    .topbar-crumb { display: none; }
    .content { padding: 1rem 1rem 5rem; }
    h1 { font-size: 1.5rem; }
    .form-grid, .endpoint { grid-template-columns: 1fr; }
    .estimate { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .endpoint.stay-grid, .endpoint.rental-end { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rental-end .rental-place { grid-column: 1 / -1; }
    .form-grid .solo { max-width: none; }
    .segment .leg-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .segment .leg-row > .span-2, .segment .leg-code, .segment .leg-clock { grid-column: span 1; }
    .segment .leg-name, .segment .leg-zone { grid-column: 1 / -1; }
    .cost-total { text-align: left; }
    .stats strong { font-size: 1.3rem; }
    .date-strip { display: flex; gap: .4rem; overflow-x: auto; position: sticky; top: 3.4rem; z-index: 1; background: var(--cream); padding: .5rem 0; }
    .date-strip a { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 3rem; padding: .3rem .4rem; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; color: var(--ink); font-size: .75rem; }
    .date-strip a.today { background: var(--green); color: #fff; border-color: var(--green); }
    .date-strip strong { font-size: 1.1rem; }
    .day-grid { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
    .day { scroll-margin-top: 7.5rem; }
    .mobile-footer {
        display: flex; justify-content: space-around; align-items: center; position: fixed; left: 0; right: 0; bottom: 0;
        background: var(--paper); border-top: 1px solid var(--line); padding: .6rem; z-index: 3;
    }
    .mobile-footer a, .mobile-footer .link-button { color: var(--ink); text-decoration: none; font-weight: 600; min-height: 2.5rem; display: inline-flex; align-items: center; }
    .mobile-footer form { margin: 0; }
    .itinerary-lines li { grid-template-columns: 5.5rem 1fr; }
    .itinerary-lines .it-category { display: none; }
    .print-sheet { padding: 1rem; }
    .copy-row { flex-direction: column; }
    .trip-toolbar { flex-direction: column; align-items: stretch; width: 100%; }
    .toolbar-group + .toolbar-group { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: .75rem; }
}

/* Browser print / Save as PDF */
/* Moving ideas and activities: a drag handle (pointer), the Move… menu (keyboard, tap, no JavaScript). */
.movable { position: relative; }
.entry.movable { padding-right: 2.4rem; }
.drag-handle { position: absolute; top: .3rem; right: .3rem; width: 2rem; height: 2rem; padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); font-size: 1.15rem; line-height: 1; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.drag-handle:hover, .drag-handle:focus-visible { background: var(--paper); border-color: var(--line); color: var(--ink); }
.idea-card.movable { position: relative; padding-right: 2.4rem; }
.activity-link { margin: .15rem 0 0; }
.activity-link a { font-weight: 600; }
.activity-link .pin { display: inline-block; margin-right: .2rem; text-decoration: none; }
.move-menu { margin-top: .3rem; }
.move-menu summary { display: inline-block; cursor: pointer; color: var(--green); font-size: .85rem; font-weight: 600; text-decoration: underline; }
.move-menu summary::-webkit-details-marker { display: none; }
.move-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .35rem; }
.move-form select { flex: 1 1 9rem; min-width: 0; width: auto; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.drag-source { opacity: .45; }
.drag-pending { opacity: .6; }
[data-drop].drop-active { outline: 3px dashed var(--green); outline-offset: 2px; background: var(--green-soft); }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; max-width: 16rem; padding: .45rem .7rem; border-radius: 8px; background: var(--green); color: #fff; font-weight: 600; font-size: .9rem; box-shadow: 0 6px 18px rgba(0,0,0,.25); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Manual order within a day: drop line, handle menu (Move up/down) and the "Sort by time" reset. */
.drop-line { height: 4px; margin: -2px 0; border-radius: 2px; background: var(--green); box-shadow: 0 0 0 2px var(--green-soft); pointer-events: none; }
.tile-menu { position: absolute; top: 2.5rem; right: .3rem; z-index: 50; display: flex; flex-direction: column; min-width: 12rem; padding: .25rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.tile-menu button { padding: .5rem .7rem; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.tile-menu button:hover:not(:disabled), .tile-menu button:focus-visible { background: var(--green-soft); }
.tile-menu button:disabled { color: var(--muted); cursor: default; }
.day-order-reset { display: flex; gap: .4rem; align-items: baseline; justify-content: flex-end; margin: -.2rem 0 .1rem; }
.day.order-saving { cursor: progress; }

@media print {
    :root { background: #fff; }
    .sidebar, .topbar, .mobile-footer, .quick-entry, .actions, .trip-toolbar, .inline-form, .idea-form, .date-strip, .notice[role="status"], .drag-handle, .move-menu, .tile-menu, .day-order-reset, .drop-line, .drag-hint, .activity-link, .place-menu, .place-status { display: none !important; }
    .day.day-selected { box-shadow: none; }
    .day-select::after { content: none !important; }
    .content { padding: 0; max-width: none; }
    .day-grid { display: block; overflow: visible; }
    .day { break-inside: avoid; margin-bottom: .5rem; border-color: #999; }
    .entry { background: none; border: 1px solid #bbb; border-left-width: 4px; }
    a { color: inherit; text-decoration: none; }
    .no-print, .no-print-url { display: none !important; }
    .print-sheet { border: 0; padding: 0; max-width: none; background: none; }
    .itinerary-day { break-inside: avoid; }
    .itinerary-day h2 { break-after: avoid; }
    .itinerary-lines li { grid-template-columns: 6.5rem 7rem 1fr; }
    .itinerary-lines .it-category { display: block; }
}

/* Sign-in, not-configured state and account */
.signin { max-width: 26rem; margin: 3rem auto; }
.signin .brand { margin-bottom: 1.5rem; font-size: 1.45rem; }
.signin .brand-mark { width: 2.4rem; height: 2.4rem; }
.signin h1 { margin-bottom: .25rem; }
.button.wide { width: 100%; justify-content: center; }
.panel + .panel, .form-grid + .panel { margin-top: 1.25rem; }
.activity { width: 100%; border-collapse: collapse; font-size: .9rem; }
.activity th, .activity td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .activity th:nth-child(4), .activity td:nth-child(4) { display: none; } }
