/* 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);
  padding: 0.35rem 0; /* 58.3 */
}
.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.75rem; font-weight: 600; color: rgba(255,255,255,0.75); } /* 58.10 reduced */

/* 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; color: rgba(255,255,255,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; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.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; }
/* Container for holiday badges — holds national + international pills */
#cities-wrap .holiday-badge-wrap {
  display: flex; flex-wrap: wrap; gap: 0.2rem; margin-top: 0.2rem;
}
/* National public holiday pill — warm yellow */
.holiday-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  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);
}
/* UN international day / week pill — blue (UN brand colour) */
.holiday-badge-intl {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.62rem; padding: 0.08rem 0.4rem;
  border-radius: 99px; border: 1px solid rgba(100,160,255,0.45);
  background: rgba(70,130,255,0.1); color: rgba(130,185,255,0.9);
}
.los-warn { font-size: 0.65rem; color: rgba(255,160,60,0.9); margin-top: 0.15rem; }
.planet-zone { font-size: 0.68rem; 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 when cities exist */
  height: 34px; border-radius: 9px; padding: 0 0.9rem; border: none; cursor: pointer;
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
  background: rgba(0,0,0,0.35); color: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  align-items: center; gap: 0.35rem; transition: background 0.2s;
}
#manage-btn.visible { display: flex; }
#manage-btn:hover { background: rgba(0,0,0,0.55); }
#manage-btn.active { background: rgba(91,141,239,0.25); 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: 80px; max-height: 100px; 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: 80px; max-height: 100px; overflow: hidden; justify-content: flex-start; display: flex; flex-direction: column; }
/* B1: hourly bar becomes a vertical strip (full height of the row) */
#cities-wrap.horiz .hourly-wrap { height: 100%; width: 100%; position: relative; }
#cities-wrap.horiz .hourly-bar { flex-direction: column; height: 100%; width: 100%; }
#cities-wrap.horiz .hourly-bar .hour-cell { flex: 1; height: unset; width: 100%; }
#cities-wrap.horiz .hourly-bar .now-line { top: unset; left: 0; width: 100%; height: 2px; transform: translateY(-50%); }
#cities-wrap.horiz .hourly-bar .now-line::before { display: none; }
#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: 850;
}
.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: 40vh; overflow-y: auto; scrollbar-width: thin; }

/* ── Advanced city search ─────────────────────────────────────────────────── */
#search-advanced { border-top: 1px solid rgba(255,255,255,0.07); }
.adv-city-toggle {
  width: 100%; background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.45); font-size: 0.75rem; padding: 0.55rem 1rem;
  text-align: left; display: flex; align-items: center; gap: 0.4rem;
  transition: color 0.15s;
}
.adv-city-toggle:hover { color: rgba(255,255,255,0.75); }
.adv-city-toggle[aria-expanded="true"] { color: rgba(255,255,255,0.75); }
#adv-city-panel { padding: 0.5rem 0.75rem 0.75rem; display: flex; flex-direction: column; gap: 0.45rem; }
#adv-country-select, #adv-city-input {
  width: 100%; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px; color: white; font-size: 0.8rem; padding: 0.4rem 0.6rem;
  outline: none; font-family: inherit;
}
#adv-country-select option { background: #1a1a2e; color: white; }
#adv-city-input:disabled { opacity: 0.35; cursor: default; }
#adv-city-input:focus, #adv-country-select:focus { border-color: rgba(91,141,239,0.6); }
#adv-city-results { max-height: 30vh; overflow-y: auto; scrollbar-width: thin; }
.adv-city-item {
  padding: 0.5rem 0.4rem; cursor: pointer; font-size: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.5rem;
  border-radius: 5px; transition: background 0.1s;
}
.adv-city-item:hover { background: rgba(255,255,255,0.07); }
.adv-city-tz { font-size: 0.68rem; opacity: 0.5; text-align: right; }

/* Light mode */
html.light-mode .adv-city-toggle { color: rgba(0,0,0,0.4); }
html.light-mode .adv-city-toggle:hover,
html.light-mode .adv-city-toggle[aria-expanded="true"] { color: rgba(0,0,0,0.7); }
html.light-mode #adv-country-select,
html.light-mode #adv-city-input { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12); color: rgba(0,0,0,0.85); }
html.light-mode #adv-country-select option { background: #f5f6fa; color: rgba(0,0,0,0.85); }
html.light-mode #search-advanced { border-top-color: rgba(0,0,0,0.08); }
html.light-mode .adv-city-item:hover { background: rgba(0,0,0,0.05); }
.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); }

