/* InterPlanet — sky.css v1.0.0 */
/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #060614; color: rgba(255,255,255,0.92);
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; width: 100vw; overflow: hidden; }

#cities-wrap {
  flex: 1; display: flex; flex-direction: row;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.25) transparent;
}
#cities-wrap.horiz {
  flex-direction: column; overflow-x: hidden; overflow-y: auto;
}
#cities-wrap::-webkit-scrollbar { height: 5px; width: 5px; }
#cities-wrap::-webkit-scrollbar-track { background: transparent; }
#cities-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 3px; }

/* ── City column (vertical/default) ──────────────────────────────────────── */
.city-col {
  flex: 1 0 200px;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr minmax(172px, auto) 28px; /* sky | info | hourly */
  position: relative;
  border-right: 1px solid rgba(255,255,255,0.07); transition: background 3.5s ease;
  cursor: default; min-width: 200px;
}
.city-col:last-of-type { border-right: none; }

/* sky area — holds centred time block + gradient */
.city-sky {
  /* flex:1 not needed — grid row 1 (1fr) handles sizing */
  transition: background 3.5s ease; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

/* time block centred in sky */
.city-time-block {
  text-align: center; pointer-events: none;
  text-shadow: 0 1px 10px rgba(0,0,0,0.45), 0 0 28px rgba(0,0,0,0.25);
}
.city-time-row { display: flex; align-items: baseline; justify-content: center; gap: 0.5rem; line-height: 1; }
.city-time { font-size: 2rem; font-weight: 700; letter-spacing: -0.04em; }
.city-dow  { font-size: 0.88rem; font-weight: 600; opacity: 0.75; }

/* sky description label */
.sky-label {
  position: absolute; bottom: 6px; left: 0; right: 0; text-align: center;
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; opacity: 0.55; pointer-events: none;
}

/* city info panel — inherits column bg colour, no forced black */
.city-info {
  padding: 0.55rem 0.75rem 0.45rem;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background 3.5s ease, color 3.5s ease;
  border-top: 1px solid rgba(255,255,255,0.08);
  min-height: 172px; flex-shrink: 0;
}
.city-tz { font-size: 0.65rem; margin-top: 0.15rem; }
.city-name-wrap { display: flex; align-items: baseline; gap: 0.3rem; margin-top: 0.3rem; }
.city-name { font-size: 0.82rem; font-weight: 600; }
.city-country { font-size: 0.7rem; }
.city-sky-desc { font-size: 0.7rem; margin-top: 0.15rem; }
.city-weather { font-size: 0.7rem; margin-top: 0.2rem; line-height: 1.4; }
.city-sun { font-size: 0.68rem; margin-top: 0.15rem; }
.city-moon { font-size: 0.68rem; margin-top: 0.05rem; }
.city-ping { font-size: 0.65rem; margin-top: 0.15rem; font-variant-numeric: tabular-nums; }
.holiday-badge {
  display: inline-block; font-size: 0.62rem; padding: 0.08rem 0.4rem;
  border-radius: 99px; border: 1px solid rgba(255,220,80,0.5);
  background: rgba(255,200,0,0.12); color: rgba(255,220,80,0.9);
  margin-top: 0.2rem;
}
.los-warn { font-size: 0.65rem; color: rgba(255,160,60,0.9); margin-top: 0.15rem; }
.planet-zone { font-size: 0.68rem; opacity: 0.6; margin-top: 0.1rem; }

/* editable city name */
.city-name-input {
  background: none; border: none; border-bottom: 1px solid currentColor;
  color: inherit; font-size: 0.82rem; font-weight: 600; width: 100%;
  outline: none; padding: 0; opacity: 0.9; min-width: 0;
}

/* planet badge */
.planet-badge {
  display: inline-block; font-size: 0.65rem; padding: 0.1rem 0.35rem;
  border-radius: 99px; border: 1px solid currentColor;
  margin-top: 0.2rem;
}

/* work hours indicator */
.work-indicator {
  display: flex; align-items: center; gap: 0.3rem; margin-top: 0.25rem;
  font-size: 0.65rem;
}
.work-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.work-dot.work { background: #4caf50; }
.work-dot.marginal { background: #ff9800; }
.work-dot.rest { background: #f44336; }

/* hourly bar */
.hourly-wrap { position: relative; }
.hourly-bar {
  height: 24px; display: flex; flex-direction: row; overflow: hidden; position: relative;
}
.hour-cell {
  flex: 1; height: 100%; cursor: pointer; position: relative;
  transition: filter 0.15s;
}
.hour-cell:hover { filter: brightness(1.4) saturate(1.3); }
.now-line {
  position: absolute; top: 0; width: 2px; height: 100%;
  background: rgba(255,255,255,0.9); box-shadow: 0 0 6px rgba(255,255,255,0.7);
  pointer-events: none; z-index: 5; transform: translateX(-50%);
}
/* downward-pointing arrow above the now-line */
.now-line::before {
  content: ''; position: absolute; top: -7px; left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 7px solid rgba(255,255,255,0.9);
}

/* SVG icon wrappers in info rows */
.wx-row { display: flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; margin-top: 0.15rem; flex-wrap: wrap; }
.wx-row svg { flex-shrink: 0; vertical-align: middle; opacity: 0.8; }
.wx-chip { display: flex; align-items: center; gap: 0.2rem; white-space: nowrap; }
.city-temp-est { font-size: 0.67rem; margin-top: 0.1rem; }
.hourly-labels {
  display: flex; justify-content: space-between;
  padding: 0 0 0.3rem; font-size: 0.6rem; opacity: 0.45;
}

/* remove button */
.remove-btn {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px;
  border-radius: 50%; border: none; background: rgba(0,0,0,0.3); color: rgba(255,255,255,0.6);
  cursor: pointer; font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s; z-index: 10;
}
.city-col:hover .remove-btn { opacity: 1; }
/* Manage mode: remove buttons always visible, larger tap target on mobile */
#cities-wrap.manage-mode .remove-btn {
  opacity: 1; width: 32px; height: 32px; font-size: 0.85rem;
  background: rgba(200,50,50,0.75); color: #fff; top: 50%; right: 8px;
  transform: translateY(-50%);
}

/* Manage button (mobile) */
#manage-btn {
  display: none; /* shown via JS on mobile when cities exist */
  position: fixed; bottom: 72px; right: 14px; z-index: 600;
  background: rgba(30,30,50,0.92); border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.75); border-radius: 22px; padding: 0.45rem 0.9rem;
  font-size: 0.8rem; cursor: pointer; backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4); gap: 0.4rem; align-items: center;
}
#manage-btn.visible { display: flex; }
#manage-btn.active { background: rgba(91,141,239,0.25); border-color: rgba(91,141,239,0.5); color: #fff; }

