:root {
  --bg: #14181d;          /* page background, darker than face */
  --face: #232b34;        /* dial face (from market24hclock dark) */
  --rim: #3a4552;
  --num: #7d8894;         /* quiet numerals */
  --label: #66727f;       /* ring city labels */
  --dim: 0.28;            /* opacity of inactive arcs */
  --panel: #1a2129;
  --text: #c9d1da;
  --muted: #5f6b77;
  --hot: #f5c518;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, "Segoe UI", Roboto, Verdana, sans-serif;
}
#layout {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  height: 100%;
  padding: 12px;
}

/* legend (left) */
#legend {
  flex: 0 1 280px;
  min-width: 230px;
  background: var(--panel);
  border: 1px solid #2a343f;
  border-radius: 8px;
  padding: 40px 14px 12px;   /* top padding clears the ⓘ toggle */
  overflow-y: auto;
  max-height: calc(100vh - 24px);
  font-size: 12px;
  line-height: 1.45;
}
#legend.collapsed { display: none; }
#legend h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 10px;
}
#legend h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin: 12px 0 4px;
}
#legend p { display: inline; }
.lg-item { display: flex; gap: 8px; margin-bottom: 8px; }
.lg-dot, .lg-overlap, .lg-att {
  flex: 0 0 auto;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 3px;
}
.lg-dot { background: #35d07f; box-shadow: 0 0 6px rgba(53, 208, 127, .6); }
.lg-overlap { background: #000; border: 1px solid #3a4552; border-radius: 2px; height: 6px; margin-top: 5px; }
.lg-att { background: var(--hot); border-radius: 2px; height: 6px; margin-top: 5px; }
.lg-slots { list-style: none; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11px; }
.lg-slots li { padding: 1.5px 0; color: var(--muted); }
.lg-slots li.b { color: #d8b23c; } /* bright slots called out in legend */
.lg-foot {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #2a343f;
  color: var(--muted);
  font-style: italic;
}
#legend-toggle {
  position: fixed;
  top: 14px; left: 14px;
  z-index: 5;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid #2a343f;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
#legend-toggle:hover { color: var(--text); border-color: #3a4552; }

/* dial (center) */
#dial-wrap {
  flex: 1 1 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
#dial {
  width: min(100%, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, .55)); /* card edge */
}
#face { fill: var(--face); stroke: var(--rim); stroke-width: 1.5; }

/* rim: fine ticks + small quiet numerals */
#ticks line { stroke: var(--rim); stroke-width: 1; }
#ticks line.major { stroke: #4d5966; stroke-width: 1.5; }
#numerals text {
  fill: var(--num);
  font-size: 12px;          /* ~40% smaller than the old 20px */
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: Verdana, sans-serif;
  letter-spacing: .04em;
}

/* venue rings */
.arc { transition: opacity .6s ease; }
.arc.main { opacity: var(--dim); }
.arc.main.active { opacity: .9; }
.arc.lunch { opacity: calc(var(--dim) * .55); }
.arc.lunch.active { opacity: .42; }
.arc.ghost { opacity: .3; }
/* attention track: bright = do-not-trade, reg = reduced size, ghost = summer DST */
.arc.att-bright { opacity: 1; }
.arc.att-reg { opacity: .4; }
.arc.att-ghost { opacity: .16; }
.ring-label {
  fill: #a2b1c4;            /* brighter, legible */
  font-size: 7.5px;
  letter-spacing: 1.6px;
  font-family: Verdana, sans-serif;
  text-transform: uppercase;
  dominant-baseline: central;
}

/* now-dots */
.dot { opacity: .35; transition: opacity .5s ease; }
.dot.live { opacity: 1; }
.dot-halo { opacity: 0; transition: opacity .5s ease; }
.dot-halo.live { opacity: .22; }

