/* ── Variables ── */
:root {
  --bg-primary: #07111f;
  --bg-secondary: #0d1a2b;
  --bg-tertiary: #13243a;
  --bg-hover: #19324d;
  --accent: #00b5d4;
  --accent-hover: #008c95;
  --accent-glow: rgba(0, 181, 212, 0.24);
  --accent-bg: rgba(0, 181, 212, 0.11);
  --purple: #008c95;
  --success: #8eea9d;
  --warning: #ff8200;
  --danger: #f26b43;
  --danger-strong: #dc2626;
  --text-primary: #f5f8fb;
  --text-secondary: #c9d7e6;
  --text-muted: #8ea4ba;
  --border: rgba(148, 163, 184, 0.22);
  --border-subtle: rgba(148, 163, 184, 0.12);
  --input-bg: #0a1728;
  --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.22);
  --sidebar-width: 260px;
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Lato', Arial, Helvetica, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --ns-deep-blue: #081a59;
  --ns-navy: #071958;
  --ns-cyan: #00b5d4;
  --ns-cyan-bright: #00a9ce;
  --ns-teal: #008c95;
  --ns-light-cyan: #d9faff;
  --ns-soft-blue: #f4fdff;
  --ns-orange: #ff8200;
  --ns-light-green: #aff097;
  --ns-soft-green: #e4fbdc;
  --admin-title-gradient: linear-gradient(90deg, var(--ns-soft-blue) 0%, rgba(217, 250, 255, 0.36) 24%, #ffffff 72%);
  --hero-actions-width: 326px;
  --admin-hero-border: rgba(0, 181, 212, 0.20);
}

[data-theme="light"] {
  --bg-primary: #f7fbfc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eefbfe;
  --bg-hover: #d9faff;
  --accent: #00a9ce;
  --accent-hover: #008c95;
  --accent-glow: rgba(0, 169, 206, 0.18);
  --purple: #008c95;
  --text-primary: #081a59;
  --text-secondary: #54565a;
  --text-muted: #5c665f;
  --border: #cceef4;
  --border-subtle: #e9f8fb;
  --input-bg: #eef6f8;
  --accent-bg: rgba(0, 169, 206, 0.11);
  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.08);
  --success: #008c95;
  --warning: #ff8200;
  --danger: #f26b43;
  --danger-strong: #b91c1c;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }
html, body { height: 100%; font-family: var(--font); background: var(--bg-primary); color: var(--text-primary); font-size: 14px; line-height: 1.6; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, textarea, select { font-family: var(--font); }
a { color: var(--accent); text-decoration: none; }

/* ── Login Screen ── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(28px, 5vw, 64px) 24px;
  background:
    radial-gradient(circle at 23% 32%, rgba(40, 214, 230, 0.2), transparent 28%),
    radial-gradient(circle at 76% 48%, rgba(37, 99, 235, 0.18), transparent 25%),
    radial-gradient(circle at 94% 8%, rgba(255, 138, 0, 0.16), transparent 18%),
    linear-gradient(135deg, #031b26 0%, #052e3a 34%, #063f4a 58%, #0b1b3a 100%);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

#login-screen::before {
  content: '';
  position: absolute;
  inset: -12%;
  background-image: radial-gradient(circle at center, rgba(40, 214, 230, 0.22) 0 1px, transparent 1.4px);
  background-size: 18px 18px;
  opacity: 0.36;
  transform: rotate(-7deg);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 90%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

#login-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.08), transparent 30%, rgba(255,255,255,0.04) 62%, transparent),
    radial-gradient(circle at 70% 52%, rgba(9, 80, 154, 0.28), transparent 28%);
  pointer-events: none;
  z-index: 0;
}

.login-shell {
  width: min(1240px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, 420px);
  gap: clamp(36px, 6vw, 82px);
  align-items: center;
  position: relative;
  z-index: 1;
}

.login-brief {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 560px;
  padding: 4px 0;
  position: relative;
}

.login-card {
  align-self: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(248,252,253,0.97));
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 24px;
  padding: 44px;
  width: 100%;
  max-width: 420px;
  position: relative;
  color: #0f172a;
  box-shadow: 0 28px 90px rgba(1, 13, 32, 0.42), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.login-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(40, 214, 230, 0.32), transparent 34%, rgba(34, 197, 94, 0.18));
  opacity: 0.38;
  pointer-events: none;
  z-index: -1;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 38px;
}

.login-logo img {
  height: 28px;
  width: auto;
  max-width: 180px;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.25));
}

.login-brief h1 {
  max-width: 620px;
  color: #ffffff;
  line-height: 1.04;
  letter-spacing: 0;
  text-shadow: 0 16px 44px rgba(0,0,0,0.34);
}

.login-brief h1 span {
  display: block;
  font-size: 54px;
  font-weight: 800;
}

.login-brief h1 .login-title-subline {
  margin-top: 10px;
  color: #d8fbff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.16;
}

.login-brief p {
  max-width: 560px;
  color: rgba(229, 247, 250, 0.82);
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.68;
}

.login-card-kicker {
  color: #008c9a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.login-card h2 {
  font-size: 29px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  letter-spacing: 0;
}

.login-card p {
  color: #536171;
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.55;
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

.form-group input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s;
  letter-spacing: 2px;
}

.form-group input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

#login-screen .form-group label {
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: 0;
}

#login-screen .form-group input {
  min-height: 50px;
  background: #ffffff;
  border: 1px solid #d9e4e8;
  border-radius: 10px;
  color: #0f172a;
  font-size: 15px;
  letter-spacing: 0;
  padding: 13px 15px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

#login-screen .form-group input::placeholder {
  color: #8a97a6;
  letter-spacing: 0;
}

#login-screen .form-group input:focus {
  border-color: #00a6b2;
  box-shadow: 0 0 0 4px rgba(40, 214, 230, 0.18);
}

#login-screen .btn-primary {
  min-height: 50px;
  background: linear-gradient(135deg, #22c55e 0%, #00a6b2 48%, #2563eb 100%);
  border: 1px solid rgba(0, 166, 178, 0.25);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(0, 166, 178, 0.25);
  font-size: 15px;
  font-weight: 800;
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}

#login-screen .btn-primary:hover {
  opacity: 1;
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(0, 166, 178, 0.3);
}

#login-screen .btn-primary:focus-visible,
#login-screen .btn-link:focus-visible,
#login-screen .lang-picker-btn:focus-visible {
  outline: 3px solid rgba(40, 214, 230, 0.38);
  outline-offset: 3px;
}

#login-screen .btn-primary:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.72;
  transform: none;
}

.login-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 640px;
  margin-top: 34px;
}

.login-signal-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 90px;
  padding: 18px;
  border: 1px solid rgba(180, 236, 240, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.055));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 14px 34px rgba(0,0,0,0.13);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.login-signal-card:hover {
  transform: translateY(-3px);
  border-color: rgba(40, 214, 230, 0.46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 18px 46px rgba(0, 166, 178, 0.18);
}

.login-signal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: 14px;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.12);
}

.login-signal-icon svg {
  width: 21px;
  height: 21px;
}

.login-signal-copy {
  min-width: 0;
}

.login-signal-copy span {
  display: block;
  color: rgba(216, 251, 255, 0.74);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.login-signal-copy strong {
  display: block;
  margin-top: 6px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.login-signal-card--active {
  border-color: rgba(34, 197, 94, 0.42);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.14), rgba(255,255,255,0.055));
}

.login-signal-card--active strong { color: #d9ffe7; }

.login-telemetry-panel {
  max-width: 640px;
  margin-top: 18px;
  border: 1px solid rgba(180, 236, 240, 0.18);
  border-radius: 18px;
  background: rgba(3, 27, 38, 0.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 20px 52px rgba(0,0,0,0.18);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.telemetry-header,
.telemetry-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.telemetry-header {
  grid-template-columns: 1fr auto;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(180, 236, 240, 0.12);
  color: #e6fbfc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.telemetry-header span:last-child {
  color: #bfe6ea;
  font-weight: 700;
}

.telemetry-row {
  grid-template-columns: auto minmax(110px, 1fr) minmax(104px, auto);
  padding: 12px 18px;
  color: #e0f3f5;
  font-size: 13px;
  border-bottom: 1px solid rgba(180, 236, 240, 0.1);
}

.telemetry-row:last-child { border-bottom: none; }

.telemetry-row code {
  color: #c2f7fa;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
  text-align: right;
}

.telemetry-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.telemetry-dot--ok { background: #22c55e; box-shadow: 0 0 12px rgba(34,197,94,0.72); }

.telemetry-row--ranking { align-items: flex-start; }
.telemetry-row--ranking .telemetry-dot { margin-top: 6px; }
.telemetry-ranking {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-self: end;
}
.telemetry-rank-entry {
  display: grid;
  grid-template-columns: 28px minmax(62px, auto) 56px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.telemetry-rank-pos {
  color: #22c55e;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}
.telemetry-rank-name {
  color: #d6fbff;
  font-family: var(--font-mono);
}
.telemetry-rank-pts {
  color: rgba(214, 238, 240, 0.68);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
}

.login-form-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  color: #536171;
  font-size: 12px;
}

.login-form-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.login-form-meta span::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #00a7ce;
  box-shadow: 0 0 10px rgba(0, 167, 206, 0.5);
}

.login-lang-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.login-switch-row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
  font-size: 13px;
  color: #64748b;
}

.btn-link {
  background: none;
  border: none;
  color: #0b83c8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 0;
  text-decoration: none;
}
.btn-link:hover { opacity: 0.8; }

#login-screen .lang-picker-btn {
  min-height: 40px;
  padding: 7px 12px;
  background: #ffffff;
  border-color: #d9e4e8;
  border-radius: 10px;
  color: #334155;
  box-shadow: 0 8px 20px rgba(15,23,42,0.06);
}

#login-screen .lang-picker-btn:hover {
  border-color: #00a6b2;
  color: #007c8f;
}

#login-screen .lang-picker-dropdown {
  background: #ffffff;
  border-color: #d9e4e8;
}

#login-screen .lang-picker-dropdown button {
  color: #334155;
}

#login-screen .lang-picker-dropdown button:hover {
  background: #f1f7f8;
  color: #0f172a;
}

/* Registration code card */

.reg-code-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reg-code-status {
  margin-top: 8px;
  font-size: 12px;
}

/* Control Center: subtitle + quick actions */

.cc-section-label { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-muted); margin: 34px 0 14px; }
.cc-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.cc-action {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg-secondary); cursor: pointer;
  transition: border-color .15s, transform .15s; text-align: left; width: 100%;
}
.cc-action:hover { border-color: var(--accent); transform: translateY(-1px); }
.cc-action-ic {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: var(--bg-tertiary); color: var(--text-secondary);
}
.cc-action-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.cc-action-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.35; }
.cc-action--primary { background: linear-gradient(120deg, rgba(251,191,36,.14), rgba(245,158,11,.06)); border-color: rgba(245,158,11,.4); }
.cc-action--primary:hover { border-color: #f59e0b; }
.cc-action--primary .cc-action-ic { background: rgba(245,158,11,.18); }
.cc-action--lb .cc-action-ic { background: var(--accent-glow, rgba(0,102,255,.1)); color: var(--accent); }
.cc-action--danger:hover { border-color: #ef4444; }
.cc-action--danger .cc-action-ic { background: rgba(239,68,68,.12); color: #ef4444; }

.challenge-overview-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.challenge-overview-card .adm-card-header,
.challenge-overview-card .adm-card-body {
  position: relative;
  z-index: 1;
}

.challenge-overview-card .adm-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  flex: 1;
}

.challenge-control-panel {
  display: grid;
  grid-template-columns: 112px minmax(160px, 220px);
  grid-template-areas: "semaphore info";
  align-items: center;
  justify-content: center;
  column-gap: 22px;
  min-height: 118px;
}

.challenge-control-panel .ctf-dash-info {
  grid-area: info;
  justify-self: start;
  min-width: 0;
  text-align: left;
  align-items: flex-start;
}

.challenge-control-panel .challenge-panel-semaphore {
  grid-area: semaphore;
  justify-self: center;
}

.challenge-panel-semaphore {
  flex-direction: row;
  border-radius: 18px;
  padding: 10px 12px;
}

.challenge-panel-semaphore--registration {
  gap: 12px;
}

.challenge-overview-card .ctf-dash-status-line {
  font-size: 20px;
}

.reg-code-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 118px;
  text-align: center;
}

.reg-code-display {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.reg-code-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.reg-code-edit-field {
  width: min(100%, 200px);
  height: 36px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-color: var(--accent);
}

.reg-code-action-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.reg-code-panel .row-icon-btn {
  width: 32px;
  height: 32px;
}

.reg-code-panel .reg-code-status {
  min-height: 16px;
  margin-top: 0;
}

.btn-primary {
  width: 100%;
  background: var(--ns-deep-blue);
  color: white;
  border: 1px solid var(--ns-deep-blue);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }

.login-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 10px;
  display: none;
  text-align: center;
}

@media (max-width: 900px) {
  #login-screen {
    align-items: flex-start;
    padding: 28px 16px;
    overflow-y: auto;
  }

  .login-shell {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .login-brief {
    min-height: auto;
    padding: 8px 0;
  }

  .login-brief h1 span {
    font-size: 40px;
  }

  .login-brief h1 .login-title-subline {
    font-size: 24px;
  }

  .login-brief p {
    font-size: 15px;
  }

  .login-card {
    max-width: 520px;
    justify-self: center;
  }
}

@media (max-width: 560px) {
  #login-screen {
    padding: 14px;
  }

  .login-brief,
  .login-card {
    padding: 24px;
  }

  .login-logo {
    margin-bottom: 26px;
  }

  .login-brief h1 span {
    font-size: 31px;
  }

  .login-brief h1 .login-title-subline {
    font-size: 20px;
  }

  .login-brief p {
    font-size: 14px;
  }

  .login-signal-grid {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .telemetry-row {
    grid-template-columns: auto 1fr;
  }

  .telemetry-row code,
  .telemetry-ranking {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  .login-form-meta {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
}

/* ── App Layout ── */
#app { display: none; height: 100vh; flex-direction: row; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: color-mix(in srgb, var(--bg-secondary) 88%, var(--bg-primary));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.22s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.sidebar.collapsed {
  width: 64px;
  border-right: 1px solid var(--border);
}

.sidebar-header {
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.sidebar-logo img { height: 28px; width: auto; flex-shrink: 0; }
.sidebar-logo > span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  white-space: normal;
}
.sidebar-logo > span > span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 7px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.sidebar-collapse-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.sidebar-expand-btn {
  position: fixed;
  left: 14px;
  top: 14px;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.sidebar-expand-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar.collapsed ~ .main-area .sidebar-expand-btn { display: none; }

.sidebar.collapsed .sidebar-header {
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 14px 10px;
}
.sidebar.collapsed .sidebar-logo {
  display: none;
}
.sidebar.collapsed .sidebar-collapse-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
}
.sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar.collapsed .sidebar-footer {
  margin-top: auto;
  padding: 10px;
  gap: 8px;
  align-items: center;
}

.sidebar-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  text-align: left;
}
.sidebar-action:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar.collapsed .sidebar-action {
  width: 42px;
  height: 42px;
  justify-content: center;
  padding: 0;
}
.sidebar.collapsed .sidebar-action span {
  display: none;
}
.sidebar.collapsed .sidebar-action svg {
  width: 16px;
  height: 16px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  margin-bottom: 4px;
}
.sidebar.collapsed .user-badge {
  width: 42px;
  height: 42px;
  justify-content: center;
  padding: 0;
}
.sidebar.collapsed .user-info {
  display: none;
}

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-secondary));
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.user-avatar--emoji {
  background: transparent;
  border: none;
  font-size: 24px;
  width: 28px; height: 28px;
}

