/* Valentina · Schengen trip planner
   One job: plan trips and see how long Valentina can stay. Neutral surfaces, one blue accent,
   status colors only where they carry meaning. Dark mode follows :root[data-theme=dark]. */

/* System font: San Francisco on Apple devices, Segoe UI on Windows; nothing to download. */

:root{
  color-scheme:light;
  --ease:cubic-bezier(.2,.8,.2,1);
  --sans:-apple-system,BlinkMacSystemFont,system-ui,"Segoe UI",Roboto,sans-serif;
  
  --bg:#f5f5f7;--surface:#ffffff;--surface-2:#f5f5f7;--surface-3:#e8e8ed;
  --border:#e3e3e8;--border-strong:#8e8e93;
  --text:#1d1d1f;--text-2:#515154;--text-3:#6e6e73;
  --accent:#0066cc;--on-accent:#ffffff;--accent-soft:#e3effb;
  --ok:#1d7a36;--ok-soft:#eaf6ec;
  --done:#515154;--done-soft:#f0f0f3;
  --check:#b25000;--check-soft:#fff4e5;--check-line:#f0a85a;
  --possible:#0066cc;--possible-soft:#e3effb;
  --danger:#d70015;--danger-soft:#fff0f1;
  --focus:#0071e3;
  --fill:rgb(118 118 128/.12);--fill-press:rgb(118 118 128/.22);
  --ink:#1d1d1f;--on-ink:#ffffff;--ink-hover:#000000;
  --today:#d70015;
  --trip-done:#e3e3e8;--trip-planned:#dbe9fb;--on-ok:#ffffff;
  --e3:0 20px 60px rgb(0 0 0/.22);
  --r-sm:10px;--r-md:14px;--r-lg:18px;--r-xl:22px;
}
/* Dark tokens live in one block, "Dark mode", further down. */

/* Base */
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:20px;-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font:15px/1.55 var(--sans);-webkit-font-smoothing:antialiased;font-feature-settings:"tnum" 1}
h1,h2,h3,p{margin:0}
h1,h2{font-weight:700;line-height:1.15;letter-spacing:-.022em}
h3{font-size:16px;font-weight:600;line-height:1.35}
strong{font-weight:600}
a{color:inherit;text-underline-offset:3px}
button,input,textarea{font:inherit;color:inherit}
button{border:0;background:none;cursor:pointer;padding:0;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:not-allowed}
svg{display:block}
button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
[hidden]{display:none!important}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.small{font-size:13px;line-height:1.5;color:var(--text-3)}
.muted{color:var(--text-2)}
.skip{position:absolute;left:12px;top:-60px;z-index:20;background:var(--accent);color:var(--on-accent);padding:10px 14px;border-radius:var(--r-md);text-decoration:none;font-weight:600}
.skip:focus{top:12px}

/* Layout */
.shell{margin:0 auto;padding:0 32px 48px}
.section-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.section-top h2{font-size:22px}

/* Buttons */
.primary-button,.secondary-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;font-size:15px;line-height:1.2;text-decoration:none;white-space:nowrap;transition:background-color .12s var(--ease),border-color .12s var(--ease)}
.small-button{min-height:36px;font-size:14px}
.icon-button{display:inline-grid;place-items:center;width:40px;height:40px;color:var(--text-2);font-size:20px;line-height:1;transition:background-color .12s var(--ease),color .12s var(--ease);border-radius:50%}
.icon-button:hover{color:var(--text)}
.icon-button:disabled{opacity:.4}
.link-button{color:var(--accent);font-weight:600;font-size:14px;text-decoration:underline;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent);text-underline-offset:3px;padding:6px 0}
.link-button:hover{text-decoration-color:currentColor}
.danger-link{color:var(--danger);font-weight:600;font-size:14px;padding:10px 4px;text-decoration:underline;text-underline-offset:3px;text-decoration-color:color-mix(in srgb,currentColor 35%,transparent)}
@media (pointer:coarse){.small-button,.link-button{min-height:44px}.link-button{display:inline-flex;align-items:center}.icon-button{width:44px;height:44px}}

/* Header: title, the rule in one line, appearance switch */
.site-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:28px 0 4px}

/* Plan a trip: the main tool */
.plan:focus{outline:none}
.plan-head{display:grid;gap:4px}
.plan-now{color:var(--text-2);font-size:14px}
.plan-now:empty{display:none}
.plan-now strong{color:var(--text)}
.plan-form{display:grid}
.verdict{font-weight:700}
.plan-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;column-gap:16px;gap:18px;align-items:center}

