:root {
  color-scheme: light;
  --ink: #15110d;
  --ink-soft: #332920;
  --muted: #766b61;
  --line: rgba(42, 34, 27, 0.16);
  --line-strong: rgba(21, 17, 13, 0.34);
  --paper: #f7efe1;
  --porcelain: #fffaf1;
  --panel: rgba(255, 252, 246, 0.84);
  --panel-solid: #fffaf4;
  --amber: #c9982f;
  --vermilion: #ef5a32;
  --blue: #214c9a;
  --green: #147c61;
  --aubergine: #6f3c8f;
  --rose: #c94f72;
  --shadow-soft: 0 24px 80px rgba(42, 34, 27, 0.12);
  --shadow-lift: 0 28px 90px rgba(42, 34, 27, 0.18);
  --radius: 8px;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.94), rgba(247, 239, 225, 0.98)),
    repeating-linear-gradient(90deg, rgba(21, 17, 13, 0.045) 0 1px, transparent 1px 82px),
    repeating-linear-gradient(0deg, rgba(21, 17, 13, 0.026) 0 1px, transparent 1px 82px),
    var(--paper);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(135deg, transparent 0 35%, rgba(33, 76, 154, 0.08) 35% 36%, transparent 36% 100%),
    linear-gradient(25deg, transparent 0 62%, rgba(239, 90, 50, 0.09) 62% 63%, transparent 63% 100%),
    linear-gradient(170deg, transparent 0 72%, rgba(20, 124, 97, 0.08) 72% 73%, transparent 73% 100%);
  pointer-events: none;
}

.ambient-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 20% 18%, rgba(21, 17, 13, 0.08) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 72%, rgba(21, 17, 13, 0.08) 0 1px, transparent 1px);
  background-size: 28px 28px, 34px 34px;
  mask-image: linear-gradient(180deg, black, transparent 78%);
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(33, 76, 154, 0.28);
  outline-offset: 3px;
}

.app-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 0 0;
  padding: 10px;
  border: 1px solid rgba(21, 17, 13, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 244, 0.78);
  box-shadow: 0 18px 50px rgba(42, 34, 27, 0.1);
  backdrop-filter: blur(22px) saturate(1.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 8px 0 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: conic-gradient(from 180deg, var(--vermilion), var(--amber), var(--green), var(--blue), var(--vermilion));
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 5px rgba(255, 250, 244, 0.3);
}

.brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1.14rem;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.nav-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(21, 17, 13, 0.1);
  background: rgba(21, 17, 13, 0.04);
  border-radius: 8px;
}

.nav-tab {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.nav-tab:hover {
  color: var(--ink);
}

.nav-tab.is-active {
  background: var(--ink);
  color: var(--porcelain);
  box-shadow: 0 12px 28px rgba(21, 17, 13, 0.18);
}

.view {
  padding: 28px 0 70px;
  animation: pageIn 320ms ease both;
}

.workflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.workbench,
.side-brief,
.course-reader,
.course-list-panel {
  border: 1px solid rgba(21, 17, 13, 0.14);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
}

.workbench {
  min-width: 0;
  padding: clamp(18px, 3vw, 34px);
}

.atelier-panel {
  position: relative;
  overflow: hidden;
}

.atelier-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--vermilion), var(--amber), var(--green), var(--blue), var(--aubergine));
}

.stage-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 20px;
}

.stage-ribbon span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(21, 17, 13, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.side-brief {
  position: sticky;
  top: 96px;
  padding: 22px;
  overflow: hidden;
}

.dossier {
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.88), rgba(247, 239, 225, 0.82)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(21, 17, 13, 0.05) 31px 32px);
}

.dossier-seal {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.dossier-seal span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: var(--porcelain);
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
}

.dossier-seal small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.side-brief h2,
.section-title h1,
.section-title h2 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0;
}

.side-brief h2 {
  margin-top: 12px;
  font-size: clamp(1.7rem, 2.4vw, 2.35rem);
  line-height: 0.98;
}

.side-brief p,
.section-title p {
  color: var(--muted);
  font-weight: 600;
}