/* Manage action bar (slides up from bottom in manage mode) */
#manage-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 650;
  background: rgba(18,18,32,0.97); border-top: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px); padding: 0.65rem 1rem;
  display: flex; gap: 0.6rem; align-items: center; justify-content: flex-end;
  transform: translateY(100%); transition: transform 0.25s ease;
}
#manage-bar.on { transform: translateY(0); }
.mb-clear-btn {
  background: rgba(200,50,50,0.85); color: #fff; border: none;
  border-radius: 8px; padding: 0.5rem 1.1rem; font-size: 0.85rem;
  cursor: pointer; font-weight: 600;
}
.mb-clear-btn:hover { background: rgba(220,60,60,1); }
.mb-done-btn {
  background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 8px;
  padding: 0.5rem 1.1rem; font-size: 0.85rem; cursor: pointer;
}
.mb-done-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ── City timezone-change confirmation panel ──────────────────────────────── */
.city-confirm {
  display: none; position: absolute; inset: 0; z-index: 110;
  background: rgba(8,8,22,0.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 0.7rem 0.85rem; overflow-y: auto;
  flex-direction: column; gap: 0.35rem;
  color: rgba(255,255,255,0.92); font-size: 0.74rem;
}
.city-confirm.on { display: flex; }
.cc-title { font-size: 0.69rem; opacity: 0.55; margin-bottom: 0.1rem; }
.cc-candidate {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.06); border-radius: 6px; padding: 0.35rem 0.5rem;
}
.cc-cand-info { flex: 1; min-width: 0; }
.cc-cand-name { font-weight: 600; font-size: 0.77rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-cand-tz   { font-size: 0.65rem; opacity: 0.5; font-family: monospace; margin-top: 0.1rem; }
.cc-actions   { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.1rem; }
.cc-btn {
  border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.07);
  color: inherit; border-radius: 5px; font-size: 0.67rem;
  padding: 0.22rem 0.55rem; cursor: pointer; white-space: nowrap; line-height: 1.3;
}
.cc-btn:hover { background: rgba(255,255,255,0.15); }
.cc-btn-change { background: rgba(91,141,239,0.18); border-color: rgba(91,141,239,0.5); }
.cc-btn-change:hover { background: rgba(91,141,239,0.32); }
.cc-btn-cancel { opacity: 0.45; }
.cc-btn-cancel:hover { opacity: 0.75; }

/* ── City row (horizontal mode) ───────────────────────────────────────────── */
#cities-wrap.horiz .city-col {
  flex: 0 0 auto; min-width: unset; max-width: unset; width: 100%;
  min-height: 110px; display: grid; grid-template-rows: unset;
  grid-template-columns: 1fr 175px 18px;
  border-right: none; border-bottom: 1px solid rgba(255,255,255,0.07);
}
#cities-wrap.horiz .city-sky { /* grid column 1 */ }
#cities-wrap.horiz .city-info { width: unset; min-height: 110px; justify-content: flex-start; display: flex; flex-direction: column; }
#cities-wrap.horiz .hourly-bar { height: 18px; }
#cities-wrap.horiz .hourly-labels { display: none; }
#cities-wrap.horiz .sky-label { display: none; }

/* ── Add / layout buttons ─────────────────────────────────────────────────── */
#add-col {
  flex: 0 0 50px; width: 50px; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: none; border-left: 1px solid rgba(255,255,255,0.15);
  cursor: pointer; font-size: 1.4rem; color: rgba(255,255,255,0.7);
  transition: background 0.2s, color 0.2s;
}
#add-col:hover { background: rgba(255,255,255,0.13); color: rgba(255,255,255,1); }
#cities-wrap.horiz #add-col {
  width: 100%; height: 50px; flex: 0 0 50px;
}

/* ── Floating controls ────────────────────────────────────────────────────── */
#controls {
  position: fixed; top: 10px; right: 10px;
  display: flex; gap: 6px; z-index: 600;
}
.font-ctl { font-size: 0.72rem !important; font-weight: 700; letter-spacing: -0.01em; min-width: 1.8rem; }
.font-ctl:disabled { opacity: 0.3; cursor: default; }
.ctl {
  width: 34px; height: 34px; border-radius: 9px; border: none; cursor: pointer;
  font-size: 0.95rem; background: rgba(0,0,0,0.35); color: white;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.ctl:hover { background: rgba(0,0,0,0.55); }

/* ── Hour hover popup ─────────────────────────────────────────────────────── */
#hpop {
  position: fixed; z-index: 1000; display: none; pointer-events: none;
  background: rgba(12,12,22,0.94); color: white; border-radius: 9px;
  padding: 0.55rem 0.75rem; font-size: 0.72rem; white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.1);
  min-width: 140px;
}
#hpop.on { display: block; }
.hpop-time { font-weight: 700; font-size: 0.8rem; margin-bottom: 0.25rem; }
.hpop-row { display: flex; justify-content: space-between; gap: 0.8rem; opacity: 0.8; }