/* ── Controls toolbar separator ──────────────────────────────────────────── */
.ctl-sep {
  width: 1px; background: rgba(255,255,255,0.15); align-self: stretch; margin: 4px 2px;
}
/* hide my-location button if already present */
#qa-myloc.hidden { display: none; }

/* ── More menu (mobile overflow dropdown) ─────────────────────────────────── */
#more-btn { display: none !important; }
#more-menu {
  position: fixed; top: 50px; right: 10px; z-index: 900;
  background: rgba(12,12,28,0.97); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 0.3rem; min-width: 160px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  display: none; flex-direction: column; gap: 2px;
}
#more-menu.on { display: flex; }
.mm-btn {
  background: none; border: none; color: rgba(255,255,255,0.85);
  cursor: pointer; border-radius: 8px; padding: 0.5rem 0.75rem;
  font-size: 0.82rem; display: flex; align-items: center; gap: 0.5rem;
  text-align: left; width: 100%; transition: background 0.15s;
}
.mm-btn:hover { background: rgba(255,255,255,0.1); }
.mm-sep { height: 1px; background: rgba(255,255,255,0.1); margin: 0.25rem 0; }
.mm-font-row { display: flex; gap: 4px; }
.mm-font-btn { flex: 1; justify-content: center; font-weight: 700; font-size: 0.78rem; }
#mm-manage { display: none; }
#mm-manage.visible { display: flex; }

/* ── 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-back-btn { display: none; }
body.scheduler-fullscreen .mp-back-btn {
  display: inline-flex; align-items: center;
  color: rgba(255,255,255,0.5); text-decoration: none;
  font-size: 0.9rem; padding: 0 0.25rem; line-height: 1;
}
body.scheduler-fullscreen .mp-back-btn:hover { color: rgba(255,255,255,0.85); }
html.light-mode body.scheduler-fullscreen .mp-back-btn { color: rgba(0,0,0,0.5); }
html.light-mode body.scheduler-fullscreen .mp-back-btn:hover { color: rgba(0,0,0,0.85); }

.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: 4px 6px; font-size: 0.72rem; min-width: 70px; /* 58.3 */
  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: 5px 8px 5px 6px; /* 58.3 */
}
.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; color: rgba(255,255,255,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-overlap-header { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.mp-action-btns    { display: flex; gap: 0.4rem; margin-top: 0.35rem; }
.mp-action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  min-width: 4.2rem; padding: 0.22rem 0.55rem;
  font-size: 0.73rem; font-family: inherit;
  background: none; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px; cursor: pointer; color: inherit;
  transition: background 0.15s;
}
.mp-action-btn:hover { background: rgba(255,255,255,0.1); }
html.light-mode .mp-action-btn { border-color: rgba(0,0,0,0.18); }
html.light-mode .mp-action-btn:hover { background: rgba(0,0,0,0.06); }
.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: 3.4rem 1.2rem 1rem; 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; color: rgba(255,255,255,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; }
.sp-segmented { display: flex; border-radius: 7px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15); }
.sp-seg-btn { flex: 1; padding: 0.3rem 0.5rem; font-size: 0.78rem;
  background: transparent; border: none; color: rgba(255,255,255,0.55);
  cursor: pointer; transition: background 0.15s, color 0.15s; }
.sp-seg-btn + .sp-seg-btn { border-left: 1px solid rgba(255,255,255,0.15); }
.sp-seg-btn.active { background: rgba(91,141,239,0.25); color: rgba(255,255,255,0.9); }
.sp-seg-btn:hover:not(.active) { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.8); }
html.light-mode .sp-segmented { border-color: rgba(0,0,0,0.18); }
html.light-mode .sp-seg-btn { color: rgba(0,0,0,0.5); }
html.light-mode .sp-seg-btn + .sp-seg-btn { border-left-color: rgba(0,0,0,0.18); }
html.light-mode .sp-seg-btn.active { background: rgba(53,99,200,0.15); color: rgba(0,0,0,0.85); }
html.light-mode .sp-seg-btn:hover:not(.active) { background: rgba(0,0,0,0.06); color: rgba(0,0,0,0.75); }

/* ── "How it works" explainer panel ─────────────────────────────────────── */
#sp-hiw-panel { margin-top: .4rem; }
.sp-hiw-section {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: .6rem 0;
}
.sp-hiw-title {
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255,255,255,.75);
  margin-bottom: .3rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.sp-hiw-body {
  font-size: .71rem;
  color: rgba(255,255,255,.55);
  line-height: 1.55;
}
html.light-mode .sp-hiw-title { color: rgba(0,0,0,.7); }
html.light-mode .sp-hiw-body  { color: rgba(0,0,0,.55); }
html.light-mode .sp-hiw-section { border-bottom-color: rgba(0,0,0,.07); }