.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--text-muted); }

/* ── Main Chat Area ── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
  transition: background 0.4s ease;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.participant-session-block {
  min-width: 0;
  padding-right: 12px;
}
.participant-session-kicker {
  margin-bottom: 1px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}
.participant-session-title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-right { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.chat-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.chat-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Messages ── */

.empty-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

/* ── Dark mode depth polish (chat surfaces) ──
   Black shadows are invisible on the near-black canvas, so dark mode gets
   stronger shadows plus a subtle lit top edge to create real separation
   between the canvas, header, input and side panels. Light mode untouched. */
[data-theme="dark"] .chat-header {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 1px 12px rgba(0,0,0,0.35);
}

[data-theme="dark"] .side-panel {
  box-shadow: -10px 0 28px rgba(0,0,0,0.28);
}

 /* legacy — replaced by btn-send-circle */

.side-panel {
  display: none;
  width: 360px;
  flex: 0 0 360px;
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 18px;
  flex-direction: column;
  gap: 18px;
  box-shadow: none;
}
.side-panel.open {
  display: flex;
}

/* ── Config Panel ── */

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-header h2 { font-size: 16px; font-weight: 700; }

/* Live session summary at the top of the Settings panel: reads as current
   state first, with the editable form below. */

.lab-step {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.step-number {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}
.step-content h3 { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.step-content p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.step-content code {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 11px;
  color: var(--accent);
}

/* ══════════════════════════════════════
   ADMIN PANEL — Nodus-style sidebar layout
══════════════════════════════════════ */
#admin-screen {
  display: none;
  height: 100vh;
  flex-direction: row;
  background: var(--bg-primary);
}

/* ── Sidebar ── */
.adm-sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.adm-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border);
}
.adm-sidebar-logo span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.adm-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.adm-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  transition: background 0.12s, color 0.12s;
  width: 100%;
}
.adm-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.adm-nav-item.active { background: var(--accent); color: #fff; }
.adm-nav-item.active svg { stroke: #fff; }

.adm-sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.adm-footer-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  width: 100%;
  text-align: left;
  transition: background 0.12s;
}
.adm-footer-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.adm-footer-btn.adm-signout:hover { color: var(--danger); }

/* ── Main area ── */
.adm-main {
  flex: 1;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 28px 32px;
  background: var(--bg-primary);
}

/* ── Card ── */
.adm-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.adm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.adm-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
/* Inner content sections that need padding (NOT tables) */
.adm-card .adm-card-body {
  padding: 18px;
}

/* Settings cards auto-padding */
.settings-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-card-body label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.settings-card-body input[type="text"],
.settings-card-body input[type="password"],
.settings-card-body input[type="number"] {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 13px;
}

.settings-console {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  margin-top: 20px;
}

.settings-product-card {
  padding: 0;
  overflow: hidden;
}

.settings-product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 104px;
  gap: 16px;
  align-items: stretch;
  padding: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 56%),
    color-mix(in srgb, var(--bg-secondary) 82%, var(--bg-primary) 18%);
}

.settings-product-copy {
  min-width: 0;
}

.settings-product-kicker,
.settings-danger-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.settings-product-copy h2 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.15;
}

.settings-product-copy p {
  max-width: 820px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.settings-help-tile,
.admin-help-tile,
.about-help-tile,
.standard-help-tile,
.standard-icon-tile {
  position: relative;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    inset 0 -2px 0 color-mix(in srgb, var(--accent) 18%, transparent);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.settings-help-tile::after,
.admin-help-tile::after,
.about-help-tile::after,
.standard-help-tile::after {
  content: "?";
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.settings-help-tile:hover,
.admin-help-tile:hover,
.about-help-tile:hover,
.standard-help-tile:hover,
.standard-icon-tile:hover {
  transform: translateY(-1px);
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.09),
    inset 0 -2px 0 color-mix(in srgb, var(--accent) 32%, transparent);
}

.settings-help-tile:active,
.admin-help-tile:active,
.about-help-tile:active,
.standard-help-tile:active,
.standard-icon-tile:active {
  transform: translateY(0);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.08),
    inset 0 2px 0 rgba(15, 23, 42, 0.04);
}

.settings-console-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-radius: 10px;
  min-height: 210px;
}

.settings-console-card .adm-card-header {
  min-height: 44px;
  padding: 10px 14px;
}

.settings-console-card .settings-card-body {
  flex: 1;
  gap: 11px;
  padding: 16px;
}

.settings-console-card .settings-card-body label {
  margin-bottom: 4px;
  font-size: 10px;
}

.settings-console-card .settings-card-body input[type="text"],
.settings-console-card .settings-card-body input[type="password"],
.settings-console-card .settings-card-body input[type="number"] {
  height: 34px;
  padding: 6px 9px;
}

.settings-compact-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-height: 34px;
  margin-top: auto;
}

.settings-inline-status {
  min-width: 0;
  margin-right: auto;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
}

.settings-compact-actions .btn-primary,
.settings-compact-actions .btn-secondary,
.settings-compact-actions .btn-danger {
  min-height: 32px;
  padding: 6px 11px;
  white-space: nowrap;
}

.settings-console-card--utility {
  min-height: 100%;
}

.settings-danger-zone {
  margin-top: 28px;
  padding: 20px 22px 22px;
  border: 1px solid color-mix(in srgb, var(--danger) 36%, var(--border));
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(239,68,68,.11), rgba(239,68,68,.035) 42%, transparent 78%),
    color-mix(in srgb, var(--bg-primary) 94%, rgba(239,68,68,.08));
  box-shadow: var(--shadow-sm);
}

.settings-danger-zone-header {
  margin-bottom: 16px;
  padding: 0 2px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--danger) 24%, transparent);
}

.settings-danger-zone-header h2 {
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 20px;
  line-height: 1.2;
}

.settings-danger-zone-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.settings-danger-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 16px;
}

.settings-danger-action {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(239,68,68,.22);
  border-radius: 10px;
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.settings-danger-action strong {
  color: var(--text-primary);
  font-size: 14px;
}

.settings-danger-action p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.settings-danger-action--reset {
  justify-content: space-between;
}

.settings-danger-action--reset .btn-danger {
  align-self: flex-end;
}

.settings-utility-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.settings-clear-warning {
  padding: 12px 14px;
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 8px;
  background: rgba(239,68,68,.08);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.55;
}

.settings-clear-warning strong {
  color: var(--danger);
}

.settings-clear-warning ul {
  margin: 6px 0 0 16px;
  padding: 0;
}

.settings-clear-warning div {
  margin-top: 8px;
  color: var(--text-secondary);
}

.admin-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 62px;
  margin: 16px -16px -16px;
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-secondary) 88%, var(--bg-tertiary) 12%);
}

.admin-form-actions .admin-action-status {
  margin-right: auto;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.admin-form-actions .btn-primary,
.admin-form-actions .btn-secondary,
.admin-form-actions .btn-danger {
  min-height: 34px;
  white-space: nowrap;
}

.admin-primary-action {
  min-width: 96px;
  justify-content: center;
}

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

.admin-product-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
}
.admin-product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 104px;
  gap: 16px;
  align-items: stretch;
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 56%),
    color-mix(in srgb, var(--bg-secondary) 82%, var(--bg-primary) 18%);
}
.admin-product-copy {
  min-width: 0;
}
.admin-product-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.admin-product-copy h2 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.15;
}
.admin-product-copy p {
  max-width: 820px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.admin-help-tile,
.settings-help-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-primary) 78%, var(--accent) 4%);
  color: var(--accent);
  cursor: pointer;
}
.admin-help-tile:hover,
.settings-help-tile:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  background: color-mix(in srgb, var(--bg-primary) 70%, var(--accent) 8%);
}

.standard-product-card {
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
}
.standard-product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 104px;
  gap: 16px;
  align-items: stretch;
  padding: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 56%),
    color-mix(in srgb, var(--bg-secondary) 82%, var(--bg-primary) 18%);
}
.standard-product-copy {
  min-width: 0;
}
.standard-product-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.standard-product-copy h2 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.15;
}
.standard-product-copy p {
  max-width: 820px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}
.standard-icon-tile,
.standard-help-tile {
  display: flex;
  min-width: 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-primary) 78%, var(--accent) 4%);
  color: var(--accent);
}

