:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --ink: #171717;
  --muted: #6f6f69;
  --line: #deded8;
  --soft: #eeeeea;
  --green: #0d8f70;
  --green-dark: #08624e;
  --danger: #b94343;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 6%, rgba(13,143,112,.06), transparent 26rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar {
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(247,247,244,.88);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar > * { min-width: 0; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  font-weight: 650;
  font-size: 18px;
}
.brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { width: 25px; height: 25px; position: relative; display: inline-block; }
.brand-mark i { position: absolute; width: 13px; height: 13px; border: 1.8px solid var(--ink); border-radius: 50%; }
.brand-mark i:nth-child(1) { left: 0; top: 6px; }
.brand-mark i:nth-child(2) { right: 0; top: 6px; }
.brand-mark i:nth-child(3) { left: 6px; top: 0; }
nav { display: flex; gap: 5px; }
.nav-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 13px;
  border-radius: 9px;
  font-size: 13px;
}
.nav-link:hover, .nav-link.active { color: var(--ink); background: var(--soft); }
.system-pill { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.topbar-actions { min-width: 0; justify-self: end; display: flex; align-items: center; gap: 14px; }
#status-dot, #admin-status-dot { width: 8px; height: 8px; border-radius: 99px; background: #c79e3a; box-shadow: 0 0 0 4px rgba(199,158,58,.12); }
#status-dot.ok, #admin-status-dot.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(13,143,112,.12); }
.account-button { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 12px; font-size: 11px; }
.account-menu { min-width: 0; display: flex; align-items: center; gap: 9px; font-size: 11px; }
.account-menu > span:first-child { font-weight: 650; }
#account-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-state { color: #9b741d; background: #f5ecd8; padding: 5px 7px; border-radius: 6px; }
.account-state.approved { color: var(--green-dark); background: #dff3eb; }
main { max-width: 1320px; margin: 0 auto; padding: 0 34px 80px; }
.hero { padding: 104px 0 82px; max-width: 910px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.hero h1 { font-size: clamp(48px, 6vw, 78px); line-height: 1.01; letter-spacing: -.055em; margin: 21px 0 26px; font-weight: 560; }
.hero h1 span { color: #77776f; }
.hero > p { max-width: 680px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.prize-banner {
  width: min(860px, 100%);
  margin-top: 34px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  color: white;
  background:
    radial-gradient(circle at 1px 1px, rgba(141,219,195,.09) 1px, transparent 0) 0 0 / 16px 16px,
    linear-gradient(135deg, #1b1d1b, #131413);
  border: 1px solid #303330;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.12), inset 0 0 0 1px rgba(255,255,255,.025);
  position: relative;
  overflow: hidden;
}
.prize-banner::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #8ddbc3; box-shadow: 0 0 18px #8ddbc3; }
.prize-chains { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: .5; }
.prize-chains i {
  position: absolute;
  left: -8%;
  top: 50%;
  width: 116%;
  height: 18px;
  background: radial-gradient(ellipse 9px 6px at center, transparent 4px, rgba(141,219,195,.42) 4.5px 6px, transparent 6.5px) 0 0 / 19px 18px repeat-x;
  filter: drop-shadow(0 0 3px rgba(141,219,195,.22));
  transform-origin: center;
}
.prize-chains i:first-child { transform: translateY(-50%) rotate(8deg); }
.prize-chains i:last-child { transform: translateY(-50%) rotate(-8deg); }
.prize-banner > *:not(.prize-chains) { position: relative; z-index: 1; }
.prize-amount { min-width: 155px; }
.prize-amount span, .prize-condition span { display: block; color: #8ddbc3; font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.prize-amount span i { display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%; background: #8ddbc3; box-shadow: 0 0 8px rgba(141,219,195,.9); vertical-align: 1px; }
.prize-amount strong { display: block; margin-top: 5px; font-size: 29px; letter-spacing: -.04em; }
.prize-amount em { color: #8ddbc3; font-size: 13px; font-style: normal; letter-spacing: .02em; }
.prize-banner > p { margin: 0; color: #b9b9b3; font-size: 12px; line-height: 1.55; }
.prize-condition { padding-left: 22px; border-left: 1px solid #393a37; }
.prize-condition strong { display: block; margin-top: 7px; font-size: 12px; white-space: nowrap; }
.hero-actions { display: flex; gap: 12px; margin-top: 35px; }
.subscription-note { margin-top: 22px; display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.live-dot { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(13,143,112,.1); }
.primary, .secondary {
  border-radius: 10px;
  padding: 12px 17px;
  font-size: 13px;
  font-weight: 620;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.primary { background: var(--ink); color: white; border: 1px solid var(--ink); }
.primary:hover { background: #333; }
.primary:disabled { opacity: .55; cursor: not-allowed; }
.primary.pending-access { opacity: .72; }
.secondary { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.metrics { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.metrics article { padding: 28px 26px; border-right: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: end; }
.metrics article:first-child { padding-left: 0; }
.metrics article:last-child { border: 0; }
.metrics span, .metrics small { color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.metrics strong { grid-row: span 2; font-size: 34px; font-weight: 520; letter-spacing: -.04em; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin: 82px 0 25px; }
.section-head h2, .panel h2 { margin: 8px 0 0; font-size: 25px; letter-spacing: -.025em; font-weight: 570; }
.section-head > p { color: var(--muted); line-height: 1.6; max-width: 560px; margin: 0; font-size: 14px; }
.participant-flow { padding-top: 78px; }
.flow-heading { margin-top: 0; }
.flow-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.flow-grid article { padding: 27px; min-height: 180px; border-right: 1px solid var(--line); }
.flow-grid article:last-child { border: 0; }
.flow-grid article > span { color: var(--green); font: 11px ui-monospace, monospace; }
.flow-grid h3 { font-size: 19px; margin: 30px 0 8px; }
.flow-grid p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; }
.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.scenario-card {
  min-width: 0;
  min-height: 380px;
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.scenario-card:hover { transform: translateY(-3px); box-shadow: 0 15px 45px rgba(0,0,0,.06); }
.scenario-card::before { content: ""; height: 3px; position: absolute; inset: 0 0 auto; background: var(--accent); }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.difficulty { border: 1px solid var(--line); padding: 5px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; }
.card-index { color: #aaa; font: 12px ui-monospace, monospace; }
.scenario-card h3 { font-size: 29px; margin: 39px 0 8px; letter-spacing: -.035em; font-weight: 570; }
.codename { color: var(--muted); font: 10px ui-monospace, SFMono-Regular, monospace; letter-spacing: .09em; }
.scenario-card > p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 20px 0; }
.cve-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.cve { font: 10px ui-monospace, SFMono-Regular, monospace; background: var(--soft); padding: 6px 7px; border-radius: 6px; color: #555; }
.card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--soft); margin-top: 21px; padding-top: 18px; }
.card-footer span { font-size: 11px; color: var(--muted); }
.suite-order { font: 9px ui-monospace, monospace; letter-spacing: .08em; }
.launch-button { border: 0; background: transparent; font-weight: 650; font-size: 12px; padding: 5px 0; }
.lower-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-top: 70px; }
.lower-grid > *, .admin-control-grid > * { min-width: 0; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 25px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.activity-panel table { min-width: 680px; }
.admin-control-grid table { min-width: 620px; }
.admin-runs-panel table { min-width: 700px; }
th { color: var(--muted); font-size: 9px; letter-spacing: .11em; text-align: left; padding: 10px; }
td { border-top: 1px solid var(--soft); padding: 14px 10px; font-size: 12px; }
td.empty { color: var(--muted); text-align: center; padding: 50px; }
.status { display: inline-flex; gap: 6px; align-items: center; text-transform: capitalize; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #aaa; }
.status.running::before { background: var(--green); }
.status.solved::before { background: #7c5cff; }
.status.completed::before { background: #7c5cff; }
.status.queued::before, .status.starting::before, .status.pending::before { background: #c79e3a; }
.status.failed::before { background: var(--danger); }
.status.infra_failed::before { background: var(--danger); }
.status.active::before { background: var(--green); }
.status.disabled::before { background: var(--danger); }
.mini-progress { width: 70px; height: 4px; border-radius: 9px; background: var(--soft); overflow: hidden; }
.mini-progress i { display: block; height: 100%; background: var(--green); }
.row-button { border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 2px; font-size: 11px; }
.methodology { background: #1d1e1c; color: white; border-color: #1d1e1c; }
.methodology .eyebrow, .methodology p, .methodology li { color: #aaa; }
.methodology p { line-height: 1.65; font-size: 13px; }
.formula { margin: 28px 0 19px; padding: 17px; background: #282926; border-radius: 11px; display: flex; justify-content: space-between; align-items: center; }
.formula span { color: #999; font-size: 9px; letter-spacing: .13em; }
.formula code { color: #d6f5e9; }
.methodology ul { padding: 0; margin: 0; list-style: none; }
.methodology li { border-top: 1px solid #333; padding: 10px 0; font-size: 12px; }
.methodology b { color: white; display: inline-block; width: 24px; }
.leaderboard-panel { margin-top: 14px; }
.leaderboard-head { gap: 20px; }
.season-tabs { display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); }
.season-tab { border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 8px 11px; font-size: 11px; display: inline-flex; align-items: center; gap: 6px; }
.season-tab.active { color: var(--ink); background: var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.season-tab i { color: var(--green); font-style: normal; font-size: 7px; font-weight: 800; letter-spacing: .08em; }
.leaderboard-empty { color: var(--muted); text-align: center; padding: 35px; font-size: 13px; }
.leaderboard-panel #leaderboard { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.leader-row { min-width: 700px; display: grid; grid-template-columns: 40px 1.5fr 1.5fr repeat(4, 1fr); border-top: 1px solid var(--soft); align-items: center; padding: 14px 8px; font-size: 12px; }
.leader-row.header { color: var(--muted); font-size: 9px; letter-spacing: .1em; }
footer { max-width: 1320px; margin: 0 auto; padding: 24px 34px 45px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.skeleton { min-height: 380px; border-radius: var(--radius); background: linear-gradient(100deg, #ecece7 30%, #f6f6f3 50%, #ecece7 70%); background-size: 400%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { to { background-position-x: -100%; } }
dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: 0 30px 90px rgba(0,0,0,.18); }
dialog::backdrop { background: rgba(20,20,18,.42); backdrop-filter: blur(4px); }
dialog h2 { font-size: 29px; margin: 10px 0; letter-spacing: -.03em; }
dialog p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.dialog-close { position: absolute; right: 18px; top: 15px; border: 0; background: none; font-size: 25px; color: var(--muted); }
dialog label { display: block; color: var(--muted); font-size: 11px; margin: 20px 0; }
dialog input, dialog select, dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; margin-top: 7px; background: var(--bg); color: var(--ink); }
dialog textarea { resize: vertical; line-height: 1.5; }
dialog label small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.45; }
.hidden { display: none !important; }
.dialog-note { background: var(--soft); border-radius: 9px; padding: 12px; display: flex; justify-content: space-between; font-size: 11px; margin: 22px 0; }
.dialog-note span { color: var(--muted); }
.wide { width: 100%; }
.form-error { color: var(--danger); min-height: 18px; }
.auth-dialog { width: min(760px, calc(100% - 32px)); }
.harness-guide-dialog { width: min(900px, calc(100% - 32px)); }
.guide-intro { max-width: 680px; }
.guide-intro strong { color: var(--ink); }
.guide-intro code, .harness-guide-grid code { color: var(--ink); font-size: .92em; }
.harness-loop { margin: 24px 0 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--bg); }
.harness-loop > span { display: block; padding: 11px 15px; border-bottom: 1px solid var(--line); color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.harness-loop > div { min-width: 720px; display: grid; grid-template-columns: repeat(5, 1fr); }
.harness-loop article { min-width: 0; padding: 15px; border-right: 1px solid var(--line); position: relative; }
.harness-loop article:last-child { border-right: 0; }
.harness-loop article:not(:last-child)::after { content: "→"; position: absolute; right: -7px; top: 17px; z-index: 1; display: grid; place-items: center; width: 14px; height: 14px; color: var(--green); background: var(--bg); font-size: 10px; }
.harness-loop b, .harness-loop strong, .harness-loop small { display: block; }
.harness-loop b { color: var(--green); font: 9px ui-monospace, monospace; }
.harness-loop strong { margin-top: 8px; font-size: 12px; letter-spacing: .04em; }
.harness-loop small { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.harness-tree { margin: 24px 0; overflow-x: auto; border: 1px solid #303330; border-radius: 13px; background: #171817; color: #d7dedb; }
.harness-tree > div { min-width: 760px; display: flex; align-items: center; gap: 6px; padding: 11px 16px; border-bottom: 1px solid #303330; }
.harness-tree > div span { width: 7px; height: 7px; border-radius: 50%; background: #5b5d59; }
.harness-tree > div span:first-child { background: #8ddbc3; }
.harness-tree > div strong { margin-left: 7px; color: #919691; font: 9px ui-monospace, SFMono-Regular, monospace; letter-spacing: .12em; text-transform: uppercase; }
.harness-tree pre { min-width: 760px; margin: 0; padding: 18px 20px 21px; color: #d6f5e9; font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.harness-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.harness-guide-grid article { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); }
.harness-guide-grid article > span { color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.harness-guide-grid h3, .guide-checklist h3 { margin: 10px 0 8px; font-size: 15px; }
.harness-guide-grid p { margin: 0; font-size: 11px; line-height: 1.55; }
.guide-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 26px; }
.guide-checklist > div { min-width: 0; }
.guide-checklist ul { margin: 0; padding-left: 18px; color: var(--muted); }
.guide-checklist li { margin: 8px 0; font-size: 11px; line-height: 1.5; }
.guide-checklist code { padding: 2px 4px; border-radius: 4px; background: var(--soft); color: var(--ink); font-size: 10px; }
.guide-limits { padding-left: 24px; border-left: 1px solid var(--line); }
.guide-tip { display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: start; margin-top: 23px; padding: 14px; border-radius: 10px; background: #e2f3ed; }
.guide-tip span { color: var(--green-dark); font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.guide-tip p { margin: 0; color: var(--green-dark); font-size: 11px; line-height: 1.5; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 25px; }
.auth-form { border-top: 1px solid var(--line); padding-top: 16px; }
.auth-form h3 { margin: 0 0 4px; font-size: 17px; }
.run-dialog { width: min(620px, calc(100% - 32px)); }
.run-head { display: flex; justify-content: space-between; }
.run-url { background: #1d1e1c; color: #d6f5e9; padding: 14px; border-radius: 9px; font: 12px ui-monospace, monospace; word-break: break-all; }
.progress-large { height: 8px; background: var(--soft); border-radius: 20px; margin: 25px 0 8px; overflow: hidden; }
.progress-large i { display: block; height: 100%; background: var(--green); }
.milestones { padding: 0; list-style: none; }
.milestones li { padding: 10px 0; border-top: 1px solid var(--soft); color: var(--muted); font-size: 12px; }
.milestones li.reached { color: var(--ink); }
.submit-grid { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 20px; }
.submit-grid input { margin: 0; }
.danger-link { color: var(--danger); background: none; border: 0; margin-top: 18px; font-size: 11px; }
.danger-button { color: white; background: var(--danger); border: 1px solid var(--danger); border-radius: 8px; padding: 8px 11px; font-size: 10px; }
.evaluation-summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; margin: 24px 0; overflow: hidden; }
.evaluation-summary div { padding: 14px; border-right: 1px solid var(--line); }
.evaluation-summary div:last-child { border: 0; }
.evaluation-summary span { display: block; color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.evaluation-summary strong { display: block; margin-top: 7px; font-size: 17px; }
.task-results { border-bottom: 1px solid var(--soft); }
.task-result { display: grid; grid-template-columns: 1.5fr .8fr .6fr .8fr .65fr; align-items: center; gap: 10px; border-top: 1px solid var(--soft); padding: 14px 3px; font-size: 11px; }
.task-result > div { display: flex; align-items: center; gap: 10px; }
.task-order { color: var(--muted); font: 10px ui-monospace, monospace; }
.operator-tools { margin-top: 16px; border: 1px dashed var(--line); border-radius: 12px; padding: 16px 20px; color: var(--muted); font-size: 11px; }
.operator-tools summary { cursor: pointer; }
#operator-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.operator-launch { font-size: 11px; padding: 9px 12px; }
.admin-main { padding-top: 20px; }
.admin-heading { margin: 24px 0 28px; }
.admin-auth { max-width: 620px; margin: 0 auto; }
.admin-auth-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; }
.admin-auth-form label { color: var(--muted); font-size: 11px; }
.admin-auth-form input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; margin-top: 7px; background: var(--bg); color: var(--ink); }
.admin-scenario-grid { margin-bottom: 24px; }
.admin-scenario .card-footer { align-items: center; }
.admin-launch { padding: 9px 13px; font-size: 10px; }
.admin-runs-panel { margin-top: 18px; }
.admin-runs-panel code { font-size: 10px; word-break: break-all; }
.wallet-address { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; font-size: 10px; }
.wallet-missing { color: var(--muted); font-size: 10px; }
.admin-control-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin: 26px 0 0; }
.admin-control-grid .danger-link { margin-top: 0; }
.admin-scoreboard-panel { margin-top: 14px; }
.admin-data-head { align-items: flex-start; gap: 18px; }
.admin-data-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.admin-data-actions .danger-link { margin-top: 0; padding: 8px 7px; }
.admin-row-actions { min-width: 118px; white-space: nowrap; }
.admin-row-actions .danger-link { margin: 0 0 0 8px; }
.admin-record-locked { color: var(--muted); font-size: 10px; }
.admin-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.admin-limit-control { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.admin-limit-control span { color: var(--muted); font-size: 10px; }
.admin-limit-control input { width: 62px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 8px; background: var(--bg); color: var(--ink); font-size: 11px; }
.admin-limit-control .row-button { padding: 7px 8px; }
.admin-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 16px; border-top: 1px solid var(--soft); margin-top: 12px; padding-top: 14px; }
.admin-pagination span { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.admin-pagination .text-button:disabled { opacity: .35; cursor: not-allowed; }
.settings-copy { color: var(--muted); line-height: 1.6; font-size: 12px; }
.settings-form { margin-top: 25px; }
.settings-form label { display: block; color: var(--muted); font-size: 11px; }
.settings-form input, .settings-form select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; margin: 7px 0 12px; background: var(--bg); color: var(--ink); }
.capacity-readout { border-top: 1px solid var(--soft); margin-top: 24px; padding-top: 18px; display: flex; justify-content: space-between; font-size: 12px; }
.capacity-readout span { color: var(--muted); }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: white; padding: 12px 16px; border-radius: 9px; font-size: 12px; transform: translateY(80px); opacity: 0; transition: .25s; }
.toast.show { transform: none; opacity: 1; }
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 18px; }
  nav { display: none; }
  main { padding: 0 18px 60px; }
  .hero { padding: 70px 0; }
  .prize-banner { grid-template-columns: 1fr; gap: 16px; }
  .prize-banner > p, .prize-condition { grid-column: 1 / -1; }
  .prize-chains i:first-child { transform: translateY(-50%) rotate(23deg); }
  .prize-chains i:last-child { transform: translateY(-50%) rotate(-23deg); }
  .prize-condition { padding: 14px 0 0; border-left: 0; border-top: 1px solid #393a37; }
  .scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lower-grid, .flow-grid, .admin-control-grid, .auth-grid, .harness-guide-grid { grid-template-columns: 1fr; }
  .admin-data-head { align-items: stretch; flex-direction: column; }
  .admin-data-actions { justify-content: flex-start; }
  .flow-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .evaluation-summary { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:first-child { padding-left: 20px; }
  .section-head { grid-template-columns: 1fr; gap: 16px; }
  .system-pill { display: none; }
  .account-state { display: none; }
}

@media (max-width: 640px) {
  .topbar { height: 60px; padding: 0 14px; }
  .brand { gap: 9px; font-size: 16px; }
  .brand-mark { width: 23px; height: 23px; flex: 0 0 auto; }
  .topbar-actions { gap: 8px; }
  #account-name { max-width: 92px; }
  .account-button { min-height: 38px; }
  main { padding: 0 14px 48px; }
  .hero { padding: 52px 0 56px; }
  .hero h1 { font-size: clamp(38px, 11.5vw, 52px); margin: 17px 0 22px; }
  .hero > p { font-size: 15px; line-height: 1.6; }
  .prize-banner { margin-top: 27px; padding: 18px; }
  .prize-chains { opacity: .38; }
  .hero-actions { margin-top: 27px; }
  .primary, .secondary { min-height: 44px; }
  .metrics article { min-width: 0; padding: 20px 14px; }
  .metrics article:first-child { padding-left: 14px; }
  .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metrics strong { font-size: 30px; }
  .participant-flow { padding-top: 56px; }
  .section-head { margin: 56px 0 20px; }
  .section-head h2, .panel h2 { font-size: 23px; }
  .section-head > p { font-size: 13px; }
  .flow-grid article { min-height: 0; padding: 22px; }
  .flow-grid h3 { margin-top: 20px; }
  .scenario-grid { grid-template-columns: 1fr; }
  .scenario-card { min-height: 0; padding: 22px; }
  .scenario-card h3 { margin-top: 28px; }
  .lower-grid { margin-top: 52px; }
  .panel { padding: 20px; }
  .panel-head { flex-wrap: wrap; gap: 12px; }
  .leaderboard-head { align-items: flex-start; flex-direction: column; }
  .season-tabs { max-width: 100%; overflow-x: auto; }
  .season-tab { flex: 0 0 auto; }
  footer { padding: 22px 14px 30px; flex-direction: column; gap: 8px; }
  dialog, .auth-dialog, .run-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); padding: 24px 18px 20px; border-radius: 14px; }
  .harness-guide-dialog { width: calc(100% - 20px); }
  dialog h2 { padding-right: 22px; font-size: 25px; }
  .dialog-close { right: 12px; top: 10px; min-width: 42px; min-height: 42px; }
  dialog label { margin: 16px 0; }
  dialog input, dialog select, dialog textarea { min-height: 44px; font-size: 16px; }
  .dialog-note { gap: 10px; align-items: flex-start; }
  .guide-checklist { grid-template-columns: 1fr; gap: 16px; }
  .guide-limits { padding: 16px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .evaluation-summary div:nth-child(even) { border-right: 0; }
  .evaluation-summary div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .task-result { grid-template-columns: 1fr auto; gap: 9px 14px; padding: 16px 3px; }
  .task-result > div { grid-column: 1 / -1; }
  .task-result > span:nth-child(even) { justify-self: start; }
  .task-result > span:nth-child(odd) { justify-self: end; }
  .admin-main { padding-top: 30px; }
  .admin-heading { margin-bottom: 22px; }
  .admin-heading h1 { margin-bottom: 0; }
  .toast { left: 14px; right: 14px; bottom: 14px; text-align: center; }
}

@media (max-width: 420px) {
  .topbar { padding: 0 12px; }
  .brand { max-width: 205px; }
  .account-menu { gap: 6px; }
  .account-menu .text-button { padding: 4px 0; font-size: 10px; }
  #account-name { max-width: 72px; }
  main { padding-right: 12px; padding-left: 12px; }
  .hero { padding-top: 44px; }
  .hero h1 { font-size: clamp(36px, 11vw, 44px); }
  .eyebrow { letter-spacing: .13em; }
  .prize-amount { min-width: 0; }
  .prize-amount strong { font-size: 26px; }
  .prize-condition strong { white-space: normal; }
  .hero-actions .primary { width: 100%; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .secondary { width: 100%; }
  .metrics article { display: block; min-height: 106px; padding: 16px 12px; }
  .metrics article:first-child { padding-left: 12px; }
  .metrics strong { display: block; margin: 8px 0 3px; font-size: 29px; }
  .metrics small { display: block; line-height: 1.35; }
  .section-head { margin-top: 48px; }
  .panel { padding: 16px; }
  .formula { align-items: flex-start; flex-direction: column; gap: 9px; }
  .dialog-note { display: grid; grid-template-columns: 1fr; gap: 5px; }
  .harness-tree { margin-right: -2px; margin-left: -2px; }
  .dialog-note strong { line-height: 1.4; }
  .evaluation-summary div { padding: 12px; }
  .evaluation-summary strong { font-size: 15px; overflow-wrap: anywhere; }
  .admin-auth-form, .submit-grid { grid-template-columns: 1fr; }
  .admin-edit-grid { grid-template-columns: 1fr; }
  .admin-auth-form .primary { width: 100%; }
  td.empty { padding: 34px 16px; }
}
