:root {
  --ink: #1e2420;
  --muted: #657065;
  --paper: #f6f3ec;
  --surface: #fffdf8;
  --soft: #edf1ea;
  --deep: #243d2f;
  --sage: #667f69;
  --clay: #b86f56;
  --blue: #496b78;
  --line: #ddd7ca;
  --white: #ffffff;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 24px 18px;
  color: var(--white);
  background: var(--deep);
}

.brand {
  display: block;
  margin-bottom: 28px;
  font-weight: 840;
  font-size: 18px;
  line-height: 1.18;
}

.profile {
  padding: 16px;
  margin-bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.profile strong {
  display: block;
}

.profile span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.76);
  font-weight: 720;
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 24px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.8);
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 72px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--deep);
  font-size: 13px;
  font-weight: 800;
}

.content {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 22px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.pad {
  padding: 26px;
}

.hero-card {
  color: var(--white);
  background: linear-gradient(135deg, #243d2f, #496b78);
}

.hero-card p {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.78);
}

.panel.hero-card p {
  color: rgba(255, 255, 255, 0.8);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 800;
  font: inherit;
  cursor: pointer;
}

.button.primary {
  background: var(--deep);
  color: var(--white);
}

.button.light {
  background: var(--white);
  color: var(--deep);
}

.button.ghost {
  border-color: var(--line);
  background: transparent;
}

.hero-card .button.ghost {
  border-color: rgba(255, 255, 255, 0.62);
  color: var(--white);
}

.progress-ring {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.ring {
  width: 142px;
  height: 142px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--sage) 0 62%, #e3ded2 62% 100%);
}

.ring[data-progress-ring] {
  background: conic-gradient(var(--sage) 0 var(--progress, 0%), #e3ded2 var(--progress, 0%) 100%);
}

.ring span {
  width: 102px;
  height: 102px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--deep);
  font-size: 28px;
  font-weight: 860;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.grid.four {
  grid-template-columns: repeat(4, 1fr);
}

.grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.plan-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.session-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.session-card h3,
.session-card p {
  margin: 0;
}

.session-card strong {
  color: var(--deep);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.report-grid h3,
.report-grid p {
  margin: 0;
}

.report-grid p {
  margin-top: 4px;
  color: var(--muted);
}

.report-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.report-sections.four {
  grid-template-columns: repeat(4, 1fr);
}

.scenario-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
  align-items: start;
}

.scenario-result {
  background: var(--surface);
}

.scenario-steps {
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.scenario-steps li {
  margin: 10px 0;
}

.metric strong {
  display: block;
  margin-bottom: 6px;
  font-size: 30px;
  color: var(--deep);
}

.metric span,
.panel p,
.task-meta {
  color: var(--muted);
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 30px 0 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 30px;
}

.module-list {
  display: grid;
  gap: 10px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.module-item,
.task-item,
.support-item,
.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.timeline-item > span:first-child {
  min-width: 82px;
  color: var(--deep);
  font-weight: 840;
}

.timeline-item h3,
.timeline-item p,
.plan-summary h3,
.plan-summary p {
  margin: 0;
}

.timeline-item p,
.plan-summary p {
  margin-top: 4px;
  color: var(--muted);
}

.module-num {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--deep);
  font-weight: 840;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--deep);
  font-size: 13px;
  font-weight: 800;
}

.status.hot {
  background: #f1dfd6;
  color: #884936;
}

.status.done {
  background: #dfe8de;
  color: #3e6745;
}

.status-toggle {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--deep);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.status-toggle.done {
  border-color: #c8dac7;
  background: #dfe8de;
  color: #3e6745;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.support-case-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
}

.case-form {
  display: grid;
  gap: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.field-row label,
.field-block {
  display: grid;
  gap: 7px;
  font-weight: 780;
}

.field-row select,
.field-block select,
.field-block textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.field-block textarea {
  min-height: 132px;
  resize: vertical;
}

.case-consent {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.case-consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--deep);
}

.case-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tracker-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.tracker-entry {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.tracker-entry strong,
.tracker-entry span {
  display: block;
}

.tracker-entry span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.warning-panel {
  border-color: #e6c7b9;
  background: #fff8f3;
}

.question {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.question strong {
  display: block;
  margin-bottom: 12px;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.chip.active {
  border-color: var(--deep);
  background: var(--deep);
  color: var(--white);
}

.lesson-layout {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 18px;
}

.video-placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--white);
  background: linear-gradient(135deg, #243d2f, #6a8068);
  font-size: 18px;
  font-weight: 840;
}

.plain-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.plain-list li {
  margin: 8px 0;
}

.mobile-nav-toggle {
  display: none;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  font-weight: 800;
}

body.nav-open {
  overflow: hidden;
}

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

  .sidebar {
    display: none;
    position: fixed;
    inset: 72px 0 0 0;
    z-index: 30;
    min-height: auto;
    overflow: auto;
  }

  body.nav-open .sidebar {
    display: block;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
  }

  .hero-panel,
  .grid.four,
  .grid.three,
  .grid.two,
  .plan-summary,
  .session-grid,
  .report-grid,
  .report-sections,
  .report-sections.four,
  .scenario-layout,
  .support-case-layout,
  .field-row,
  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .content {
    width: min(100% - 28px, 1120px);
    padding-top: 22px;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 0 14px;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .module-item,
  .task-item,
  .support-item,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .task-actions {
    justify-content: stretch;
  }

  .task-actions .button,
  .task-actions .status-toggle {
    width: 100%;
  }

  .button-row .button {
    width: 100%;
  }
}
