:root {
  --bg: #f3efe6;
  --bg-elevated: #fffdf8;
  --ink: #1a1f1c;
  --ink-muted: #5a635c;
  --accent: #0f6b4c;
  --accent-soft: #d8efe4;
  --border: #d9d2c4;
  --foundation: #2f6fed;
  --middle: #0f6b4c;
  --senior: #b45309;
  --expert: #9f1239;
  --shadow: 0 12px 40px rgba(26, 31, 28, 0.08);
  --radius: 14px;
  --sidebar-w: 280px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Literata", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #e4f2ea 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #efe6d4 0%, transparent 50%),
    var(--bg);
  line-height: 1.55;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 1.25rem;
  border-right: 1px solid var(--border);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  z-index: 20;
}

.sidebar__brand { display: flex; gap: 0.75rem; align-items: center; }
.sidebar__logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 1.25rem;
}
.sidebar__title { font-weight: 700; letter-spacing: -0.02em; }
.sidebar__subtitle { font-size: 0.8rem; color: var(--ink-muted); }

.sidebar__nav { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.nav-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.nav-item:hover:not(:disabled) { background: #f0ebe0; }
.nav-item.is-active {
  background: var(--accent-soft);
  border-color: #b7dccb;
}
.nav-item.is-locked { opacity: 0.55; cursor: not-allowed; }
.nav-item__num { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-muted); }
.nav-item__badge {
  font-size: 0.7rem; font-weight: 600;
  background: var(--ink); color: #fff;
  border-radius: 999px; padding: 0.1rem 0.45rem;
}
.nav-hint {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.toggle {
  display: flex; gap: 0.5rem; align-items: center;
  font-size: 0.85rem; color: var(--ink-muted); cursor: pointer;
}

.main { flex: 1; min-width: 0; padding: 0 1.5rem 4rem; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 0.75rem; align-items: center;
  padding: 0.9rem 0;
  background: linear-gradient(var(--bg), rgba(243, 239, 230, 0.85));
  backdrop-filter: blur(8px);
}
.icon-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 10px;
  width: 40px; height: 40px;
  cursor: pointer;
}
.topbar__search { flex: 1; }
.topbar__search input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font: inherit;
  box-shadow: var(--shadow);
}
.topbar__search input:focus {
  outline: 2px solid #9fd0ba;
  border-color: var(--accent);
}
.topbar__stats {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.hero {
  margin: 1rem 0 1.5rem;
  padding: 1.75rem 1.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, rgba(15, 107, 76, 0.08), transparent 40%),
    var(--bg-elevated);
  box-shadow: var(--shadow);
}
.hero__eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
}
.hero__title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.hero__lead { margin: 0.75rem 0 0; max-width: 62ch; color: var(--ink-muted); }
.hero__meta {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.75rem;
}
.checklist, .redflags, .deepdive {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
.checklist h3, .redflags h3, .deepdive h3 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
}
.checklist ul, .redflags ul, .deepdive ul {
  margin: 0; padding-left: 1.1rem; font-size: 0.88rem; color: var(--ink-muted);
}
.redflags { border-color: #f0c2cb; background: #fff5f7; }

.filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1rem;
}
.chip {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.chip.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.progress-wrap { margin-bottom: 1.25rem; }
.progress {
  height: 8px; border-radius: 999px;
  background: #e5dfd2; overflow: hidden;
}
.progress__bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #2a9d6f);
  transition: width 0.25s ease;
}
.progress__actions {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 0.65rem;
}
.btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.btn:hover { border-color: #b8b0a0; }
.btn--ghost { background: transparent; }

.questions { display: flex; flex-direction: column; gap: 0.85rem; }

.q {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.q:hover { border-color: #c9c0ae; }
.q.is-open { box-shadow: var(--shadow); border-color: #b7dccb; }
.q.is-done .q__title { text-decoration: line-through; opacity: 0.7; }

.q__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  width: 100%;
  padding: 1rem 1.1rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.q__id {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-muted);
  padding-top: 0.2rem;
}
.q__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.q__meta {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  margin-top: 0.45rem;
}
.tag {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #efe9dc;
  color: var(--ink-muted);
}
.tag--foundation { background: #e8effc; color: var(--foundation); }
.tag--middle { background: var(--accent-soft); color: var(--middle); }
.tag--senior { background: #fde8cf; color: var(--senior); }
.tag--expert { background: #fce4ec; color: var(--expert); }

.q__done {
  margin-top: 0.15rem;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}
.q.is-done .q__done {
  background: var(--accent);
  border-color: var(--accent);
  position: relative;
}
.q.is-done .q__done::after {
  content: "";
  position: absolute;
  inset: 4px 7px 6px 5px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(40deg);
}

.q__body {
  display: none;
  padding: 0 1.15rem 1.25rem;
  border-top: 1px solid var(--border);
}
.q.is-open .q__body { display: block; }

.section { margin-top: 1.1rem; }
.section h4 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.section p, .section li { color: var(--ink); font-size: 0.95rem; }
.section ul, .section ol { margin: 0.25rem 0 0; padding-left: 1.2rem; }
.section li + li { margin-top: 0.25rem; }

.short {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #f4faf7;
  border: 1px solid #cfe5da;
}

pre, code { font-family: var(--mono); }
pre {
  margin: 0.5rem 0 0;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #18201c;
  color: #e8f0ea;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.55;
}
code.inline {
  font-size: 0.85em;
  background: #efe9dc;
  padding: 0.05rem 0.35rem;
  border-radius: 5px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.box {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
.box--good { border-color: #b7dccb; background: #f4faf7; }
.box--bad { border-color: #f0c2cb; background: #fff5f7; }
.box h5 { margin: 0 0 0.35rem; font-size: 0.8rem; }

.senior-answer {
  border-left: 3px solid var(--accent);
  padding: 0.15rem 0 0.15rem 0.85rem;
}

.outro {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: rgba(255,253,248,0.7);
}
.outro h2 { margin: 0 0 0.4rem; font-family: var(--display); }
.outro p { margin: 0; color: var(--ink-muted); }

body.is-compact .q__title { font-size: 0.95rem; }
body.is-compact .section p,
body.is-compact .section li { font-size: 0.9rem; }

.empty {
  padding: 2rem;
  text-align: center;
  color: var(--ink-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { transform: translateX(0); }
  .icon-btn { display: inline-grid; place-items: center; }
  .two-col { grid-template-columns: 1fr; }
  .main { padding: 0 1rem 3rem; }
}