/* ── Search modal ─────────────────────────────────────────────────────────── */
#search-modal {
  position: fixed; inset: 0; z-index: 900; display: none;
  align-items: flex-start; justify-content: center;
  padding: 10vh 1rem 2rem; background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
}
#search-modal.on { display: flex; }
#search-box {
  background: #12121f; border-radius: 14px; width: 100%; max-width: 430px;
  overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.08);
}
#search-head {
  display: flex; align-items: center; padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07); gap: 0.5rem;
}
#search-input {
  flex: 1; background: none; border: none; color: white; font-size: 0.95rem;
  outline: none;
}
#search-input::placeholder { color: rgba(255,255,255,0.28); }
#search-close {
  background: none; border: none; color: rgba(255,255,255,0.45);
  cursor: pointer; font-size: 1.1rem; padding: 2px 4px;
}
#search-results { max-height: 50vh; overflow-y: auto; scrollbar-width: thin; }
.sr-item {
  padding: 0.65rem 1rem; cursor: pointer; display: grid;
  grid-template-columns: 1fr auto; align-items: center; gap: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.04); transition: background 0.1s;
}
.sr-item:hover { background: rgba(255,255,255,0.07); }
.sr-item.planet { border-top: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.02); }
.sr-name { color: white; font-size: 0.88rem; }
.sr-sub { color: rgba(255,255,255,0.72); font-size: 0.73rem; margin-top: 0.1rem; }
.sr-tz { color: rgba(255,255,255,0.6); font-size: 0.7rem; text-align: right; }
.sr-sym { font-size: 1.1rem; }
.sr-section-header {
  padding: 0.4rem 1rem 0.2rem; font-size: 0.62rem; opacity: 0.35;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; justify-content: space-between; align-items: center;
}
.sr-zone { padding: 0.45rem 1rem 0.45rem 1.8rem; }
.sr-zone .sr-name { font-size: 0.8rem; }
/* Planet row add/zone-toggle controls */
.sr-planet-controls { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.sr-add-btn {
  font-size: 0.68rem; padding: 0.2rem 0.5rem;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 5px;
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7);
  cursor: pointer; white-space: nowrap;
}
.sr-add-btn:hover { background: rgba(255,255,255,0.16); color: white; }
.sr-zones-toggle {
  font-size: 0.68rem; padding: 0.2rem 0.45rem;
  border: 1px solid rgba(91,141,239,0.35); border-radius: 5px;
  background: rgba(91,141,239,0.1); color: rgba(91,141,239,0.9);
  cursor: pointer; white-space: nowrap;
}
.sr-zones-toggle:hover { background: rgba(91,141,239,0.22); }
.sr-zones-toggle.open { background: rgba(91,141,239,0.22); }
/* Indent zone items under their parent planet */
.sr-item.sr-zone { background: rgba(255,255,255,0.015); }

/* ── Quick action buttons ─────────────────────────────────────────────────── */
#quick-actions {
  position: fixed; top: 10px; left: 10px; z-index: 600;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.qa-btn {
  background: rgba(0,0,0,0.38); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 9px;
  color: rgba(255,255,255,0.85); font-size: 0.75rem; padding: 0.28rem 0.65rem;
  cursor: pointer; transition: background 0.15s, opacity 0.15s; white-space: nowrap;
}
.qa-btn:hover { background: rgba(0,0,0,0.55); color: white; }
/* hide my-location button if already present */
#qa-myloc.hidden { display: none; }

/* ── Meeting scheduler button (lives in #controls toolbar, top-right) ──────── */
#meeting-btn {
  height: 34px; border-radius: 9px; padding: 0 0.9rem; border: none; cursor: pointer;
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
  background: #3563c8; color: #fff;
  display: flex; align-items: center; gap: 0.3rem;
  transition: background 0.2s;
}
#meeting-btn:hover { background: #4472d8; }

/* Settings button notification dot */
#settings-ctl { position: relative; }
#settings-ctl .notif-dot {
  display: none; position: absolute; top: 4px; right: 4px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #f5a623; border: 1px solid rgba(0,0,0,0.3);
  pointer-events: none;
}
#settings-ctl.has-notif .notif-dot { display: block; }

#meeting-panel {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 700;
  background: #0d0d1c; color: white; max-height: 55vh; overflow-y: auto;
  transform: translateY(100%); transition: transform 0.35s ease;
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}
#meeting-panel.on { transform: translateY(0); }

/* ── Full-screen scheduler mode (?schedule=fullscreen) ─────────────────────── */
body.scheduler-fullscreen #controls,
body.scheduler-fullscreen #cities-wrap,
body.scheduler-fullscreen #add-col,
body.scheduler-fullscreen .placeholder { display: none !important; }
body.scheduler-fullscreen #meeting-panel {
  inset: 0; max-height: 100dvh; height: 100dvh;
  transform: none !important; border-top: none; box-shadow: none;
  overflow-y: auto; z-index: 800;
}
body.scheduler-fullscreen .mp-close { display: none; }
body.scheduler-fullscreen #mp-fullscreen-link { display: none; }
#mp-fullscreen-link {
  background: none; border: none; color: rgba(255,255,255,0.4);
  cursor: pointer; font-size: 0.9rem; padding: 0 0.25rem;
  text-decoration: none; line-height: 1;
}
#mp-fullscreen-link:hover { color: rgba(255,255,255,0.75); }

.mp-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky; top: 0; background: #0d0d1c; z-index: 1;
}
.mp-title { font-weight: 700; font-size: 0.95rem; }
.mp-close { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 1.1rem; }

