:root {
  --bg: #101717;
  --bg-soft: #17201f;
  --surface: #1f2b29;
  --surface-2: #263734;
  --text: #fff4dc;
  --muted: #d9c9a9;
  --gold: #f0aa3e;
  --amber: #ffd37a;
  --green: #31543d;
  --teal: #14312f;
  --line: rgba(255, 244, 220, 0.16);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #fff4dc;
  --bg-soft: #fff9ea;
  --surface: #f4ead5;
  --surface-2: #e8ddc8;
  --text: #18211f;
  --muted: #53645d;
  --gold: #9b641c;
  --amber: #8a5a18;
  --green: #31543d;
  --teal: #14312f;
  --line: rgba(24, 33, 31, 0.16);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

button.primary {
  background: var(--gold);
  color: #101717;
  border-color: transparent;
  font-weight: 800;
}

button.icon {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

button:disabled {
  opacity: 0.52;
  cursor: default;
}

.button-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(31, 43, 41, 0.72);
  color: var(--text);
  padding: 0 14px;
  text-decoration: none;
  font-weight: 700;
}

.button-link:hover {
  border-color: var(--gold);
  color: var(--amber);
}

.subtle-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: var(--amber);
  font-weight: 800;
  text-decoration: none;
}

.subtle-link:hover {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 4px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.app-shell {
  min-height: 100vh;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: grid;
  gap: 4px;
}

.brand-title {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 900;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}

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

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
}

.nav button.active {
  background: var(--surface-2);
  border-color: var(--gold);
}

.nav-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
  color: var(--amber);
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
}

.nav-icon-home::before {
  inset: 6px 3px 2px;
  border-top: 0;
}

.nav-icon-home::after {
  width: 10px;
  height: 10px;
  left: 3px;
  top: 1px;
  transform: rotate(45deg);
  border-right: 0;
  border-bottom: 0;
}

.nav-icon-learn::before {
  inset: 2px 3px;
  border-radius: 999px;
}

.nav-icon-learn::after {
  width: 8px;
  height: 2px;
  left: 5px;
  top: 8px;
  border-width: 0;
  background: currentColor;
}

.nav-icon-tools::before {
  width: 12px;
  height: 4px;
  left: 3px;
  top: 7px;
  border-radius: 4px;
  transform: rotate(-35deg);
}

.nav-icon-progress::before {
  width: 3px;
  height: 9px;
  left: 3px;
  bottom: 2px;
  background: currentColor;
}

.nav-icon-progress::after {
  width: 3px;
  height: 14px;
  right: 3px;
  bottom: 2px;
  background: currentColor;
}

.nav-icon-profile::before {
  width: 7px;
  height: 7px;
  left: 5px;
  top: 1px;
  border-radius: 999px;
}

.nav-icon-profile::after {
  width: 13px;
  height: 7px;
  left: 2px;
  bottom: 1px;
  border-radius: 999px 999px 3px 3px;
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
}

.muted {
  color: var(--muted);
}

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

.grid > *,
.panel,
.card {
  min-width: 0;
}

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

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

.panel {
  padding: 18px;
  box-shadow: var(--shadow);
}

.card {
  padding: 14px;
}

.cover-panel {
  min-height: 320px;
  background-image: linear-gradient(180deg, rgba(16, 23, 23, 0.1), rgba(16, 23, 23, 0.82)), url("assets/write-cover.jpg");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: end;
}

.cover-panel h2 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(30px, 5vw, 64px);
  line-height: 0.95;
}

.stat {
  display: grid;
  gap: 4px;
}

.stat strong {
  font-size: 28px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.lesson-item {
  width: 100%;
  text-align: left;
  padding: 12px;
  background: var(--surface);
}

.lesson-item.active {
  border-color: var(--gold);
  background: var(--surface-2);
}

.lesson-body {
  white-space: pre-wrap;
  line-height: 1.62;
  max-height: 520px;
  overflow: auto;
  padding-right: 8px;
}

.lesson-map-panel {
  padding: 16px;
  overflow: hidden;
}

.lesson-map-head,
.lesson-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.lesson-map-head h2,
.lesson-header h2 {
  margin: 0;
}

.map-progress {
  min-width: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 10px;
  text-align: center;
}

.map-progress strong,
.map-progress span {
  display: block;
}

.map-progress strong {
  font-size: 22px;
}

.map-progress span {
  color: var(--muted);
  font-size: 12px;
}

.lesson-map {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 14px 2px 4px;
  scroll-snap-type: x proximity;
}

.map-section {
  flex: 0 0 auto;
  min-width: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 244, 220, 0.03);
  padding: 10px;
  scroll-snap-align: start;
}