.receipt-strip {
  position: relative;
  margin: 22px 0;
  padding: 17px 0 18px;
  border-top: 1px solid rgba(21, 17, 13, 0.16);
  border-bottom: 1px solid rgba(21, 17, 13, 0.16);
}

.receipt-strip span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.receipt-strip strong {
  display: block;
  margin: 2px 0;
  font-family: var(--display);
  font-size: 3.6rem;
  line-height: 0.86;
  letter-spacing: 0;
}

.dossier-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 0 18px;
  border: 1px solid rgba(21, 17, 13, 0.13);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(21, 17, 13, 0.12);
}

.dossier-metrics div {
  min-width: 0;
  padding: 12px 10px;
  background: rgba(255, 250, 244, 0.74);
}

.dossier-metrics strong {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1;
}

.dossier-metrics span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.signal-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 20px;
  padding: 14px 0 4px;
}

.signal-map span {
  display: block;
  min-height: 118px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.34), rgba(21, 17, 13, 0.1)),
    var(--bar-color);
  transform: translateY(var(--bar-shift));
  box-shadow: inset 0 0 0 1px rgba(21, 17, 13, 0.18);
  animation: columnBreathe 4.8s ease-in-out infinite;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 28px;
}

.step-dot {
  appearance: none;
  min-width: 0;
  min-height: 66px;
  display: grid;
  align-content: space-between;
  gap: 6px;
  padding: 11px;
  border: 1px solid rgba(21, 17, 13, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
}

.step-dot span {
  font-family: var(--display);
  font-size: 1.05rem;
  color: rgba(21, 17, 13, 0.38);
}

.step-dot strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-dot.is-active {
  border-color: rgba(21, 17, 13, 0.42);
  background: var(--ink);
  color: var(--porcelain);
}

.step-dot.is-active span {
  color: var(--amber);
}

.step-dot.is-done {
  background: rgba(20, 124, 97, 0.1);
  color: var(--green);
}

.step-dot.is-done:not(:disabled) {
  cursor: pointer;
}

.step-dot:disabled {
  cursor: default;
}

.section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 24px;
}

.section-title h1,
.section-title h2 {
  max-width: 820px;
  font-size: clamp(2.4rem, 6vw, 5.7rem);
  line-height: 0.88;
}

.workbench .section-title h2,
.course-list-panel .section-title h2 {
  font-size: clamp(2rem, 4.4vw, 4.3rem);
}

.title-index {
  font-family: var(--display);
  font-size: clamp(2.8rem, 7vw, 7rem);
  line-height: 0.78;
  color: rgba(21, 17, 13, 0.08);
  user-select: none;
}

.kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(21, 17, 13, 0.18);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.category-card {
  position: relative;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 17px;
  border: 1px solid rgba(21, 17, 13, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--card-accent) 70%, #fff 30%), rgba(255, 255, 255, 0.94) 54%),
    #fff;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 12px 34px rgba(42, 34, 27, 0.08);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.category-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 112px;
  height: 112px;
  border: 1px solid color-mix(in srgb, var(--card-color) 58%, transparent);
  border-radius: 50%;
}

.category-card:hover,
.category-card.is-selected {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--card-color) 72%, var(--ink) 28%);
  box-shadow: 0 26px 70px rgba(42, 34, 27, 0.16);
}

.category-card strong {
  display: block;
  max-width: 92%;
  font-family: var(--display);
  font-size: 1.28rem;
  line-height: 1;
}

.category-card span span {
  display: block;
  margin-top: 8px;
  color: #574b40;
  font-size: 0.9rem;
  font-weight: 700;
}

.category-orbit {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(21, 17, 13, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.56);
}

.category-orbit i {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--card-color);
  transform: rotate(12deg);
  box-shadow: 12px 8px 0 color-mix(in srgb, var(--card-color) 28%, transparent);
}

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

.textarea-shell {
  position: relative;
  display: block;
}