.mp-grid {
  display: grid; padding: 0.75rem 0; overflow-x: auto;
}
/* columns: time label + one per city */
.mp-row {
  display: contents;
}
.mp-cell {
  padding: 2px 6px; font-size: 0.72rem; min-width: 70px;
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center;
}
.mp-cell:last-child { border-right: none; }
.mp-cell.time-col {
  font-size: 0.68rem; opacity: 0.5; min-width: 80px; justify-content: flex-end;
  padding-right: 8px;
}
.mp-cell.work { background: rgba(76,175,80,0.18); }
.mp-cell.marginal { background: rgba(255,152,0,0.14); }
.mp-cell.rest { background: rgba(244,67,54,0.1); }
.mp-cell.highlight { background: rgba(91,141,239,0.3); font-weight: 700; }
.mp-header-cell {
  font-size: 0.68rem; font-weight: 600; opacity: 0.65; padding: 4px 6px;
  min-width: 70px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mp-header-cell.time-col { min-width: 80px; }
.mp-legend { display: flex; gap: 1rem; padding: 0.5rem 1.25rem; font-size: 0.7rem; opacity: 0.55; }
.mp-leg { display: flex; align-items: center; gap: 0.3rem; }
.mp-leg-dot { width: 8px; height: 8px; border-radius: 2px; }
.mp-controls {
  display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap;
  padding: 0.5rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mp-date-input {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 7px; color: white; font-size: 0.78rem; padding: 0.3rem 0.5rem;
  cursor: pointer; outline: none;
}
.mp-date-input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.6; }
.mp-overlap-btn {
  background: rgba(91,141,239,0.15); border: 1px solid rgba(91,141,239,0.35);
  border-radius: 7px; color: rgba(91,141,239,1); font-size: 0.78rem;
  padding: 0.3rem 0.7rem; cursor: pointer; transition: background 0.2s;
}
.mp-overlap-btn:hover { background: rgba(91,141,239,0.28); }
.mp-overlap-result {
  padding: 0.4rem 1.25rem; font-size: 0.78rem;
}
.mp-overlap-found { color: rgba(76,175,80,0.9); }
.mp-overlap-none { color: rgba(255,152,0,0.9); font-weight: 600; }
.mp-nav-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 7px; color: rgba(255,255,255,0.75); font-size: 0.85rem;
  padding: 0.25rem 0.55rem; cursor: pointer; line-height: 1; transition: background 0.15s;
}
.mp-nav-btn:hover { background: rgba(255,255,255,0.18); }
.mp-days-toggle { display: flex; gap: 2px; }
.mp-days-btn {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; color: rgba(255,255,255,0.70); font-size: 0.72rem;
  padding: 0.25rem 0.5rem; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.mp-days-btn.active { background: #3563c8; border-color: #3563c8; color: #fff; font-weight: 600; }
.mp-days-btn:hover:not(.active) { background: rgba(255,255,255,0.12); }
.mp-day-header {
  grid-column: 1 / -1; padding: 3px 8px 2px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7);
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky; left: 0;
}

/* ── Settings panel ───────────────────────────────────────────────────────── */
#settings-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 270px;
  background: #0d0d1c; color: white; z-index: 800;
  transform: translateX(100%); transition: transform 0.3s ease;
  overflow-y: auto; box-shadow: -6px 0 32px rgba(0,0,0,0.45);
  border-left: 1px solid rgba(255,255,255,0.07);
}
#settings-panel.on { transform: translateX(0); }
.sp-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.07);
  font-weight: 700; font-size: 0.95rem;
}
.sp-close { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 1.1rem; }
.sp-sec { padding: 0.7rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.sp-sec-title { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.65); margin-bottom: 0.55rem; }
.tog-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.tog-label { font-size: 0.83rem; opacity: 0.82; }
.tog { position: relative; width: 36px; height: 20px; }
.tog input { opacity: 0; width: 0; height: 0; }
.tog-sl {
  position: absolute; inset: 0; border-radius: 20px; background: rgba(255,255,255,0.15);
  cursor: pointer; transition: background 0.2s;
}
.tog-sl::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  border-radius: 50%; background: white; top: 3px; left: 3px; transition: transform 0.2s;
}
.tog input:checked + .tog-sl { background: #5b8def; }
.tog input:checked + .tog-sl::after { transform: translateX(16px); }
.sp-btn {
  width: 100%; padding: 0.5rem; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12); background: none;
  color: rgba(255,255,255,0.75); cursor: pointer; font-size: 0.8rem;
  transition: background 0.2s; text-align: center; margin-bottom: 0.4rem;
}
.sp-btn:hover { background: rgba(255,255,255,0.08); }
.sp-note { font-size: 0.72rem; color: rgba(255,255,255,0.65); line-height: 1.4; margin-top: 0.3rem; }

/* ── Cookie banner ────────────────────────────────────────────────────────── */
/* Cookie bar is now inside settings panel only — hidden elsewhere */
#cookie-bar { display: none; }
.ck-inline {
  background: rgba(245,166,35,0.1); border: 1px solid rgba(245,166,35,0.35);
  border-radius: 9px; padding: 0.65rem 0.75rem; margin-bottom: 0.5rem;
}
.ck-text { font-size: 0.78rem; color: rgba(255,255,255,0.75); margin-bottom: 0.5rem; line-height: 1.4; }
.ck-btns { display: flex; gap: 0.5rem; }
.ck-btn {
  padding: 0.3rem 0.75rem; border-radius: 7px; border: 1px solid rgba(255,255,255,0.2);
  background: none; color: white; cursor: pointer; font-size: 0.75rem; transition: background 0.2s;
}
.ck-btn:hover { background: rgba(255,255,255,0.08); }
.ck-btn.acc { background: #3563c8; border-color: #3563c8; }
.ck-btn.acc:hover { background: #4472d8; border-color: #4472d8; }
/* Advanced section collapsed by default */
.sp-advanced-body { display: none; }
.sp-advanced-body.open { display: block; }
.sp-advanced-toggle {
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
  user-select: none;
}
.sp-advanced-toggle .adv-arrow { font-size: 0.7rem; opacity: 0.5; transition: transform 0.2s; }
.sp-advanced-toggle.open .adv-arrow { transform: rotate(90deg); }
.sp-adv-group-title {
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; opacity: 0.5; margin: 0.9rem 0 0.3rem;
  padding-top: 0.7rem; border-top: 1px solid rgba(255,255,255,0.07);
}
.sp-adv-group-title:first-child { margin-top: 0.2rem; border-top: none; padding-top: 0; }

/* ── UTC Placeholder (shown when no cities selected) ────────────────────── */
#utc-placeholder {
  flex: 1; min-width: 0; height: 100%; position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: background 3.5s ease;
}
#utc-placeholder.hidden { display: none; }
#cities-wrap.horiz #utc-placeholder { flex: 1; width: 100%; height: auto; min-height: 0; }
.ph-center { text-align: center; }
.ph-time {
  font-size: 3rem; font-weight: 200; letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 2px 14px rgba(0,0,0,0.45);
}
.ph-dow {
  font-size: 0.82rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(255,255,255,0.65);
  margin-top: 0.35rem; text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}
.ph-label {
  font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.4); margin-top: 0.12rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.ph-hint {
  position: absolute; bottom: 2.5rem;
  font-size: 0.72rem; color: rgba(255,255,255,0.35);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3); pointer-events: none;
}

