/* Palette lifted from my other tools so the whole set matches */
:root {
  --bg: #14151f;
  --panel: #1b1d29;
  --panel-2: #212432;
  --line: #2c3043;
  --text: #e7e9f3;
  --muted: #8d93ab;
  --gold: #c9a84c;
  --gold-dim: #8d7530;

  --ocean: #3f9fc4;
  --triad: #9b7bd6;
  --gate: #d9903c;
  --leve: #5fb87a;
  --reset: #d1596a;
  --reset2: #c0708f;
  --night: #6470c4;
  --fashion-open: #cf8fb0;
  --fashion-shut: #6a5a6e;
  --fl-a: #b08d57;
  --fl-b: #8a6e42;
  --fl-secure: #b08d57;
  --fl-seize: #35a3a3;
  --fl-shatter: #7fb2e0;
  --fl-naadam: #9bb04f;
  --fl-triumph: #cf6b52;
  --house-entry: #4a9d8f;
  --house-results: #b06a9c;
  --cosmic: #3ea9a0;

  --label-w: 168px;
  --track-h: 34px;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--gold); }

h1, h2 { font-weight: 600; letter-spacing: 0.01em; }

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

/* Visible to screen readers, out of the way for everyone else */
.sr-only {
  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;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 50;
  background: var(--panel-2);
  padding: 8px 14px;
  border-radius: 8px;
}

/* Banner back to the tools hub, same as the timer site */
.hub {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
}
.hub strong { color: var(--gold); }
.hub span { color: var(--muted); }
.hub:hover strong { text-decoration: underline; }

.head {
  text-align: center;
  padding: 34px 16px 6px;
}
.panels { display: grid; gap: 26px; }
.head h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  color: var(--gold);
}
.tagline {
  margin: 8px auto 0;
  max-width: 52ch;
  color: var(--muted);
}

main {
  max-width: min(1800px, 94vw);
  margin: 0 auto;
  padding: 18px 16px 40px;
}

section { margin-bottom: 26px; }

section h2 {
  font-size: 1.15rem;
  margin: 0 0 12px;
  color: var(--gold);
}

/* Two live clocks up top */
.clocks {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.clock {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 20px;
  min-width: 190px;
  text-align: center;
}
.clock-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}
.clock-time {
  display: block;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.controls {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.daynav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.daynav button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1.2rem;
  line-height: 1;
  padding: 8px 13px;
  cursor: pointer;
}
.daynav button:hover { border-color: var(--gold-dim); }
.daynav-date {
  min-width: 160px;
  text-align: center;
}
.daynav-date span { display: block; }
.daynav-sub {
  font-size: 0.8rem;
  color: var(--muted);
}
/* Makes it obvious the numbers on screen are not the visitor's own clock */
.tztag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--gold-dim);
  color: #14151f;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: 1px;
}
.today-btn {
  font-size: 0.85rem !important;
  padding: 8px 14px !important;
}
.today-btn[disabled] {
  opacity: 0.4;
  cursor: default;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}
.toggle input { accent-color: var(--gold); width: 16px; height: 16px; }

/* The timeline itself */
.chart {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 0 4px;
}
.chart-viewport { position: relative; }
.chart-viewport::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 34px;
  background: linear-gradient(to right, rgba(27, 29, 41, 0), var(--panel));
  pointer-events: none;
  transition: opacity 0.2s;
}
.chart.at-end .chart-viewport::after { opacity: 0; }

.chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.chart-inner {
  position: relative;
  min-width: 860px;
  padding: 0 12px 8px;
}
.chart-inner.week { min-width: 1180px; }

.hours {
  display: flex;
  height: 22px;
  border-bottom: 1px solid var(--line);
}
/* The spacer keeps the hour numbers from sliding under the name column */
.hours-spacer {
  width: var(--label-w);
  flex: 0 0 var(--label-w);
  position: sticky;
  left: 12px;
  z-index: 3;
  background: var(--panel);
}
.hours-track {
  position: relative;
  flex: 1;
}
.hour-tick.first { transform: translateX(0); }
.hour-tick.last { transform: translateX(-100%); }