.standard-help-tile {
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.standard-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: var(--hero-actions-width);
  max-width: 100%;
  align-self: center;
  justify-self: end;
}
.standard-icon-tile {
  width: 64px;
  height: 64px;
  min-width: 64px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.standard-icon-tile:disabled {
  cursor: wait;
  opacity: 0.72;
}

.standard-icon-tile:hover,
.standard-help-tile:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  background: color-mix(in srgb, var(--bg-primary) 70%, var(--accent) 8%);
}

.standard-list-card {
  overflow: hidden;
}
.admin-create-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-secondary);
}
.admin-create-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.admin-create-copy strong {
  color: var(--text-primary);
  font-size: 14px;
}
.admin-create-copy span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.admin-create-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.admin-create-panel input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  color: var(--text-primary);
  font-size: 13px;
}
.admin-create-panel .admin-form-actions {
  min-height: 0;
  margin: 0;
  padding: 0;
  border-top: 0;
  background: transparent;
}
.admin-list-card {
  overflow: hidden;
}

.reg-code-status {
  margin-top: 0;
}

@media (max-width: 720px) {
  .standard-hero-actions {
    width: auto;
  }

  .settings-product-hero,
  .settings-console,
  .settings-danger-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-actions {
    flex-wrap: wrap;
  }

  .admin-form-actions .admin-action-status {
    width: 100%;
    margin-right: 0;
  }

  .admin-create-fields {
    grid-template-columns: 1fr;
  }

  .admin-product-hero,
  .admin-create-panel,
  .admin-create-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .settings-console {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .settings-console {
    grid-template-columns: 1fr;
  }
}

/* ── Table (replaces data-table) ── */
.adm-table {
  width: 100%;
  border-collapse: collapse;
}
/* Participants table: slightly tighter horizontal padding. */
#section-codes .adm-table th,
#section-codes .adm-table td {
  padding-left: 9px;
  padding-right: 9px;
}
.adm-table th {
  text-align: left;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}
.adm-table td {
  padding: 0 16px;
  height: 44px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
  white-space: nowrap;
}

.adm-table tr:last-child td { border-bottom: none; }
.adm-table tr:hover td { background: var(--bg-hover); }

/* keep .data-table alias for any JS that injects rows */

.about-product-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
}
.about-product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 104px;
  gap: 16px;
  align-items: stretch;
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 56%),
    color-mix(in srgb, var(--bg-secondary) 82%, var(--bg-primary) 18%);
}
.about-product-copy {
  min-width: 0;
}
.about-product-kicker,
.about-info-label,
.about-version-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.about-product-copy h2 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.15;
}
.about-product-copy p {
  max-width: 820px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}
.about-version-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  min-width: 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-primary) 78%, var(--accent) 4%);
}

.about-version-card::after {
  content: none;
}
.about-help-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-primary) 78%, var(--accent) 4%);
  color: var(--accent);
  cursor: pointer;
}
.about-help-tile:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  background: color-mix(in srgb, var(--bg-primary) 70%, var(--accent) 8%);
}
.about-version-value {
  color: var(--text-primary);
  font-family: monospace;
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.about-details-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  margin-bottom: 20px;
}

.about-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.about-info-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-primary);
}
.about-info-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.35;
}
.about-capabilities {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.about-capability {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}
.about-capability-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.about-actions-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-tertiary) 65%, transparent);
}
.about-actions-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.about-actions-copy strong {
  color: var(--text-primary);
  font-size: 14px;
}
.about-actions-copy span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.about-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.about-actions .btn-icon {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.2;
}
.about-actions .btn-primary {
  width: auto;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.2;
  min-height: 32px;
  border-radius: var(--radius-sm);
}

.about-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 20px 22px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(251, 191, 36, 0.14), rgba(245, 158, 11, 0.06));
  text-align: left;
  transition: border-color 0.15s, transform 0.15s;
}
.about-note:hover {
  border-color: #f59e0b;
  transform: translateY(-1px);
}
.about-note-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.18);
  color: var(--text-primary);
  font-size: 24px;
}
.about-note-copy {
  min-width: 0;
}
.about-note-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
}
.about-note-desc {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}
.about-note-meta {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .about-product-hero,
  .about-actions-panel {
    grid-template-columns: 1fr;
  }
  .about-info-grid,
  .about-capabilities {
    grid-template-columns: 1fr;
  }
  .about-actions {
    justify-content: stretch;
  }
  .about-actions .btn-icon {
    width: 100%;
    justify-content: center;
  }

  .about-note {
    align-items: flex-start;
    padding: 18px;
  }
}

/* Compact action buttons inside table cells */
.adm-table .btn-danger,
.adm-table .btn-secondary {
  padding: 3px 10px;
  font-size: 11px;
  line-height: 1.5;
}

/* ── Shared section visibility ── */
.admin-section { display: none; }
.admin-section.active { display: block; }

/* Backwards compat header/section used by old JS */

.btn-danger {
  background: var(--danger-strong);
  color: white;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-danger:hover { background: #b91c1c; }

/* Admin panel: btn-primary always auto-width and consistent size */
.adm-card-header .btn-primary,
.adm-card-body .btn-primary,
.settings-card-body .btn-primary { width: auto; padding: 7px 14px; font-size: 12px; }

/* Icon+text buttons */
.btn-icon { display: inline-flex; align-items: center; gap: 6px; }

.btn-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--bg-hover); }