/* ── 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(0,0,0,0.08); color: rgba(0,0,0,0.7); }
html.light-mode #manage-btn:hover { background: rgba(0,0,0,0.15); }
html.light-mode #manage-btn.active { background: rgba(53,99,200,0.15); 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 .tog-label { color: rgba(0,0,0,0.82); }
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-legend { color: rgba(0,0,0,0.55); }
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; }
/* More menu light mode */
html.light-mode #more-menu { background: rgba(242,244,250,0.98); border-color: rgba(0,0,0,0.12); }
html.light-mode .mm-btn { color: rgba(0,0,0,0.75); }
html.light-mode .mm-btn:hover { background: rgba(0,0,0,0.07); }
html.light-mode .mm-sep { background: rgba(0,0,0,0.1); }
html.light-mode .ctl-sep { background: rgba(0,0,0,0.15); }
/* 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; position: relative;
}
.splash-close-btn {
  position: absolute;
  top: .75rem; right: .75rem;
  background: none; border: none;
  color: rgba(255,255,255,.7); font-size: 1.4rem;
  cursor: pointer; line-height: 1; padding: .2rem .4rem;
  border-radius: 4px;
}
.splash-close-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
html.light-mode .splash-close-btn { color: rgba(0,0,0,.5); }
html.light-mode .splash-close-btn:hover { color: rgba(0,0,0,.8); background: rgba(0,0,0,.07); }
#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; flex-direction: column; align-items: center; gap: 0; }
.splash-demo-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: rgba(255,255,255,0.55); margin: 0.5rem 0 0.25rem; text-align: center;
}
.splash-demo-row { display: flex; gap: 0.5rem; justify-content: center; }
.splash-btn-alone { margin-top: 0.4rem; }
.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"] #more-menu { right: auto; left: 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;color:rgba(255,255,255,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; }
html.light-mode .mc-text { color: rgba(0,0,0,0.65); }

/* ── 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; flex: 1; }
.mp-window-actions { margin-left: auto; display: flex; gap: 0.2rem; align-items: center; flex-shrink: 0; }
.mp-cal-btn { font-size: 0.58rem; padding: 0.08rem 0.3rem; border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.18); background: transparent; color: inherit;
  cursor: pointer; white-space: nowrap; opacity: 0.65; line-height: 1.4; }
.mp-cal-btn:hover { opacity: 1; background: rgba(255,255,255,0.1); }
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); }
html.light-mode .mp-cal-btn { border-color: rgba(0,0,0,0.2); }
html.light-mode .mp-cal-btn:hover { background: rgba(0,0,0,0.06); }

.mp-local-times { font-size: 0.62rem; color: var(--text-muted, rgba(255,255,255,0.45)); margin-top: 0.1rem; line-height: 1.4; }
html.light-mode .mp-local-times { color: rgba(0,0,0,0.45); }

/* ── Rotation preview (Story 1.3) ──────────────────────────────────────────── */
.mp-rotation { margin-top: 0.6rem; padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.7rem; }
.mp-rotation-hdr { opacity: 0.5; font-weight: 600; margin-bottom: 0.3rem;
  text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.62rem; }
.mp-rotation-tbl { border-collapse: collapse; width: 100%; }
.mp-rotation-tbl th { text-align: left; opacity: 0.45; font-weight: 500;
  padding: 0.1rem 0.4rem 0.1rem 0; font-size: 0.62rem; }
.mp-rotation-tbl td { padding: 0.15rem 0.4rem 0.15rem 0; }
.mp-rotation-tbl .rot-work { color: rgba(76,175,80,0.9); }
.mp-rotation-tbl .rot-rest { color: rgba(244,67,54,0.75); }
.mp-rotation-note { margin-top: 0.35rem; opacity: 0.6; font-size: 0.65rem; }
html.light-mode .mp-rotation { border-top-color: rgba(0,0,0,0.1); }

