:root{
  --bg:#0d1117;
  --panel:#151c26;
  --panel2:#1b2430;
  --line:#25303d;
  --ink:#e8eef6;
  --dim:#93a1b3;
  --dimmer:#5f7186;
  --accent:#43b0ff;
  --rock:#ff9f57;
  --good:#4ad6a4;
  --warn:#ffce54;
  --bad:#ff7b7b;
  /* Planning's own hue. Planning is a real bucket, not the absence of one, and
   * on a grey field a grey bar is unreadable — see .cal-cat-planning. */
  --plum:#a97cff;
  /* priority metals: high / medium / low */
  --gold:#d4af37;
  --silver:#c0c5ce;
  --bronze:#b0794c;
  --radius:10px;
  --shadow:0 1px 0 rgba(255,255,255,.04), 0 12px 28px rgba(0,0,0,.35);
  font-size:16px;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{
  background:var(--bg);
  color:var(--ink);
  font:15px/1.55 ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
.hidden{display:none !important}
a{color:var(--accent)}

/* ------------------------------------------------------------------ auth */
.auth{
  min-height:100vh;display:grid;place-items:center;padding:24px;
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(67,176,255,.15), transparent 60%),
    radial-gradient(900px 500px at 90% 110%, rgba(255,159,87,.13), transparent 60%),
    var(--bg);
}
.auth-card{
  width:min(420px,100%);background:var(--panel);border:1px solid var(--line);
  border-radius:16px;padding:30px;box-shadow:var(--shadow)
}
.auth-card h1{margin:14px 0 4px;font-size:1.55rem;letter-spacing:-.02em}
.auth-card .sub{margin:0 0 18px;color:var(--dim);font-size:.92rem}
.brand-mark{
  width:44px;height:44px;border-radius:12px;display:grid;place-items:center;
  overflow:hidden;background:#fff;
}
.brand-mark img{width:100%;height:100%;object-fit:cover}
.brand-mark.sm{width:30px;height:30px;border-radius:9px}
.tabs-inline{display:flex;gap:6px;background:var(--panel2);padding:4px;border-radius:9px;margin-bottom:18px}
.tab-inline{
  flex:1;border:0;background:transparent;color:var(--dim);padding:8px;border-radius:6px;
  font:inherit;font-weight:600;cursor:pointer
}
.tab-inline.active{background:var(--panel);color:var(--ink);box-shadow:0 1px 4px rgba(0,0,0,.4)}

/* ---------------------------------------------------------------- fields */
.field{display:block;margin-bottom:14px}
.field span{display:block;font-size:.8rem;color:var(--dim);margin-bottom:6px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}
input[type=text],input[type=email],input[type=password],input[type=date],input:not([type]),select,textarea{
  width:100%;background:var(--panel2);border:1px solid var(--line);border-radius:8px;
  color:var(--ink);padding:10px 12px;font:inherit
}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(67,176,255,.16)}
textarea{resize:vertical;min-height:76px;line-height:1.5}
.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
button.primary,button.ghost{
  border-radius:8px;padding:9px 16px;font:inherit;font-weight:600;cursor:pointer;border:1px solid transparent
}
button.primary{background:var(--accent);color:#06121e;border-color:transparent}
button.primary:hover{background:#63c0ff}
button.ghost{background:transparent;border-color:var(--line);color:var(--ink)}
button.ghost:hover{background:var(--panel2);border-color:var(--dimmer)}
button.ghost.danger{color:var(--bad);border-color:rgba(255,123,123,.35)}
button.small{padding:6px 12px;font-size:.86rem}
.err{color:var(--bad);font-size:.88rem;margin:12px 0 0;min-height:1.2em}
.hint{margin:7px 0 0;font-size:.78rem;line-height:1.45;color:var(--dimmer)}

/* ------------------------------------------------------- location fields */
.loc-set{border:1px solid var(--line);border-radius:10px;padding:12px 14px;margin:0 0 14px}
.loc-set legend{font-size:.8rem;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:var(--dim);padding:0 6px}
.loc-search{display:flex;gap:8px;margin:10px 0 0}
.loc-search input{flex:1}
.loc-results{list-style:none;margin:8px 0 0;padding:0;border:1px solid var(--line);border-radius:8px;max-height:180px;overflow:auto}
.loc-results li+li{border-top:1px solid var(--line)}
.loc-result{display:flex;justify-content:space-between;gap:10px;align-items:baseline;width:100%;background:transparent;border:0;color:var(--ink);padding:8px 10px;font:inherit;text-align:left;cursor:pointer}
.loc-result:hover{background:var(--panel2)}
.loc-result small{color:var(--dimmer);font-variant-numeric:tabular-nums}
.loc-note{margin:8px 0 0;font-size:.78rem;line-height:1.45;color:var(--dimmer)}
select:disabled{opacity:.55;cursor:not-allowed}
/* The entry modal's dates are real date inputs, and nothing in this theme is
   one yet. The native picker icon is painted dark, so on a dark field it is
   close to invisible — inverted here so the affordance is legible. The page
   declares no color-scheme, which is why the icon needs help. */
input[type=date]::-webkit-calendar-picker-indicator{filter:invert(.9)}
/* A date field the reader cannot edit has to look locked. On someone else's
   plan these two boxes are the whole reason the modal reads as read-only, and
   a native input at full brightness looks live while accepting no input. */
input:disabled{opacity:.55;cursor:not-allowed}
/* A disabled *button* also has to look disabled. Without this the one case
 * where the dialog refuses a write — reading someone else's plan — is a live
 * looking Save that can only fail, which is the exact opposite of why the
 * button is disabled in the first place. */
button:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.row.end{justify-content:flex-end}
.row label{display:flex;gap:7px;align-items:center;color:var(--dim);font-size:.9rem}

/* ----------------------------------------------------------------- shell */
.top{
  display:flex;justify-content:space-between;align-items:center;gap:16px;
  padding:12px 22px;border-bottom:1px solid var(--line);background:var(--panel);
  position:sticky;top:0;z-index:5;flex-wrap:wrap
}
.top-brand{display:flex;gap:11px;align-items:center}
.top-brand strong{display:block;font-size:.98rem;line-height:1.15}
.top-brand em{font-style:normal;color:var(--dimmer);font-size:.78rem}
/* No search box here. It reached /api/items as `q`, but the only list on the
 * page is the map list, and that already filters by category, tag, priority and
 * shortlist through controls that sit beside it — a free-text box that narrowed
 * a list someone was already narrowing was the extra half of this header's
 * height, and the header's own job is just brand + who is signed in. */
.top-right{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.who{color:var(--dim);font-size:.88rem}
main{max-width:1180px;margin:0 auto;padding:20px 22px 30px}
/* ---------------------------------------------------- the map pair, full bleed
 * The map and the list together want more of the screen than the measure that
 * suits prose. Rather than bleed with vw-based negative margins — which are off
 * by the scrollbar and answer to the viewport rather than to the layout — main
 * is simply released from its max-width while that pair is on screen, and
 * everything that was inside the measure stays inside it.
 *
 * "On screen" means both halves visible and still side by side: below 901px the
 * split stacks, and the Show map switch adds .no-map, and in either case a wide
 * single column of cards is what the narrow one was all along. */
@media (min-width:901px){
  main:has(.map-page:not(.no-map)){max-width:none}
  main:has(.map-page:not(.no-map))>.planner,
  main:has(.map-page:not(.no-map))>.chips{max-width:1180px;margin-inline:auto}
}

/* The nav is gone with the tabs: one page has nothing to switch between. What
 * was the nav's sticky row is now just the main header's own bottom edge. */

.chips{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:16px}
/* An empty filter row is not a row. With no priority filter in force nothing is
 * rendered here, and the margin alone would still separate two panels by a gap
 * that is filtering nothing. The rule is safe precisely because a live chip
 * puts content back and the block comes out of hiding. */
.chips:empty{display:none}
.chip{
  border:1px solid var(--line);background:var(--panel);color:var(--dim);border-radius:99px;
  padding:4px 12px;font-size:.82rem;cursor:pointer;font-weight:600
}
.chip:hover{color:var(--ink);border-color:var(--dimmer)}
.chip.on{background:rgba(67,176,255,.14);border-color:rgba(67,176,255,.45);color:var(--accent)}
.chip.reset{border-style:dashed}

/* ------------------------------------------------------- plan switch (Planning) */
/* Two segmented controls already set the vocabulary in this app: the sign-in
 * mode switch and the map's show/hide track. The plan switch reuses the first,
 * because "which of two things" is the same question and a radiogroup reads
 * better as two labelled segments than as a slider. It is deliberately not a
 * checkbox switch: a switch answers on/off, and neither plan is off. */
/* First thing in the plan panel, so it carries the panel's own separation from
 * whatever is above it and none from the calendar below. */
.planbar{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.plan-switch{
  display:inline-flex;padding:3px;gap:2px;border-radius:99px;
  background:var(--panel2);border:1px solid var(--line)
}
.plan-seg{
  border:0;background:transparent;color:var(--dim);font:inherit;font-size:.86rem;
  font-weight:600;padding:6px 14px;border-radius:99px;cursor:pointer;
  transition:color .1s ease,background .1s ease
}
.plan-seg:hover{color:var(--ink)}
.plan-seg.active{background:var(--panel);color:var(--accent);box-shadow:0 1px 0 rgba(255,255,255,.05)}
.plan-seg:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* A third dimension: the switch answers "which plan", the select answers "whose
 * plan". It only appears in My Plan, so it never suggests the group plan has a
 * choice of owner. */
.plan-owner{width:auto;padding:7px 10px;font-size:.86rem}


.card{
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
  padding:16px;cursor:pointer;transition:transform .09s ease,border-color .09s ease
}
.card:hover{transform:translateY(-2px);border-color:var(--dimmer)}
.card.expanded{grid-column:1/-1;border-color:var(--accent);box-shadow:0 0 0 3px rgba(67,176,255,.14);cursor:default}
.card.expanded:hover{transform:none}
.card-head{position:relative;display:block;padding-right:34px}
.card-head:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:7px}
.chev{
  position:absolute;right:0;bottom:1px;font-size:.7rem;color:var(--dimmer);line-height:1
}
.card.expanded .chev{color:var(--accent)}
.card.expanded .card-head{border-bottom:1px solid var(--line);padding-bottom:14px;cursor:pointer}
.card.expanded:hover .card-head{border-bottom-color:var(--dimmer)}
.card.expanded .clamp{-webkit-line-clamp:unset;display:block;overflow:visible}
.card h3{margin:0 0 7px;font-size:1.03rem;line-height:1.35}
.card.expanded h3{font-size:1.24rem}
.card p{margin:0;color:var(--dim);font-size:.885rem}
.card .meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:11px;align-items:center}
.pill{
  font-size:.7rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;
  border-radius:99px;padding:2.5px 9px;border:1px solid
}
.pill.idea{color:var(--dim);border-color:var(--line);background:var(--panel2)}
.pill.shortlist{color:var(--warn);border-color:rgba(255,206,84,.4);background:rgba(255,206,84,.09)}
.pill.done{color:var(--good);border-color:rgba(74,214,164,.45);background:rgba(74,214,164,.10)}
/* personal shortlist marker — shared with nothing on the item */
.pill.mine{color:var(--good);border-color:rgba(74,214,164,.45);background:rgba(74,214,164,.10)}
/* Priority marker — sits in front of the title, where the eye lands first.
 * Bullion by rank: gold, silver, bronze; no priority is no mark at all. The
 * metal stands alone so a card that is also shortlisted (warm pill) does not
 * wear the same hue twice. */
.dot{
  width:8px;height:8px;border-radius:50%;display:inline-block;
  vertical-align:middle;margin-right:7px;margin-bottom:2px;background:var(--dimmer);
}
.dot.high{background:var(--gold);box-shadow:0 0 0 1px rgba(212,175,55,.35)}
.dot.medium{background:var(--silver);box-shadow:0 0 0 1px rgba(192,197,206,.3)}
.dot.low{background:var(--bronze);box-shadow:0 0 0 1px rgba(176,121,76,.35)}
.dot.none{background:transparent;box-shadow:none;margin:0;width:0}
.card.expanded h3 .dot{width:10px;height:10px}
.tg{font-size:.74rem;color:var(--dimmer)}
.clamp{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

/* ------------------------------------------------- expanded card detail */
/* The detail lives inside the card that was clicked; .card.expanded spans the
 * whole row above so the photo and prose keep the width the old panel had. */
.card-more{position:relative;padding-top:16px}
.card-more .close{
  position:absolute;top:12px;right:0;border:0;background:transparent;color:var(--dim);
  font-size:24px;line-height:1;cursor:pointer;padding:4px 8px;border-radius:7px
}
.card-more .close:hover{color:var(--ink);background:var(--panel2)}
.more-body{max-width:78ch}
.card-more .prose{margin:14px 0}
.card-more .prose p{margin:0 0 .75em}
.detail-actions{margin-top:18px;border-top:1px solid var(--line);padding-top:14px}
.detail-actions textarea{margin-bottom:10px}
.doneLbl{display:flex;gap:7px;align-items:center;color:var(--dim);font-size:.9rem}
.doneLbl input{accent-color:var(--good)}
/* the two flags sit together as one group, buttons after a gap */
/* ------------------------------------------- multi-select priority filter */
/* Status above it is a single <select>; priority needs several ranks at once,
 * so it is a button over a popover of checkboxes rather than a native control
 * no HTML select can express withouta native. */
.prio{position:relative}
#prioBtn{display:inline-flex;align-items:center;gap:7px;padding:8px 12px;font-size:.88rem}
#prioBtn.on{border-color:rgba(212,175,55,.5);color:var(--gold)}
#prioBtn .n{color:var(--dim);font-weight:700;font-size:.8rem}
/* The caret is what says "this opens something". A bare label that reads like
 * a setting is easy to mistake for static text and never click at all. */
#prioBtn .caret{font-size:.68rem;color:var(--dimmer);transition:transform .1s ease}
#prioBtn[aria-expanded="true"] .caret{transform:rotate(180deg);color:var(--accent)}
#prioBtn.on .n{color:var(--gold)}
.prio-menu{
  position:absolute;right:0;top:calc(100% + 6px);z-index:9;min-width:190px;
  background:var(--panel);border:1px solid var(--line);border-radius:11px;
  padding:8px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:1px
}
.prio-menu label{
  display:flex;gap:9px;align-items:center;padding:7px 9px;border-radius:7px;
  color:var(--ink);font-size:.9rem;cursor:pointer;text-transform:none;letter-spacing:0;font-weight:500
}
.prio-menu label:hover{background:var(--panel2)}
.prio-menu .dot{margin:0}
.prio-menu .prio-all{margin-top:6px;border-top:1px solid var(--line);border-radius:0 0 7px 7px;text-align:center}

/* In the menu an unranked card still needs a mark, or the row reads as blank;
 * an empty ring says "no rank" without inventing a fourth metal. */
.prio-menu .dot.none{width:8px;background:transparent;box-shadow:inset 0 0 0 1px var(--dimmer)}

/* the priority dropdown that replaces reaching for the editor */
.prioLbl{display:flex;gap:7px;align-items:center;color:var(--dim);font-size:.9rem}
.prioLbl span{text-transform:none;letter-spacing:0;font-weight:600;color:var(--dim)}
.prioLbl select{width:auto;padding:6px 10px;font-size:.88rem}
.myLbl{color:var(--good)}
.detail-actions .row{gap:14px}
.detail-actions .saveNotes{margin-left:auto}

/* ---------------------------------------------------------------- modals */
dialog{
  border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--ink);
  padding:24px;width:min(560px,92vw);box-shadow:var(--shadow)
}
dialog::backdrop{background:rgba(3,7,12,.72);backdrop-filter:blur(2px)}
dialog h3{margin:0 0 18px;font-size:1.15rem}

/* The schedule confirmation. It carries no inputs of its own, so the whole box
   is the one fact it states: which idea, which days, which plan, plus what the
   plan already holds for that idea so a second copy is not a surprise. */
.sched-when{margin:0 0 6px;font-size:1rem}
.sched-plan{margin:0 0 14px;font-size:.86rem;color:var(--dim)}
.sched-existing{margin:0 0 18px;padding:10px 14px;list-style:none;border:1px solid var(--line);
  border-radius:9px;background:var(--panel2);display:grid;gap:6px;font-size:.88rem}
.sched-existing li{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.sched-existing li em{color:var(--dim);font-style:normal}
.sched-existing li .by{margin-left:auto;color:var(--dimmer);font-size:.8rem}
.sched-existing li.none,.sched-existing li.warn{color:var(--dim);font-size:.84rem}
.sched-existing li.warn{color:var(--warn,#f0a94b)}

.toast{
  position:fixed;bottom:22px;left:50%;transform:translateX(-50%);
  background:var(--panel2);border:1px solid var(--line);color:var(--ink);
  padding:11px 18px;border-radius:99px;box-shadow:var(--shadow);z-index:20;font-size:.9rem
}
.toast.bad{border-color:rgba(255,123,123,.5)}

@media (max-width:640px){
  main{padding:16px 14px 20px}
  .two{grid-template-columns:1fr}
}

/* ------------------------------------------- expanded-card media & links */
.cardimg{text-align:center;margin:14px 0 0;padding:0}
.cardimg img{
  display:inline;width:100%;max-width:40em;object-fit:cover;
  border:1px solid var(--line);border-radius:9px;background:var(--panel2)
}
.cardimg figcaption{
  margin-top:6px;font-size:.74rem;color:var(--dimmer);line-height:1.4
}
.cardimg figcaption a{color:var(--dim)}
.moreinfo{
  display:inline-flex;align-items:center;gap:7px;margin:4px 0 12px;
  padding:8px 14px;border-radius:99px;text-decoration:none;font-weight:600;font-size:.9rem;
  background:rgba(67,176,255,.12);border:1px solid rgba(67,176,255,.4);color:var(--accent)
}
.moreinfo:hover{background:rgba(67,176,255,.22)}
.moreinfo span{font-weight:400;color:var(--dim);font-size:.84rem}
.hasmedia{color:var(--dimmer);font-size:.8em;vertical-align:middle}

/* expanded detail image grows to full width on narrow screens */
@media (max-width:640px){.cardimg img{border-radius:7px}}

@media (prefers-reduced-motion:reduce){.card{transition:none}.card:hover{transform:none}}

/* ----------------------------------------------------------------- map tab */
/* A read-only view over all six tabs: a toolbar of filters above a map/list
 * split. The map keeps 3fr of a two-column split so the island stays legible,
 * and the list collapses below on narrow screens rather than squeezing pins. */
/* The plan panel sits above this, and the two are independent views rather
 * than neighbours in one flow — so the map needs its own breathing room under
 * the calendar's hint line. Without it the toolbar abuts the calendar on a tall
 * screen, which reads as one control set rather than two panels. */
.map-page{display:block;margin-top:26px}
.map-toolbar{
  display:flex;flex-wrap:wrap;gap:14px 22px;align-items:center;justify-content:center;
  margin-bottom:16px
}
.map-cats{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center}
.map-cats-label{color:var(--dim);font-size:.82rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.map-cats label{display:flex;align-items:center;gap:6px;color:var(--dim);font-size:.9rem;cursor:pointer}
.map-cats input{accent-color:var(--accent)}
.map-tools-right{display:flex;flex-wrap:wrap;gap:14px 18px;align-items:center}
.map-shortlists{display:flex;gap:18px}
.planning-filter{display:inline-flex;align-items:center;gap:6px;color:var(--dim);font-size:.8rem}
.planning-filter select{width:auto;padding:6px 8px;font-size:.82rem}
/* -------------------------------------------- map visibility switch */
/* A visibility control, not a filter: it must not look like the checkbox rows
 * beside it, so it reads as a switch. The track takes the accent when on and
 * the dim line colour when off, which is the same vocabulary the pills use. */
.map-toggle{display:flex;align-items:center;gap:9px;color:var(--dim);font-size:.9rem;cursor:pointer}
.map-toggle-input{position:absolute;width:1px;height:1px;opacity:0}
.map-toggle-track{
  width:38px;height:21px;border-radius:99px;background:var(--panel2);
  border:1px solid var(--line);position:relative;flex:0 0 auto;
  transition:background .12s ease,border-color .12s ease
}
.map-toggle-knob{
  position:absolute;top:2px;left:2px;width:15px;height:15px;border-radius:50%;
  background:var(--dimmer);transition:transform .12s ease,background .12s ease
}
.map-toggle-input:checked + .map-toggle-track{background:rgba(67,176,255,.25);border-color:var(--accent)}
.map-toggle-input:checked + .map-toggle-track .map-toggle-knob{transform:translateX(17px);background:var(--accent)}
.map-toggle-input:focus-visible + .map-toggle-track{outline:2px solid var(--accent);outline-offset:2px}
.map-toggle-input:checked ~ span{color:var(--ink)}
/* Hidden means gone from layout, and the split hands its column back to the
 * list rather than leaving an empty gutter. */
.map-page.no-map .map-canvas{display:none}
.map-page.no-map .map-split{grid-template-columns:minmax(0,1fr)}
/* -------------------------------------------------- searchable tag picker */
/* 54 tags across six tabs is not a checkbox list. The menu filters its own
 * option list as you type and keeps selected tags visible even when they stop
 * matching the search, so a live filter can never be stranded out of sight. */
.map-tags{position:relative}
#mapTagsBtn{display:inline-flex;align-items:center;gap:7px;padding:8px 12px;font-size:.88rem}
#mapTagsBtn.on{border-color:rgba(67,176,255,.5);color:var(--accent)}
#mapTagsBtn .n{color:var(--dim);font-weight:700;font-size:.8rem}
#mapTagsBtn.on .n{color:var(--accent)}
#mapTagsBtn .caret{font-size:.68rem;color:var(--dimmer);transition:transform .1s ease}
#mapTagsBtn[aria-expanded="true"] .caret{transform:rotate(180deg);color:var(--accent)}
.map-tags-menu{
  /* Placement is done in JS (placeMapTagsMenu): a CSS anchor to the button
   * knows nothing about the viewport, which put a fixed 250px panel off the
   * right edge on mobile and let it run past the bottom. The values here are a
   * fallback for the one case the measuring pass never runs. */
  position:fixed;right:8px;top:calc(100% + 6px);z-index:9;width:min(250px,calc(100vw - 16px));
  max-width:calc(100vw - 16px);
  background:var(--panel);border:1px solid var(--line);border-radius:11px;
  padding:8px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:6px
}
.map-tags-menu input[type="search"]{
  width:100%;background:var(--panel2);border:1px solid var(--line);border-radius:7px;
  padding:7px 10px;color:var(--ink);font:inherit;font-size:.88rem
}
.map-tags-list{max-height:280px;overflow-y:auto;display:flex;flex-direction:column;gap:1px}
.map-tags-list label{
  display:flex;gap:9px;align-items:center;padding:6px 8px;border-radius:6px;
  color:var(--ink);font-size:.86rem;cursor:pointer;text-transform:none;letter-spacing:0;font-weight:500
}
.map-tags-list label:hover{background:var(--panel2)}
.map-tags-list input{accent-color:var(--accent)}
.map-tags-miss{color:var(--dimmer);font-size:.82rem;padding:6px 8px;text-align:center}
.map-tags-menu .map-tags-none{margin-top:2px;border-top:1px solid var(--line);border-radius:0 0 7px 7px;text-align:center}
.map-shortlists label{display:flex;gap:7px;align-items:center;color:var(--dim);font-size:.9rem;cursor:pointer}
.map-shortlists input{accent-color:var(--good)}
/* category swatches echo the pill hues so the checkbox row and the tab pills
 * read as the same vocabulary */
.cat-swatch{width:9px;height:9px;border-radius:50%;display:inline-block}
.sw-planning{background:var(--plum)}
.sw-tasks{background:var(--rock)}
.sw-climbing{background:var(--accent)}
.sw-non_climbing{background:var(--good)}
.sw-lodging{background:var(--warn)}
.sw-eating{background:var(--bad)}
.tabpill{white-space:nowrap}
.tabpill-climbing{color:var(--accent);border-color:rgba(67,176,255,.4);background:rgba(67,176,255,.09)}
.tabpill-non-climbing{color:var(--good);border-color:rgba(74,214,164,.4);background:rgba(74,214,164,.09)}
.tabpill-lodging{color:var(--warn);border-color:rgba(255,206,84,.4);background:rgba(255,206,84,.09)}
.tabpill-eating{color:var(--bad);border-color:rgba(255,123,123,.4);background:rgba(255,123,123,.09)}
.tabpill-planning{color:var(--plum);border-color:rgba(169,124,255,.4);background:rgba(169,124,255,.09)}
/* One height for the pair. The canvas needs a floor so a short window still
 * gives the reader an island worth panning; the list used to get only a ceiling,
 * so below vh 820 the canvas sat on its 480px floor while the list's max-height
 * kept shrinking, which is the dead space along the bottom. Declared once on the
 * split and read by both, so neither can be the wrong height on its own.
 * The 900px block restates both sides for the stacked case, where they no longer
 * share a row. */
.map-split{--map-h:max(480px,calc(100vh - 340px));
  display:grid;grid-template-columns:minmax(260px,1fr) 10px minmax(280px,2fr);gap:0}
/* The list is the wider half, everywhere the pair sits side by side.

The old 3fr:2fr is the reason this page's column rule sat inert for as long as
it did, and the 1fr:2fr that replaced it left the arithmetic untested: a 615px
floor (45em at this page's 15px text) wants 1238px of list, and two-thirds of a
split that wide is not on any desktop short of 5K, so auto-fill was handed a
number it could never satisfy and answered one column everywhere. Two columns
now arrive at ~1460px, where the list's content box crosses 908px (2*450+8).
The list is where width pays -- a card of clamped
prose is readable at whatever it is handed, and the surplus is what a second
 column is made of -- while a map is readable only as large as its own
coastline and stays pannable at any size. Hence two-thirds to the list, one
third to the map, and no gate this time: the map's minmax(260px,1fr) floor
replaces the old measured one, so even at the stacking edge (split 842, map
277) the map stays pannable rather than collapsing to a legend. What you asked
for holds below any threshold you might later measure, which beats an exact
crossover that only ever justified itself at 1563px.

The middle track is the divider, not a gap: 10px of it, dragging writes
--map-map-fr/--map-list-fr through to this same template, and when the two
stack the divider is display:none so the grid drops back to one column. Two
fr units are used rather than one fr plus a gap so the drag math is one
subtraction on either side of the divider's own width; the old 16px of gap is
gone because the track eats it.

Scope, same as the full-bleed rule: below 901px they stack, Show map off hands
the column back to the list, and in either case there is no pair to split.
*/
.map-divider{
  grid-column:2;display:flex;align-items:center;justify-content:center;
  cursor:col-resize;touch-action:none;-webkit-user-select:none;user-select:none
}
.map-divider span{
  width:2px;height:64px;border-radius:2px;background:var(--line);
  transition:background .12s ease,transform .12s ease
}
.map-divider:hover span,
.map-divider:focus-visible span{background:var(--accent)}
.map-divider:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* The dragged pair takes the fr values; untouched, the template's own 1fr:2fr
 * stands. Scoped to the side-by-side breakpoint, because this rule outweighs
 * the stacking one below 901px on specificity alone and would drag the pair
 * back into three tracks on a phone. min-width:0 would fight the floors that
 * keep either side usable, so they deliberately stay. */
@media (min-width:901px){
  .map-split.dragged{
    grid-template-columns:minmax(260px,var(--map-map-fr,1fr)) 10px minmax(280px,var(--map-list-fr,2fr))
  }
}
/* Stacked, or with the canvas switched off: the pair is not a pair, so the
 * divider comes out of the grid rather than taking a row of its own. Both the
 * plain and the dragged template are named so a remembered split cannot leak a
 * third track into a page with nothing to split. */
.map-page.no-map .map-divider{display:none}
.map-page.no-map .map-split,
.map-page.no-map .map-split.dragged{grid-template-columns:minmax(0,1fr)}
.map-canvas{
  height:var(--map-h);border:1px solid var(--line);
  border-radius:var(--radius);background:var(--panel);overflow:hidden
}
.map-error{padding:28px;color:var(--bad);text-align:center}
/* The list is a column of cards that happen to be the same two half-templates a
 * grid card is made of, and it can now stand in more than one column of itself:
 * auto-fill/minmax is the whole rule, two columns exactly when each track would
 * be 30em or wider and never a phantom track when they would not. em, not px, so
 * the floor is a measure of prose rather than of the split: 30em is 450px at the
 * 15px body this page computes to, which is ~38ch of .855rem text. It also means
 * the floor moves if the text size ever does — deliberately, but deliberately.
 * Nothing here grows and nothing is allowed to be squeezed — the list scrolls,
 * which is what the max-height is for, and max-height is --map-h so it is the
 * same height as the map beside it. */
.map-list{
  /* min() on the floor, not 30em alone: a definite 450px minimum track inside a
   * narrower container does not fall back to one column, it overflows the grid
   * sideways. Clamping the floor to the container's own width keeps the rule and
   * still answers 360px with one column. */
  display:grid;grid-template-columns:repeat(auto-fill,minmax(min(30em,100%),1fr));
  gap:8px;align-content:start;align-items:start;
  max-height:var(--map-h);overflow-y:auto;padding-right:4px
}
/* A row is the grid item's default min-width — its min-content size — and an
 * expanded row holds a width:100% photo, whose min-content is the image's
 * intrinsic width. In a 450px track that is how a picture forces the track past
 * the container. min-width:0 is the standard release and costs nothing when
 * nothing overflows. */
.map-list>.map-row{min-width:0}
/* The open row and the empty state both want the whole panel: one is open for
 * its detail, and a "nothing matches the filters" line that sits in the first
 * track of two reads as a fragment rather than as the state of the list. */
.map-list>.map-row.expanded,
.map-list>.map-empty{grid-column:1/-1}
.map-empty{color:var(--dimmer);text-align:center;padding:36px 10px}
/* A row used to be a compact table line: a title and a row of pills. It is now
 * the same two half-templates a grid card is made of, so it reads as a card
 * standing in a column rather than as a list with a card glued to it. A closed
 * row shows what a card shows and nothing more, so the header's own body text
 * is clamped to two lines here rather than the grid's three; the column is the
 * narrow one of the split, and three lines in 38ch is the same amount of prose
 * the grid puts in 80. */
.map-row{
  display:block;padding:10px 12px;
  height:stretch;
  border:1px solid var(--line);border-left:4px solid var(--line);border-radius:9px;
  background:var(--panel);cursor:pointer;transition:border-color .09s ease,background .09s ease
}
.map-row:hover{background:var(--panel2)}
.map-row.pin-hover{background:var(--panel2)}
.map-row.selected{box-shadow:0 0 0 2px rgba(67,176,255,.35);border-color:var(--accent)}
.map-row:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.map-row h3{margin:0 0 6px;font-size:.93rem;line-height:1.35;font-weight:600}
.map-row p{margin:0;color:var(--dim);font-size:.855rem}
.map-row .meta{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;margin-top:8px}
.map-row .chev{right:0;bottom:2px}
/* The open row is the card-equivalent, so it takes the card's own shape:
 * accent edge, the clamp lifted so the header carries the whole body, and the
 * detail block underneath it with room for the photo at column width. The
 * border-left keeps the pin's hue, so the accent ring has to come from the box
 * shadow rather than from border-color, which would overwrite it. */
/* border-color would overwrite the pin hue on the left edge, so the ring here
 * is a box shadow; the inline hue set in renderMapList keeps its colour, which
 * is what the row's dot is matched to. */
.map-row.expanded{cursor:default;box-shadow:0 0 0 2px rgba(67,176,255,.35);border-color:var(--accent)}
.map-row.expanded .card-head{cursor:pointer}
.map-row.expanded .card-head>.clamp{-webkit-line-clamp:unset;display:block;overflow:visible}
.map-row.expanded h3{font-size:1.06rem}
.map-row.expanded .card-head{border-bottom:1px solid var(--line);padding-bottom:12px}
.map-row.expanded .card-more{padding-top:14px}
.map-row .card-more{padding-top:14px}
.map-row .more-body{max-width:none}
.map-row .cardimg{margin:12px 0 0}
.map-row .prose{margin:10px 0}
.map-row .detail-actions{margin-top:14px;padding-top:12px}
.map-row .card-more .close{top:10px}
.map-row .card-more .row{gap:10px}
.map-row .notesBox{min-height:64px}
@media (max-width:900px){
  .map-split{grid-template-columns:1fr}
  .map-page.no-map .map-split{grid-template-columns:1fr}
  /* One track, three children: out of the way or the pair drags apart on a
   * phone, which is exactly what stacking is meant to end. */
  .map-divider{display:none}
  /* Stacked there is no shared row to agree in, so both sides state the same
   * number here: --map-h is the desktop value and would keep the list taller
   * than a 380px canvas, which just moves the gap. */
  .map-split{--map-h:380px}
  .map-canvas{height:var(--map-h);min-height:300px}
  .map-list{max-height:var(--map-h)}
}

/* -------------------------------------------------------- planner calendar */
/* The Planning tab's own content: a month grid. The grid is deliberately a
 * flat 7-column CSS grid of buttons rather than a table, because the thing it
 * has to support is a drag across cells, which wants one hit-testable box per
 * day and nothing in between. Week starts Sunday, so a Mon-to-Fri trip block
 * still reads as a single row. */
.planner{margin-top:2px}
.cal-bar{
  display:flex;justify-content:space-between;align-items:center;gap:14px;
  flex-wrap:wrap;margin-bottom:14px
}
.cal-nav{display:flex;align-items:center;gap:8px}
.cal-nav .cal-title{
  margin:0;font-size:1.15rem;font-weight:650;letter-spacing:-.01em;
  min-width:9.5ch;text-align:center;font-variant-numeric:tabular-nums
}
.cal-right{display:flex;align-items:center;gap:10px}
.cal-sel{margin:0;font-size:.88rem;color:var(--dim);font-variant-numeric:tabular-nums}
.cal-sel.has{color:var(--ink)}
.ghost.icon{padding:6px 12px;font-size:1.15rem;line-height:1}
.cal-week,.cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
/* The column gap goes away. A bar is one element spanning day columns, and the
 * day cells keep their card borders by sitting inside a margin instead — that
 * way the bar's left edge is the day it starts on and its right edge is the day
 * it ends on. Row spacing is free because the row template is set from JS. */
.cal-grid{gap:0}
.cal-week{margin-bottom:6px}
.cal-week span{
  font-size:.74rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;
  color:var(--dimmer);text-align:center;padding:4px 0
}
:root{--cal-cell:66px;--cal-bar:26px;--cal-inset:3px}
.cal-day{
  position:relative;margin:var(--cal-inset);padding:7px 9px;text-align:left;font:inherit;
  /* The day number goes to the top-left and stays there. A button that is not
   * told otherwise keeps its number in the middle of the box, and the bars grow
   * upward from the bottom of that same box — so the more ideas a week holds,
   * the closer a centred number sits to the ones crossing it. Asking for the
   * corner rather than merely reserving the room is the fix: reserving is what
   * min-height below already does, and the two agree on the same edge. */
  display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;
  /* The day asks for the room its own bars need. --lanes is written per cell by
   * renderPlanner, so a quiet week is the size it always was and only a week
   * with overlapping ideas pays the height. Keep the two --cal-bar terms in step
   * with the bar's own height and lane step below or the last bar lands on the
   * day number. */
  min-height:calc(var(--cal-cell) + var(--lanes,0)*(var(--cal-bar) + 2px));
  background:var(--panel);border:1px solid var(--line);border-radius:9px;
  color:var(--ink);cursor:pointer;transition:border-color .08s ease,background .08s ease;
  /* A drag across the grid is a gesture, not a text selection. Without this the
   * browser does what it is told and highlights the day numbers, which looks
   * exactly like a selection the calendar did not make. */
  user-select:none;-webkit-user-select:none;
  /* Scroll stays the page's, the drag stays the calendar's. Without pan-y a
     touch that begins on the grid would have no gesture to give, and the only
     way to scroll the page would be to land the finger somewhere else. */
  touch-action:pan-y
}
.cal-day:hover{border-color:var(--dimmer);background:var(--panel2)}
.cal-day:focus-visible{outline:2px solid var(--accent);outline-offset:2px;z-index:1}
.cal-day .d{display:block;font-size:.92rem;font-weight:650;font-variant-numeric:tabular-nums}
.cal-day .sub{display:block;margin-top:3px;font-size:.72rem;color:var(--dimmer)}
.cal-day.outside{background:transparent;border-style:dashed;color:var(--dimmer)}
.cal-day.outside .d{color:var(--dimmer);font-weight:500}
.cal-day.outside:hover{background:var(--panel);border-style:solid}
/* Today is the one day the reader needs no month for: the ring is the marker,
 * so it survives every other state rather than being replaced by it. */
.cal-day.today{border-color:var(--accent)}
.cal-day.today .d::after{content:"\25CF";color:var(--accent);font-size:.6rem;margin-left:5px;vertical-align:1px}
.cal-day.selected{
  background:rgba(67,176,255,.16);border-color:var(--accent);
  box-shadow:0 0 0 2px rgba(67,176,255,.22)
}
.cal-day.selected:hover{background:rgba(67,176,255,.22)}
.cal-day.anchor{border-color:var(--accent);border-width:2px}
.cal-hint{margin:12px 0 0;font-size:.79rem;line-height:1.5;color:var(--dimmer)}

/* ------------------------------------------------------- scheduled bars */
/* One thin track per lane under each week, so two ideas over the same days do
 * not fight and one does not sit on top of the other. A bar is one element per
 * week row it touches, which is what makes a long stint read as a shape rather
 * than as a cliff at the first Sunday. */
.cal-evt{
  /* Drawn inside the week's own day row rather than on a track under it: same
   * grid row and same columns as the days it runs across, which is what puts it
   * over those cells — grid will let two items own the same area. It stays in
   * flow (grid's out-of-flow child placement is a newer behaviour than this page
   * otherwise relies on) but its height is fixed and align-self:end drops it to
   * the bottom of the band, so it cannot drive the row's height and the day cells
   * stay in charge of that. The bottom margin is the lane, so two ideas sharing
   * days never fight, and the side insets keep a bar off the grid's edge. Keep
   * both margins in step with .cal-day's min-height. */
  position:relative;z-index:1;display:flex;align-items:center;gap:2px;
  min-width:0;height:var(--cal-bar);align-self:end;justify-self:stretch;
  margin:0 var(--cal-inset) calc(var(--cal-inset) + var(--lane,0)*(var(--cal-bar) + 2px));
  padding:0 8px;border-radius:6px;
  font-size:.78rem;font-weight:600;color:#0b1118;cursor:pointer;
  border:1px solid rgba(0,0,0,.22);
  overflow:hidden;user-select:none;-webkit-user-select:none;
  transition:filter .08s ease
}
.cal-evt .cap{flex:none;font-weight:800;font-size:.8rem;line-height:1;opacity:.75}
/* The name is what shrinks: a chip one column wide would otherwise push the date
 * off the end of the bar, and the date is the part that says which day. */
.cal-evt .t{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cal-evt .d{flex:none;font-size:.74rem;font-weight:700;opacity:.75;margin-left:5px;
  font-variant-numeric:tabular-nums}
/* The bar owns the band it is drawn over. It is a button in its own right and a
 * drag that passes through it still has to resolve the day underneath, so the
 * bar answers a press but never intercepts an answer. */
.cal-evt:hover{filter:brightness(1.14)}
.cal-evt:focus-visible{outline:2px solid var(--ink);outline-offset:1px;z-index:2}
/* Same five buckets the card pills wear, as a solid fill. The pills are alpha
 * tints on a dark field, and a tint you cannot read a name against is not a
 * colour; these are the same hues at the lightness dark text needs. */
.cal-cat-climbing{background:#7cc6ff}
.cal-cat-non_climbing{background:#68dfb4}
.cal-cat-lodging{background:#ffd66b}
.cal-cat-eating{background:#ff9a9a}
/* Planning wore the same grey as the disabled state and the grid's outside days,
 * so a Planning bar was near invisible. It takes the purple hue now, at the
 * lightness dark text needs, one step lighter than the swatch and pill. */
.cal-cat-planning{background:#c9a6ff}
/* An entry whose idea is gone. Still drawn, because it is still on the plan and
 * removing it needs somewhere to click, but it must not wear a category. */
.cal-cat-gone{background:var(--panel2);color:var(--dim);border-style:dashed}
:root{--cal-cell:48px;--cal-bar:22px;--cal-inset:2px}
@media (max-width:640px){
  /* Same room-claiming calc as the desktop rule above, at the narrower sizes.
   * A bare min-height here would silently undo the layout for phones, which is
   * the one place a bar is most likely to be drawn over a day number. */
  .cal-day{min-height:calc(var(--cal-cell) + var(--lanes,0)*(var(--cal-bar) + 2px));padding:5px 6px;border-radius:7px}
  .cal-day .sub{display:none}
  .cal-week{gap:4px}
  .cal-nav .cal-title{min-width:8ch}
  /* Stacked, not wrapped. Side by side, a range like "Tue, May 18 – May 24 ·
   * 7 days" only has a few ch of room before it breaks mid-word, and the
   * nav it is sharing the row with is the widest thing on the line. Give the
   * arrows the whole row and let the selection own the next one; flex-wrap
   * alone cannot guarantee that, because it only breaks when something
   * overflows. */
  .cal-bar{flex-direction:column;align-items:stretch;gap:10px}
  .cal-nav{justify-content:space-between}
  .cal-right{justify-content:space-between}
  .cal-sel{font-size:.86rem}
}
/* The modal that opens from one. It is deliberately not the schedule dialog:
 * nothing here writes except Remove, so the box is read-only plus two ways out. */
.entry-when{margin:0 0 10px;font-size:1.02rem;font-variant-numeric:tabular-nums}
.entry-meta{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.entry-meta .tg{color:var(--dim);font-size:.84rem}
.entry-note{margin:0 0 16px;padding:10px 12px;border:1px solid var(--line);
  border-radius:9px;background:var(--panel2);font-size:.88rem;color:var(--dim)}
#entryTitle.gone{color:var(--dim)}

/* Date editing in the entry modal. The two fields are the entry's own start and
 * end, so they are one row: running over a week is one decision, not two stacked
 * ones. No bottom margin of its own — each .field inside already carries 14px,
 * and a container margin stacked on a grid item's would double the gap before
 * the meta row.
 *
 * auto-fit/minmax rather than `1fr 1fr` plus a breakpoint, because whether two
 * date inputs fit is a question about their own width (text box plus the picker
 * button) and the dialog's, not about the viewport's — the dialog is already
 * 92vw under 608px, so a viewport rule would answer a different question than
 * the one that actually makes them cramped. */
.entry-dates{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}
@media (prefers-reduced-motion:reduce){.cal-day{transition:none}}

/* ------------------------------------------------------------- trip assistant
 * A right-side drawer rather than a fourth modal. Everything before this line
 * has been a <dialog> that takes the middle of the screen and stops the page,
 * because each one is a single decision: save this card, schedule this idea,
 * correct these two dates. A conversation is the opposite shape — its whole use
 * is that the map and the calendar are still there behind it, because every
 * answer concerns something on them. So it opens from the side, keeps its own
 * scroll region, and leaves the page usable.
 *
 * Width is a cap, not a fixed box: 400px is about the narrowest two-column map
 * split the page tolerates, so at 1180px it costs the list, and below 40em the
 * drawer would be the page anyway. There it simply becomes the page. */
#chat{
  /* Both edges are named. The first version wrote `inset:0 auto 0 0` and then
   * `left:auto`, which leaves left *and* right auto — and a fixed box with both
   * auto falls back to its static position. So the drawer sat over the middle
   * of the page while its slide came from off-screen left, which read as the
   * panel travelling left when you opened it. The anchor is right:0. */
  position:fixed;top:0;right:0;left:auto;bottom:0;margin:0;
  width:min(400px,100vw);height:100%;max-height:100vh;max-width:none;
  border:0;border-left:1px solid var(--line);background:var(--panel);
  padding:0;display:flex;flex-direction:column;
  box-shadow:-18px 0 40px rgba(0,0,0,.4);
  /* The debt show() takes out. Only showModal() puts a dialog in the top layer,
   * so a drawer that keeps the page interactive paints in the ordinary stacking
   * context, where its z-index is auto and therefore zero. The calendar chips are
   * .cal-evt{position:relative;z-index:1}, which outranks zero, so the bars drew
   * themselves over a panel that should have been over them — the yellow bar
   * across the middle of the open drawer. 15 clears the chips (1), the sticky
   * header (5) and the toolbar menus (9), and stays deliberately under the toast
   * (20): an answer that says "saved" still has to be readable over an open
   * drawer, and it was 30 for one edit that would have quietly buried it. */
  z-index:15;
}
/* The base dialog rule gives centring, padding and a max-width that would fight
 * a full-height side panel, so those three are reset here rather than elsewhere
 * in the file. */
#chat{border-radius:0;transform:translateX(100%);transition:transform .18s ease}
#chat[open]{transform:none}
/* The UA sheet hides a dialog that is not open. display:flex here was written
 * for the open drawer and it overrode that rule, so a closed drawer stayed in
 * the layout with its Send button reachable by Tab — a translated box is off the
 * viewport but still focusable, which means the keyboard walk of a closed panel
 * is a real bug rather than an invisible one. Restored, and it must stay ahead of
 * the display:flex above. */
#chat:not([open]){display:none}
@media (prefers-reduced-motion:reduce){#chat{transition:none}}
/* Below ~640px the drawer cannot leave anything behind it worth leaving, so it
 * stops pretending: full width, no slide, page-like. */
@media (max-width:40em){
  #chat{width:100vw;border-left:0;transform:translateY(100%)}
  #chat[open]{transform:none}
}

.chat-head{
  display:flex;align-items:center;gap:10px;padding:12px 14px;
  border-bottom:1px solid var(--line);flex:none
}
.chat-title{display:flex;flex-direction:column;flex:1;min-width:0}
.chat-title strong{font-size:.95rem;line-height:1.2}
.chat-title em{font-style:normal;color:var(--dimmer);font-size:.74rem}
.chat-log{
  flex:1;min-height:0;overflow-y:auto;padding:14px;
  display:flex;flex-direction:column;gap:12px;background:var(--bg);
}
.cline{display:flex;flex-direction:column;max-width:96%}
.cline.c-user{align-self:flex-end;align-items:flex-end}
.cline.c-assistant{align-self:flex-start;align-items:flex-start}
.ctext{
  border-radius:12px;padding:9px 12px;font-size:.92rem;line-height:1.55;
  word-break:break-word;overflow-wrap:anywhere;border:1px solid var(--line);
}
/* The reader's own line carries the accent, because it is the one thing on this
 * screen that is certainly theirs, and it keeps a long exchange readable at a
 * glance at which side is which. */
.c-user .ctext{background:rgba(67,176,255,.13);border-color:rgba(67,176,255,.3);color:var(--ink);border-bottom-right-radius:4px}
.c-assistant .ctext{background:var(--panel);border-bottom-left-radius:4px}
.cmeta{font-size:.7rem;color:var(--dimmer);margin:4px 2px 0;letter-spacing:.02em}
.c-sources,.c-search-suggestions{display:flex;flex-wrap:wrap;gap:5px 9px;margin:6px 2px 0;font-size:.74rem}
.c-sources strong{width:100%;font-weight:600;color:var(--dim)}
.c-sources a,.c-search-suggestions a{color:var(--accent);text-underline-offset:2px;overflow-wrap:anywhere}

/* Markdown inside a bubble: the renderer's block spacing has to be flattened, or
 * a one-line answer arrives as three paragraphs and a bubble that was one line
 * becomes four. */
.ctext p{margin:0}
.ctext p+p,.ctext ul,.ctext ol{margin-top:8px}
.ctext ul,.ctext ol{margin-left:18px;padding-left:0}
.ctext li+li{margin-top:3px}
.ctext h1,.ctext h2,.ctext h3{font-size:.95rem;margin:10px 0 4px}
.ctext code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.85em;
  background:var(--panel2);border:1px solid var(--line);border-radius:5px;padding:1px 5px
}
.ctext pre{
  background:var(--panel2);border:1px solid var(--line);border-radius:8px;
  padding:10px 12px;overflow-x:auto;margin:8px 0 0
}
.ctext pre code{background:none;border:0;padding:0;font-size:.8rem}
.ctext blockquote{margin:8px 0 0;padding:2px 0 2px 10px;border-left:2px solid var(--line);color:var(--dim)}
.ctext table{border-collapse:collapse;margin:8px 0 0;font-size:.86rem}
.ctext th,.ctext td{border:1px solid var(--line);padding:4px 8px;text-align:left}
.ctext th{background:var(--panel2);font-weight:600}
.ctext hr{border:0;border-top:1px solid var(--line);margin:10px 0}
.ctext a{text-decoration-thickness:1px;text-underline-offset:2px}

/* An empty conversation offers something rather than a cursor: three prompts
 * that are the shape of questions the assistant can answer about this page. */
.cintro{color:var(--dim);font-size:.9rem;display:flex;flex-direction:column;gap:8px}
.cintro p{margin:0}
.csuggest{
  border:1px solid var(--line);background:var(--panel);color:var(--ink);
  border-radius:9px;padding:8px 11px;font:inherit;font-size:.86rem;text-align:left;
  cursor:pointer
}
.csuggest:hover{background:var(--panel2);border-color:var(--dimmer)}

.chat-status{
  flex:none;margin:0;padding:8px 14px;font-size:.78rem;color:var(--dim);
  border-top:1px solid var(--line);background:var(--panel2)
}
/* A turn that is thinking is the one state the whole drawer must not look dead
 * in: a server loop with tools can sit on one step for seconds. */
.chat-status::before{
  content:"";display:inline-block;width:6px;height:6px;border-radius:50%;
  background:var(--accent);margin-right:7px;vertical-align:middle;
  animation:think 1.1s ease-in-out infinite
}
@keyframes think{0%,100%{opacity:.25}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){.chat-status::before{animation:none}}

.chat-form{
  display:flex;gap:8px;padding:11px 14px 14px;border-top:1px solid var(--line);flex:none;align-items:flex-end
}
.chat-form textarea{
  flex:1;min-height:40px;max-height:168px;resize:none;line-height:1.5;
  font-size:.92rem;padding:9px 11px
}
/* Send reads as the primary action only when there is something to send. */
.chat-form button.primary{flex:none;padding:9px 14px}
.chat-form.busy #chatSend{opacity:.55;pointer-events:none}

/* ---------------------------------------------------------- header controls
 * A round icon button in the identity cluster. 34px matches .brand-mark.sm's
 * optical weight, and the dot lives on the corner where a badge would. */
#chatBtn{
  position:relative;width:34px;height:34px;flex:none;border-radius:50%;
  display:grid;place-items:center;padding:0;
  background:transparent;border:1px solid var(--line);color:var(--dim);cursor:pointer
}
#chatBtn:hover{background:var(--panel2);border-color:var(--dimmer);color:var(--ink)}
#chatBtn:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(67,176,255,.16)}
#chatBtn .dot{
  position:absolute;right:2px;bottom:2px;width:8px;height:8px;border-radius:50%;
  border:2px solid var(--panel);background:transparent
}
/* Two states, and each is only ever true when it is true: "new" means there is
 * a reply this reader has not looked at, "busy" means an answer is arriving. */
#chatBtn[data-unread="new"] .dot{background:var(--good)}
#chatBtn[data-unread="busy"] .dot{
  background:var(--accent);animation:think 1.1s ease-in-out infinite
}
@media (prefers-reduced-motion:reduce){#chatBtn[data-unread="busy"] .dot{animation:none}}
#chatBtn svg{width:17px;height:17px;display:block}

/* ------------------------------------------------------- guided walkthrough */
#helpBtn{
  width:34px;height:34px;flex:none;padding:0;border-radius:50%;
  background:transparent;border:1px solid var(--line);color:var(--dim);
  font:600 1.1rem/1 inherit;cursor:pointer
}
#helpBtn:hover{background:var(--panel2);border-color:var(--dimmer);color:var(--ink)}
#helpBtn:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(67,176,255,.16)}
.tour-shade{
  position:fixed;inset:0;z-index:20;background:rgba(4,8,13,.64);pointer-events:none
}
.tour-focus{
  position:relative!important;z-index:21!important;
  outline:3px solid var(--accent)!important;outline-offset:5px!important;
  border-radius:10px;box-shadow:0 0 0 8px rgba(67,176,255,.16)!important
}
.tour-card{
  position:fixed;z-index:22;width:min(360px,calc(100vw - 32px));
  padding:18px;background:var(--panel);border:1px solid rgba(67,176,255,.7);
  border-radius:12px;box-shadow:0 18px 55px rgba(0,0,0,.55)
}
.tour-title{color:var(--accent)}
.tour-card h2{margin:5px 0 7px;font-size:1.12rem}
.tour-card p{margin:0;color:var(--dim);font-size:.9rem;line-height:1.5}
.tour-actions,.tour-next{display:flex;align-items:center;gap:8px}
.tour-actions{justify-content:space-between;margin-top:17px}
.tour-next{justify-content:flex-end}
@media (max-width:640px){
  .top-brand>div{display:none}
  .map-split{--map-h:max(480px,70vh)}
  .map-canvas{height:50vh;min-height:260px}
  .map-list{max-height:70vh}
  .tour-card{padding:15px}
}
