/* TerraCivic look, build 191: near-black and white, hairline lines, wide-spaced capital labels in Montserrat.
   The only color is the party red and blue on the dots (the map itself is unchanged). Loaded after styles.css, so the
   color tokens below retheme everything that already reads them. Night is the default; day is the exact opposite. */
:root {
  --bg: #07080b;
  --surface: #0d0f14;
  --surface-strong: #0d0f14;
  --surface-soft: #151820;
  --line: #ffffff24;
  --line-strong: #ffffff4d;
  --ink: #ffffff;
  --ink-2: #d3d8df;
  --muted: #9ba2ad;
  --dem: #6f8bff;
  --rep: #ff6b78;
  --other: #b48ad6;
  --btn-bg: #ffffff;
  --btn-fg: #07080b;
  --edge: #ffffff;
  --overlay: #07080bf2;
  --sun: #ffffff;
  --control: #ffffff;
  --control-ink: #07080b;
  --font-ui: 'Montserrat', 'Manrope', system-ui, sans-serif;
  --dock-height: 62px;
  --utility-strip-height: 0px;
  --mast-h: 48px;
}
html[data-theme='light'] {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #eceef2;
  --line: #0b0d1024;
  --line-strong: #0b0d1050;
  --ink: #0b0d10;
  --ink-2: #2e333b;
  --muted: #59606a;
  --dem: #2f55e8;
  --rep: #d23a46;
  --other: #7a4fa3;
  --btn-bg: #0b0d10;
  --btn-fg: #ffffff;
  --edge: #0b0d10;
  --overlay: #fffffff2;
  --sun: #0b0d10;
  --control: #0b0d10;
  --control-ink: #ffffff;
}
* { font-family: var(--font-ui) !important; }

/* ---- Header: the name in capitals with the slogan beside it; no mascots, no logo images ---- */
.masthead {
  flex: 0 0 var(--mast-h) !important;
  height: var(--mast-h) !important;
  margin: 0 !important;
  border-width: 0 0 1px !important;
  background: var(--bg) !important;
}
.masthead-stage { justify-content: flex-start; gap: 0; padding: 0 14px; }
.masthead-wordmark {
  display: flex !important;
  align-items: center;
  gap: 12px;
  height: auto !important;
  max-width: none !important;
  aspect-ratio: auto !important;
  filter: none !important;
  color: var(--ink);
  text-decoration: none;
}
.wm-name { font-size: 15px; font-weight: 700; letter-spacing: 0.34em; line-height: 1; white-space: nowrap; }
.wm-slogan { padding-left: 12px; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 0.15em; line-height: 1.3; }
.wm-slogan span { display: block; white-space: nowrap; }
@media (min-width: 901px) {
  :root { --mast-h: 56px; }
  .masthead-stage { padding: 0 22px; }
  .wm-name { font-size: 18px; }
  .wm-slogan { font-size: 11px; }
  .wm-slogan span { display: inline; }
}