/* ── Async send-window planner (Story 7.1) ──────────────────────────────────── */
.mp-async-result { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
.mp-async-hdr { font-size: 0.62rem; opacity: 0.5; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.35rem; }
.mp-async-row { display: flex; flex-wrap: wrap; gap: 0.3rem 0.5rem;
  padding: 0.2rem 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  align-items: baseline; }
.mp-async-row:last-child { border-bottom: none; }
.mp-async-name { font-weight: 600; min-width: 5rem; flex-shrink: 0; }
.mp-async-future { color: rgba(76,175,80,0.9); }
.mp-async-past   { color: rgba(255,152,0,0.9); }
.mp-async-arrives { opacity: 0.6; font-size: 0.68rem; }
.mp-async-delay { opacity: 0.55; font-size: 0.65rem; }
.mp-async-note { opacity: 0.5; font-size: 0.68rem; }
html.light-mode .mp-async-row { border-bottom-color: rgba(0,0,0,0.07); }

/* ── 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;
    padding-top: 54px; /* 58.1 — clear fixed toolbar; on scroll container not #app to avoid flex recalc glitch on resize */
  }
  #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: 80px; max-height: 100px; /* 58.2 — taller bands for better touch targets */
    grid-template-columns: 90px 1fr; /* sky | info; wider sky so time never clips */
  }
  #cities-wrap:not(.vert-forced) .city-info {
    min-height: 80px; max-height: 100px; overflow: hidden; /* 58.2 */
  }
  #cities-wrap:not(.vert-forced) .hourly-wrap { display: none; }
  /* Scale time down to fit the narrower sky strip */
  #cities-wrap:not(.vert-forced) .city-time { font-size: 1.5rem; }
  #cities-wrap:not(.vert-forced) .city-dow  { display: none; }
}
/* Very narrow phones (Galaxy S series ~360px, Pixel 5 ~393px) */
@media (max-width: 380px) {
  #cities-wrap:not(.vert-forced) .city-col {
    grid-template-columns: 80px 1fr;
  }
  #cities-wrap:not(.vert-forced) .city-time { font-size: 1.3rem; }
}
/* 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) {
  /* Show hamburger, hide overflow controls in toolbar */
  #more-btn { display: flex !important; }
  #layout-ctl, #share-ctl, #tt-btn, #kbd-btn, #orrery-btn,
  .font-ctl, #settings-ctl { display: none !important; }
  #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-loading-hint { font-size: .68rem; opacity: .7; }
.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); }

/* ── Service status bar (Story 16.3) ─────────────────────────────────────── */
.mp-svc-status { padding: .2rem .6rem .15rem; }
.mp-svc-bar {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  font-size: .65rem; color: rgba(255,255,255,.45); font-family: monospace;
}
html.light-mode .mp-svc-bar { color: rgba(0,0,0,.4); }
.mp-svc-item {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .1rem .35rem; border-radius: 4px; font-size: .64rem;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  cursor: default; color: rgba(255,255,255,.85);
}
html.light-mode .mp-svc-item { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.09); color: rgba(0,0,0,.82); }
.mp-svc-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.25);
}
.mp-svc-item.svc-ok   .mp-svc-dot { background: #4caf50; box-shadow: 0 0 4px rgba(76,175,80,.5); }
.mp-svc-item.svc-warn .mp-svc-dot { background: #ff9800; box-shadow: 0 0 4px rgba(255,152,0,.5); }
.mp-svc-item.svc-err  .mp-svc-dot { background: #f44336; box-shadow: 0 0 4px rgba(244,67,54,.5); }
.mp-svc-refresh {
  background: none; border: none; color: rgba(255,255,255,.3); cursor: pointer;
  font-size: .65rem; padding: .1rem .25rem; border-radius: 4px; transition: color .15s; line-height: 1;
  margin-left: auto;
}
.mp-svc-refresh:hover { color: rgba(255,255,255,.7); }
html.light-mode .mp-svc-refresh { color: rgba(0,0,0,.3); }
html.light-mode .mp-svc-refresh:hover { color: rgba(0,0,0,.7); }

/* ── LLM Provider config (Story 16.1) ────────────────────────────────────── */
.mp-llm-stream {
  font-size: .72rem; line-height: 1.55; opacity: .88;
  white-space: pre-wrap; word-break: break-word;
}
.mp-llm-reasoning {
  margin-top: .5rem; border-top: 1px solid rgba(255,255,255,.07); padding-top: .4rem;
}
.mp-llm-reasoning-toggle {
  background: none; border: none; color: rgba(255,255,255,.4); font-size: .65rem; cursor: pointer;
  padding: 0; display: flex; align-items: center; gap: .3rem; transition: color .15s;
}
.mp-llm-reasoning-toggle:hover { color: rgba(255,255,255,.7); }
.mp-llm-reasoning-body {
  font-size: .65rem; color: rgba(255,255,255,.4); font-family: monospace;
  white-space: pre-wrap; word-break: break-word; margin-top: .35rem; line-height: 1.4;
}
html.light-mode .mp-llm-reasoning { border-color: rgba(0,0,0,.07); }
html.light-mode .mp-llm-reasoning-toggle { color: rgba(0,0,0,.4); }
html.light-mode .mp-llm-reasoning-toggle:hover { color: rgba(0,0,0,.7); }
html.light-mode .mp-llm-reasoning-body { color: rgba(0,0,0,.45); }
.sp-btn.acc {
  background: #3563c8; color: #fff; border-color: #3563c8;
}
.sp-btn.acc:hover { background: #4472d8; border-color: #4472d8; }

/* ── 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;
}

/* ── Recurring ICS series button (Story 2.3) ────────────────────────────── */
.mp-series-ics-btn {
  margin-top: 0.4rem; display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.71rem; background: none;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 6px;
  padding: 0.2rem 0.55rem; cursor: pointer; color: inherit;
}
.mp-series-ics-btn:hover { background: rgba(255,255,255,0.06); }
html.light-mode .mp-series-ics-btn { border-color: rgba(0,0,0,0.18); }
html.light-mode .mp-series-ics-btn:hover { background: rgba(0,0,0,0.05); }

/* ── HDTN ML best-slot label (Story 9.2) ────────────────────────────────── */
.hdtn-best-slot { color: rgba(91,141,239,0.85); font-size: 0.58rem; }

/* ── Pluto badge (Easter egg 19.1) ──────────────────────────────────────── */
.pluto-badge { font-size: 0.58rem; opacity: 0.55; margin-left: 0.25rem;
  vertical-align: middle; cursor: default; }

/* ── Y2K38 countdown chip (Easter egg 19.2) ─────────────────────────────── */
#y2k38-chip {
  position: fixed; bottom: 0.35rem; right: 0.5rem; font-size: 0.52rem;
  color: rgba(255,160,60,0.45); pointer-events: none; z-index: 1; letter-spacing: 0.02em;
}

/* ── Kerbal mode overlay (Easter egg 19.3) ──────────────────────────────── */
#kerbal-overlay {
  position: fixed; inset: 0; z-index: 9000; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); transition: background 0.4s;
}
#kerbal-overlay.active { background: rgba(0,0,0,0.75); pointer-events: all; }
#kerbal-banner {
  text-align: center; padding: 2rem; border-radius: 16px;
  background: rgba(14,18,36,0.95); border: 1px solid rgba(91,141,239,0.35);
  max-width: 480px; opacity: 0; transform: scale(0.8);
  transition: opacity 0.35s, transform 0.35s;
}
#kerbal-overlay.active #kerbal-banner { opacity: 1; transform: scale(1); }
#kerbal-banner h2 { font-size: 1.4rem; margin: 0 0 0.5rem; color: #5b8def; }
#kerbal-banner p  { font-size: 0.82rem; opacity: 0.8; margin: 0.3rem 0; }
#kerbal-banner .kerbal-close {
  margin-top: 1.2rem; padding: 0.4rem 1.2rem; border-radius: 8px;
  background: #3563c8; color: #fff; border: none; cursor: pointer; font-size: 0.82rem;
}