/* Trips: each trip says whether it fits */
.trip-main{display:grid;align-items:center;gap:12px;width:100%;min-height:56px;text-align:left;transition:background-color .12s var(--ease)}
.trip-main:hover{background:var(--surface-2)}
.record-name{display:grid;gap:1px;min-width:0}
.record-name b{font-size:15px;font-weight:600}
.record-name small{font-size:14px;color:var(--text-2)}
.record-side{display:grid;justify-items:end;gap:4px;white-space:nowrap;font-size:15px;font-weight:700;margin-left:12px}
.trip-verdict{margin:0 6px 4px 50px;font-size:14px;color:var(--text-2);display:flex;flex-wrap:wrap;align-items:center;gap:2px 14px;margin-left:44px}
.ok{color:var(--ok);font-weight:600}
.bad{color:var(--danger);font-weight:600}
.edit-verdict{font-size:14px;color:var(--text-2);margin:-2px 0 0}
.edit-verdict:empty{display:none}
#edit-max{justify-self:start;margin-top:-8px}
.empty-message{padding:24px;text-align:center}
.workspace{display:grid;gap:28px;align-items:start;grid-template-columns:minmax(0,1fr)}
/* Wide screens: plan on the left (it stays in view), trips and the overview on the right. */
@media (min-width:1024px){
  .workspace>.plan{top:16px}
}
#theme{flex-shrink:0}
/* The editor's Save and Remove stay visible on small screens. */
.dialog-actions{position:sticky;bottom:-24px;background:var(--surface);padding-bottom:4px;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:6px;padding-top:14px;flex-wrap:wrap;border-top:0}

/* Calendar section */
/* The overview decides its calendar layout from its own width: one month beside the day panel
   when it sits in the right-hand column, and the day panel below the month when narrower still. */

/* Rules, sources and the booked flight, at the end */
.rules{padding:4px 24px;box-shadow:none;background:transparent}
.rules h3{margin:12px 0 4px}
.rules p{margin-bottom:6px}
.rules .disclosure-body{gap:4px}

/* Callouts (pending actions, notices) */
.callout,.notice{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap;padding:16px;background:var(--surface-2);color:var(--text);font-size:14px;line-height:1.5;border:0;border-radius:var(--r-lg)}
.callout.check{background:var(--check-soft);border-color:color-mix(in srgb,var(--check-line) 55%,transparent)}
.callout-text{display:grid;gap:2px;min-width:min(100%,280px);flex:1}
.callout-text strong{font-size:15px}
.callout-actions,.notice>div{display:flex;gap:8px;flex-wrap:wrap}
.notice.error{background:var(--danger-soft);border-color:color-mix(in srgb,var(--danger) 30%,transparent)}
.notice button,.notice a{display:inline-flex;align-items:center;gap:4px;min-height:36px;font-weight:600;font-size:13px;text-decoration:none;border:0;border-radius:999px;background:var(--surface);padding:0 14px}
#notices{display:grid;gap:10px}
#notices:empty{display:none}

/* Disclosure */
.disclosure>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;cursor:pointer;color:var(--text-2);border-radius:var(--r-sm);font-size:15px;font-weight:500}
.disclosure>summary::-webkit-details-marker{display:none}
.disclosure>summary::after{content:"";width:8px;height:8px;margin-right:6px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(45deg) translate(-2px,-2px);transition:transform .2s var(--ease);color:var(--border-strong)}
.disclosure[open]>summary::after{transform:rotate(225deg) translate(-2px,-2px)}
.disclosure>summary:hover{color:var(--text)}
.disclosure-body{display:grid;gap:10px;padding:4px 0 10px;font-size:14px;color:var(--text-2)}
.disclosure-body strong{color:var(--text)}

/* Status pills */
.state{display:inline-flex;align-items:center;gap:5px;padding:3px 9px 3px 7px;border-radius:999px;font-size:12px;font-weight:600;line-height:1.35;white-space:nowrap;background:var(--done-soft);color:var(--done)}
.state::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.state.planned{background:var(--accent-soft);color:var(--accent)}
.state.now{background:var(--accent);color:var(--on-accent)}
.state.next{background:var(--possible-soft);color:var(--possible)}
.state.review{background:var(--check-soft);color:var(--check)}

