/* ============================================================
   DailyDesk — World Time Planner
   styles.css  (v5 — aligned grid, rescaling bars, hour highlight)
   ============================================================ */

:root {
  --color-bg: #f7f7f7;
  --color-card: #ffffff;
  --color-text: #111111;
  --color-muted: #666666;
  --color-light: #999999;
  --color-border: #e6e6e6;
  --color-border-hover: #c8c8c8;

  --color-btn-primary-bg: #111111;
  --color-btn-primary-text: #ffffff;
  --color-btn-primary-hover: #2a2a2a;

  /* Soft pastel "time of day" bands: indigo night → peach dawn → mint workday
     → apricot dusk. Desaturated so the planner stays calm and on-brand. */
  --tl-night:   #4e5882;
  --tl-morning: #f7e6cf;
  --tl-work:    #e9f3ec;
  --tl-evening: #f0d1a6;

  /* Weekend accent (a soft, desaturated rose — the calendar convention). */
  --weekend:      #b5616b;
  --weekend-soft: rgba(181, 97, 107, 0.12);
  --weekend-chip: rgba(181, 97, 107, 0.13);

  --radius-card: 16px;
  --radius-input: 9px;
  --radius-btn: 9px;
  --radius-pill: 20px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --max-width: 1200px;
  --side-pad: 24px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);

  /* Planner metrics */
  --label-w: 184px;     /* sidebar column width */
  --row-h: 38px;        /* shared row height: sidebar item == bar */
  --row-gap: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--font-sans); background: var(--color-bg); color: var(--color-text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--side-pad); }