/* ── Apollo 11 banner (Easter egg 19.5) ─────────────────────────────────── */
#apollo-badge {
  position: fixed; bottom: 4rem; right: 1rem; font-size: 0.68rem;
  background: rgba(20,22,40,0.92); border: 1px solid rgba(91,141,239,0.3);
  border-radius: 8px; padding: 0.4rem 0.7rem; z-index: 100;
  color: #c8d4ff; display: none; max-width: 200px; line-height: 1.4;
}
#apollo-badge.visible { display: block; }

/* ── Great Year Drift indicator (Easter egg 19.4) ───────────────────────── */
.great-year-indicator {
  position: fixed; bottom: 1.8rem; right: 0.5rem; font-size: 0.46rem;
  color: rgba(180,160,255,0.25); pointer-events: none; z-index: 1;
  font-style: italic; letter-spacing: 0.01em;
}

/* ── Widget mode (6.2) ─────────────────────────────────────────────────────
   Activated by ?widget=1 URL parameter.
   Hides all chrome: toolbar, manage-bar, add-button.
   The city clock board fills the viewport cleanly for iframe embedding.
   ─────────────────────────────────────────────────────────────────────── */
body.widget-mode #controls,
body.widget-mode #more-menu,
body.widget-mode #manage-bar,
body.widget-mode #add-col,
body.widget-mode .skip-link,
body.widget-mode #cookie-bar,
body.widget-mode #hpop { display: none !important; }

body.widget-mode { overflow: hidden; }

body.widget-mode #app {
  padding-bottom: 0;
  min-height: 100vh;
}

/* Keep the board visible and flush to edges in widget mode */
body.widget-mode #cities-wrap { padding: 0.5rem; }

/* Widget frame: thin accent border on host page */
body.widget-mode::before {
  content: '';
  position: fixed;
  inset: 0;
  border: 2px solid rgba(53, 99, 200, 0.35);
  pointer-events: none;
  z-index: 9999;
  border-radius: 0;
}