.hour-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  font-size: 0.72rem;
  color: var(--muted);
  transform: translateX(-50%);
  font-variant-numeric: tabular-nums;
}

.row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(44, 48, 67, 0.6);
}
.row:last-child { border-bottom: 0; }

.hours-spacer::before,
.row-label::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -12px;
  width: 12px;
  background: var(--panel);
}

.row-label {
  appearance: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  width: var(--label-w);
  border-right: 1px solid var(--line);
  box-shadow: 6px 0 8px -8px rgba(0, 0, 0, 0.9);
  flex: 0 0 var(--label-w);
  position: sticky;
  left: 12px;
  z-index: 3;
  background: var(--panel);
  padding: 6px 12px 6px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.row-name {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Bell sits faint until the reminder is armed */
.bell {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  fill: currentColor;
  opacity: 0.16;
}
.armed .bell,
.next-item.armed .bell {
  opacity: 1;
  color: var(--gold);
}
.row-label:hover .bell,
.next-item:hover .bell { opacity: 0.5; }
.row-label.armed:hover .bell,
.next-item.armed:hover .bell { opacity: 1; }

.row-label.armed .row-name { color: var(--gold); }

.block.armed,
.pin.armed {
  box-shadow: 0 0 0 1px var(--gold);
}
.row-where {
  font-size: 0.73rem;
  color: var(--muted);
}
.row-empty { opacity: 0.62; }
.row-empty .row-where { display: block; }

/* Shaded column for the hour I am in right now */
.hourband {
  position: absolute;
  background: rgba(201, 168, 76, 0.09);
  border-left: 1px solid rgba(201, 168, 76, 0.22);
  border-right: 1px solid rgba(201, 168, 76, 0.22);
  pointer-events: none;
  z-index: 0;
}

.row-track {
  position: relative;
  z-index: 1;
  flex: 1;
  height: var(--track-h);
  margin: 4px 0;
  background-image: linear-gradient(to right, rgba(44, 48, 67, 0.9) 0 1px, transparent 1px);
  background-size: calc(100% / 24) 100%;
}

.row-track.week { background-size: calc(100% / 7) 100%; }

/* A week of two hourly blocks is just a smear, so those rows say their rhythm instead */
.block.summary {
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    115deg,
    rgba(20, 21, 31, 0.32) 0 6px,
    transparent 6px 13px
  );
}

.block {
  position: absolute;
  top: 5px;
  bottom: 5px;
  min-width: 5px;
  border-radius: 4px;
  cursor: pointer;
}
.block:focus-visible, .pin:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.block.dense {
  top: 13px;
  bottom: 13px;
  opacity: 0.8;
  border-radius: 2px;
}

.c-ocean  { background: var(--ocean); }
.c-triad  { background: var(--triad); }
.c-gate   { background: var(--gate); }
.c-leve   { background: var(--leve); }
.c-reset  { background: var(--reset); }
.c-reset2 { background: var(--reset2); }
.c-night  { background: var(--night); }
.c-cosmic { background: var(--cosmic); }
.c-weekly { background: var(--gold); }
.c-fashion-open { background: var(--fashion-open); }
.c-fashion-shut { background: var(--fashion-shut); }
.c-fl-a { background: var(--fl-a); }
.c-fl-b { background: var(--fl-b); }
.c-fl-secure  { background: var(--fl-secure); }
.c-fl-seize   { background: var(--fl-seize); }
.c-fl-shatter { background: var(--fl-shatter); }
.c-fl-naadam  { background: var(--fl-naadam); }
.c-fl-triumph { background: var(--fl-triumph); }
.c-house-entry   { background: var(--house-entry); }
.c-house-results { background: var(--house-results); }

/* Bands run the width of the day, so they get their name printed inside */
.block.span {
  top: 7px;
  bottom: 7px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.block-text {
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #14151f;
  white-space: nowrap;
}
.block.span.live { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
.block.span.armed { box-shadow: 0 0 0 1px var(--gold); }
.block.live {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--gold);
}

/* Single moment events get a pin and a time next to it */
.pin {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 3px;
  border-radius: 2px;
  cursor: pointer;
}
/* Fatter invisible target so a thumb can actually hit a 3px pin */
.pin::before {
  content: "";
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: -9px;
  right: -9px;
}
.pin-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.nowline {
  position: absolute;
  top: 22px;
  width: 2px;
  background: var(--gold);
  pointer-events: none;
  z-index: 4;
}
.nowline span {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #14151f;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.detail {
  margin: 8px 12px 0;
  font-size: 0.85rem;
  min-height: 1.5em;
  font-variant-numeric: tabular-nums;
}
.detail strong { color: var(--gold); font-weight: 600; }
.detail.empty { color: var(--muted); }

.remind {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 12px 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.remind button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  padding: 4px 10px;
  cursor: pointer;
}
.remind button:hover { border-color: var(--gold-dim); }

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  max-width: min(320px, calc(100vw - 32px));
  background: var(--panel-2);
  border: 1px solid var(--gold-dim);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hint {
  margin: 2px 12px 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Day and week switch */
.viewswitch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.viewswitch button {
  background: var(--panel);
  color: var(--muted);
  border: 0;
  font: inherit;
  font-size: 0.85rem;
  padding: 8px 16px;
  cursor: pointer;
}
.viewswitch button + button { border-left: 1px solid var(--line); }
.viewswitch button.on {
  background: var(--panel-2);
  color: var(--gold);
}

/* Drop down panels: settings, and everything below the chart */
.drop {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 14px;
}
.settings { margin: -10px 0 22px; }

.drop > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  padding: 11px 16px;
  font-size: 0.88rem;
  color: var(--muted);
  list-style: none;
}
.drop > summary::-webkit-details-marker { display: none; }
.drop > summary::before {
  content: "\25B8";
  transition: transform 0.15s;
}
.drop[open] > summary::before { transform: rotate(90deg); }
.drop > summary:hover { color: var(--text); }
.drop > summary h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--gold);
}
.drop > summary:hover h2 { color: var(--gold); }