.field-label {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(21, 17, 13, 0.13);
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.86);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rich-textarea {
  display: block;
  width: 100%;
  min-height: 250px;
  resize: vertical;
  padding: 54px 18px 18px;
  border: 1px solid rgba(21, 17, 13, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 244, 0.96)),
    #fff;
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 18px 50px rgba(42, 34, 27, 0.08);
}

.rich-textarea:focus {
  border-color: rgba(33, 76, 154, 0.55);
}

.hint-row,
.action-row,
.plan-meta,
.payment-status,
.course-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.action-row {
  margin-top: 18px;
}

.reader-toolbar .action-row,
.course-topline.action-row {
  margin-top: 0;
}

.hint-row {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid rgba(21, 17, 13, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(42, 34, 27, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(42, 34, 27, 0.13);
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--porcelain);
}

.button.green {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.button.subtle {
  min-height: 38px;
  background: transparent;
  box-shadow: none;
}

.button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.button.icon {
  width: 44px;
  padding: 0;
}

.question-box,
.privacy-box,
.payment-box,
.progress-box {
  padding: 18px;
  border: 1px solid rgba(21, 17, 13, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(247, 239, 225, 0.68)),
    var(--panel-solid);
  box-shadow: 0 16px 42px rgba(42, 34, 27, 0.08);
}

.question-box strong,
.privacy-box strong,
.payment-box strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.05;
}

.recommendation-box {
  margin-bottom: 14px;
  border-color: rgba(33, 76, 154, 0.22);
  background:
    linear-gradient(135deg, rgba(33, 76, 154, 0.12), rgba(255, 250, 244, 0.9)),
    var(--panel-solid);
}

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

.plan-card {
  position: relative;
  display: grid;
  gap: 15px;
  min-height: 300px;
  padding: 20px;
  border: 1px solid rgba(21, 17, 13, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 244, 0.94)),
    #fff;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 18px 54px rgba(42, 34, 27, 0.1);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.plan-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 18px auto;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(21, 17, 13, 0.11);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 48%, rgba(21, 17, 13, 0.08) 48% 52%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(21, 17, 13, 0.08) 48% 52%, transparent 52%);
}

.plan-card:hover,
.plan-card.is-selected {
  transform: translateY(-4px);
  border-color: rgba(33, 76, 154, 0.38);
  box-shadow: var(--shadow-lift);
}

.plan-card.is-selected {
  background:
    linear-gradient(135deg, rgba(33, 76, 154, 0.13), rgba(255, 250, 244, 0.94)),
    #fff;
}

.plan-card.recommended {
  border-color: rgba(111, 60, 143, 0.34);
}

.plan-card > strong {
  font-family: var(--display);
  font-size: 1.8rem;
  line-height: 0.95;
}

.price {
  display: inline-block;
  margin-right: 8px;
  font-family: var(--display);
  font-size: 3.1rem;
  line-height: 0.86;
  font-weight: 800;
}

.old-price {
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(21, 17, 13, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.checkline {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid rgba(21, 17, 13, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
}

.checkline input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--green);
}

#stripeCheckoutContainer {
  padding: 0;
}

.payment-box {
  margin-bottom: 16px;
}

.payment-status {
  margin-bottom: 18px;
}

.payment-actions {
  display: grid;
  gap: 14px;
  max-width: 680px;
  margin: 0 0 22px;
}

#stripeCheckoutContainer,
.payment-actions .button,
#stripeCheckoutContainer .button {
  width: 100%;
}

.payment-actions .button,
#stripeCheckoutContainer .button {
  min-height: 52px;
}

.stripe-embedded-checkout {
  min-height: 560px;
  margin-top: 18px;
  padding: 16px 0 0;
  border-top: 1px solid rgba(21, 17, 13, 0.12);
}

.stripe-embedded-checkout[hidden] {
  display: none;
}

.payment-nav {
  margin-top: 0;
}