/* ── Demo video modal (Story 13.2) ──────────────────────────────────────── */
.vm-overlay {
  position: fixed; inset: 0; z-index: 12000;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s;
}
.vm-overlay.off { display: none; }
.vm-card {
  position: relative;
  width: min(900px, 95vw);
  background: #0d0d1c;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(0,0,0,.7);
}
.vm-close {
  position: absolute; top: .5rem; right: .6rem; z-index: 1;
  background: rgba(0,0,0,.5); border: none; color: #fff;
  font-size: 1.2rem; line-height: 1; width: 2rem; height: 2rem;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.vm-close:hover { background: rgba(255,255,255,.15); }
.vm-iframe-wrap {
  position: relative; width: 100%;
  padding-top: 56.25%; /* 16:9 */
}
.vm-iframe-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: none;
}

/* ── Agent negotiation chat UI (Story 16.4) ─────────────────────────────── */
#mp-agent-result { margin-top: .25rem; }
.mp-agent-chat { padding: .3rem .2rem .5rem; }
.mp-agent-header {
  font-size: .68rem; opacity: .5; font-weight: 600;
  padding: .1rem 0 .5rem; letter-spacing: .03em; text-transform: uppercase;
}
.mp-agent-bubble {
  display: flex; gap: .5rem; margin-bottom: .5rem; align-items: flex-start;
}
.mp-agent-bubble.agent-b { flex-direction: row-reverse; }
.mp-agent-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; letter-spacing: -.02em;
}
.mp-agent-bubble.agent-a .mp-agent-avatar { background: rgba(91,141,239,0.35); color: rgba(91,141,239,1); }
.mp-agent-bubble.agent-b .mp-agent-avatar { background: rgba(76,175,80,0.35); color: rgba(76,175,80,1); }
.mp-agent-body { max-width: 82%; }
.mp-agent-name { font-size: .6rem; opacity: .45; margin-bottom: .12rem; }
.mp-agent-bubble.agent-b .mp-agent-name { text-align: right; }
.mp-agent-text {
  background: rgba(91,141,239,0.12); border: 1px solid rgba(91,141,239,0.2);
  border-radius: 0 8px 8px 8px; padding: .35rem .55rem;
  font-size: .72rem; line-height: 1.5;
}
.mp-agent-bubble.agent-b .mp-agent-text {
  background: rgba(76,175,80,0.12); border-color: rgba(76,175,80,0.2);
  border-radius: 8px 0 8px 8px;
}
.mp-agent-agreed {
  background: #3563c8; color: #fff; border-radius: 8px;
  padding: .5rem .75rem; margin-top: .4rem; font-size: .74rem; line-height: 1.5;
}
.mp-agent-agreed-title { font-weight: 700; margin-bottom: .2rem; font-size: .78rem; }
.mp-agent-agreed-actions {
  display: flex; gap: .4rem; margin-top: .4rem; flex-wrap: wrap;
}
.mp-agent-agreed-btn {
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px; color: #fff; font-size: .68rem; padding: .2rem .5rem;
  cursor: pointer; transition: background .15s;
}
.mp-agent-agreed-btn:hover { background: rgba(255,255,255,0.3); }
.mp-agent-typing {
  display: flex; gap: .22rem; align-items: center; padding: .35rem .55rem;
  background: rgba(255,255,255,0.06); border-radius: 8px; width: fit-content;
}
.mp-agent-typing span {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,0.4);
  animation: mp-agent-dot 1.1s ease-in-out infinite;
}
.mp-agent-typing span:nth-child(2) { animation-delay: .18s; }
.mp-agent-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes mp-agent-dot { 0%,80%,100% { transform: scale(.7); opacity:.4; } 40% { transform: scale(1); opacity:1; } }
.mp-agent-no-slot { font-size: .72rem; opacity: .55; padding: .4rem .2rem; }
/* Light mode overrides */
html.light-mode .mp-agent-text {
  background: rgba(91,141,239,0.08); border-color: rgba(91,141,239,0.25);
}
html.light-mode .mp-agent-bubble.agent-b .mp-agent-text {
  background: rgba(76,175,80,0.08); border-color: rgba(76,175,80,0.25);
}
html.light-mode .mp-agent-typing { background: rgba(0,0,0,0.06); }
html.light-mode .mp-agent-typing span { background: rgba(0,0,0,0.35); }