.map-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--amber);
  font-size: 13px;
  text-transform: uppercase;
}

.map-section-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.map-node {
  position: relative;
  flex: 0 0 142px;
  min-height: 136px;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  scroll-snap-align: start;
  padding: 12px;
  text-align: left;
  background: var(--bg-soft);
}

.map-node::after {
  content: "";
  position: absolute;
  top: 33px;
  left: 58px;
  right: -18px;
  height: 2px;
  background: var(--line);
  z-index: 0;
}

.map-node:last-child::after {
  display: none;
}

.map-node.active {
  border-color: var(--gold);
  background: var(--surface-2);
}

.map-node.completed {
  border-color: rgba(240, 170, 62, 0.65);
}

.map-node.recommended {
  box-shadow: 0 0 0 2px rgba(240, 170, 62, 0.16);
}

.map-node.future {
  opacity: 0.78;
}

.map-node.locked {
  opacity: 0.54;
}

.map-node.locked .map-circle {
  border-color: var(--line);
  color: var(--muted);
  background: var(--bg-soft);
}

.map-node.locked:hover {
  border-color: var(--line);
}

.map-circle {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
}

.map-node.active .map-circle {
  border-color: var(--gold);
  color: var(--amber);
}

.map-node.completed .map-circle {
  border-color: var(--gold);
  background: conic-gradient(var(--gold) calc(var(--score, 100) * 1%), rgba(240, 170, 62, 0.18) 0);
  color: #101717;
}

.map-copy {
  display: grid;
  gap: 3px;
}

.map-copy strong {
  line-height: 1.2;
}

.map-copy span {
  color: var(--muted);
  font-size: 13px;
}

.map-stage {
  color: var(--amber) !important;
  font-size: 12px !important;
  text-transform: uppercase;
}

.lesson-workspace {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  justify-self: center;
}

.demo-access-panel {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border-color: rgba(240, 170, 62, 0.4);
  background: linear-gradient(180deg, rgba(240, 170, 62, 0.08), var(--surface));
}

.demo-access-panel h2 {
  margin: 0 0 4px;
}

.lesson-kicker {
  color: var(--amber);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.status-pill {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 0 12px;
  background: var(--bg-soft);
}

.status-pill.ready {
  border-color: rgba(240, 170, 62, 0.6);
  color: var(--amber);
}

.status-pill.done {
  border-color: var(--gold);
  background: rgba(240, 170, 62, 0.14);
  color: var(--amber);
}

.lesson-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 14px;
  margin: 16px 0;
}

.lesson-brief > div,
.lesson-toolbox,
.source-lesson {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 14px;
}

.lesson-brief h3 {
  margin-top: 0;
}

.micro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.mini-teach {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.mini-teach p {
  color: var(--muted);
}

.format-path {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.format-path span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 10px;
  font-size: 13px;
}

.format-path b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(240, 170, 62, 0.16);
  color: var(--amber);
  margin-right: 6px;
}

.lesson-toolbox {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
  margin: 16px 0;
}

.lesson-toolbox h3 {
  margin: 4px 0 8px;
}

.lesson-toolbox p {
  color: var(--muted);
  line-height: 1.55;
}

.tool-link-grid {
  display: grid;
  gap: 8px;
}

.tool-link-card {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px;
  background: var(--surface);
}

.tool-link-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.source-lesson summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--amber);
}

.source-lesson .lesson-body {
  margin-top: 14px;
}

.lesson-activity {
  min-width: 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
  scroll-margin-top: 14px;
}

.activity-stepper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
}

.activity-dot {
  flex: 0 0 auto;
  min-width: 76px;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.activity-dot span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  font-weight: 900;
}

.activity-dot.active span,
.activity-dot.done span {
  border-color: var(--gold);
  background: rgba(240, 170, 62, 0.16);
  color: var(--amber);
}

.activity-dot.active strong {
  color: var(--text);
}