/* ── Dark / light mode theme ───────────────────────────────────────────────
   Menus and the empty-state body background adapt to system preference.
   Sky columns always render true sky colours regardless of mode.         */
html.light-mode, html.light-mode body { background: #e8edf5; color: rgba(0,0,0,0.88); }
html.light-mode #cities-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); }
html.light-mode #add-col { background: rgba(0,0,0,0.05); border-left-color: rgba(0,0,0,0.15); color: rgba(0,0,0,0.5); }
html.light-mode #add-col:hover { background: rgba(0,0,0,0.1); color: rgba(0,0,0,0.82); }
html.light-mode #manage-btn { background: rgba(240,242,248,0.95); border-color: rgba(0,0,0,0.15); color: rgba(0,0,0,0.65); }
html.light-mode #manage-btn.active { background: rgba(53,99,200,0.15); border-color: rgba(53,99,200,0.4); color: #3563c8; }
html.light-mode #manage-bar { background: rgba(240,242,248,0.97); border-top-color: rgba(0,0,0,0.1); }
/* Settings panel */
html.light-mode #settings-panel { background: #f5f6fa; color: rgba(0,0,0,0.88); border-left-color: rgba(0,0,0,0.1); }
html.light-mode .sp-head { border-bottom-color: rgba(0,0,0,0.1); }
html.light-mode .sp-close { color: rgba(0,0,0,0.42); }
html.light-mode .sp-sec { border-bottom-color: rgba(0,0,0,0.07); }
html.light-mode .sp-btn { border-color: rgba(0,0,0,0.14); color: rgba(0,0,0,0.68); }
html.light-mode .sp-btn:hover { background: rgba(0,0,0,0.07); }
html.light-mode .sp-note { color: rgba(0,0,0,0.65); }
html.light-mode .tog-sl { background: rgba(0,0,0,0.14); }
html.light-mode .ck-inline { background: rgba(245,166,35,0.08); border-color: rgba(245,166,35,0.4); }
html.light-mode .ck-text { color: rgba(0,0,0,0.75); }
html.light-mode .ck-btn { border-color: rgba(0,0,0,0.18); color: rgba(0,0,0,0.8); }
/* Search modal */
html.light-mode #search-box { background: #f5f6fa; border-color: rgba(0,0,0,0.07); }
html.light-mode #search-head { border-bottom-color: rgba(0,0,0,0.08); }
html.light-mode #search-input { color: rgba(0,0,0,0.85); }
html.light-mode #search-input::placeholder { color: rgba(0,0,0,0.32); }
html.light-mode #search-close { color: rgba(0,0,0,0.42); }
html.light-mode .sr-item { border-bottom-color: rgba(0,0,0,0.05); }
html.light-mode .sr-item:hover { background: rgba(0,0,0,0.05); }
html.light-mode .sr-item.planet { border-top-color: rgba(0,0,0,0.1); background: rgba(0,0,0,0.02); }
html.light-mode .sr-name { color: rgba(0,0,0,0.85); }
html.light-mode .sr-sub { color: rgba(0,0,0,0.68); }
html.light-mode .sr-tz { color: rgba(0,0,0,0.58); }
html.light-mode .sp-sec-title { color: rgba(0,0,0,0.65); }
html.light-mode #tour-popup .tp-text  { color: rgba(0,0,0,0.78); }
html.light-mode #tour-popup .tp-count { color: rgba(0,0,0,0.60); }
html.light-mode .sr-section-header { border-top-color: rgba(0,0,0,0.08); }
html.light-mode .sr-add-btn { border-color: rgba(0,0,0,0.2); background: rgba(0,0,0,0.05); color: rgba(0,0,0,0.65); }
html.light-mode .sr-add-btn:hover { background: rgba(0,0,0,0.12); color: rgba(0,0,0,0.85); }
html.light-mode .sr-zones-toggle { background: rgba(91,141,239,0.08); border-color: rgba(91,141,239,0.4); }
html.light-mode .sr-zones-toggle:hover, html.light-mode .sr-zones-toggle.open { background: rgba(91,141,239,0.18); }
html.light-mode .sr-item.sr-zone { background: rgba(0,0,0,0.015); }
/* Meeting panel */
html.light-mode #meeting-panel { background: #f5f6fa; color: rgba(0,0,0,0.88); border-top-color: rgba(0,0,0,0.1); }
html.light-mode .mp-head { background: #f5f6fa; border-bottom-color: rgba(0,0,0,0.08); }
html.light-mode .mp-close { color: rgba(0,0,0,0.42); }
html.light-mode .mp-controls { border-bottom-color: rgba(0,0,0,0.07); }
html.light-mode .mp-date-input { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); color: rgba(0,0,0,0.85); }
html.light-mode .mp-date-input::-webkit-calendar-picker-indicator { filter: none; opacity: 0.5; }
html.light-mode .mp-cell { border-right-color: rgba(0,0,0,0.06); }
html.light-mode .mp-header-cell { border-bottom-color: rgba(0,0,0,0.1); }
html.light-mode .mp-day-header { background: rgba(0,0,0,0.05); color: rgba(0,0,0,0.65); border-color: rgba(0,0,0,0.08); }
html.light-mode .mp-nav-btn { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); color: rgba(0,0,0,0.65); }
html.light-mode .mp-nav-btn:hover { background: rgba(0,0,0,0.12); }
html.light-mode .mp-days-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); color: rgba(0,0,0,0.65); }
html.light-mode .mp-days-btn.active { background: #3563c8; border-color: #3563c8; color: #fff; }
/* Quick action buttons */
html.light-mode .qa-btn { background: rgba(255,255,255,0.82); border-color: rgba(0,0,0,0.2); color: rgba(0,0,0,0.72); }
html.light-mode .qa-btn:hover { background: rgba(255,255,255,0.97); color: rgba(0,0,0,0.9); }
/* Splash + tour */
html.light-mode #splash-box { background: #f5f6fa; color: rgba(0,0,0,.88); border-color: rgba(0,0,0,.12); }
html.light-mode #tour-popup { background: #f5f6fa; color: rgba(0,0,0,.88); border-color: rgba(0,0,0,.15); }
html.light-mode .splash-btn-ghost { color: rgba(0,0,0,.72); border-color: rgba(0,0,0,.2); }
html.light-mode .splash-btn-ghost:hover { background: rgba(0,0,0,.05); }

/* ── Splash modal ─────────────────────────────────────────────────────────── */
#splash-modal {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(0,0,0,0.82); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
#splash-modal.off { display: none; }
#splash-box {
  background: #12121f; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px; padding: 2rem 2.2rem; max-width: 400px; width: 90%;
  text-align: center;
}
#splash-box h2 { margin: 0 0 .5rem; font-size: 1.5rem; }
.splash-sub { font-size: .82rem; color: rgba(255,255,255,0.62); margin: 0 0 .9rem; }
html.light-mode .splash-sub { color: rgba(0,0,0,0.56); }
.splash-bullets {
  text-align: left; font-size: .8rem; color: rgba(255,255,255,0.78); line-height: 1.7;
  margin: 0 0 1.3rem; padding-left: 1.1rem;
}
html.light-mode .splash-bullets { color: rgba(0,0,0,0.70); }
.splash-bullets li { margin-bottom: .1rem; }
.splash-btns   { display: flex; gap: .75rem; justify-content: center; }
.splash-btn-primary {
  padding: .55rem 1.3rem; border-radius: 8px; border: none;
  background: #3563c8; color: #fff; font-size: .85rem; cursor: pointer;
}
.splash-btn-primary:hover { background: #4472d8; }
.splash-btn-ghost {
  padding: .55rem 1.1rem; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18); background: none;
  color: rgba(255,255,255,.72); font-size: .85rem; cursor: pointer;
}
.splash-btn-ghost:hover { background: rgba(255,255,255,.07); }
.splash-tour-link { margin-top: .9rem; font-size: .75rem; }
.splash-tour-link a {
  color: rgba(255,255,255,.58); text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.25);
}
.splash-tour-link a:hover { color: rgba(255,255,255,.82); }
html.light-mode .splash-tour-link a {
  color: rgba(0,0,0,.55); border-bottom-color: rgba(0,0,0,.2);
}
html.light-mode .splash-tour-link a:hover { color: rgba(0,0,0,.75); }

