/* trip — all styles. Mobile refinements live in the @media (max-width:900px) block. */
:root{
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --display:-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --mono:"SF Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;

  --bg:#FFFFFF; --bg2:#F5F5F7; --fill:#F5F5F7; --fill2:#EBEBF0;
  --text:#1D1D1F; --text2:#6E6E73; --text3:#86868B; --text4:#B4B4BB;
  --sep:#D2D2D7; --sep2:#E9E9ED;
  --blue:#0071E3; --blue-bg:#EAF2FD;
  --red:#C7362B; --amber:#8A6100;

  --gt:80px; --gn:26px; --gi:34px;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.45;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow:hidden;letter-spacing:normal}
::selection{background:#CFE3FB}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;text-align:left;letter-spacing:inherit}
input{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:5px}
[contenteditable]{outline:none}
[contenteditable]:focus{background:#EAF2FD80;box-shadow:0 0 0 3px #EAF2FD80;border-radius:3px}
.app{display:flex;flex-direction:column;height:100%}

/* colour tones ─ tile tint + glyph colour per category */
.t-air{color:#0071E3;--tint:#E9F1FD;--tone:#0071E3}
.t-rail{color:#5856D6;--tint:#EDEDFB;--tone:#5856D6}
.t-bus,.t-car,.t-other{color:#6E6E73;--tint:#F0F0F2;--tone:#6E6E73}
.t-sea{color:#0A7E9E;--tint:#E6F2F6;--tone:#0A7E9E}
.t-place{color:#248A3D;--tint:#E9F5EC;--tone:#248A3D}
.t-food{color:#C2410C;--tint:#FBEEE8;--tone:#C2410C}
.t-stay{color:#7A3FBF;--tint:#F2ECFB;--tone:#7A3FBF}
.t-warn{color:var(--red);--tint:#FBECEA;--tone:var(--red)}
.t-idea{color:var(--amber);--tint:#F8F1E2;--tone:var(--amber)}
.t-text{color:#6E6E73;--tint:#F0F0F2;--tone:#6E6E73}

/* ── top bar ────────────────────────────────────────── */
.topbar{display:flex;align-items:stretch;gap:14px;padding:0 14px;height:62px;flex:0 0 auto;
  border-bottom:1px solid var(--sep2);position:relative;z-index:40;background:var(--bg)}
.trip-btn{display:flex;flex-direction:column;justify-content:center;gap:0;padding:0 8px;border-radius:8px;max-width:320px;flex:0 1 auto;min-width:0}
.trip-btn:hover{background:var(--fill)}
.trip-btn .row1{display:flex;align-items:center;gap:5px}
.trip-btn .nm{font-family:var(--display);font-size:20px;font-weight:600;letter-spacing:-.014em;line-height:1.15;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.trip-btn .cv{color:var(--text3);display:flex;padding-top:2px}
.trip-dates{font-size:12.5px;color:var(--text2);white-space:nowrap;line-height:1.3;overflow:hidden;text-overflow:ellipsis}
.chips{display:flex;align-items:stretch;gap:1px;overflow-x:auto;flex:1 1 auto;scrollbar-width:none;min-width:0}
.chips::-webkit-scrollbar{display:none}
.chip{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;
  padding:0 11px;border-bottom:2px solid transparent;white-space:nowrap;flex:0 0 auto}
.chip .d{font-size:13.5px;font-weight:500;color:var(--text);line-height:1.3}
.chip .w{font-size:11.5px;color:var(--text3);line-height:1.3}
.chip:hover .d{color:var(--blue)}
.chip.on{border-bottom-color:var(--blue)}
.chip.on .d,.chip.on .w{color:var(--blue)}
.chip.empty .d{color:var(--text3)}
.addday{flex:0 0 auto;width:30px;display:flex;align-items:center;justify-content:center;color:var(--text2);border-radius:8px;margin:14px 2px}
.addday:hover{background:var(--fill);color:var(--text)}
.tools{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.pill{display:flex;align-items:center;gap:6px;border:1px solid var(--sep);border-radius:8px;padding:6px 11px;
  font-size:13px;font-weight:500;color:var(--text);white-space:nowrap}
.pill:hover{background:var(--fill)}
.pill.on{background:var(--fill)}
.pill svg{color:var(--text2)}
.iconbtn{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;color:var(--text2)}
.iconbtn:hover{background:var(--fill);color:var(--text)}
.saved{font-size:12.5px;color:var(--text3);white-space:nowrap;min-width:46px}

.main{display:flex;flex:1 1 auto;min-height:0;position:relative}
.doc{flex:1 1 auto;min-width:0;overflow-y:auto;overscroll-behavior:contain;background:var(--bg)}
.doc-inner{max-width:790px;margin:0 auto;padding:8px 26px 42vh 58px}

/* focus bar */
.focusbar{display:flex;align-items:center;gap:10px;padding:14px 0 2px}
.backlink{display:flex;align-items:center;gap:4px;font-size:13.5px;color:var(--blue);padding:4px 8px 4px 4px;border-radius:7px}
.backlink:hover{background:var(--fill)}
.stepper{margin-left:auto;display:flex;gap:2px}
.stepper button{width:28px;height:28px;border-radius:7px;color:var(--text2);display:flex;align-items:center;justify-content:center}
.stepper button:hover{background:var(--fill);color:var(--text)}

/* ── day ────────────────────────────────────────────── */
.day{position:relative;margin-bottom:10px}
.day-head{position:sticky;top:0;z-index:14;background:var(--bg);padding:18px 0 12px;border-bottom:1px solid var(--sep2);margin-bottom:6px}
.day-line{display:flex;align-items:flex-start;gap:16px}
.day-when{font-family:var(--display);font-size:21px;font-weight:600;letter-spacing:-.015em;line-height:1.2;
  border-radius:7px;padding:1px 5px;margin-left:-5px}
.day-when:hover{color:var(--blue)}
.day-meta{margin-left:auto;display:flex;flex-direction:column;align-items:flex-end;text-align:right;min-width:0}
.dm1{display:inline-flex;align-items:center;gap:7px;padding:3px 0}
.day-where{font-size:15px;font-weight:600;letter-spacing:-.005em;display:inline-block;min-width:16px}
.day-where:empty:not(:focus)::before{content:"Add city";color:var(--text4);font-weight:400}
.arrow2{color:var(--text3);font-weight:400}
.day-where.dest:empty:not(:focus)::before{content:"Arrival";color:var(--text4);font-weight:400}
.destwrap{display:inline-flex;align-items:baseline;gap:7px}
.dm1 .ghost{max-width:0;min-width:0;margin-left:-7px;opacity:0;overflow:hidden;white-space:nowrap;pointer-events:none;
  transition:max-width .26s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin-left .26s cubic-bezier(.4,0,.2,1)}
.dm1:hover .ghost,.dm1:focus-within .ghost{max-width:88px;margin-left:0;opacity:1;pointer-events:auto}
@media (prefers-reduced-motion:reduce){.dm1 .ghost{transition:none}}
.wx{display:inline-flex;align-items:center;gap:4px;font-size:13.5px;color:var(--text2);white-space:nowrap;flex:0 0 auto}
.wx svg{color:var(--text3)}
.dm2{font-size:13px;color:var(--text2);margin-top:1px;display:flex;align-items:center;justify-content:flex-end;gap:6px}
.day-more{opacity:0;width:26px;height:26px;border-radius:7px;display:flex;align-items:center;justify-content:center;color:var(--text3);flex:0 0 auto}
.day-more:hover,.day-more:focus-visible{opacity:1}
.day-more:hover{background:var(--fill);color:var(--text)}

.rows{position:relative}
.spine{position:absolute;left:calc(var(--gt) + var(--gn)/2);top:0;bottom:0;width:1px;background:var(--sep2);pointer-events:none}

/* ── row ────────────────────────────────────────────── */
.row{position:relative;display:flex;align-items:flex-start;padding:9px 0;border-radius:10px}
.row:hover{background:#FAFAFB}
.row.sel{background:var(--blue-bg)}
.row.lit{background:#FFF6E0}
.row.dragging{opacity:.35}
.ctl{position:absolute;left:-48px;top:11px;display:flex;gap:2px;opacity:0;transition:opacity .12s}
.row:hover .ctl,.row.sel .ctl,.ctl:focus-within{opacity:1}
.ctl button{width:22px;height:22px;display:flex;align-items:center;justify-content:center;color:var(--text4);border-radius:6px}
.ctl button:hover{background:var(--fill2);color:var(--text2)}
.ctl .drag{cursor:grab;touch-action:none}
.ctl .drag:active{cursor:grabbing}
.row.dragging{opacity:.3}
.ghostrow{position:fixed;z-index:1250;pointer-events:none;background:var(--bg);border-radius:10px;
  box-shadow:0 10px 30px rgba(0,0,0,.18),0 0 0 1px var(--sep2);padding:9px 14px 9px 0;opacity:.97;
  max-width:820px;cursor:grabbing}
.ghostrow .ctl,.ghostrow .more{display:none}
.drop-line::before{content:"";position:absolute;left:-4px;top:-3px;width:8px;height:8px;
  border-radius:50%;background:var(--blue)}
.more{position:absolute;right:2px;top:8px;width:26px;height:24px;display:flex;align-items:center;justify-content:center;
  color:var(--text3);border-radius:7px;opacity:0}
.more:hover,.row.sel .more,.more:focus-visible{opacity:1}   /* only on its own spot, or a selected row */
.more:hover{background:var(--fill2);color:var(--text)}
.more.on{opacity:1;background:var(--fill2);color:var(--text)}

.time{flex:0 0 var(--gt);font-size:13px;color:var(--text2);font-variant-numeric:tabular-nums;
  padding-top:6px;white-space:nowrap;min-height:18px;letter-spacing:-.002em}
.tspace{flex:0 0 var(--gt)}
/* memo + prose blocks start their box at the icon column (gt+gn); each then adds
   gi of its own left inset, so their CONTENT lands on the same rail as the block
   names above and below (gt+gn+gi). Identical at every window width. */
.tspace.wide{flex:0 0 calc(var(--gt) + var(--gn))}
.node{flex:0 0 var(--gn);display:flex;justify-content:center;padding-top:11px;position:relative;z-index:2}
.node i{width:9px;height:9px;border-radius:50%;background:var(--bg);border:1.5px solid var(--sep);display:block}
.row.sel .node i{border-color:var(--blue);background:var(--blue)}
.mark{flex:0 0 var(--gi);display:flex;justify-content:flex-start;padding-top:2px}
.tile{width:28px;height:28px;border-radius:8px;background:var(--tint);display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.body{flex:1 1 auto;min-width:0;padding-right:30px}

.nameline{display:flex;align-items:center;gap:8px;min-height:20px}
.name{font-size:15px;font-weight:600;letter-spacing:-.006em;color:var(--text);display:inline-block;max-width:100%;min-width:24px}
.name:empty:not(:focus)::before{content:attr(data-ph);color:var(--text4);font-weight:400}
.sub{font-size:13px;color:var(--text2);margin-top:1px}
.sub>span{display:inline-block;min-width:18px}
.sub>span[data-ph]:empty:not(:focus)::before{content:attr(data-ph);color:var(--text4)}
.tag{font-size:13px;color:var(--text2);display:inline-block}
.status{margin-left:auto;font-size:12.5px;font-weight:500;white-space:nowrap;flex:0 0 auto;padding:1px 7px;border-radius:7px}
.status:hover{background:var(--fill2)}
.status.booked{color:#1D7A3E}
.status.maybe{color:#8A6100}
.status.need{color:var(--red)}
.status.none{color:var(--text4);font-weight:400}
.tline .status{margin-left:auto}
.tag::before{content:"·";margin:0 6px;color:var(--text4)}
.note{background:var(--fill);border-radius:9px;padding:7px 11px;margin-top:8px;font-size:13.5px;color:var(--text2);
  white-space:pre-wrap;display:block;line-height:1.42}
.row.sel .note{background:#FFFFFFAA}
.note:empty::before{content:"Note";color:var(--text4)}
.addnote{font-size:13px;color:var(--blue);margin-top:6px;display:none}
.row.sel .addnote{display:block}

.tline{display:flex;align-items:baseline;gap:9px;flex-wrap:wrap}
.code{font-size:15px;font-weight:600;letter-spacing:-.004em;display:inline-block;min-width:38px}
.code:empty:not(:focus)::before{content:attr(data-ph);color:var(--text4);font-weight:400}
.time:empty::before{content:attr(data-ph);color:var(--text4);font-weight:400}
.carrier{font-size:13px;color:var(--text2);display:inline-block}
.legs{display:flex;align-items:baseline;gap:8px;margin-top:3px;font-size:15px;font-weight:600;letter-spacing:-.004em;
  font-variant-numeric:tabular-nums}
.legs span[contenteditable]{display:inline-block;min-width:28px}
.legs .term[contenteditable]{min-width:0}   /* "Terminal 2" must not reserve airport-code width */
.legs .term:empty{min-width:14px}           /* …but an empty one still needs a click target */
.legs [data-ph]:empty:not(:focus)::before{content:attr(data-ph);color:var(--text4);font-weight:400}
.legs .arrow{color:var(--text3);font-weight:400}
.legs .to-t{margin-left:auto;font-size:14px;font-weight:400;color:var(--text);white-space:nowrap}
.legs .to-t span[contenteditable]{min-width:36px}
.legs .dv{color:var(--text3)}
.plusday{font-size:10px;color:var(--text3);margin-left:2px;vertical-align:super}
.leg{display:inline-flex;align-items:baseline;gap:7px}
.term{font-size:13px;font-weight:400;color:var(--text2);display:inline-block;min-width:14px}
.termwrap{display:inline-flex;align-items:baseline;gap:5px}
.termwrap .tlabel{font-size:13px;font-weight:400;color:var(--text3)}
[data-sugg]:hover,[data-mask]:hover{background:#0000000A;border-radius:4px;box-shadow:0 0 0 3px #0000000A}
[data-sugg]:focus,[data-mask]:focus{box-shadow:0 0 0 3px #EAF2FD80}
.meta-line{font-size:13px;color:var(--text2);margin-top:3px;font-variant-numeric:tabular-nums}
.meta-line span[contenteditable]{display:inline-block;min-width:14px}
.meta-line [data-ph]:empty:not(:focus)::before{content:attr(data-ph);color:var(--text4)}
.meta-line .dv{color:var(--text4)}

.memo{border-left:3px solid var(--sep);border-radius:12px;padding:8px 12px 9px calc(var(--gi) - 3px);
  white-space:pre-wrap;font-size:14.5px;color:var(--text2);line-height:1.4}
.memo.note{border-left-color:#8E8E93;background:#F2F2F5}
.memo.warn{border-left-color:var(--red);background:#FBEDEA}
.memo.idea{border-left-color:#C99A2E;background:#FAF3E2}
.memo-head{display:flex;align-items:center;gap:8px;margin-bottom:3px}
.memo-head .status{margin-left:auto}
.memo-kind{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;color:var(--red)}
.memo-kind svg{width:13px;height:13px;flex:0 0 auto}
.memo.note .memo-kind{color:var(--text3)}
.memo.idea .memo-kind{color:var(--amber)}
.memo>[data-f="text"]{display:inline-block;min-width:60px;color:var(--text)}
.memo>[data-f="text"]:empty:not(:focus)::before{content:"Write a note";color:var(--text4)}
.prose{font-size:14.5px;line-height:1.5;color:var(--text);white-space:pre-wrap;padding-left:var(--gi)}
.prose.h{font-family:var(--display);font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--text)}
.prose:empty::before{content:"Write anything";color:var(--text4)}
.divider-line{height:1px;background:var(--sep2);margin:9px 0}

.conn{display:flex;align-items:center;font-size:13px;color:var(--text3);padding:1px 0}
.legmode{border-radius:6px;padding:1px 5px;margin-left:-5px}
.legmode:hover{background:var(--fill2);color:var(--text2)}
.legmore{margin-left:6px;color:var(--text4);display:inline-flex;align-items:center;border-radius:5px;padding:1px}
.legmore:hover{background:var(--fill2);color:var(--text2)}
.legmore.open{transform:rotate(180deg)}
.legsteps{margin:1px 0 7px calc(var(--gt) + var(--gn)/2 + 18px);padding-left:12px;
  border-left:1.5px solid var(--sep2);display:flex;flex-direction:column;gap:5px}
.legstep{display:flex;gap:9px;align-items:flex-start;font-size:12.5px;color:var(--text2);line-height:1.45}
.legstep .sdot{width:7px;height:7px;border-radius:50%;flex:0 0 auto;margin-top:5px;background:var(--text4)}
.legstep .sdot.ride{border-radius:2px;width:8px;height:8px;background:var(--text2)}
.legstep b{font-weight:600;color:var(--text)}
.legstep .q{color:var(--text3)}
.legstep .q i{font-style:normal;padding:0 1px}
.legnote{font-size:11.5px;color:var(--text4);padding-bottom:2px}
.conn .gap{flex:0 0 calc(var(--gt) + var(--gn) + var(--gi))}
.conn .lbl{white-space:nowrap;display:flex;align-items:center;gap:6px}
.conn .swap{opacity:0;margin-left:10px;font-size:12.5px;color:var(--blue)}
.conn:hover .swap{opacity:1}
.row.flat{padding:3px 0}
.row>.conn{flex:1 1 auto;width:100%}

/* details */

.parked{margin-top:14px;padding-top:11px;border-top:1px solid var(--sep2)}
.parked-h{font-size:12.5px;font-weight:600;color:var(--text2);margin:0 0 2px calc(var(--gt) + var(--gn) + var(--gi))}
.padd{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--blue);padding:4px 0;
  margin-left:calc(var(--gt) + var(--gn) + var(--gi) - 26px)}
.padd:hover{opacity:.72}
.row.park .tspace{flex:0 0 var(--gt)}
.day-end{display:flex;align-items:center;gap:10px;padding:8px 0 4px;margin-left:calc(var(--gt) + var(--gn) + var(--gi) - 26px)}
.day-end .add{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--blue);padding:4px 8px 4px 0;border-radius:8px}
.day-end .add:hover{opacity:.72}
.day-empty{font-size:14px;color:var(--text4)}
.day-add{display:flex;align-items:center;gap:2px;width:max-content}
/* invisible until the cursor is on the button ITSELF — hovering "Add item"
   next to it must not reveal it. pointer-events stays on so it can be hovered. */
.addmaybe{font-size:13.5px;color:var(--text3);padding:4px 8px;border-radius:7px;opacity:0;
  transition:opacity 0s}                       /* leaving hides it at once: no lingering fade */
.addmaybe:hover,.addmaybe:focus-visible{opacity:1;transition:opacity .12s}
.addmaybe:hover{background:var(--fill);color:var(--text2)}
.drop-line{position:absolute;left:calc(var(--gt) + var(--gn)/2);right:0;height:2px;background:var(--blue);border-radius:1px;pointer-events:none;z-index:20}

/* ── map ────────────────────────────────────────────── */
.split{flex:0 0 10px;cursor:col-resize;position:relative;z-index:2;background:var(--bg)}
.split::after{content:"";position:absolute;left:4px;top:0;bottom:0;width:1px;background:var(--sep2)}
.split:hover::after,.split.on::after{background:var(--blue)}
.mappane{flex:0 0 34%;min-width:0;background:var(--bg);display:flex;flex-direction:column;position:relative;z-index:1;isolation:isolate}
.mappane.hidden{display:none}
#mapArea{flex:1 1 auto;position:relative;min-height:0;background:var(--bg2)}
#leaf{position:absolute;inset:0}
.schematic{position:absolute;inset:0}
.schematic svg{width:100%;height:100%}
.map-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:13.5px;
  color:var(--text3);text-align:center;padding:0 38px;z-index:500;background:var(--bg2)}
.daynote{flex:0 0 auto;border-top:1px solid var(--sep2);padding:12px 16px 14px;background:var(--bg)}
.daynote .h{font-size:12.5px;font-weight:600;color:var(--text2);margin-bottom:3px}
.daynote .b{font-size:13.5px;color:var(--text);line-height:1.45;white-space:pre-wrap;min-height:20px}
.daynote .b:empty::before{content:"Anything about this day…";color:var(--text4)}

.leaflet-container{background:#EDEDF0;font-family:var(--font)}
.leaflet-bar{border:0!important;box-shadow:0 1px 4px rgba(0,0,0,.18);border-radius:8px;overflow:hidden}
.leaflet-bar a{width:30px!important;height:30px!important;line-height:30px!important;color:var(--text)!important;
  border-bottom-color:var(--sep2)!important;font-weight:400}
.leaflet-bar a:hover{background:var(--fill)!important}
.leaflet-control-attribution{font-size:10px!important;background:#FFFFFFCC!important;color:var(--text3)!important;border-radius:4px 0 0 0}
.leaflet-control-attribution a{color:var(--text2)!important}
.mpin{display:block;position:relative}
.mpin .dot{width:24px;height:24px;border-radius:50%;background:var(--tone,#0071E3);color:#fff;display:flex;align-items:center;
  justify-content:center;font-size:12px;font-weight:600;box-shadow:0 1px 4px rgba(0,0,0,.35);font-variant-numeric:tabular-nums}
.mpin .dot span{color:#fff}
.mpin::after{content:"";position:absolute;left:50%;top:21px;transform:translateX(-50%);
  border-left:4px solid transparent;border-right:4px solid transparent;border-top:6px solid currentColor}
.mpin.lit .dot{box-shadow:0 0 0 3px #FFFFFF,0 2px 7px rgba(0,0,0,.4);transform:scale(1.14)}
.glpin{position:relative;width:24px;height:28px;cursor:pointer}
.glpin .mpin{position:absolute;left:0;top:0}
.glpin:hover{z-index:6}
.gl-lbl{position:absolute;left:31px;top:2px;background:#fff;border-radius:8px;padding:4px 9px;font-size:12.5px;
  font-weight:500;color:var(--text);box-shadow:0 1px 4px rgba(0,0,0,.18);white-space:nowrap;pointer-events:none}
.mapboxgl-ctrl-group{border-radius:8px!important;box-shadow:0 1px 4px rgba(0,0,0,.18)!important;border:0!important}
.mapboxgl-ctrl-attrib{font-size:10px!important}
.map-lbl{background:#fff;border:0;border-radius:8px;padding:4px 9px;font-size:12.5px;font-weight:500;color:var(--text);
  box-shadow:0 1px 4px rgba(0,0,0,.18);white-space:nowrap}
.map-lbl::before{display:none}
.mp{cursor:pointer}
.mp circle.hit{fill:transparent}
.mp .ring{fill:#fff;stroke:currentColor;stroke-width:1.4}
.mp text{font-size:10px;font-weight:600;fill:currentColor;font-family:var(--font)}
.mp .lbl{fill:var(--text);paint-order:stroke;stroke:#fff;stroke-width:3.5px;stroke-linejoin:round;font-weight:500}
.mp.lit .ring{fill:currentColor}.mp.lit text{fill:#fff}

/* ── overlays ───────────────────────────────────────── */
.scrim{position:fixed;inset:0;background:#00000026;z-index:1000;display:none}
.scrim.on{display:block}
.sheet{position:fixed;top:14vh;left:50%;transform:translateX(-50%);width:min(560px,93vw);background:var(--bg);
  border-radius:14px;box-shadow:0 24px 60px -12px rgba(0,0,0,.3),0 2px 8px rgba(0,0,0,.08);z-index:1001;display:none;overflow:hidden}
.sheet.on{display:block;animation:pop .16s cubic-bezier(.2,.7,.3,1)}
@keyframes pop{from{opacity:0;transform:translateX(-50%) scale(.97)}}
.p-input{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--sep2)}
.p-input input{flex:1;border:0;background:none;font-size:16px;letter-spacing:-.006em}
.p-input input:focus{outline:none}
.p-input input::placeholder{color:var(--text4)}
.p-kind{font-size:12px;font-weight:500;color:var(--text2);background:var(--fill);border-radius:6px;padding:3px 8px;white-space:nowrap}
.p-list{max-height:min(340px,52vh);overflow-y:auto;padding:6px}
.p-item{display:flex;align-items:center;gap:12px;padding:8px 10px;border-radius:8px;cursor:pointer;width:100%}
.p-item.on{background:var(--fill)}
.p-item .ic{flex:0 0 24px;display:flex;justify-content:center}
.p-item .t{font-size:14.5px;flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.p-item .t em{font-style:normal;color:var(--text3)}
.p-item .t strong{font-weight:600}
.p-item .k{font-size:12.5px;color:var(--text3);white-space:nowrap}
.p-foot{padding:9px 16px;border-top:1px solid var(--sep2);background:var(--bg2);font-size:12px;color:var(--text2);
  display:flex;gap:16px;flex-wrap:wrap}
kbd{font-family:var(--font);font-size:11.5px;background:var(--bg);border:1px solid var(--sep);border-radius:4px;padding:1px 4px;color:var(--text2)}

.sugg{position:fixed;z-index:1150;background:#FFFFFFF8;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  border:1px solid var(--sep2);border-radius:10px;box-shadow:0 10px 30px -8px rgba(0,0,0,.26),0 1px 3px rgba(0,0,0,.1);
  padding:4px;min-width:172px;max-width:320px;max-height:248px;overflow-y:auto;display:none}
.sugg.on{display:block}
.si{display:flex;align-items:baseline;gap:9px;width:100%;padding:6px 9px;border-radius:6px;font-size:13.5px;white-space:nowrap}
.si.on{background:var(--fill)}
.si .v{font-weight:500;flex:0 0 auto}
.si .s{color:var(--text3);font-size:12.5px;overflow:hidden;text-overflow:ellipsis}
.pop{position:fixed;z-index:1150;background:var(--bg);border:1px solid var(--sep2);border-radius:12px;
  box-shadow:0 12px 34px -10px rgba(0,0,0,.28),0 1px 3px rgba(0,0,0,.1);padding:12px 13px;display:none}
.pop.on{display:block}
.pop .two{display:flex;gap:10px}
.pop label{display:block}
.pop .lb{font-size:12px;color:var(--text2);display:block;margin-bottom:4px}
.pop input{padding:6px 9px;border:1px solid var(--sep);border-radius:8px;font-size:13.5px;background:var(--bg);width:150px}
.pop input:focus{outline:none;border-color:var(--blue)}
.pop .go{display:flex;justify-content:space-between;align-items:center;margin-top:11px;gap:12px}
.pop .clear{font-size:13px;color:var(--text2)}
.pop .clear:hover{color:var(--red)}
.subdot{margin:0 6px;color:var(--text4)}
.tagbtn{font-size:13px;color:var(--text2);display:inline-block;border-radius:5px;padding:0 4px;margin:0 -4px}
.tagbtn:hover{background:var(--fill2);color:var(--text)}
.tagbtn.empty{color:var(--blue)}
.menu{position:fixed;z-index:1100;background:#FFFFFFF7;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  border:1px solid var(--sep2);border-radius:12px;box-shadow:0 12px 34px -10px rgba(0,0,0,.28),0 1px 3px rgba(0,0,0,.1);
  padding:5px;min-width:228px;max-height:70vh;overflow-y:auto;display:none}
.menu.on{display:block}
.mi{display:flex;align-items:center;gap:10px;width:100%;padding:7px 10px;border-radius:7px;font-size:13.5px;white-space:nowrap}
.mi:hover{background:var(--fill)}
.mi.dim{opacity:.45;cursor:default}
.mi.dim:hover{background:transparent}
.mi .k{margin-left:auto;font-size:12px;color:var(--text3)}
.mi.danger{color:var(--red)}
.mi .sw{width:10px;height:10px;border-radius:3px;background:currentColor;flex:0 0 auto}
.mi .sw.blank{background:none;box-shadow:inset 0 0 0 1.5px var(--sep)}
.mhead{font-size:12px;font-weight:600;color:var(--text3);padding:8px 10px 5px;display:flex;align-items:center;gap:8px}
.mhead button{color:var(--blue);font-size:13px}
.msep{height:1px;background:var(--sep2);margin:5px 3px}

.form{padding:14px 16px 16px}
.form label{display:block;margin-bottom:12px}
.form .hint{display:block;font-size:11.5px;color:var(--text4);font-weight:400;margin-top:1px}
.form .lb{font-size:12.5px;color:var(--text2);display:block;margin-bottom:5px}
.form input[type=text],.form input[type=date],.form input[type=number],.form input[type=password]{width:100%;padding:8px 11px;border:1px solid var(--sep);
  border-radius:9px;background:var(--bg);font-size:14.5px}
.form input:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px #0071E31F}
.form .two{display:flex;gap:12px}
.form .two label{flex:1}
.form .go{display:flex;gap:8px;justify-content:flex-end;margin-top:6px}
.btn{font-size:13.5px;font-weight:500;padding:8px 15px;border-radius:9px;border:1px solid var(--sep);background:var(--bg)}
.btn:hover{background:var(--fill)}
.btn.pri{background:var(--blue);color:#fff;border-color:var(--blue)}
.btn.pri:hover{background:#0062C4}
.triprow{display:flex;align-items:center;gap:12px;width:100%;padding:9px 10px;border-radius:8px}
.triprow:hover{background:var(--fill)}
.triprow .nm{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14.5px}
.triprow .dt{font-size:12.5px;color:var(--text3);white-space:nowrap}
.triprow.on .nm{font-weight:600}
.triprow .tick{color:var(--blue);flex:0 0 auto;opacity:0}
.triprow.on .tick{opacity:1}
.keys{padding:12px 18px 18px;display:grid;grid-template-columns:1fr 1fr;gap:7px 26px}
.keys div{display:flex;gap:12px;font-size:13px;color:var(--text2);align-items:baseline}
.keys div span{margin-left:auto;font-size:12px;color:var(--text3);white-space:nowrap}

.perfbox{position:fixed;right:14px;bottom:14px;z-index:1300;background:#1D1D1FF2;color:#fff;border-radius:10px;
  padding:10px 13px;font-size:11.5px;line-height:1.5;display:none;font-variant-numeric:tabular-nums;
  box-shadow:0 8px 24px rgba(0,0,0,.3);pointer-events:none;min-width:236px}
.perfbox.on{display:block}
.perfbox b{display:block;font-size:12px;margin-bottom:3px}
.perfbox span{display:block;color:#C9CBD0}
.authwrap{position:fixed;inset:0;background:rgba(250,250,251,.96);backdrop-filter:blur(6px);display:none;align-items:center;justify-content:center;z-index:900}
.authwrap.on{display:flex}
.authcard{width:300px;background:#fff;border:1px solid var(--sep);border-radius:14px;padding:22px;display:flex;flex-direction:column;gap:9px;box-shadow:0 12px 40px rgba(0,0,0,.08)}
.authcard .ah{font-size:20px;font-weight:700}
.authcard .as{font-size:13px;color:var(--text3);margin-bottom:6px}
.authcard input{border:1px solid var(--sep);border-radius:8px;padding:8px 10px;font-size:14px}
.aerr{color:var(--red);font-size:12.5px;min-height:15px}
.abtn{border-radius:8px;padding:8px;font-size:14px;background:var(--fill)}
.abtn:hover{background:var(--fill2)}
.abtn.pri{background:var(--blue);color:#fff}
.abtn.pri:hover{background:var(--blue)}
.abtn[disabled]{opacity:.6}
.alink{font-size:12.5px;color:var(--text3);margin-top:2px}
.alink:hover{text-decoration:underline}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(8px);background:#1D1D1FF2;color:#fff;
  border-radius:11px;padding:10px 16px;z-index:1200;font-size:13.5px;display:flex;gap:16px;align-items:center;
  opacity:0;pointer-events:none;transition:opacity .18s,transform .18s;box-shadow:0 8px 24px rgba(0,0,0,.24)}
.toast.on{opacity:1;transform:translateX(-50%);pointer-events:auto}
.toast button{color:#6EB4FF;font-size:13.5px;font-weight:500}
/* mobile-only chrome, hidden on desktop */
.fab{display:none}
.mapclose{display:none}

@keyframes sheetUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
@media (max-width:900px){
  /* iOS treats taps precisely and never flashes a grey box */
  *{-webkit-tap-highlight-color:transparent}
  html,body{overflow-x:hidden}
  .doc,.main,.doc-inner{max-width:100vw}
  .doc{-webkit-overflow-scrolling:touch}

  /* ── translucent nav bar (the signature iOS look) ── */
  .topbar{height:auto;min-height:calc(96px + env(safe-area-inset-top));flex-wrap:wrap;align-items:center;
    gap:8px;padding:calc(env(safe-area-inset-top) + 6px) 12px 0;
    background:rgba(255,255,255,.8);-webkit-backdrop-filter:saturate(180%) blur(20px);
    backdrop-filter:saturate(180%) blur(20px);border-bottom:.5px solid var(--sep)}
  .trip-btn{order:1;height:44px;justify-content:center;max-width:46vw;padding:0 6px 0 2px}
  .tools{order:2;height:44px;margin-left:auto;gap:8px}
  .addday,.trip-dates,.saved{display:none}
  .split{display:none}
  .ctl{display:none}
  .doc-inner{padding:4px 16px calc(44vh + env(safe-area-inset-bottom)) 16px}
  :root{--gt:70px;--gn:22px;--gi:32px}
  .pill{padding:7px 12px;border-radius:20px;font-size:14px}
  .pill:active,.iconbtn:active{opacity:.5}
  .iconbtn{width:36px;height:36px;border-radius:50%}   /* circular, to sit among the capsule pills */

  /* ── Apple Calendar-style date strip ── */
  .chips{order:3;flex:0 0 100%;height:auto;gap:5px;padding:4px 0 10px;margin:0 -12px;padding-left:12px;padding-right:12px}
  .chip{flex-direction:column;border-bottom:none;padding:5px 4px;min-width:46px;border-radius:14px;gap:3px}
  .chip .w{order:-1;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--text3)}
  .chip .d{font-size:13.5px;font-weight:600;color:var(--text);padding:3px 8px;border-radius:11px;line-height:1.15}
  .chip.on{border-bottom:none}
  .chip.on .d{background:var(--blue);color:#fff}
  .chip.on .w{color:var(--blue)}
  .chip:active .d{background:var(--fill2)}
  .chip.on:active .d{background:var(--blue)}

  /* ── day header: same type system as desktop, translucent + sticky ── */
  .day-head{padding:11px 0 9px;background:rgba(255,255,255,.82);
    -webkit-backdrop-filter:saturate(180%) blur(14px);backdrop-filter:saturate(180%) blur(14px);border-bottom:.5px solid var(--sep)}
  .day-line{flex-wrap:wrap;align-items:baseline;gap:6px}
  .day-when{flex:1 1 auto;white-space:normal;overflow-wrap:anywhere}
  .day-more{order:2}
  .day-meta{order:3;flex-basis:100%;margin:2px 0 0;text-align:left;align-items:flex-start}
  .dm1{justify-content:flex-start}
  .dm2{text-align:left;justify-content:flex-start}

  /* ── rows fit the screen; nothing scrolls sideways ── */
  .legs{flex-wrap:wrap;gap:5px 8px}
  .legs .to-t{margin-left:0;flex-basis:100%;white-space:normal}
  .tline,.meta-line{flex-wrap:wrap}
  .leg,.termwrap{min-width:0}
  .body,.nameline,.sub,.tline{min-width:0;max-width:100%}
  .name,.prose,.memo span,.note{overflow-wrap:anywhere}
  .row{border-radius:12px;padding:6px 0}
  .row:active:not(:focus-within){background:var(--fill)}
  /* selection is transient on mobile — no persistent blue background or dot */
  .row.sel{background:transparent}
  .row.sel .node i{border-color:var(--sep);background:#fff}
  .nameline{gap:0}
  /* memos (Idea/Note/Important) become tinted callout cards, text aligned with
     the block names above and below — the coloured edge is the card, not a
     bar floating in empty space */
  .name{line-height:1.3}                       /* wrapped titles read tight, not loose (was inherited 1.45) */
  /* tidy vertical rhythm */
  .day{margin-bottom:6px}
  .sub{margin-top:1px}
  .note{margin-top:6px;border-radius:12px}   /* match the 12px rows and memo cards */
  /* empty-day ghost label gets its own line above the add controls, not crammed
     inline where it wraps and collides with them */
  .day-end{flex-wrap:wrap}
  .day-empty{flex-basis:100%;order:-1;margin:0 0 2px}
  /* maximum-scale=1 in the viewport stops iOS from zooming on field focus, so
     the fonts stay the same size as desktop — no 16px bump, no auto-zoom */

  /* ── PRECISE hit areas, exactly like desktop — no invisible zones that steal
     taps meant for the fields next to a button (that was the ⋯ bug) ── */
  .more,.day-more{opacity:1;width:34px;height:34px}
  .body{padding-right:38px}                       /* reserve the gutter so ⋯ never overlaps content */
  .tile{width:28px;height:28px}                   /* 28px tile in a 32px column = 4px icon→name gutter (was 0) */
  .addmaybe{opacity:1}
  .more:active,.day-more:active,.tile:active,.status:active,.tagbtn:active,.addnote:active,.legmore:active,.legmode:active{opacity:.5}
  /* enlarge inline controls to a real touch target without shifting layout — the
     padding grows the hit box and negative margins cancel the growth (these
     controls have no persistent mobile background, so the expansion is invisible) */
  .status{min-height:32px;padding:6px 10px;display:inline-flex;align-items:center;align-self:center;margin-top:-5px;margin-bottom:-5px}
  /* a long chip (“Need to be booked”) wraps to its own line in a flight's title
     row — keep that line compact instead of a 32px-tall gap before the airports */
  .tline .status{min-height:24px;padding:3px 8px;margin-top:-2px;margin-bottom:-2px}
  .legmore{padding:9px;margin:-8px 0 -8px 2px}
  .legmode{padding:7px 8px;margin-top:-6px;margin-bottom:-6px}
  .tagbtn{padding:6px 6px;margin:-6px -6px}

  /* ── notch + home bar ── */
  .mappane{position:fixed;inset:0;flex:none!important;z-index:45;isolation:isolate}   /* full-screen map above the nav bar */
  .sheet,.menu{padding-bottom:calc(8px + env(safe-area-inset-bottom))}
  .toast{bottom:calc(20px + env(safe-area-inset-bottom))}
  /* horizontal insets too, so a landscape notch/home-bar never clips the nav bar,
     the timeline, the FAB, or the map's day-note editor */
  .topbar{padding-left:calc(12px + env(safe-area-inset-left));padding-right:calc(12px + env(safe-area-inset-right))}
  .doc-inner{padding-left:calc(16px + env(safe-area-inset-left));padding-right:calc(16px + env(safe-area-inset-right))}
  .daynote{padding-bottom:calc(14px + env(safe-area-inset-bottom));
    padding-left:calc(16px + env(safe-area-inset-left));padding-right:calc(16px + env(safe-area-inset-right))}
  /* keep scroll gestures inside the overlays instead of chaining to the page */
  .sheet,.menu,.p-list{overscroll-behavior:contain}

  /* ── bottom sheet: grabber + spring, above the keyboard ── */
  .scrim.on{background:rgba(0,0,0,.28);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:scrimIn .3s ease}
  @keyframes scrimIn{from{opacity:0}to{opacity:1}}
  /* the jump-to-row highlight eases out instead of a hard flash on/off */
  .row.lit{animation:rowLit 1s ease forwards}
  @keyframes rowLit{from{background:#FFF6E0}to{background:transparent}}
  .sheet{top:auto;left:0;right:0;bottom:0;transform:none;width:100%;max-width:100%;
    border-radius:20px 20px 0 0;max-height:88vh;overflow-y:auto;padding-top:12px}
  .sheet::before{content:"";position:absolute;top:7px;left:50%;transform:translateX(-50%);
    width:36px;height:5px;border-radius:3px;background:var(--sep);z-index:2}
  .sheet.on{animation:sheetUp .4s cubic-bezier(.32,.72,0,1)}
  .p-item:active,.mi:active,.triprow:active,.si:active{background:var(--fill2)}
  .mi,.p-item,.si,.triprow{min-height:44px}
  /* ⌘-shortcut badges are meaningless on a touch phone — drop them so menu
     rows read as clean iOS action labels, not a desktop menu */
  .mi .k{display:none}
  .p-foot{display:none}

  /* date popover fits a phone */
  .pop{max-width:calc(100vw - 20px)}
  .pop input{width:100%}

  /* a clear way out of the full-screen map — z-index must clear Leaflet's own
     panes (tile 200 … popup 700) and control layer (1000), which share this
     stacking context because .leaflet-container is z-index:auto; at 40 the pill
     was painted underneath the map and the map had no visible exit */
  .mapclose{display:inline-flex;align-items:center;gap:6px;position:absolute;
    top:calc(12px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:1000;
    background:rgba(255,255,255,.9);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);
    color:var(--text);border:.5px solid var(--sep);border-radius:20px;
    padding:9px 16px;font-size:14px;font-weight:600;box-shadow:0 4px 16px rgba(0,0,0,.12)}
  .mapclose:active{opacity:.5}

  /* thumb-reachable quick-add, styled like an iOS accent button */
  .fab{display:flex;align-items:center;justify-content:center;position:fixed;z-index:60;
    right:calc(18px + env(safe-area-inset-right));bottom:calc(20px + env(safe-area-inset-bottom));width:54px;height:54px;
    border-radius:27px;background:var(--blue);color:#fff;font-size:28px;font-weight:400;line-height:1;
    box-shadow:0 8px 22px rgba(0,113,227,.4);transition:transform .12s ease,opacity .12s ease}
  .fab:active{transform:scale(.92);opacity:.9}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