.activity-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 18px;
  animation: activity-in 180ms ease-out;
  scroll-margin-top: 14px;
}

@keyframes activity-in {
  from { opacity: 0.72; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.activity-card h3 {
  margin: 4px 0 10px;
  font-size: 26px;
}

.activity-kicker {
  color: var(--amber);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-coach,
.answer-feedback {
  border-radius: 8px;
  margin: 14px 0;
  padding: 12px;
}

.activity-coach {
  border: 1px solid rgba(240, 170, 62, 0.35);
  color: var(--amber);
  background: rgba(240, 170, 62, 0.08);
}

.activity-card textarea {
  min-height: 170px;
  margin-top: 10px;
}

.activity-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.rule-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 8px 12px;
  white-space: nowrap;
}

.rule-pill.done {
  border-color: rgba(240, 170, 62, 0.62);
  color: var(--amber);
  background: rgba(240, 170, 62, 0.1);
}

.answer-grid {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.answer-choice {
  min-height: 58px;
  padding: 13px 14px;
  text-align: left;
  background: var(--surface);
}

.answer-choice.selected {
  border-color: var(--gold);
}

.answer-choice.correct {
  border-color: #68c98b;
  background: rgba(104, 201, 139, 0.12);
  color: var(--text);
}

.answer-choice.wrong {
  border-color: #f08375;
  background: rgba(240, 131, 117, 0.12);
  color: var(--text);
}

.answer-feedback.correct {
  border: 1px solid rgba(104, 201, 139, 0.5);
  color: #b7f1c9;
  background: rgba(104, 201, 139, 0.1);
  box-shadow: 0 0 0 1px rgba(104, 201, 139, 0.08) inset;
}

.answer-feedback.wrong {
  border: 1px solid rgba(240, 131, 117, 0.5);
  color: #ffc5bd;
  background: rgba(240, 131, 117, 0.1);
  box-shadow: 0 0 0 1px rgba(240, 131, 117, 0.08) inset;
}

.answer-feedback p {
  margin: 6px 0 0;
}

.completion-score {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 999px;
  color: var(--amber);
  font-size: 28px;
  font-weight: 900;
}

.note-block {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.note-block summary {
  cursor: pointer;
  color: var(--amber);
  font-weight: 900;
}

.note-form {
  margin-top: 12px;
}

.toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
}

.toggle-row input {
  width: auto;
}

.lesson-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.lesson-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 12px;
}

.lesson-metrics strong,
.lesson-metrics span {
  display: block;
}

.lesson-metrics strong {
  font-size: 20px;
}

.lesson-metrics span {
  color: var(--muted);
  font-size: 13px;
}

.completion-banner {
  border: 1px solid rgba(240, 170, 62, 0.42);
  border-radius: 8px;
  background: rgba(240, 170, 62, 0.1);
  color: var(--amber);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.practice-lab,
.note-block {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.practice-lab textarea {
  min-height: 150px;
  margin: 8px 0 14px;
}

.quiz-list {
  display: grid;
  gap: 12px;
}

.quiz-question {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  margin: 0;
  padding: 12px;
}

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

.quiz-question label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
  color: var(--muted);
}

.quiz-question input {
  width: auto;
  margin-top: 4px;
}

.completion-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.completion-rules span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 13px;
}

.completion-rules span.done {
  border-color: rgba(240, 170, 62, 0.62);
  color: var(--amber);
  background: rgba(240, 170, 62, 0.1);
}

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

.chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  color: var(--muted);
  background: var(--bg-soft);
  font-size: 13px;
}

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

.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.result-list {
  display: grid;
  gap: 8px;
}

.intelligence-card h2 {
  margin-top: 4px;
}

.tools-layout {
  align-items: start;
}

.tool-chooser {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1.15fr);
  gap: 16px;
  align-items: end;
}

.tool-chooser h2 {
  margin: 4px 0 6px;
}

.tool-picker-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.tool-active-summary {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 11px 12px;
}

.tool-active-summary span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.tool-workspace {
  scroll-margin-top: 14px;
}

.preview-lock {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(240, 170, 62, 0.35);
  border-radius: 8px;
  background: rgba(240, 170, 62, 0.08);
  padding: 12px;
  margin: 12px 0;
}

.preview-lock span {
  color: var(--muted);
  line-height: 1.45;
}