/* Calendar */
.month h3 span{color:var(--text-3);font-weight:500}
.calendar-day{position:relative;height:46px;display:grid;align-content:start;justify-items:start;padding:5px 7px;font-size:14px;font-weight:500;color:var(--text);transition:background-color .12s var(--ease),box-shadow .12s var(--ease);border-radius:var(--r-sm);min-width:44px}
.calendar-day:hover{box-shadow:inset 0 0 0 1px var(--border-strong)}
.calendar-day.past{color:var(--text-2)}
.calendar-day.blocked{color:var(--text-3)}
.calendar-day:focus-visible{outline-offset:1px}

/* Dialogs */
dialog{width:min(560px,calc(100% - 32px));overflow:auto;background:var(--surface);color:var(--text);box-shadow:var(--e3);opacity:1;transform:none;transition:opacity .22s var(--ease),transform .22s var(--ease),overlay .22s allow-discrete,display .22s allow-discrete;overscroll-behavior:contain;max-height:min(92dvh,calc(var(--vvh,100dvh) - 8px));border:0;border-radius:24px;padding:28px}
@starting-style{dialog[open]{opacity:0;transform:translateY(10px)}}
dialog h2{margin:2px 0 14px;font-size:26px}
dialog p{color:var(--text-2);font-size:14px;margin-bottom:10px}
dialog form{display:grid;gap:12px}
dialog form h2{margin-bottom:4px}
.dialog-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-8px -12px 0 0}
.dialog-top p{margin:0}
.optional{font-weight:400;color:var(--text-3)}
input:not([type]),input[type=date],textarea{width:100%;color:var(--text);font-weight:400}
textarea{resize:vertical;font-family:ui-monospace,Menlo,monospace;font-size:13px}
.date-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.check-field{display:flex;align-items:center;gap:10px;min-height:40px;font-size:16px;font-weight:400;color:var(--text)}
.check-field input{width:20px;height:20px;accent-color:var(--ink)}
.form-error{color:var(--danger);font-size:14px;font-weight:600}
.form-error:empty{display:none}
.dialog-actions .primary-button{margin-left:auto}

/* Toast */
.toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:30;display:flex;align-items:center;gap:12px;width:max-content;max-width:calc(100% - 32px);box-shadow:var(--e3);font-size:14px;animation:toast-in .24s var(--ease);background:rgb(28 28 30);color:#fff;-webkit-backdrop-filter:blur(20px) saturate(180%);backdrop-filter:blur(20px) saturate(180%)}
.toast button{color:inherit;font-weight:700;min-height:36px;padding:0 14px;white-space:nowrap;border-radius:999px}
@keyframes toast-in{from{opacity:0;transform:translate(-50%,8px)}}

.calendar-link{display:inline-flex;align-items:center;gap:6px;justify-self:start;font-size:13px;padding:4px 0;white-space:nowrap}
.calendar-link svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.noscript{padding:20px;text-align:center}
#share-link,#legacy-data{font-size:16px}