/* ── Welcome-back banner ──────────────────────────────────────────────────── */
#welcome-back {
  position: fixed; top: 52px; left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: rgba(18,18,31,0.95); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 0.45rem 0.9rem; z-index: 9000;
  display: flex; align-items: center; gap: 0.7rem;
  font-size: 0.78rem; opacity: 0; transition: opacity 0.3s, transform 0.3s;
  pointer-events: none; white-space: nowrap;
}
#welcome-back.wb-on {
  opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto;
}
#welcome-back.wb-off { display: none; }
#wb-close {
  background: none; border: none; color: rgba(255,255,255,0.4);
  cursor: pointer; font-size: 0.75rem; padding: 0 0 0 0.3rem; line-height: 1;
}

/* ── Tour overlay / spotlight / popup ──────────────────────────────────────── */
#tour-overlay {
  position: fixed; inset: 0; z-index: 9600; cursor: pointer; display: none;
}
#tour-overlay.on { display: block; }
#tour-spotlight {
  position: fixed; z-index: 9601; border-radius: 8px; pointer-events: none;
  box-shadow: 0 0 0 2000px rgba(0,0,0,0.76);
  transition: left .3s, top .3s, width .3s, height .3s;
  outline: 2px solid rgba(91,141,239,0.7);
  display: none;
}
#tour-popup {
  position: fixed; z-index: 9602; pointer-events: all; display: none;
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px; padding: 1.1rem 1.2rem; max-width: 270px; min-width: 210px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#tour-popup .tp-title { font-size: .88rem; font-weight: 600; margin: 0 0 .35rem; }
#tour-popup .tp-text  { font-size: .78rem; color: rgba(255,255,255,0.8); line-height: 1.5; margin: 0 0 .9rem; }
#tour-popup .tp-footer { display: flex; align-items: center; gap: .5rem; }
#tour-popup .tp-count  { font-size: .7rem; color: rgba(255,255,255,0.65); flex: 1; }
.tp-btn { padding: .38rem .8rem; border-radius: 7px; font-size: .78rem; cursor: pointer; border: none; }
.tp-btn-prev { background: rgba(255,255,255,.1); color: rgba(255,255,255,.7); }
.tp-btn-prev:hover { background: rgba(255,255,255,.16); }
.tp-btn-next { background: #3563c8; color: #fff; }
.tp-btn-next:hover { background: #4472d8; }
#tour-cancel-tip {
  position: fixed; z-index: 9700; pointer-events: none;
  background: rgba(30,30,50,0.96); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; padding: .5rem .85rem; font-size: .75rem; opacity: 0;
  transition: opacity .3s; white-space: nowrap;
  top: 52px; right: 48px;
}
#tour-cancel-tip.show { opacity: 1; }

/* ── Skip navigation link ─────────────────────────────────────────────────── */
.skip-link {
  position: fixed; top: -100px; left: 10px; z-index: 99999;
  background: #1a1a2e; color: #fff; padding: .5rem 1rem;
  border-radius: 6px; font-size: .85rem; text-decoration: none;
  border: 2px solid rgba(91,141,239,0.9);
  transition: top .15s;
}
.skip-link:focus { top: 10px; }

/* ── Custom toggle — keyboard focus ring ──────────────────────────────────── */
.tog input:focus-visible ~ .tog-sl {
  outline: 2px solid rgba(91,141,239,0.9);
  outline-offset: 2px;
}

/* ── Screen-reader-only text ──────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* ── Layout button pulse animation (triggered by auto-switch) ─────────────── */
@keyframes layout-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(91,141,239,0.9); }
  40%  { box-shadow: 0 0 0 8px rgba(91,141,239,0.3); }
  100% { box-shadow: 0 0 0 0 rgba(91,141,239,0); }
}
#layout-ctl.auto-switched {
  animation: layout-pulse 0.7s ease-out;
}