.preview-lock button {
  justify-self: start;
}

.account-required-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 260px;
}

.account-required-panel h2 {
  max-width: 720px;
  margin: 2px 0 0;
}

.account-required-panel p {
  max-width: 760px;
}

.tool-menu {
  display: grid;
  gap: 8px;
}

.tool-menu-item {
  display: grid;
  gap: 3px;
  text-align: left;
  background: var(--bg-soft);
  padding: 12px;
}

.tool-menu-item.active {
  border-color: var(--gold);
  background: var(--surface-2);
}

.tool-menu-item span {
  color: var(--muted);
  font-size: 13px;
}

.tool-guide {
  border: 1px solid rgba(240, 170, 62, 0.35);
  border-radius: 8px;
  background: rgba(240, 170, 62, 0.08);
  padding: 12px;
  margin: 12px 0;
}

.tool-guide p {
  margin: 4px 0 0;
  color: var(--muted);
}

.related-lessons {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 12px;
  margin: 12px 0;
}

.related-lessons strong {
  display: block;
  margin-bottom: 8px;
}

.chip-button {
  border-radius: 999px;
  border: 1px solid var(--line);
  min-height: 32px;
  padding: 5px 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
}

.chip-button:hover {
  border-color: var(--gold);
  color: var(--amber);
}

.entry-fields {
  display: grid;
  gap: 5px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 14px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.card-actions button {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 13px;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0;
}

.stage-progress {
  display: grid;
  gap: 7px;
}

.stage-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.diploma-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  align-items: center;
}

.diploma-panel.locked {
  opacity: 0.84;
}

.diploma-panel h2 {
  margin: 4px 0 8px;
}

.diploma-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.diploma-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 13px;
}

.diploma-stats strong {
  color: var(--amber);
}

.diploma-preview {
  position: relative;
  border: 4px double rgba(240, 170, 62, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(240, 170, 62, 0.08), transparent 44%),
    var(--bg-soft);
  padding: clamp(20px, 4vw, 36px);
  text-align: center;
  overflow: hidden;
}

.diploma-preview::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 244, 220, 0.14);
  border-radius: 6px;
  pointer-events: none;
}

.diploma-seal {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: var(--gold);
  color: #101717;
  font-weight: 900;
  box-shadow: 0 0 0 8px rgba(240, 170, 62, 0.12);
}

.diploma-overline {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.diploma-preview h3 {
  margin: 8px 0 14px;
  font-size: clamp(24px, 4vw, 40px);
}

.diploma-awarded,
.diploma-preview p {
  color: var(--muted);
}

.diploma-name {
  display: block;
  color: var(--amber);
  font-size: clamp(26px, 4vw, 44px);
  margin: 8px 0 14px;
}

.diploma-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.heatmap {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 112px;
}

.heat {
  width: 28px;
  border-radius: 5px;
  background: var(--gold);
  opacity: 0.35;
}

.reward-card {
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(240, 170, 62, 0.45);
  border-radius: 8px;
  background: rgba(240, 170, 62, 0.1);
  padding: 14px;
  margin: 10px 0 14px;
}

.reward-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.badge-burst {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  background: var(--gold);
  color: #101717;
  font-weight: 900;
  box-shadow: 0 0 0 8px rgba(240, 170, 62, 0.12);
  animation: badge-pop 520ms ease-out;
}

@keyframes badge-pop {
  0% { transform: scale(0.82); opacity: 0.2; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 244, 220, 0.03);
  padding: 14px;
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
}

.empty-state p {
  margin: 0 0 10px;
  color: var(--muted);
}

.mobile-tabs {
  display: none;
}

.landing {
  min-height: 100vh;
  background: var(--bg);
}

.landing-hero {
  min-height: 76vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px);
  gap: 24px;
  align-items: center;
  padding: clamp(20px, 6vw, 72px);
  background-image:
    linear-gradient(90deg, rgba(16, 23, 23, 0.98), rgba(16, 23, 23, 0.72) 52%, rgba(16, 23, 23, 0.42)),
    url("assets/write-cover.jpg");
  background-size: cover;
  background-position: center;
}

.landing-copy {
  max-width: 820px;
}

