/* Trip Budget: phone-first budget planner. Builds on travel-tools.css and travel-smart.css tokens. */

/* Defined page-wide: the stop page, viewer and sheets live outside .tb-shell. */
:root { --tb-good: var(--good, #059669); --tb-warn: var(--warn, #d97706); --tb-bad: var(--bad, #dc2626); --tb-coral: #ec765d; }
.tb-shell { padding-bottom: 40px; }
.tb-shell h1, .tb-shell h2, .tb-shell h3 { text-wrap: balance; }
.tb-shell p, .tb-shell small { text-wrap: pretty; }
.tb-quiet { margin: 12px 0 0; color: var(--muted, #64748b); font-size: .72rem; line-height: 1.55; }
.tb-span-2 { grid-column: 1 / -1; }
.tb-shell .tb-trip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tb-inline { display: flex; gap: 8px; }
.tb-inline .form-control { min-width: 0; }
.tb-inline .tt-btn { flex: none; }

/* Scoreboard */
.tb-scoreboard { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; margin-bottom: 16px; }
.tb-scoreboard > * { min-width: 0; }
.tb-score-main { position: relative; overflow: hidden; padding: 22px; border-radius: 18px; color: #fff; background: radial-gradient(circle at 100% 0, rgba(94, 234, 212, .26), transparent 38%), linear-gradient(145deg, #0d1b2a, #134e4a); }
.tb-score-main.warn { background: radial-gradient(circle at 100% 0, rgba(253, 224, 71, .22), transparent 38%), linear-gradient(145deg, #1c1917, #854d0e); }
.tb-score-main.bad { background: radial-gradient(circle at 100% 0, rgba(253, 186, 116, .24), transparent 38%), linear-gradient(145deg, #2a0f0a, #9a3412); }
.tb-score-main > span { display: block; color: #ccfbf1; font-size: .66rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.tb-score-main strong { display: block; margin: 8px 0 4px; font-size: clamp(2.5rem, 9vw, 4.2rem); line-height: .95; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.tb-score-main small { display: block; color: #e2fdf8; font-size: .78rem; line-height: 1.45; }
.tb-meter { position: relative; display: flex; height: 12px; margin-top: 18px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .14); }
.tb-meter i { display: block; height: 100%; transition: width .25s ease; }
#tb-meter-committed { background: #5eead4; }
#tb-meter-planned { background: rgba(255, 255, 255, .55); }
.tb-meter-legend { position: relative; display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; color: #ccfbf1; font-size: .64rem; }
.tb-meter-legend span { display: inline-flex; align-items: center; gap: 6px; }
#tb-meter-budget { margin-left: auto; font-weight: 700; }
.tb-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.tb-dot.committed { background: #5eead4; }
.tb-dot.planned { background: rgba(255, 255, 255, .6); }
.tb-dot.good { background: var(--tb-good); }
.tb-dot.warn { background: var(--tb-warn); }
.tb-dot.bad { background: var(--tb-bad); }
.tb-score-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tb-score-side .smart-metric { display: flex; flex-direction: column; justify-content: center; }
.tb-score-side .smart-metric strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }

/* Tabs: sticky under the top bar so the plan stays one tap away on a phone. */
.tb-tabs { position: sticky; top: 76px; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0 0 16px; padding: 5px; border: 1px solid var(--border, #e5e7eb); border-radius: 16px; background: color-mix(in srgb, var(--surface, #fff), transparent 6%); backdrop-filter: blur(14px); }
.tb-tabs button { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 4px; border: 0; border-radius: 12px; color: var(--muted, #64748b); background: transparent; font-size: .68rem; font-weight: 700; }
.tb-tabs button i { font-size: 1rem; }
.tb-tabs button[aria-selected="true"] { color: var(--accent, #0f766e); background: var(--accent-soft, rgba(15, 118, 110, .1)); }
.tb-panel-set { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 0; }
.tb-panel-set > * { min-width: 0; }
/* main.css pads every section by 60px; this page sets its own rhythm. */
.tb-shell .tb-scoreboard, .tb-shell .tb-today { padding-top: 0; padding-bottom: 0; }
.tb-shell .tb-today { padding: 22px; }
.tb-shell .tt-hero { padding-top: 8px; padding-bottom: 0; }
.tb-panel-set[hidden] { display: none; }

/* Route */
.tb-passport { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tb-stamp { min-width: 0; padding: 10px 8px; border: 1.5px dashed var(--border, #cbd5e1); border-radius: 14px; color: var(--muted, #64748b); text-align: center; }
.tb-stamp b { display: block; color: var(--text, #111827); font-size: .74rem; }
.tb-stamp small { display: block; margin-top: 2px; font-size: .6rem; }
.tb-stamp.stamped { border: 2px solid var(--accent, #0f766e); color: var(--accent, #0f766e); background: var(--accent-soft, rgba(15, 118, 110, .08)); transform: rotate(-2deg); }
.tb-stamp.stamped small { font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.tb-legs { display: grid; gap: 12px; }
.tb-leg { padding: 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 16px; background: var(--surface, #fff); }
.tb-leg.is-booked { border-color: color-mix(in srgb, var(--accent, #0f766e), transparent 50%); box-shadow: inset 4px 0 0 var(--accent, #0f766e); }
.tb-leg-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 12px; }
.tb-leg-num { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--accent, #0f766e); font-size: .75rem; font-weight: 800; }
.tb-leg-title { min-width: 0; }
.tb-leg-city { width: 100%; padding: 2px 0; border: 0; border-bottom: 1px dashed transparent; color: var(--text, #111827); background: transparent; font-size: .95rem; font-weight: 800; }
.tb-leg-city:focus { outline: none; border-bottom-color: var(--accent, #0f766e); }
.tb-leg-title small, .tb-leg-cost small { display: block; color: var(--muted, #64748b); font-size: .64rem; }
.tb-leg-cost { text-align: right; }
.tb-leg-cost strong { display: block; color: var(--text, #111827); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.tb-leg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tb-leg-grid .tb-span-2 { grid-column: span 3; }
.tb-stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; }
.tb-stepper input { min-width: 0; min-height: 44px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; color: var(--text, #111827); background: var(--input, #f8fafc); text-align: center; font-weight: 800; }
.tb-stepper .tt-btn { min-height: 44px; padding: 0; justify-content: center; }
.tb-more { margin-top: 10px; }
.tb-more summary { min-height: 40px; display: flex; align-items: center; gap: 6px; color: var(--accent, #0f766e); font-size: .72rem; font-weight: 750; cursor: pointer; overflow-wrap: anywhere; }
.tb-more[open] summary { margin-bottom: 8px; }
.tb-real input { border-color: color-mix(in srgb, var(--accent, #0f766e), transparent 40%); font-weight: 800; }
.tb-leg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Daily rates */
.tb-rates { display: grid; gap: 8px; }
.tb-rate { display: grid; grid-template-columns: 36px minmax(0, 1fr) 96px minmax(96px, auto); gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--input, #f8fafc); }
.tb-rate > i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--accent, #0f766e); background: var(--surface, #fff); }
.tb-rate-copy label { display: block; margin: 0; color: var(--text, #111827); font-size: .82rem; font-weight: 800; }
.tb-rate-copy small { display: block; color: var(--muted, #64748b); font-size: .64rem; line-height: 1.35; }
.tb-rate input { min-height: 44px; text-align: right; font-weight: 800; }
.tb-rate-total { text-align: right; }
.tb-rate-total strong { display: block; color: var(--text, #111827); font-size: .92rem; font-variant-numeric: tabular-nums; }
.tb-rate-total small { display: block; color: var(--muted, #64748b); font-size: .6rem; }
.tb-scenario-pick { width: auto; min-width: 130px; min-height: 44px; }

/* One-time costs */
.tb-once { display: grid; gap: 10px; }
.tb-once-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 90px auto minmax(0, 1fr) 100px minmax(90px, auto) 44px; gap: 8px; align-items: end; padding: 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; }
.tb-once-row .tt-field label { font-size: .6rem; }
.tb-check { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--text, #111827); font-size: .66rem; font-weight: 700; white-space: nowrap; }
.tb-check input { width: 18px; height: 18px; accent-color: var(--accent, #0f766e); }
.tb-once-total { align-self: center; text-align: right; }
.tb-once-total strong { display: block; color: var(--text, #111827); font-size: .86rem; font-variant-numeric: tabular-nums; }
.tb-once-total small { display: block; color: var(--muted, #64748b); font-size: .58rem; line-height: 1.3; }
.tb-once-remove { min-height: 44px; justify-content: center; }

/* Compare */
.tb-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tb-scen { padding: 16px; border: 1px solid var(--border, #e5e7eb); border-top: 5px solid var(--tb-good); border-radius: 16px; background: var(--surface, #fff); }
.tb-scen.warn { border-top-color: var(--tb-warn); }
.tb-scen.bad { border-top-color: var(--tb-bad); }
.tb-scen.active { box-shadow: 0 0 0 2px var(--accent, #0f766e); }
.tb-scen header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tb-scen-name { min-width: 0; width: 100%; border: 0; color: var(--text, #111827); background: transparent; font-size: 1rem; font-weight: 800; }
.tb-scen-total { display: block; margin-top: 8px; color: var(--text, #111827); font-size: 2rem; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.tb-scen-left { margin: 4px 0 10px; color: var(--muted, #64748b); font-size: .74rem; font-weight: 700; }
.tb-scen.good .tb-scen-left { color: var(--tb-good); }
.tb-scen.bad .tb-scen-left { color: var(--tb-bad); }
.tb-scen dl { display: grid; gap: 6px; margin: 0; }
.tb-scen dl div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.tb-scen dt { color: var(--muted, #64748b); font-size: .7rem; font-weight: 700; }
.tb-scen dd { display: flex; align-items: center; gap: 8px; margin: 0; }
.tb-scen dd input { width: 64px; min-height: 40px; padding: 4px 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 9px; color: var(--text, #111827); background: var(--input, #f8fafc); text-align: right; font-weight: 700; }
.tb-scen dd small { min-width: 58px; color: var(--text, #111827); text-align: right; font-size: .72rem; font-variant-numeric: tabular-nums; }

/* Tables */
.tb-table-wrap { overflow-x: auto; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
.tb-table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--text, #111827); font-size: .76rem; font-variant-numeric: tabular-nums; }
.tb-table th, .tb-table td { padding: 9px 10px; border-bottom: 1px solid var(--border, #e5e7eb); text-align: right; white-space: nowrap; }
.tb-table th:first-child { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--surface, #fff); }
.tb-table thead th { color: var(--muted, #64748b); font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.tb-total-row th, .tb-total-row td { font-weight: 800; border-top: 2px solid var(--border, #e5e7eb); }
.tb-good { color: var(--tb-good) !important; font-weight: 800; }
.tb-warn { color: var(--tb-warn) !important; font-weight: 800; }
.tb-bad { color: var(--tb-bad) !important; font-weight: 800; }
.tb-col-now { color: var(--accent, #0f766e) !important; }

/* Price grid */
.tb-grid-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; color: var(--muted, #64748b); font-size: .66rem; }
.tb-grid-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tb-price-grid td { padding: 3px; border: 0; }
.tb-price-grid th { border: 0; }
.tb-corner { font-size: .58rem !important; line-height: 1.3; }
.tb-corner span { color: var(--muted, #94a3b8); font-weight: 600; text-transform: none; letter-spacing: 0; }
.tb-cell { width: 100%; min-width: 64px; min-height: 44px; padding: 6px 8px; border: 2px solid transparent; border-radius: 10px; font-size: .74rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tb-cell.good { color: #065f46; background: #d1fae5; }
.tb-cell.warn { color: #92400e; background: #fef3c7; }
.tb-cell.bad { color: #991b1b; background: #fee2e2; }
.tb-cell.active { border-color: var(--text, #111827); box-shadow: 0 3px 10px rgba(15, 23, 42, .18); }
.tb-cell:hover { filter: brightness(.96); }

/* Probability */
.tb-ranges { display: grid; gap: 6px; margin-bottom: 16px; }
.tb-range-head, .tb-range { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 72px); gap: 8px; align-items: center; }
.tb-range-head span { color: var(--muted, #64748b); font-size: .6rem; font-weight: 800; text-align: center; letter-spacing: .05em; text-transform: uppercase; }
.tb-range label { margin: 0; color: var(--text, #111827); font-size: .74rem; font-weight: 700; }
.tb-range input { min-width: 0; min-height: 44px; padding: 4px 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; color: var(--text, #111827); background: var(--input, #f8fafc); text-align: center; font-weight: 700; }
.tb-range input[data-range-i="1"] { border-color: color-mix(in srgb, var(--accent, #0f766e), transparent 40%); }
.tb-prob-result { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 12px; margin-bottom: 14px; }
.tb-prob-hero.warn { background: radial-gradient(circle at 100% 0, rgba(253, 224, 71, .2), transparent 36%), linear-gradient(145deg, #1c1917, #854d0e); }
.tb-prob-hero.bad { background: radial-gradient(circle at 100% 0, rgba(253, 186, 116, .26), transparent 36%), linear-gradient(145deg, #431407, #7c2d12); }
.tb-prob-metrics { margin-top: 0; }
.tb-histogram { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; align-items: end; height: 120px; margin-top: 16px; padding-bottom: 18px; }
.tb-bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.tb-bar i { display: block; height: var(--h); min-height: 2px; border-radius: 5px 5px 2px 2px; background: var(--tb-good); }
.tb-bar.edge i { background: var(--tb-warn); }
.tb-bar.over i { background: var(--tb-bad); opacity: .85; }
.tb-bar small { position: absolute; bottom: -17px; left: 50%; transform: translateX(-50%); color: var(--muted, #64748b); font-size: .5rem; white-space: nowrap; }
.tb-bar:nth-child(odd) small { visibility: hidden; }

/* Follow-up */
.tb-today { padding: 22px; border-radius: 18px; color: #fff; background: radial-gradient(circle at 0 100%, rgba(236, 118, 93, .35), transparent 45%), linear-gradient(145deg, #0d1b2a, #134e4a); }
.tb-today.warn { background: radial-gradient(circle at 0 100%, rgba(236, 118, 93, .4), transparent 45%), linear-gradient(145deg, #1c1917, #854d0e); }
.tb-today.bad { background: linear-gradient(145deg, #2a0f0a, #9a3412); }
.tb-today > span { display: block; color: #ccfbf1; font-size: .66rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.tb-today strong { display: block; margin: 8px 0 6px; font-size: clamp(2.2rem, 8vw, 3.6rem); line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.tb-today h2 { margin: 0; color: #fff; font-size: 1rem; font-weight: 800; }
.tb-today p { margin: 6px 0 0; color: #e2fdf8; font-size: .76rem; line-height: 1.5; }
.tb-expense-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; }
.tb-form-submit .tt-btn { width: 100%; min-height: 46px; justify-content: center; }
.tb-expenses { display: grid; gap: 10px; margin-top: 16px; }
.tb-day { padding: 12px 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; }
.tb-day header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tb-day header strong { display: block; color: var(--text, #111827); font-size: .84rem; }
.tb-day header small { color: var(--muted, #64748b); font-size: .66rem; }
.tb-expense { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--border, #eef2f7); }
.tb-expense b { display: block; color: var(--text, #111827); font-size: .76rem; overflow-wrap: anywhere; }
.tb-expense small { color: var(--muted, #64748b); font-size: .62rem; }
.tb-expense > strong { color: var(--text, #111827); font-size: .82rem; font-variant-numeric: tabular-nums; }
.tb-expense .tt-btn { min-height: 40px; padding: 0; justify-content: center; }
.tb-chip { padding: 3px 8px; border-radius: 999px; color: var(--accent, #0f766e); background: var(--accent-soft, rgba(15, 118, 110, .1)); font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.tb-chip.food { color: #b45309; background: #fef3c7; }
.tb-chip.leisure { color: #be185d; background: #fce7f3; }
.tb-chip.other { color: #475569; background: #e2e8f0; }

/* Share */
.tb-share-box { display: grid; gap: 12px; }
.tb-link label { display: block; margin-bottom: 6px; color: var(--muted, #64748b); font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.tb-link input { font-size: .72rem; }

/* Touch screens: 16 px text in every field (iPhone zooms the page into anything smaller) and 44 px targets. */
@media (pointer: coarse) {
  .tb-shell input:not([type=checkbox]):not([type=radio]), .tb-shell select, .tb-shell select.form-select, .tb-shell textarea { font-size: 16px !important; }
}
.tb-scen dd input { min-height: 44px; }
.tb-stance { min-height: 44px; }
.tb-expense .tt-btn { min-height: 44px; }
.tb-expense { grid-template-columns: auto minmax(0, 1fr) auto 44px; }
.tb-alone { display: flex; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 12px; color: var(--warn, #b45309); background: var(--warn-soft, #fffbeb); font-size: .74rem; font-weight: 650; line-height: 1.45; }

/* Together */
.tb-tabs button { position: relative; }
.tb-tab-count { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; color: #fff; background: var(--tb-coral); font-size: .58rem; font-weight: 800; line-height: 17px; }
.tb-me.chosen { padding-top: 12px; padding-bottom: 12px; }
.tb-me.chosen .tt-panel-subtitle { display: none; }
.tb-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tb-person { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; }
.tb-person.active { border-color: var(--accent, #0f766e); background: var(--accent-soft, rgba(15, 118, 110, .07)); }
.tb-person-pick { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; color: var(--muted, #64748b); background: none; font-size: .7rem; font-weight: 800; }
.tb-person.active .tb-person-pick { color: var(--accent, #0f766e); }
.tb-trip-card { padding: 22px; border-radius: 18px; color: #fff; background: radial-gradient(circle at 100% 0, rgba(236, 118, 93, .3), transparent 40%), linear-gradient(150deg, #0d1b2a, #0f4c4a); }
.tb-trip-kicker { display: block; color: #99f6e4; font-size: .64rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.tb-trip-card h2 { margin: 6px 0 2px; color: #fff; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.tb-trip-meta { margin: 0; color: #ccfbf1; font-size: .74rem; }
.tb-trip-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 14px 0; }
.tb-trip-total strong { font-size: 2.2rem; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.tb-trip-total span { color: #e2fdf8; font-size: .72rem; }
.tb-trip-route { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: stop; }
.tb-trip-route li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; padding: 10px 12px 10px 42px; border-radius: 12px; background: rgba(255, 255, 255, .08); counter-increment: stop; }
.tb-trip-route li::before { content: counter(stop); position: absolute; left: 12px; top: 11px; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: #0d1b2a; background: #99f6e4; font-size: .66rem; font-weight: 800; }
.tb-trip-route li.booked { box-shadow: inset 0 0 0 1.5px #5eead4; }
.tb-trip-route b { color: #fff; font-size: .82rem; }
.tb-trip-route span { grid-column: 1; color: #ccfbf1; font-size: .66rem; }
.tb-trip-route em { grid-column: 2; grid-row: 1 / span 3; align-self: center; color: #fff; font-size: .7rem; font-style: normal; font-weight: 800; text-align: right; }
.tb-trip-warn { margin: 12px 0 0; padding: 8px 10px; border-radius: 10px; color: #fde68a; background: rgba(245, 158, 11, .16); font-size: .72rem; font-weight: 700; }
.tb-trip-open { margin: 12px 0 0; color: #ccfbf1; font-size: .72rem; }
.tb-trip-card .tt-btn:not(.tt-btn-primary) { color: #fff; border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); }
.tb-decisions { display: grid; gap: 14px; }
.tb-decision { padding: 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 16px; background: var(--surface, #fff); }
.tb-decision.decided { background: var(--input, #f8fafc); }
.tb-decision > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tb-decision h3 { margin: 0; color: var(--text, #111827); font-size: .95rem; font-weight: 800; }
.tb-decision header small { display: block; margin-top: 3px; color: var(--muted, #64748b); font-size: .64rem; line-height: 1.4; }
.tb-verdict { margin: 10px 0; padding: 9px 11px; border-radius: 10px; color: var(--text, #111827); background: var(--input, #f1f5f9); font-size: .72rem; font-weight: 650; line-height: 1.45; }
.tb-options { display: grid; gap: 10px; }
.tb-option { padding: 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; }
.tb-option.winner { border-color: var(--accent, #0f766e); box-shadow: inset 4px 0 0 var(--accent, #0f766e); }
.tb-option-head { display: flex; justify-content: space-between; gap: 10px; }
.tb-option-head b { display: block; color: var(--text, #111827); font-size: .84rem; overflow-wrap: anywhere; }
.tb-option-head small { display: block; margin-top: 2px; color: var(--muted, #64748b); font-size: .64rem; line-height: 1.4; }
.tb-option-head a { display: inline-block; margin-top: 3px; color: var(--accent, #0f766e); font-size: .66rem; font-weight: 750; }
.tb-option-head .tb-by { font-size: .58rem; }
.tb-option-cost { flex: none; text-align: right; }
.tb-option-cost strong { display: block; color: var(--text, #111827); font-size: .82rem; font-variant-numeric: tabular-nums; }
.tb-option-cost small { color: var(--muted, #64748b); font-size: .58rem; }
.tb-stances { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.tb-stance { min-height: 40px; padding: 4px 2px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; color: var(--muted, #64748b); background: var(--surface, #fff); font-size: .64rem; font-weight: 750; }
.tb-stance.on.support { color: #fff; border-color: #059669; background: #059669; }
.tb-stance.on.consent { color: #065f46; border-color: #6ee7b7; background: #d1fae5; }
.tb-stance.on.concern { color: #92400e; border-color: #fcd34d; background: #fef3c7; }
.tb-stance.on.block { color: #fff; border-color: #dc2626; background: #dc2626; }
.tb-stance:disabled { opacity: .55; }
.tb-option-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; }
.tb-option-foot .tt-btn:first-of-type { margin-left: auto; }
.tb-their { padding: 3px 8px; border-radius: 999px; background: var(--input, #f1f5f9); color: var(--text, #111827); font-size: .6rem; font-weight: 700; }
.tb-their.support { color: #065f46; background: #d1fae5; }
.tb-their.concern { color: #92400e; background: #fef3c7; }
.tb-their.block { color: #991b1b; background: #fee2e2; }
.tb-score { color: var(--muted, #64748b); font-size: .6rem; font-weight: 700; }
.tb-add-option { margin-top: 10px; }
.tb-add-option summary { min-height: 40px; display: flex; align-items: center; gap: 7px; color: var(--accent, #0f766e); font-size: .74rem; font-weight: 800; cursor: pointer; }
.tb-option-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.tb-thread { display: grid; gap: 8px; margin-top: 10px; }
.tb-msg { max-width: 86%; padding: 8px 11px; border-radius: 14px 14px 14px 4px; background: var(--input, #f1f5f9); }
.tb-msg.mine { justify-self: end; border-radius: 14px 14px 4px 14px; background: var(--accent-soft, rgba(15, 118, 110, .12)); }
.tb-msg b { display: block; color: var(--accent, #0f766e); font-size: .62rem; }
.tb-msg p { margin: 2px 0; color: var(--text, #111827); font-size: .78rem; line-height: 1.4; overflow-wrap: anywhere; }
.tb-msg small { color: var(--muted, #64748b); font-size: .56rem; }
.tb-say { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 6px; margin-top: 10px; }
.tb-say .tt-btn { min-height: 44px; padding: 0; justify-content: center; }
.tb-decision-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.tb-new-decision { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border, #e5e7eb); }
.tb-chip.communication { color: #1d4ed8; background: #dbeafe; }
[data-theme="dark"] .tb-chip.communication { color: #bfdbfe; background: rgba(59, 130, 246, .2); }

[data-theme="dark"] .tb-cell.good { color: #a7f3d0; background: rgba(16, 185, 129, .2); }
[data-theme="dark"] .tb-cell.warn { color: #fde68a; background: rgba(245, 158, 11, .2); }
[data-theme="dark"] .tb-cell.bad { color: #fecaca; background: rgba(239, 68, 68, .2); }
[data-theme="dark"] .tb-cell.active { border-color: #fff; }
[data-theme="dark"] .tb-chip.food { color: #fde68a; background: rgba(245, 158, 11, .2); }
[data-theme="dark"] .tb-chip.leisure { color: #fbcfe8; background: rgba(236, 72, 153, .2); }
[data-theme="dark"] .tb-chip.other { color: #cbd5e1; background: rgba(148, 163, 184, .2); }

@media (max-width: 1080px) {
  .tb-once-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tb-once-label { grid-column: 1 / -1; }
  .tb-once-total { grid-column: span 3; text-align: left; }
}

@media (max-width: 860px) {
  .tb-scoreboard, .tb-prob-result { grid-template-columns: 1fr; }
  .tb-new-decision { grid-template-columns: 1fr 1fr; }
  .tb-new-decision .tt-field:first-child { grid-column: 1 / -1; }
  .tb-expense-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .tb-shell .tt-hero { margin-bottom: 14px; }
  .tb-shell .tt-hero h1 { font-size: 1.7rem; }
  .tb-shell .tt-hero p { font-size: .82rem; line-height: 1.55; }
  .tb-tabs { top: 64px; }
  .tb-tabs button span { font-size: .6rem; }
  .tb-leg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-leg-grid .tb-span-2 { grid-column: 1 / -1; }
  .tb-leg-grid .tt-field:first-child { grid-column: 1 / -1; }
  .tb-rate { grid-template-columns: 36px minmax(0, 1fr) 84px; }
  .tb-rate-total { grid-column: 2 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; text-align: left; }
  .tb-once-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-once-total { grid-column: 1 / 2; }
  .tb-once-remove { justify-self: end; width: 44px; }
  .tb-range-head, .tb-range { grid-template-columns: minmax(0, 1fr) repeat(3, 58px); gap: 6px; }
  .tb-range label { font-size: .68rem; }
  .tb-histogram { height: 96px; }
  .tb-table { font-size: .7rem; }
  .tb-table th, .tb-table td { padding: 8px 5px; }
  .tb-table thead th { font-size: .56rem; letter-spacing: .02em; }
  .tb-cell { min-width: 54px; padding: 6px 4px; font-size: .68rem; }
  .tb-price-grid th:first-child { padding-right: 4px; }
  .tb-scen-total { font-size: 1.7rem; }
  .tt-panel-head { flex-wrap: wrap; }
}

@media (max-width: 390px) {
  .tb-score-side { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tb-score-side .smart-metric strong { font-size: 1.05rem; }
  .tb-expense-form { grid-template-columns: 1fr 1fr; }
  .tb-range-head, .tb-range { grid-template-columns: minmax(0, 1fr) repeat(3, 52px); }
  .tb-rate { grid-template-columns: 32px minmax(0, 1fr) 76px; padding: 10px; }
  .tb-rate > i { width: 32px; height: 32px; }
}

@media print {
  .tb-tabs, .tt-actions, .tb-leg-actions, .tb-once-remove, .tb-expense-form, .tb-share-box { display: none !important; }
  .tb-panel-set[hidden] { display: grid !important; }
}

/* Placed last so these sizes win over the component rules above. */
.tb-shell .tb-more summary, .tb-shell .tb-add-option summary { min-height: 44px; }

/* ---------- Stage: full-width trip photos behind the budget (the page makes you dream first) ---------- */
body:has(.tb-stage) { overflow-x: clip; }
.tb-stage { position: relative; isolation: isolate; margin: 0 calc(50% - 50vw) 22px; padding: clamp(36px, 7vw, 88px) calc(50vw - 50%) 22px; min-height: min(760px, 92vh); display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.tb-stage-media { position: absolute; inset: 0; z-index: -2; overflow: hidden; background: #0d1b2a; }
.tb-slide { position: absolute; inset: -2%; background-size: cover; background-position: center; opacity: 0; transform: scale(1.06); transition: opacity 1.6s ease, transform 9s linear; }
.tb-slide.is-on { opacity: 1; transform: scale(1); }
.tb-slide[data-slide="beach"] { background-image: url("../assets/img/trip/yucatan-beach.webp"); background-position: 60% 55%; }
.tb-slide[data-slide="pyramid"] { background-image: url("../assets/img/trip/yucatan-pyramid.webp"); background-position: 55% 40%; }
.tb-slide[data-slide="street"] { background-image: url("../assets/img/trip/yucatan-street.webp"); background-position: 50% 45%; }
.tb-stage::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(90deg, rgba(4, 18, 28, .72) 0%, rgba(4, 18, 28, .38) 46%, rgba(4, 18, 28, .08) 75%),
  linear-gradient(180deg, rgba(4, 18, 28, .25) 0%, rgba(4, 18, 28, 0) 30%, rgba(4, 18, 28, .55) 72%, rgba(4, 18, 28, .86) 100%); }
.tb-stage-inner { width: 100%; }
.tb-stage .tt-hero { margin-bottom: 26px; padding: 0; background: transparent; box-shadow: none; }
.tb-stage .smart-eyebrow { color: #99f6e4; }
.tb-stage .tt-hero h1 { max-width: 15ch; margin: 0 0 12px; color: #fff; font-size: clamp(2.3rem, 6.2vw, 4.6rem); line-height: 1.02; letter-spacing: -.035em; text-shadow: 0 2px 24px rgba(0, 0, 0, .35); }
.tb-stage .tt-hero p { max-width: 560px; color: rgba(255, 255, 255, .88); font-size: clamp(.86rem, 1.4vw, 1rem); line-height: 1.6; text-shadow: 0 1px 12px rgba(0, 0, 0, .4); }
.tb-stage .tb-scoreboard, .tb-stage section { margin-bottom: 14px; background: transparent; box-shadow: none; }
.tb-stage .tb-score-main { background: rgba(6, 26, 36, .52); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 24px 60px rgba(0, 0, 0, .28); }
.tb-stage .tb-score-main.warn { background: rgba(92, 52, 6, .55); }
.tb-stage .tb-score-main.bad { background: rgba(110, 32, 12, .58); }
.tb-stage .tb-score-side .smart-metric { border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .13); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); }
.tb-stage .tb-score-side .smart-metric span { color: rgba(255, 255, 255, .78); }
.tb-stage .tb-score-side .smart-metric strong { color: #fff; }
.tb-stage .tb-score-side .smart-metric small { color: rgba(255, 255, 255, .72); }
.tb-ribbon { display: flex; gap: 8px; margin: 0; padding: 0 0 2px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.tb-ribbon::-webkit-scrollbar { display: none; }
.tb-ribbon li { position: relative; flex: 1 0 auto; min-width: 118px; padding: 10px 12px 10px 28px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 14px; background: rgba(6, 26, 36, .38); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tb-ribbon li::before { content: ""; position: absolute; left: 12px; top: 15px; width: 8px; height: 8px; border: 2px solid #99f6e4; border-radius: 50%; }
.tb-ribbon li.booked::before { background: #5eead4; border-color: #5eead4; }
.tb-ribbon b { display: block; color: #fff; font-size: .8rem; }
.tb-ribbon span { display: block; color: rgba(255, 255, 255, .74); font-size: .64rem; }
.tb-stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.tb-dots { display: flex; }
.tb-dots button { width: 44px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; background: none; }
.tb-dots button::after { content: ""; width: 22px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .38); transition: background .3s, width .3s; }
.tb-dots button[aria-pressed="true"]::after { width: 30px; background: #fff; }
.tb-credit { margin: 0; color: rgba(255, 255, 255, .62); font-size: .6rem; text-align: right; }
.tb-credit a { color: rgba(255, 255, 255, .85); }
@media (prefers-reduced-motion: reduce) { .tb-slide { transition: none; transform: none; } }
@media (max-width: 860px) {
  .tb-stage { min-height: 0; padding-top: 34px; }
  .tb-slide[data-slide="beach"] { background-image: url("../assets/img/trip/yucatan-beach-phone.webp"); }
  .tb-slide[data-slide="pyramid"] { background-image: url("../assets/img/trip/yucatan-pyramid-phone.webp"); }
  .tb-slide[data-slide="street"] { background-image: url("../assets/img/trip/yucatan-street-phone.webp"); }
  .tb-stage::before { background: linear-gradient(180deg, rgba(4, 18, 28, .35) 0%, rgba(4, 18, 28, .45) 30%, rgba(4, 18, 28, .82) 70%, rgba(4, 18, 28, .92) 100%); }
}
@media (max-width: 620px) {
  .tb-stage .tt-hero h1 { font-size: 2.15rem; }
}

/* ---------- Room price guard ---------- */
.tb-price { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: .58rem; font-weight: 800; letter-spacing: .02em; vertical-align: middle; white-space: nowrap; }
.tb-price.under { color: #065f46; background: #d1fae5; }
.tb-price.above { color: #92400e; background: #fef3c7; }
.tb-price.over { color: #fff; background: #dc2626; }

/* ---------- Quick Spend ---------- */
.tb-fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 1100; min-height: 56px; display: inline-flex; align-items: center; gap: 8px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; color: #fff; background: linear-gradient(135deg, #0f766e, #134e4a); box-shadow: 0 14px 34px rgba(15, 118, 110, .42); font-size: .9rem; font-weight: 800; }
.tb-fab i { font-size: 1.2rem; }
.tb-fab[hidden] { display: none; }
.tb-sheet-wrap { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-end; justify-content: center; }
.tb-sheet-wrap[hidden] { display: none; }
.tb-sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 18, 28, .55); }
.tb-sheet { position: relative; width: min(560px, 100%); max-height: 92vh; overflow-y: auto; padding: 18px 18px max(18px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--surface, #fff); box-shadow: 0 -18px 50px rgba(0, 0, 0, .25); }
.tb-sheet header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tb-sheet h2 { margin: 0; color: var(--text, #111827); font-size: 1.1rem; font-weight: 800; }
.tb-qs-amount { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.tb-qs-amount input { min-width: 0; min-height: 64px; padding: 0 14px; border: 2px solid var(--accent, #0f766e); border-radius: 16px; color: var(--text, #111827); background: var(--input, #f8fafc); font-size: 2rem !important; font-weight: 800; font-variant-numeric: tabular-nums; }
.tb-qs-cur { display: grid; gap: 4px; }
.tb-qs-cur button, .tb-qs-chips button { min-height: 44px; padding: 0 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; color: var(--muted, #64748b); background: var(--surface, #fff); font-size: .78rem; font-weight: 800; }
.tb-qs-cur button { min-height: 30px; }
.tb-qs-cur button[aria-pressed="true"], .tb-qs-chips button[aria-pressed="true"] { color: #fff; border-color: var(--accent, #0f766e); background: var(--accent, #0f766e); }
.tb-qs-converted { min-height: 1.2em; margin: 6px 2px 12px; color: var(--muted, #64748b); font-size: .74rem; font-weight: 650; }
.tb-qs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tb-qs-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.tb-qs-label { margin: 2px 0 6px; color: var(--text, #111827); font-size: .7rem; font-weight: 700; }
.tb-qs-save { width: 100%; min-height: 52px; justify-content: center; font-size: .95rem; }
body.tb-sheet-open { overflow: hidden; }

/* ---------- Day by day ---------- */
.tb-days { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tb-day-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 13px; }
.tb-day-row.today { border-color: var(--accent, #0f766e); box-shadow: inset 4px 0 0 var(--accent, #0f766e); }
.tb-day-row.past { background: var(--input, #f8fafc); }
.tb-day-date b { display: block; color: var(--text, #111827); font-size: .76rem; }
.tb-day-date span { color: var(--muted, #64748b); font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tb-day-row.today .tb-day-date span { color: var(--accent, #0f766e); }
.tb-day-main { min-width: 0; }
.tb-day-main em { display: block; color: var(--accent, #0f766e); font-size: .72rem; font-style: normal; font-weight: 800; }
.tb-day-main small { display: block; color: var(--muted, #64748b); font-size: .64rem; overflow-wrap: anywhere; }
.tb-day-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* ---------- Who paid ---------- */
.tb-settle-verdict { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; color: var(--text, #111827); background: var(--good-soft, #ecfdf5); font-size: .86rem; font-weight: 700; line-height: 1.5; }
.tb-settle-verdict.owes { background: var(--warn-soft, #fffbeb); }
.tb-settle-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.tb-settle-people div { padding: 10px 12px; border-radius: 12px; background: var(--input, #f8fafc); }
.tb-settle-people span { display: block; color: var(--muted, #64748b); font-size: .62rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.tb-settle-people strong { color: var(--text, #111827); font-size: 1rem; font-variant-numeric: tabular-nums; }
.tb-transfers { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.tb-transfers li { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text, #111827); font-size: .74rem; }
.tb-transfers .tt-btn { min-height: 44px; }

/* ---------- What changed ---------- */
.tb-activity { border-color: color-mix(in srgb, var(--tb-coral), transparent 50%); }
.tb-activity .tt-panel-title i { color: var(--tb-coral); }
.tb-feed { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tb-feed li { padding: 9px 12px; border-radius: 12px; color: var(--text, #111827); background: var(--input, #f8fafc); font-size: .78rem; line-height: 1.45; overflow-wrap: anywhere; }
.tb-feed small { display: block; color: var(--muted, #64748b); font-size: .6rem; }
.tb-shell { padding-bottom: 96px; }
@media (max-width: 620px) {
  .tb-day-row { grid-template-columns: 74px minmax(0, 1fr) auto; padding: 9px 10px; }
  .tb-fab span { display: none; }
  .tb-fab { width: 58px; padding: 0; justify-content: center; }
}

/* ---------- Save bar (sticky with the tabs) ---------- */
.tb-sticky { position: sticky; top: 76px; z-index: 20; margin: 0 0 16px; }
.tb-sticky .tb-tabs { position: static; margin: 0; }
.tb-savebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding: 6px 6px 6px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; background: color-mix(in srgb, var(--surface, #fff), transparent 4%); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tb-save-state { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tb-save-state > i { font-size: 1.15rem; }
.tb-save-state b { display: block; color: var(--text, #111827); font-size: .78rem; }
.tb-save-state small { display: block; color: var(--muted, #64748b); font-size: .64rem; overflow-wrap: anywhere; }
.tb-savebar.good .tb-save-state > i { color: var(--tb-good); }
.tb-savebar.local .tb-save-state > i { color: var(--accent, #0f766e); }
.tb-savebar.busy .tb-save-state > i { color: var(--accent, #0f766e); animation: tb-spin 1s linear infinite; }
.tb-savebar.wait .tb-save-state > i { color: var(--tb-warn); }
.tb-savebar.bad { border-color: var(--tb-bad); background: var(--bad-soft, #fef2f2); }
.tb-savebar.bad .tb-save-state > i { color: var(--tb-bad); }
.tb-save-btn { flex: none; min-height: 44px; }
@keyframes tb-spin { to { transform: rotate(360deg); } }
@keyframes tb-flash { 0% { box-shadow: 0 0 0 3px rgba(16, 185, 129, .55); border-color: #10b981; } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.tb-flash { animation: tb-flash 1.3s ease-out; }
@media (max-width: 620px) { .tb-sticky { top: 64px; } .tb-save-state small { font-size: .6rem; } }
@media (prefers-reduced-motion: reduce) { .tb-savebar.busy .tb-save-state > i, .tb-flash { animation: none; } }

/* ---------- Stop cards with a photo ---------- */
.tb-legs { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tb-leg-card { padding: 0; overflow: hidden; }
.tb-leg-cover { position: relative; width: 100%; height: 168px; display: flex; align-items: flex-end; padding: 14px; border: 0; color: #fff; text-align: left; background: #0f4c4a center / cover no-repeat; cursor: pointer; }
.tb-leg-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 18, 28, .05) 30%, rgba(4, 18, 28, .78) 100%); transition: background .25s; }
.tb-leg-cover:hover::before { background: linear-gradient(180deg, rgba(4, 18, 28, 0) 20%, rgba(4, 18, 28, .7) 100%); }
.tb-leg-cover > * { position: relative; }
.tb-leg-cover .tb-leg-num { position: absolute; top: 12px; left: 12px; background: rgba(255, 255, 255, .92); color: #0d1b2a; }
.tb-leg-badge { position: absolute; top: 14px; right: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(4, 18, 28, .55); backdrop-filter: blur(8px); font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.tb-leg-card.is-booked .tb-leg-badge { color: #0d1b2a; background: #5eead4; }
.tb-leg-cover-text b { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; text-shadow: 0 1px 10px rgba(0, 0, 0, .4); }
.tb-leg-cover-text small { display: block; margin-top: 3px; color: rgba(255, 255, 255, .88); font-size: .72rem; font-weight: 650; }
.tb-leg-body { display: grid; gap: 8px; padding: 12px 14px 14px; }
.tb-leg-line { display: flex; gap: 8px; margin: 0; color: var(--text, #111827); font-size: .76rem; line-height: 1.4; }
.tb-leg-line i { color: var(--accent, #0f766e); }
.tb-leg-foot { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px; align-items: center; }
.tb-leg-foot .tb-leg-cost { text-align: left; }
.tb-leg-foot .tb-stepper { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.tb-leg-open-btn { width: 100%; min-height: 46px; justify-content: center; }
.tb-leg-open-btn i { margin-left: 4px; }

/* ---------- Stop page ---------- */
body.tb-place-open { overflow: hidden; }
.tb-place-wrap { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; padding: 3vh 16px; }
.tb-place-wrap[hidden] { display: none; }
.tb-place-backdrop { position: absolute; inset: 0; background: rgba(4, 18, 28, .66); backdrop-filter: blur(4px); }
.tb-place { position: relative; padding: 0; width: min(980px, 100%); max-height: 94vh; overflow-y: auto; border-radius: 24px; background: var(--surface, #fff); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); overscroll-behavior: contain; }
.tb-place-hero { position: relative; min-height: 340px; display: flex; flex-direction: column; justify-content: space-between; padding: 16px 24px 22px; color: #fff; background: #0f4c4a center / cover no-repeat; }
.tb-place-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 18, 28, .45) 0%, rgba(4, 18, 28, .1) 35%, rgba(4, 18, 28, .82) 100%); }
.tb-place-hero > * { position: relative; }
.tb-place-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tb-place-close { color: #fff; border-color: rgba(255, 255, 255, .4); background: rgba(4, 18, 28, .4); backdrop-filter: blur(8px); }
.tb-place-saved { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(4, 18, 28, .45); backdrop-filter: blur(8px); font-size: .68rem; font-weight: 750; }
.tb-place-saved i { color: #5eead4; }
.tb-place-kicker { display: block; color: #99f6e4; font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.tb-place-head h2 { margin: 6px 0 2px; color: #fff; font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 800; line-height: 1; letter-spacing: -.035em; text-shadow: 0 2px 20px rgba(0, 0, 0, .35); }
.tb-place-head p { margin: 0; color: rgba(255, 255, 255, .9); font-size: .9rem; font-weight: 650; }
.tb-place-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tb-place-chips > span { padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 999px; background: rgba(255, 255, 255, .14); backdrop-filter: blur(10px); font-size: .72rem; font-weight: 750; }
.tb-place-credit { position: absolute; right: 16px; bottom: 8px; color: rgba(255, 255, 255, .6); font-size: .56rem; }
.tb-place-credit a { color: rgba(255, 255, 255, .82); }
.tb-place-body { display: grid; gap: 14px; padding: 18px 20px 26px; }
.tb-place-sec { padding: 16px; border: 1px solid var(--border, #e5e7eb); border-radius: 18px; }
.tb-place-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--text, #111827); font-size: 1.05rem; font-weight: 800; }
.tb-place-sec h3 > i { color: var(--accent, #0f766e); }
.tb-place-stay { border: 2px solid color-mix(in srgb, var(--accent, #0f766e), transparent 55%); background: color-mix(in srgb, var(--accent, #0f766e), transparent 95%); }
.tb-place-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tb-place-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tb-place-actions .tt-btn { min-height: 44px; }
.tb-place-empty { margin: 0 0 10px; color: var(--muted, #64748b); font-size: .76rem; }
.tb-spots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tb-spot { padding: 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; background: var(--surface, #fff); }
.tb-spot.planned { border-color: color-mix(in srgb, var(--accent, #0f766e), transparent 40%); box-shadow: inset 4px 0 0 var(--accent, #0f766e); }
.tb-spot.done { opacity: .66; }
.tb-spot-head { display: flex; align-items: center; gap: 8px; }
.tb-spot-head b { color: var(--text, #111827); font-size: .9rem; overflow-wrap: anywhere; }
.tb-spot-status { flex: none; min-height: 32px; padding: 0 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 999px; color: var(--muted, #64748b); background: var(--input, #f8fafc); font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tb-spot.planned .tb-spot-status { color: #fff; border-color: var(--accent, #0f766e); background: var(--accent, #0f766e); }
.tb-spot.done .tb-spot-status { color: #065f46; background: #d1fae5; }
.tb-spot p { margin: 6px 0 0; color: var(--muted, #64748b); font-size: .74rem; line-height: 1.45; }
.tb-spot-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tb-spot-meta span { padding: 2px 8px; border-radius: 999px; color: var(--text, #111827); background: var(--input, #f1f5f9); font-size: .62rem; font-weight: 650; }
.tb-spot .tb-place-actions { margin-top: 8px; }
.tb-spot .tb-place-actions .tt-btn { min-height: 40px; }
.tb-spot-edit { margin-top: 6px; }
.tb-spot-edit summary { min-height: 44px; display: flex; align-items: center; color: var(--accent, #0f766e); font-size: .72rem; font-weight: 800; cursor: pointer; }
.tb-spot-add { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
.tb-spot-add[data-add-kind="link"] { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; }
.tb-spot-add .tt-btn { min-height: 44px; white-space: nowrap; }
.tb-links { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tb-link-card { display: grid; grid-template-columns: 112px minmax(0, 1fr) 44px; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; }
.tb-link-thumb { position: relative; height: 70px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #0d1b2a center / cover no-repeat; font-size: 1.6rem; text-decoration: none; }
.tb-link-thumb.plain { background: linear-gradient(135deg, #0f766e, #134e4a); font-size: .74rem; font-weight: 800; }
.tb-link-platform { display: block; color: var(--accent, #0f766e); font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.tb-link-card b { display: block; color: var(--text, #111827); font-size: .8rem; overflow-wrap: anywhere; }
.tb-link-card small { color: var(--muted, #64748b); font-size: .62rem; }
.tb-driver { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 16px; background: rgba(4, 18, 28, .82); }
.tb-driver[hidden] { display: none; }
.tb-driver-card { width: min(560px, 100%); padding: 28px 24px; border-radius: 22px; background: #fff; color: #0d1b2a; text-align: center; }
.tb-driver-kicker { margin: 0; color: #0f766e; font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.tb-driver-ask { margin: 10px 0 4px; font-size: 1.3rem; font-weight: 700; }
.tb-driver-card h2 { margin: 6px 0; color: #0d1b2a; font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 800; line-height: 1.05; }
.tb-driver-where { margin: 0; font-size: 1.15rem; font-weight: 650; }
.tb-driver-city { margin: 4px 0 8px; color: #475569; font-size: .95rem; }
.tb-driver-card .tb-place-actions { justify-content: center; }
@media (max-width: 720px) {
  .tb-place-wrap { padding: 0; align-items: stretch; }
  .tb-place { width: 100%; max-height: none; height: 100%; border-radius: 0; }
  .tb-place-hero { min-height: 300px; padding: 12px 16px 20px; }
  .tb-place-body { padding: 14px 12px 40px; }
  .tb-place-sec { padding: 14px 12px; }
  .tb-place-grid, .tb-spot-add, .tb-spot-add[data-add-kind="link"] { grid-template-columns: 1fr; }
  .tb-place-grid .tb-span-2 { grid-column: auto; }
  .tb-link-card { grid-template-columns: 96px minmax(0, 1fr) 44px; }
  .tb-place-saved { font-size: .62rem; padding: 6px 10px; }
}

/* ---------- Route view switch: List (photo on the left, every field inline) or Cards ---------- */
.tb-route-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tb-viewswitch { display: inline-flex; padding: 3px; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; background: var(--input, #f8fafc); }
.tb-viewswitch button { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 0; border-radius: 9px; color: var(--muted, #64748b); background: transparent; font-size: .72rem; font-weight: 800; }
.tb-viewswitch button[aria-pressed="true"] { color: var(--accent, #0f766e); background: var(--surface, #fff); box-shadow: 0 2px 8px rgba(15, 23, 42, .08); }
.tb-legs.is-list { grid-template-columns: minmax(0, 1fr); }
.tb-leg-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); padding: 0; overflow: hidden; }
.tb-leg-row .tb-leg-cover { height: auto; min-height: 100%; align-items: flex-end; justify-content: flex-start; }
.tb-leg-row .tb-leg-cover::before { background: linear-gradient(180deg, rgba(4, 18, 28, .05) 40%, rgba(4, 18, 28, .6) 100%); }
.tb-leg-cover-open { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(4, 18, 28, .5); backdrop-filter: blur(8px); font-size: .68rem; font-weight: 800; }
.tb-leg-main { min-width: 0; padding: 14px; }
.tb-leg-row .tb-leg-head { grid-template-columns: minmax(0, 1fr) auto; }
.tb-leg-row .tb-leg-actions { align-items: center; }
.tb-leg-plans { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: var(--muted, #64748b); font-size: .7rem; font-weight: 650; }
.tb-leg-plans i { color: var(--accent, #0f766e); }
.tb-leg-row .tb-leg-actions .tt-btn { min-height: 44px; }
.tb-leg-row .tb-leg-actions .tt-btn i { margin: 0 3px; }
@media (max-width: 620px) {
  .tb-leg-row { grid-template-columns: 92px minmax(0, 1fr); }
  .tb-leg-row .tb-leg-badge { display: none; }
  .tb-leg-cover-open { padding: 4px 8px; font-size: .6rem; }
  .tb-leg-main { padding: 12px 10px; }
  .tb-leg-row .tb-leg-grid { grid-template-columns: minmax(0, 1fr); }
  .tb-leg-row .tb-leg-head { grid-template-columns: minmax(0, 1fr); }
  .tb-leg-row .tb-leg-cost { text-align: left; }
  .tb-leg-plans { flex-basis: 100%; }
}

/* ---------- Links found online: strip on every stop, rich cards, full-screen viewer ---------- */
.tb-leg-links { margin-top: 2px; padding-top: 10px; border-top: 1px dashed var(--border, #e5e7eb); }
.tb-leg-row .tb-leg-links { margin-top: 10px; }
.tb-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--text, #111827); font-size: .7rem; font-weight: 800; }
.tb-strip-head i { margin-right: 6px; color: var(--tb-coral); }
.tb-strip-hint { color: var(--muted, #94a3b8); font-size: .6rem; font-weight: 650; }
.tb-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tb-leg-row .tb-strip { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.tb-strip-item { min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.tb-strip-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #0f766e, #134e4a) center / cover no-repeat; overflow: hidden; }
.tb-strip-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .55) 100%); }
.tb-strip-thumb i { position: relative; z-index: 1; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .55); font-size: 1rem; }
.tb-strip-thumb em { position: absolute; left: 6px; bottom: 4px; z-index: 1; font-size: .52rem; font-style: normal; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.tb-strip-title { display: -webkit-box; margin-top: 4px; overflow: hidden; color: var(--text, #111827); font-size: .62rem; font-weight: 700; line-height: 1.3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tb-strip-item:hover .tb-strip-thumb { outline: 2px solid var(--accent, #0f766e); outline-offset: 1px; }
.tb-strip-more { display: grid; place-content: center; aspect-ratio: 16 / 10; border: 1px dashed var(--border, #cbd5e1); border-radius: 10px; color: var(--accent, #0f766e); background: var(--input, #f8fafc); font-size: 1rem; font-weight: 800; }
.tb-strip-more small { font-size: .55rem; font-weight: 700; }
.tb-link-card { grid-template-columns: 150px minmax(0, 1fr) 44px; align-items: start; padding: 10px; }
.tb-link-thumb { height: auto; aspect-ratio: 16 / 10; border: 0; cursor: pointer; }
.tb-link-thumb i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .55); font-size: 1.5rem; }
.tb-link-text { min-width: 0; }
.tb-link-text p { margin: 4px 0 0; color: var(--muted, #64748b); font-size: .7rem; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tb-link-text .tb-link-note { color: var(--text, #111827); font-weight: 650; }
.tb-link-text small { display: block; margin-top: 4px; }
.tb-link-loading { color: var(--accent, #0f766e) !important; }
.tb-links { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.tb-drop-target { outline: 3px dashed var(--tb-coral) !important; outline-offset: 3px; }
.tb-dragging { opacity: .45; }
.tb-leg-card, .tb-leg-row { cursor: grab; }
.tb-leg-card input, .tb-leg-row input, .tb-leg-row select { cursor: auto; }
body.tb-viewer-open { overflow: hidden; }
.tb-viewer { position: fixed; inset: 0; z-index: 1400; display: flex; flex-direction: column; background: rgba(2, 10, 16, .94); color: #fff; }
.tb-viewer[hidden] { display: none; }
.tb-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.tb-viewer-meta { min-width: 0; }
.tb-viewer-meta span { display: block; color: #99f6e4; font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tb-viewer-meta b { display: block; overflow: hidden; color: #fff; font-size: .95rem; white-space: nowrap; text-overflow: ellipsis; }
.tb-viewer-meta small { display: block; overflow: hidden; color: rgba(255, 255, 255, .7); font-size: .66rem; white-space: nowrap; text-overflow: ellipsis; }
.tb-viewer-actions { display: flex; flex: none; gap: 6px; }
.tb-viewer-actions .tt-btn { min-height: 44px; color: #fff; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); }
.tb-viewer-actions .tt-btn-primary { background: var(--accent, #0f766e); border-color: var(--accent, #0f766e); }
.tb-viewer-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 16px; }
.tb-viewer-frame { width: min(100%, 1100px); aspect-ratio: 16 / 9; max-height: 100%; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.tb-viewer-frame.tall { width: auto; height: min(100%, 760px); aspect-ratio: 9 / 16; }
.tb-viewer-frame iframe { width: 100%; height: 100%; border: 0; }
.tb-viewer-card { width: min(100%, 640px); overflow: hidden; border-radius: 18px; background: #fff; color: #0d1b2a; }
.tb-viewer-img { aspect-ratio: 16 / 9; background: #0d1b2a center / cover no-repeat; }
.tb-viewer-card-body { padding: 18px 20px 20px; }
.tb-viewer-card-body span { color: #0f766e; font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tb-viewer-card-body h3 { margin: 6px 0; color: #0d1b2a; font-size: 1.25rem; font-weight: 800; }
.tb-viewer-card-body p { color: #475569; font-size: .82rem; line-height: 1.5; }
@media (max-width: 720px) {
  .tb-viewer-stage { padding: 8px; }
  .tb-viewer-frame { width: 100%; }
  .tb-viewer-frame.tall { width: min(100%, calc((100vh - 140px) * 9 / 16)); height: auto; }
  .tb-link-card { grid-template-columns: 110px minmax(0, 1fr) 44px; }
  .tb-links { grid-template-columns: 1fr; }
  .tb-strip-hint { display: none; }
}

/* ---------- Link strip: one row, collapsible ---------- */
.tb-strip-head { width: 100%; min-height: 40px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.tb-strip-head:disabled { cursor: default; color: var(--muted, #64748b); }
.tb-strip-chevron { color: var(--muted, #64748b); font-size: .8rem; }
.tb-strip, .tb-leg-row .tb-strip { grid-template-columns: repeat(var(--strip-cols, 4), minmax(0, 1fr)); }

/* ---------- Hotel options (inside Where we sleep) ---------- */
.tb-stays { margin-top: 16px; padding-top: 14px; border-top: 1px dashed color-mix(in srgb, var(--accent, #0f766e), transparent 55%); }
.tb-stays h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; color: var(--text, #111827); font-size: .92rem; font-weight: 800; }
.tb-stays h4 i { color: var(--accent, #0f766e); }
.tb-stay-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.tb-stay { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; padding: 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; background: var(--surface, #fff); }
.tb-stay.chosen { border: 2px solid var(--accent, #0f766e); }
.tb-stay-thumb { position: relative; min-height: 110px; padding: 0; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #0f766e, #134e4a) center / cover no-repeat; cursor: pointer; }
.tb-stay-thumb span { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-size: .56rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.tb-stay-thumb b { position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 999px; color: #0d1b2a; background: #5eead4; font-size: .58rem; }
.tb-stay-body { min-width: 0; }
.tb-stay-name { display: block; width: 100%; padding: 2px 0; border: 0; border-bottom: 1px dashed transparent; color: var(--text, #111827); background: transparent; font-size: .9rem; font-weight: 800; line-height: 1.3; }
.tb-stay-name:hover, .tb-stay-name:focus { outline: none; border-bottom-color: var(--accent, #0f766e); }
.tb-spot-meta .ok { color: #065f46; background: #d1fae5; }
.tb-spot-meta .warn { color: #92400e; background: #fef3c7; }
.tb-stay-price { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: end; margin-top: 8px; }
.tb-stay-price label { margin: 0; color: var(--muted, #64748b); font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tb-stay-price input { margin-top: 3px; font-weight: 800; }
.tb-stay-figures strong { display: block; color: var(--text, #111827); font-size: 1rem; font-variant-numeric: tabular-nums; }
.tb-stay-figures small { color: var(--muted, #64748b); font-size: .62rem; }
.tb-stay-seen { margin: 6px 0 0; color: var(--muted, #64748b); font-size: .66rem; }
.tb-stay-seen .up { color: var(--tb-bad); font-weight: 800; }
.tb-stay-seen .down { color: var(--tb-good); font-weight: 800; }
.tb-stay .tb-place-actions { margin-top: 8px; }
.tb-stay .tb-place-actions .tt-btn { min-height: 40px; }
.tb-stay-add[data-add-kind="stay"] { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) auto; }
@media (max-width: 720px) {
  .tb-stay-list { grid-template-columns: 1fr; }
  .tb-stay { grid-template-columns: 96px minmax(0, 1fr); }
  .tb-stay-price { grid-template-columns: minmax(0, 1fr); }
  .tb-stay-add[data-add-kind="stay"] { grid-template-columns: 1fr; }
}

/* ---------- Stop page: what is covered ---------- */
.tb-cover { padding: 14px 16px; border-radius: 18px; background: var(--input, #f8fafc); border: 1px solid var(--border, #e5e7eb); }
.tb-cover-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.tb-cover-head b { color: var(--text, #111827); font-size: .9rem; font-weight: 800; }
.tb-cover-head span { color: var(--accent, #0f766e); font-size: .72rem; font-weight: 800; }
.tb-cover-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.tb-cover-item { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; color: var(--muted, #64748b); background: var(--surface, #fff); font-size: .74rem; font-weight: 700; text-align: left; }
.tb-cover-item i { font-size: 1.05rem; }
.tb-cover-item.done { color: var(--text, #111827); border-color: color-mix(in srgb, var(--tb-good), transparent 60%); }
.tb-cover-item.done i { color: var(--tb-good); }
.tb-cover-item.part i { color: var(--tb-warn); }
.tb-cover-item.todo i { color: var(--border, #cbd5e1); }
.tb-chip-total { color: #0d1b2a; background: #fff !important; border-color: #fff !important; font-weight: 800 !important; }

/* ---------- Where we sleep: drop zone first ---------- */
.tb-stays { margin-top: 4px; padding-top: 0; border-top: 0; }
.tb-stay-drop { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 18px; border: 2px dashed color-mix(in srgb, var(--accent, #0f766e), transparent 45%); border-radius: 16px; background: var(--surface, #fff); }
.tb-stay-drop > i { font-size: 2rem; color: var(--accent, #0f766e); }
.tb-stay-drop b { display: block; color: var(--text, #111827); font-size: .98rem; font-weight: 800; }
.tb-stay-drop small { display: block; margin-top: 2px; color: var(--muted, #64748b); font-size: .72rem; line-height: 1.4; }
.tb-stay-drop-actions { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.tb-stay-drop-actions .tt-btn { min-height: 46px; }
.tb-stay-drop.tb-drop-target { background: color-mix(in srgb, var(--tb-coral), transparent 88%); }
.tb-chosen { display: grid; gap: 2px; margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #0f766e, #134e4a); }
.tb-chosen-label { color: #99f6e4; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tb-chosen b { font-size: 1.05rem; }
.tb-chosen .tt-btn { color: #fff; border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .1); }
.tb-hotel-details { margin-top: 14px; }
.tb-hotel-details > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--accent, #0f766e); font-size: .76rem; font-weight: 800; cursor: pointer; }
.tb-hotel-details[open] > summary { margin-bottom: 10px; }

/* ---------- Plan: the trip by destination ---------- */
.tb-dest-rows { display: grid; gap: 6px; }
.tb-dest-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; grid-template-areas: "name bar total" "name parts total"; gap: 4px 12px; align-items: center; width: 100%; padding: 10px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; background: var(--surface, #fff); text-align: left; }
.tb-dest-row:hover { border-color: var(--accent, #0f766e); }
.tb-dest-name { grid-area: name; }
.tb-dest-name b { display: block; color: var(--text, #111827); font-size: .86rem; }
.tb-dest-name small { color: var(--muted, #64748b); font-size: .64rem; }
.tb-dest-bar { grid-area: bar; height: 8px; border-radius: 999px; background: var(--input, #eef2f7); overflow: hidden; }
.tb-dest-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0f766e, #14b8a6); }
.tb-dest-parts { grid-area: parts; display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted, #64748b); font-size: .64rem; font-weight: 650; }
.tb-dest-row > strong { grid-area: total; color: var(--text, #111827); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.tb-dest-sum { display: grid; gap: 4px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--input, #f8fafc); }
.tb-dest-sum > div { display: flex; justify-content: space-between; gap: 10px; color: var(--text, #111827); font-size: .8rem; }
.tb-dest-sum b { font-variant-numeric: tabular-nums; }
.tb-dest-strong { padding-top: 6px; border-top: 1px solid var(--border, #e5e7eb); font-weight: 800; }
.tb-dest-grand { padding-top: 8px; border-top: 2px solid var(--text, #111827); font-size: 1.05rem !important; font-weight: 800; }
.tb-dest-grand b { font-size: 1.3rem; }
.tb-dest-sum p { margin: 6px 0 0; font-size: .74rem; }
@media (max-width: 620px) {
  .tb-dest-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name total" "bar bar" "parts parts"; }
  .tb-stay-drop-actions { grid-template-columns: 1fr; }
  .tb-cover-list { grid-template-columns: 1fr 1fr; }
}
