/* Itinerary timeline. Uses the site tokens from styles.css (:root --ink, --muted, --line, --panel, --maple, --sage, --sky, --danger). */
.tl { display: grid; gap: 10px; }
/* styles.css gives every button min-height 44px and a maple fill; reset inside the timeline. */
.tl button { min-height: 0; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.tl .tl-links, .tl .tl-legline { align-items: center; }
.tl-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel); }
.tl-switch button { border: 0; background: none; padding: 5px 14px; font: inherit; font-size: 13px; color: var(--muted); }
.tl-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tl-reset { margin-left: auto; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 12px; color: var(--maple); }
.tl-map { height: 230px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #efe6d6; position: relative; z-index: 0; }
.tl-map-off { margin: 0; padding: 16px; font-size: 13px; color: var(--muted); }
.tl-map-offline::after { content: "離線中：底圖無法載入，圖釘相對位置仍可參考"; position: absolute; left: 8px; right: 8px; top: 8px; z-index: 500; font-size: 12px; background: var(--panel); border-radius: 8px; padding: 4px 8px; color: var(--muted); }
.tl-stale { opacity: .55; text-decoration: line-through; }
.tl-hint, .tl-banner { margin: 0; font-size: 12px; color: var(--muted); }
.tl-banner { background: #fbeee2; border-radius: 10px; padding: 6px 10px; color: var(--ink); }
.tl-notes { display: grid; gap: 6px; }
.tl-note { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 13px; }
.tl-note summary { cursor: pointer; font-weight: 600; }

.tl-rows, .tl-stops { display: grid; }
.tl-row { display: grid; grid-template-columns: 46px 22px minmax(0, 1fr); column-gap: 8px; align-items: start; position: relative; }
.tl-row::before { content: ""; position: absolute; left: 64px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-time { font-size: 12px; color: var(--muted); text-align: right; padding-top: 12px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.tl-time b { display: block; color: var(--ink); font-size: 15px; }
.tl-axis { position: relative; z-index: 1; }
.tl-dot { margin-top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--maple); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.tl-dot-end { background: var(--sage); }
.tl-dot-s { display: block; width: 10px; height: 10px; margin: 15px auto 0; border-radius: 50%; background: var(--bg, #f7f0e4); border: 2px solid var(--muted); }

.tl-card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-block: 4px; display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 10px; scroll-margin-top: 90px; transition: box-shadow .2s; }
.tl-flash { box-shadow: 0 0 0 2px var(--maple); }
.tl-thumb { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; background: #f1e7d8; display: block; }
.tl-body { min-width: 0; }
.tl-body h4 { margin: 0; font-size: 15px; line-height: 1.35; }
.tl-stay { border: 0; background: none; padding: 0; font: inherit; color: var(--maple); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tl-stay::after { content: " ✎"; font-weight: 400; }
.tl-stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.tl-stepper button { border: 1px solid var(--line); background: #f1e7d8; border-radius: 8px; padding: 2px 8px; font: inherit; font-size: 12px; min-height: 30px; }
.tl-stepper span { font-size: 12px; color: var(--muted); }
.tl-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tl-chip { font-size: 12px; background: #f1e7d8; border-radius: 999px; padding: 1px 8px; }
.tl-chip-hi { background: var(--maple); color: #fff; }
.tl-alert { margin: 6px 0 0; font-size: 12.5px; border-radius: 8px; padding: 4px 8px; background: #fbeee2; }
.tl-bad { color: var(--danger, #9b3c2c); font-weight: 600; }
.tl-warn { color: #8a5a12; }
.tl-info { color: var(--ink); }
.tl-links { display: flex; gap: 12px; margin-top: 6px; font-size: 13px; }
.tl-links a, .tl-links button, .tl-more { color: var(--sky); font-weight: 600; text-decoration: none; border: 0; background: none; padding: 0; font: inherit; font-size: 13px; }
.tl-grip { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 6px 2px 6px 8px; touch-action: none; cursor: grab; align-self: start; }
.tl-lock { font-size: 12px; padding: 6px 0 0 6px; align-self: start; }
.tl-detail { grid-column: 3; margin: 0 0 6px 64px; }
/* The reused itinerary card keeps a 110px photo column from styles.css; the timeline hides the photo,
   so collapse it to one column or the text gets squeezed into a vertical strip. */
.tl-detail .itinerary-item, .tl-note .itinerary-item { grid-template-columns: minmax(0, 1fr); }
/* Inside a transport row the box is a grid too; without spanning, "grid-column: 3" above would add columns and squeeze every line. */
.tl-legbox > .tl-detail { grid-column: 1 / -1; margin: 6px 0; }
.tl-card-nothumb { grid-template-columns: minmax(0, 1fr) auto; }
.sortable-ghost .tl-card { opacity: .35; }
.sortable-chosen .tl-card { box-shadow: 0 10px 24px rgba(45, 37, 29, .22); }
.sortable-fallback .tl-leg { display: none; }

.tl-legbox { min-width: 0; padding: 6px 0; display: grid; gap: 4px; }
.tl-legline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.tl-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #f1e7d8; flex: 0 0 auto; color: var(--sky); }
.tl-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tl-walk .tl-ico { color: var(--sage); }
.tl-mins { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tl-mins-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ink); }
.tl-mins-btn::after { content: " ✎"; font-weight: 400; color: var(--muted); }
.tl-fare, .tl-tag { font-size: 12px; color: var(--ink); background: #f1e7d8; border-radius: 6px; padding: 0 6px; }
.tl-tag { background: #e3ece6; }
.tl-est { font-size: 11px; padding: 0 6px; border-radius: 6px; border: 1px dashed var(--muted); color: var(--muted); }
.tl-go { margin-left: auto; font-size: 12px; color: var(--sky); text-decoration: none; font-weight: 600; white-space: nowrap; }
.tl-how, .tl-wait { margin: 0; font-size: 12.5px; color: var(--muted); padding-left: 36px; overflow-wrap: anywhere; }
.tl-wait { color: var(--sage); font-weight: 600; }
.tl-how-inline { font-size: 12.5px; }
.tl-modes { display: flex; gap: 4px; padding-left: 36px; flex-wrap: wrap; }
.tl-modes button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; color: var(--muted); min-height: 28px; }
.tl-modes button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tl-legbox > .tl-more, .tl-legbox > .tl-alert, .tl-legbox > .tl-stepper { margin-left: 36px; }

.tl-pin-wrap { background: none; border: 0; }
.tl-pin { width: 24px; height: 24px; border-radius: 50%; background: var(--maple); color: #fff; font: 700 12px/24px -apple-system, BlinkMacSystemFont, sans-serif; text-align: center; display: block; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.tl-pin-lock { background: var(--sage); }
.tl button:focus-visible, .tl a:focus-visible { outline: 2px solid var(--maple); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .tl-card { transition: none; } }
