/* Clearflow guide — "field manual" look. Editorial reading experience built on
 * the site tokens, with serif display type and a sticky chapter index. */

.guide-hero-new {
  padding-bottom: 34px;
}

.guide-hero-new h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.guide-meta {
  margin: 18px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.guide-meta a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* ---------- reading layout ---------- */

.guide-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-top: 8px;
  padding-bottom: 20px;
}

.guide-toc {
  position: sticky;
  top: 110px;
}

.guide-toc-title {
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.guide-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.guide-toc a {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 9px 10px;
  border-radius: 9px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 620;
  color: var(--ink-soft);
}

.guide-toc a span {
  font-size: 0.76rem;
  font-weight: 760;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

.guide-toc a:hover {
  background: rgba(22, 143, 135, 0.09);
}

/* ---------- chapters ---------- */

.guide-body {
  min-width: 0;
  max-width: 720px;
}

.chapter {
  padding: 44px 0;
  border-top: 1px solid var(--ink);
}

.chapter:first-child {
  border-top: 0;
  padding-top: 8px;
}

.chapter-number {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 780;
  letter-spacing: 0.18em;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}

.chapter h2 {
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.chapter p {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 1.1em;
}

.chapter a {
  color: var(--teal);
  font-weight: 680;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.chapter-steps {
  margin: 1.4em 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 14px;
}

.chapter-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.chapter-steps li::before {
  content: counter(step, decimal-leading-zero);
  font-weight: 780;
  font-size: 0.85rem;
  color: var(--teal);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  padding: 6px 0;
  font-variant-numeric: tabular-nums;
}

.margin-note {
  margin: 1.6em 0 0.4em;
  padding: 16px 20px;
  border-left: 3px solid var(--teal);
  background: rgba(22, 143, 135, 0.07);
  border-radius: 0 12px 12px 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

/* ---------- definition lists ---------- */

.state-list {
  margin: 1.6em 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.state-list > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.state-list dt {
  font-weight: 780;
  font-size: 0.98rem;
}

.state-list dd {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

/* ---------- waterfall diagram ---------- */

.waterfall {
  margin: 1.8em 0;
  padding: 24px 26px 18px;
  background: var(--ink);
  color: var(--white);
  border-radius: 16px;
}

.waterfall-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 6px 14px;
  align-items: center;
  padding: 10px 0;
  font-size: 0.92rem;
}

.waterfall-row span {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.72);
}

.waterfall-row strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  text-align: right;
  white-space: nowrap;
}

.waterfall-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.waterfall-bar i {
  display: block;
  height: 100%;
  background: var(--sky);
  border-radius: 999px;
}

.waterfall-bar i.neg { background: var(--coral); }
.waterfall-bar i.pos { background: var(--teal-bright); }

.waterfall-row.is-result {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: 6px;
  padding-top: 16px;
}

.waterfall-row.is-result strong {
  color: var(--teal-bright);
  font-size: 1.3rem;
}

.waterfall figcaption {
  margin-top: 14px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.waterfall figcaption a {
  color: var(--teal-bright);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* ---------- screen blocks ---------- */

.screen-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 28px;
  align-items: center;
  margin: 2.2em 0;
  padding: 26px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.screen-block figure {
  margin: 0;
}

.screen-block img {
  border-radius: 18px;
  border: 1px solid var(--line);
  aspect-ratio: 1206 / 2622;
  object-fit: cover;
  object-position: top;
  max-height: 380px;
  width: 100%;
}

.screen-block figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.screen-label {
  margin: 0 0 8px !important;
  font-size: 0.76rem !important;
  font-weight: 760 !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal) !important;
}

.screen-block h3 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.screen-block p {
  font-size: 0.95rem;
}

.screen-block-simple {
  grid-template-columns: minmax(0, 1fr);
}

/* ---------- routine checklist ---------- */

.routine-checklist {
  list-style: none;
  margin: 1.4em 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.routine-checklist li {
  position: relative;
  padding: 16px 18px 16px 52px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.routine-checklist li::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 22px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--teal);
  border-radius: 5px;
}

/* ---------- chapter footer nav ---------- */

.chapter-next {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 40px 0 10px;
}

.button-ghost-dark {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}

.button-ghost-dark:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .guide-toc {
    position: static;
    margin-bottom: 8px;
  }

  .guide-toc ol {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
  }

  .guide-toc a {
    white-space: nowrap;
    border: 1px solid var(--line);
  }

  .guide-toc-title {
    display: none;
  }

  .guide-body {
    max-width: none;
  }

  .screen-block {
    grid-template-columns: minmax(0, 1fr) 160px;
  }
}

@media (max-width: 560px) {
  .state-list > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .screen-block {
    grid-template-columns: minmax(0, 1fr);
  }

  .screen-block img {
    max-height: 300px;
  }

  .waterfall-row {
    grid-template-columns: minmax(0, 1fr) 40px;
  }
}
