/* JuryQ public status dashboard — dark only
   Background matches juror-web LoginPage dark gradient. */
:root {
  color-scheme: dark;
  --bg: #0d0d0d;
  --bg-accent: #1a1612;
  --ink: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.58);
  --card: rgba(30, 30, 30, 0.88);
  --card-solid: #1e1e1e;
  --line: rgba(255, 255, 255, 0.12);
  --ok: #9ec73d;
  --ok-bg: rgba(158, 199, 61, 0.16);
  --warn: #e9d20c;
  --warn-bg: rgba(233, 210, 12, 0.14);
  --bad: #ef4444;
  --bad-bg: rgba(239, 68, 68, 0.16);
  --unknown: rgba(255, 255, 255, 0.45);
  --unknown-bg: rgba(255, 255, 255, 0.08);
  --brand: #eb8b2d;
  --radius: 1rem;
  --font: "Metropolis", "Roboto", "Helvetica", "Arial", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(135deg, #0d0d0d 0%, #2d1f0f 40%, #1a2410 100%);
  background-attachment: fixed;
}

a {
  color: inherit;
}

.page {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand img {
  height: 2.4rem;
  width: auto;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.92rem;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

.nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--brand);
}

.hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.hero-copy {
  min-width: min(100%, 20rem);
  flex: 1 1 16rem;
}

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 38rem;
  line-height: 1.5;
}

.refresh-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  padding-top: 0.35rem;
}

#refresh-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}

#refresh-btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  background: rgba(235, 139, 45, 0.14);
}

#refresh-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

#refresh-countdown {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  min-width: 3.5rem;
}

.overall {
  margin: 1.5rem 0 1.75rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.overall-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.overall-copy strong {
  font-size: 1.05rem;
}

.overall-copy span {
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.pill-ok {
  color: var(--ok);
  background: var(--ok-bg);
}

.pill-warn {
  color: var(--warn);
  background: var(--warn-bg);
}

.pill-bad {
  color: var(--bad);
  background: var(--bad-bg);
}

.pill-unknown {
  color: var(--unknown);
  background: var(--unknown-bg);
}

.tree {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.node {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.node-header {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(7rem, 1.35fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.95rem 1.1rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  list-style: none;
}

.node-header::-webkit-details-marker {
  display: none;
}

.node-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.node-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.chevron {
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  margin-left: 0.15rem;
}

.node[open] > .node-header .chevron {
  transform: rotate(45deg);
}

.node-title {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.node-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.node-body {
  display: none;
  border-top: 1px solid var(--line);
  padding: 0.55rem;
  background: rgba(0, 0, 0, 0.28);
}

.node[open] > .node-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.node-body > .node {
  margin: 0;
}

.check {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: var(--card-solid);
}

.check-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.check-name {
  font-weight: 600;
}

.check-detail {
  color: var(--muted);
  font-size: 0.82rem;
}

.history-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.history-dots {
  display: flex;
  gap: 0.22rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
}

.dot {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  background: var(--unknown-bg);
  border: 1px solid var(--line);
}

.dot-ok {
  background: var(--ok);
  border-color: var(--ok);
}

.dot-warn {
  background: var(--warn);
  border-color: var(--warn);
}

.dot-bad {
  background: var(--bad);
  border-color: var(--bad);
}

.dot-unknown {
  background: var(--unknown-bg);
  border-color: var(--line);
}

.history-bars {
  display: flex;
  gap: 3px;
  width: 100%;
  height: 2rem;
  align-items: stretch;
}

.bar {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  padding: 0;
  border-radius: 3px;
  background: var(--unknown-bg);
  cursor: pointer;
  transition: transform 0.12s ease, outline-color 0.12s ease;
}

.bar:hover {
  transform: translateY(-1px);
}

.bar-selected {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.bar-ok {
  background: var(--ok);
}

.bar-warn {
  background: var(--warn);
}

.bar-bad {
  background: var(--bad);
}

.bar-unknown {
  background: var(--unknown-bg);
  cursor: default;
}

.bar-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: -0.15rem;
}

.day-detail {
  margin-top: 0.15rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 6px);
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.day-detail-heading {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
}

.day-detail-heading span {
  color: var(--muted);
}

.history-minutes {
  position: relative;
  width: 100%;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}

.minute-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  cursor: crosshair;
}

.minute-tooltip {
  position: absolute;
  top: -1.7rem;
  transform: translateX(-50%);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.7rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

.minute-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

.footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer a {
  color: var(--ink);
}

.footer-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  max-width: 40rem;
}

.error {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--bad-bg);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.error strong {
  font-size: 0.98rem;
}

.error-note {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid rgba(235, 139, 45, 0.35);
  background: rgba(235, 139, 45, 0.12);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .node-header {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "chevron copy pill"
      "history history history";
  }

  .chevron {
    grid-area: chevron;
  }

  .node-copy {
    grid-area: copy;
  }

  .node-header .pill {
    grid-area: pill;
    justify-self: end;
  }

  .history-dots {
    grid-area: history;
    justify-content: stretch;
    width: 100%;
  }

  .history-dots .dot {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
}
