:root {
  --bg: #e8eef5;
  --ink: #0b1f3a;
  --soft: #4b5c73;
  --line: #c9d5e5;
  --card: #ffffff;
  --side: #0b1f3a;
  --side-2: #123056;
  --side-text: #f4f8fc;
  --side-dim: #9db0c9;
  --accent: #0f8f86;
  --accent-2: #38bdf8;
  --accent-ink: #f0fffc;
  --bad: #b91c1c;
  --warn: #c2410c;
  --ok: #0f766e;
  --shadow: 0 22px 50px rgba(11, 31, 58, 0.12);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(56, 189, 248, 0.16), transparent 55%),
    radial-gradient(700px 360px at 100% 0%, rgba(15, 143, 134, 0.12), transparent 50%),
    linear-gradient(180deg, #f3f7fb 0%, var(--bg) 40%, #dde7f2 100%);
  color: var(--ink);
  line-height: 1.5;
}
::selection { background: var(--accent); color: var(--accent-ink); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.55; cursor: default; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
h1, h2, h3 { font-family: Georgia, "Iowan Old Style", Palatino, serif; font-weight: 600; letter-spacing: -0.03em; margin: 0; }
.kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.lede { color: var(--soft); margin: 8px 0 0; max-width: 62ch; }
.err { color: var(--bad); min-height: 1.2em; font-size: 14px; margin: 10px 0 0; }
.ok { color: var(--ok); }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    radial-gradient(700px 360px at 20% 10%, rgba(56, 189, 248, 0.2), transparent 60%),
    radial-gradient(600px 320px at 90% 80%, rgba(15, 143, 134, 0.18), transparent 55%),
    linear-gradient(160deg, #0b1f3a, #123056 55%, #0f4c5c);
}
.gate .sheet { box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28); }
.gate .kicker { color: #0f8f86; }
.sheet {
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.sheet h1 { font-size: 40px; line-height: 1; color: var(--ink); }
label { display: block; font-size: 13px; font-weight: 700; margin: 16px 0 6px; }
input, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
button.btn, button {
  background: linear-gradient(135deg, #0f8f86, #0d7a73);
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  margin-top: 18px;
  box-shadow: 0 10px 24px rgba(15, 143, 134, 0.28);
}
button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}
button.mini {
  margin: 0 6px 6px 0;
  padding: 7px 12px;
  font-size: 13px;
  box-shadow: none;
}
button.danger {
  background: transparent;
  color: var(--bad);
  border: 1px solid #fecaca;
  box-shadow: none;
}

/* Candidate desk: fixed sidebar, paper scrolls */
.desk {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  overflow: hidden;
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  background:
    radial-gradient(420px 240px at 0% 0%, rgba(56, 189, 248, 0.22), transparent 60%),
    linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%);
  color: var(--side-text);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 8;
}
.side .kicker { color: var(--accent-2); }
.side h1 { font-size: 30px; line-height: 1.05; }
.side-meta, .save-state { color: var(--side-dim); font-size: 13px; margin: 0; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #0f8f86, #38bdf8);
  color: white; font-family: Georgia, serif; font-size: 22px;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.25);
}
.clock-block {
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.clock-block span { display: block; color: var(--side-dim); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.clock-block b {
  display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 56px; line-height: 1; letter-spacing: -0.05em; font-weight: 650;
}
.clock-block.mid b { color: #fdba74; }
.clock-block.low b { color: #fecaca; }
.bar { height: 4px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2dd4bf, #38bdf8); transition: width .3s linear; }
.clock-block.mid .bar i { background: #fdba74; }
.clock-block.low .bar i { background: #fca5a5; }
.round-link {
  width: 100%; margin: 0 0 8px; text-align: left;
  background: rgba(255, 255, 255, 0.04); color: var(--side-text);
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.round-link:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); }
.round-link b { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--side-dim); }
.round-link.ready b { color: #5eead4; }
.round-link.live b { color: #7dd3fc; }
.round-link.done b { color: #cbd5e1; }
.side .ghost {
  color: var(--side-text);
  border-color: rgba(255,255,255,.28);
  margin-top: auto;
  box-shadow: none;
}

.paper {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 36px 44px 88px;
}
.paper-head h2 { font-size: 42px; line-height: 1.02; margin-top: 4px; }
.round-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.round-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(11, 31, 58, 0.05);
}
.round-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.round-card h2 { font-size: 28px; }
.round-card p { color: var(--soft); flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; background: #e8eef5; color: var(--soft);
}
.pill.live { background: #ccfbf1; color: #0f766e; }
.pill.ready { background: #e0f2fe; color: #0369a1; }
.pill.done { background: #e2e8f0; color: #475569; }
.pill.bad { background: #fee2e2; color: var(--bad); }
.rules { margin: 8px 0 0; padding-left: 18px; color: var(--soft); font-size: 14px; }
.rules li { margin: 4px 0; }
.q {
  display: grid; grid-template-columns: 64px 1fr; gap: 8px 16px;
  padding: 22px 0; border-top: 1px solid var(--line);
}
.q-n { font-family: Georgia, serif; font-size: 34px; color: var(--accent); line-height: 1; }
.q h3 { font-size: 22px; margin-bottom: 4px; }
.mark-note {
  font-family: system-ui, sans-serif; font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-left: 8px;
}
a.ghost {
  display: inline-block; text-decoration: none; background: transparent; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 12px 20px; font-weight: 700;
}
.task {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px 20px; margin: 18px 0; box-shadow: 0 8px 24px rgba(11, 31, 58, 0.04);
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions button { margin-top: 0; }
.banner {
  margin-top: 18px; padding: 16px 18px; border-radius: 16px;
  background: #ecfeff; border: 1px solid #a5f3fc; color: #0e7490;
}
.intern-post {
  background: linear-gradient(180deg, #f0f9ff, #ffffff);
  border-color: #bae6fd;
}
.task input { margin-bottom: 4px; }

.alarm {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 24px;
  background: #4c0d0d; color: #fff7ed; text-align: center;
}
.alarm.final { animation: alarmPulse 0.7s ease-in-out infinite; }
.alarm-card { width: min(920px, 100%); min-width: 0; }
.alarm .kicker { color: #fecaca; }
.alarm h2 {
  font-size: clamp(40px, 8vw, 92px); line-height: 0.92; color: #fff7ed;
  margin: 8px auto; max-width: 10ch; text-wrap: balance;
}
.alarm-copy { font-size: clamp(16px, 2.4vw, 22px); margin: 12px auto 0; max-width: 34ch; }
.alarm-clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(52px, 12vw, 120px); letter-spacing: -0.06em; line-height: 1; margin-top: 8px;
}
.alarm button { background: #fff7ed; color: #4c0d0d; font-size: 18px; padding: 14px 28px; box-shadow: none; }
@keyframes alarmPulse { 0%, 100% { background: #4c0d0d; } 50% { background: #dc2626; } }
@media (prefers-reduced-motion: reduce) {
  .alarm.final { animation: none; background: #9f1d1d; }
  .bar i, .paper { transition: none; scroll-behavior: auto; }
}

body.admin {
  padding: 0;
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(56, 189, 248, 0.14), transparent 55%),
    radial-gradient(700px 360px at 100% 0%, rgba(15, 143, 134, 0.1), transparent 50%),
    var(--bg);
}
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 28px 18px 70px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.topbar h1 { font-size: 46px; }
.topbar .ghost { margin: 0; }
.admin-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-wrap .sheet {
  width: auto; min-width: 0;
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(11, 31, 58, 0.06);
}
.admin-wrap .sheet h2 { font-size: 28px; margin-bottom: 4px; }
.steps { margin: 12px 0 0; padding-left: 18px; color: var(--soft); font-size: 14px; }
.steps li { margin: 5px 0; }
.cred { margin-top: 16px; background: var(--side); color: var(--side-text); border-radius: 16px; padding: 16px; }
.cred h2 { font-size: 26px; color: white; }
.cred p { color: var(--side-dim); font-size: 14px; }
.cred dl { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; margin: 12px 0; }
.cred dt { color: var(--side-dim); }
.cred dd { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; }
.cred button { background: #fff7ed; color: var(--ink); box-shadow: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); }
tr.cand { cursor: pointer; }
tr.cand:hover, tr.cand.is-open { background: rgba(15, 143, 134, 0.07); }
.who { font-weight: 700; }
.sub { color: var(--soft); font-size: 12px; }
.detail { margin-top: 16px; }
.detail h2 { font-size: 32px; }
.scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
pre.ans {
  white-space: pre-wrap; background: #f8fbff; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; max-height: 180px; overflow: auto;
}
details { margin: 12px 0; }
summary { cursor: pointer; font-weight: 700; }
.bank-block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.bank-item {
  background: #f8fbff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; margin: 10px 0;
}
.bank-item .row { margin-top: 4px; }
.bank-item label { margin-top: 8px; }
.bank-item textarea { min-height: 72px; }
.bank-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

@media (max-width: 960px) {
  .desk {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
  }
  .side {
    position: sticky;
    top: 0;
    height: auto;
    max-height: 42vh;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(11, 31, 58, 0.2);
  }
  .paper {
    height: auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 16px 64px;
  }
  .admin-grid, .round-grid, .row { grid-template-columns: 1fr; }
  .paper-head h2, .topbar h1 { font-size: 34px; }
  .q { grid-template-columns: 1fr; }
  .clock-block b { font-size: 40px; }
  .side .ghost { margin-top: 4px; }
}