/* ── Focused city card keyboard navigation ────────────────────────────────── */
.city-col:focus {
  outline: 2px solid rgba(91,141,239,0.8);
  outline-offset: -2px;
}
.city-col:focus-within {
  outline: 2px solid rgba(91,141,239,0.4);
  outline-offset: -2px;
}

/* Accessible detail panel — visually hidden, read by screen reader on Down-arrow focus */
.city-a11y-details {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: normal; border-width: 0;
}

/* ── i18n: RTL support ────────────────────────────────────────────────────── */
[dir="rtl"] #settings-panel {
  right: auto; left: 0;
  transform: translateX(-100%);
  border-left: none; border-right: 1px solid rgba(255,255,255,0.07);
  box-shadow: 6px 0 32px rgba(0,0,0,0.45);
}
[dir="rtl"] #settings-panel.on { transform: translateX(0); }
[dir="rtl"] #controls { right: auto; left: 10px; }
[dir="rtl"] #quick-actions { left: auto; right: 10px; }
[dir="rtl"] #search-input, [dir="rtl"] .city-name-input { text-align: right; }
[dir="rtl"] .tog-row { flex-direction: row-reverse; }
[dir="rtl"] .work-indicator { flex-direction: row-reverse; }
[dir="rtl"] #tour-popup { text-align: right; }
[dir="rtl"] .tp-footer { flex-direction: row-reverse; }

/* ── i18n: responsive text for long translations ──────────────────────────── */
.tog-label { flex:1; min-width:0; word-break:break-word; hyphens:auto; overflow-wrap:break-word; }
.sp-sec-title { white-space:normal; word-break:break-word; }
.mp-header-cell { white-space:normal; word-break:break-word; }
#meeting-btn { white-space:normal; text-align:center; }
:lang(ja), :lang(zh), :lang(ko) { line-height:1.5; word-break:keep-all; }
:lang(ar)  { font-size:105%; }
:lang(hi)  { line-height:1.6; }

.sp-lang-select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 7px; color: inherit;
  font-size: 0.8rem; padding: 0.25rem 0.4rem; cursor: pointer;
}
html.light-mode .sp-lang-select { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); }

/* ── Compact mode ─────────────────────────────────────────────────────────── */
#cities-wrap.compact .hourly-wrap    { display: none !important; }
#cities-wrap.compact .city-weather   { display: none !important; }
#cities-wrap.compact .city-sun       { display: none !important; }
#cities-wrap.compact .city-moon      { display: none !important; }
#cities-wrap.compact .work-indicator { display: none !important; }
#cities-wrap.compact .city-ping      { display: none !important; }
#cities-wrap.compact .sky-label      { display: none !important; }
#cities-wrap.compact { grid-auto-rows: minmax(130px, 1fr); }
#cities-wrap.compact.horiz .city-col { height: 80px; }

/* ── Skeleton shimmer (weather loading) ───────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.city-col.weather-loading .city-weather {
  display: block !important; min-height: 1.1rem; border-radius: 4px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
body.light .city-col.weather-loading .city-weather {
  background: linear-gradient(90deg,
    rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.10) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* ── Custom confirm modal ─────────────────────────────────────────────────── */
#modal-confirm { position:fixed;inset:0;background:rgba(0,0,0,0.6);z-index:2000;
  display:flex;align-items:center;justify-content:center; }
#mc-box { background:#1a1a2e;border:1px solid rgba(255,255,255,0.12);border-radius:12px;
  padding:1.2rem 1.4rem;max-width:340px;width:90%;box-shadow:0 8px 40px rgba(0,0,0,0.5); }
.mc-title { font-size:0.95rem;font-weight:700;margin-bottom:0.4rem; }
.mc-text  { font-size:0.8rem;opacity:0.65;margin-bottom:1rem; }
.mc-actions { display:flex;gap:0.5rem;justify-content:flex-end; }
.cc-btn-destructive { background:rgba(220,60,60,0.2);border-color:rgba(220,60,60,0.55);color:rgba(255,120,120,0.9); }
.cc-btn-destructive:hover { background:rgba(220,60,60,0.35); }
html.light-mode #mc-box { background:#f5f6fa; }

/* ── HDTN ML forecast row ─────────────────────────────────────────────────── */
.hdtn-forecast { font-size: 0.6rem; margin-top: 0.1rem;
  font-variant-numeric: tabular-nums; }
.hdtn-safe   { color: rgba(76, 175, 80, 0.9); }
.hdtn-warn   { color: rgba(255, 160, 0, 0.95); }
.hdtn-danger { color: rgba(240, 60, 60, 0.95); }
#cities-wrap.compact .hdtn-forecast { display: none !important; }

/* ── Meeting panel Ka column ──────────────────────────────────────────────── */
.mp-ka-cell { min-width: 28px; border-radius: 2px; display: flex;
  align-items: center; justify-content: center; }
.mp-ka-hdr  { min-width: 28px; font-size: .55rem; opacity: .55; text-align: center;
  font-weight: 600; padding: 4px 2px;
  border-bottom: 1px solid rgba(255,255,255,0.08); }

/* ── Best windows result ──────────────────────────────────────────────────── */
.mp-signal-result { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
.mp-window-item { display: flex; gap: 0.5rem; padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05); align-items: baseline;
  cursor: pointer; }
