:root {
  color-scheme: dark;
  --bg: #071024;
  --panel: #0d1a35;
  --panel-soft: #122142;
  --line: #22345b;
  --text: #f4f7ff;
  --muted: #9daac5;
  --blue: #53a6ff;
  --yellow: #ffd85a;
  --green: #5ce0a0;
  --red: #ff6b76;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(83, 166, 255, 0.22), transparent 32rem),
    radial-gradient(circle at 95% 5%, rgba(255, 216, 90, 0.12), transparent 28rem),
    var(--bg);
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 28px;
}

.topbar, .panel-heading, .toolbar, .product-meta, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2.2rem, 5vw, 4.1rem); letter-spacing: -0.055em; }
h2 { margin-bottom: 0; font-size: 1.5rem; letter-spacing: -0.025em; }
h3 { margin-bottom: 8px; font-size: 1rem; line-height: 1.4; }
.subtitle { margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }
.eyebrow { margin-bottom: 6px; color: var(--blue); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }

.monitor-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 10px 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 26, 53, 0.8);
  font-size: 0.86rem;
  font-weight: 700;
}

.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px rgba(255, 216, 90, 0.12); }
.monitor-pill[data-status="healthy"] .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(92, 224, 160, 0.12); }
.monitor-pill[data-status="degraded"] .status-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 107, 118, 0.12); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 38px 0 14px;
}

.stats article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(13, 26, 53, 0.74);
}

.stats span { display: block; margin-bottom: 5px; font-size: 1.65rem; font-weight: 800; }
.stats span.hot { color: var(--yellow); }
.stats small { color: var(--muted); }

.toolbar {
  min-height: 54px;
  margin-bottom: 14px;
  padding: 10px 12px 10px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 26, 53, 0.55);
}

.toolbar p { margin-bottom: 0; color: var(--muted); font-size: 0.9rem; }
button {
  padding: 9px 14px;
  color: var(--text);
  border: 1px solid #365080;
  border-radius: 10px;
  background: #172b53;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 750;
  cursor: pointer;
}
button:hover { background: #1d376a; }
button:disabled { cursor: wait; opacity: 0.65; }

.alert-signup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 24px;
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid rgba(83, 166, 255, 0.45);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(83, 166, 255, 0.12), rgba(13, 26, 53, 0.82));
}
.alert-signup h2 { margin-bottom: 7px; }
.alert-signup > div > p:last-child { margin-bottom: 0; color: var(--muted); font-size: 0.86rem; }
.alert-signup form { display: flex; flex-wrap: wrap; align-self: center; gap: 8px; }
.alert-signup input {
  width: min(280px, 40vw);
  padding: 10px 12px;
  color: var(--text);
  border: 1px solid #365080;
  border-radius: 10px;
  outline: none;
  background: #0a1730;
  font: inherit;
  font-size: 0.88rem;
}
.alert-signup input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(83, 166, 255, 0.14); }
.alert-result { grid-column: 1 / -1; min-height: 1.2em; margin: 0; color: var(--muted); font-size: 0.8rem; }
.alert-result[data-status="success"] { color: var(--green); }
.alert-result[data-status="error"] { color: var(--red); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.panel { min-height: 540px; padding: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: rgba(13, 26, 53, 0.9); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14); }
.live-panel { background: linear-gradient(150deg, rgba(18, 33, 66, 0.98), rgba(13, 26, 53, 0.9)); }
.panel-heading { margin-bottom: 20px; }
.count { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-weight: 800; }

.queue-card, .community-card, .product-card, .empty-state { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-soft); }
.queue-card { margin-bottom: 12px; }
.community-card { margin-bottom: 12px; }
.queue-card.active { border-color: rgba(255, 216, 90, 0.55); background: linear-gradient(135deg, rgba(255, 216, 90, 0.11), rgba(18, 33, 66, 0.95)); }
.queue-card h3 { margin-top: 13px; font-size: 1.08rem; }
.queue-card p, .product-card p, .empty-state p, .timeline-item > div > p:last-child { margin-bottom: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.community-card h3 { margin: 13px 0 6px; font-size: 1.08rem; }
.community-card p { margin-bottom: 10px; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.community-card a { color: var(--blue); font-size: 0.76rem; text-decoration: none; }
.queue-card a { display: inline-block; margin-top: 15px; color: var(--yellow); font-size: 0.86rem; font-weight: 800; text-decoration: none; }

.badge { display: inline-flex; width: fit-content; padding: 5px 8px; border-radius: 999px; color: var(--muted); background: rgba(157, 170, 197, 0.12); font-size: 0.67rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.queue-card.active .badge { color: var(--yellow); background: rgba(255, 216, 90, 0.12); }
.badge.available { color: var(--green); background: rgba(92, 224, 160, 0.11); }
.card-list { display: grid; gap: 12px; }
.product-meta time { color: var(--muted); font-size: 0.76rem; }
.product-card h3 { margin-top: 13px; }
.product-card a, .timeline-item a { text-decoration: none; }
.product-card a:hover, .timeline-item a:hover { color: var(--blue); }
.empty-state { text-align: center; padding: 34px 20px; background: transparent; border-style: dashed; }
.empty-state strong { display: block; margin-bottom: 8px; }

.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 6px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 14px; padding: 0 0 22px; }
.timeline-marker { position: relative; z-index: 1; width: 13px; height: 13px; margin-top: 4px; border: 3px solid var(--panel); border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.timeline-meta { margin-bottom: 5px; color: var(--blue); font-size: 0.7rem; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.timeline-item h3 { margin-bottom: 4px; }

footer { margin-top: 18px; padding: 0 4px; color: var(--muted); font-size: 0.76rem; }
footer p { margin-bottom: 0; }
footer a { color: var(--muted); }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 620px); padding-top: 28px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .columns { grid-template-columns: 1fr; }
  .panel { min-height: 0; padding: 19px; }
  .toolbar { align-items: flex-start; }
  .alert-signup { grid-template-columns: 1fr; }
  .alert-signup form { flex-direction: column; align-self: stretch; }
  .alert-signup input { width: 100%; min-width: 0; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: no-preference) {
  .status-dot { animation: breathe 2.4s ease-in-out infinite; }
  @keyframes breathe { 50% { transform: scale(0.75); opacity: 0.65; } }
}