.landing-kicker {
  color: var(--amber);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.landing-copy h1 {
  margin: 18px 0;
  max-width: 920px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.94;
}

.landing-copy p {
  max-width: 700px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.book-companion {
  border-left: 3px solid var(--gold);
  padding-left: 12px;
  font-size: 15px !important;
}

.trust-row {
  margin-top: 12px;
}

.landing-product {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 150px));
  gap: 10px;
  margin-top: 22px;
}

.landing-product div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(31, 43, 41, 0.72);
  padding: 12px;
}

.landing-product strong,
.landing-product span {
  display: block;
}

.landing-product strong {
  color: var(--amber);
  font-size: 26px;
}

.landing-product span {
  color: var(--muted);
  font-size: 13px;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 22px;
}

.landing-proof,
.landing-tool-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 22px;
}

.landing-proof div,
.tool-preview-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.landing-proof strong,
.landing-proof span,
.tool-preview-card strong,
.tool-preview-card span {
  display: block;
}

.landing-proof strong,
.tool-preview-card strong {
  color: var(--text);
  margin-bottom: 6px;
}

.landing-proof span,
.tool-preview-card span {
  color: var(--muted);
  line-height: 1.5;
}

.tool-preview-card {
  display: grid;
  gap: 10px;
}

.tool-preview-card button {
  justify-self: start;
  min-height: 34px;
  padding: 6px 11px;
}