/* hands */
#hand-hour { fill: #e8edf2; }
#hand-minute { stroke: #dfe5eb; stroke-width: 2.4; stroke-linecap: round; }
#hand-second { stroke: #9aa6b2; stroke-width: 1; stroke-linecap: round; }
#hand-hub { fill: #e8edf2; }
#hand-pin { fill: #232b34; }

/* events panel (right): terminal-tight */
#events {
  flex: 0 1 340px;
  min-width: 280px;
  background: var(--panel);
  border: 1px solid #2a343f;
  border-radius: 8px;
  padding: 10px 12px;
  overflow-y: auto;
  max-height: calc(100vh - 24px);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
}
#events h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 8px;
  font-family: inherit;
}
#ics-status { font-weight: normal; text-transform: none; letter-spacing: 0; }
#event-list { list-style: none; }
#event-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px solid #232c36;
  line-height: 1.35;
}
#event-list li.hot {
  background: rgba(245, 197, 24, .07);
  box-shadow: inset 2px 0 0 var(--hot); /* next-60-min accent only */
}
#event-list li.med { opacity: .62; }      /* medium-impact info rows, no alerts */
#event-list li.empty { color: var(--muted); border: none; }
.ev-time { color: var(--num); white-space: nowrap; }
.ev-flag {
  font-size: 10px;
  padding: 0 4px;
  border: 1px solid #333e4a;
  border-radius: 3px;
  color: var(--muted);          /* dim badge */
  white-space: nowrap;
}
.ev-title { flex: 1; }
.ev-fc { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38%; }

@media (max-width: 820px) {
  #layout { flex-direction: column; height: auto; }
  #dial { width: 100%; max-height: none; }
  #events { max-height: none; flex-basis: auto; }
  /* legend stays behind the ⓘ toggle on narrow screens; events panel stays put */
  #legend:not(.collapsed) {
    position: fixed;
    top: 50px; left: 12px;
    z-index: 6;
    width: min(320px, calc(100vw - 24px));
    max-height: 70vh;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .6);
  }
}

/* season calendar screen (finviz snapshots) */
#season-toggle {
  position: fixed;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  padding: 4px 14px;
  background: var(--panel);
  border: 1px solid #2a343f;
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .06em;
  cursor: pointer;
}
#season-toggle:hover { color: var(--text); border-color: #3a4552; }
#season {
  padding: 20px 16px 48px;
  border-top: 1px solid #2a343f;
  background: var(--bg);
  scroll-margin-top: 8px;
}
#season-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-left: 34px;
}
#season-head h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
#season-tabs { display: flex; gap: 4px; }
#season-tabs button {
  background: transparent;
  border: 1px solid #2a343f;
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
}
#season-tabs button.active {
  color: var(--text);
  background: #232c36;
  border-color: #3a4552;
}
#season-updated { font-size: 10px; color: var(--muted); margin-left: auto; }
.s-day {
  font-size: 12px;
  color: var(--text);
  margin: 16px 0 4px;
}
.s-day .s-count { color: var(--muted); font-weight: normal; font-size: 11px; margin-left: 6px; }
.s-table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
}
.s-table th {
  text-align: left;
  color: var(--muted);
  font-weight: normal;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 8px;
  border-bottom: 1px solid #2a343f;
}
.s-table td { padding: 3px 8px; border-bottom: 1px solid #1e2630; color: var(--text); }
.s-table td.t { color: var(--num); white-space: nowrap; }
.s-table td.tk { color: #7fb4e8; font-weight: 600; }
.s-table td.r { text-align: right; }
.s-table td.imp { letter-spacing: 2px; white-space: nowrap; }
.s-table td.imp3 { color: var(--hot); }
.s-table td.imp2 { color: #9aa6b2; }
.s-table td.imp1 { color: var(--muted); }
.s-table .up { color: #35c46f; }
.s-table .down { color: #e05a4e; }
#season-body { overflow-x: auto; }
.season-empty { color: var(--muted); padding: 16px 8px; }