/* ── HEADER ── */
.site-header { background: var(--color-card); border-bottom: 1px solid var(--color-border); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 58px; }
.brand { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; min-width: 0; }
.brand-name { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; flex-shrink: 0; }
.brand-name:hover { color: #444; }
.brand-tagline { font-size: 0.8125rem; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link { font-size: 0.875rem; font-weight: 500; color: var(--color-muted); padding: 6px 12px; border-radius: 8px; transition: color .15s, background .15s; }
.nav-link:hover { color: var(--color-text); background: var(--color-bg); }
.nav-link--active { color: var(--color-text); font-weight: 600; position: relative; }
.nav-link--active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -2px; height: 2px; background: var(--color-text); border-radius: 2px; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 4px; margin-left: auto; }
.nav-toggle-bar { display: block; width: 20px; height: 2px; background: var(--color-text); border-radius: 2px; }

/* ── PAGE HEAD ── */
.page-head { padding: 28px 0 18px; }
.page-title { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 6px; }
.page-sub { font-size: 1.05rem; color: var(--color-muted); }

/* ── CARD ── */
.card { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.tool-card { padding: 22px 26px; margin-bottom: 28px; }
.tool-divider { height: 1px; background: var(--color-border); margin: 18px 0; }
.block-title { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }

/* ═══════════════════════════════════════════
   PLANNER
   ═══════════════════════════════════════════ */
.planner { position: relative; }

/* ── Date bar ── */
.planner-datebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--color-border); }
.datebar-arrow { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 34px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-card); color: var(--color-muted); transition: border-color .15s, background .15s, color .15s; flex-shrink: 0; }
.datebar-arrow:hover:not(:disabled) { border-color: var(--color-border-hover); background: var(--color-bg); color: var(--color-text); }
.datebar-arrow:disabled { opacity: 0.35; cursor: not-allowed; }
.datebar-arrow svg { width: 15px; height: 15px; }
.datebar-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.datebar-days { display: flex; gap: 5px; overflow-x: auto; padding: 1px; }
.datebar-day { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 44px; padding: 4px 8px; border: 1px solid var(--color-border); border-radius: 9px; background: var(--color-card); color: var(--color-text); line-height: 1.12; transition: border-color .12s, background .12s; }
.datebar-day:hover { border-color: var(--color-border-hover); background: var(--color-bg); }
.datebar-day.is-selected { background: var(--color-text); border-color: var(--color-text); color: #fff; }
.datebar-day.is-weekend:not(.is-selected) { background: var(--weekend-chip); border-color: rgba(181,97,107,0.28); }
.dd-wd { font-size: 0.58rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--color-light); white-space: nowrap; }
.datebar-day.is-selected .dd-wd { color: #cfcfcf; }
.datebar-day.is-weekend .dd-wd { color: var(--weekend); }
.datebar-day.is-selected.is-weekend .dd-wd { color: #f1b9bd; }
.dd-dn { font-size: 0.92rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.datebar-pick { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-card); color: var(--color-muted); cursor: pointer; transition: border-color .15s; }
.datebar-pick:hover { border-color: var(--color-border-hover); color: var(--color-text); }
.datebar-pick svg { width: 15px; height: 15px; flex-shrink: 0; }
.datebar-input { border: none; background: none; font-family: inherit; font-size: 0.8rem; color: var(--color-text); padding: 0; min-width: 116px; }
.datebar-input:focus { outline: none; }
.datebar-today { margin-left: 2px; }

.planner-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.planner-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.seg-toggle { display: inline-flex; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.seg-btn { font-size: 0.74rem; font-weight: 600; color: var(--color-muted); background: var(--color-card); border: none; padding: 7px 11px; transition: background .12s, color .12s; }
.seg-btn + .seg-btn { border-left: 1px solid var(--color-border); }
.seg-btn:hover { background: var(--color-bg); color: var(--color-text); }
.seg-btn.is-active { background: var(--color-text); color: #fff; }
.planner-sub { font-size: 0.8rem; color: var(--color-muted); }
.planner-hint { font-size: 0.76rem; color: var(--color-light); margin: 12px 0 4px; }
.btn--icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-card); color: var(--color-muted); transition: border-color .15s, background .15s, color .15s; flex-shrink: 0; }
.btn--icon:hover { border-color: var(--color-border-hover); background: var(--color-bg); color: var(--color-text); }
.btn--icon svg { width: 16px; height: 16px; }

/* Per-city ruler: a thin strip of that city's own local hours, sitting above
   its bar. Labels are absolutely positioned at the fraction of the day where
   each 3-hour mark falls, so half-hour zones land correctly. */
.row-ruler { grid-column: 2; grid-row: 1; position: relative; height: 14px; }
.row-ruler-mark { position: absolute; top: 0; font-size: 0.58rem; line-height: 14px; color: var(--color-light); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-ruler-mark--home { color: var(--color-muted); font-weight: 600; }

/* Body: aligned rows. Top padding reserves room for the Now / Best tags.
   The overlay is positioned over the bar column only. */
.planner-body { position: relative; display: flex; flex-direction: column; gap: var(--row-gap); padding-top: 20px; }

/* Hour-scroll arrows: a thin row just above the bars, split to each end of the
   bar column (so they slide the 24h window without eating into the bar width). */
.planner-hour-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-left: var(--label-w); margin-bottom: 4px; }
.hour-arrow { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-card); color: var(--color-muted); font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.hour-arrow:hover:not(:disabled) { border-color: var(--color-border-hover); background: var(--color-bg); color: var(--color-text); }
.hour-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.hour-arrow svg { width: 15px; height: 15px; }
.planner-hour-hint { font-size: 0.7rem; color: var(--color-light); letter-spacing: 0.02em; }

/* Each row is a 2-row grid: [ruler over bar] in column 2, the city cell in
   column 1 spanning both so it stays the same height as ruler+bar. */
.planner-row { display: grid; grid-template-columns: var(--label-w) 1fr; grid-template-rows: var(--row-h); align-items: stretch; position: relative; z-index: 2; }
.planner-row.dragging { opacity: 0.4; }
.planner-row.drag-over-top::before,
.planner-row.drag-over-bottom::after { content: ''; position: absolute; left: 0; right: 0; height: 2px; background: var(--color-text); border-radius: 2px; z-index: 5; }
.planner-row.drag-over-top::before { top: calc(var(--row-gap) / -2 - 1px); }
.planner-row.drag-over-bottom::after { bottom: calc(var(--row-gap) / -2 - 1px); }

/* Sidebar cell */
.city-cell { grid-column: 1; grid-row: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; height: 100%; padding: 0 12px 0 8px; border: 1px solid var(--color-border); border-right: none; border-radius: 10px 0 0 10px; background: var(--color-card); transition: border-color .15s, background .12s; }
.city-cell--home { border-color: #d4d4d4; background: #fafafa; }
.planner-row:hover .city-cell { border-color: var(--color-border-hover); }
.drag-handle { display: flex; align-items: center; color: var(--color-light); cursor: grab; touch-action: none; }
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 13px; height: 13px; }
.city-cell--home .drag-handle { visibility: hidden; }   /* home is pinned */
.city-cell-main { min-width: 0; }
.city-cell-top { display: flex; align-items: baseline; gap: 5px; }
.cc-date { margin-left: auto; padding-left: 5px; flex-shrink: 0; font-size: 0.6rem; font-weight: 600; color: var(--color-light); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-date--diff { color: var(--color-muted); }   /* a city already on a different day */
.city-cell-home-icon { display: flex; color: var(--color-muted); flex-shrink: 0; }
.city-cell-home-icon svg { width: 12px; height: 12px; }
.city-cell-name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; border: none; padding: 0; font-family: inherit; color: inherit; text-align: left; }
button.city-cell-name { cursor: pointer; }
button.city-cell-name:hover { color: var(--color-muted); }
.city-cell-meta { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; overflow: hidden; }
.cc-time { font-size: 0.71rem; font-weight: 700; color: var(--color-text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cc-abbr { font-size: 0.61rem; font-weight: 600; color: var(--color-light); }
.cc-diff { margin-left: auto; padding-left: 4px; flex-shrink: 0; font-size: 0.63rem; font-weight: 600; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.city-cell-remove { display: flex; align-items: center; background: none; border: none; color: var(--color-light); padding: 2px; border-radius: 5px; transition: color .12s, background .12s; }
.city-cell-remove:hover { color: var(--color-text); background: #f0f0f0; }
.city-cell-remove svg { width: 13px; height: 13px; }
.city-cell--home .city-cell-remove { visibility: hidden; }
/* Home name is editable (opens the home picker) */
.city-cell-name--home { cursor: pointer; }
.city-cell-name--home:hover { color: var(--color-muted); text-decoration: underline dotted; text-underline-offset: 2px; }
.picker-mode-hint { font-size: 0.78rem; color: var(--color-muted); padding: 2px 14px 8px; }

/* Bar */
.timeline-bar { grid-column: 2; grid-row: 1; position: relative; height: var(--row-h); border: 1px solid var(--color-border); border-left: none; border-radius: 0 6px 6px 0; overflow: hidden; display: flex; cursor: crosshair; }
/* The hour sits centred inside each box; dark on light bands, white on night */
.timeline-segment { flex: 1 1 0; min-width: 0; height: 100%; position: relative; display: flex; align-items: center; justify-content: center; font-size: 0.55rem; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; overflow: hidden; color: #1b1b1b; }
.timeline-segment--night   { background: var(--tl-night); color: #fff; }
.timeline-segment--morning { background: var(--tl-morning); }
.timeline-segment--work    { background: var(--tl-work); }
.timeline-segment--evening { background: var(--tl-evening); }
.seg-ap { font-size: 0.9em; margin-left: 0.5px; opacity: 0.8; }
.timeline-segment:not(:last-child)::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,0.12); }
.timeline-segment--work:not(:last-child)::after, .timeline-segment--morning:not(:last-child)::after { background: rgba(0,0,0,0.05); }

/* Day boundary: a little gap where a city rolls into a new day */
.bar-day-divider { position: absolute; top: 0; bottom: 0; width: 3px; transform: translateX(-1.5px); background: var(--color-bg); box-shadow: inset 1px 0 0 rgba(0,0,0,.28), inset -1px 0 0 rgba(0,0,0,.28); pointer-events: none; z-index: 3; }
.bar-date-label { position: absolute; top: 1px; transform: translateX(3px); font-size: 0.56rem; font-weight: 700; line-height: 1.45; padding: 0 4px; border-radius: 4px; background: rgba(255,255,255,0.82); color: var(--color-muted); white-space: nowrap; pointer-events: none; z-index: 4; }
.bar-date-label.is-weekend { color: var(--weekend); background: rgba(255,255,255,0.86); }
/* Weekend portion of a bar gets a soft tint */
.bar-weekend { position: absolute; top: 0; bottom: 0; background: var(--weekend-soft); box-shadow: inset 0 2px 0 rgba(181,97,107,0.4); pointer-events: none; z-index: 1; }

/* ── Overlay (spans the bar column only) ── */
.planner-overlay { position: absolute; top: 0; bottom: 0; left: var(--label-w); right: 0; pointer-events: none; z-index: 3; }

/* Hour highlight column */
.hour-highlight { position: absolute; top: 0; bottom: 0; background: rgba(40,90,200,0.10); border-left: 1px solid rgba(40,90,200,0.5); border-right: 1px solid rgba(40,90,200,0.5); border-radius: 2px; pointer-events: none; transition: left .04s linear; }

/* Pinned (clicked) time column + the converted-time readout on each bar */
#pinned-col { position: absolute; top: 0; bottom: 0; background: rgba(40,90,200,0.13); border-left: 1.5px solid rgba(40,90,200,0.8); border-right: 1.5px solid rgba(40,90,200,0.8); pointer-events: none; z-index: 3; }
#pinned-tag { position: absolute; top: 0; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; font-size: 0.62rem; font-weight: 700; color: #fff; background: #2a5ac8; padding: 2px 7px; border-radius: 5px; white-space: nowrap; border: none; cursor: pointer; pointer-events: auto; z-index: 7; }
#pinned-tag:hover { background: #1f49a8; }
.bar-pin-label { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 0.6rem; font-weight: 700; color: #1f2d52; background: rgba(255,255,255,0.92); padding: 1px 4px; border-radius: 4px; white-space: nowrap; pointer-events: none; z-index: 5; box-shadow: 0 1px 2px rgba(0,0,0,.16); font-variant-numeric: tabular-nums; }

/* Best-time overlay (per row, drawn in JS) */
.timeline-best-overlay { position: absolute; top: 0; bottom: 0; border: 1.5px solid #111; border-radius: 4px; pointer-events: none; z-index: 4; background: repeating-linear-gradient(45deg, rgba(0,0,0,0.06) 0 3px, transparent 3px 6px); }

/* Now marker (inside overlay, spans all rows) */
.timeline-now { position: absolute; top: 0; bottom: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; width: 0; }
.timeline-now-tag { font-size: 0.62rem; font-weight: 700; color: #fff; background: #111; padding: 2px 7px; border-radius: 5px; white-space: nowrap; margin-bottom: 2px; transform: translateX(-50%); }
.timeline-now-dot { width: 6px; height: 6px; border-radius: 50%; background: #111; flex-shrink: 0; }
.timeline-now-line { width: 1px; background: #111; flex: 1; opacity: 0.5; }

/* Best-time tag (created in JS) */
.timeline-best-tag { position: absolute; z-index: 6; font-size: 0.62rem; font-weight: 700; color: #fff; background: #111; padding: 2px 7px; border-radius: 5px; white-space: nowrap; transform: translateX(-50%); pointer-events: none; top: 1px; }

/* ── Add-city ── */
.btn--add-city { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border: 1px dashed var(--color-border); border-radius: 10px; background: var(--color-card); color: var(--color-text); font-size: 0.84rem; font-weight: 500; transition: border-color .15s, background .15s; margin-top: 10px; }
.btn--add-city:hover { border-color: var(--color-border-hover); background: var(--color-bg); }
.btn--add-city svg { width: 14px; height: 14px; }

/* ── Legend ── */
.timeline-legend { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--color-border); }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 0.74rem; color: var(--color-muted); }
.legend-swatch { display: inline-block; width: 24px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-swatch--night { background: var(--tl-night); }
.legend-swatch--morning { background: var(--tl-morning); }
.legend-swatch--work { background: var(--tl-work); box-shadow: inset 0 0 0 1px #d0d0d0; }
.legend-swatch--evening { background: var(--tl-evening); }
.legend-swatch--best { background: repeating-linear-gradient(45deg, rgba(0,0,0,0.12) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1.5px #111; }

/* ── Tooltip ── */
.timeline-tooltip { position: fixed; background: #111; color: #fff; font-size: 0.76rem; padding: 8px 11px; border-radius: 8px; pointer-events: none; z-index: 300; opacity: 0; transition: opacity .12s; white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.2); line-height: 1.5; }
.timeline-tooltip.is-visible { opacity: 1; }
.timeline-tooltip-head { font-weight: 700; margin-bottom: 5px; padding-bottom: 5px; border-bottom: 1px solid rgba(255,255,255,.18); }
.timeline-tooltip-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 5px; }
/* Colour box around the city name = its current state (matches the planner bands) */
.tt-chip { font-weight: 700; font-size: 0.74rem; padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.tt-chip--work    { background: var(--tl-work);    color: #1e3a2a; }
.tt-chip--morning { background: var(--tl-morning); color: #5b4020; }
.tt-chip--evening { background: var(--tl-evening); color: #5b3a16; }
.tt-chip--night   { background: var(--tl-night);   color: #fff; }
.tt-time { font-variant-numeric: tabular-nums; opacity: .92; white-space: nowrap; }
.tt-ab { opacity: .5; }
.tt-state { opacity: .55; font-size: 0.66rem; margin-left: 2px; }

/* ═══════════════════════════════════════════
   CONTROLS
   ═══════════════════════════════════════════ */
.controls-bar { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.control-group { display: flex; align-items: center; gap: 12px; }
.control-label { font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.control-inline { display: flex; align-items: center; gap: 8px; }
.control-to { font-size: 0.85rem; color: var(--color-muted); }
.control-hint { font-size: 0.76rem; color: var(--color-light); margin-left: auto; text-align: right; max-width: 320px; }

/* Meeting-length slider ("scroll wheel" in 30-min steps) */
.range-control { display: flex; align-items: center; gap: 12px; }
.range-slider { -webkit-appearance: none; appearance: none; width: 168px; height: 4px; border-radius: 3px; background: var(--color-border); outline: none; cursor: pointer; }
.range-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--color-text); border: 2px solid var(--color-card); box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: grab; transition: transform .1s; }
.range-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.12); }
.range-slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--color-text); border: 2px solid var(--color-card); box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: grab; }
.range-slider::-moz-range-track { height: 4px; border-radius: 3px; background: var(--color-border); }
.range-slider:focus-visible { box-shadow: 0 0 0 3px rgba(0,0,0,.12); }
.range-value { font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 74px; white-space: nowrap; }

.select-wrapper { position: relative; display: inline-flex; align-items: center; }
.select { border: 1px solid var(--color-border); border-radius: var(--radius-input); background: var(--color-card); color: var(--color-text); font-family: var(--font-sans); appearance: none; -webkit-appearance: none; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.select:focus { outline: none; border-color: #aaa; box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.select:hover { border-color: var(--color-border-hover); }
.select--sm { padding: 9px 32px 9px 12px; font-size: 0.875rem; min-width: 116px; }
.select--xs { padding: 5px 24px 5px 8px; font-size: 0.78rem; min-width: 92px; }
.select-chevron { position: absolute; right: 9px; pointer-events: none; display: flex; align-items: center; color: var(--color-light); }
.select-chevron svg { width: 14px; height: 14px; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--radius-btn); font-size: 0.875rem; font-weight: 600; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; border: none; }
.btn-icon { flex-shrink: 0; width: 14px; height: 14px; }
.btn--primary { padding: 11px 22px; background: var(--color-btn-primary-bg); color: var(--color-btn-primary-text); font-size: 0.9rem; }
.btn--primary:hover { background: var(--color-btn-primary-hover); }
.btn--primary:focus-visible { outline: 3px solid rgba(0,0,0,.25); outline-offset: 2px; }
.btn--copy { padding: 9px 15px; background: var(--color-btn-primary-bg); color: #fff; font-size: 0.82rem; }
.btn--copy:hover { background: var(--color-btn-primary-hover); }
.btn--ghost { padding: 8px 12px; background: none; color: var(--color-muted); font-size: 0.82rem; font-weight: 500; }
.btn--ghost:hover { color: var(--color-text); }
.btn--ghost .btn-icon--chevron { transition: transform .2s; }
.btn--ghost[aria-expanded="true"] .btn-icon--chevron { transform: rotate(180deg); }
.btn--xs { padding: 6px 12px; font-size: 0.78rem; border: 1px solid var(--color-border); border-radius: 7px; background: var(--color-card); color: var(--color-text); }
.btn--xs:hover { border-color: var(--color-border-hover); background: var(--color-bg); }

/* ═══════════════════════════════════════════
   FOOTER STRIP
   ═══════════════════════════════════════════ */
.footer-strip { display: grid; grid-template-columns: 1.5fr auto 1fr; align-items: stretch; }
.fs-col { min-width: 0; }
.fs-col--results { padding-right: 28px; }
.fs-col--privacy { padding-left: 28px; }
.fs-divider { width: 1px; background: var(--color-border); }
.fs-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.result-pill { font-size: 0.7rem; font-weight: 500; color: #555; background: #f0f0f0; padding: 3px 10px; border-radius: var(--radius-pill); white-space: nowrap; }
.result-table { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 16px; align-items: baseline; }
.result-city { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.result-time { font-size: 0.85rem; color: var(--color-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-abbr { font-size: 0.75rem; color: var(--color-light); text-align: right; }
.result-meta { font-size: 0.72rem; color: var(--color-light); margin-top: 6px; }
.result-meta b { color: var(--color-muted); font-weight: 600; }
/* "How is this picked?" explainer */
.fs-note { margin: 2px 0 12px; font-size: 0.78rem; }
.fs-note summary { cursor: pointer; color: var(--color-muted); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.fs-note summary::-webkit-details-marker { display: none; }
.fs-note summary::before { content: '?'; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border: 1px solid var(--color-border-hover); border-radius: 50%; font-size: 0.66rem; font-weight: 700; color: var(--color-muted); }
.fs-note[open] summary { margin-bottom: 6px; }
.fs-note p { color: var(--color-muted); line-height: 1.55; max-width: 360px; }
.fs-note em { font-style: normal; font-weight: 600; color: var(--color-text); }
.fs-actions { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.more-options { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 16px; }
.more-option-group .more-option-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.more-option-title { font-size: 0.8rem; font-weight: 700; }
.results-empty { padding: 8px 0; }
.results-empty-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 3px; }
.results-empty-body { font-size: 0.8rem; color: var(--color-muted); line-height: 1.5; max-width: 280px; }
.privacy-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.privacy-icon { display: flex; color: var(--color-muted); }
.privacy-icon svg { width: 17px; height: 17px; }
.privacy-title { font-size: 0.88rem; font-weight: 700; }
.privacy-body { font-size: 0.8rem; color: var(--color-muted); line-height: 1.5; }

/* ═══════════════════════════════════════════
   CITY PICKER
   ═══════════════════════════════════════════ */
.picker-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.32); z-index: 500; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.picker { width: 100%; max-width: 480px; background: var(--color-card); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.28); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; animation: popIn .16s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(-8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.picker-head { display: flex; align-items: center; gap: 8px; padding: 14px; border-bottom: 1px solid var(--color-border); }
.picker-search-wrap { position: relative; flex: 1; display: flex; align-items: center; }
.picker-search-icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--color-light); pointer-events: none; }
.picker-search { width: 100%; padding: 11px 12px 11px 36px; border: 1px solid var(--color-border); border-radius: 10px; font-size: 0.9rem; font-family: var(--font-sans); background: var(--color-bg); transition: border-color .15s, box-shadow .15s, background .15s; }
.picker-search:focus { outline: none; border-color: #999; background: var(--color-card); box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.picker-close { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: none; background: none; color: var(--color-muted); border-radius: 8px; flex-shrink: 0; transition: background .15s, color .15s; }
.picker-close:hover { background: var(--color-bg); color: var(--color-text); }
.picker-close svg { width: 18px; height: 18px; }
.picker-list { overflow-y: auto; padding: 6px; }
.picker-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; transition: background .1s; }
.picker-option:hover, .picker-option.is-active { background: var(--color-bg); }
.picker-option-main { min-width: 0; }
.picker-option-name { font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-option-name .opt-abbr { font-size: 0.72rem; font-weight: 500; color: var(--color-light); margin-left: 6px; }
.picker-option-sub { font-size: 0.72rem; color: var(--color-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-option-off { font-size: 0.72rem; color: var(--color-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.picker-empty { padding: 24px 14px; text-align: center; color: var(--color-muted); font-size: 0.85rem; }
.picker-disabled { opacity: 0.42; cursor: not-allowed; }

/* ── LIST / MAP TABS ── */
.picker-tabs { display: flex; gap: 4px; padding: 10px 14px 2px; }
.picker-tab { font-size: 0.8rem; font-weight: 600; color: var(--color-muted); background: none; border: 1px solid var(--color-border); border-radius: 8px; padding: 6px 16px; transition: background .12s, color .12s, border-color .12s; }
.picker-tab:hover { background: var(--color-bg); color: var(--color-text); border-color: var(--color-border-hover); }
.picker-tab.is-active { background: var(--color-text); color: #fff; border-color: var(--color-text); }

/* ── MAP VIEW (offline geographic world timezone map) ── */
.picker--wide { max-width: 880px; }   /* the map needs room; list view stays 480 */
.picker-map { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.picker-map-hint { font-size: 0.74rem; color: var(--color-light); padding: 10px 14px 8px; }
.tz-map { flex: 0 0 auto; padding: 0 14px 10px; }
.tz-map svg { display: block; width: 100%; height: auto; border: 1px solid var(--color-border); border-radius: 10px; overflow: hidden; }
/* Real time-zone polygons: hover highlights the whole zone, click selects it.
   The faint blue tint matches the planner's hover-highlight column. */
.tzfill { cursor: pointer; transition: fill .08s; }
.tzfill:hover { fill: rgba(40,90,200,0.16); stroke: rgba(40,90,200,0.55); stroke-width: 0.9; }
.tzfill.is-active { fill: rgba(40,90,200,0.24); stroke: rgba(40,90,200,0.9); stroke-width: 1.1; }
.tzh.is-active { font-weight: 700; }
.tz-band-head { font-size: 0.78rem; font-weight: 700; padding: 10px 14px 6px; border-top: 1px solid var(--color-border); }
.tz-band-head span { font-weight: 500; color: var(--color-light); }
.tz-band-cities { flex: 1; min-height: 0; overflow-y: auto; }

/* ── HOURS POPOVER ── */
.hours-popover { position: absolute; z-index: 520; background: var(--color-card); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.16); padding: 12px; min-width: 214px; }
.hours-popover-title { font-size: 0.78rem; font-weight: 700; margin-bottom: 9px; }
.hours-popover-row { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.hours-popover-row span { font-size: 0.76rem; color: var(--color-muted); }

/* ── FOOTER ── */
.site-footer { background: var(--color-card); border-top: 1px solid var(--color-border); padding: 16px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-copy { font-size: 0.8rem; color: var(--color-muted); }
.footer-links { display: flex; gap: 18px; }
.footer-link { font-size: 0.8rem; color: var(--color-muted); transition: color .15s; }
.footer-link:hover { color: var(--color-text); }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1000px) {
  .footer-strip { grid-template-columns: 1fr; gap: 20px 0; }
  .fs-divider { display: none; }
  .fs-col--results, .fs-col--privacy { padding: 0; }
}
@media (max-width: 720px) {
  :root { --label-w: 150px; }
}
/* Below this width the 24 columns get too thin to read -> allow horizontal scroll
   on the planner only, keeping rows aligned. */
@media (max-width: 560px) {
  :root { --side-pad: 14px; --label-w: 156px; }
  .brand-tagline { display: none; }
  .header-inner { gap: 12px; }
  .page-head { padding: 18px 0 14px; }
  .tool-card { padding: 16px; }
  /* Make the whole planner scroll as one unit so alignment is preserved */
  .planner-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .planner-body { min-width: 520px; }
  /* Hour-scroll row: drop the text labels + hint, keep the chevrons at each end */
  .hour-arrow span, .planner-hour-hint { display: none; }
  .hour-arrow { padding: 5px 9px; }
  /* Tight cells: drop the secondary abbr + date so the name + offset fit */
  .cc-abbr, .cc-date { display: none; }
  /* Narrow boxes: just the number (no am/pm), a touch smaller */
  .timeline-segment { font-size: 0.5rem; letter-spacing: -0.04em; }
  .seg-ap { display: none; }
  /* Date bar: chips scroll between the arrows; the calendar wraps underneath */
  .planner-datebar { gap: 8px; }
  .datebar-nav { flex: 1 1 100%; }
  .datebar-days { flex: 1 1 0; min-width: 0; }
  .datebar-pick { margin-left: 0; flex: 1 1 auto; }
  /* Title row: let the format toggle + sort wrap below the heading if needed */
  .planner-head { flex-wrap: wrap; }
  .controls-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .control-group { justify-content: space-between; }
  .control-hint { margin-left: 0; text-align: left; max-width: none; }
  .footer-strip { grid-template-columns: 1fr; }
  .fs-divider { display: none; }
  .fs-col--privacy { padding: 0; }
  .timeline-legend { gap: 10px 14px; }
  .fs-actions { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════
   STATIC CONTENT PAGES (About / Privacy)
   ═══════════════════════════════════════════ */
.content-page { padding: 26px 30px 32px; margin-bottom: 28px; max-width: 760px; }
.content-page h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; margin: 22px 0 8px; }
.content-page h2:first-of-type { margin-top: 0; }
.content-page p { font-size: 0.95rem; color: var(--color-muted); margin-bottom: 12px; }
.content-page .prose-list { list-style: disc; padding-left: 20px; margin-bottom: 12px; }
.content-page .prose-list li { font-size: 0.95rem; color: var(--color-muted); margin-bottom: 6px; }
.content-page .inline-link { color: var(--color-text); text-decoration: underline; }
.content-page .inline-link:hover { color: var(--color-muted); }
.content-page h3 { font-size: 0.98rem; font-weight: 600; margin: 18px 0 4px; color: var(--color-text); }
/* Homepage intro/FAQ block: full width so its border lines up with the tool
   card above; the bulk (how-it-works + FAQ) collapses behind an expander. */
.home-content { max-width: none; margin: 0 0 28px; }
.home-more { margin-top: 6px; }
.home-more > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 0.92rem; font-weight: 600; color: var(--color-text); padding: 4px 0; }
.home-more > summary::-webkit-details-marker { display: none; }
.home-more > summary:hover { color: var(--color-muted); }
.home-more-chev { width: 15px; height: 15px; transition: transform .15s ease; }
.home-more[open] > summary { margin-bottom: 8px; }
.home-more[open] .home-more-chev { transform: rotate(180deg); }
.content-back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--color-muted); margin-top: 4px; }
.content-back:hover { color: var(--color-text); }
.content-back svg { width: 15px; height: 15px; }

:focus-visible { outline: 2px solid rgba(0,0,0,.35); outline-offset: 2px; }
[hidden] { display: none !important; }
