/* ==========================================================================
   Trips UI (TSNMI-style layout in the Riverstone palette)
   Used by trip.html (body.tpage) and the trips list on account.html (body.tlpage).
   Read mode by default; planners flip on "Edit plan" to see the add/edit tools.
   ========================================================================== */
.tpage,.tlpage{
  --tp-ink:#3B342B; --tp-primary:#5C7A5A; --tp-primary-deep:#4A6449;
  --tp-bg:#FAF8F4; --tp-card:#FFFFFF; --tp-soft:#F4F0E8; --tp-sand:#EFE9DF;
  --tp-line:#E4DDD0; --tp-muted:#7A6C58; --tp-rust:#A6553C;
  --tp-r:14px; --tp-shadow:0 2px 10px rgba(59,52,43,.07);
  background:var(--tp-bg); color:var(--tp-ink); font-size:16px; line-height:1.5;
}
.tp-main{padding:14px 0 40px}
.tp-main .wrap{max-width:1060px}
[hidden]{display:none!important}

/* per-row edit: .ed shows only inside an element being edited, .ro hides there */
.tpage .ed:not(.editing .ed){display:none!important}
.tpage .editing .ro{display:none!important}
.tp-editbtn{flex:none;display:inline-flex;align-items:center;gap:5px;min-height:38px;padding:6px 11px;border-radius:10px;
  border:1px solid var(--tp-line);background:#fff;color:var(--tp-primary-deep);font:600 14px 'Outfit',sans-serif;cursor:pointer;line-height:1}
.tp-editbtn:hover{background:var(--tp-soft)}
.tp-editbtn span{white-space:nowrap}
.tp-gear.editing,.tp-rem.editing{background:#FCFBF8;margin:0 -10px;padding-left:10px;padding-right:10px;border-radius:10px}
.tp-item.editing{border-color:var(--tp-primary)}
.tp-stay.editing{box-shadow:0 0 0 2px var(--tp-primary)}

/* back link */
.tp-back{display:inline-flex;align-items:center;gap:6px;min-height:40px;font-weight:600;font-size:15px;color:var(--tp-primary-deep)}
.tp-back:hover{text-decoration:none;color:var(--tp-ink)}

/* cards */
.tp-card{background:var(--tp-card);border:1px solid var(--tp-line);border-radius:var(--tp-r);box-shadow:var(--tp-shadow);padding:16px 18px;min-width:0}
.tp-card + .tp-card{margin-top:12px}
.tp-card h3,.tp-cardh h3{font-family:'Outfit',sans-serif;font-weight:700;font-size:18px;line-height:1.2;margin:0 0 10px;letter-spacing:-.01em}
.tp-cardh{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:10px}
.tp-cardh h3{margin:0}
.tp-sub{color:var(--tp-muted);font-size:14px;font-weight:500;text-align:right}
.tp-note{color:var(--tp-muted);font-size:14px;margin:10px 0 0}
.tp-empty{color:var(--tp-muted);font-size:15px;margin:2px 0}
.tp-err{color:var(--tp-rust);font-size:14px;margin:6px 0}
.tp-err:empty{display:none}

/* buttons */
.tp-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:46px;padding:10px 18px;
  border-radius:12px;border:1px solid transparent;font-family:'Outfit',sans-serif;font-weight:600;font-size:16px;
  cursor:pointer;transition:background .15s,border-color .15s;white-space:nowrap;text-decoration:none;line-height:1.1}
.tp-btn:hover{text-decoration:none}
.tp-btn.primary{background:var(--tp-primary);color:#fff}
.tp-btn.primary:hover{background:var(--tp-primary-deep)}
.tp-btn.ghost{background:#fff;color:var(--tp-ink);border-color:var(--tp-line)}
.tp-btn.ghost:hover{background:var(--tp-soft)}
.tp-btn.ghost.on{background:var(--tp-ink);border-color:var(--tp-ink);color:#fff}
.tp-btn.danger{background:#fff;color:var(--tp-rust);border-color:#EBD3C9}
.tp-btn.danger:hover{background:#FBF1ED}
.tp-btn.sm{min-height:38px;padding:7px 13px;font-size:14.5px;border-radius:10px}
.tp-btn:disabled{opacity:.55;cursor:default}
.tp-btns{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.tp-linkbtn{background:none;border:none;padding:6px 0;color:var(--tp-primary-deep);font:600 15px 'Montserrat',sans-serif;cursor:pointer}

/* chips */
.tp-chip{display:inline-flex;align-items:center;gap:5px;background:var(--tp-soft);border:1px solid var(--tp-line);
  border-radius:999px;padding:3px 11px;font-size:13px;font-weight:600;color:var(--tp-primary-deep);white-space:nowrap}
.tp-chip.st-now{background:#E7F0E5;color:#2F5A2D;border-color:#C5DBC1;font-weight:700}
.tp-chip.st-up{background:#EEF2EA;color:var(--tp-primary-deep);border-color:#D6E0D2}
.tp-chip.st-past{background:var(--tp-soft);color:var(--tp-muted)}
.tp-chip.st-tbd{background:#FAF0E4;color:#8E5A26;border-color:#EEDCC4}

/* avatars */
.tp-av{width:30px;height:30px;border-radius:50%;flex:none;display:inline-flex;align-items:center;justify-content:center;
  background:var(--tp-sand);color:var(--tp-primary-deep);font:700 13px 'Outfit',sans-serif;background-size:cover;background-position:center;
  border:2px solid #fff}
.tp-av.lg{width:40px;height:40px;font-size:16px}
.tp-avs{display:inline-flex}
.tp-avs .tp-av + .tp-av{margin-left:-8px}

/* ---------- trip header ---------- */
.tp-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px 20px;flex-wrap:wrap;margin:6px 0 14px}
.tp-headmain{min-width:0;flex:1 1 420px}
.tp-head h1{font-family:'Outfit',sans-serif;font-weight:700;font-size:clamp(28px,5vw,40px);line-height:1.08;letter-spacing:-.02em;margin:8px 0 8px;overflow-wrap:anywhere}
.tp-meta{display:flex;flex-wrap:wrap;gap:6px 18px;color:var(--tp-muted);font-size:15.5px}
.tp-meta b{color:var(--tp-ink);font-weight:600}
.tp-crewline{display:flex;align-items:center;gap:10px;margin-top:10px;font-size:15px;color:var(--tp-muted)}
.tp-crewline b{color:var(--tp-ink);font-weight:600}
.tp-actions{display:flex;gap:8px;flex-wrap:wrap}

/* trip details (edit mode) */
.tp-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px 12px;align-items:end}
.tpage label,.tlpage label{display:block;font-size:13.5px;font-weight:600;color:var(--tp-muted);margin:0 0 5px;letter-spacing:0;text-transform:none}
.tpage input[type=text],.tpage input[type=search],.tpage input[type=date],.tpage input[type=time],.tpage input[type=number],.tpage select,.tpage textarea,
.tlpage input[type=text],.tlpage input[type=search],.tlpage input[type=date],.tlpage input[type=number]{
  width:100%;min-height:46px;padding:10px 12px;border:1px solid var(--tp-line);border-radius:10px;background:#fff;
  font:16px 'Montserrat',sans-serif;color:var(--tp-ink)}
.tpage textarea{min-height:96px;resize:vertical;line-height:1.45}
.tpage input:focus,.tpage select:focus,.tpage textarea:focus,.tlpage input:focus{outline:2px solid var(--tp-primary);outline-offset:0;border-color:transparent}
.tp-split{border-top:1px solid var(--tp-soft);margin-top:14px;padding-top:14px}
.tp-invite{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:15px;color:var(--tp-muted)}
.tp-invite b{font-family:'Outfit',sans-serif;font-size:18px;letter-spacing:.14em;color:var(--tp-ink);background:var(--tp-soft);
  border:1px solid var(--tp-line);border-radius:8px;padding:4px 12px}
.tp-hits{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.tp-hits:empty{display:none}
.tp-hit{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:#fff;border:1px solid var(--tp-line);
  border-radius:10px;padding:8px 10px;cursor:pointer;font:inherit;color:inherit;min-height:52px}
.tp-hit:hover{background:var(--tp-soft)}
.tp-hit img{width:44px;height:44px;border-radius:8px;object-fit:cover;flex:none}
.tp-hit .h{flex:1;min-width:0;display:flex;flex-direction:column}
.tp-hit .h b{font-weight:600;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tp-hit .h small{color:var(--tp-muted);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tp-hit .add{flex:none;font:600 14px 'Outfit',sans-serif;color:var(--tp-primary-deep);background:var(--tp-soft);border-radius:8px;padding:6px 11px}
.tp-hit:disabled{opacity:.55}
.tp-msg{font-size:14px;margin-top:6px;color:var(--tp-muted)}
.tp-msg:empty{display:none}
.tp-msg.ok{color:var(--tp-primary-deep)} .tp-msg.err{color:var(--tp-rust)}
.tp-synced{font-size:13px;color:var(--tp-muted);margin:12px 0 0}

/* weather strip */
.tp-wx{display:flex;gap:8px;overflow-x:auto;padding:2px 0 4px;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
.tp-wday{flex:none;width:72px;text-align:center;background:var(--tp-soft);border:1px solid var(--tp-line);border-radius:12px;padding:8px 4px;line-height:1.25}
.tp-wday.ontrip{background:#fff;border-color:var(--tp-primary);box-shadow:inset 0 0 0 1px var(--tp-primary)}
.tp-wday .lbl{font-size:12px;font-weight:700;color:var(--tp-muted);text-transform:uppercase;letter-spacing:.04em}
.tp-wday .ico{font-size:22px;margin:3px 0}
.tp-wday .hi{font-weight:700;font-size:16px}
.tp-wday .lo{color:var(--tp-muted);font-size:13px}
.tp-wday .pp{color:#3E6E9E;font-size:12px;font-weight:600;min-height:15px}

/* tabs */
.tp-tabs{position:sticky;top:56px;z-index:40;display:flex;gap:6px;margin:16px -4px 14px;padding:8px 4px;background:var(--tp-bg)}
.tp-tabs button{display:inline-flex;align-items:center;justify-content:center;gap:7px;background:#fff;border:1px solid var(--tp-line);
  border-radius:999px;padding:9px 18px;min-height:46px;font:600 15.5px 'Outfit',sans-serif;color:var(--tp-ink);cursor:pointer;white-space:nowrap}
.tp-tabs button i{font-style:normal;font-size:17px;line-height:1}
.tp-tabs button.active{background:var(--tp-primary);border-color:var(--tp-primary);color:#fff}
.tp-pane{min-width:0}
.tp-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);gap:14px;align-items:start}
.tp-grid > *{min-width:0}

/* day cards */
.tp-days{display:flex;flex-direction:column;gap:12px}
.tp-day{background:#fff;border:1px solid var(--tp-line);border-radius:var(--tp-r);box-shadow:var(--tp-shadow);overflow:hidden}
.tp-day.is-today{box-shadow:0 0 0 2px var(--tp-primary)}
.tp-dayhead{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:11px 16px;border:none;cursor:pointer;
  background:var(--tp-primary-deep);color:#fff;font:700 17px 'Outfit',sans-serif;text-align:left}
.tp-dayhead:hover{background:var(--tp-ink)}
.tp-dayhead .chev{display:inline-flex;font-size:20px;line-height:1;color:rgba(255,255,255,.8);transform:rotate(90deg);transition:transform .16s}
.tp-day.collapsed .tp-dayhead .chev{transform:rotate(0)}
.tp-dayhead .date{font-weight:500;color:#E7EDE3}
.tp-dayhead .date::before{content:"\00B7";margin-right:9px;color:rgba(255,255,255,.5)}
.tp-dayhead .today{font-size:11.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--tp-primary-deep);background:#fff;border-radius:999px;padding:2px 9px}
.tp-dayhead .count{margin-left:auto;font:700 12.5px 'Montserrat',sans-serif;background:rgba(255,255,255,.18);border-radius:999px;padding:3px 10px;white-space:nowrap}
.tp-dayhead .count.none{font-weight:600;color:rgba(255,255,255,.75);background:rgba(255,255,255,.1)}
.tp-day.collapsed .tp-daybody{display:none}
.tp-daybody{padding:12px 14px 14px;display:flex;flex-direction:column;gap:8px}
.tp-dayline{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;font-size:14.5px;color:var(--tp-muted)}
.tp-dayline .stay{display:inline-flex;align-items:center;gap:6px;background:#EEF2EA;color:#3D5A3B;border-radius:999px;padding:4px 11px;font-weight:600;border:none;font-size:14px;cursor:pointer}
.tp-wxchip{display:inline-flex;align-items:center;gap:5px;background:var(--tp-soft);border-radius:999px;padding:4px 10px;font-weight:600;color:var(--tp-ink);font-size:14px}
.tp-wxwhere{font-size:13px}
.tp-daynote{background:#FBF8F2;border:1px solid var(--tp-line);border-left:4px solid #C9B98F;border-radius:10px;padding:9px 12px;font-size:15px;white-space:pre-wrap;overflow-wrap:anywhere}
.tp-daynote .edbtn{float:right;margin:-4px -4px 0 8px}
.tp-dayempty{color:var(--tp-muted);font-size:15px;margin:2px 2px}

/* itinerary items */
.tp-item{background:#fff;border:1px solid var(--tp-line);border-left:4px solid var(--tp-primary);border-radius:12px;overflow:hidden}
.tp-item.k-route{border-left-color:var(--tp-primary-deep)}
.tp-item.k-trailhead{border-left-color:#8A7A64}
.tp-item.k-drive{border-left-color:#B0A289}
.tp-item.k-rest{border-left-color:#C9BDA4}
.tp-item.k-resupply,.tp-item.k-note{border-left-color:var(--tp-rust)}
.tp-item.k-lodging,.tp-item.k-camp{border-left-color:#7FA07C}
.tp-itemhead{display:flex;align-items:center;gap:11px;width:100%;min-height:58px;padding:9px 12px;background:none;border:none;
  text-align:left;font:inherit;color:inherit;cursor:pointer}
.tp-itemhead.static{cursor:default}
.tp-itemhead:hover:not(.static){background:#FCFBF8}
.tp-ico{width:36px;height:36px;flex:none;border-radius:10px;background:var(--tp-soft);display:flex;align-items:center;justify-content:center;font-size:17px;color:var(--tp-primary-deep)}
.tp-itembody{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.tp-itembody b{font:600 16.5px 'Outfit',sans-serif;line-height:1.2;overflow-wrap:anywhere}
.tp-itembody small{font-size:13.5px;color:var(--tp-muted);line-height:1.35}
.tp-chev{flex:none;font-size:22px;line-height:1;color:#C9BFAE;transition:transform .15s}
.tp-item.open .tp-chev{transform:rotate(90deg);color:var(--tp-primary)}
.tp-itemdetail{display:none;border-top:1px solid var(--tp-soft);padding:12px 14px 14px;flex-direction:column;gap:10px}
.tp-item.open .tp-itemdetail{display:flex}
.tp-detailtext{font-size:15px;white-space:pre-wrap;overflow-wrap:anywhere;margin:0}
.tp-kv{font-size:14.5px;color:var(--tp-muted)}
.tp-kv b{color:var(--tp-ink);font-weight:600}
.tp-photos{display:flex;flex-wrap:wrap;gap:8px}
.tp-photos:empty{display:none}
.tp-photos figure{position:relative;margin:0}
.tp-photos img{width:96px;height:96px;object-fit:cover;border-radius:10px;display:block}
.tp-photos .x{position:absolute;top:4px;right:4px;width:28px;height:28px;border-radius:50%;border:none;background:rgba(0,0,0,.6);color:#fff;cursor:pointer}
.tpage .tp-photos .x:not(.editing .x){display:none}
.tp-row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tp-dirty{font-size:13.5px;color:var(--tp-muted)}
.tp-unplaced{background:#FCF7EE;border:1px dashed #D9C7A3;border-radius:var(--tp-r);padding:12px 14px;display:flex;flex-direction:column;gap:8px}
.tp-unplaced .uh{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.tp-unplaced .uh b{font:700 16px 'Outfit',sans-serif}
.tp-unplaced .uh small{color:var(--tp-muted);font-size:13.5px}

/* who chips (edit mode) */
.tp-who{display:flex;flex-wrap:wrap;gap:6px}
.tp-whochip{min-height:36px;padding:5px 12px;border-radius:999px;border:1px solid var(--tp-line);background:#fff;
  font:600 14px 'Montserrat',sans-serif;color:var(--tp-muted);cursor:pointer}
.tp-whochip.on{background:var(--tp-primary);border-color:var(--tp-primary);color:#fff}

/* day add tools (edit mode) */
.tp-dayadd{display:flex;flex-direction:column;gap:8px;border-top:1px dashed var(--tp-line);padding-top:10px;margin-top:2px}
.tp-dayadd .acts{display:flex;flex-wrap:wrap;gap:6px}
.tp-dayadd .acts button{min-height:40px;padding:7px 13px;border-radius:10px;border:1px solid var(--tp-line);background:#fff;font:600 14.5px 'Outfit',sans-serif;color:var(--tp-primary-deep);cursor:pointer}
.tp-dayadd .acts button.on{background:var(--tp-soft);border-color:var(--tp-primary)}
.tp-stoprow{display:grid;grid-template-columns:150px 1fr auto;gap:8px}

/* side column */
.tp-rowitem{display:flex;align-items:center;gap:11px;padding:9px 0;border-bottom:1px solid var(--tp-soft)}
.tp-rowitem:last-child{border-bottom:none}
.tp-rowitem .grow{flex:1;min-width:0}
.tp-rowitem .grow b{display:block;font-weight:600;font-size:15.5px}
.tp-rowitem .grow small{color:var(--tp-muted);font-size:13.5px}

/* stays */
.tp-stays{display:flex;flex-direction:column;gap:12px}
.tp-stay{border-left:4px solid #7FA07C}
.tp-stayhead{display:flex;align-items:flex-start;gap:12px}
.tp-stayhead .tp-ico{background:#EEF2EA}
.tp-stayhead .h{flex:1;min-width:0}
.tp-stayhead .h b{display:block;font:700 18px 'Outfit',sans-serif;line-height:1.2;overflow-wrap:anywhere}
.tp-stayhead .h small{color:var(--tp-muted);font-size:14.5px}
.tp-staybody{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.tp-addr{font-size:15px;overflow-wrap:anywhere}
.tp-nights{display:flex;flex-wrap:wrap;gap:6px}

/* gear */
.tp-gearcols{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start}
.tp-gear{display:flex;align-items:flex-start;gap:11px;padding:10px 0;border-bottom:1px solid var(--tp-soft)}
.tp-gear:last-child{border-bottom:none}
.tp-gear .gl{flex:1;min-width:0}
.tp-gear .gl b{display:block;font-weight:600;font-size:15.5px;overflow-wrap:anywhere}
.tp-gear .gl small{color:var(--tp-muted);font-size:13.5px}
.tp-gear.packed .gl b{color:var(--tp-muted)}
.tp-gear .tp-who{margin-top:7px}
.tp-check{flex:none;position:relative;width:28px;height:28px;margin:0!important;cursor:pointer}
.tp-check input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.tp-check .box{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;border:2px solid #CFC5B3;background:#fff;color:#fff;font-size:16px;font-weight:800}
.tp-check input:checked + .box{background:var(--tp-primary);border-color:var(--tp-primary)}
.tp-check input:checked + .box::after{content:"\2713"}
.tp-check input:focus-visible + .box{outline:2px solid var(--tp-primary);outline-offset:2px}
.tp-x{flex:none;width:38px;height:38px;border-radius:10px;border:1px solid var(--tp-line);background:#fff;color:var(--tp-muted);cursor:pointer;font-size:15px}
.tp-x:hover{color:var(--tp-rust);border-color:#EBD3C9}
.tp-total{margin-top:10px;font-size:14px;color:var(--tp-muted);font-weight:600}
.tp-total:empty{display:none}
.tp-chipset{display:flex;flex-wrap:wrap;gap:6px}
.tp-pick{min-height:40px;padding:6px 12px;border-radius:10px;border:1px solid var(--tp-line);background:#fff;font:600 14px 'Montserrat',sans-serif;color:var(--tp-ink);cursor:pointer;display:inline-flex;gap:8px;align-items:center}
.tp-pick i{font-style:normal;color:var(--tp-muted);font-weight:500;font-size:13px}
.tp-pick.on{background:#EEF2EA;border-color:var(--tp-primary)}
.tp-pick:disabled{opacity:.5;cursor:default}
.tp-gearhit{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--tp-soft)}
.tp-gearhit .cat{flex:none;font-size:11.5px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--tp-muted);background:var(--tp-soft);border-radius:6px;padding:3px 7px}
.tp-gearhit .h{flex:1;min-width:0}
.tp-gearhit .h b{display:block;font-weight:600;font-size:15px}
.tp-gearhit .h small{color:var(--tp-muted);font-size:13px}
.tp-gearhit input{width:70px!important;min-height:40px!important;flex:none}
.tpage details.tp-card > summary{cursor:pointer;font:700 17px 'Outfit',sans-serif;list-style:none;min-height:28px}
.tpage details.tp-card > summary::-webkit-details-marker{display:none}
.tpage details.tp-card > summary::after{content:" \25BE";color:var(--tp-primary)}
.tpage details.tp-card[open] > summary{margin-bottom:12px}
.tp-inline{display:flex;align-items:center;gap:8px;font-size:14.5px;color:var(--tp-muted);font-weight:500}
.tp-inline input{width:20px!important;height:20px;min-height:0!important}

/* reminders */
.tp-rem{display:flex;align-items:flex-start;gap:12px;padding:12px 0;border-bottom:1px solid var(--tp-soft)}
.tp-rem:last-child{border-bottom:none}
.tp-rem .rb{flex:1;min-width:0}
.tp-rem .rb b{display:block;font-weight:600;font-size:16px;overflow-wrap:anywhere}
.tp-rem.done .rb b{text-decoration:line-through;color:var(--tp-muted)}
.tp-rem .rb small{color:var(--tp-muted);font-size:13.5px}
.tp-rem .due.soon{color:var(--tp-rust);font-weight:700}
.tp-rem .tp-who{margin-top:8px}
.tp-addrow{display:grid;grid-template-columns:1fr 170px auto;gap:10px;align-items:end;margin-top:12px;border-top:1px solid var(--tp-soft);padding-top:14px}

/* map */
#tripmap{height:440px;border-radius:12px;overflow:hidden}
.tp-mapcard{padding:8px}

/* gate */
.tp-gate{max-width:560px;margin:24px auto;text-align:center;padding:28px 22px}
.tp-gate .big{font-size:44px;line-height:1;margin-bottom:10px}
.tp-gate h2{font:700 24px 'Outfit',sans-serif;margin:0 0 8px}
.tp-gate p{color:var(--tp-muted);font-size:16px;margin:0 0 18px}
.tp-gate .tp-btns{justify-content:center;flex-direction:column;align-items:stretch;max-width:340px;margin:0 auto}

/* toast */
.tp-toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);z-index:950;background:var(--tp-ink);color:#fff;
  font:600 15px 'Montserrat',sans-serif;padding:11px 18px;border-radius:999px;box-shadow:0 8px 24px rgba(0,0,0,.18);
  opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;white-space:nowrap}
.tp-toast.show{opacity:1;transform:translate(-50%,0)}
body.has-tabbar .tp-toast{bottom:84px}

/* ---------- trips list (account.html) ---------- */
.tl-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:8px 0 16px}
.tl-head h1{font-family:'Outfit',sans-serif;font-weight:700;font-size:clamp(28px,5vw,40px);letter-spacing:-.02em;line-height:1.1;margin:0}
.tl-bar{display:flex;justify-content:flex-end;margin:0 0 12px}
.tl-toggle{display:inline-flex;background:#fff;border:1px solid var(--tp-line);border-radius:999px;padding:3px}
.tl-toggle button{border:none;background:none;border-radius:999px;min-height:38px;padding:6px 16px;font:600 14.5px 'Outfit',sans-serif;color:var(--tp-ink);cursor:pointer}
.tl-toggle button.on{background:var(--tp-ink);color:#fff}
.tl-group + .tl-group{margin-top:22px}
.tl-grouph{font:800 13px 'Outfit',sans-serif;letter-spacing:.08em;text-transform:uppercase;color:var(--tp-primary-deep);margin:0 0 8px}
.tl-grouph span{color:var(--tp-muted);font-weight:600}
.tl-list{display:flex;flex-direction:column;gap:10px}
.tl-card{background:#fff;border:1px solid var(--tp-line);border-radius:var(--tp-r);box-shadow:var(--tp-shadow);overflow:hidden}
.tl-card.st-now{border-color:#A9C8A4;box-shadow:0 0 0 2px #E7F0E5}
.tl-card.st-past{opacity:.8}
.tl-link{display:flex;gap:14px;padding:14px;color:inherit;align-items:center}
.tl-link:hover{text-decoration:none;background:#FCFBF8}
.tl-ph{width:76px;height:76px;flex:none;border-radius:12px;overflow:hidden;background:var(--tp-sand)}
.tl-ph img{width:100%;height:100%;object-fit:cover;display:block}
.tl-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.tl-title{font:700 19px 'Outfit',sans-serif;line-height:1.2;color:var(--tp-ink);overflow-wrap:anywhere}
.tl-meta{display:flex;flex-direction:column;gap:2px;font-size:14.5px;color:var(--tp-muted)}
.tl-meta span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tl-kinds{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px}
.tl-go{flex:none;font-size:26px;color:#C9BFAE}
.tl-foot{display:flex;align-items:center;gap:10px;padding:9px 14px;border-top:1px solid var(--tp-soft);background:#FCFBF8;flex-wrap:wrap}
.tl-foot .grow{flex:1}
.tl-foot .tp-btn.sm{min-height:36px}
.tl-empty{text-align:center;padding:26px 18px}
.tl-empty .big{font-size:40px;margin-bottom:6px}
.tl-empty p{color:var(--tp-muted);margin:0 0 14px}
.tl-new{margin-bottom:16px}
.tlpage #tripcal .card{border-radius:var(--tp-r)}

/* ---------- phones ---------- */
@media (max-width:900px){
  .tp-grid{grid-template-columns:minmax(0,1fr)}
  .tp-aside{display:none}
}
@media (max-width:640px){
  .tp-main .wrap,.tlpage .wrap{padding:0 14px}
  .tp-head{margin-top:0}
  .tp-actions{width:100%}
  .tp-actions .tp-btn{flex:1 1 0}
  .tp-card{padding:14px}
  .tp-tabs{top:56px;margin:14px -14px 12px;padding:6px 10px;gap:4px;border-bottom:1px solid var(--tp-line)}
  .tp-tabs button{flex:1 1 0;min-width:0;flex-direction:column;gap:2px;padding:6px 2px;min-height:56px;border-radius:14px;font-size:12.5px;font-weight:700}
  .tp-tabs button i{font-size:20px}
  .tp-tabs button span{max-width:100%;overflow:hidden;text-overflow:ellipsis}
  .tp-gearcols{grid-template-columns:1fr}
  .tp-addrow{grid-template-columns:1fr 1fr}
  .tp-addrow > :first-child{grid-column:1 / -1}
  .tp-stoprow{grid-template-columns:1fr}
  .tp-row2{grid-template-columns:1fr 1fr}
  .tp-daybody{padding:10px 10px 12px}
  .tp-itemhead{padding:9px 10px;gap:10px}
  #tripmap{height:380px}
  .tl-ph{width:64px;height:64px}
  .tl-title{font-size:18px}
  .tl-head .tp-btns{width:100%}
  .tl-head .tp-btns .tp-btn{flex:1 1 0}
}

/* neutralize the legacy single-card itinerary + map rules from style.css */
.tpage #itin{background:none;border:0;border-radius:0;padding:0;box-shadow:none}
.tpage #tripmap{height:440px;border:0;border-radius:12px;margin:0}
@media (max-width:640px){ .tpage #itin{padding:0} .tpage #tripmap{height:380px} }
.tp-daybody > div:empty{display:none}
.tp-ico{font-size:19px}
.tpage section.tp-pane{padding:0;margin:0}
@media (max-width:640px){
  .tp-dayadd .acts{flex-wrap:nowrap}
  .tp-dayadd .acts button{flex:1 1 0;padding:7px 4px;font-size:13.5px;min-width:0}
}
.tpage #tripmap{isolation:isolate;position:relative;z-index:0}
.tlpage #triplist{display:block;grid-template-columns:none}
.tl-meta span{white-space:normal;overflow:visible}

/* add tools live on every tab now: keep them quiet but obvious */
.tpage details.tp-card > summary{color:var(--tp-primary-deep)}
.tp-dayadd{border-top:1px dashed var(--tp-line)}
@media (max-width:640px){ .tp-editbtn span{display:none} .tp-editbtn{padding:6px 10px} .tp-stay .tp-editbtn span{display:inline} }

/* ---------- itinerary block timeline ---------- */
.tl-weekwrap{margin:0 0 14px}
.tl-week{background:#fff;border:1px solid var(--tp-line);border-radius:var(--tp-r);box-shadow:var(--tp-shadow);overflow:hidden}
.tl-bar{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--tp-line)}
.tl-bar b{font:600 16px 'Outfit',sans-serif}
.tl-bar small{color:var(--tp-muted);font-size:13.5px}
.tl-bar .nav{margin-left:auto;display:flex;gap:6px}
.tl-bar .nav button{width:36px;height:36px;border-radius:10px;border:1px solid var(--tp-line);background:#fff;font-size:20px;line-height:1;color:var(--tp-primary-deep);cursor:pointer}
.tl-bar .nav button:disabled{opacity:.35;cursor:default}
.tl-grid{display:grid;grid-template-columns:58px repeat(var(--cols),minmax(0,1fr))}
.tl-corner{background:var(--tp-primary-deep)}
.tl-dh{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;padding:9px 10px 10px;border:none;border-left:1px solid rgba(255,255,255,.14);
  background:var(--tp-primary-deep);color:#fff;text-align:left;cursor:pointer;font:inherit}
.tl-dh:hover{background:var(--tp-ink)}
.tl-dh.is-today{background:var(--tp-primary)}
.tl-dh .r1{display:flex;align-items:center;gap:6px;width:100%}
.tl-dh b{font:700 15.5px 'Outfit',sans-serif}
.tl-dh .today{display:inline-block;margin-right:6px;font-size:9.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--tp-primary-deep);background:#fff;border-radius:999px;padding:1px 6px;vertical-align:1px}
.tl-dh .plus{margin-left:auto;font-size:17px;line-height:1;opacity:.6}
.tl-dh:hover .plus{opacity:1}
.tl-dh small{max-width:100%;font-size:12.5px;color:#E7EDE3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tl-dh small:empty{display:none}
.tl-anylab{padding:9px 8px 0 0;text-align:right;font:700 10.5px 'Montserrat',sans-serif;letter-spacing:.05em;text-transform:uppercase;color:var(--tp-muted);background:var(--tp-soft);border-bottom:1px solid var(--tp-line)}
.tl-anycell{min-width:0;display:flex;flex-direction:column;gap:4px;padding:6px 5px;background:var(--tp-soft);border-left:1px solid var(--tp-line);border-bottom:1px solid var(--tp-line)}
.tl-chip{display:block;width:100%;min-height:28px;padding:5px 8px;border:1px solid var(--tp-line);border-left:3px solid var(--tp-primary);border-radius:8px;background:#fff;
  font:600 13px 'Outfit',sans-serif;color:var(--tp-ink);text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.tl-chip:hover{background:#FCFBF8}
.tl-chip.note{border-left-color:#C9B98F;font:500 12.5px 'Montserrat',sans-serif;color:var(--tp-muted)}
.tl-gutcell{padding:9px 0}
.tl-gut{position:relative}
.tl-gut span{position:absolute;right:8px;transform:translateY(-50%);font-size:11px;font-weight:600;color:var(--tp-muted);white-space:nowrap}
.tl-cell{min-width:0;padding:9px 0;border-left:1px solid var(--tp-line)}
.tl-cell.is-today{background:#F7FAF5}
.tl-col{--tl-px:44px;position:relative;border-bottom:1px solid var(--tp-line);
  background-image:linear-gradient(to bottom,var(--tp-line) 1px,transparent 1px),linear-gradient(to bottom,#F3EFE7 1px,transparent 1px);
  background-size:100% var(--tl-px),100% calc(var(--tl-px) / 2)}
.tl-block{position:absolute;display:flex;flex-direction:column;gap:1px;padding:4px 7px;border:none;border-left:3px solid var(--tp-primary);border-radius:7px;
  background:#E9EFE6;color:var(--tp-ink);text-align:left;overflow:hidden;cursor:pointer;font:inherit;box-shadow:0 1px 2px rgba(59,52,43,.1);z-index:1}
.tl-block:hover{z-index:2;box-shadow:0 2px 8px rgba(59,52,43,.18)}
.tl-block{container-type:inline-size}
.tl-block .t{font:600 13.5px/1.22 'Outfit',sans-serif;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:break-word}
.tl-block.tall .t{-webkit-line-clamp:4}
.tl-block.mid .t{-webkit-line-clamp:1}
.tl-block .m{font-size:11.5px;color:var(--tp-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tl-block.short{flex-direction:row;align-items:center;gap:6px;padding:1px 7px}
.tl-block.short .t{display:block;flex:1;min-width:0;white-space:nowrap;text-overflow:ellipsis}
.tl-block.short .m{flex:none}
@container (max-width:150px){ .tl-block.short .m{display:none} }
.tl-block.est{-webkit-mask-image:linear-gradient(to bottom,#000 60%,rgba(0,0,0,.45));mask-image:linear-gradient(to bottom,#000 60%,rgba(0,0,0,.45))}
.tl-block.est::after{content:"";position:absolute;left:0;right:0;bottom:0;border-bottom:2px dashed rgba(59,52,43,.35)}
.tl-now{position:absolute;left:0;right:0;height:2px;background:var(--tp-rust);z-index:3;pointer-events:none}
.tl-now::before{content:"";position:absolute;left:-4px;top:-3px;width:8px;height:8px;border-radius:50%;background:var(--tp-rust)}
/* colours follow the plan cards' left edges */
.tl-block.k-route,.tl-chip.k-route{border-left-color:var(--tp-primary-deep)}
.tl-block.k-route{background:#E3EBE1}
.tl-block.k-trailhead,.tl-chip.k-trailhead{border-left-color:#8A7A64}
.tl-block.k-trailhead{background:#F1ECE4}
.tl-block.k-drive,.tl-block.k-travel,.tl-chip.k-drive,.tl-chip.k-travel{border-left-color:#B0A289}
.tl-block.k-drive,.tl-block.k-travel{background:#F4F0E8}
.tl-block.k-rest,.tl-chip.k-rest{border-left-color:#C9BDA4}
.tl-block.k-rest{background:#F6F2EA}
.tl-block.k-resupply,.tl-block.k-note,.tl-block.k-food,.tl-chip.k-resupply,.tl-chip.k-note,.tl-chip.k-food{border-left-color:var(--tp-rust)}
.tl-block.k-resupply,.tl-block.k-note,.tl-block.k-food{background:#F6EAE4}

/* phones: the open day card shows its own timeline */
.tl-day{display:flex;flex-direction:column;gap:10px}
.tl-sub{font:700 11px 'Montserrat',sans-serif;letter-spacing:.06em;text-transform:uppercase;color:var(--tp-muted);margin:0 2px}
.tl-dayany{display:flex;flex-direction:column;gap:8px}
.tl-anycard{display:flex;align-items:center;gap:11px;width:100%;min-height:58px;padding:9px 12px;background:#fff;border:1px solid var(--tp-line);border-left:4px solid var(--tp-primary);
  border-radius:12px;text-align:left;cursor:pointer;font:inherit;color:inherit}
.tl-anycard.k-route{border-left-color:var(--tp-primary-deep)}
.tl-anycard.k-trailhead{border-left-color:#8A7A64}
.tl-anycard.k-drive,.tl-anycard.k-travel{border-left-color:#B0A289}
.tl-anycard.k-rest{border-left-color:#C9BDA4}
.tl-anycard.k-resupply,.tl-anycard.k-note,.tl-anycard.k-food{border-left-color:var(--tp-rust)}
.tl-daygrid{display:grid;grid-template-columns:52px minmax(0,1fr);background:#fff;border:1px solid var(--tp-line);border-radius:12px;overflow:hidden}
.tl-daygrid .tl-block .t{font-size:14.5px}
.tl-daygrid .tl-block .m{font-size:12.5px}

/* the panel a block opens */
body.tl-lock{overflow:hidden}
.tl-sheetbg{position:fixed;inset:0;z-index:1100;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(40,35,28,.45)}
.tl-sheet{position:relative;display:flex;flex-direction:column;width:min(580px,100%);max-height:calc(100vh - 48px);background:var(--tp-bg);border-radius:16px;box-shadow:0 20px 50px rgba(0,0,0,.25);overflow:hidden}
.tl-sheetbody{overflow:auto;padding:14px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.tl-x{position:absolute;top:22px;right:22px;z-index:2;width:34px;height:34px;border-radius:50%;border:1px solid var(--tp-line);background:#fff;color:var(--tp-ink);font-size:14px;line-height:1;cursor:pointer;
  transform:translateY(-4px)}
.tl-sheetbody > .tp-item > .tp-itemdetail{display:flex}
.tl-sheetbody > .tp-item > .tp-itemhead{cursor:default;padding-right:52px}
.tl-sheetbody > .tp-item > .tp-itemhead .tp-chev{display:none}
.tl-sheetbody > .tp-item > .tp-itemhead:hover{background:none}
.tl-sheetbody > .tp-day{box-shadow:none}
.tl-sheetbody > .tp-day > .tp-dayhead{cursor:default;padding-right:58px}
.tl-sheetbody > .tp-day > .tp-dayhead:hover{background:var(--tp-primary-deep)}
.tl-sheetbody > .tp-day > .tp-dayhead .chev{display:none}
.tl-sheetbody > .tp-day > .tp-dayhead .count{display:none}
.tl-sheetlist{display:flex;flex-direction:column;gap:8px}
.tl-opt{font-weight:500;color:var(--tp-muted);font-size:.9em}
.oclrt{margin-top:4px;font-size:13.5px}
@media (max-width:900px){
  .tl-sheetbg{align-items:flex-end;padding:0}
  .tl-sheet{width:100%;max-height:88vh;border-radius:18px 18px 0 0}
  .tl-sheetbody{padding:12px 12px max(16px,env(safe-area-inset-bottom))}
  .tl-x{top:20px;right:20px}
}

/* ---------- add a stay + place search ---------- */
.s-form{grid-template-columns:repeat(3,minmax(0,1fr))}
.s-form .s-where,.s-form > div:last-child{grid-column:1/-1}
.tp-places{margin-top:6px}
.tp-place{min-height:52px;padding:8px 10px;border-radius:10px;cursor:pointer}
.tp-place .pi{flex:none;width:34px;height:34px;border-radius:9px;background:var(--tp-soft);display:flex;align-items:center;justify-content:center;font-size:16px}
.tp-hit.on{background:var(--tp-soft);border-color:var(--tp-primary)}
.tp-picked{margin-top:6px;font-size:13.5px;font-weight:600;color:var(--tp-primary-deep);overflow-wrap:anywhere}
.tp-picked:empty{display:none}
@media (max-width:640px){
  .s-form{grid-template-columns:repeat(2,minmax(0,1fr))}
  .s-form > div:nth-child(2){grid-column:1/-1}
}