.drop-body {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line);
}

.settings-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 22px;
  padding: 4px 16px 18px;
  border-top: 1px solid var(--line);
}
.setting-group h3 {
  margin: 14px 0 8px;
  font-size: 0.9rem;
  color: var(--gold);
}
.settings-note {
  margin: 6px 0 10px;
  font-size: 0.78rem;
  color: var(--muted);
}
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  margin-bottom: 10px;
}
.field select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.88rem;
  padding: 5px 8px;
}
.settings .toggle { margin-bottom: 8px; }

/* The panels already sit in a card, so their insides lose the double border */
.drop .table-wrap { border: 0; border-radius: 0; }
.drop .glance-intro { margin-top: 0; }
.drop .faq h3:first-of-type,
.drop .notes dt:first-child { margin-top: 0; }

.rowlist {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.rowlist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
}
.rowlist li:last-child { border-bottom: 0; }
.rowlist label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.85rem;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.rowlist input { accent-color: var(--gold); width: 15px; height: 15px; }
.moves { display: flex; gap: 4px; }
.moves button,
#resetRows {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
}
.moves button:hover:not([disabled]),
#resetRows:hover { border-color: var(--gold-dim); }
.moves button[disabled] { opacity: 0.3; cursor: default; }

.rows-empty {
  margin: 18px 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Coming up list */
.next-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(195px, 100%), 1fr));
  gap: 10px;
}
.next-list li { display: flex; }

