:root {
  --ink: #1c3330;
  --paper: #f7fbf8;
  --muted: #4e655f;
  --line: #c5d9d0;
  --lime: #d7ebc9;
  --emerald: #2f6f5e;
  --emerald-deep: #1f4f43;
  --pink: #a85a72;
  --pink-soft: #f6e4e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(165deg, #1a322e 0%, #243f3a 52%, #2a3834 100%);
  color: #f3f6f4;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
}

.shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 272px;
  height: 100vh;
  padding: 1.25rem 1rem 1.5rem;
  border-right: 1px solid rgba(243, 246, 244, 0.12);
  background: rgba(14, 28, 26, 0.35);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 1.75rem;
  overflow: auto;
}

.side-nav a {
  display: block;
  padding: 0.75rem 0.85rem;
  border: 1px solid transparent;
  color: #f3f6f4;
  font-weight: 600;
  text-decoration: none;
}

.side-nav a:hover,
.side-nav a:focus-visible {
  border-color: rgba(215, 235, 201, 0.45);
}

.side-nav a[aria-current="page"] {
  background: var(--lime);
  color: var(--emerald-deep);
}

.side-course {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.course-self .tone-sales,
.course-sales .tone-self {
  order: 2;
}

.side-lessons {
  display: none;
  list-style: none;
  margin: 0 0 0.45rem;
  padding: 0 0 0 0.35rem;
}

.side-course.is-here .side-lessons {
  display: block;
}

.side-lessons a,
.side-lessons .is-closed {
  padding: 0.4rem 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
}

.side-lessons a {
  color: #d7e3de;
}

.side-lessons .is-closed,
.side-lessons .is-closed .lesson-num {
  color: #9aa09e;
  font-weight: 500;
  cursor: default;
}

.lesson-num {
  display: block;
  margin-bottom: 0.08rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.side-lessons a:hover,
.side-lessons a:focus-visible {
  border-color: transparent;
  background: rgba(243, 246, 244, 0.08);
}

.tone-sales > a[aria-current="page"],
.tone-sales .side-lessons a[aria-current="page"] {
  background: var(--pink);
  color: #fff;
}

.side-lessons a[aria-current="page"] .lesson-num {
  color: inherit;
}

.side-course.is-here > a:not([aria-current="page"]) {
  box-shadow: inset 3px 0 0 var(--lime);
}

.tone-sales.is-here > a:not([aria-current="page"]) {
  box-shadow: inset 3px 0 0 #e7b4c2;
}

.side-note {
  margin: auto 0 0;
  color: #b7c7c1;
  font-size: 0.92rem;
}

.page {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 1.75rem 2rem 3rem;
  background: #eef4f0;
  color: var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #f3f6f4;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 48px;
  height: 48px;
}

.brand-mark rect {
  fill: var(--lime);
}

.brand-mark path {
  fill: none;
  stroke: var(--emerald-deep);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.course-sales .brand-mark rect {
  fill: #f4c9d4;
}

.course-sales .brand-mark path {
  stroke: #7a3e52;
}

.course-sales .brand-name span {
  color: #f7d0da;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.brand-name span {
  color: var(--lime);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1 {
  margin: 1.75rem 0 0;
  max-width: none;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.subtitle {
  margin: 1rem 0 0;
  max-width: none;
  color: var(--ink);
  font-size: 1.15rem;
}

.lead {
  margin: 0.85rem 0 0;
  max-width: none;
  color: var(--muted);
}

.sheet {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}

.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.switch button,
.topics button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.switch button {
  min-height: 3.25rem;
  padding: 0.7rem 0.8rem;
}

.switch button[aria-selected="true"] {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

#tab-sales[aria-selected="true"] {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
}

.icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.course-panel {
  margin-top: 1.25rem;
}

h2 {
  margin: 0 0 0.7rem;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.who,
.result {
  margin: 0;
}

.label {
  font-weight: 700;
}

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.15rem;
}

.topics button {
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.topics button[aria-selected="true"] {
  background: var(--lime);
  border-color: var(--emerald);
  color: var(--emerald-deep);
}

.sheet-sales .topics button[aria-selected="true"] {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
}

.topic-panel {
  margin-top: 0.85rem;
  padding: 1.15rem 1.1rem;
  background: var(--lime);
  color: var(--emerald-deep);
}

.topic-panel > p {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.result {
  margin-top: 1.15rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.25rem;
  padding: 0.9rem 1.15rem;
  background: var(--emerald);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.button-sales {
  background: var(--pink);
  color: #fff;
}

.button:focus-visible,
.switch button:focus-visible,
.topics button:focus-visible,
.chapter-nav a:focus-visible,
.lessons a:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
}

.note {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.note p {
  margin: 0;
}

.page-course h1 {
  max-width: none;
}

.free {
  display: inline-block;
  margin: 1.1rem 0 0;
  padding: 0.2rem 0.6rem;
  background: var(--pink-soft);
  color: #8a4458;
  font-size: 0.92rem;
  font-weight: 700;
}

.facts {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.fact {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--paper);
  border-left: 4px solid var(--emerald);
}

.fact-stop {
  border-left-color: var(--pink);
  background: var(--pink-soft);
}

.fact-go {
  background: var(--lime);
}

.lessons {
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.lessons li {
  margin: 0;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.lessons h3 {
  margin: 0;
  font-size: 1.05rem;
}

.lessons a {
  color: inherit;
  text-underline-offset: 0.18em;
}

.lessons a:hover,
.lessons a:focus-visible {
  color: #6d3144;
}

.kicker {
  margin: 1.35rem 0 0;
  color: #8a4458;
  font-weight: 700;
}

.kicker + h1 {
  margin-top: 0.3rem;
}

.chapter-top {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 0.75rem;
  align-items: stretch;
}

.chapter-top .outcomes {
  margin-top: 1.15rem;
}

.principle {
  margin-top: 1.15rem;
  padding: 1rem 1rem 0.2rem;
  background: var(--pink-soft);
  border-left: 4px solid var(--pink);
  color: var(--ink);
}

.principle p:last-child {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
}

.block-label {
  margin: 0 0 0.35rem;
  color: #8a4458;
  font-size: 0.92rem;
  font-weight: 700;
}

.chapter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  position: sticky;
  top: 0;
  z-index: 1;
  margin-top: 1.25rem;
  padding: 0.7rem 0;
  background: #eef4f0;
}

.chapter-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.chapter-nav a:hover,
.chapter-nav a:focus-visible {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
}

.lesson {
  margin-top: 0.5rem;
  padding: 1.25rem 1.25rem 1.4rem;
  scroll-margin-top: 4.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}

.lesson:target {
  border-color: var(--pink);
}

.lesson h2 {
  margin-bottom: 0.45rem;
}

.lesson h3 {
  margin: 1.25rem 0 0.45rem;
  font-size: 1.2rem;
}

.lesson-goal {
  margin: 0;
  color: var(--muted);
}

.say,
.miss,
.task,
.card {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
}

.say {
  margin: 1rem 0 0;
  background: var(--lime);
  color: var(--emerald-deep);
}

.say-soft {
  background: #f3f7f1;
  color: var(--ink);
}

.say p + p {
  margin-top: 0.45rem;
}

.say p:last-child,
.miss p:last-child,
.task p:last-child,
.card p:last-child {
  margin-bottom: 0;
}

.miss {
  background: var(--pink-soft);
  color: var(--ink);
}

.task {
  background: #fff;
  border-left: 4px solid var(--pink);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
}

.card-go {
  background: var(--lime);
  border-color: var(--emerald);
  color: var(--emerald-deep);
}

.table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
}

.terms {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  color: var(--ink);
}

.terms th,
.terms td {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-weight: 400;
}

.terms thead th {
  background: var(--pink-soft);
  color: var(--ink);
  font-weight: 700;
}

.terms tbody th {
  width: 16rem;
  font-weight: 700;
}

.kinds {
  padding-left: 1.2rem;
}

.kinds li + li,
.lesson ol li + li,
.lesson ul li + li {
  margin-top: 0.35rem;
}

.checks {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 1.9rem;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28rem;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid var(--pink);
  background: #fff;
}

.next {
  margin-top: 1.15rem;
  color: var(--muted);
}

.next a {
  color: #8a4458;
  font-weight: 700;
}

.back {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.back .button {
  margin-top: 1.25rem;
}

.lessons p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
}

.outcomes {
  margin: 1.5rem 0 0;
  padding: 1rem 1rem 0.4rem;
  background: var(--paper);
}

.outcomes h2 {
  margin-bottom: 0.4rem;
}

.outcomes li + li {
  margin-top: 0.35rem;
}

.board {
  margin-top: 1.5rem;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.85rem 1rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}

.tile summary {
  display: block;
  cursor: pointer;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  list-style: none;
}

.tile summary::-webkit-details-marker {
  display: none;
}

.tile summary::after {
  content: "Что в уроке?";
  display: block;
  margin-top: 0.4rem;
  color: #8a4458;
  font-size: 0.88rem;
  font-weight: 700;
}

.tile details[open] summary::after {
  content: "Скрыть";
}

.tile summary:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
}

.tile-num {
  display: block;
  margin-bottom: 0.15rem;
  color: #8a4458;
  font-size: 0.92rem;
  letter-spacing: 0;
}

.board-self .tile-num,
.board-self .tile summary::after {
  color: var(--emerald-deep);
}

.tile .lessons {
  margin-top: 0.65rem;
}

.tile .button {
  align-self: flex-start;
  margin-top: 0.85rem;
  padding: 0.65rem 0.9rem;
}

.chapter-self .kicker,
.chapter-self .block-label {
  color: var(--emerald-deep);
}

.chapter-self .chapter-nav a:hover,
.chapter-self .chapter-nav a:focus-visible {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

.chapter-self .lesson:target {
  border-color: var(--emerald);
}

.chapter-self .checks li::before {
  border-color: var(--emerald);
}

.chapter-self .next a,
.chapter-self .lesson a {
  color: var(--emerald-deep);
  font-weight: 700;
}

.glossary {
  margin: 0.4rem 0 0;
}

.glossary dt {
  margin-top: 0.65rem;
  font-weight: 700;
}

.glossary dd {
  margin: 0.15rem 0 0;
}

@media (max-width: 800px) {
  .shell {
    flex-direction: column;
  }

  .side {
    position: sticky;
    z-index: 2;
    flex-basis: auto;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(243, 246, 244, 0.12);
  }

  .side-nav {
    flex-direction: column;
    margin-top: 1rem;
    overflow: visible;
  }

  .side-note {
    display: none;
  }

  .page {
    padding: 1.25rem 1rem 2.5rem;
  }

  .chapter-top,
  .pair,
  .tiles {
    grid-template-columns: 1fr;
  }

  .chapter-nav {
    position: static;
  }
}

@media (max-width: 640px) {
  .switch {
    grid-template-columns: 1fr;
  }

  .topics button {
    flex: 1 1 auto;
  }
}