/* ── 27.1 Drag-to-reorder ─────────────────────────────────────────────────── */
/* Drag handle: hidden by default, shown in manage mode */
.drag-handle {
  position: absolute;
  bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  cursor: grab;
  z-index: 10;
  transition: opacity 0.2s;
  border-radius: 4px;
}
#cities-wrap.manage-mode .drag-handle {
  opacity: 1;
  pointer-events: auto;
}
#cities-wrap.manage-mode .drag-handle:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.1);
}
/* Horiz layout: handle on left-center of row */
#cities-wrap.horiz .drag-handle {
  bottom: auto; left: 8px; top: 50%; transform: translateY(-50%);
}

/* Dragging state: dim the card being dragged */
.city-col.dragging { opacity: 0.35; }

/* Drop target indicators (vertical / default layout) */
.city-col.drag-over-before {
  box-shadow: inset 3px 0 0 #3563c8;
}
.city-col.drag-over-after {
  box-shadow: inset -3px 0 0 #3563c8;
}
/* Drop target indicators (horiz layout) */
#cities-wrap.horiz .city-col.drag-over-before {
  box-shadow: inset 0 3px 0 #3563c8;
}
#cities-wrap.horiz .city-col.drag-over-after {
  box-shadow: inset 0 -3px 0 #3563c8;
}

/* Light mode adjustments */
html.light-mode .drag-handle { color: rgba(0,0,0,0.45); }
html.light-mode #cities-wrap.manage-mode .drag-handle:hover {
  color: rgba(0,0,0,0.8);
  background: rgba(0,0,0,0.07);
}

/* ── 28.1 Time Travel mode ───────────────────────────────────────────────── */
/* Time Travel bar — slides up from bottom like manage-bar */
#tt-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 600;
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: rgba(15,15,30,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,165,0,0.3);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  flex-wrap: wrap;
}
#tt-bar.on { transform: translateY(0); }

.tt-step {
  height: 30px; padding: 0 0.7rem; border-radius: 7px; border: 1px solid rgba(255,165,0,0.4);
  background: rgba(255,165,0,0.12); color: rgba(255,200,100,0.9);
  font-size: 0.75rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
.tt-step:hover { background: rgba(255,165,0,0.25); }

#tt-input {
  height: 30px; padding: 0 0.5rem; border-radius: 7px;
  border: 1px solid rgba(255,165,0,0.4);
  background: rgba(255,165,0,0.08); color: rgba(255,220,120,0.95);
  font-size: 0.75rem; outline: none;
  color-scheme: dark;
}
#tt-input:focus { border-color: rgba(255,165,0,0.7); background: rgba(255,165,0,0.14); }

.tt-live-btn {
  height: 30px; padding: 0 1rem; border-radius: 7px; border: none;
  background: #3563c8; color: #fff; font-size: 0.75rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.tt-live-btn:hover { background: #4472d8; }

/* Time Travel active badge on the toolbar button */
#tt-badge {
  display: none; margin-left: 3px; font-size: 0.6rem; font-weight: 700;
  color: rgba(255,200,80,0.95); vertical-align: middle; line-height: 1;
}
#tt-badge.visible { display: inline; }

/* Time Travel button active state */
#tt-btn.active { color: rgba(255,190,60,0.95); }
#tt-btn.active i { color: rgba(255,190,60,0.95); }

/* Light mode overrides */
html.light-mode #tt-bar {
  background: rgba(240,235,210,0.95);
  border-top-color: rgba(200,130,0,0.3);
}
html.light-mode .tt-step {
  border-color: rgba(180,110,0,0.4);
  background: rgba(255,165,0,0.1);
  color: rgba(140,80,0,0.9);
}
html.light-mode .tt-step:hover { background: rgba(255,165,0,0.2); }
html.light-mode #tt-input {
  border-color: rgba(180,110,0,0.4);
  background: rgba(255,165,0,0.07);
  color: rgba(120,70,0,0.95);
  color-scheme: light;
}
html.light-mode #tt-badge { color: rgba(160,90,0,0.95); }
html.light-mode #tt-btn.active { color: rgba(160,90,0,0.95); }

/* ── Keyboard shortcuts panel ─────────────────────────────────────────────── */

#kbd-panel {
  position: fixed; top: 0; right: 0; width: 320px; height: 100%;
  background: rgba(10,10,22,0.97); border-left: 1px solid rgba(255,255,255,0.1);
  z-index: 900; overflow-y: auto;
  transform: translateX(100%); transition: transform 0.25s ease;
  display: flex; flex-direction: column;
}
#kbd-panel.on { transform: translateX(0); }

.kbd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1rem 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.09);
  font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,0.88);
  position: sticky; top: 0; background: rgba(10,10,22,0.97); z-index: 1;
}

.kbd-close {
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-size: 1rem; cursor: pointer; padding: 0.2rem 0.4rem; border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}
.kbd-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