.next-item {
  appearance: none;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px 12px;
}
.next-item.is-live { border-color: var(--gold); }
.next-item.armed { background: #22243a; }
.next-name {
  display: flex;
  align-items: center;
  gap: 6px;
}
.next-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.next-name { font-size: 0.92rem; }
.next-when {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.next-count {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: var(--gold);
  white-space: nowrap;
}
.next-count.live { color: var(--leve); }

/* Weekly cards */
.weekly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 12px;
}
.weekly-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.weekly-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.weekly-card p {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
}
.weekly-count {
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  font-size: 0.95rem;
}
.weekly-count.open { color: var(--leve); }

/* No JavaScript, no chart */
.noscript {
  background: var(--panel);
  border: 1px solid var(--gold-dim);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 0 0 20px;
  font-size: 0.9rem;
}

/* Plain table of the raw GMT numbers */
.glance-intro {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.glance table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 520px;
}
.glance th,
.glance td {
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.glance thead th {
  background: var(--panel-2);
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}
.glance tbody th {
  font-weight: 500;
  white-space: nowrap;
}
.glance tbody td { color: var(--muted); }
.glance tbody tr:last-child th,
.glance tbody tr:last-child td { border-bottom: 0; }
.glance tbody tr:hover { background: rgba(201, 168, 76, 0.04); }

/* FAQ */
.faq h3 {
  font-size: 0.98rem;
  margin: 18px 0 2px;
  color: var(--text);
}
.faq p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 76ch;
}

/* Cross links to my other tools */
.tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 10px;
}
.tool-list li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
}
.tool-list a {
  display: block;
  text-decoration: none;
  font-size: 0.92rem;
}
.tool-list a:hover { text-decoration: underline; }
.tool-list span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Notes */
.notes dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 0 36px;
}
.notes dl > div { break-inside: avoid; }
.notes dt {
  color: var(--gold);
  font-size: 0.92rem;
  margin-top: 14px;
}
.notes dd {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 72ch;
}

.foot {
  border-top: 1px solid var(--line);
  padding: 22px 16px 30px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.tip { margin: 0 0 8px; }
.tip-links {
  margin: 0 0 14px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.tip-links a {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 14px;
  text-decoration: none;
}
.tip-links a:hover { border-color: var(--gold-dim); }
.made { margin: 0; }

@media (min-width: 1180px) {
  .panels { grid-template-columns: 1.55fr 1fr; align-items: start; }
  .weekly-grid { grid-template-columns: 1fr; }
  .clock { min-width: 220px; }
}

@media (max-width: 720px) {
  :root {
    --label-w: 118px;
    --track-h: 40px;
  }
  body { font-size: 15px; }
  main { padding: 14px 12px 32px; }
  .head { padding: 24px 14px 4px; }
  .chart-inner { min-width: 780px; }
  .chart-inner.week { min-width: 900px; }
  .settings-body { padding: 4px 12px 16px; gap: 8px; }
  .drop-body { padding: 12px 12px 16px; }
  .clock { min-width: 0; flex: 1 1 44%; padding: 8px 10px; }
  .clock-time { font-size: 1.3rem; }
  .controls { justify-content: center; gap: 10px; }
  .daynav { width: 100%; justify-content: center; flex-wrap: wrap; }
  .daynav-date { min-width: 128px; }
  .daynav button { padding: 10px 15px; }
  .row-where { display: none; }
  .row-name { font-size: 0.85rem; }
  .block { top: 8px; bottom: 8px; min-width: 6px; }
  .block.dense { top: 16px; bottom: 16px; }
  .next-list, .weekly-grid { grid-template-columns: 1fr; }
  .notes dd { font-size: 0.85rem; }
  .faq p { font-size: 0.85rem; }
}

@media (max-width: 380px) {
  :root { --label-w: 104px; }
  .daynav-date { min-width: 108px; }
  .today-btn { padding: 8px 10px !important; }
  .chart-inner { min-width: 700px; }
  .chart-inner.week { min-width: 820px; }
  .head h1 { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