/* ---- Search bar: outlined, no yellow ---- */
.scope-summary {
  background: transparent !important;
  color: var(--ink) !important;
  border: 1px solid var(--line-strong) !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.14em !important;
  box-shadow: none !important;
}
.scope-summary:hover, .scope-summary:focus-visible, .scope-summary[aria-expanded='true'] { border-color: var(--ink) !important; box-shadow: none !important; background: transparent !important; color: var(--ink) !important; }
.panel-mode { font-size: 0.7rem !important; font-weight: 600 !important; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.panel-mode.is-quiet { display: none !important; }
.panel-location-search input { background: transparent !important; font-size: 0.78rem !important; letter-spacing: 0.02em; }
.panel-location-search > button { display: grid; place-items: center; background: transparent !important; }
@media (max-width: 900px) {
  .panel-titleline {
    display: flex !important;
    align-items: center;
    gap: 10px !important;
    padding: 6px 8px 6px 10px !important;
    border-color: var(--line-strong) !important;
    border-radius: 16px !important;
    background: var(--surface) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
  }
  .panel-titleline .quick-radius-wrap { flex: 0 0 auto; }
  .panel-titleline .panel-location-search { flex: 1 1 auto; width: auto; min-width: 0; }
  .panel-titleline .panel-edge-left { flex: 0 0 auto; }
  .panel-titleline input, .panel-titleline .panel-location-search input { border-radius: 10px 0 0 10px !important; }
  .panel-location-search > button { border-radius: 0 10px 10px 0 !important; }
}
html[data-theme='light'] .panel-titleline { box-shadow: 0 8px 24px rgba(11, 13, 16, 0.14) !important; }

/* ---- Filter chips: white on black (night) or black on white (day), never green ---- */
.activity-switch button { font-weight: 600 !important; letter-spacing: 0.1em !important; text-transform: uppercase; }
.activity-switch button[aria-pressed='true'] { background: var(--btn-bg) !important; color: var(--btn-fg) !important; }

/* ---- Bottom bar: five tabs ---- */
.app-dock {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  border-top: 1px solid var(--line-strong) !important;
  box-shadow: none !important;
  background: var(--overlay) !important;
}
.dock-action { position: relative; gap: 4px !important; color: var(--muted) !important; background: transparent !important; border-radius: 0 !important; }
.dock-action[aria-expanded='true'], .dock-action[aria-pressed='true'] { color: var(--ink) !important; background: transparent !important; box-shadow: inset 0 2px 0 var(--ink); }
.dock-action:hover { color: var(--ink) !important; }
.dock-action.is-on::after { content: ''; position: absolute; top: 9px; left: calc(50% + 9px); width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.dock-label { font-size: 0.64rem !important; font-weight: 600 !important; letter-spacing: 0.1em; text-transform: uppercase; }
.dock-icon { stroke-width: 1.5 !important; }
.dock-settings-icon i { height: 1.5px !important; }
@media (min-width: 901px) {
  .app-dock { left: 50% !important; right: auto !important; width: min(560px, 100%); transform: translateX(-50%); border: 1px solid var(--line-strong) !important; border-bottom: 0 !important; border-radius: 16px 16px 0 0 !important; }
}

/* Sheets that open above the bar */
.dock-sheet {
  position: fixed;
  z-index: 2250;
  left: 8px; right: 8px;
  bottom: calc(var(--dock-height) + var(--safe-bottom) + 8px);
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
.dock-sheet[hidden] { display: none; }
.sheet-title { margin: 0; color: var(--muted); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.dock-sheet .activity-switch { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100% !important; gap: 8px !important; padding: 0 !important; margin: 0 !important; border: 0 !important; background: transparent !important; overflow: visible !important; }
.dock-sheet .weather-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 !important; border: 0 !important; padding: 0 !important; border-radius: 0 !important; min-height: 0; }
.dock-sheet .activity-switch button { min-height: 46px !important; padding: 8px 6px !important; font-size: 0.7rem !important; border: 1px solid var(--line-strong) !important; border-radius: 12px !important; color: var(--ink) !important; background: transparent !important; }
.dock-sheet .activity-switch button[aria-pressed='true'] { background: var(--btn-bg) !important; color: var(--btn-fg) !important; border-color: var(--btn-bg) !important; }
@media (min-width: 901px) {
  .dock-sheet { left: 50%; right: auto; width: min(440px, calc(100% - 24px)); transform: translateX(-50%); }
}
html[data-theme='light'] .dock-sheet { box-shadow: 0 14px 40px rgba(11, 13, 16, 0.18); }

/* ---- Settings drawer: display switch and build line live here now ---- */
.drawer-theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.drawer-theme-label { color: var(--muted); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.theme-switch { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; gap: 3px; border: 1px solid var(--line-strong); border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; }
.theme-switch span { padding: 8px 16px; border-radius: 9px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
html:not([data-theme='light']) .theme-switch-night, html[data-theme='light'] .theme-switch-day { background: var(--btn-bg); color: var(--btn-fg); }
.drawer-foot { display: flex; align-items: center; gap: 8px; padding: 12px 14px 16px; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.06em; }
.drawer-foot .utility-faq { min-height: 36px; }

/* ---- Welcome overlay and misc ---- */
.welcome h2 { letter-spacing: -0.01em !important; }
.map-legend { border-color: var(--line-strong) !important; }
.alert-bar.minor { background: var(--surface-strong); color: var(--ink); border-color: var(--line-strong); }

/* Small phones (320–359px wide) */
@media (max-width: 359px) {
  .masthead-stage { padding: 0 10px; overflow: hidden; }
  .wm-name { font-size: 14px; letter-spacing: 0.26em; }
  .wm-slogan { display: none; }
  .dock-label { font-size: 0.56rem !important; letter-spacing: 0.04em !important; }
  .panel-titleline .panel-edge-left { display: none !important; }
  .panel-titleline { gap: 8px !important; }
}
.masthead-stage { overflow: hidden; }
@media (max-width: 359px) { .map-legend .legend-basis { display: none; } }

/* ---- Loading screens: the TC letters on a transparent background (white at night, black by day), no box ---- */
.launch-content img { width: min(110px, 30vw) !important; height: auto !important; aspect-ratio: auto !important; filter: none; }
.status-monogram { width: 76px !important; height: auto !important; filter: none !important; }
.status-monogram-small { width: 34px !important; height: auto !important; }
.map-notice .status-monogram-small { width: 30px !important; }
html:not([data-theme='light']) .tc-loading, html:not([data-theme='light']) .status-monogram, html:not([data-theme='light']) .launch-content img { filter: invert(1) !important; }

/* Plain-text introduction for search engines and screen readers; the map is the page people see. */
.seo-intro { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* townglobe.com link: header on desktop only (the tagline joins it on wide screens); the footer link shows on desktop. The FAQ has neither. */
.tg-head { display: none; align-items: center; gap: 8px; margin-left: auto; color: var(--ink-2, var(--ink)); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; white-space: nowrap; text-decoration: none; }
.tg-head:hover { color: var(--ink); }
.tg-text { display: flex; flex-direction: column; gap: 4px; line-height: 1.2; }
.tg-head b { font-weight: 700; letter-spacing: 0.08em; }
.tg-head .tg-tag { display: none; text-transform: uppercase; color: var(--muted); font-size: 10px; letter-spacing: 0.06em; }
.tg-globe { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; opacity: 0.75; flex: 0 0 auto; }
@media (min-width: 901px) { .tg-head { display: inline-flex; } }
@media (min-width: 1100px) { .tg-head .tg-tag { display: block; } }
