/* Forex Sessions: one light and one dark theme, defined as colour tokens. */

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --topbar: rgba(244, 246, 251, 0.86);
  --cta: #0e855e;
  --cta-hover: #0a6c4c;
  --on-cta: #ffffff;
  --nav-hot: #0a7350;
  --surface: #ffffff;
  --surface-2: #f2f4f9;
  --border: #e1e6ef;
  --grid: #eef1f6;
  --grid-major: #dde3ed;
  --text: #0f172a;
  --muted: #536079;
  --faint: #646d82;
  --accent: #0e855e;
  --closed: #5f6b84;
  --closed-bg: #edf0f5;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05);
  --radius: 16px;

  /* World-map board */
  --stage-bg: #e6eaf2;
  --stage-text: #0f172a;
  --stage-muted: #4b5568;
  --scale-text: #4b5568;
  --scale-tab: #d3d9e4;
  --land: #c6cdd9;
  --land-edge: #e6eaf2;
  --closed-edge: #56607a;
  --ring-closed: #7d869b;
  --open-land: #34c193;
  --open-edge: #0e855e;
  --city-dot: #646d82;
  --city-open: #075a40;
  --card-body: #ffffff;
  --card-head: #dfe3ea;
  --card-text: #1a2131;
  --card-open: #1fae84;
  --card-open-text: #062a1e;
  --flag-ring: #ffffff;
  --tile-bg: #ffffff;
  --tile-text: #0f172a;
  --day-blue: #151821;
  --bar-closed: #8a93a6;
  --bar-open: #0e855e;
  --now-line: #151821;
  --now-edge: rgba(255, 255, 255, 0.8);

  /* NexusFx accents */
  --brand: #151821;
  --violet: #56607a;
  --prime: #151821;
  --prime-soft: rgba(21, 24, 33, 0.08);
  --on-prime: #ffffff;
  --prime-edge: #0a0c12;
  --prime-past-edge: rgba(21, 24, 33, 0.55);
  --meter-grad: linear-gradient(90deg, #34c193 0, #0e855e 55%, #075a40 100%);
  --grad: linear-gradient(135deg, #0e855e, #34c193);
  --glass: #ffffff;
  --glass-edge: #e0e7f4;
  --live: #0a7350;
  --on-live: #ffffff;
  --closed-text: #56607a;
  --live-soft: rgba(14, 133, 94, 0.12);
  --session-land: #b3bccb;
  --logo-grad: linear-gradient(90deg, #0e855e, #34c193);
  --logo-ink: #151821;
  --logo-accent: #0e855e;
  --ring-1: #34c193;
  --ring-2: #0e855e;
  --seg-bg: linear-gradient(180deg, rgba(86, 96, 122, 0.55), rgba(86, 96, 122, 0.3));
  --seg-edge: rgba(86, 96, 122, 0.55);
  --seg-past-edge: rgba(20, 30, 50, 0.3);
  --scroll-thumb: #7d869b;
  --scroll-thumb-hover: #5f6a80;
  --sbar-top: #eef0f4;
  --sbar-bottom: #ffffff;
  --sbar-text: #1a2131;
  --sbar-muted: #475066;
  --sbar-edge: rgba(20, 30, 50, 0.18);
  --sbar-status-bg: rgba(20, 30, 50, 0.08);
  --sbar-status-text: #1b3147;
  --sbar-past-top: #bcc2cc;
  --sbar-past-bottom: #aeb5c1;
  --sbar-past-text: #161b29;
  --sbar-past-chip: rgba(255, 255, 255, 0.6);
  --sbar-past-edge: rgba(20, 30, 50, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #151821;
    --topbar: rgba(21, 24, 33, 0.94);
    --cta: #34c193;
    --cta-hover: #52d3a8;
    --on-cta: #06231a;
    --nav-hot: #34c193;
    --surface: #1f222c;
    --surface-2: #282b35;
    --border: #2c2f39;
    --grid: #20232c;
    --grid-major: #2c2f39;
    --text: #e4e5e9;
    --muted: #a1a3ab;
    --faint: #8b8d95;
    --accent: #34c193;
    --closed: #a1a3ab;
    --closed-bg: rgba(161, 163, 171, 0.13);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
    --stage-bg: #151821;
    --stage-text: #e4e5e9;
    --stage-muted: #9c9ea6;
    --scale-text: #eceef2;
    --scale-tab: #2a2d37;
    --land: #35373d;
    --land-edge: #25272d;
    --closed-edge: #8a91a1;
    --ring-closed: #7b8394;
    --open-land: #1c7a5e;
    --open-edge: #34c193;
    --city-dot: #a2a5ad;
    --city-open: #8ff5d2;
    --card-body: #b9bec8;
    --card-head: #a6acb8;
    --card-text: #1c2233;
    --card-open: #1fae84;
    --card-open-text: #062a1e;
    --tile-bg: #22252f;
    --tile-text: #e4e5e9;
    --day-blue: #d4d6db;
    --bar-closed: #7b8394;
    --bar-open: #34c193;
    --now-line: #f2f4f8;
    --now-edge: rgba(21, 24, 33, 0.7);
    --brand: #c9cbd1;
    --violet: #a3a5ae;
    --prime: #f2f4f8;
    --prime-soft: rgba(255, 255, 255, 0.12);
    --on-prime: #151821;
    --prime-edge: #c5cbd8;
    --prime-past-edge: rgba(255, 255, 255, 0.6);
    --meter-grad: linear-gradient(90deg, #1f8f6d 0, #34c193 55%, #a8f3d8 100%);
    --grad: linear-gradient(135deg, #34c193, #0e855e);
    --glass: #1f222c;
    --glass-edge: #2e313b;
    --live: #34c193;
    --on-live: #04140d;
    --closed-text: #a9afbd;
    --live-soft: rgba(52, 193, 147, 0.15);
    --session-land: #3c414d;
    --logo-grad: linear-gradient(90deg, #34c193, #0e855e);
    --logo-ink: #ffffff;
    --logo-accent: #34c193;
    --ring-1: #d4d6db;
    --ring-2: #8d9099;
    --seg-bg: linear-gradient(180deg, rgba(172, 175, 184, 0.5), rgba(172, 175, 184, 0.28));
    --seg-edge: rgba(196, 198, 205, 0.55);
    --seg-past-edge: rgba(255, 255, 255, 0.28);
    --scroll-thumb: #80838c;
    --scroll-thumb-hover: #9a9da6;
    --sbar-top: #aeb0b6;
    --sbar-bottom: #c3c5ca;
    --sbar-text: #34373f;
    --sbar-muted: #4b4e56;
    --sbar-edge: rgba(255, 255, 255, 0.28);
    --sbar-status-bg: rgba(30, 33, 42, 0.13);
    --sbar-status-text: #24272d;
    --sbar-past-top: #5c5f67;
    --sbar-past-bottom: #4e5158;
    --sbar-past-text: #eceef1;
    --sbar-past-chip: rgba(0, 0, 0, 0.16);
    --sbar-past-edge: rgba(255, 255, 255, 0.14);
    --flag-ring: #a9abb1;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151821;
  --topbar: rgba(21, 24, 33, 0.94);
  --cta: #34c193;
  --cta-hover: #52d3a8;
  --on-cta: #06231a;
  --nav-hot: #34c193;
  --surface: #1f222c;
  --surface-2: #282b35;
  --border: #2c2f39;
  --grid: #20232c;
  --grid-major: #2c2f39;
  --text: #e4e5e9;
  --muted: #a1a3ab;
  --faint: #8b8d95;
  --accent: #34c193;
  --closed: #a1a3ab;
  --closed-bg: rgba(161, 163, 171, 0.13);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
  --stage-bg: #151821;
  --stage-text: #e4e5e9;
  --stage-muted: #9c9ea6;
  --scale-text: #eceef2;
  --scale-tab: #2a2d37;
  --land: #35373d;
  --land-edge: #25272d;
  --closed-edge: #8a91a1;
  --ring-closed: #7b8394;
  --open-land: #1c7a5e;
  --open-edge: #34c193;
  --city-dot: #a2a5ad;
  --city-open: #8ff5d2;
  --card-body: #b9bec8;
  --card-head: #a6acb8;
  --card-text: #1c2233;
  --card-open: #1fae84;
  --card-open-text: #062a1e;
  --tile-bg: #22252f;
  --tile-text: #e4e5e9;
  --day-blue: #d4d6db;
  --bar-closed: #7b8394;
  --bar-open: #34c193;
  --now-line: #f2f4f8;
  --now-edge: rgba(21, 24, 33, 0.7);
  --brand: #c9cbd1;
  --violet: #a3a5ae;
  --prime: #f2f4f8;
  --prime-soft: rgba(255, 255, 255, 0.12);
  --on-prime: #151821;
  --prime-edge: #c5cbd8;
  --prime-past-edge: rgba(255, 255, 255, 0.6);
  --meter-grad: linear-gradient(90deg, #1f8f6d 0, #34c193 55%, #a8f3d8 100%);
  --grad: linear-gradient(135deg, #34c193, #0e855e);
  --glass: #1f222c;
  --glass-edge: #2e313b;
  --live: #34c193;
  --on-live: #04140d;
  --closed-text: #a9afbd;
  --live-soft: rgba(52, 193, 147, 0.15);
  --session-land: #3c414d;
  --logo-grad: linear-gradient(90deg, #34c193, #0e855e);
  --logo-ink: #ffffff;
  --logo-accent: #34c193;
  --ring-1: #d4d6db;
  --ring-2: #8d9099;
  --seg-bg: linear-gradient(180deg, rgba(172, 175, 184, 0.5), rgba(172, 175, 184, 0.28));
  --seg-edge: rgba(196, 198, 205, 0.55);
  --seg-past-edge: rgba(255, 255, 255, 0.28);
  --scroll-thumb: #80838c;
  --scroll-thumb-hover: #9a9da6;
  --sbar-top: #aeb0b6;
  --sbar-bottom: #c3c5ca;
  --sbar-text: #34373f;
  --sbar-muted: #4b4e56;
  --sbar-edge: rgba(255, 255, 255, 0.28);
  --sbar-status-bg: rgba(30, 33, 42, 0.13);
  --sbar-status-text: #24272d;
  --sbar-past-top: #5c5f67;
  --sbar-past-bottom: #4e5158;
  --sbar-past-text: #eceef1;
  --sbar-past-chip: rgba(0, 0, 0, 0.16);
  --sbar-past-edge: rgba(255, 255, 255, 0.14);
  --flag-ring: #a9abb1;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

/*
 * One page width for every section, so their edges line up. On desktops it is also small enough
 * for the whole map screen (hour scale, map, overlap strip and bottom bar) to fit in the window,
 * like a wall board: the rest takes about 360px (measured) and the map gets 84% of the height left,
 * so it stays low (John's choice); the map is 0.414 times as tall as it is wide (1000 x 414, see
 * tools/build-map.js). It never goes below 800px, so on very short windows the page scrolls instead.
 */
:root {
  --page-w: clamp(800px, calc((100vh - 360px) * 0.84 / 0.414 + 32px), 1440px);
}

.wrap {
  width: 100%;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 20;
  background: var(--text);
  color: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}

.skip:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Controls ---------- */

select,
.btn {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 36px;
  padding: 0 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover,
select:hover {
  border-color: var(--grid-major);
  background: var(--surface-2);
}

.btn svg {
  width: 18px;
  height: 18px;
}

select {
  cursor: pointer;
  max-width: 280px;
  min-width: 0;
}

/* The box does not clip its buttons (each end button rounds its own outer corners instead), because
   clipping would also cut off the keyboard focus ring, which is drawn just outside a button. */
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.seg button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  height: 34px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.seg button:first-child {
  border-radius: 9px 0 0 9px;
}

.seg button:last-child {
  border-radius: 0 9px 9px 0;
}

/* The focused button's ring lies above its neighbour. */
.seg button:focus-visible {
  position: relative;
  z-index: 1;
}

.seg button[aria-pressed="true"] {
  background: var(--text);
  color: var(--surface);
}

.theme-btn .ic {
  display: none;
}

.theme-btn[data-mode="auto"] .ic-auto,
.theme-btn[data-mode="light"] .ic-light,
.theme-btn[data-mode="dark"] .ic-dark {
  display: block;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--topbar);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

/* The NexusFX logo, drawn in the page itself (the same shapes as the files in assets/logo), so it
   follows the light and dark colours. The symbol is 38px tall, like the round badge it replaced, so the
   bar keeps its height and the one-screen fitting is not disturbed. */
.logo {
  display: block;
  width: 36px;
  height: 38px;
  flex: none;
}

.logo-ink {
  fill: var(--logo-ink);
}

.logo-accent {
  fill: var(--logo-accent);
}

/* The U and the S of the name are drawn as lines, the other letters as filled shapes. */
.logo-line {
  fill: none;
  stroke: var(--logo-ink);
  stroke-width: 8;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  display: block;
  width: 107px;
  height: 16px;
  margin: 1px 0 4px;
}

.brand-tag {
  color: var(--muted);
  font-size: 12px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.zone-field {
  display: flex;
  min-width: 0;
}

/* ---------- Menu bar (see assets/js/nav.js) ----------
   Words with a down arrow open a popup. Below about 1440px of bar width the bar folds into a
   "Menu" button and the popups open as a list under it. */

.topbar-inner {
  container: topbar / inline-size;
}

/* A thin line in the logo colours along the bottom of the bar. */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--logo-grad);
  opacity: 0.75;
  pointer-events: none;
}

.nav {
  margin-left: auto;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 13px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.nav-link:hover,
.nav-item.open > .nav-link {
  background: var(--surface-2);
}

.nav-link[aria-current="page"],
.nav-item.open > .nav-link {
  color: var(--nav-hot);
}

.nav-link[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}

.nav-chev {
  width: 12px;
  height: 12px;
  transition: transform 0.15s;
}

.nav-item.open > .nav-link .nav-chev {
  transform: rotate(180deg);
}

.nav-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 340px;
  max-width: calc(100vw - 24px);
  padding: 8px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), var(--shadow);
  animation: pop-in 0.14s ease-out;
}

/* A long list scrolls inside the popup (never taller than the window). The popup itself does not
   clip, so the strip that bridges the gap to the menu word (::before below) stays reachable. */
.pop-list {
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* On the one-screen board the page is laid out at --ch tall and scaled, so measure against that. */
html.one-screen .pop-list {
  max-height: calc(var(--ch) - 140px);
}

.nav-pop[hidden] {
  display: none;
}

.nav-pop.flip {
  left: auto;
  right: 0;
}

/* Fills the gap between the word and its popup, so the pointer can travel from one to the other. */
.nav-pop::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.pop-title {
  padding: 6px 12px 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pop-list {
  display: grid;
  gap: 2px;
}

.pop-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 10px;
}

.pop-item b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.pop-item span {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
}

.pop-item span:first-child {
  margin-top: 0;
}

.pop-link {
  cursor: pointer;
}

.pop-link:hover,
.pop-link:focus-visible {
  background: var(--surface-2);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--surface-2);
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

/* The green button */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  color: var(--on-cta);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  background: var(--cta);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(52, 193, 147, 0.28);
}

.cta:hover {
  background: var(--cta-hover);
}

.cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s;
}

.cta:hover svg {
  transform: translateX(2px);
}

/* A tool (or the whole panel) that the menu just brought into view */
.tool.flash,
.tools.flash {
  animation: tool-flash 1.2s ease-out;
}

@keyframes tool-flash {
  0%,
  45% {
    box-shadow: 0 0 0 3px var(--nav-hot);
  }

  100% {
    box-shadow: 0 0 0 3px transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-pop,
  .tool.flash,
  .tools.flash {
    animation: none;
  }

  .nav-chev,
  .cta svg {
    transition: none;
  }
}

@container topbar (max-width: 1439px) {
  .nav-toggle {
    display: inline-flex;
    order: 2;
    margin-left: auto;
  }

  .controls {
    order: 3;
  }

  .nav {
    display: none;
    order: 4;
    width: 100%;
    margin: 0;
  }

  .topbar.nav-open .nav {
    display: block;
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 6px 0 4px;
  }

  .nav-link {
    justify-content: space-between;
    width: 100%;
    height: 42px;
  }

  .nav-pop {
    position: static;
    width: auto;
    max-width: none;
    margin: 2px 0 6px 10px;
    padding: 4px;
    background: transparent;
    border: 0;
    border-left: 2px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    animation: none;
  }

  .nav-pop::before {
    display: none;
  }

  /* The folded menu scrolls as a whole (see .topbar.nav-open .nav), not each list. */
  .pop-list {
    max-height: none;
    overflow: visible;
  }
}

@container topbar (max-width: 420px) {
  .brand-tag {
    display: none;
  }

  /* Alone beside the symbol, the name sits level with the body of the N (below the arrow), as in the logo. */
  .brand-name {
    margin: 10px 0 0;
  }
}

/* The green button needs room; the Tools word in the menu does the same job on narrow bars. */
@container topbar (max-width: 1000px) {
  .cta {
    display: none;
  }
}

/* ---------- World-map board ---------- */

.stage {
  overflow-x: clip; /* nothing on the board may make the page scroll sideways */
  background: var(--stage-bg);
  color: var(--stage-text);
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--border);
}

/* Sizes inside the board follow the board's own width (cqw), which on desktops is narrower than the window. */
.stage > .wrap {
  container: stage / inline-size;
}

.content {
  container: content / inline-size;
}

.stage-top {
  --scale-h: 56px;
  position: relative;
}

.mapbox {
  position: relative;
}

.hourscale {
  position: relative;
  height: var(--scale-h);
}

/* Each hour is a column: the am/pm mark (current hour only) sits above the number. */
.hs-slot {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding-bottom: 13px;
  font-size: clamp(11px, 1.35cqw, 20px);
  line-height: 1;
  color: var(--scale-text);
  white-space: nowrap;
}

.hs-slot::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.hs-slot.current {
  color: var(--stage-text);
  font-weight: 700;
  background: var(--scale-tab);
  clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%);
}

.hs-slot.current[data-ampm]::before {
  content: attr(data-ampm);
  font-size: clamp(10px, 0.9cqw, 13px);
  font-weight: 700;
  color: var(--day-blue);
}

.map {
  display: block;
  width: 100%;
  height: auto;
}

.country {
  fill: var(--land);
  stroke: var(--land-edge);
  stroke-width: 0.6;
  stroke-linejoin: round;
}

.country.session {
  fill: var(--session-land);
  stroke: var(--closed-edge);
  stroke-width: 1;
}

.country.session.open {
  fill: var(--open-land);
  stroke: var(--open-edge);
}

.city-dot {
  fill: var(--city-dot);
  stroke: var(--stage-bg);
  stroke-width: 1.2;
}

.city-dot.open {
  fill: var(--city-open);
}

.now-line {
  position: absolute;
  top: var(--scale-h);
  bottom: 0;
  z-index: 3;
  width: 2px;
  margin-left: -1px;
  background: var(--now-line);
  /* A thin edge in the opposite tone, so the line still shows where it crosses a bar of its own colour. */
  box-shadow: 0 0 0 1px var(--now-edge);
  pointer-events: none;
}

/* The session bars lie over the map, one row per session; their sizes follow the map's width (cqw). */
.map-cards,
.map-note {
  --bar-h: clamp(24px, 3.1cqw, 44px);
  position: absolute;
  top: var(--scale-h);
  left: 0;
  right: 0;
  z-index: 2;
  aspect-ratio: 1000 / 414; /* the map's own shape */
  container-type: inline-size;
  pointer-events: none;
}

/* A slim, one-line pill: flag · name · hours · length · status. The bar's box is exactly its hours on the
   scale: its edge and its spacing sit inside the box, so a short piece is drawn short, never stretched. */
.sbar {
  position: absolute;
  height: var(--bar-h);
  border-radius: calc(var(--bar-h) * 0.3);
  color: var(--sbar-text);
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* The greys of the labels in John's picture, as one smooth surface (lighter at the top, like light
   from above), so no line runs through the text. */
.sbar.closed {
  background: linear-gradient(180deg, var(--sbar-bottom), var(--sbar-top));
}

.sbar.open {
  color: #04150d;
  background: linear-gradient(180deg, #52d3a8, #2bae84);
  box-shadow: 0 0 0 1px rgba(52, 193, 147, 0.3), 0 4px 14px rgba(52, 193, 147, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* The bar's edge: a line drawn inside the box, so it takes no room. */
.sbar::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid var(--sbar-edge);
  border-radius: inherit;
  pointer-events: none;
}

.sbar.open::after {
  border-color: rgba(255, 255, 255, 0.35);
}

/* Finished today: a darker, quieter bar, so what is over steps back and what is open or still to come
   stands out. */
.sbar.past {
  color: var(--sbar-past-text);
  background: linear-gradient(180deg, var(--sbar-past-top), var(--sbar-past-bottom));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.sbar.past::after {
  border-color: var(--sbar-past-edge);
}

.sbar.past .sbar-time,
.sbar.past .sbar-status {
  background: var(--sbar-past-chip);
  color: inherit;
}

/* Yesterday's finished leftover shows only when it closed: "Closed at 01:00", "Until 01:00" or
   just "01:00", whichever fits. Plain text, so even a one-hour piece has room. */
.sbar.cut-start.tail .sbar-row {
  padding: 0 3px;
}

.sbar.tail:not([data-size="tiny"]) .sbar-status {
  display: inline-block;
  margin: 0 auto;
  padding: 0;
  background: none;
  font-size: max(9px, calc(var(--bar-h) * 0.27));
  letter-spacing: 0;
}

/* The two pieces of a session that runs past midnight: flat where it continues off the map's edge. */
.sbar.cut-start {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.sbar.cut-start::after {
  border-left: 0;
}

.sbar.cut-end {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.sbar.cut-end::after {
  border-right: 0;
}

/* Everything inside the bar is cut off at the bar's own edge. */
.sbar-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.sbar-row {
  display: flex;
  align-items: center;
  gap: max(6px, 0.6cqw);
  height: 100%;
  padding: 0 calc(var(--bar-h) * 0.2) 0 calc(var(--bar-h) + max(6px, 0.5cqw));
}

.sbar.cut-start .sbar-row {
  padding-left: calc(var(--bar-h) * 0.35);
}

/* How far through the session is (open bars only). */
.sbar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.2));
  box-shadow: inset -2px 0 0 rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

.sbar-flag {
  position: absolute;
  top: 50%;
  left: -2px;
  z-index: 2;
  width: calc(var(--bar-h) + 4px);
  height: calc(var(--bar-h) + 4px);
  overflow: hidden;
  border-radius: 50%;
  border: 3px solid var(--flag-ring);
  background: #151821;
  box-shadow: 0 0 0 2px var(--stage-bg), 0 2px 8px rgba(0, 0, 0, 0.45);
  transform: translateY(-50%);
}

/* A piece shorter than its flag shows no flag, so the bar's true length stays visible. */
.sbar.no-flag .sbar-flag {
  display: none;
}

.sbar-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sbar-info {
  position: relative;
  display: flex;
  align-items: center;
  gap: max(5px, 0.45cqw);
  flex: 0 1 auto;
  min-width: 0;
}

.sbar-name {
  overflow: hidden;
  font-size: clamp(10px, calc(var(--bar-h) * 0.38), 15px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-overflow: ellipsis;
}

.sbar-time {
  overflow: hidden;
  padding: 2px max(6px, 0.5cqw);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  color: inherit;
  font-size: clamp(9px, calc(var(--bar-h) * 0.33), 13px);
  font-weight: 600;
  text-overflow: ellipsis;
}

/* "+1": the end time is on the next day of your clock. */
.sbar-plus {
  margin-left: 2px;
  font-size: max(9.5px, 0.8em);
  font-weight: 800;
  vertical-align: 0.35em;
  line-height: 0;
}

/* The length, inside the hours chip: "06:00–15:00 · 9h". */
.sbar-dur {
  font-weight: 500;
}

.sbar-dur::before {
  content: " · ";
}

.sbar-status {
  position: relative;
  flex: none;
  overflow: hidden;
  margin-left: auto;
  padding: 3px max(6px, 0.6cqw);
  border-radius: 999px;
  background: var(--sbar-status-bg);
  color: var(--sbar-status-text);
  font-size: clamp(8.5px, calc(var(--bar-h) * 0.28), 12px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sbar.open .sbar-status {
  background: #0b3d27;
  color: #d9fbe9;
}

/* A live dot on the open session's countdown. */
.sbar.open .sbar-status::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: #5ef0a9;
  box-shadow: 0 0 6px #5ef0a9;
  vertical-align: 0.05em;
  animation: blink 1.4s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .sbar.open .sbar-status::before {
    animation: none;
  }
}

/* What a bar shows depends on the room it has (sizeBars measures and picks the fullest that fits):
   full: everything · mid: no length · small: name and hours (open: name and countdown)
   name: just the name (open: just the countdown) · tiny: just the flag.
   On an open bar the countdown matters more than the hours, so the hours give way first. */
.sbar[data-size="mid"] .sbar-dur,
.sbar[data-size="small"] .sbar-dur,
.sbar[data-size="small"].closed .sbar-status,
.sbar[data-size="small"].open .sbar-time,
.sbar[data-size="name"] .sbar-time,
.sbar[data-size="name"] .sbar-dur,
.sbar[data-size="name"].closed .sbar-status,
.sbar[data-size="name"].open .sbar-info,
.sbar[data-size="tiny"] .sbar-info,
.sbar[data-size="tiny"] .sbar-dur,
.sbar[data-size="tiny"] .sbar-status,
.sbar:not(.show-info) .sbar-info,
.sbar:not(.show-info) .sbar-dur,
.sbar:not(.show-info) .sbar-status,
.sbar.stand-in .sbar-status {
  display: none;
}

/* The weekend note: one line in the gap between the New York and Tokyo rows (rows at 7/30/53/76%),
   above the now line, so it covers no bar. */
.map-note {
  z-index: 3;
}

.map-note-text {
  position: absolute;
  top: calc(41.5% + var(--bar-h) / 2);
  left: 50%;
  width: max-content;
  max-width: 92%;
  overflow: hidden;
  padding: max(3px, 0.45cqw) max(10px, 1.1cqw);
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: var(--tile-bg);
  box-shadow: var(--shadow);
  color: var(--tile-text);
  font-size: clamp(11px, 1.2cqw, 15px);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
  transform: translate(-50%, -50%);
}

/* Bottom bar: the four city clocks and the market box */
.dock {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.75fr);
  gap: 8px;
  margin-top: 14px;
}

.dock-city,
.dock-market {
  min-width: 0;
  background: var(--tile-bg);
  color: var(--tile-text);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.dock-city {
  position: relative;
  padding: 25px 14px 10px 28px;
}

.dock-city::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 27px;
  width: 3px;
  height: 44px;
  border-radius: 2px;
  background: var(--bar-closed);
}

.dock-city.open::before {
  background: var(--bar-open);
}

.dock-summer {
  position: absolute;
  top: 7px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--stage-muted);
}

.dock-summer::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bar-closed);
}

.dock-name {
  overflow: hidden;
  font-size: clamp(13px, 1.5cqw, 22px);
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.dock-time {
  font-size: clamp(12px, 1.35cqw, 20px);
  color: var(--stage-muted);
  text-transform: uppercase;
}

.dock-day {
  margin-top: 6px;
  text-align: center;
  color: var(--day-blue);
  font-size: 14px;
  font-weight: 600;
}

.dock-market {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 18px 10px;
}

.dock-market-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dock-market-text {
  min-width: 0;
}

.dock-market-state {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(13px, 1.45cqw, 21px);
  font-weight: 600;
}

.dock-market-label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.dock-market-next {
  margin-top: 2px;
  color: var(--stage-muted);
  font-size: 13px;
}

.pulse {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--bar-closed);
}

.dock-market.open .pulse {
  background: var(--bar-open);
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 193, 147, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(52, 193, 147, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 193, 147, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .dock-market.open .pulse {
    animation: none;
  }
}

.dock-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.dock-hh {
  font-size: clamp(32px, 3.9cqw, 58px);
  font-weight: 300;
}

.dock-side {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: clamp(13px, 1.35cqw, 20px);
}

.dock-ampm:empty {
  display: none;
}

.dock-week {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--stage-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.dock-week .today {
  color: var(--day-blue);
  font-weight: 700;
}

/* Overlap strip under the map, and the hover time readout */
.ovstrip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 10px 2px 6px;
  font-size: 12px;
  color: var(--stage-muted);
}

.ovstrip-title {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ovstrip-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ovstrip-key .key {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 8px;
  border-radius: 3px;
  background: var(--violet);
}

.ovstrip-key .key.prime {
  background: var(--prime);
}

.ovstrip-key .key.live {
  background: #34c193;
  box-shadow: 0 0 6px rgba(52, 193, 147, 0.6);
}

.ovstrip-key .key.past {
  border: 1px dashed var(--seg-past-edge);
  background: transparent;
}

.ovstrip {
  position: relative;
  border: 1px solid var(--glass-edge);
  border-radius: 10px;
  background: var(--glass);
}

.ovstrip-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--stage-muted);
  font-size: 13px;
}

/* Each overlap's box is exactly its hours on the scale: the edge is drawn inside it and the spacing
   sits in an inner row, so even a half-hour piece is drawn short, never stretched. */
.ovseg {
  --edge: var(--seg-edge);
  --edge-style: solid;
  position: absolute;
  overflow: hidden;
  border-radius: 7px;
  background: var(--seg-bg);
  color: #fff;
  white-space: nowrap;
}

.ovseg::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px var(--edge-style) var(--edge);
  border-radius: inherit;
  pointer-events: none;
}

.ovseg-in {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 6px;
}

.ovseg.prime {
  --edge: var(--prime-edge);
  background: var(--prime);
}

.ovseg.live {
  box-shadow: 0 0 14px rgba(52, 193, 147, 0.55);
  --edge: var(--live);
}

/* The prime bar is the strongest one (white on dark, navy on light), so its text takes the opposite colour. */
.ovseg.prime .ovseg-l {
  color: var(--on-prime);
  text-shadow: none;
}

/* Light theme: solid, deeper bars so the white labels stay readable (contrast above 4.5:1). */
:root[data-theme="light"] .ovseg {
  background: #56607a;
  --edge: #454e66;
}

:root[data-theme="light"] .ovseg.prime {
  background: var(--prime);
  --edge: var(--prime-edge);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .ovseg {
    background: #56607a;
    --edge: #454e66;
  }

  :root:not([data-theme="dark"]) .ovseg.prime {
    background: var(--prime);
    --edge: var(--prime-edge);
  }
}

.ovseg.cut-start {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.ovseg.cut-end {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.ovseg-l {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* The pair's two flags, overlapping a little, so even a one-hour overlap says who. */
.ovseg-flags {
  display: inline-flex;
  flex: none;
}

.ovseg-flags .mini-flag {
  width: 15px;
  height: 15px;
  vertical-align: 0;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.35);
}

.ovseg-flags .mini-flag + .mini-flag {
  margin-left: -4px;
}

.ovseg.bare .ovseg-flags {
  display: none;
}

/* Live now: a pulsing dot before the words. */
.ovseg-dot {
  display: none;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5ef0a9;
  box-shadow: 0 0 6px #5ef0a9;
  animation: blink 1.4s infinite;
}

.ovseg.live:not(.no-dot) .ovseg-dot {
  display: inline-block;
}

/* On the strip the live bar is a bright fill, so its dot takes the colour of the words beside it. */
.ovstrip .ovseg.live .ovseg-dot {
  background: #04150d;
  box-shadow: none;
}

.ovstrip .ovseg.prime.live .ovseg-dot {
  background: var(--on-prime);
}

@media (prefers-reduced-motion: reduce) {
  .ovseg-dot {
    animation: none;
  }
}

/* Phases, like the session bars (written after the light-theme colours so they win in both themes).
   Live: green, or the prime colour ringed in green for London x New York. */
.ovstrip .ovseg.live {
  --edge: rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, #52d3a8, #2bae84);
  box-shadow: 0 0 12px rgba(52, 193, 147, 0.5);
}

.ovstrip .ovseg.live .ovseg-l {
  color: #04150d;
  text-shadow: none;
}

.ovstrip .ovseg.prime.live {
  --edge: var(--prime-edge);
  background: var(--prime);
  box-shadow: 0 0 0 2px var(--live), 0 0 14px rgba(52, 193, 147, 0.55);
}

.ovstrip .ovseg.prime.live .ovseg-l {
  color: var(--on-prime);
}

/* Finished today: a faint dashed outline, so what is over steps back. */
.ovstrip .ovseg.past {
  --edge: var(--seg-past-edge);
  --edge-style: dashed;
  background: transparent;
  box-shadow: none;
}

.ovstrip .ovseg.past .ovseg-l {
  color: var(--stage-muted);
  text-shadow: none;
}

/* (The background is repeated here because the light-theme prime colour above is as specific as the
   "finished" rule and would otherwise win.) */
.ovstrip .ovseg.prime.past {
  --edge: var(--prime-past-edge);
  background: transparent;
}

.ovstrip .ovseg.prime.past .ovseg-l {
  color: var(--prime);
}

.ovstrip .ovseg.past .ovseg-flags {
  opacity: 0.65;
}

.hover-line {
  position: absolute;
  top: var(--scale-h);
  bottom: 0;
  z-index: 4;
  width: 2px;
  margin-left: -1px;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, var(--stage-text) 0 6px, transparent 6px 12px);
  opacity: 0.6;
}

.hover-time {
  position: absolute;
  top: 4px;
  z-index: 5;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: var(--tile-bg);
  box-shadow: var(--shadow);
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}

.hover-time b {
  font-size: 15px;
  font-weight: 900;
  color: var(--brand);
}

.hover-time span {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stage-muted);
}

/* ---------- Today at a glance ---------- */

.card {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.glance {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.glance-clock {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ring {
  position: relative;
  flex: none;
  width: 224px;
  height: 224px;
}

.ring-svg {
  width: 100%;
  height: 100%;
}

.ring-glass {
  fill: none;
  stroke: var(--grid-major);
  stroke-width: 1;
}

.ring-track {
  fill: none;
  stroke: var(--grid);
  stroke-width: 9;
}

.ring-prog {
  fill: none;
  stroke: url(#ring-grad);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear;
}

.ring-tick {
  stroke: var(--grid-major);
  stroke-width: 1.3;
}

.ring-tick.major {
  stroke: var(--brand);
  stroke-width: 2.4;
}

.ring-num {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

.ring-dot {
  fill: #fff;
  stroke: var(--brand);
  stroke-width: 2;
}

.ring-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ring-time {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.ring-sec {
  margin-left: 1px;
  font-size: 13px;
  font-weight: 700;
  color: var(--violet);
}

.ring-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.ring-pct {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.glance-info {
  min-width: 0;
}

.glance-loc {
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.glance-date {
  margin-top: 5px;
  font-size: 16px;
  font-weight: 700;
}

.glance-utc {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  color: var(--closed-text);
  font-size: 13px;
  font-weight: 700;
}

.pill.open {
  color: var(--live);
}

.pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.pill.open .pill-dot {
  animation: blink 1.4s infinite;
}

@keyframes blink {
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .pill.open .pill-dot {
    animation: none;
  }
}

.glance-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--glass-edge);
  border-radius: 13px;
  background: var(--surface-2);
}

.stat-k {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-v {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 800;
}

.stat-v.live {
  color: var(--prime);
}

.stat-v.open {
  color: var(--live);
}

.stat-v.closed {
  color: var(--closed-text);
}

.stat-s {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.stat-s b {
  color: var(--text);
}

/* ---------- Section titles (NexusFx style) ---------- */

.sec-title {
  display: block;
  margin: 26px 4px 12px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sec-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 15px;
  margin-right: 9px;
  vertical-align: -2px;
  border-radius: 3px;
  background: var(--grad);
}

.sec-title span {
  letter-spacing: 0.04em;
  text-transform: none;
}

/* ---------- City clocks (four analog clocks) ---------- */

.aclocks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.aclock {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 14px 8px 12px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.aclock-dial {
  width: min(100%, var(--dial, 160px));
  height: auto;
  aspect-ratio: 1;
}

.aclock-face {
  fill: var(--surface-2);
}

.aclock-ring {
  fill: none;
  stroke: var(--ring-closed);
  stroke-width: 5;
}

.aclock.open .aclock-ring {
  stroke: var(--open-edge);
}

.aclock-tick {
  stroke: var(--faint);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.8;
}

.aclock-tick.major {
  stroke: var(--muted);
  stroke-width: 3;
  opacity: 1;
}

.aclock-num {
  fill: var(--text);
  font-size: 19px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

.aclock-hand {
  stroke-linecap: round;
}

.aclock-hand.hour {
  stroke: var(--text);
  stroke-width: 7;
}

.aclock-hand.minute {
  stroke: var(--text);
  stroke-width: 5;
}

.aclock-hand.second {
  stroke: var(--nav-hot);
  stroke-width: 2.2;
}

.aclock-cap {
  fill: var(--nav-hot);
}

.aclock-pin {
  fill: var(--surface-2);
}

.aclock-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.aclock-name .mini-flag {
  flex: none;
  width: 16px;
  height: 16px;
}

.aclock-time {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@container content (max-width: 640px) {
  .aclocks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Session detail cards ---------- */

/* Four in a row when there is room, two or one when the page is narrower (see the container rules). */
.scards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.scard {
  position: relative;
  overflow: hidden;
  padding: 16px 14px 14px;
  border: 1px solid var(--glass-edge);
  border-radius: 15px;
  background: var(--glass);
  box-shadow: var(--shadow);
}

.scard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--closed);
}

.scard.is-open::before {
  background: var(--live);
}

.scard-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scard-name {
  flex: 1;
  margin: 0;
  font-size: 15px;
}

.mini-flag {
  display: inline-block;
  flex: none;
  width: 20px;
  height: 20px;
  overflow: hidden;
  border-radius: 50%;
  vertical-align: -4px;
  box-shadow: 0 0 0 1.5px var(--glass-edge);
}

.mini-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.badge.open {
  background: var(--live-soft);
  color: var(--live);
}

.badge.closed {
  background: var(--closed-bg);
  color: var(--closed);
}

.scard-rows {
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
}

.scard-rows div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}

.scard-rows dt {
  color: var(--muted);
}

.scard-rows dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.progress {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--live);
}

.scard-cd {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.scard-cd b {
  color: var(--text);
}

/* ---------- Session overlaps & activity ---------- */

.ovtop {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meter-title,
.next-k {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meter-tag {
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--closed-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.meter-tag[data-tag="peak"] {
  background: var(--prime-soft);
  color: var(--prime);
}

.meter-tag[data-tag="high"] {
  background: var(--live-soft);
  color: var(--live);
}

.meter-tag[data-tag="moderate"] {
  background: var(--closed-bg);
  color: var(--violet);
}

.meter {
  position: relative;
  height: 13px;
  margin: 13px 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--meter-grad);
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.meter-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.meter-foot b {
  color: var(--text);
}

.meter-note {
  margin: 6px 0 0;
  color: var(--faint);
  font-size: 11.5px;
}

.best {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-edge);
}

.best span {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.best b {
  font-size: 16px;
  font-weight: 900;
  color: var(--brand);
}

.next-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.next-v {
  margin: 4px 0 2px;
  font-size: 22px;
  font-weight: 900;
}

.next-s {
  color: var(--muted);
  font-size: 12.5px;
}

.next-s b {
  color: var(--text);
}

.next-bar {
  height: 6px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.next-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--grad);
  transition: width 0.6s ease;
}

/* As many overlap cards in a row as fit; how many show depends on the season. */
.ovcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.ovcard {
  position: relative;
  overflow: hidden;
  padding: 13px 14px 14px 17px;
  border: 1px solid var(--glass-edge);
  border-radius: 15px;
  background: var(--glass);
  box-shadow: var(--shadow);
}

.ovcard::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--violet);
}

.ovcard.prime::before {
  background: var(--prime);
}

.ovcard.live {
  border-color: var(--live);
}

.ovc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ovc-pair {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.ovc-pair .mini-flag {
  width: 16px;
  height: 16px;
}

.ovc-badge {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--closed-bg);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.ovc-badge.live {
  background: var(--live-soft);
  color: var(--live);
}

.ovc-badge.prime {
  background: var(--prime-soft);
  color: var(--prime);
}

.ovc-time {
  margin: 9px 0 3px;
  font-size: 18px;
  font-weight: 900;
}

.ovc-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11.5px;
}

.ovc-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.ovc-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--live), var(--prime));
}

.ovc-cd {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.ovc-cd b {
  color: var(--text);
}

@media (max-width: 760px) {
  .ovstrip-key {
    display: none;
  }
}

/* The sections below the board choose their columns from their own width, not the window's. */
@container content (max-width: 1000px) {
  .scards,
  .ovcards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container content (max-width: 760px) {
  .glance,
  .ovtop {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container content (max-width: 560px) {
  .ovcards {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container content (max-width: 480px) {
  .scards {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container content (max-width: 460px) {
  .glance-clock {
    flex-direction: column;
    text-align: center;
  }

  .glance-stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Footer ---------- */

.footer {
  padding-top: 24px;
  padding-bottom: 40px;
  color: var(--faint);
  font-size: 13px;
}

.footer p {
  margin: 0;
}

.footer p + p {
  margin-top: 4px;
}

.noscript {
  padding: 16px;
}

/* ---------- Smaller screens ---------- */

/* The bottom bar follows the board's width: one row while it fits, then the market box drops below. */
@container stage (max-width: 760px) {
  .dock {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dock-market {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .stage-top {
    --scale-h: 46px;
  }

  /* Every other hour, and never the current hour's neighbours, so labels don't run together. */
  .hs-slot:nth-child(even):not(.current),
  .hs-slot.near {
    color: transparent;
  }
}

@media (max-width: 640px) {
  .controls {
    width: 100%;
  }

  .zone-field {
    flex: 1;
  }

  #theme-label {
    display: none;
  }

  .theme-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  select {
    width: 100%;
    max-width: none;
  }
}

@container stage (max-width: 560px) {
  .dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ---------- One screen (desktops; see fitScreen in app.js) ----------
   The page is laid out at a design size (--cw x --ch) and scaled by --fit to fill the window:
   map board on the left, the information on the right, the notes on one line at the bottom. */

.footer-short {
  display: none;
}

html.one-screen {
  overflow: hidden;
}

/* Fixed in place, so the page itself never scrolls: the scaled board is exactly the window. */
html.one-screen body {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: var(--cw);
  height: var(--ch);
  overflow: hidden;
  transform: scale(var(--fit));
  transform-origin: 0 0;
}

html.one-screen .topbar {
  position: relative;
  flex: none;
}

html.one-screen .topbar-inner {
  max-width: none;
}

html.one-screen main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--board-w) var(--side-w);
  justify-content: center;
  align-content: center;
  align-items: start;
  gap: 0 20px;
  padding: 12px 16px;
  background: var(--stage-bg);
}

html.one-screen .stage {
  overflow: visible;
  padding: 0;
  border: 0;
  background: none;
}

html.one-screen .stage > .wrap,
html.one-screen .content {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* The information column. If it ever runs taller than the screen, it scrolls on its own. */
html.one-screen .content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: var(--avail);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* The board fills its column: map at the top, the clocks and market box at the bottom. */
html.one-screen .stage {
  display: flex;
  flex-direction: column;
}

html.one-screen .stage > .wrap {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-between;
}

html.one-screen main {
  align-items: stretch;
}

/* ----- The information column: three panels, NOW · SESSIONS · OVERLAPS & ACTIVITY ----- */

html.one-screen .sec-title {
  margin: 2px 2px -3px;
  font-size: 12px;
}

html.one-screen .glance,
html.one-screen .scards,
html.one-screen .ovpanel {
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow);
}

/* Cards inside a panel are plain: the panel is the card. */
html.one-screen .glance > .card,
html.one-screen .ovtop > .card,
html.one-screen .scard,
html.one-screen .ovcard {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

/* 1. NOW: one slim panel in three columns. Column 1: the time (big), the date and zone. Columns 2 and 3
   are labelled facts, each as label / value / detail: SESSIONS OPEN and NEXT EVENT. The 24-hour ring and
   the market status are not repeated here: the market box under the map has the status, and the ring's
   time is the big number. */
html.one-screen .glance {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr);
  align-items: stretch;
  gap: 20px;
  margin: 0;
  padding: 12px 16px;
}

html.one-screen .glance-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

html.one-screen .ring {
  display: block;
  width: auto;
  height: auto;
}

html.one-screen .ring-svg,
html.one-screen .ring-pct {
  display: none;
}

html.one-screen .ring-face {
  position: static;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
}

html.one-screen .ring-time {
  font-size: 28px;
}

html.one-screen .ring-sec {
  font-size: 14px;
}

html.one-screen .ring-sub {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

/* Date on the first line; the zone and the UTC time share the second. */
html.one-screen .glance-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1px 12px;
  min-width: 0;
}

html.one-screen .glance-date {
  order: 1;
  flex-basis: 100%;
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
}

html.one-screen .glance-loc {
  order: 2;
  font-size: 11px;
  white-space: nowrap;
}

html.one-screen .glance-utc {
  order: 3;
  margin: 0;
  font-size: 12px;
  white-space: nowrap;
}

html.one-screen .glance-info .pill,
html.one-screen .glance-stats .stat:nth-child(n + 3) {
  display: none;
}

html.one-screen .glance-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border: 0;
}

/* Each fact: label on top, the value big, the detail under it; a thin rule on its left edge. */
html.one-screen .stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 0 0 0 16px;
  border: 0;
  border-left: 1px solid var(--glass-edge);
  background: none;
}

html.one-screen .stat-k {
  font-size: 10.5px;
}

html.one-screen .stat-v {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

html.one-screen .stat-s {
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
}

/* 2. SESSIONS: one compact line each: flag, name, status ... countdown. The open session's progress
   runs along its row's bottom edge. The hours are on the bars and in each bar's tooltip. */
html.one-screen .scards {
  display: block;
  padding: 0 16px;
}

html.one-screen .scard {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible;
  padding: 9px 0;
  border-top: 1px solid var(--glass-edge);
  line-height: 1.3;
}

html.one-screen .scard:first-child {
  border-top: 0;
}

html.one-screen .scard::before {
  display: none;
}

html.one-screen .scard-head {
  flex: 1 1 auto;
  min-width: 0;
}

html.one-screen .scard-name {
  flex: none;
  font-size: 14.5px;
}

html.one-screen .badge {
  padding: 2px 8px;
  font-size: 10.5px;
}

html.one-screen .scard-cd {
  flex: none;
  margin: 0;
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}

/* Hidden to the eye only (the hours are on the bars), still read out by screen readers. */
html.one-screen .scard-rows {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
}

html.one-screen .progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  margin: 0;
  background: transparent;
}

/* 3. OVERLAPS: the overlaps that matter as rows (live, prime, NEXT). Line 1: the pair and its badge;
   line 2: the hours on your clock, how long, and the countdown. The activity meter sits under the
   overlap strip on the board. */
html.one-screen .ttl-activity,
html.one-screen .next-card,
html.one-screen .best {
  display: none;
}

html.one-screen .ovpanel {
  display: flex;
  flex: none;
  flex-direction: column;
  min-height: 0;
  padding: 2px 16px;
}

/* Only what matters now: overlaps that are live, the NEXT one, and the prime one. The rest are on
   the overlap strip under the map. */
html.one-screen .ovcard:not(.live):not(.next):not(.prime) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
}

html.one-screen .ovtop {
  display: block;
  margin: 0;
}

html.one-screen .ovcards {
  display: block;
}

html.one-screen .ovcard {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "pair badge" "time cd";
  align-items: center;
  column-gap: 12px;
  overflow: visible;
  padding: 9px 0 9px 12px;
  border-top: 1px solid var(--glass-edge);
  line-height: 1.3;
}

html.one-screen .ovcards .ovcard:first-child,
html.one-screen .ovcard[hidden] + .ovcard {
  border-top: 0;
}

html.one-screen .ovcard::before {
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
}

html.one-screen .ovcard.live {
  border-color: var(--glass-edge);
}

html.one-screen .ovc-top {
  display: contents;
}

html.one-screen .ovc-pair {
  grid-area: pair;
  overflow: hidden;
  min-width: 0;
  flex-wrap: nowrap;
  font-size: 13.5px;
  white-space: nowrap;
}

html.one-screen .ovc-pair .mini-flag {
  width: 16px;
  height: 16px;
}

html.one-screen .ovc-badge {
  grid-area: badge;
  justify-self: end;
  padding: 2px 8px;
  font-size: 10.5px;
}

html.one-screen .ovc-badge.next {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}

/* Line 2 holds the hours and the window's length together. */
html.one-screen .ovc-time {
  grid-area: time;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 0;
  font-size: 14px;
  white-space: nowrap;
}

html.one-screen .ovc-meta {
  grid-area: time;
  justify-self: end;
  align-self: end;
  margin: 0;
  font-size: 11.5px;
  white-space: nowrap;
}

html.one-screen .ovc-cd {
  grid-area: cd;
  align-self: end;
  margin: 4px 0 0;
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}

html.one-screen .ovc-bar {
  position: absolute;
  left: 12px;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: transparent;
}

/* The activity meter on the board, under the overlap strip: one slim panel. */
html.one-screen .stage .meter-card {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  grid-template-areas: "head meter foot" "note note note";
  align-items: center;
  column-gap: 16px;
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid var(--glass-edge);
  border-radius: 12px;
  background: var(--glass);
  box-shadow: var(--shadow);
  color: var(--text);
}

html.one-screen .stage .meter-head {
  grid-area: head;
  gap: 10px;
}

html.one-screen .stage .meter {
  grid-area: meter;
  height: 9px;
  margin: 0;
}

html.one-screen .stage .meter-foot {
  grid-area: foot;
  gap: 14px;
  font-size: 12px;
  white-space: nowrap;
}

html.one-screen .stage .meter-note {
  grid-area: note;
  margin: 5px 0 0;
  font-size: 11px;
}

html.one-screen .stage .meter-tag {
  padding: 2px 10px;
  font-size: 11px;
}

/* Smallest labels on the board get a little more size, so they stay readable when scaled down. */
html.one-screen .sbar-status {
  font-size: clamp(9.5px, calc(var(--bar-h) * 0.3), 12px);
}

html.one-screen .footer {
  flex: none;
  padding-top: 7px;
  padding-bottom: 8px;
  font-size: 12px;
  line-height: 1.35;
}

html.one-screen .footer p {
  display: none;
}

html.one-screen .footer .footer-short {
  display: block;
}

/* With no tool in the column, nothing sits under the panels, so the clocks and the sessions list share
   the free height (the time panel at the top stays as tall as its content, so everything below it
   starts as high as possible): rows get roomier and stay centred, and the column ends on the same line
   as the clocks. When a tool is added, the tools panel takes that height instead and these rules stop
   applying. */
html.one-screen .content:not(:has(.tool)) > .scards {
  display: flex;
  flex: 1.9 1 auto;
  flex-direction: column;
}

html.one-screen .content:not(:has(.tool)) .scard {
  flex: 1 1 auto;
}

html.one-screen .content:not(:has(.tool)) > .aclocks {
  flex: 0.5 1 auto;
}

/* The sessions list, when the rows have room (no tool in the column): each session is a small card of its
   own. Line 1: flag, name, status ... countdown. Line 2: two labelled columns, the session's hours on its
   own clock and the same hours on your clock. The open session's progress runs along the row's bottom. */
html.one-screen .content:not(:has(.tool)) .scard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "head cd" "rows rows";
  align-content: center;
  align-items: center;
  row-gap: 8px;
}

html.one-screen .content:not(:has(.tool)) .scard-head {
  grid-area: head;
}

html.one-screen .content:not(:has(.tool)) .scard-cd {
  grid-area: cd;
}

html.one-screen .content:not(:has(.tool)) .scard-rows {
  position: static;
  grid-area: rows;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  white-space: normal;
  clip: auto;
  clip-path: none;
}

html.one-screen .content:not(:has(.tool)) .scard-rows div {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

html.one-screen .content:not(:has(.tool)) .scard-rows dt {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html.one-screen .content:not(:has(.tool)) .scard-rows dd {
  font-size: 14px;
  text-align: left;
}

/* ----- 4. CITY CLOCKS: one analog clock per session city, at the top of the column -----
   Each dial shows that city's own wall clock (hour, minute and second hands); the ring is green while
   its session is open. On the board this panel replaces the overlap cards, which are hidden to the eye
   there (screen readers still get them); the overlaps are on the strip under the map. */
/* In the page the time panel comes first (best on phones); on the board the clocks are moved to the top
   of the column, level with the top of the hour scale. */
html.one-screen .clocks-title {
  order: -2;
}

html.one-screen .aclocks {
  order: -1;
  flex: none;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* always one row of four on the board */
  align-content: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow);
}

html.one-screen .aclock {
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

html.one-screen .aclock .badge {
  padding: 2px 8px;
  font-size: 10.5px;
}

/* With a tool in the column the clocks give it room: smaller dials (too small for the numbers, the
   ticks and hands still read), tighter padding. */
html.one-screen .content:has(.tool) .aclocks {
  --dial: 76px;
  gap: 6px;
  padding: 8px 12px;
}

html.one-screen .content:has(.tool) .aclock {
  gap: 4px;
}

html.one-screen .content:has(.tool) .aclock-num {
  display: none;
}

/* One tool alone shrinks to fit the panel (it fills it); several stay at least 260px each and scroll. */
html.one-screen .tool:only-of-type {
  flex-basis: 160px;
}

html.one-screen .sec-title.ov-title,
html.one-screen .sec-title.clocks-title,
html.one-screen #ovpanel {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
}

/* ----- Space for your own trading tools -----
   The rest of the information column, under the three panels. Put each tool in its own
   <div class="tool"> inside #tools (see the comment in index.html). One tool fills the panel; several
   stack and the panel scrolls, with a slide bar on its right. Only the one-screen layout shows it. */
.tools {
  display: none;
}

/* On windows too small for the one-screen board (small laptop windows, tablets, phones) the tools
   stack under the page instead, and the page scrolls. Nothing shows until there is a tool. */
html:not(.one-screen) .tools:has(.tool) {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

html:not(.one-screen) .tool {
  height: clamp(360px, 70vh, 640px);
}

html.one-screen .tools-title {
  display: none;
}

html.one-screen .tools {
  display: flex;
  flex: 1 1 0; /* takes what is left of the column; its content scrolls inside */
  flex-direction: column;
  gap: 10px;
  min-height: 150px;
  padding: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  background: var(--glass);
}

/* With no tool in it the panel is not shown at all; it appears as soon as a .tool block is added. */
html.one-screen .tools:not(:has(.tool)) {
  display: none;
}

/* Firefox has no ::-webkit-scrollbar: a thin bar in the theme's colours. */
@supports not selector(::-webkit-scrollbar) {
  html.one-screen .tools {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--surface-2);
  }
}

/* The slide bar: always visible (not the hide-until-you-scroll kind), slim, on the right. Setting
   scrollbar-width / scrollbar-color in Chrome would switch these styles off, hence the @supports above. */
html.one-screen .tools::-webkit-scrollbar {
  width: 10px;
}

html.one-screen .tools::-webkit-scrollbar-track {
  margin: 8px 0;
  border-radius: 999px;
  background: var(--surface-2);
}

html.one-screen .tools::-webkit-scrollbar-thumb {
  min-height: 40px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--scroll-thumb, #80838c);
  background-clip: padding-box;
}

html.one-screen .tools::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover, #9a9da6);
  background-clip: padding-box;
}

/* One tool block: at least 260px tall; a single block grows to fill the panel. */
.tool {
  position: relative;
  display: flex;
  flex: 1 0 260px;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--glass-edge);
  border-radius: 12px;
  background: var(--surface);
}

.tool > iframe,
.tool > img,
.tool > video,
.tool > canvas {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}

.tool > .tool-title {
  flex: none;
  padding: 8px 12px;
  border-bottom: 1px solid var(--glass-edge);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