/* Responsive */
@media (max-width:800px){
  .shell{padding:0 20px 40px}
}
@media (max-width:540px){
  .shell{padding:0 16px 32px}
  .calendar-day{height:46px;padding:4px 5px;font-size:13px}
  .small{font-size:14px}
  dialog{width:100%;max-width:100%;margin:auto 0 0;border-radius:24px 24px 0 0;padding:22px 20px calc(18px + env(safe-area-inset-bottom))}
  @starting-style{dialog[open]{opacity:0;transform:translateY(40px)}}
}
@media (max-width:380px){
  .record-side{grid-column:2;display:flex;justify-content:flex-start;align-items:center;gap:8px}
  .date-fields{grid-template-columns:minmax(0,1fr)}
  .callout-actions{width:100%}
  .callout-actions>*{flex:1}
}
@media (pointer:coarse){.toast button{min-height:44px;min-width:44px}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}
@media print{
  body{background:#fff;color:#000}
  .shell{padding:0}
  .icon-button,.toast,.skip,.callout-actions,#notices button,.calendar-link{display:none!important}
  .calendar-day{height:34px}
}

/* Type scale (32 / 20 / 17 / 15 / 13) and an 8-point spacing rhythm. */
.card{background:var(--surface);border-color:transparent}
.section-top h2{font-weight:700;font-size:22px;letter-spacing:-.02em}
.trips .section-top{margin-bottom:6px}
.trip-list{padding:0}
.trip-record{display:grid;gap:4px;padding:4px 0;border-radius:0}
.trip-record+.trip-record{box-shadow:none;border-top:1px solid var(--border)}
.trip-main{padding:8px 0;border-radius:var(--r-sm)}
.done-trips{padding:0;border-top:1px solid var(--border)}
.done-trips>summary{padding:0;border:0}
.done-trips[open]>summary{border-bottom:0}
.endnotes .rules{padding:0;border:0;border-radius:0;background:none;box-shadow:none}
.endnotes .rules+.rules{border-top:1px solid var(--border)}
.endnotes .rules>summary{font-size:14px;color:var(--text-2)}
@media (max-width:540px){
  .trips{border:0;box-shadow:none}
  .trip-verdict{margin-left:38px}
}

/* Trip rows show they open, and the editor's error sits next to Save. */
.trip-main{grid-template-columns:32px minmax(0,1fr) auto 14px}
.record-arrow{font-size:20px;line-height:1;justify-self:end;color:var(--border-strong)}
.dialog-actions .form-error{flex-basis:100%;margin:0}
@media (max-width:540px){.trip-main{gap:10px;grid-template-columns:28px minmax(0,1fr) auto 12px}}
@media (max-width:380px){
  .trip-main{grid-template-columns:28px minmax(0,1fr) 12px}
  .record-arrow{grid-column:3;grid-row:1}
}

/* Touch and iPhone */
.loading main{opacity:0}
main{display:grid;grid-template-columns:minmax(0,1fr);gap:28px;transition:opacity .12s ease-out}
a,summary,label,button{-webkit-tap-highlight-color:transparent}
button,.calendar-day,summary{touch-action:manipulation}
/* Touch screens: no hover highlight that stays after a tap; a short press state instead. */
@media (hover:none){
  .icon-button:hover,.trip-main:hover{background:transparent}
  .calendar-day:hover{box-shadow:none}
}
.trip-main:active,.secondary-button:active,.icon-button:active{background:var(--surface-3)}
.calendar-day:active{transform:scale(.96)}
/* Bottom sheets: grab handle, no page scrolling behind, room above the keyboard. */
html:has(dialog[open]){overflow:hidden}
@media (max-width:540px){dialog::before{content:"";display:block;width:36px;height:5px;border-radius:3px;background:var(--border-strong);opacity:.45;margin:-10px auto 10px}}
/* Date fields: left-aligned like other fields, and "Choose date" when empty. */
input[type=date]{-webkit-appearance:none;appearance:none;text-align:left;display:block}
input[type=date]::-webkit-date-and-time-value{text-align:left}
input[type=date].empty:not(:focus){color:transparent;position:relative}
.field:has(input[type=date].empty){position:relative}
.field:has(input[type=date].empty:not(:focus))::after{content:"Choose date";position:absolute;color:var(--text-3);font-weight:400;pointer-events:none;left:15px;bottom:13px;font-size:17px}
.field>span{display:block}
/* Home-screen app: the page runs under the status bar, so the header keeps clear of it. */
.site-header{padding-top:max(18px,env(safe-area-inset-top))}
.shell{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
@media (min-width:801px){.shell{padding-left:max(32px,env(safe-area-inset-left));padding-right:max(32px,env(safe-area-inset-right))}}
/* Text sizes closer to iOS on phones. */
@media (max-width:540px){body{font-size:16px}.small,.record-name small,.trip-verdict{font-size:15px}}
/* Notification banner */
.toast #undo{background:rgb(255 255 255/.16)}
/* Dark mode */
:root[data-theme=dark]{
  color-scheme:dark;
  --bg:#000;--surface:#1c1c1e;--surface-2:#2c2c2e;--surface-3:#3a3a3c;
  --border:#38383a;--border-strong:#8a8a8e;
  --text:#fff;--text-2:#ebebf5cc;--text-3:#ebebf599;
  --accent:#409cff;--on-accent:#000;--accent-soft:#0a84ff33;
  --ok:#5fd394;--ok-soft:#0f2a1c;
  --done:#ebebf5cc;--done-soft:#2c2c2e;
  --check:#f5b66d;--check-soft:#2e2412;--check-line:#8a5a25;
  --possible:#8cc4ff;--possible-soft:#0a84ff33;
  --danger:#ff9c90;
  --focus:#409cff;
  --e3:0 24px 64px rgb(0 0 0/.6);
  --fill:rgb(118 118 128/.24);--fill-press:rgb(118 118 128/.4);
  --ink:#f5f5f7;--on-ink:#000000;--ink-hover:#ffffff;
  --today:#ff6961;
  --trip-done:#3a3a3c;--trip-planned:#0a3a6b;--on-ok:#000000;
  --danger-soft:#4a1a1c;
}

/* Long names without spaces wrap instead of widening the page. */
.record-name b,.record-name small,.callout-text,.trip-verdict{overflow-wrap:anywhere}

/* Accessibility: states are told apart by shape as well as color, and focus stays visible. */
.toast :focus-visible{outline:2px solid #fff;outline-offset:2px}
:root[data-theme=dark] .state.planned{color:var(--possible)}
#editor-title:focus{outline:none}
@media (max-width:540px){.dialog-actions{bottom:calc(-18px - env(safe-area-inset-bottom));padding-bottom:calc(12px + env(safe-area-inset-bottom))}}
.state.has-icon::before{display:none}
.state.has-icon svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Dark toast stands off the cards behind it. */
:root[data-theme=dark] .toast{background:rgb(58 58 60);box-shadow:0 0 0 1px var(--border),var(--e3)}
/* Touch: 44px targets. */
#remove-trip{display:inline-flex;align-items:center;min-height:44px}
/* Windows high contrast: cues that survive forced colors. */

/* The answer: one large number and one line of detail below. */
/* The November 7 question: a quiet strip inside the planner instead of a large box above everything. */
.plan .confirm:empty{display:none}
.plan .callout.check{padding:12px 14px;border:0;gap:10px 16px}
.plan .callout-text strong{font-size:15px}
.plan .callout-text span{font-size:14px;color:var(--text-2)}

/* Trip list: one row per trip; the right side carries the length and a single short verdict. */
.trip-list .trip-main{min-height:60px;grid-template-columns:minmax(0,1fr) auto 12px;gap:12px}
.trip-list .record-side{display:grid;justify-items:end;gap:2px;font-weight:400}
.record-days{color:var(--text);font-variant-numeric:tabular-nums;font-size:17px;font-weight:600}
.record-verdict.ok{color:var(--ok)}.record-verdict.bad{color:var(--danger)}.record-verdict.check{color:var(--check)}.record-verdict.muted{color:var(--text-3);font-weight:500}
.trip-list .trip-verdict{font-size:14px;color:var(--text-3)}
.trip-list .trip-verdict .link-button{font-size:14px}
#edit-ics{justify-self:start;margin-top:-4px}
@media (max-width:380px){.trip-list .record-side{justify-items:start;gap:8px;align-items:baseline;grid-column:auto;display:grid}.trip-list .record-arrow{grid-column:3;grid-row:1;display:block}}

/* Look: calm and plain, in the manner of Apple's own apps. Neutral grays without a blue cast, ink for the
   answer and the main button, blue only for links and planned days, red only for today and for what does not fit.
   Surfaces are filled, not outlined: white cards on a light gray page, gray fields and buttons inside them. */
body{line-height:1.47;letter-spacing:-.01em}
.site-header h1{font-weight:700;line-height:1.1;font-size:34px}
.lede{max-width:60ch;margin-top:8px;font-size:17px;color:var(--text-3)}
.lede strong{color:var(--text);font-weight:600}
/* Cards: white, no outline, no shadow. */
.card{border:0;box-shadow:none;border-radius:var(--r-xl)}
:root[data-theme=dark] .card{box-shadow:none}
/* Buttons: one ink button for the main step; everything else is a quiet gray pill or a plain blue word. */
.primary-button,.secondary-button{border-radius:999px;font-weight:600;padding:0 20px;letter-spacing:-.01em}
.small-button{padding:0 16px}
.primary-button{background:var(--ink);color:var(--on-ink)}
.primary-button:hover{background:var(--ink-hover)}
.secondary-button{background:var(--fill);border:0;color:var(--text)}
.secondary-button:hover{background:var(--fill-press)}
.callout .secondary-button{background:var(--fill)}
.primary-button:disabled,.secondary-button:disabled{border-color:var(--border);background:var(--fill);color:var(--text-3)}
.icon-button:hover{background:var(--fill)}
.link-button,.danger-link{text-decoration:none;font-weight:500;font-size:15px}
.link-button:hover,.danger-link:hover{text-decoration:underline;text-underline-offset:3px}
.rules a{color:var(--accent);font-weight:500}
@media (hover:none){
  .primary-button:hover{background:var(--ink)}
  .secondary-button:hover{background:var(--fill)}
  .icon-button:hover{background:transparent}
  .link-button:hover,.danger-link:hover{text-decoration:none}
}
.secondary-button:active,.icon-button:active{background:var(--fill-press)}
.trip-main:active{background:var(--surface-2)}
.primary-button:active{filter:none;opacity:.8}
/* The answer: one large ink number on the white card, nothing around it. */
.plan .callout.check{background:var(--surface-2);border-radius:var(--r-md)}
/* Fields: filled, no outline until they have focus. */
.field{display:grid;font-size:13px;font-weight:500;color:var(--text-3);gap:6px}
input:not([type]),input[type=date],textarea{border:1px solid transparent;background:var(--fill);border-radius:var(--r-md);min-height:48px;padding:11px 14px;font-size:17px}
input:not([type]):focus-visible,input[type=date]:focus-visible,textarea:focus-visible{outline:2px solid var(--focus);outline-offset:0;border-color:transparent}
/* Trips */
.trips{padding:24px 28px 12px}
.trip-list .record-name small{font-size:15px;color:var(--text-3)}
.record-verdict{white-space:nowrap;font-size:15px;font-weight:500}
.empty-message{color:var(--text-3)}
/* Overview */
/* Calendar: the chosen day is ink, today is red, as in Calendar. */
.calendar-day.today>span:first-child{text-decoration-thickness:2px;text-underline-offset:4px;color:var(--today);text-decoration:none;font-weight:700}
/* Notices, sheets */
.callout.check,.notice.error{border:0}
dialog::backdrop{background:rgb(0 0 0/.36);backdrop-filter:none;-webkit-backdrop-filter:none}
.toast{border-radius:999px;padding:8px 8px 8px 20px}
/* In an open sheet the toast sits at the top of the screen, clear of the fields and buttons. */
dialog .toast{top:calc(12px + env(safe-area-inset-top));bottom:auto}
/* Phones: every section is a white card on the gray page, like a grouped list. */
@media (max-width:540px){
  .site-header{padding-bottom:8px}
  .trips{background:var(--surface);border-radius:var(--r-xl);padding:20px 20px 10px}
}
@media print{.card{border:1px solid #ccc}}
/* Flow: one column, one step after the other. Arrival, the answer in green, departure, the days left, Add.
   Everything else waits in a grouped list of folds below. */
.shell{max-width:680px}
main,.workspace{gap:16px}
.workspace>.plan{position:static}
.plan-form{grid-template-columns:minmax(0,1fr);gap:14px;padding-top:0;border-top:0;align-items:stretch}
@keyframes rise{from{opacity:0;transform:translateY(6px)}}
.plan-actions .primary-button{min-height:50px;padding:0 28px;font-size:17px;flex:1 1 auto}
/* Folds: one white grouped list. */
.endnotes{display:grid;background:var(--surface);border-radius:var(--r-xl);padding:4px 24px;margin-top:0}
.endnotes>*+*{border-top:1px solid var(--border)}
.endnotes .fold,.endnotes .rules{padding:0;border-radius:0;background:none;box-shadow:none}
.endnotes .fold>summary{min-height:54px;font-size:17px;font-weight:400;color:var(--text)}
@media (max-width:540px){
  .site-header h1{font-size:30px}
  .endnotes{padding:2px 20px}
}
/* The planner: only the two dates and the answers. */
.plan-head:has(.plan-now:empty){display:none}
.plan{display:grid;scroll-margin-top:16px;gap:18px;padding:24px}
.plan-actions .primary-button:disabled{display:none}
.trip-list .record-name small.record-verdict.bad{color:var(--danger)}
.trip-list .record-name small.record-verdict.check{color:var(--check)}
.trip-list .record-name small.record-verdict.ok{color:var(--ok)}
.trip-list .trip-verdict{margin:-8px 0 10px 0}
.trip-list .record-days{font-weight:500;color:var(--text-2)}
@media (max-width:540px){.trip-list .trip-main{grid-template-columns:minmax(0,1fr) auto 12px;gap:10px}.trip-list .trip-verdict{margin-left:0}.plan{padding:20px}}
@media (max-width:380px){.trip-list .trip-main{grid-template-columns:minmax(0,1fr) auto 12px}}
.endnotes>:first-child,.endnotes>:first-child>summary{border-top:0}
.trip-list .record-name b{font-size:16px;font-weight:500}
.site-header .lede{font-size:17px}
.plan-actions:not(:has(>button:not([hidden]):not(:disabled))){display:none}

/* Plain messages, aligned results, one calendar, quieter editor. */
@media (min-width:700px){.plan-actions .primary-button{flex:0 1 280px}}
dialog input[type=checkbox]{accent-color:var(--accent)}
.edit-more{margin-top:4px}

/* The start page is the calendar: arrival and departure side by side above it, and the picked days marked in it. */
/* The arrows sit on the line of the month name. */
.plan-calendar{position:relative}
.plan-actions{scroll-margin-bottom:24px}
#calendar{touch-action:pan-y}
/* What to tap next. */
.plan-hint{font-size:15px;font-weight:500;color:var(--text-2)}
.plan-hint:empty{display:none}
/* The row arrow is drawn here, not typed into the page, so it is not part of the row's text. */
.record-arrow::before{content:"›"}
/* Sync between devices */
#sync-body p{font-size:15px}
#sync-join{display:grid;gap:10px;justify-items:start;margin-top:8px}
#sync-join .field{width:100%}
.sync-code{font:600 24px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.04em;color:var(--text);user-select:all;-webkit-user-select:all}

/* Overview: the plan in four figures and one bar. */
.overview{display:grid;gap:14px}
.overview .ov-title{font-size:20px;font-weight:700;line-height:1.25;color:var(--text)}
.overview.bad .ov-title{color:var(--danger)}
.overview .ov-note{font-size:15px;color:var(--text-2)}
.overview .link-button{display:inline;min-height:0;padding:6px 0}
.figs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 18px}
.fig{display:grid;gap:2px;align-content:start;min-width:0}
.fig-label{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:400;color:var(--text-3)}
.fig-value{font-size:21px;font-weight:700;line-height:1.2;letter-spacing:-.02em;color:var(--text);font-variant-numeric:tabular-nums}
.fig-note{font-size:13px;line-height:1.35;color:var(--text-2)}
.fig.bad .fig-value{color:var(--danger)}
@media (min-width:700px){.figs{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Sliders */
.sliders{display:grid;gap:10px;padding:14px 16px;border-radius:var(--r-lg);background:var(--surface-2)}
.sliders[hidden]{display:none}
.slider{display:grid;grid-template-columns:1fr auto;align-items:center;gap:2px 12px;font-size:15px;font-weight:600;color:var(--text)}
.slider>.track,.slider>input{grid-column:1/-1}
.slider output{font-weight:500;color:var(--text-2);font-variant-numeric:tabular-nums}
.slider input{width:100%;min-height:36px;margin:0;accent-color:var(--ok);cursor:pointer}
.slider input:disabled{cursor:default;opacity:.5}

/* Calendar: every month in one scrolling list, weekdays pinned on top. */
.plan-calendar{display:grid;gap:10px}
.legend{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:12px;color:var(--text-2)}
.key{display:inline-flex;align-items:center;gap:6px}
.key::before{content:"";width:12px;height:12px;border-radius:4px}
.key.done::before{background:var(--trip-done)}
.key.planned::before{background:var(--trip-planned)}
.key.pick::before{background:var(--ok)}
.key.can::before{content:"12";width:auto;height:auto;border-radius:0;background:none;color:var(--ok);font-weight:600;font-size:12px}
.months{position:relative;display:block;margin:0 -6px;padding:0 6px 8px}
.cal-weekdays{position:sticky;top:var(--chips-h,48px);z-index:2;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));padding:6px 0;background:var(--surface);box-shadow:0 1px 0 var(--border);font-size:12px;font-weight:600;color:var(--text-3);text-align:center}
.month{padding-top:14px}
.month h3{margin:0 0 8px 2px;font-size:17px;font-weight:700}
.month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px 0}
.months .calendar-day{min-width:0;border-radius:var(--r-sm)}
/* Saved trips and the plan run as bars across the week: square inside, round at both ends. */
.calendar-day.done,.calendar-day.planned,.calendar-day.now,.calendar-day.next,.calendar-day.review,.calendar-day.pick,.calendar-day.can,.calendar-day.over{border-radius:0}
.calendar-day.run-start{border-top-left-radius:var(--r-sm);border-bottom-left-radius:var(--r-sm)}
.calendar-day.run-end{border-top-right-radius:var(--r-sm);border-bottom-right-radius:var(--r-sm)}
.calendar-day.done{background:var(--trip-done);color:var(--text-2)}
.calendar-day.planned,.calendar-day.next,.calendar-day.now{background:var(--trip-planned);color:var(--possible)}
.calendar-day.review{background:var(--check-soft);color:var(--check)}
.calendar-day.pick{background:color-mix(in srgb,var(--ok) 26%,transparent);color:var(--text)}
.calendar-day.pick.edge{background:var(--ok);color:var(--on-ok)}
.calendar-day.can{background:none;color:var(--ok);font-weight:600}
.calendar-day.over{background:var(--danger-soft);color:var(--danger)}
.calendar-day.can>span:first-child,.calendar-day.pick>span:first-child,.calendar-day.over>span:first-child{text-decoration:none;color:inherit}
.calendar-day.first{box-shadow:inset 0 0 0 2px var(--ok)}
.calendar-day.first.pick.edge{box-shadow:inset 0 0 0 2px var(--ok),inset 0 0 0 4px var(--surface)}
.calendar-day[data-tag]::after{content:attr(data-tag);position:absolute;left:6px;bottom:4px;font-size:9px;font-weight:700;letter-spacing:.01em;white-space:nowrap;pointer-events:none}
@media (forced-colors:active){.calendar-day.done,.calendar-day.planned,.calendar-day.now,.calendar-day.next,.calendar-day.pick,.calendar-day.can,.calendar-day.over{forced-color-adjust:none;outline:1px solid CanvasText;outline-offset:-1px}.calendar-day.first{outline:3px solid Highlight}}

/* Slider marks: a faint line above the arrival slider shows the longest stay for each arrival day,
   a faint tick on the departure and stay tracks shows the last possible day. The ends sit where the thumb's centre can reach. */
.track{position:relative}
.mark{position:absolute;top:6px;bottom:6px;left:calc(12px + (100% - 24px) * var(--at,0));width:2px;margin-left:-1px;border-radius:1px;background:var(--text-3);opacity:.55;pointer-events:none}
.mark[hidden]{display:none}

/* Month chips: one tap to any month of the year; the month in view is filled. */
.month-chips{position:sticky;top:0;z-index:3;display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;margin:0 -6px -10px;padding:8px 6px;background:var(--surface)}
.month-chips::-webkit-scrollbar{display:none}
.chip{flex:none;min-height:32px;padding:0 12px;border-radius:999px;background:var(--fill);font-size:13px;font-weight:600;color:var(--text-2)}
.chip.on{background:var(--ink);color:var(--on-ink)}
.cal-earlier{display:block;margin:10px auto 0;font-size:14px}
/* Shorter day cells so more of the year fits. */
.months .calendar-day{height:40px}
@media (pointer:coarse){.chip{min-height:36px}}

/* Explanations on demand: a small "i" marks a figure that has one; it opens on hover, tap or keyboard focus. */
.fig.tip{position:relative;display:grid;gap:2px;align-content:start;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;letter-spacing:inherit;cursor:help}
.fig.tip .fig-label::after{content:"i";display:inline-grid;place-items:center;width:13px;height:13px;border-radius:50%;box-shadow:inset 0 0 0 1px currentColor;font:600 9px/1 var(--sans);opacity:.7}
.tip-text{display:none;text-align:left;position:absolute;z-index:5;left:0;top:calc(100% + 6px);width:max-content;max-width:min(240px,70vw);padding:8px 11px;border-radius:10px;background:var(--ink);color:var(--on-ink);font-size:13px;font-weight:500;line-height:1.35;letter-spacing:0;box-shadow:var(--e3);pointer-events:none}
.figs>.tip:nth-child(even)>.tip-text{left:auto;right:0}
@media (hover:hover){.tip:hover>.tip-text{display:block}}
.tip:focus-visible>.tip-text,.tip.open>.tip-text{display:block}
/* A slider's value explains its tick on hover or tap. */
.slider-value.tip{position:relative;padding:0;border:0;background:none;font:inherit;color:inherit;cursor:help;display:inline-flex;align-items:center;gap:6px}
.slider-value>.tip-text{left:auto;right:0}
/* The longest stay for an arrival on that day, small and quiet under each free future day; hidden where the plan fills the day. */
.calendar-day[data-cap]::before{content:attr(data-cap);position:absolute;left:7px;bottom:5px;font-size:10px;font-weight:500;line-height:1;color:var(--text-3);font-variant-numeric:tabular-nums;pointer-events:none}
.calendar-day.pick::before,.calendar-day.can::before,.calendar-day.over::before,.calendar-day.first::before{display:none}
.key.num::before{display:none}
.key.num b{font-size:10px;font-weight:500;color:var(--text-3)}
/* The calendar has its own card under the trip list, so "Your trips" sits right under "Add trip". */
.cal-card{padding:20px 24px 12px}
@media (max-width:540px){.cal-card{padding:16px 20px 8px}}
