:root {
  --cream: #f7f4ee;
  --navy: #1e2a4a;
  --navy-soft: #2c3e50;
  --orange: #e67e22;
  --orange-deep: #d35400;
  --muted: #7f8c8d;
  --line: #e4dfd6;
  --white: #ffffff;
  --ok: #1f7a4d;
  --ok-bg: #e7f6ee;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --shadow: 0 10px 30px rgba(30, 42, 74, 0.08);
  --serif: "Liberation Serif", "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: "Carlito", "Liberation Sans", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--navy-soft);
  min-height: 100dvh;
  line-height: 1.45;
}
a { color: var(--navy); }
button, input { font: inherit; }
.top {
  background: var(--navy);
  color: var(--cream);
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.top strong { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; letter-spacing: 0.01em; }
.top span { color: var(--orange); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.wrap { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 64px; }
.card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px 22px 24px;
  margin: 0 0 16px;
}
h1, h2, h3 { font-family: var(--serif); color: var(--navy); margin: 0 0 8px; }
h1 { font-size: 1.8rem; line-height: 1.15; }
h2 { font-size: 1.35rem; }
.muted { color: var(--muted); }
.kicker { color: var(--orange-deep); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.75rem; margin-bottom: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  background: var(--navy);
  color: var(--cream);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.orange { background: var(--orange-deep); color: #fff; }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn.danger { background: #8f1d14; color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.wide { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
input[type="text"], input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--navy);
  outline: none;
}
input:focus { border-color: var(--navy); }
.option {
  width: 100%;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 10px;
  cursor: pointer;
  color: var(--navy-soft);
}
.option .letter {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--orange-deep);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}
.option.selected { border-color: var(--navy); background: #eef1f7; }
.option.selected .letter { background: var(--navy); color: #fff; }
.option.correct { border-color: var(--ok); background: var(--ok-bg); }
.option.correct .letter { background: var(--ok); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-bg); }
.option.wrong .letter { background: var(--bad); color: #fff; }
.option:disabled { cursor: default; }
.q { margin: 0 0 28px; }
.q p { font-size: 1.05rem; color: var(--navy); font-weight: 700; margin: 0 0 12px; }
.explain {
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  margin-top: 6px;
}
.wait {
  text-align: center;
  padding: 36px 16px;
}
.wait .pulse {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--orange);
  margin: 0 auto 16px;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}
.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--line);
  color: var(--navy);
}
.status-pill.open { background: #e7f6ee; color: var(--ok); }
.status-pill.revealed { background: #fde8d2; color: var(--orange-deep); }
.status-pill.closed { background: var(--line); color: var(--muted); }
.grid-sets { display: grid; gap: 10px; }
.set-link {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 14px 16px; background: #fff; border-radius: 14px;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 0.9rem; opacity: 0; pointer-events: none; transition: opacity .2s;
  z-index: 20;
}
.toast.show { opacity: 1; }
.mentor-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100dvh; }
.side { background: var(--navy); color: var(--cream); padding: 18px 14px; }
.side a, .side button.linkish { color: var(--cream); }
.side h1 { color: var(--cream); font-size: 1.2rem; }
.side nav button, .side .set-btn {
  width: 100%; text-align: left; background: transparent; color: var(--cream);
  border: 0; border-radius: 10px; padding: 10px 10px; cursor: pointer; margin: 0 0 4px;
}
.side .set-btn.active, .side nav button.active { background: rgba(255,255,255,0.12); }
.main { padding: 22px; overflow: auto; }
.bars { display: grid; gap: 8px; margin-top: 8px; }
.bar-row { display: grid; grid-template-columns: 22px 1fr 40px; gap: 8px; align-items: center; font-size: 0.9rem; }
.bar-track { background: var(--cream); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--navy); border-radius: 999px; width: 0; transition: width .35s ease; }
.bar-fill.hl { background: var(--ok); }
.leader li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.modal-back {
  position: fixed; inset: 0; background: rgba(30,42,74,.45);
  display: none; align-items: center; justify-content: center; z-index: 30; padding: 16px;
}
.modal-back.show { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: min(420px, 100%); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.proj { background: var(--navy); color: var(--cream); min-height: 100dvh; }
.proj .wrap { width: min(1100px, calc(100% - 48px)); padding-top: 36px; }
.proj h1, .proj h2 { color: var(--cream); }
.proj .card { background: rgba(255,255,255,0.06); color: var(--cream); box-shadow: none; }
.proj .bar-track { background: rgba(255,255,255,0.12); }
.proj .bar-fill { background: var(--orange); }
.proj .bar-fill.hl { background: #3dd68c; }
.hidden { display: none !important; }
@media (max-width: 800px) {
  .mentor-shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 5; }
}