.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.row-icon-btn {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.row-icon-btn:hover {
  z-index: 40;
}

.row-icon-btn[data-tooltip]::before,
.row-icon-btn[data-tooltip]::after {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: translate(-4px, -50%);
  transition: opacity 0.12s, transform 0.12s;
  z-index: 60;
}

.row-icon-btn[data-tooltip]::before {
  content: attr(data-tooltip);
  top: 50%;
  right: calc(100% + 12px);
  width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: 0 10px 28px rgba(0,0,0,0.16);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.row-icon-btn[data-tooltip]::after {
  content: "";
  top: 50%;
  right: calc(100% + 8px);
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  transform: translate(-4px, -50%) rotate(45deg);
}

.row-icon-btn[data-tooltip]:hover::before,
.row-icon-btn[data-tooltip]:hover::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.row-icon-btn[data-tooltip]:hover::after {
  transform: translate(0, -50%) rotate(45deg);
}

.row-icon-btn:hover {
  transform: translateY(-1px);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.row-icon-btn:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.row-icon-btn--accent:hover {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
  background: color-mix(in srgb, var(--success) 10%, var(--bg-tertiary));
}

.row-icon-btn--danger:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
  background: color-mix(in srgb, var(--danger) 10%, var(--bg-tertiary));
}

.row-icon-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.challenge-import-btn {
  cursor: pointer;
}

/* ── CTF Semaphore ────────────────────────────────── */
.ctf-dash-semaphore {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: linear-gradient(180deg, #64748b, #4b5563);
  border: 1px solid #94a3b8;
  border-radius: 18px;
  padding: 9px 8px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -2px 4px rgba(17,24,39,0.22),
    0 3px 7px rgba(15,23,42,0.16);
  flex-shrink: 0;
}

.challenge-panel-semaphore {
  border-radius: 18px;
  padding: 8px 10px;
}

.ctf-dash-light {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: box-shadow 0.2s, opacity 0.2s, transform 0.2s, filter 0.2s;
  opacity: 0.38;
  border: 3px solid #374151;
  box-shadow:
    inset 0 4px 5px rgba(0,0,0,0.32),
    0 1px 0 rgba(255,255,255,0.12);
  transform: scale(0.94);
  filter: saturate(0.72);
}

.ctf-dash-light:hover {
  opacity: 0.72;
  transform: scale(0.98);
  filter: saturate(1);
}

.ctf-dash-stop    { background: #ef4444; }
.ctf-dash-standby { background: #f59e0b; }
.ctf-dash-run     { background: #22c55e; }

.ctf-dash-light.active {
  opacity: 1;
  transform: scale(1);
  filter: saturate(1);
}

.ctf-dash-light.active.ctf-dash-stop {
  box-shadow: inset 0 3px 4px rgba(255,255,255,0.36), 0 0 9px 3px rgba(239,68,68,0.46);
}
.ctf-dash-light.active.ctf-dash-standby {
  box-shadow: inset 0 3px 4px rgba(255,255,255,0.4), 0 0 9px 3px rgba(245,158,11,0.46);
}
.ctf-dash-light.active.ctf-dash-run {
  box-shadow: inset 0 3px 4px rgba(255,255,255,0.36), 0 0 9px 3px rgba(34,197,94,0.46);
}

[data-theme="dark"] .ctf-dash-semaphore {
  background: linear-gradient(180deg, #64748b, #475569);
  border-color: #94a3b8;
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.16),
    0 2px 6px rgba(0,0,0,0.16);
}

[data-theme="dark"] .ctf-dash-light {
  opacity: 0.4;
  border-color: #334155;
}

[data-theme="dark"] .ctf-dash-light:hover {
  opacity: 0.64;
  border-color: rgba(255,255,255,0.42);
}

[data-theme="dark"] .ctf-dash-light.active {
  opacity: 1;
  border-color: rgba(255,255,255,0.72);
}

.ctf-dash-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ctf-dash-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.ctf-dash-status-line {
  font-size: 20px;
  color: var(--text-secondary);
}

.ctf-dash-status-line strong {
  font-size: 22px;
  font-weight: 700;
}

/* ── CTF State Control (header) ───────────────────── */
.ctf-state-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.ctf-state-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.ctf-state-btn:last-child {
  border-right: none;
}

.ctf-state-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.ctf-state-btn.active-stop {
  background: #fef2f2;
  color: #dc2626;
}

.ctf-state-btn.active-standby {
  background: #fffbeb;
  color: #d97706;
}

.ctf-state-btn.active-run {
  background: #f0fdf4;
  color: #16a34a;
}

[data-theme="dark"] .ctf-state-btn.active-stop {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
}

[data-theme="dark"] .ctf-state-btn.active-standby {
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
}

[data-theme="dark"] .ctf-state-btn.active-run {
  background: rgba(22, 163, 74, 0.15);
  color: #4ade80;
}

.challenge-admin-table {
  font-family: inherit;
  table-layout: fixed;
}

.challenge-col-label { width: 200px; }
.challenge-col-value { width: auto; }

.challenge-admin-table th {
  text-align: left;
  vertical-align: middle;
  border-right: none;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}

.challenge-admin-table thead th {
  height: auto;
  line-height: 1.2;
}

.challenge-admin-table td {
  font-family: inherit;
  height: auto;
  padding: 8px 16px;
  vertical-align: middle;
  white-space: normal;
  border-bottom: 1px solid var(--border-subtle);
}

.challenge-group-start td {
  border-top: 1px solid var(--border-subtle);
}

.challenge-admin-row td {
  border-bottom: 1px solid var(--border-subtle);
}

.challenge-admin-table tbody tr:hover td {
  background: var(--bg-hover);
}

.challenge-id-cell {
  text-align: center;
  border-right: 2px solid var(--border);
}

.challenge-id-cell code {
  display: inline-flex;
  min-width: 32px;
  justify-content: center;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
}

.challenge-label-cell {
  border-right: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.challenge-value-cell {
  border-right: 2px solid var(--border);
  min-width: 0;
}

.challenge-action-cell {
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
  vertical-align: middle;
  white-space: nowrap;
}

.challenge-action-cell .row-icon-btn {
  vertical-align: middle;
}

.challenge-admin-table .adm-inline-input {
  width: 100%;
  min-width: 0;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font: inherit;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 10px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.challenge-admin-table .adm-inline-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

.challenge-read-value {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  padding: 2px 0;
  line-height: 1.4;
  user-select: text;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.challenge-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.challenge-summary-title {
  flex: 1 1 auto;
  min-width: 0;
}

.challenge-summary-type {
  flex: 0 0 auto;
  margin-top: 1px;
}

.challenge-text-key-value {
  display: inline-block;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.35;
  padding: 2px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--ns-light-cyan) 44%, #fff 56%);
  color: var(--ns-deep-blue);
  border: 1px solid color-mix(in srgb, var(--ns-cyan) 18%, var(--border));
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.challenge-description-input {
  min-height: 42px;
  resize: vertical;
}

/* ── Challenge add form ── */

.ch-add-input--narrow {
  max-width: 100px;
  flex: 0 0 100px;
}

/* Challenge type picker */

.challenge-type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.challenge-type-badge--text   { background: color-mix(in srgb, #10b981 15%, transparent); color: #10b981; }

/* ── Admin visual refresh ── */
#admin-screen {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-primary) 94%, var(--accent) 6%) 0, var(--bg-primary) 280px);
}

.adm-sidebar {
  width: 236px;
  min-width: 236px;
  background: color-mix(in srgb, var(--bg-secondary) 94%, var(--bg-primary) 6%);
  border-right: 0;
  position: relative;
  z-index: 2;
}

.adm-sidebar::after {
  content: "";
  position: absolute;
  top: 152px;
  right: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  pointer-events: none;
}

.adm-sidebar-logo {
  margin-top: 22px;
  padding: 20px;
  height: 130px;
  min-height: 130px;
  box-sizing: border-box;
  justify-content: center;
  background-image: var(--admin-title-gradient);
  background-size: 100vw 100%;
  background-position: left center;
  background-repeat: no-repeat;
  border: 1px solid var(--admin-hero-border);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  position: relative;
  z-index: 3;
}

.adm-sidebar-logo span {
  font-size: 14px;
  letter-spacing: 0;
}

.adm-nav {
  padding: 12px 10px;
  gap: 3px;
}

.adm-nav-label {
  margin: 15px 10px 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.adm-nav-label:first-child {
  margin-top: 4px;
}

.adm-nav-item {
  position: relative;
  min-height: 36px;
  border-radius: 8px;
  padding: 9px 12px 9px 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.adm-nav-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.adm-nav-item svg {
  opacity: 0.82;
}

.adm-nav-item:hover {
  background: color-mix(in srgb, var(--bg-hover) 74%, var(--accent) 8%);
}

.adm-nav-item.active {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent);
  font-weight: 700;
}

.adm-nav-item.active::before {
  background: var(--accent);
}

.adm-nav-item.active svg {
  stroke: currentColor;
  opacity: 1;
}

.adm-sidebar-footer {
  padding: 14px 10px;
  background: color-mix(in srgb, var(--bg-secondary) 92%, var(--bg-primary) 8%);
}

.adm-main {
  padding: 22px clamp(22px, 3vw, 42px) 42px;
  overflow-x: hidden;
}

.admin-section.active {
  max-width: 1480px;
}

.participant-table-header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.participant-table-all-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.participant-table-all-btn:hover {
  background: var(--bg-hover);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  color: var(--accent);
  transform: translateY(-1px);
}

.participant-table-all-btn:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.participant-table-all-btn--danger:hover {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--border));
  color: var(--danger);
}

.readiness-card-header {
  align-items: center;
  gap: 12px;
}

.reg-dash-closed { background: #ef4444; }
.reg-dash-open   { background: #22c55e; }

.ctf-dash-light.active.reg-dash-closed { box-shadow: 0 0 10px 3px rgba(239,68,68,0.7); opacity: 1; }
.ctf-dash-light.active.reg-dash-open   { box-shadow: 0 0 10px 3px rgba(34,197,94,0.7); opacity: 1; }

.dash-top-row .adm-card {
  display: flex;
  flex-direction: column;
}

.dash-top-row .adm-card-body,
.dash-top-row .adm-card > .status-split,
.dash-top-row .adm-card > .dash-podium {
  flex: 1;
}

/* Dashboard top row: readiness + podium 50/50 */
.dash-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

/* Podium */
.dash-podium {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 16px;
  min-height: 250px;
}
/* When the dashboard card shows the Concept C list (not the podium), align it
   to the top instead of vertically centering. */
.dash-podium:has(.lb-c) { justify-content: flex-start; }
.dash-podium-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  margin: auto;
}

/* ── Leaderboard list (Concept C) — shared by participant panel + admin card ── */
.lb-c { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.lb-c-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  animation: lb-c-in 0.32s ease both;
}
.lb-c-row--top { background: transparent; }
.lb-c-bg { position: absolute; inset: 0; opacity: 0.12; pointer-events: none; }
.lb-c-row--gold   .lb-c-bg { background: #f59e0b; }
.lb-c-row--silver .lb-c-bg { background: #9aa0a6; }
.lb-c-row--bronze .lb-c-bg { background: #d8703e; }
.lb-c-row--me { box-shadow: inset 0 0 0 1.5px var(--accent); }
.lb-c-rank { width: 26px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-muted); z-index: 1; flex-shrink: 0; }
.lb-c-medal { width: 26px; text-align: center; font-size: 20px; line-height: 1; z-index: 1; flex-shrink: 0; }
.lb-c-av {
  width: 28px; height: 28px;
  background: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; z-index: 1; flex-shrink: 0;
}
.lb-c-main { flex: 1; min-width: 0; z-index: 1; }
.lb-c-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-c-sub { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.lb-c-sub svg { opacity: 0.7; }
.lb-c-pts { z-index: 1; text-align: right; flex-shrink: 0; line-height: 1.15; }
.lb-c-pts b { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.lb-c-pts small { display: block; font-size: 10px; font-weight: 500; color: var(--text-muted); }
.lb-c-empty { color: var(--text-secondary); font-size: 13px; padding: 8px 2px; }
@keyframes lb-c-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Status panel (redesigned in the ranking style) ── */
.status-split { display: grid; grid-template-columns: 0.85fr 1fr; gap: 12px; flex: 1; align-items: stretch; padding: 16px 18px 18px; }
.status-controls { display: flex; flex-direction: column; gap: 12px; }
.status-tile {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px;
  background: var(--bg-secondary); cursor: pointer;
  transition: border-color 0.15s;
}
.status-tile:hover { border-color: var(--accent); }
.status-tile-bg { position: absolute; inset: 0; opacity: 0.10; pointer-events: none; background: var(--bg-tertiary); }
.challenge-overview-card > .status-tile-bg { opacity: 0; }
.status-tile:has(.ctf-dash-stop.active) .status-tile-bg,
.status-tile:has(.ctf-dash-standby.active) .status-tile-bg,
.status-tile:has(.ctf-dash-run.active) .status-tile-bg,
.status-tile:has(.reg-dash-closed.active) .status-tile-bg,
.status-tile:has(.reg-dash-open.active) .status-tile-bg { opacity: 0; }
.status-tile:has(.ctf-dash-stop.active) .status-tile-bg,
.status-tile:has(.reg-dash-closed.active) .status-tile-bg { background: #ef4444; }
.status-tile:has(.ctf-dash-standby.active) .status-tile-bg { background: #f59e0b; }
.status-tile:has(.ctf-dash-run.active) .status-tile-bg,
.status-tile:has(.reg-dash-open.active) .status-tile-bg { background: #22c55e; }

/* Challenge overview cards: same background color behavior as status tiles */
.challenge-overview-card:has(.ctf-dash-stop.active) .status-tile-bg,
.challenge-overview-card:has(.reg-dash-closed.active) .status-tile-bg { background: #ef4444; }
.challenge-overview-card:has(.ctf-dash-standby.active) .status-tile-bg { background: #f59e0b; }
.challenge-overview-card:has(.ctf-dash-run.active) .status-tile-bg,
.challenge-overview-card:has(.reg-dash-open.active) .status-tile-bg { background: #22c55e; }
.challenge-overview-card,
.readiness-card,
.dashboard-leaderboard-card,
.status-tile {
  transition: border-color .25s, background .25s;
}
.challenge-overview-card:has(.ctf-dash-run.active),
.challenge-overview-card:has(.reg-dash-open.active),
.status-tile:has(.ctf-dash-run.active),
.status-tile:has(.reg-dash-open.active),
.dashboard-leaderboard-card {
  border-color: rgba(22,163,74,.5);
  background: linear-gradient(120deg,rgba(22,163,74,.10),transparent 70%);
}
.challenge-overview-card:has(.ctf-dash-standby.active),
.status-tile:has(.ctf-dash-standby.active) {
  border-color: rgba(217,119,6,.55);
  background: linear-gradient(120deg,rgba(217,119,6,.12),transparent 70%);
}
.readiness-card,
.readiness-card:has(.status-row-val.is-ready):not(:has(.status-row-val.is-missing)),
.readiness-card:has(.status-row-val.is-missing) {
  border-color: var(--border);
  background: var(--bg-secondary);
}
.challenge-overview-card:has(.ctf-dash-stop.active),
.challenge-overview-card:has(.reg-dash-closed.active),
.status-tile:has(.ctf-dash-stop.active),
.status-tile:has(.reg-dash-closed.active) {
  border-color: rgba(220,38,38,.6);
  background: linear-gradient(120deg,rgba(220,38,38,.14),transparent 70%);
}
.challenge-overview-card:has(.ctf-dash-run.active) .adm-card-body,
.challenge-overview-card:has(.reg-dash-open.active) .adm-card-body,
.dashboard-leaderboard-card .dash-podium {
  background: transparent;
}
.challenge-overview-card:has(.ctf-dash-standby.active) .adm-card-body {
  background: transparent;
}
.challenge-overview-card:has(.ctf-dash-stop.active) .adm-card-body,
.challenge-overview-card:has(.reg-dash-closed.active) .adm-card-body {
  background: transparent;
}
.readiness-card .status-split,
.readiness-card:has(.status-row-val.is-ready) .status-split,
.readiness-card:has(.status-row-val.is-missing) .status-split {
  background: var(--bg-secondary);
}
.status-tile-inner { display: flex; align-items: center; gap: 16px; width: 140px; z-index: 1; }
.status-tile-copy { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-width: 0; }
.status-tile-name { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.status-tile-val { font-size: 17px; font-weight: 600; color: var(--text-primary); margin-top: 3px; white-space: nowrap; }
.status-tile .ctf-dash-semaphore { gap: 6px; padding: 8px 7px; border-radius: 15px; }
.status-tile .ctf-dash-light { width: 21px; height: 21px; border-width: 2px; }

.status-readiness { display: flex; flex-direction: column; gap: 8px; }
.status-row {
  position: relative; overflow: hidden; flex: 1;
  display: flex; align-items: center; gap: 9px;
  padding: 10px; border-radius: 10px; border: none;
  background: var(--bg-secondary); cursor: pointer; text-align: left; width: 100%;
}
.status-row-bg { position: absolute; inset: 0; opacity: 1; pointer-events: none; background: transparent; }
.status-row:has(.is-ready) .status-row-bg { background: linear-gradient(120deg, rgba(0, 140, 149, .12), transparent 70%); }
.status-row:has(.is-missing) .status-row-bg { background: linear-gradient(120deg, rgba(220, 38, 38, .14), transparent 70%); }
.status-row-ic {
  width: 26px; height: 26px; flex-shrink: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: none; color: var(--text-secondary);
}
.status-row-name { flex: 1; font-size: 12px; font-weight: 600; color: var(--text-primary); z-index: 1; }
.status-row-val { font-size: 12px; z-index: 1; white-space: nowrap; color: var(--text-secondary); }
.status-row-val.is-ready { color: var(--ns-teal); }
.status-row-val.is-missing { color: #dc2626; }
.status-row-val.is-ready::before { content: "\2713  "; }
.status-row-val.is-missing::before { content: "\2715  "; }

.dash-podium-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 208px;
}
.podium-slot {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.podium-avatar {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  flex-shrink: 0;
  align-self: center;
  justify-self: center;
  line-height: 1;
  overflow: hidden;
}
.podium-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: monospace;
  text-align: center;
  word-break: break-all;
  align-self: center;
}
.podium-score {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  align-self: center;
}
.podium-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  align-self: stretch;
}
.podium-slot--1 .podium-bar { background: #f59e0b; height: 110px; }
.podium-slot--2 .podium-bar { background: #94a3b8; height: 85px; }
.podium-slot--3 .podium-bar { background: #cd7c3e; height: 62px; }

.podium-pts-label {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-top: 2px;
  text-align: center;
}
.podium-bar--empty {
  opacity: .25;
  font-size: 20px;
}
.dash-podium--fs .podium-pts-label { font-size: 32px; }

.podium-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  padding: 24px 32px 0;
  animation: podium-overlay-in .18s ease;
  overflow: hidden;
}
@keyframes podium-overlay-in {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}
.podium-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-shrink: 0;
}
.podium-overlay-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.podium-autorefresh-active {
  background: rgba(34,197,94,.12) !important;
  color: var(--success) !important;
  border-color: rgba(34,197,94,.3) !important;
}
.podium-fs-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: clamp(24px, 3vw, 60px);
  align-items: center;
  justify-content: center;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  padding: 0 2vw;
}
.dash-podium--fs {
  flex: 1;
  min-height: 0;
  padding: clamp(20px, 3vh, 60px) clamp(20px, 3vw, 60px) clamp(30px, 5vh, 80px);
}
.dash-podium--fs .dash-podium-stage {
  height: 100%;
  min-height: 0;
}
.dash-podium--fs .podium-slot {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: clamp(8px, 1.2vh, 16px);
}
.podium-fs-ranking {
  width: clamp(280px, 28vw, 460px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  border-left: 1px solid var(--border);
  padding-left: 32px;
}
.podium-fs-ranking-title {
  font-size: clamp(13px, 1.2vw, 18px);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
}
.podium-fs-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.podium-fs-rank-row:last-child { border-bottom: none; }
.podium-fs-rank-num {
  width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.podium-fs-rank-code {
  flex: 1;
  font-size: clamp(14px, 1.3vw, 20px);
  font-weight: 600;
  font-family: monospace;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.podium-fs-rank-pts {
  font-size: clamp(14px, 1.3vw, 20px);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  width: clamp(60px, 6vw, 100px);
  text-align: right;
}
.podium-fs-rank-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  width: clamp(40px, 4vw, 64px);
  text-align: right;
  flex-shrink: 0;
}
.dash-podium--fs .podium-avatar {
  width: clamp(80px, 7vw, 118px);
  height: clamp(80px, 7vw, 118px);
  font-size: clamp(56px, 5.5vw, 88px);
}
.dash-podium--fs .podium-name {
  align-self: center;
  font-size: clamp(14px, 1.4vw, 22px);
}
.dash-podium--fs .podium-score {
  align-self: center;
  font-size: clamp(12px, 1.1vw, 18px);
}
.dash-podium--fs .podium-bar {
  align-self: stretch;
  font-size: clamp(24px, 2.4vw, 42px);
}
.dash-podium--fs .podium-slot--1 .podium-bar { height: 42%; min-height: clamp(160px, 18vh, 260px); }
.dash-podium--fs .podium-slot--2 .podium-bar { height: 30%; min-height: clamp(120px, 13vh, 190px); }
.dash-podium--fs .podium-slot--3 .podium-bar { height: 22%; min-height: clamp(90px, 10vh, 140px); }

.dash-podium--fs .podium-pts-label { font-size: clamp(24px, 2.4vw, 38px); }

.adm-card {
  border-radius: 8px;
  background: var(--bg-secondary);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--border) 52%, transparent);
}

.adm-card-header {
  min-height: 50px;
  padding: 13px 16px;
  background: color-mix(in srgb, var(--bg-secondary) 82%, var(--bg-tertiary) 18%);
}

.adm-card-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.adm-card .adm-card-body,
.settings-card-body {
  padding: 16px;
}

.adm-table th {
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg-tertiary) 74%, var(--bg-secondary) 26%);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.adm-table td {
  height: 48px;
}

.btn-secondary,
.btn-danger,
.adm-card-header .btn-primary,
.adm-card-body .btn-primary,
.settings-card-body .btn-primary {
  border-radius: 8px;
}

@media (max-width: 1120px) {
  .dash-top-row {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 760px) {
  .adm-sidebar {
    width: 210px;
    min-width: 210px;
  }
  .adm-main {
    padding: 20px 16px 32px;
  }

  .readiness-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

}

/* ── Lang selector ── */
.lang-picker {
  position: relative;
}
.lang-picker-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.lang-picker-btn:hover { border-color: var(--accent); color: var(--accent); }
.lang-picker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  overflow: hidden;
  z-index: 999;
  min-width: 150px;
}
.lang-picker-dropdown.open { display: block; }
.lang-picker-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.lang-picker-dropdown button:hover { background: var(--bg-hover); color: var(--text-primary); }
.lang-picker-dropdown button.active { color: var(--accent); font-weight: 700; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .sidebar { display: none; }
  .chat-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .chat-header-left,
  .chat-header-right {
    width: 100%;
  }
  .chat-header-right {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .participant-session-title {
    white-space: normal;
  }

  .chat-workspace { position: relative; }
  .side-panel.open {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(380px, 92vw);
    height: 100%;
    z-index: 10;
    box-shadow: -12px 0 32px rgba(0,0,0,0.18);
  }

}

/* ── Sortable table headers ── */
th[data-sortable]:hover { color: var(--text-primary); }
th[data-sortable] .sort-arrow { font-size: 10px; opacity: 0.5; margin-left: 2px; }
th[data-sortable]:hover .sort-arrow { opacity: 1; }
th[data-sortable][aria-sort="asc"] .sort-arrow,
th[data-sortable][aria-sort="desc"] .sort-arrow { opacity: 1; color: var(--accent); }

/* ── Help section ── */
.help-content { flex: 1; min-width: 0; }

.help-panel { display: none; flex-direction: column; gap: 20px; }
.help-panel.active { display: flex; }

.help-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.help-panel-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.help-intro {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.help-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.help-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.help-card-icon { font-size: 22px; }
.help-card-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.help-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.help-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.help-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.help-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.help-step strong { color: var(--text-primary); }
.help-step code {
  font-size: 11px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
}

.help-note {
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-secondary));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.help-note strong { color: var(--text-primary); }

.help-subsection { display: flex; flex-direction: column; gap: 8px; }
.help-subsection h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 0; }
.help-subsection p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.help-subsection code {
  font-size: 11px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
}

.help-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.help-flow-step {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  line-height: 1.4;
}

.help-flow-step span { display: block; font-size: 10px; font-weight: 500; color: var(--text-muted); }
.help-flow-arrow { font-size: 18px; color: var(--text-muted); }

/* ── Help sidebar ── */

.help-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 900;
}
.help-sidebar-overlay.open { display: block; }

.help-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 95vw;
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
  z-index: 901;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
}
.help-sidebar.open { transform: translateX(0); }

.help-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.help-sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.help-sidebar-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-sidebar-close:hover { background: var(--bg-secondary); color: var(--text-primary); }

.help-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.help-sidebar-body .help-panel { display: none; flex-direction: column; gap: 18px; }
.help-sidebar-body .help-panel.active { display: flex; }
.help-sidebar-body .help-panel-header { display: none; }
.help-sidebar-body .help-intro { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.help-sidebar-body .help-subsection { display: flex; flex-direction: column; gap: 8px; }
.help-sidebar-body .help-subsection h3 { font-size: 13px; font-weight: 700; color: var(--text-primary); margin: 0; }
.help-sidebar-body .help-subsection ul,
.help-sidebar-body .help-subsection ol { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.help-sidebar-body .help-subsection li { margin-bottom: 2px; }
.help-sidebar-body .help-note { background: var(--bg-secondary); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; padding: 10px 14px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.help-sidebar-body .help-steps { display: flex; flex-direction: column; gap: 10px; }
.help-sidebar-body .help-step { display: flex; gap: 12px; align-items: flex-start; }
.help-sidebar-body .help-step-num { width: 22px; height: 22px; min-width: 22px; background: var(--accent); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.help-sidebar-body .help-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.help-sidebar-body .help-card { background: var(--bg-secondary); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }

/* ── Factory reset progress ── */
.factory-reset-progress-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(4px);
  padding: 20px;
}

.factory-reset-progress-card {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  padding: 26px;
}

.factory-reset-progress-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.factory-reset-progress-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.factory-reset-progress-icon.is-running {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.factory-reset-progress-icon.is-success {
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success);
}

.factory-reset-progress-icon.is-warning {
  background: color-mix(in srgb, var(--warning) 18%, transparent);
  color: var(--warning);
}

.factory-reset-progress-icon.is-error {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

.factory-reset-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: factoryResetSpin .8s linear infinite;
}

@keyframes factoryResetSpin {
  to { transform: rotate(360deg); }
}

.factory-reset-progress-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.factory-reset-progress-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.factory-reset-progress-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.factory-reset-step {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-tertiary);
  padding: 11px 12px;
}

.factory-reset-step-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 800;
}

.factory-reset-step.is-running .factory-reset-step-dot {
  border: 2px solid var(--accent);
  border-top-color: transparent;
  animation: factoryResetSpin .8s linear infinite;
}

.factory-reset-step.is-success .factory-reset-step-dot {
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success);
}

.factory-reset-step.is-warning .factory-reset-step-dot {
  background: color-mix(in srgb, var(--warning) 18%, transparent);
  color: var(--warning);
}

.factory-reset-step.is-error .factory-reset-step-dot {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

.factory-reset-step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.factory-reset-step-detail {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.factory-reset-progress-errors {
  margin-top: 14px;
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
}

.factory-reset-progress-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ── CTF Participant Sidebar ─────────────────────────────── */
.ctf-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,0.25);
}
.ctf-sidebar-overlay.open { display: block; }

.ctf-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 95vw;
  z-index: 1201;
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.ctf-sidebar.open { transform: translateX(0); }

.ctf-sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ctf-sidebar-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.ctf-sidebar-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ctf-sidebar-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  line-height: 1;
  flex-shrink: 0;
}
.ctf-sidebar-close:hover { color: var(--text-primary); }

.ctf-sidebar-score {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ctf-sidebar-score-item {
  flex: 1;
  text-align: center;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 10px 6px;
}
.ctf-sidebar-score-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.ctf-sidebar-score-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.ctf-sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 14px 20px 6px;
  flex-shrink: 0;
}

.ctf-sidebar-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ctf-sidebar-tl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle, var(--border));
  position: relative;
}
.ctf-sidebar-tl-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ctf-sidebar-tl-dot--success { background: rgba(34,197,94,0.15); }
.ctf-sidebar-tl-dot--fail    { background: rgba(239,68,68,0.15); }
.ctf-sidebar-tl-dot--hint    { background: rgba(245,158,11,0.15); }
.ctf-sidebar-tl-body { flex: 1; min-width: 0; }
.ctf-sidebar-tl-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ctf-sidebar-tl-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}
.ctf-sidebar-tl-pts {
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 3px;
}

/* ══════════════════ Award ceremony animation ══════════════════ */
.award-overlay {
  position: fixed; inset: 0; z-index: 99999; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 50% 36%, #1c1c30 0%, #0c0c16 55%, #050509 100%);
  animation: award-overlay-in 0.6s ease both;
}
.award-overlay::before {
  content: ''; position: absolute; top: -20%; left: 50%; width: 120vw; height: 90vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 38% 60% at 50% 0%, rgba(255,240,200,0.16), transparent 70%);
  pointer-events: none; animation: award-spot 6s ease-in-out infinite;
}
.award-overlay--out { animation: award-overlay-out 0.45s ease both; }
@keyframes award-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes award-overlay-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes award-spot { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }

.award-controls {
  position: absolute; top: 22px; right: 26px; z-index: 10; display: flex; gap: 6px;
  padding: 7px; border-radius: 32px;
  background: rgba(20,20,32,0.7); border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(8px); box-shadow: 0 8px 26px rgba(0,0,0,0.45);
}
.award-ctrl-btn {
  width: 48px; height: 48px; padding: 0; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  color: #fff; font-size: 19px; font-weight: 700; cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.award-ctrl-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.08); }
.award-ctrl-btn--start { background: rgba(34,197,94,0.22); border-color: rgba(34,197,94,0.5); color: #86efac; }
.award-ctrl-btn--start:hover { background: rgba(34,197,94,0.34); }
.award-ctrl-btn--close { font-size: 20px; }

.award-stage {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  width: 100%; height: 100%; max-width: 1720px;
  padding: clamp(36px, 6vh, 80px) clamp(30px, 4vw, 70px) clamp(40px, 7vh, 90px); z-index: 2;
}

.award-main {
  display: flex; flex-direction: row; align-items: flex-end; justify-content: center;
  gap: clamp(36px, 5vw, 96px); width: 100%;
}

/* Static "ready" screen shown on open — nothing runs until ▶ Start */
.award-stage--ready { justify-content: center; gap: clamp(28px, 5vh, 56px); }
.award-ready {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  font-size: clamp(20px, 2.4vw, 30px); font-weight: 600; color: #cbd5e1;
  padding: 16px 30px; border-radius: 40px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  animation: award-breathe 2s ease-in-out infinite;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.award-ready:hover { background: rgba(34,197,94,0.16); border-color: rgba(34,197,94,0.5); transform: scale(1.03); animation: none; }
.award-ready span { color: #86efac; font-size: 1.1em; }
.award-ready b { color: #fff; font-weight: 800; }

.award-title {
  font-size: clamp(46px, 6vw, 92px); font-weight: 900; letter-spacing: 1px;
  text-align: center; line-height: 1.1;
  background: linear-gradient(100deg, #fde047 0%, #fbbf24 25%, #fffbe6 50%, #fbbf24 75%, #f59e0b 100%);
  background-size: 220% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 36px rgba(251,191,36,0.5));
  animation: award-title-in 0.9s cubic-bezier(.2,.9,.3,1.4) both, award-shimmer 3.2s linear infinite;
  transition: font-size 0.6s ease, margin 0.6s ease;
}
.award-title--top { font-size: clamp(32px, 4vw, 58px); margin-bottom: 4px; }
.award-title-text { letter-spacing: 4px; }
.award-trophy { display: inline-block; margin: 0 0.42em; -webkit-text-fill-color: initial; }
@keyframes award-title-in { 0% { transform: scale(0.4) rotate(-6deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes award-shimmer { to { background-position: 220% center; } }

@keyframes award-breathe { 0%,100% { opacity: 0.5; transform: scale(0.99); } 50% { opacity: 1; transform: scale(1.02); } }

.award-podium {
  display: flex; align-items: flex-end; justify-content: center; gap: clamp(24px, 4vw, 64px);
}
.award-place { display: flex; flex-direction: column; align-items: center; gap: 16px; transition: transform 0.5s cubic-bezier(.2,.9,.3,1.3), filter 0.4s ease; }
.award-place--spot { transform: scale(1.08) translateY(-8px); filter: drop-shadow(0 0 44px rgba(255,240,180,0.6)); }

.award-figure { display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; transform: translateY(34px) scale(0.7); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2,.9,.3,1.5); position: relative; }
.award-revealed .award-figure { opacity: 1; transform: translateY(0) scale(1); }
.award-avatar {
  width: clamp(88px, 8.5vw, 128px); height: clamp(88px, 8.5vw, 128px); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: clamp(48px, 5.2vw, 70px);
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.16), rgba(255,255,255,0.04));
  border: 3px solid rgba(255,255,255,0.22); position: relative;
}
.award-name { font-size: clamp(26px, 3vw, 40px); font-weight: 800; color: #fff; text-align: center; max-width: 260px; word-break: break-word; }
.award-pts { font-size: clamp(24px, 2.6vw, 36px); font-weight: 800; color: #fbbf24; text-shadow: 0 0 16px rgba(251,191,36,0.6); }

.award-pedestal {
  width: clamp(168px, 18vw, 250px); border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 22px; gap: 8px; color: #fff;
  transform-origin: bottom; animation: award-pedestal-rise 1s cubic-bezier(.2,.9,.3,1.2) both;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.25), 0 16px 40px rgba(0,0,0,0.5);
}
@keyframes award-pedestal-rise { 0% { transform: scaleY(0); opacity: 0; } 100% { transform: scaleY(1); opacity: 1; } }

.award-medal { font-size: clamp(58px, 6.5vw, 88px); line-height: 1; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35)); }
.award-medal--hidden { opacity: 0; transform: scale(0.4); transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.2,.9,.3,1.6); }
.award-revealed .award-medal--hidden { opacity: 1; transform: scale(1); }

.award-winner .award-avatar {
  border-color: #fde047;
  box-shadow: 0 0 0 5px rgba(253,224,71,0.3), 0 0 48px rgba(251,191,36,0.75);
  animation: award-winner-glow 1.5s ease-in-out infinite;
}
.award-winner .award-figure::before {
  content: '👑'; position: absolute; top: clamp(-58px, -4vw, -48px); left: 50%; transform: translateX(-50%);
  font-size: clamp(42px, 5vw, 64px);
  animation: award-crown-drop 0.9s cubic-bezier(.2,.9,.3,1.6) both, award-crown-float 2.4s ease-in-out infinite 0.9s;
}
@keyframes award-winner-glow { 0%,100% { box-shadow: 0 0 0 5px rgba(253,224,71,0.3), 0 0 40px rgba(251,191,36,0.6); } 50% { box-shadow: 0 0 0 8px rgba(253,224,71,0.5), 0 0 70px rgba(251,191,36,0.95); } }
@keyframes award-crown-drop { 0% { transform: translateX(-50%) translateY(-70px) rotate(-25deg); opacity: 0; } 100% { transform: translateX(-50%) translateY(0) rotate(0); opacity: 1; } }
@keyframes award-crown-float { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-8px); } }

.award-runners { display: flex; flex-direction: column; gap: 11px; width: clamp(360px, 34vw, 520px); flex-shrink: 0; }
.award-runner {
  display: flex; align-items: center; gap: 18px; padding: 15px 26px; border-radius: 14px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  opacity: 0;
}
.award-runner--show { animation: award-runner-in 0.6s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes award-runner-in { from { opacity: 0; transform: translateX(48px) scale(0.96); } to { opacity: 1; transform: translateX(0) scale(1); } }
.award-runner-rank { font-size: 25px; font-weight: 800; color: #9ca3af; min-width: 50px; }
.award-runner-av { font-size: 34px; }
.award-runner-name { flex: 1; font-size: 24px; font-weight: 700; color: #fff; }
.award-runner-pts { font-size: 22px; font-weight: 700; color: #fbbf24; }

/* Winner flash + screen shake */
.award-flash { position: fixed; inset: 0; z-index: 4; background: radial-gradient(circle at 50% 45%, rgba(255,255,240,0.85), transparent 60%); pointer-events: none; animation: award-flash-fade 0.7s ease both; }
@keyframes award-flash-fade { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
.award-shake { animation: award-overlay-in 0.6s ease both, award-shake-kf 0.6s ease-in-out; }
@keyframes award-shake-kf {
  0%,100% { transform: translate(0,0); } 15% { transform: translate(-9px, 5px); } 30% { transform: translate(8px, -6px); }
  45% { transform: translate(-7px, 4px); } 60% { transform: translate(6px, -3px); } 75% { transform: translate(-4px, 2px); }
}

.award-confetti { position: fixed; top: -24px; z-index: 5; opacity: 0; will-change: transform; animation-name: award-confetti-fall; animation-timing-function: cubic-bezier(.3,.1,.6,1); animation-fill-mode: both; }
@keyframes award-confetti-fall {
  0% { transform: translateY(-24px) translateX(0) rotate(0); opacity: 1; }
  100% { transform: translateY(106vh) translateX(var(--drift, 0)) rotate(var(--rot, 360deg)); opacity: 1; }
}

/* Uppercase header style across the admin portal — section page titles and
   card/table titles, matching the "Quick actions" eyebrow look. */
.adm-card-title {
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ══════════════════ CTF countdown timer ══════════════════ */
.ctf-timer-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 20px;
  font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.4;
  border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-secondary);
  transition: background .2s, border-color .2s, color .2s;
}
.ctf-timer-chip.is-green  { color:#16a34a; border-color:rgba(22,163,74,.45); background:rgba(22,163,74,.12); }
.ctf-timer-chip.is-orange { color:#d97706; border-color:rgba(217,119,6,.5);  background:rgba(217,119,6,.13); }
.ctf-timer-chip.is-red    { color:#dc2626; border-color:rgba(220,38,38,.55); background:rgba(220,38,38,.14); }
.ctf-timer-chip.is-paused { color:#64748b; border-color:rgba(100,116,139,.4); background:rgba(100,116,139,.12); }
[data-theme="dark"] .ctf-timer-chip.is-green  { color:#4ade80; }
[data-theme="dark"] .ctf-timer-chip.is-orange { color:#fbbf24; }
[data-theme="dark"] .ctf-timer-chip.is-red    { color:#f87171; }
[data-theme="dark"] .ctf-timer-chip.is-paused { color:#94a3b8; }
.ctf-timer-chip.is-pulsing { animation: ctf-timer-pulse 1s ease-in-out infinite; }
@keyframes ctf-timer-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); transform: scale(1); }
  50% { box-shadow: 0 0 0 4px rgba(220,38,38,.18); transform: scale(1.06); }
}

/* Control Center: two columns — left semaphores, right timer (double height) + reg code */
.cc-control-layout {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}
.cc-semaphore-row,
.cc-ops-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}
/* Timer + registration code only (the workshop-limits card was removed). */
.cc-ops-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cc-semaphore-row > .challenge-overview-card,
.cc-ops-row > .challenge-overview-card,
.cc-ops-row > .ctf-timer-banner {
  min-height: 210px;
}
@media (max-width: 860px) {
  .cc-semaphore-row,
  .cc-ops-row {
    grid-template-columns: 1fr;
  }
}

.ctf-timer-banner {
  display: flex; flex-direction: column; justify-content: flex-start; gap: 0;
  padding: 0; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg-secondary);
  overflow: hidden;
  transition: border-color .25s, background .25s;
}
.ctf-timer-content { display: flex; flex: 1; flex-direction: column; justify-content: space-between; gap: 20px; padding: 22px; min-height: 0; }
.ctf-timer-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; flex: 1; }
.ctf-timer-head { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ctf-timer-icon-shell {
  display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px;
  border-radius: 12px; background: var(--bg-tertiary); color: var(--text-muted); flex: 0 0 50px;
  transition: color .25s, background .25s;
}
.ctf-timer-banner-ic { color: currentColor; flex-shrink: 0; transition: color .25s; }
.ctf-timer-display { font-size: clamp(38px, 4.6vw, 58px); font-weight: 900; line-height: .95; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.ctf-timer-status { max-width: 360px; font-size: 12px; color: var(--text-muted); margin-top: 7px; line-height: 1.4; }
.ctf-timer-ring {
  --timer-pct: 0deg;
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: conic-gradient(var(--text-muted) var(--timer-pct), color-mix(in srgb, var(--border) 45%, transparent) 0);
  flex: 0 0 auto;
  justify-self: end;
  transition: background .25s;
}
.ctf-timer-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: var(--bg-secondary);
}
.ctf-timer-ring span { display: none; }
.ctf-timer-ring strong { position: relative; z-index: 1; color: var(--text-primary); font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }

.ctf-timer-banner.is-green  { border-color:rgba(22,163,74,.5);  background:linear-gradient(120deg,rgba(22,163,74,.10),transparent 70%); }
.ctf-timer-banner.is-orange { border-color:rgba(217,119,6,.55); background:linear-gradient(120deg,rgba(217,119,6,.12),transparent 70%); }
.ctf-timer-banner.is-red    { border-color:rgba(220,38,38,.6);  background:linear-gradient(120deg,rgba(220,38,38,.14),transparent 70%); }
.ctf-timer-banner.is-paused { border-color:rgba(100,116,139,.4); }
.ctf-timer-banner.is-green  .ctf-timer-display, .ctf-timer-banner.is-green  .ctf-timer-icon-shell { color:#16a34a; }
.ctf-timer-banner.is-orange .ctf-timer-display, .ctf-timer-banner.is-orange .ctf-timer-icon-shell { color:#d97706; }
.ctf-timer-banner.is-red    .ctf-timer-display, .ctf-timer-banner.is-red    .ctf-timer-icon-shell { color:#dc2626; }
.ctf-timer-banner.is-paused .ctf-timer-display, .ctf-timer-banner.is-paused .ctf-timer-icon-shell { color:#64748b; }
.ctf-timer-banner.is-green  .ctf-timer-icon-shell { background: rgba(22,163,74,.12); }
.ctf-timer-banner.is-orange .ctf-timer-icon-shell { background: rgba(217,119,6,.13); }
.ctf-timer-banner.is-red    .ctf-timer-icon-shell { background: rgba(220,38,38,.14); }
.ctf-timer-banner.is-paused .ctf-timer-icon-shell { background: rgba(100,116,139,.12); }
.ctf-timer-banner.is-green  .ctf-timer-ring { background:conic-gradient(#16a34a var(--timer-pct), color-mix(in srgb, var(--border) 45%, transparent) 0); }
.ctf-timer-banner.is-orange .ctf-timer-ring { background:conic-gradient(#d97706 var(--timer-pct), color-mix(in srgb, var(--border) 45%, transparent) 0); }
.ctf-timer-banner.is-red    .ctf-timer-ring { background:conic-gradient(#dc2626 var(--timer-pct), color-mix(in srgb, var(--border) 45%, transparent) 0); }
.ctf-timer-banner.is-paused .ctf-timer-ring { background:conic-gradient(#64748b var(--timer-pct), color-mix(in srgb, var(--border) 45%, transparent) 0); }
[data-theme="dark"] .ctf-timer-banner.is-green  .ctf-timer-display, [data-theme="dark"] .ctf-timer-banner.is-green  .ctf-timer-icon-shell { color:#4ade80; }
[data-theme="dark"] .ctf-timer-banner.is-orange .ctf-timer-display, [data-theme="dark"] .ctf-timer-banner.is-orange .ctf-timer-icon-shell { color:#fbbf24; }
[data-theme="dark"] .ctf-timer-banner.is-red    .ctf-timer-display, [data-theme="dark"] .ctf-timer-banner.is-red    .ctf-timer-icon-shell { color:#f87171; }
.ctf-timer-banner.is-pulsing { animation: ctf-timer-banner-pulse 1s ease-in-out infinite; }
@keyframes ctf-timer-banner-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(220,38,38,0);} 50%{box-shadow:0 0 0 6px rgba(220,38,38,.14);} }

.ctf-timer-card-header { min-height: 50px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.ctf-timer-quickrow { display: flex; gap: 5px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.ctf-timer-preset-group,
.ctf-timer-adjust-group { display: inline-flex; align-items: center; gap: 5px; flex-wrap: nowrap; }

.ctf-qbtn {
  min-height: 34px; padding: 6px 10px; border-radius: 8px; border:1px solid var(--border); background:var(--bg-secondary);
  color: var(--text-secondary); font-size:12px; font-weight:700; cursor:pointer; transition:.15s;
}
.ctf-qbtn:hover { border-color: var(--accent); color: var(--accent); }
.ctf-qbtn-reset { width: 36px; padding: 5px 0; font-size: 15px; line-height: 1; }

.cc-ops-row .ctf-timer-content {
  gap: 14px;
  padding: 18px;
}

.cc-ops-row .ctf-timer-display {
  font-size: clamp(34px, 3.2vw, 46px);
}
.cc-ops-row .ctf-timer-quickrow {
  justify-content: space-between;
  flex-wrap: nowrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
@media (max-width: 1180px) {
  .ctf-timer-main { grid-template-columns: 1fr; }
  .ctf-timer-ring { justify-self: start; }
  .ctf-timer-quickrow { justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .ctf-timer-content { padding: 18px; }
  .ctf-timer-head { align-items: flex-start; }
  .ctf-timer-icon-shell { width: 42px; height: 42px; flex-basis: 42px; }
  .ctf-timer-display { font-size: 36px; }
}

.timer-splash {
  position: fixed; inset: 0; z-index: 100000; display:flex; align-items:center; justify-content:center;
  background: rgba(8,8,16,.82); animation: timer-splash-in .3s ease both; cursor: pointer;
}
.timer-splash--out { animation: timer-splash-out .5s ease both; }
@keyframes timer-splash-in { from{opacity:0;} to{opacity:1;} }
@keyframes timer-splash-out { from{opacity:1;} to{opacity:0;} }
.timer-splash-card { text-align:center; animation: timer-splash-pop .5s cubic-bezier(.2,.9,.3,1.5) both; }
@keyframes timer-splash-pop { 0%{transform:scale(.5);opacity:0;} 100%{transform:scale(1);opacity:1;} }
.timer-splash-emoji { font-size: 84px; animation: timer-splash-shake .6s ease-in-out 2; }
@keyframes timer-splash-shake { 0%,100%{transform:rotate(0);} 25%{transform:rotate(-12deg);} 75%{transform:rotate(12deg);} }
.timer-splash-title { font-size: clamp(40px, 7vw, 80px); font-weight: 900; letter-spacing: 2px; color:#ef4444; text-shadow:0 0 30px rgba(239,68,68,.5); }
.timer-splash-sub { font-size: clamp(16px, 2.4vw, 24px); color:#e5e7eb; margin-top: 8px; }

/* Netskope public template alignment */
.btn-primary,
.adm-card-header .btn-primary,
.adm-card-body .btn-primary,
.settings-card-body .btn-primary {
  background: var(--ns-deep-blue);
  border: 1px solid var(--ns-deep-blue);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(8, 26, 89, 0.14);
  transition: background .18s, border-color .18s, color .18s, transform .1s, box-shadow .18s;
}

.btn-primary:hover,
.adm-card-header .btn-primary:hover,
.adm-card-body .btn-primary:hover,
.settings-card-body .btn-primary:hover {
  background: var(--ns-teal);
  border-color: var(--ns-teal);
  opacity: 1;
  box-shadow: 0 8px 18px rgba(0, 140, 149, 0.18);
}

.btn-secondary,
.ctf-qbtn {
  border-color: color-mix(in srgb, var(--ns-cyan) 32%, var(--border));
  background: color-mix(in srgb, var(--bg-secondary) 88%, var(--ns-light-cyan) 12%);
  color: var(--text-primary);
}

.btn-secondary:hover,
.ctf-qbtn:hover {
  border-color: var(--ns-cyan);
  color: var(--ns-teal);
  background: color-mix(in srgb, var(--bg-secondary) 78%, var(--ns-light-cyan) 22%);
}

.admin-section.active > .standard-product-card:first-child,
.admin-section.active > .settings-product-card:first-child,
.admin-section.active > .admin-product-card:first-child,
.admin-section.active > .about-product-card:first-child {
  width: calc(100% + 236px + clamp(22px, 3vw, 42px));
  margin-left: calc(-236px - clamp(22px, 3vw, 42px));
  position: sticky;
  top: 0;
  z-index: 20;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-section.active > .standard-product-card:first-child::before,
.admin-section.active > .settings-product-card:first-child::before,
.admin-section.active > .admin-product-card:first-child::before,
.admin-section.active > .about-product-card:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -22px;
  height: 22px;
  background: var(--bg-primary);
  pointer-events: none;
}

.standard-product-hero,
.settings-product-hero,
.admin-product-hero,
.about-product-hero {
  height: 130px;
  min-height: 130px;
  align-items: center;
  overflow: hidden;
  padding-left: calc(236px + clamp(22px, 3vw, 42px) + 24px);
  background-image: var(--admin-title-gradient);
  background-size: 100vw 100%;
  background-position: left center;
  background-repeat: no-repeat;
  border: 1px solid var(--admin-hero-border);
  border-left: 0;
  border-radius: 0 10px 10px 0;
}

[data-theme="dark"] .standard-product-hero,
[data-theme="dark"] .settings-product-hero,
[data-theme="dark"] .admin-product-hero,
[data-theme="dark"] .about-product-hero {
  background-image: var(--admin-title-gradient);
  background-size: 100vw 100%;
  background-position: left center;
  background-repeat: no-repeat;
}

.standard-product-kicker,
.settings-product-kicker,
.admin-product-kicker,
.about-product-kicker {
  color: rgba(8, 26, 89, 0.72);
}

.standard-product-copy h2,
.settings-product-copy h2,
.admin-product-copy h2,
.about-product-copy h2 {
  color: var(--ns-deep-blue);
}

.standard-product-copy p,
.settings-product-copy p,
.admin-product-copy p,
.about-product-copy p {
  color: rgba(8, 26, 89, 0.78);
  line-height: 1.45;
}

.standard-help-tile,
.standard-icon-tile,
.about-version-card,
.admin-help-tile,
.settings-help-tile,
.about-help-tile {
  border-color: rgba(8, 26, 89, 0.16);
  background: rgba(255, 255, 255, 0.56);
  color: var(--ns-deep-blue);
}

.about-version-value {
  color: var(--ns-deep-blue);
}

.standard-help-tile:hover,
.standard-icon-tile:hover,
.admin-help-tile:hover,
.settings-help-tile:hover,
.about-help-tile:hover {
  border-color: rgba(8, 26, 89, 0.28);
  background: rgba(255, 255, 255, 0.52);
}

.challenge-overview-card:has(.ctf-dash-run.active),
.challenge-overview-card:has(.reg-dash-open.active),
.status-tile:has(.ctf-dash-run.active),
.status-tile:has(.reg-dash-open.active),
.dashboard-leaderboard-card,
.ctf-timer-banner.is-green {
  border-color: rgba(0, 140, 149, .48);
  background: linear-gradient(120deg, rgba(0, 140, 149, .12), transparent 70%);
}

.challenge-overview-card:has(.ctf-dash-standby.active),
.status-tile:has(.ctf-dash-standby.active),
.ctf-timer-banner.is-orange {
  border-color: rgba(255, 130, 0, .54);
  background: linear-gradient(120deg, rgba(255, 130, 0, .13), transparent 70%);
}

.ctf-timer-banner.is-green .ctf-timer-display,
.ctf-timer-banner.is-green .ctf-timer-icon-shell,
.ctf-timer-banner.is-paused .ctf-timer-display,
.ctf-timer-banner.is-paused .ctf-timer-icon-shell {
  color: var(--ns-teal);
}

.ctf-timer-banner.is-orange .ctf-timer-display,
.ctf-timer-banner.is-orange .ctf-timer-icon-shell {
  color: var(--ns-orange);
}

.ctf-timer-banner.is-green .ctf-timer-ring,
.ctf-timer-banner.is-paused .ctf-timer-ring {
  background: conic-gradient(var(--ns-teal) var(--timer-pct), color-mix(in srgb, var(--border) 45%, transparent) 0);
}

.ctf-timer-banner.is-orange .ctf-timer-ring {
  background: conic-gradient(var(--ns-orange) var(--timer-pct), color-mix(in srgb, var(--border) 45%, transparent) 0);
}

.ctf-dash-run,
.reg-dash-open {
  background: var(--ns-teal);
}

.ctf-dash-standby {
  background: var(--ns-orange);
}

.dashboard-leaderboard-card {
  border-color: var(--border);
  background: var(--bg-secondary);
}

.adm-nav-item,
.adm-nav-item:hover {
  background: transparent;
}

.adm-nav-item:hover {
  color: var(--ns-teal);
}

.adm-nav-item.active {
  background: transparent;
  color: var(--ns-deep-blue);
  font-weight: 700;
}

.adm-nav-item.active span {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
}

.adm-nav-item.active::before {
  background: transparent;
}

.adm-nav-item.active svg {
  stroke: var(--ns-teal);
}

.standard-product-hero:not(:has(.standard-action-tile)),
.settings-product-hero,
.admin-product-hero,
.about-product-hero {
  grid-template-columns: minmax(0, 1fr) 104px;
}

.standard-product-hero:has(.standard-hero-actions),
.settings-product-hero:has(.standard-hero-actions),
.admin-product-hero:has(.standard-hero-actions) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.about-product-hero:has(.about-version-card) {
  grid-template-columns: minmax(0, 1fr) 104px 104px;
}

.standard-help-tile,
.settings-help-tile,
.admin-help-tile,
.about-help-tile,
.about-version-card {
  width: 104px;
  height: 80px;
  min-width: 104px;
  padding: 18px;
  align-self: center;
  justify-self: end;
}

/* Info icon for challenge variables */
.info-icon-wrap {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  cursor: help;
  position: relative;
  vertical-align: middle;
}

.info-icon {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  flex-shrink: 0;
  transition: stroke 0.2s ease;
}

.info-icon-wrap:hover .info-icon {
  stroke: var(--ns-teal);
}

.info-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  width: 310px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--ns-cyan) 24%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, #ffffff 94%, var(--ns-light-cyan) 6%);
  color: var(--ns-deep-blue);
  box-shadow: 0 12px 28px rgba(8, 26, 89, 0.16);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  z-index: 80;
  text-align: left;
}
.info-popover strong {
  color: var(--ns-deep-blue);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.info-popover span {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: #54565a;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}
.info-popover code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--ns-cyan) 22%, transparent);
  border-radius: 5px;
  background: var(--ns-soft-blue);
  color: var(--ns-teal);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}
.info-icon-wrap::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: color-mix(in srgb, #ffffff 94%, var(--ns-light-cyan) 6%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 81;
}

.info-icon-wrap:hover .info-popover,
.info-icon-wrap:hover::before {
  opacity: 1;
  visibility: visible;
}
.info-icon-wrap:hover .info-popover {
  transform: translateX(-50%) translateY(-2px);
}

/* Dark theme surfaces: participant + admin */
[data-theme="dark"] {
  color-scheme: dark;
}

[data-theme="dark"] body,
[data-theme="dark"] #app,
[data-theme="dark"] #admin-screen,
[data-theme="dark"] .main-area,
[data-theme="dark"] .adm-main {
  background:
    linear-gradient(180deg, rgba(0, 181, 212, 0.035), transparent 260px),
    var(--bg-primary);
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .adm-sidebar,
[data-theme="dark"] .chat-header,
[data-theme="dark"] .side-panel {
  background: color-mix(in srgb, var(--bg-secondary) 92%, #000 8%);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .adm-sidebar {
  box-shadow: 12px 0 34px rgba(0,0,0,0.22);
}

[data-theme="dark"] .chat-header {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent),
    color-mix(in srgb, var(--bg-secondary) 90%, #000 10%);
  box-shadow: 0 12px 28px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.04);
}

[data-theme="dark"] .sidebar-header,
[data-theme="dark"] .sidebar-footer,
[data-theme="dark"] .adm-sidebar-logo,
[data-theme="dark"] .adm-sidebar-footer,
[data-theme="dark"] .adm-card-header,
[data-theme="dark"] .admin-form-actions {
  border-color: var(--border-subtle);
}

[data-theme="dark"] .sidebar-action:hover,
[data-theme="dark"] .adm-footer-btn:hover,
[data-theme="dark"] .adm-nav-item:hover,
[data-theme="dark"] .icon-btn:hover,
[data-theme="dark"] .btn-secondary:hover {
  background: color-mix(in srgb, var(--bg-hover) 86%, var(--accent) 5%);
}

[data-theme="dark"] .adm-nav-label,
[data-theme="dark"] .participant-session-kicker,
[data-theme="dark"] .empty-kicker,
[data-theme="dark"] .admin-product-kicker,
[data-theme="dark"] .standard-product-kicker,
[data-theme="dark"] .about-product-kicker {
  color: color-mix(in srgb, var(--text-muted) 82%, var(--accent) 18%);
}

[data-theme="dark"] .adm-nav-item.active {
  background: linear-gradient(135deg, var(--ns-teal), color-mix(in srgb, var(--accent) 76%, #0f766e));
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(0, 181, 212, 0.22), inset 0 1px 0 rgba(255,255,255,0.18);
}

[data-theme="dark"] .btn-primary{
  background: linear-gradient(135deg, var(--ns-teal), var(--accent));
  border-color: color-mix(in srgb, var(--accent) 74%, #fff 8%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 181, 212, 0.18);
}

[data-theme="dark"] .btn-primary:hover{
  background: linear-gradient(135deg, color-mix(in srgb, var(--ns-teal) 82%, #fff 8%), color-mix(in srgb, var(--accent) 86%, #fff 10%));
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .ctf-state-control {
  background: color-mix(in srgb, var(--bg-tertiary) 82%, #000 18%);
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .adm-card,
[data-theme="dark"] .admin-create-panel,
[data-theme="dark"] .settings-danger-zone,
[data-theme="dark"] .settings-danger-action,
[data-theme="dark"] .about-details-card,
[data-theme="dark"] .about-info-card,
[data-theme="dark"] .about-actions-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent 120px),
    color-mix(in srgb, var(--bg-secondary) 86%, #000 14%);
  border-color: var(--border);
  box-shadow: 0 14px 36px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.04);
}

[data-theme="dark"] .adm-card-header,
[data-theme="dark"] .admin-form-actions {
  background: color-mix(in srgb, var(--bg-tertiary) 52%, transparent);
}

[data-theme="dark"] .standard-product-hero,
[data-theme="dark"] .settings-product-hero,
[data-theme="dark"] .admin-product-hero,
[data-theme="dark"] .about-product-hero {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent), transparent 48%),
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent),
    color-mix(in srgb, var(--bg-secondary) 86%, #000 14%);
  border-color: var(--border-subtle);
}

[data-theme="dark"] .standard-icon-tile,
[data-theme="dark"] .standard-help-tile,
[data-theme="dark"] .settings-help-tile,
[data-theme="dark"] .admin-help-tile,
[data-theme="dark"] .about-version-card,
[data-theme="dark"] .about-help-tile,
[data-theme="dark"] .about-capability {
  background: color-mix(in srgb, var(--bg-tertiary) 76%, var(--accent) 6%);
  border-color: color-mix(in srgb, var(--border) 76%, var(--accent) 18%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.045);
}

[data-theme="dark"] .standard-icon-tile:hover,
[data-theme="dark"] .standard-help-tile:hover,
[data-theme="dark"] .settings-help-tile:hover,
[data-theme="dark"] .admin-help-tile:hover,
[data-theme="dark"] .about-help-tile:hover {
  background: color-mix(in srgb, var(--bg-hover) 72%, var(--accent) 10%);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 12px 26px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.06);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .settings-card-body input[type="text"],
[data-theme="dark"] .settings-card-body input[type="password"],
[data-theme="dark"] .settings-card-body input[type="number"],
[data-theme="dark"] .admin-create-panel input,
[data-theme="dark"] .challenge-admin-table .adm-inline-input {
  background: color-mix(in srgb, var(--input-bg) 88%, #000 12%);
  border-color: var(--border);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: color-mix(in srgb, var(--text-muted) 78%, transparent);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] .adm-inline-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.04);
  outline: none;
}

[data-theme="dark"] select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

[data-theme="dark"] .adm-table th,
[data-theme="dark"] .challenge-admin-table th {
  background: color-mix(in srgb, var(--bg-tertiary) 78%, #000 22%);
  border-color: var(--border);
  color: color-mix(in srgb, var(--text-muted) 88%, var(--accent) 12%);
}

[data-theme="dark"] .adm-table td,
[data-theme="dark"] .challenge-admin-table td {
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

[data-theme="dark"] .adm-table tr:hover td,
[data-theme="dark"] .challenge-admin-table tbody tr:hover td {
  background: color-mix(in srgb, var(--bg-hover) 72%, var(--accent) 5%);
}

[data-theme="dark"] .user-avatar,
[data-theme="dark"] .row-icon-btn {
  background: color-mix(in srgb, var(--bg-tertiary) 74%, var(--accent) 7%);
  border-color: color-mix(in srgb, var(--border) 74%, var(--accent) 16%);
}

[data-theme="dark"] .row-icon-btn:hover {
  background: color-mix(in srgb, var(--bg-hover) 72%, var(--accent) 8%);
}

[data-theme="dark"] .challenge-text-key-value,
[data-theme="dark"] .info-popover,
[data-theme="dark"] .row-icon-btn[data-tooltip]::before {
  background: color-mix(in srgb, var(--bg-secondary) 94%, var(--accent) 6%);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
  color: var(--text-primary);
  box-shadow: 0 18px 36px rgba(0,0,0,0.28);
}

[data-theme="dark"] .info-popover strong,
[data-theme="dark"] .info-popover span {
  color: var(--text-secondary);
}

[data-theme="dark"] .info-popover code {
  background: color-mix(in srgb, var(--bg-tertiary) 86%, var(--accent) 8%);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  color: var(--accent);
}

[data-theme="dark"] .info-icon-wrap::before {
  border-top-color: color-mix(in srgb, var(--bg-secondary) 94%, var(--accent) 6%);
}

[data-theme="dark"] .settings-clear-warning {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
  color: var(--text-secondary);
}

[data-theme="dark"] .adm-sidebar {
  position: relative;
  z-index: 40;
}

[data-theme="dark"] .adm-sidebar-logo {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 11%, transparent), transparent 54%),
    linear-gradient(180deg, rgba(255,255,255,0.045), transparent),
    color-mix(in srgb, var(--bg-secondary) 90%, #000 10%);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.055);
  z-index: 45;
}

[data-theme="dark"] .adm-sidebar-logo span {
  color: var(--text-primary);
}

[data-theme="dark"] .adm-sidebar-logo span span {
  color: var(--text-muted);
}

[data-theme="dark"] .standard-product-copy h2,
[data-theme="dark"] .settings-product-copy h2,
[data-theme="dark"] .admin-product-copy h2,
[data-theme="dark"] .about-product-copy h2,
[data-theme="dark"] .about-version-value {
  color: var(--text-primary);
}

[data-theme="dark"] .standard-product-copy p,
[data-theme="dark"] .settings-product-copy p,
[data-theme="dark"] .admin-product-copy p,
[data-theme="dark"] .about-product-copy p {
  color: var(--text-secondary);
}

[data-theme="dark"] .standard-product-kicker,
[data-theme="dark"] .settings-product-kicker,
[data-theme="dark"] .admin-product-kicker,
[data-theme="dark"] .about-product-kicker {
  color: color-mix(in srgb, var(--text-muted) 76%, var(--accent) 24%);
}

[data-theme="dark"] .standard-icon-tile,
[data-theme="dark"] .standard-help-tile,
[data-theme="dark"] .settings-help-tile,
[data-theme="dark"] .admin-help-tile,
[data-theme="dark"] .about-help-tile,
[data-theme="dark"] .about-version-card {
  color: color-mix(in srgb, var(--accent) 82%, #ffffff 12%);
}

[data-theme="dark"] .standard-icon-tile svg,
[data-theme="dark"] .standard-help-tile svg,
[data-theme="dark"] .settings-help-tile svg,
[data-theme="dark"] .admin-help-tile svg,
[data-theme="dark"] .about-help-tile svg,
[data-theme="dark"] .about-version-card svg {
  stroke: currentColor;
}

[data-theme="dark"] .settings-help-tile::after,
[data-theme="dark"] .admin-help-tile::after,
[data-theme="dark"] .about-help-tile::after,
[data-theme="dark"] .standard-help-tile::after {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: color-mix(in srgb, var(--accent) 78%, #ffffff 18%);
}

/* ══════════════════════════════════════
   Participant challenge board
   (the participant's main view)
══════════════════════════════════════ */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar.collapsed .sidebar-nav {
  padding: 10px;
  gap: 8px;
  align-items: center;
}

.ctf-board {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 24px 40px;
}
.ctf-board-inner {
  max-width: 820px;
  margin: 0 auto;
}
.ctf-board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.ctf-board-title {
  font-size: 28px;
  font-weight: 750;
  color: var(--text-primary);
  margin: 6px 0 4px;
  line-height: 1.15;
}
.ctf-board-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}
.ctf-board-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.ctf-board-progress:not(:empty) {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
}
.ctf-board-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.ctf-board-tabs button {
  flex: 1;
  padding: 9px;
  font-size: 13px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
}
.ctf-board-tabs button + button { border-left: 1px solid var(--border); }
.ctf-board-tabs button.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}
.ctf-board-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 640px) {
  .ctf-board { padding: 18px 16px 32px; }
  .ctf-board-head { flex-direction: column; }
  .ctf-board-title { font-size: 22px; }
}

/* Wrong answer submitted by the participant (admin → Participants → Detail) */
.ctf-sidebar-tl-answer {
  margin-top: 4px;
  padding: 3px 8px;
  display: inline-block;
  max-width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
