:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-soft: #eef4ef;
  --surface-warm: #fff8ec;
  --text: #1c2523;
  --muted: #68706d;
  --line: #d9ded8;
  --primary: #1f4f46;
  --primary-strong: #123a33;
  --accent: #d98c28;
  --danger: #9d2f2f;
  --success: #2f7a4f;
  --focus: #0f766e;
  --shadow: 0 18px 50px rgba(31, 79, 70, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--primary);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 28px;
  overflow-y: auto;
  background: #173d36;
  color: #ffffff;
}

.brand {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f6f3ee;
  color: var(--primary);
  font-weight: 800;
}

.brand h1,
.overview h2,
.next-steps h3,
.track h2,
.step h3,
.modal h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 1rem;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 4px;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.user-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
}

.user-panel a {
  color: #ffffff;
  font-weight: 800;
}

.ghost-button,
.danger-button,
.primary-button,
.secondary-button,
.status-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.ghost-button:hover,
.danger-button:hover,
.primary-button:hover,
.secondary-button:hover,
.status-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.track-nav {
  display: grid;
  gap: 8px;
}

.track-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  color: #ffffff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.07);
}

.track-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.track-link small {
  color: rgba(255, 255, 255, 0.7);
}

.danger-button {
  margin-top: auto;
  color: #ffffff;
  background: rgba(157, 47, 47, 0.58);
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 32px;
}

.overview,
.toolbar,
.next-steps,
.track {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 24px;
  align-items: center;
  padding: 28px;
}

.overview h2 {
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.lede {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.summary-panel {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
}

.summary-panel span {
  color: var(--primary);
  font-size: 2.4rem;
  font-weight: 800;
}

.summary-panel p {
  margin: 0;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px;
  gap: 16px;
  margin-top: 20px;
  padding: 18px;
}

.search,
.filter {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.search input,
.filter select,
.evidence textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.search input,
.filter select {
  min-height: 44px;
  padding: 0 12px;
}

.search input:focus,
.filter select:focus,
.evidence textarea:focus,
.quiz-option input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.25);
  outline-offset: 2px;
}

.next-steps {
  margin-top: 20px;
  padding: 22px;
}

.next-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.next-item {
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-warm);
  border: 1px solid #eedec5;
}

.next-item strong {
  display: block;
  margin-bottom: 4px;
}

.tracks {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.track {
  scroll-margin-top: 24px;
  overflow: hidden;
}

.track-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  align-items: center;
  padding: 24px;
  background: linear-gradient(120deg, #ffffff, #f0f6f2);
  border-bottom: 1px solid var(--line);
}

.track h2 {
  font-size: 1.45rem;
}

.track-description {
  margin: 8px 0 0;
  color: var(--muted);
}

.progress-meter {
  display: grid;
  gap: 8px;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #dce7df;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
  transition: width 200ms ease;
}

.progress-label {
  color: var(--muted);
  font-size: 0.86rem;
  text-align: right;
}

.steps {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.step {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.step-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.step h3 {
  font-size: 1.12rem;
}

.step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 99px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.warning {
  background: #fff1d4;
  color: #8a5a0e;
}

.pill.done {
  background: #e6f3eb;
  color: var(--success);
}

.step-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  gap: 18px;
}

.text-block {
  display: grid;
  gap: 14px;
}

.text-block p,
.text-block ul {
  margin: 0;
}

.text-block ul {
  padding-left: 20px;
}

.resource-list,
.exercise-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.side-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 14px;
  border-radius: 8px;
  background: #f8faf7;
  border: 1px solid var(--line);
}

.evidence {
  display: grid;
  gap: 8px;
}

.evidence label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.evidence textarea {
  min-height: 116px;
  resize: vertical;
  padding: 10px;
}

.step-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.primary-button {
  color: #ffffff;
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-strong);
}

.secondary-button {
  color: var(--primary);
  background: #e8f1ec;
}

.status-button {
  color: var(--text);
  background: #fff4df;
}

.status-button[data-status="completed"] {
  color: #ffffff;
  background: var(--success);
}

.status-button[data-status="ready"] {
  color: #422f09;
  background: #ffd98e;
}

.status-button[data-status="in_progress"] {
  color: #ffffff;
  background: var(--accent);
}

.empty {
  color: var(--muted);
  padding: 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 25, 23, 0.58);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(760px, 100%);
  max-height: min(88vh, 860px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 16px;
  align-items: start;
  padding: 22px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 44px;
  min-height: 44px;
  background: #f0f3f0;
  color: var(--text);
  font-size: 1.5rem;
}

.quiz-form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.quiz-question {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quiz-question legend {
  padding: 0;
  font-weight: 800;
}

.quiz-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 8px;
  background: #f8faf7;
}

.quiz-result {
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.quiz-result strong {
  display: block;
  margin-bottom: 6px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--text);
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-shell {
  width: min(440px, 100%);
}

.login-card {
  display: grid;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--text);
}

.login-brand .brand-mark {
  background: var(--primary);
  color: #ffffff;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.login-form input {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-error {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #fff0f0;
  color: var(--danger);
  font-weight: 800;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .track-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main {
    padding: 22px;
  }

  .step-body,
  .toolbar,
  .overview,
  .track-header,
  .next-list {
    grid-template-columns: 1fr;
  }

  .progress-label {
    text-align: left;
  }

  .summary-panel {
    width: 150px;
  }
}

@media (max-width: 620px) {
  .sidebar,
  .main {
    padding: 18px;
  }

  .track-nav {
    grid-template-columns: 1fr;
  }

  .step-top {
    grid-template-columns: 1fr;
  }

  .overview h2 {
    font-size: 2.3rem;
  }

  .modal-backdrop {
    padding: 12px;
  }
}