.kbd-body { padding: 0.8rem 1rem 1.5rem; }

.kbd-section { margin-bottom: 1.2rem; }

.kbd-section-title {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4); text-transform: uppercase; margin-bottom: 0.5rem;
}

.kbd-row {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.82rem; color: rgba(255,255,255,0.75);
}
.kbd-row:last-child { border-bottom: none; }

.kbd-row kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.6rem; height: 1.6rem; padding: 0 0.4rem;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 5px; font-family: monospace; font-size: 0.75rem;
  color: rgba(255,255,255,0.88); font-style: normal; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}

.kbd-row span { margin-left: 0.4rem; flex: 1; }

/* Active button state */
#kbd-btn.active { color: rgba(91,141,239,0.95); }

/* Light mode overrides */
html.light-mode #kbd-panel {
  background: rgba(240,242,255,0.98);
  border-left-color: rgba(0,0,100,0.1);
}
html.light-mode .kbd-head { background: rgba(240,242,255,0.98); color: rgba(0,0,30,0.85); }
html.light-mode .kbd-close { color: rgba(0,0,30,0.45); }
html.light-mode .kbd-close:hover { color: rgba(0,0,30,0.85); background: rgba(0,0,0,0.07); }
html.light-mode .kbd-section-title { color: rgba(0,0,30,0.45); }
html.light-mode .kbd-row { color: rgba(0,0,30,0.72); border-bottom-color: rgba(0,0,0,0.06); }
html.light-mode .kbd-row kbd {
  background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.18);
  color: rgba(0,0,30,0.85); box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

/* ── Solar system orrery panel ────────────────────────────────────────────── */

#orrery-panel {
  position: fixed; bottom: 0; left: 0;
  width: 290px; height: 310px;
  background: rgba(6,6,16,0.97); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0 14px 0 0; z-index: 800;
  transform: translateY(100%); transition: transform 0.25s ease;
  display: flex; flex-direction: column; overflow: hidden;
}
#orrery-panel.on { transform: translateY(0); }

.orrery-head {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.7rem 0.45rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(6,6,16,0.97); position: sticky; top: 0; z-index: 1;
}

.orrery-title {
  font-size: 0.75rem; font-weight: 700;
  color: rgba(255,255,255,0.7); white-space: nowrap;
}

.orrery-date {
  flex: 1; font-size: 0.62rem; font-family: monospace;
  color: rgba(255,255,255,0.35); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}

.orrery-close {
  background: none; border: none; color: rgba(255,255,255,0.4);
  font-size: 0.85rem; cursor: pointer; padding: 0.15rem 0.3rem;
  border-radius: 4px; transition: color 0.15s, background 0.15s; flex-shrink: 0;
}
.orrery-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

#orrery-canvas {
  flex: 1; display: block; width: 100%; cursor: crosshair;
}

/* Active button state */
#orrery-btn.active { color: rgba(255,220,60,0.95); }

/* Light mode */
html.light-mode #orrery-panel {
  background: rgba(10,10,28,0.98);
  border-color: rgba(0,0,60,0.18);
}
html.light-mode .orrery-head { background: rgba(10,10,28,0.98); }

/* ── 58.8 Simple/Advanced settings toggle ────────────────────────────────── */
#settings-panel.settings-simple .adv-only { display: none; }

/* ── 58.9 Contextual info (i) buttons and popover ───────────────────────── */
.info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4); background: none;
  font-size: 0.65rem; font-weight: 700; cursor: pointer;
  color: rgba(255,255,255,0.6); vertical-align: middle; margin-left: 0.3rem;
  line-height: 1; padding: 0;
}
html.light-mode .info-btn { border-color: rgba(0,0,0,0.3); color: rgba(0,0,0,0.5); }
.info-btn:hover { color: rgba(255,255,255,0.9); border-color: rgba(255,255,255,0.7); }
html.light-mode .info-btn:hover { color: rgba(0,0,0,0.8); border-color: rgba(0,0,0,0.6); }
.info-pop {
  position: fixed; z-index: 2000;
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; padding: 0.7rem 0.85rem;
  font-size: 0.76rem; max-width: 260px; line-height: 1.5;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.88);
}
.info-pop-title { font-weight: 700; margin-bottom: 0.35rem; font-size: 0.8rem; display: block; }
.info-pop-links { margin-top: 0.55rem; display: flex; gap: 0.6rem; font-size: 0.72rem; }
.info-pop-links a { color: #4472d8; text-decoration: none; }
.info-pop-links a:hover { text-decoration: underline; }
#info-pop-overlay { display:none; position:fixed; inset:0; z-index:1999; }
#info-pop-overlay.on { display:block; }