.mp-window-item:last-child { border-bottom: none; }
.mp-window-item:hover { background: rgba(255,255,255,0.04); }
.mp-window-rank { color: rgba(255,255,255,0.4); min-width: 1rem; flex-shrink: 0; }
.mp-window-time { font-weight: 600; white-space: nowrap; }
.mp-window-meta { opacity: 0.7; font-size: 0.68rem; }
html.light-mode .mp-window-item:hover { background: rgba(0,0,0,0.04); }
html.light-mode .mp-window-rank { color: rgba(0,0,0,0.3); }

/* ── Forecast API URL input ───────────────────────────────────────────────── */
.sp-input {
  width: 100%; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 7px;
  color: white; font-size: 0.72rem; padding: .35rem .5rem;
  outline: none; font-family: monospace; margin-top: .3rem;
}
.sp-input:focus { border-color: rgba(91,141,239,0.6); }
html.light-mode .sp-input { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.14); color: rgba(0,0,0,0.85); }

/* ── Responsive: narrow/tablet screens auto-switch to horizontal ──────────── */
/* CSS breakpoint at 768px (tablet); JS ResizeObserver also triggers at this width.
   The 'vert-forced' class overrides the CSS auto-switch when user picks vertical manually.
   The 'horiz-forced' class overrides when user picks horizontal manually. */
@media (max-width: 768px) {
  #cities-wrap:not(.vert-forced) {
    flex-direction: column; overflow-x: hidden; overflow-y: auto;
  }
  #cities-wrap:not(.vert-forced) .city-col {
    flex: 0 0 auto; min-width: unset; max-width: unset; width: 100%;
    min-height: 80px; max-height: 100px; display: grid; grid-template-rows: unset;
    grid-template-columns: 1fr 165px 20px;
    border-right: none; border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  #cities-wrap:not(.vert-forced) .city-sky { /* grid column 1 */ }
  #cities-wrap:not(.vert-forced) .city-info { width: unset; min-height: 80px; max-height: 100px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; }
  #cities-wrap:not(.vert-forced) .hourly-labels { display: none; }
  #cities-wrap:not(.vert-forced) #add-col { width: 100%; height: 48px; flex: 0 0 48px; }
  /* Vertical hourly bar: strip fills full card height in the 3rd grid column */
  #cities-wrap:not(.vert-forced) .hourly-wrap { height: 100%; width: 100%; position: relative; }
  #cities-wrap:not(.vert-forced) .hourly-bar {
    flex-direction: column; height: 100%; width: 100%;
  }
  #cities-wrap:not(.vert-forced) .hourly-bar .hour-cell {
    flex: 1; height: unset; width: 100%;
  }
  /* Now-line becomes a horizontal rule across the vertical bar */
  #cities-wrap:not(.vert-forced) .hourly-bar .now-line {
    top: unset; left: 0; width: 100%; height: 2px;
    transform: translateY(-50%);
  }
  #cities-wrap:not(.vert-forced) .hourly-bar .now-line::before { display: none; }
}
@media (max-width: 480px) {
  #cities-wrap:not(.vert-forced) .city-col {
    min-height: 68px; max-height: 88px;
    grid-template-columns: 68px 1fr; /* sky | info; drop the tiny 18px hourly column */
  }
  #cities-wrap:not(.vert-forced) .city-info {
    min-height: 68px; max-height: 88px; overflow: hidden;
  }
  #cities-wrap:not(.vert-forced) .hourly-wrap { display: none; }
}
/* Short-screen / landscape iPhone: keep cards compact */
@media (max-height: 600px) and (max-width: 768px) {
  #cities-wrap:not(.vert-forced) .city-col { min-height: 60px; max-height: 72px; }
  #cities-wrap:not(.vert-forced) .city-info { min-height: 60px; max-height: 72px; overflow: hidden; }
  #cities-wrap:not(.vert-forced) .hourly-wrap { display: none; }
}
@media (max-width: 768px) {
  #quick-actions { top: 55px; }
  .font-ctl { display: none; }
  #meeting-btn span[data-i18n] { display: none; }
  #settings-panel { width: 100%; border-left: none; }
  .splash-tour-link { display: none; }
}

/* ── SLM AI Assistant result panel ─────────────────────────────────────────── */
#mp-llm-result { margin-top: .5rem; }
.mp-llm-loading {
  display: flex; align-items: center; gap: .5rem;
  font-size: .72rem; opacity: .6; padding: .4rem .2rem;
  animation: mp-llm-pulse 1.6s ease-in-out infinite;
}
@keyframes mp-llm-pulse { 0%,100% { opacity:.4; } 50% { opacity:.75; } }
.mp-llm-result {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px; padding: .5rem .65rem; font-size: .72rem; line-height: 1.55;
}
.mp-llm-icon { font-size: .8rem; opacity: .5; margin-bottom: .2rem; }
.mp-llm-text { opacity: .88; }
.mp-llm-feedback {
  display: flex; gap: .4rem; margin-top: .4rem; align-items: center; font-size: .75rem;
}
.mp-llm-thumb {
  background: none; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px;
  padding: .15rem .4rem; cursor: pointer; font-size: .8rem; color: inherit;
  transition: background .15s, border-color .15s;
}
.mp-llm-thumb:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }
.mp-llm-feedback-done { font-size: .7rem; opacity: .55; }
.mp-llm-error {
  font-size: .7rem; opacity: .55; padding: .3rem .2rem;
  display: flex; align-items: center; gap: .4rem;
}
/* Light mode overrides */
html.light-mode .mp-llm-result {
  background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1);
}
html.light-mode .mp-llm-thumb {
  border-color: rgba(0,0,0,0.18); color: rgba(0,0,0,0.75);
}
html.light-mode .mp-llm-thumb:hover { background: rgba(0,0,0,0.06); }

/* ── Reduced motion: respect OS preference + manual settings toggle ───────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* Manual override class applied by settings toggle (html.reduce-motion) */
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}
