:root { --bg:#14171f; --fg:#e6e9f0; --mute:#9aa; --line:#2a3040; --acc:#6aa8ff; --card:#1c212c; color-scheme: dark; } /* dark only */
* { box-sizing: border-box; }
body { --aw:max(340px, 34vw); margin:0; display:grid; grid-template-columns: var(--aw) 1fr; height:100vh; font:15px/1.45 system-ui, sans-serif; background:var(--bg); color:var(--fg); }
aside { overflow-y:auto; padding:0 16px 40px; border-right:1px solid var(--line); }
header { position:sticky; top:0; background:var(--bg); padding:12px 0 8px; z-index:2; border-bottom:1px solid var(--line); }
h1 { font-size:1.2rem; margin:0; } header p { margin:2px 0 8px; color:var(--mute); }
header div { display:flex; gap:10px; align-items:center; font-size:.85rem; } #status { flex:1; color:var(--mute); }
button { font:inherit; padding:3px 10px; border:1px solid var(--line); background:var(--card); color:var(--fg); border-radius:6px; cursor:pointer; }
button:hover { border-color:var(--acc); }
.city { margin:18px 0 6px; font-size:1.3rem; font-weight:700; color:var(--fg); cursor:pointer; user-select:none; }
.city:hover { color:var(--acc); }
.day { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:10px 12px; margin-bottom:8px; cursor:pointer; }
.day.sel { border-color:var(--acc); box-shadow:0 0 0 1px var(--acc); }
.day h3 { margin:0 0 4px; font-size:.95rem; display:flex; align-items:center; gap:4px; }
.day p { margin:4px 0; } .notes { color:var(--mute); font-size:.9rem; white-space:pre-line; }
.places { list-style:none; padding:0; margin:6px 0 0; font-size:.88rem; }
.places li { display:flex; gap:6px; padding:1px 0; } .places li span { flex:1; cursor:pointer; } .places li:hover span { color:var(--acc); }
.places button { padding:0 6px; border:0; background:none; color:var(--mute); }
textarea { width:100%; font:inherit; background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:6px; padding:6px; margin:2px 0; }
details { margin:12px 0; } summary { cursor:pointer; font-weight:600; }
details li { margin:4px 0; } ul.chk { list-style:none; padding:0; }
.hint { font-size:.8rem; color:var(--mute); margin-top:6px; }
#map { height:100vh; }
.num { background:#d9480f; color:#fff; border-radius:50%; width:32px; height:32px; text-align:center; font:700 16px/28px system-ui, sans-serif; border:2px solid #fff; box-shadow:0 2px 6px #0007; }
@media (max-width:760px) { body { grid-template-columns:1fr; grid-template-rows:42vh 1fr; height:100dvh; } #map { order:-1; height:auto; } aside { border:0; } }

.travel { white-space:pre-line; background:#e8590c18; border-left:3px solid #e8590c; padding:4px 8px; margin:4px 0; border-radius:4px; font-size:.9rem; }
.stay { display:flex; gap:6px; align-items:center; margin-bottom:6px; } .stay input { flex:1; font:inherit; padding:3px 6px; background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:6px; }
.home { background:#d9480f; border-radius:50%; width:26px; height:26px; box-sizing:border-box; font-size:14px; line-height:22px; text-align:center; border:2px solid #fff; box-shadow:0 2px 6px #0007; }
.stay button[data-act=zoomstay] { border:0; background:none; font-size:1.1rem; padding:0 2px; }
.legs { border-top:1px dashed var(--line); margin-top:6px; padding-top:4px; color:var(--mute); } .legs a { color:var(--acc); }
.places input { flex:1; font:inherit; padding:1px 4px; background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:4px; }
.travel { cursor:pointer; margin:8px 0; } .travel.sel { box-shadow:0 0 0 1px #e8590c; }
.places li { flex-wrap:wrap; } .stopinfo { flex-basis:100%; position:relative; margin:4px 0 6px; padding:8px 28px 8px 10px; background:var(--bg); border:1px solid var(--line); border-radius:8px; cursor:default; font-size:.88rem; color:var(--fg); }
.stopinfo h2 { font-size:.95rem; margin:0 0 4px; } .stopinfo p { margin:4px 0; } .stopinfo img { width:100%; border-radius:6px; } .stopinfo a { color:var(--acc); }
.stopinfo .x { position:absolute; top:2px; right:4px; border:0; background:none; font-size:1.2rem; }
.stopinfo img { max-height:110px; object-fit:cover; }
.places li, .stopinfo { scroll-margin-top:100px; }
@media (max-width:760px) { header p { display:none; } }
.stopinfo p:not(:last-child) { display:-webkit-box; -webkit-line-clamp:6; -webkit-box-orient:vertical; overflow:hidden; }
.places li.leg { display:block; }
.city small { font-size:.8rem; font-weight:400; color:var(--mute); margin-left:4px; }
.stay span { flex:1; cursor:pointer; } .stay button[data-act=editstay] { border:0; background:none; color:var(--mute); }
.day h3 button { padding:0 6px; border:0; background:none; }
[data-act=zoompt] { cursor:pointer; }
.grip { cursor:grab; color:var(--mute); user-select:none; margin-right:4px; } .places li .grip { flex:none; }
.dropbefore { box-shadow:0 -3px 0 var(--acc); } .dropafter { box-shadow:0 3px 0 var(--acc); } .dropend { outline:2px dashed var(--acc); }
.places li.active, .stay.active { --c:var(--acc); background:color-mix(in srgb, var(--c) 22%, transparent); border:1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius:4px; padding-left:6px; margin:-1px -1px -1px -7px; } /* same outline as a leg row; the negative margin cancels border+padding so the content doesn't shift */ .places li.active > span { font-weight:700; color:var(--acc); }
.num.act, .home.act { transform:scale(1.35); animation:pulse 1.4s ease-out infinite; z-index:1; }
@keyframes pulse { 0% { box-shadow:0 0 0 0 #d9480fcc, 0 2px 6px #0007; } 100% { box-shadow:0 0 0 14px #d9480f00, 0 2px 6px #0007; } }
.stay.active { font-weight:700; }
.places li span[data-act=zoomstay] { flex:none; }
.mk { transform:translateY(50%); } .dot { width:10px; height:10px; border-radius:50%; background:#99a; border:1px solid #667; opacity:.7; }
.leg[style] { color:var(--c); border-radius:4px; padding-left:6px; } /* the text carries the route's colour; the box only appears on the active route */
.leg.on[style] { background:color-mix(in srgb, var(--c) 22%, transparent); }
.leg.on { font-weight:700; }
.leg [data-act=routeinfo] { float:right; padding:0 6px; border:0; background:none; } .routebox { clear:both; margin:4px 0; } .routebox p { margin:3px 0; } .routebox small { color:var(--mute); }
.leg.on .routebox { font-weight:400; color:var(--fg); }

/* ---- visual polish: one warm accent (matches the map markers), softer surfaces, tighter type ---- */
:root { --bg:#101216; --fg:#e9ebef; --mute:#8d94a1; --line:#242933; --acc:#ff8f55; --card:#171a21; --r:10px; }
body { font:14.5px/1.5 ui-sans-serif, "SF Pro Text", system-ui, sans-serif; -webkit-font-smoothing:antialiased; }
aside { padding:0 18px 56px; scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
header { padding:18px 0 12px; background:color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter:blur(12px); border-bottom:1px solid var(--line); }
h1 { font-size:1.35rem; line-height:1.15; letter-spacing:-.02em; font-weight:650; text-wrap:balance; }
header p { margin:6px 0 12px; font-size:.85rem; }
button { border-radius:8px; padding:4px 12px; transition:border-color .15s, background .15s, transform .1s; }
button:hover { border-color:var(--acc); background:color-mix(in srgb, var(--acc) 10%, var(--card)); }
button:active { transform:scale(.97); }
button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible { outline:2px solid var(--acc); outline-offset:2px; }
.city { margin:26px 0 8px; font-size:1.1rem; font-weight:650; letter-spacing:-.01em; transition:color .15s; }
.city small { font-size:.78rem; font-weight:450; letter-spacing:0; }
.day, .stopinfo { border-radius:var(--r); }
.day { padding:12px 14px; margin-bottom:10px; transition:border-color .15s, background .15s; }
.day:hover { border-color:color-mix(in srgb, var(--acc) 45%, var(--line)); }
.day.sel { background:color-mix(in srgb, var(--acc) 6%, var(--card)); }
.day h3 { font-size:.95rem; font-weight:600; }
.places { margin-top:8px; } .places li { padding:3px 0; }
.travel { border-radius:8px; font-size:.86rem; padding:6px 10px; }
.stopinfo { background:var(--bg); }
textarea, .stay input, .places input { border-radius:8px; }
details { margin:16px 0 0; padding-top:12px; border-top:1px solid var(--line); }
summary { font-size:.8rem; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--mute); }
summary:hover { color:var(--fg); }
details[open] > summary { color:var(--fg); }
input[type=checkbox] { accent-color:var(--acc); }
ul.chk li { padding:6px 0; }
ul.chk li + li { border-top:1px solid color-mix(in srgb, var(--line) 60%, transparent); }
@media (prefers-reduced-motion:reduce) { * { transition:none !important; } }

/* day description sits behind the info button */
.day h3 .dayinfo { margin-left:auto; }
.day:not(.sel) :is(button, [data-act=zoomstay]) { opacity:.55; } .day:not(.sel) :is(button, [data-act=zoomstay]):hover { opacity:1; } /* icons wake up when their day is selected */
#fold { display:none; margin-left:auto; }
@media (max-width:760px) {
  #fold { display:inline-block; }
  body.folded { grid-template-rows:1fr auto; }
  body.folded aside { overflow:hidden; padding-bottom:0; } body.folded #days, body.folded #info { display:none; }
  body.folded header { position:static; }
}
.legs [data-act=zoompt] { padding:0 3px; border:0; background:none; cursor:pointer; }
.tedit { display:flex; flex-direction:column; gap:6px; margin:4px 0; } .tedit div { display:flex; gap:6px; }
.tedit input { flex:1; min-width:0; font:inherit; padding:3px 6px; background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:8px; } .tedit input.sm { flex:0 0 38%; }

.citymap { padding:0 6px; border:0; background:none; opacity:.6; } .citymap:hover, .citymap.on { opacity:1; }
.day h3.cv { background:color-mix(in srgb, var(--c) 28%, transparent); border-left:3px solid var(--c); border-radius:6px; padding:3px 6px; }

/* city name and date editing, and the Done warnings */
.cedit { display:flex; flex-wrap:wrap; align-items:center; gap:6px; cursor:default; } .cedit:hover { color:var(--fg); }
.cedit input { font:inherit; font-size:.9rem; font-weight:450; min-width:0; padding:3px 6px; background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:8px; color-scheme:dark; }
.cedit input[data-dc=name] { flex:1; font-weight:600; }
.cedit div { flex-basis:100%; display:flex; align-items:center; gap:6px; font-size:.85rem; font-weight:400; color:var(--mute); } .cedit div input { flex:1; } .cedit div input[data-dc=nights] { flex:none; width:4.5em; }
.issues { margin:10px 0; padding:10px 32px 10px 12px; }
.issues ul { list-style:none; padding:0; margin:6px 0 10px; }
.issues li { margin:6px 0; padding:4px 8px; --c:var(--acc); background:color-mix(in srgb, var(--c) 18%, transparent); border-left:3px solid var(--c); border-radius:6px; } .issues li.err { --c:#ff6b6b; }
.cedit button { padding:0 6px; border:0; background:none; opacity:.6; } .cedit button:hover { opacity:1; }
.cedit.gone input[data-dc=name] { text-decoration:line-through; opacity:.55; } .cedit.gone div { opacity:.5; }
.cnote { flex-basis:100%; font-size:.78rem; font-weight:400; color:var(--mute); }
.cardcheck { margin-top:6px; padding:4px 8px; font-size:.82rem; white-space:normal; border-radius:6px; background:color-mix(in srgb, var(--acc) 16%, transparent); } .cardcheck button { margin-left:6px; padding:1px 8px; }

/* each city is a big card with its days nested inside */
.citycard { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:2px 12px 12px; margin:14px 0; }
.citycard > .city { margin:12px 0 8px; }
.citycard .day { background:color-mix(in srgb, var(--bg) 72%, var(--card)); }
.citycard .day.sel { background:color-mix(in srgb, var(--acc) 7%, var(--bg)); }
.citycard .travel { margin:8px 0 0; }
.cedit select, .tedit select { font:inherit; font-size:.85rem; padding:3px 6px; background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:8px; color-scheme:dark; }

/* editable checklist and notes */
.sect { margin:16px 0 0; padding-top:12px; border-top:1px solid var(--line); } .sect h4 { margin:0 0 6px; font-size:.8rem; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--mute); }
.sect ul { list-style:none; padding:0; margin:6px 0; }
.erow { display:flex; gap:6px; align-items:flex-start; margin:4px 0; }
.erow input:not([type=checkbox]), .erow textarea { flex:1; min-width:0; margin:0; font:inherit; font-size:.9rem; padding:4px 8px; background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:8px; }
.erow input[type=checkbox] { margin-top:8px; } .erow .stitle { font-weight:600; }
.xbtn { padding:0 6px; border:0; background:none; color:var(--mute); } .xbtn:hover { color:var(--fg); }

/* stops sit indented under their day, and the directions between them a step further in */
.day .places { margin-left:12px; padding-left:12px; border-left:2px solid var(--line); }
.day .places li.leg { margin-left:20px; }

.caret { display:inline-block; width:1.2em; font-size:1.6em; line-height:1; color:var(--mute); } .city:hover .caret { color:var(--acc); }

/* ---- polish pass: no thick side stripes, readable links, touch targets, themed browser surfaces ---- */
.travel { border-left:0; border:1px solid color-mix(in srgb, #e8590c 35%, transparent); }
.leg[style] { border:1px solid transparent; } .leg.on[style] { border-color:color-mix(in srgb, var(--c) 40%, transparent); }
.day h3.cv { border-left:0; border:1px solid color-mix(in srgb, var(--c) 55%, transparent); }
.issues li { border-left:0; border:1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.legs a, .leg a, .stopinfo a { color:var(--acc); text-underline-offset:2px; }
.legs a:visited, .leg a:visited, .stopinfo a:visited { color:color-mix(in srgb, var(--acc) 70%, var(--fg)); }
::selection { background:color-mix(in srgb, var(--acc) 40%, transparent); color:var(--fg); }
input, textarea { caret-color:var(--acc); }
.num, .home, .places li > b, .city small, .stay { font-variant-numeric:tabular-nums; }
button { touch-action:manipulation; }
@media (pointer:coarse) {
  button { min-height:36px; min-width:36px; }
  .places button, .day h3 button, .leg [data-act=routeinfo], .xbtn, .cedit button, .citymap { min-height:40px; min-width:40px; }
  input[type=checkbox] { width:20px; height:20px; }
}

/* trip picker */
#trips { color:var(--mute); text-decoration:none; font-size:.85rem; } #trips:hover { color:var(--acc); }
#picker { position:fixed; inset:0; z-index:10; background:var(--bg); display:flex; flex-direction:column; padding:12vh max(20px, calc((100vw - 520px) / 2)) 20px; gap:20px; overflow-y:auto; }
#picker[hidden] { display:none; }
#picker h1 { font-size:1.6rem; }
#tripList { display:flex; flex-direction:column; gap:10px; }
#tripList a { display:flex; flex-direction:column; gap:2px; padding:14px 16px; background:var(--card); border:1px solid var(--line); border-radius:var(--r); color:var(--fg); text-decoration:none; transition:border-color .15s; }
#tripList a:hover, #tripList a:focus-visible { border-color:var(--acc); } #tripList small { color:var(--mute); }
#newTrip { display:flex; flex-wrap:wrap; gap:8px; } #newTrip input[name=title] { flex-basis:100%; } #newTrip input[type=date] { color-scheme:dark; } #newTrip input { flex:1 1 0; min-width:0; font:inherit; padding:8px 10px; background:var(--card); color:var(--fg); border:1px solid var(--line); border-radius:8px; }
#tripErr { color:#ff6b6b; margin:0; }

#sizer { position:fixed; top:0; bottom:0; left:var(--aw); width:10px; margin-left:-5px; cursor:col-resize; z-index:5; touch-action:none; } #sizer:hover, #sizer.on { background:linear-gradient(90deg, transparent 4px, var(--acc) 4px 6px, transparent 6px); }
@media (max-width:760px) { #sizer { display:none; } }
.addstop { width:100%; font:inherit; padding:4px 8px; margin-bottom:4px; background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:8px; }

.day.dep h3 span { color:var(--mute); } .day.dep { border-style:dashed; }