.landing-tool-preview {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.landing-tool-preview h2 {
  margin: 6px 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.tool-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.landing-diploma {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: center;
  gap: 18px;
  margin: 0 22px 22px;
}

.landing-diploma h2 {
  margin: 6px 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.mini-diploma {
  border: 4px double rgba(240, 170, 62, 0.72);
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 24px;
  text-align: center;
}

.mini-diploma span,
.mini-diploma strong,
.mini-diploma small {
  display: block;
}

.mini-diploma span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-diploma strong {
  margin: 10px 0;
  font-size: 28px;
  line-height: 1;
}

.mini-diploma small {
  color: var(--muted);
}

.auth-card {
  background: rgba(31, 43, 41, 0.94);
}

.auth-intro {
  margin-top: -4px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.auth-tabs button.active {
  border-color: var(--gold);
  background: var(--surface-2);
}

.auth-benefits,
.onboarding-benefits {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.auth-benefits span::before,
.onboarding-benefits span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--amber);
  color: var(--amber);
  margin-right: 10px;
  vertical-align: 0.12em;
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid rgba(255, 112, 112, 0.5);
  border-radius: 8px;
  color: #ffb3a8;
  background: rgba(255, 112, 112, 0.08);
}

.auth-message {
  padding: 10px 12px;
  border: 1px solid rgba(240, 170, 62, 0.5);
  border-radius: 8px;
  color: var(--amber);
  background: rgba(240, 170, 62, 0.08);
}

.auth-trust {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.auth-trust strong {
  color: var(--text);
}

.landing-seo {
  margin: 0 22px 22px;
}

.landing-seo h2 {
  max-width: 820px;
}

.landing-seo p {
  max-width: 920px;
  color: var(--muted);
  line-height: 1.65;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links a,
.public-back {
  color: var(--amber);
  text-decoration: none;
}

.public-page {
  background: var(--bg);
}

.public-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 5vw, 54px);
}

.public-hero {
  margin-top: 18px;
  background-image: linear-gradient(120deg, rgba(31, 43, 41, 0.96), rgba(20, 49, 47, 0.84)), url("assets/write-cover.jpg");
  background-size: cover;
  background-position: center;
}

.public-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(36px, 7vw, 72px);
  line-height: 0.98;
}

.public-hero p,
.public-copy p,
.public-grid p {
  color: var(--muted);
  line-height: 1.65;
}

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

.public-copy {
  margin-top: 14px;
}

.hidden {
  display: none !important;
}

.onboarding {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background-image: linear-gradient(120deg, rgba(16, 23, 23, 0.94), rgba(20, 49, 47, 0.86)), url("assets/write-cover.jpg");
  background-size: cover;
  background-position: center;
}

.onboarding-panel {
  width: min(680px, 100%);
}

.onboarding-panel h1 {
  margin: 8px 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
}

@media (max-width: 880px) {
  .layout {
    grid-template-columns: 1fr;
    padding-bottom: 74px;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .sidebar .nav {
    display: none;
  }

  .main {
    padding: 14px;
  }

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

  .span-12,
  .span-8,
  .span-6,
  .span-4,
  .span-3 {
    grid-column: span 1;
  }

  .two {
    grid-template-columns: 1fr;
  }

  .lesson-metrics {
    grid-template-columns: 1fr;
  }

  .lesson-map-panel {
    padding: 12px;
  }

  .lesson-map-head,
  .lesson-header {
    display: grid;
  }

  .map-progress {
    width: 100%;
    text-align: left;
  }

  .map-progress strong,
  .map-progress span {
    display: inline;
  }

  .lesson-map {
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .map-section {
    min-width: 238px;
  }

  .map-node {
    flex-basis: 118px;
    min-height: 122px;
    padding: 10px;
  }

  .map-node::after {
    top: 31px;
    left: 52px;
  }

  .map-circle {
    width: 40px;
    height: 40px;
  }

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

  .demo-access-panel {
    display: grid;
  }

  .lesson-actions button,
  .lesson-actions .status-pill {
    flex: 1 1 auto;
    justify-content: center;
  }

  .lesson-brief,
  .lesson-toolbox,
  .micro-grid,
  .tool-chooser,
  .tool-picker-row,
  .format-path {
    grid-template-columns: 1fr;
  }

  .tool-workspace {
    scroll-margin-top: 10px;
  }

  .mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px;
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
  }

  .mobile-tabs button {
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 48px;
    padding: 6px 4px;
    font-size: 11px;
  }

  .mobile-tabs button.active {
    border-color: var(--gold);
    background: var(--surface-2);
  }

  .mobile-tabs .nav-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  .landing-hero,
  .landing-grid,
  .landing-proof,
  .landing-tool-preview,
  .landing-diploma {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: auto;
    gap: 18px;
    align-items: start;
    padding: 28px 20px 26px;
    background-image:
      linear-gradient(180deg, rgba(16, 23, 23, 0.98), rgba(16, 23, 23, 0.86) 46%, rgba(16, 23, 23, 0.72)),
      url("assets/write-cover.jpg");
    background-position: center top;
  }

  .landing-copy {
    max-width: 100%;
  }

  .landing-kicker {
    font-size: 11px;
    line-height: 1.35;
  }

  .landing-copy .brand-title {
    margin-top: 3px;
    font-size: 22px;
    line-height: 1.1;
  }

  .landing-copy h1 {
    margin: 22px 0 16px;
    font-size: 38px;
    line-height: 1.08;
    max-width: 14ch;
  }

  .landing-copy p {
    font-size: 16px;
    line-height: 1.55;
  }

  .book-companion {
    margin-top: 18px;
    margin-bottom: 18px;
    font-size: 14px !important;
    line-height: 1.55 !important;
  }

  .landing-copy .toolbar {
    gap: 10px;
  }

  .landing-copy .toolbar button,
  .landing-copy .toolbar .button-link {
    flex: 1 1 calc(50% - 8px);
    min-width: 148px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .landing-copy .toolbar .subtle-link {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 40px;
    border: 1px solid rgba(240, 170, 62, 0.28);
    border-radius: 8px;
    background: rgba(16, 23, 23, 0.44);
    padding: 0 12px;
    text-decoration: none;
  }

  .trust-row {
    gap: 8px;
    margin-top: 14px;
  }

  .trust-row .chip {
    font-size: 12px;
    padding: 6px 10px;
  }

  .landing-product {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 24px;
  }

  .landing-product div {
    padding: 10px;
    background: rgba(16, 23, 23, 0.54);
  }

  .auth-card {
    background: rgba(31, 43, 41, 0.9);
    padding: 18px;
  }

  .auth-card h2 {
    margin-top: 0;
  }

  .auth-tabs {
    gap: 6px;
  }

  .auth-tabs button {
    padding: 6px 8px;
    line-height: 1.15;
  }

  .auth-error,
  .auth-message {
    font-size: 14px;
    line-height: 1.45;
  }

  .tool-preview-grid {
    grid-template-columns: 1fr;
  }

  .landing-diploma {
    margin-left: 14px;
    margin-right: 14px;
  }

  .public-grid {
    grid-template-columns: 1fr;
  }

  .diploma-panel {
    grid-template-columns: 1fr;
  }

  .diploma-meta {
    display: grid;
    justify-content: stretch;
  }
}