.progress-track {
  height: 16px;
  overflow: hidden;
  border: 1px solid rgba(21, 17, 13, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.progress-fill {
  width: var(--progress);
  height: 100%;
  background: linear-gradient(90deg, var(--vermilion), var(--amber), var(--green), var(--blue));
  transition: width 260ms ease;
}

.log-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.log-list li {
  padding: 11px 13px;
  border: 1px solid rgba(21, 17, 13, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: #4b433c;
  font-weight: 650;
}

.course-list-panel {
  padding: clamp(18px, 3vw, 34px);
}

.catalog-band {
  margin-top: 26px;
}

.catalog-band h3 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.45rem;
}

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

.course-card {
  position: relative;
  min-height: 245px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 19px;
  border: 1px solid rgba(21, 17, 13, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 244, 0.94)),
    #fff;
  box-shadow: 0 17px 48px rgba(42, 34, 27, 0.1);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.course-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--course-color);
}

.course-card::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 62px;
  height: 62px;
  border: 1px solid color-mix(in srgb, var(--course-color) 45%, transparent);
  border-radius: 8px;
  transform: rotate(8deg);
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.course-topline {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.course-card h3 {
  margin: 0 0 10px;
  max-width: 92%;
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 0.98;
}

.course-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.course-reader {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 740px;
  overflow: hidden;
}

.reader-sidebar {
  padding: 20px;
  border-right: 1px solid rgba(21, 17, 13, 0.13);
  background:
    linear-gradient(180deg, rgba(247, 239, 225, 0.88), rgba(255, 250, 244, 0.76)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(21, 17, 13, 0.045) 31px 32px);
}

.reader-sidebar h2 {
  margin: 16px 0 8px;
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 0.96;
}

.reader-sidebar p {
  color: var(--muted);
  font-weight: 650;
}

.lesson-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.lesson-tab {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(21, 17, 13, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.lesson-tab:hover,
.lesson-tab.is-active {
  transform: translateY(-2px);
  border-color: rgba(21, 17, 13, 0.34);
  background: rgba(255, 255, 255, 0.9);
}

.lesson-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--porcelain);
  font-family: var(--display);
  font-weight: 800;
}

.reader-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(255, 255, 255, 0.62);
}

.reader-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(21, 17, 13, 0.12);
  background: rgba(255, 250, 244, 0.82);
}

.reader-toolbar strong {
  display: block;
  font-family: var(--display);
  font-size: 1.2rem;
}

.lesson-frame {
  width: 100%;
  min-height: 670px;
  height: 100%;
  border: 0;
  background: #fffaf2;
}

.empty-state {
  padding: 32px;
  border: 1px dashed rgba(21, 17, 13, 0.2);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
  font-weight: 700;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 34px 0 40px;
  border-top: 1px solid rgba(21, 17, 13, 0.13);
  color: var(--muted);
}

.footer-author {
  min-width: 0;
}

.footer-author span,
.footer-author small {
  display: block;
}

.footer-author span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-author strong {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 2.1rem);
  line-height: 0.95;
}

.footer-author small {
  margin-top: 8px;
  max-width: 460px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 8px;
}

.socials a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(21, 17, 13, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.socials a:hover {
  transform: translateY(-1px);
  border-color: rgba(33, 76, 154, 0.28);
  background: #fff;
  color: var(--blue);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100% - 36px));
  padding: 14px 16px;
  border: 1px solid rgba(21, 17, 13, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 244, 0.94);
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes columnBreathe {
  0%,
  100% {
    filter: saturate(0.96);
  }
  50% {
    filter: saturate(1.16) brightness(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1040px) {
  .workflow,
  .course-reader {
    grid-template-columns: 1fr;
  }

  .side-brief {
    position: static;
    order: -1;
  }

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

  .reader-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(21, 17, 13, 0.13);
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .brand small {
    display: none;
  }

  .nav-tabs,
  .stepper,
  .category-grid,
  .plan-grid,
  .course-grid,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .socials {
    justify-content: flex-start;
  }

  .workbench,
  .course-list-panel {
    padding: 16px;
  }

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

  .title-index {
    display: none;
  }

  .section-title h1,
  .section-title h2 {
    font-size: 2.55rem;
  }

  .receipt-strip strong {
    font-size: 3rem;
  }

  .course-reader {
    min-height: 0;
  }

  .reader-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .lesson-frame {
    min-height: 740px;
  }
}
