/* SABAYJAI APPROACH & DEVELOPMENT FRAMEWORK (SADF) — know-how page components.
   Every colour, font and radius resolves to the shared tokens declared in
   ../../styles.css, so this sheet only adds layout and SADF-specific visuals:
   lettered work-lens cards, the recurring-lens and decomposition diagrams,
   safety-pillar cards, and the copyable checklist box. */

:root {
  /* Terracotta, the same hue the primary logo uses for its second glyph, so
     the accents on this page now agree with the mark above them. */
  --sadf-accent: #D16B4A;
  /* #D16B4A measures 3.49:1 on --paper and 2.68:1 on the hero band, which is
     enough for a fill or a rule but short of 4.5:1 for a letter. Text uses of
     the accent therefore resolve to this darkened step (7.2:1 on --paper,
     5.5:1 on the hero band) instead of the raw brand hue. */
  --sadf-accent-ink: #8F3E21;
  --sadf-motion: 180ms ease;
}

/* Reading rhythm on wide screens -------------------------------------------
   The shared body sets line-height 1.75, and .detail-copy lifts its font to
   1.25rem on desktop — which puts 33.6px of leading behind 19.2px of text and
   reads as visibly airy on a monitor. Thai keeps its tone marks and vowels
   clear down to about 1.5, so the values here stay above that floor. Mobile is
   deliberately left alone: the same measure on a narrow screen benefits from
   the looser setting. Everything is scoped to this page so the shared sheets
   keep serving the rest of the site unchanged. */
@media (min-width: 861px) {
  .know-how-detail .detail-copy,
  .know-how-detail .sadf-pillar p,
  .know-how-detail .sadf-card li,
  .know-how-detail .sadf-role li,
  .know-how-detail .detail-list li { line-height: 1.62; }

  /* The lead sets 23px, so it needs less leading, not more. */
  .know-how-detail .detail-lead { line-height: 1.5; }

  /* Paragraph and list gaps shrink with the leading so the block keeps its
     shape instead of only tightening internally. */
  .know-how-detail .detail-copy p { margin-bottom: .95rem; }
  .know-how-detail .sadf-card ul,
  .know-how-detail .sadf-role ul { gap: .55rem; }
  .know-how-detail .detail-list { gap: .8rem; }
}

/* Vertical rhythm on wide screens -------------------------------------------
   The shared .detail-grid sets one gap for both axes, which resolves to 8rem
   (128px) on a desktop. That is right for the gap BETWEEN the heading and the
   prose beside it, but it was also applied to the gap BETWEEN that row and the
   full-width figure underneath, which is what left the page feeling so empty.
   Only the row gap is reduced here; the column gap keeps its generous measure.
   Section padding drops a step for the same reason. Tablet and phone keep the
   looser shared values, where the content stacks anyway. */
@media (min-width: 1100px) {
  .know-how-detail .detail-grid {
    row-gap: clamp(2.25rem, 3.4vw, 3rem);
  }
  .know-how-detail .detail-section,
  .know-how-detail .detail-hero {
    padding-block: clamp(2.2rem, 2.7vw, 2.8rem);
  }
  /* The illustrations are the tallest blocks on the page, so the row gap that
     separates them from the text above and the section edge below reads as the
     emptiest space of all. Pulling the figure box back by a negative block
     margin trims roughly 17px on each side while the grid gap itself stays
     intact for every other row; the section keeps its bottom padding, so the
     figure never crowds the next section's first line. */
  .know-how-detail .sadf-loop-figure,
  .know-how-detail .sadf-map-figure { margin-block: -.6rem; }
  /* A sticky heading was tried here to fill the empty left column, but the
     full-width figures in the row below paint over it as they scroll past, so
     the heading was clipped mid-word. The space is handled by the row gap and
     section padding above instead. */
}

/* The wide composition starts together at 1200px: the route plan and the
   walking pace share one row — the same journey at two moments, which lets
   the zoom rail below start a full block higher — and the five zoom states
   stay a horizontal rail. Below this width the longest node title would not
   fit its Thai words inside a rail node, so both compositions stack, and the
   rail becomes the vertical ladder declared further down. */
@media (min-width: 1200px) {
  .sadf-map-figure { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sadf-map-figure > * { grid-column: 1 / -1; }
  .sadf-map-plan { grid-column: 1; grid-row: 2; }
  .sadf-map-pace { grid-column: 2; grid-row: 2; }
}

/* Stacked section intro on desktop ------------------------------------------
   The shared .detail-grid puts the heading left and the prose right. On this
   page every section ends in a full-width figure (cards, route, pillars), so
   the narrow left heading leaves an awkward empty rail above the figure. From
   861px up the intro stacks instead: label + heading on top, prose below, both
   owning the shell width. Copy caps at 68rem (just inside the 1180px shell)
   so long Thai paragraphs feel full without running edge to edge. Phone keeps
   the shared single-column values untouched. */
/* Stacked headings own the full row: the shared 16ch cap folds
   "วิธีทำงานกับ AI ที่คนยังเป็นผู้ถือหางเสือ" into two short lines on the
   left with a wide empty rail on the right — on desktop and on phones alike.
   Lifting the cap everywhere lets the heading wrap naturally across the shell
   instead. */
.know-how-detail .detail-grid h2 { max-width: none; }
@media (min-width: 861px) {
  .know-how-detail .detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.4rem, 2.2vw, 2rem);
  }
  /* 60rem keeps the stacked intro near a Thai-comfortable measure instead of
     the ~110-character lines 68rem allowed on a wide monitor. */
  .know-how-detail .detail-copy { max-width: 60rem; }
}

/* Hero ---------------------------------------------------------------------
   The shared sheet paints this band lavender for the old purple mark. The v0.4
   logo is cream, green and terracotta, so the band moves to the same warm
   paper family the mark's own card sits on. Overridden here rather than in the
   shared sheet because no other page uses .detail-hero-sadf. */
.know-how-detail .detail-hero-sadf { background: #e9dfc9; }
.sadf-hero .detail-lead { max-width: 46rem; }
/* The shared hero sets this at clamp(3rem, 6.5vw, 6.5rem), which wraps the
   title onto three very tall lines beside a logo that is less than half as
   tall. Holding it to two lines and a slightly smaller cap height lets the
   mark and the headline read as two comparable blocks instead of one loud
   column and one small one. */
.sadf-hero h1 {
  max-width: 17ch;
  font-size: clamp(2.75rem, 5vw, 4.75rem);
}
.sadf-hero h1 .sadf-abbr { color: var(--sadf-accent-ink); }
/* Thai name under the h1. It repeats the copy baked into the logo file, but
   the page also carries it as selectable text for readability and accessibility. */
.sadf-thai-name {
  margin: .7rem 0 0;
  color: var(--ink-soft);
  font-family: var(--heading);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 600;
  line-height: 1.5;
}
/* One vertical rhythm down the left column: tight under the kicker, roomier
   before each new idea, and tight again under the chip row. The shared sheet
   sets 24px / 28px / 17.6px, which reads as three unrelated gaps. */
.sadf-hero .article-kicker { margin-bottom: 1rem; }
.sadf-hero .detail-lead { margin-top: 1.75rem; }
.sadf-hero .sadf-thai-name + .detail-lead { margin-top: 1.1rem; }
.sadf-hero .sadf-status { margin-top: 1.75rem; }
.sadf-hero .sadf-hero-tags { margin-top: 1rem; }
@media (min-width: 861px) {
  .detail-hero-sadf .detail-hero-inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: clamp(2.25rem, 5vw, 4rem);
  }
}
.detail-hero-sadf .detail-logo-sadf {
  width: min(100%, 30rem);
  align-self: center;
}
.sadf-logo-picture,
.sadf-logo-picture img { display: block; width: 100%; }
.sadf-logo-picture img {
  height: auto;
  aspect-ratio: 960 / 800;
}
@media (max-width: 860px) {
  .detail-hero-sadf .detail-logo-sadf {
    width: min(100%, 36rem);
    justify-self: center;
  }
  .sadf-logo-picture img { aspect-ratio: 1280 / 420; }
}
@media (max-width: 620px) {
  .detail-hero-sadf .detail-logo-sadf {
    width: min(100%, 28rem);
    margin-top: -.75rem;
  }
}

.sadf-status {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin: 1.75rem 0 0;
  padding: .6rem 1.1rem;
  border: 1px solid rgba(21, 61, 51, .16);
  border-radius: 999px;
  background: rgba(255, 253, 248, .72);
  color: var(--ink-deep);
  font-family: var(--heading);
  font-size: .98rem;
  font-weight: 600;
  line-height: 1.5;
}
.sadf-status::before {
  content: "";
  flex: 0 0 auto;
  width: .62rem;
  height: .62rem;
  border-radius: 50%;
  background: var(--saffron);
  box-shadow: 0 0 0 .3rem rgba(233, 165, 36, .28);
}

.sadf-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}
.sadf-hero-tags li {
  padding: .35rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-muted);
  font-family: var(--heading);
  font-size: .85rem;
  font-weight: 600;
}

/* Section intro that spans both columns of the shared detail grid ---------- */
.detail-section > .shell > .detail-intro {
  grid-column: 1 / -1;
  max-width: 62rem;
}
/* The shared .detail-grid is a two-column .78fr/1.22fr layout for a heading
   plus prose. Every multi-column block here is a grid of its own and must own
   the full shell width, otherwise it is auto-placed into the narrow first
   column and each card is squeezed to a few characters wide. */
.detail-section > .shell > .sadf-grid,
.detail-section > .shell > .sadf-pillar-grid,
.detail-section > .shell > .sadf-next-grid,
.detail-section > .shell > .sadf-loop-figure,
.detail-section > .shell > .sadf-map-figure,
.detail-section > .shell > .sadf-checklist,
.detail-section > .shell > .sadf-evidence {
  grid-column: 1 / -1;
}
/* Grid items default to min-width:auto, which lets the checklist's
   white-space:pre block push the whole section wider than the viewport on a
   phone. The checklist scrolls inside its own box instead. */
.detail-section > .shell > .sadf-grid,
.detail-section > .shell > .sadf-pillar-grid,
.detail-section > .shell > .sadf-next-grid,
.detail-section > .shell > .sadf-loop-figure,
.detail-section > .shell > .sadf-map-figure,
.detail-section > .shell > .sadf-checklist,
.detail-section > .shell > .sadf-evidence,
.detail-section > .shell > .detail-intro { min-width: 0; }
.detail-intro .section-lead { max-width: 44rem; margin: 1.1rem 0 0; }

/* S-A-D-F cards ------------------------------------------------------------ */
.sadf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}
.sadf-card {
  display: flex;
  flex-direction: column;
  padding: clamp(1.6rem, 3vw, 2.3rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(9, 39, 31, .05);
}
/* Each lens card carries one real frame from the work the framework came out
   of, rather than an illustration drawn for the page. The four sources are not
   all the same shape (the game screen is 16:10, the drawings 3:2), so the frame
   is a fixed 3:2 window with object-fit:cover and the caption carries the
   credit and the link back to the episode. */
.sadf-card-shot {
  margin: 0 0 1.1rem;
}
.sadf-card-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid rgba(21, 61, 51, .12);
  border-radius: .9rem;
  background: var(--paper-soft);
}
.sadf-card-shot figcaption {
  margin-top: .45rem;
  color: var(--ink-muted);
  font-size: .82rem;
  line-height: 1.5;
}
.sadf-card-shot figcaption a { color: inherit; }
.sadf-card--s { --card-accent: var(--saffron-deep); }
.sadf-card--a { --card-accent: var(--leaf); }
.sadf-card--d { --card-accent: var(--terracotta); }
.sadf-card--f { --card-accent: var(--sadf-accent); --card-accent-ink: var(--sadf-accent-ink); }

.sadf-card-head {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: .9rem;
}
.sadf-card-letter {
  display: grid;
  flex: 0 0 auto;
  width: 3.1rem;
  height: 3.1rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-soft);
  color: var(--card-accent-ink, var(--card-accent));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.04em;
}
.sadf-card-head p {
  margin: 0 0 .2rem;
  color: var(--terracotta);
  font-family: var(--heading);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
}
.sadf-card-head h3 {
  margin: 0;
  color: var(--ink-deep);
  font-family: var(--heading);
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.25;
}
.sadf-card-question {
  margin: 0 0 1.1rem;
  padding: .8rem 1rem;
  border-left: 3px solid var(--card-accent);
  border-radius: 0 .6rem .6rem 0;
  background: var(--paper-soft);
  color: var(--ink);
  font-family: var(--heading);
  font-size: 1.02rem;
  line-height: 1.6;
}
.sadf-card ul {
  display: grid;
  gap: .7rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-size: 1.02rem;
}
.sadf-card li { position: relative; padding-left: 1.35rem; }
.sadf-card li::before {
  content: "";
  position: absolute;
  top: .72em;
  left: 0;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--card-accent);
}
.sadf-card li strong { color: var(--ink); }

/* Recurring work lenses ---------------------------------------------------- */
.sadf-loop-figure {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  align-items: center;
  gap: .6rem 1rem;
  margin: 0;
  padding: clamp(1.1rem, 2vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--paper);
}
.sadf-loop-mark {
  grid-row: 1 / span 2;
  display: grid;
  width: 4rem;
  height: 4rem;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-soft);
  color: var(--sadf-accent);
  font-size: 3.4rem;
  line-height: 1;
}
.sadf-loop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.sadf-loop-node {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: .1rem .55rem;
  min-height: 5.2rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--paper-soft);
}
.sadf-loop-node > span {
  grid-row: 1 / span 2;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--loop-accent-ink, var(--loop-accent));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: 700;
}
.sadf-loop-node strong { color: var(--ink-deep); font-family: var(--heading); }
.sadf-loop-node small { grid-column: 2; color: var(--ink-muted); font-size: .82rem; line-height: 1.4; }
.sadf-loop-node--s { --loop-accent: var(--saffron-deep); }
.sadf-loop-node--a { --loop-accent: var(--leaf); }
.sadf-loop-node--d { --loop-accent: var(--terracotta); }
.sadf-loop-node--f { --loop-accent: var(--sadf-accent); --loop-accent-ink: var(--sadf-accent-ink); }
.sadf-loop-figure figcaption,
.sadf-map-figure figcaption {
  color: var(--ink-muted);
  font-size: .92rem;
  line-height: 1.6;
}
.sadf-loop-figure figcaption { grid-column: 2; }

/* Zoom until you can stop --------------------------------------------------
   The picture is a map, not a road. Start zoomed out with the whole system in
   sight, then zoom into the one place the work is happening, and keep zooming
   down as many levels as that work needs — the depth is never capped. What is
   fixed is where to stop, so the figure runs left to right through the zoom
   states (too wide → just right → too fine) with the stopping point marked,
   then spells out the check that decides it. Colour carries meaning here:
   terracotta marks the two states to zoom out of, leaf the one to stop at.
   Everything else stays plain text on the paper. */
.sadf-map-figure {
  display: grid;
  gap: 1.15rem;
  margin: 0;
  padding: clamp(1.2rem, 2.4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--paper);
}
.sadf-map-lead {
  margin: 0;
  max-width: 52rem;
  color: var(--ink-muted);
  font-size: .96rem;
  line-height: 1.65;
  /* Balance the break so a short Thai clause never strands itself alone. */
  text-wrap: balance;
}
.sadf-map-lead strong { color: var(--ink-deep); font-family: var(--heading); font-weight: 700; }

/* Before any zooming happens there is a route to pick: two fixed ends and a
   few ways across. Options are drawn as parallel lines between the same two
   marks, and only the chosen one is inked — the reader should see the choice,
   not a menu. */
.sadf-map-plan,
.sadf-map-pace {
  display: grid;
  /* Pin content to the top: in the wide two-column row the shorter box
     stretches to match its neighbour, and the default stretch would hand the
     spare space to the inner rows — drifting the end labels off the route
     lines and the pace heading off its list. Bottom air stays inside the box
     instead, like the lens cards on this page. */
  align-content: start;
  gap: .7rem;
  padding: clamp(.95rem, 1.8vw, 1.2rem) clamp(1rem, 2vw, 1.3rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper-soft);
}
.sadf-map-sub {
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--heading);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.sadf-map-ends {
  /* Space-between puts each label's outer edge on the same edge as the route
     marks below (the route grid's first and last columns start and end at the
     content edges), so the labels read as naming those marks. Flex keeps the
     labels single-line: in the mark-width grid columns they wrapped. */
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  color: var(--ink-deep);
  font-family: var(--heading);
  font-size: .8rem;
  font-weight: 700;
}
.sadf-map-ends span { white-space: nowrap; }
.sadf-map-routes {
  display: grid;
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* One route: mark, line, mark, then the trade-off written under it. The grid
   columns match .sadf-map-ends so every line starts and ends on the same two
   marks as the labels above. */
.sadf-map-route {
  display: grid;
  grid-template-columns: .65rem minmax(0, 1fr) .65rem;
  align-items: center;
  gap: .3rem .5rem;
}
.sadf-map-route-mark {
  width: .65rem;
  height: .65rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
}
.sadf-map-route-mark--to { border-color: rgba(95, 127, 92, .6); }
.sadf-map-route-line { height: 1px; background: var(--line); }
.sadf-map-route p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink-muted);
  font-size: .88rem;
  line-height: 1.55;
}
.sadf-map-route p strong {
  margin-left: .4rem;
  padding: .1rem .55rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-deep);
  font-family: var(--heading);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}
/* The chosen route is the only one drawn in ink: a 2px line, filled marks and
   the "picked" flag. Everything unchosen stays a hairline. */
.sadf-map-route--picked .sadf-map-route-line { height: 2px; background: var(--sadf-accent); }
.sadf-map-route--picked .sadf-map-route-mark { border-color: var(--sadf-accent); background: rgba(209, 107, 74, .18); }
.sadf-map-route--picked p { color: var(--ink); }
.sadf-map-pick {
  margin: 0;
  padding-top: .65rem;
  border-top: 1px dashed var(--line);
  color: var(--ink);
  font-size: .9rem;
  line-height: 1.6;
}
.sadf-map-pick span { margin-right: .35rem; color: var(--sadf-accent-ink); }
.sadf-map-pick strong { font-family: var(--heading); font-weight: 700; }

/* Zoom level follows the speed of the moment: the diagram cannot sit at one
   depth all journey, and the same journey can be walked at different speeds. */
.sadf-map-pace-list {
  display: grid;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sadf-map-pace-list li {
  display: grid;
  grid-template-columns: .55rem minmax(0, 1fr);
  align-items: start;
  gap: .55rem;
}
/* Same reason as .sadf-check-conds: the sentence has to be one element or the
   <strong> becomes a grid item of its own and lands in the dot column. */
.sadf-map-pace-list li > span {
  color: var(--ink-muted);
  font-size: .9rem;
  line-height: 1.6;
}
.sadf-map-pace-list .sadf-map-dot { margin-top: .5em; }
.sadf-map-pace-list strong { color: var(--ink-deep); font-family: var(--heading); font-weight: 700; }

/* The rail: five map states in a row with thin connectors between them. The
   states are 1fr and the connectors auto, so a connector takes only the width
   its label needs and the states share what is left. */
.sadf-map-rail {
  --rail-gap: clamp(.3rem, .55vw, .5rem);
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto
    minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--rail-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.sadf-map-node {
  display: grid;
  align-content: start;
  gap: .3rem;
  min-width: 0;
  padding: .8rem .85rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--paper-soft);
}
.sadf-map-tag {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  color: var(--ink-muted);
  font-size: .76rem;
  line-height: 1.4;
}
.sadf-map-node strong {
  color: var(--ink-deep);
  font-family: var(--heading);
  /* Fluid so the longest title keeps its Thai words whole across the whole
     1200px+ rail range instead of falling back to a mid-word break when a
     node runs tight near the breakpoint. */
  font-size: clamp(.82rem, .6vw + .37rem, .96rem);
  font-weight: 700;
  line-height: 1.4;
}
.sadf-map-node small { color: var(--ink-muted); font-size: .84rem; line-height: 1.55; }
/* State dots: a quiet fill for the neutral middle depths, terracotta for the
   two states the reader has to zoom out of, leaf for the one they can stop at.
   The ring on the green dot is the only glow in the whole figure. */
.sadf-map-dot {
  flex: none;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--line);
}
.sadf-map-dot--off { background: var(--terracotta); }
.sadf-map-dot--on {
  background: var(--leaf);
  box-shadow: 0 0 0 4px rgba(95, 127, 92, .18);
}
/* The stopping point is the only tinted state on the rail: it is the answer
   the whole section argues for, so it is ringed rather than numbered. */
.sadf-map-node--stop {
  border-color: rgba(95, 127, 92, .55);
  background: rgba(95, 127, 92, .08);
  box-shadow: 0 0 0 3px rgba(95, 127, 92, .1);
}
.sadf-map-node--wide,
.sadf-map-node--fine { background: var(--paper); }
/* Connectors say "zoom in", not "keep driving": label over a hairline. */
.sadf-map-arrow {
  align-self: center;
  display: grid;
  gap: .35rem;
  justify-items: center;
  /* Wider than the label, so the hairline under it reads as a link between
     two states instead of an underline of the word above it. The width is
     budgeted against the node titles — every pixel here is one the five
     nodes lose, and they need room to keep Thai words unbroken. */
  min-width: 2.75rem;
  color: var(--ink-muted);
  font-size: .72rem;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}
.sadf-map-arrow::after {
  content: "";
  width: 100%;
  min-width: 1.6rem;
  height: 1px;
  background: var(--line);
}
.sadf-map-depth {
  margin: 0;
  color: var(--ink-muted);
  font-size: .88rem;
  line-height: 1.6;
  text-wrap: balance;
}
.sadf-map-depth strong { color: var(--ink-deep); }
.sadf-map-depth span { margin-right: .35rem; color: var(--sadf-accent-ink); }

/* The rule itself — the one line from this section worth remembering. */
.sadf-map-rule {
  margin: 0;
  padding: clamp(.95rem, 1.8vw, 1.2rem) clamp(1rem, 2vw, 1.35rem);
  border-left: 3px solid var(--sadf-accent);
  border-radius: 1rem;
  background: rgba(209, 107, 74, .06);
  color: var(--ink-deep);
  font-family: var(--heading);
  font-size: clamp(1.08rem, 1.7vw, 1.28rem);
  font-weight: 600;
  line-height: 1.65;
  text-wrap: balance;
}
.sadf-map-rule strong { color: var(--sadf-accent-ink); font-weight: 700; }

/* The three states, checked ------------------------------------------------ */
.sadf-check { display: grid; gap: .8rem; }
.sadf-check-title {
  margin: 0;
  color: var(--ink-deep);
  font-family: var(--heading);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.sadf-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem 1rem;
}
.sadf-check-card {
  display: grid;
  align-content: start;
  gap: .35rem;
  padding: .95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--paper);
}
.sadf-check-flag {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  color: var(--ink-muted);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.sadf-check-card strong {
  color: var(--ink-deep);
  font-family: var(--heading);
  font-size: 1.02rem;
  font-weight: 700;
}
.sadf-check-card > p:not(.sadf-check-flag) { margin: 0; color: var(--ink-muted); font-size: .9rem; line-height: 1.6; }
.sadf-check-action {
  margin: .2rem 0 0 !important;
  padding-top: .5rem;
  border-top: 1px dashed var(--line);
  color: var(--sadf-accent-ink);
  font-size: .88rem;
  font-weight: 700;
}
.sadf-check-action span { margin-right: .3rem; }
/* The right answer owns the full row: it is the longer card (two conditions)
   and the one the reader should leave this section holding. */
.sadf-check-card--stop {
  grid-column: 1 / -1;
  border-color: rgba(95, 127, 92, .5);
  background: rgba(95, 127, 92, .07);
}
.sadf-check-card--stop .sadf-check-action {
  border-top-color: rgba(95, 127, 92, .35);
  color: var(--ink-deep);
}
.sadf-check-conds {
  display: grid;
  gap: .5rem;
  margin: .2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: cond;
}
.sadf-check-conds li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: .5rem;
  align-items: start;
}
/* The condition text is one element on purpose: an unwrapped <strong> next to
   loose Thai text would become a grid item of its own and get squeezed into
   the 1.5rem number column. */
.sadf-check-conds li > span {
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.6;
}
.sadf-check-conds li::before {
  counter-increment: cond;
  content: counter(cond);
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: .9rem;
  font-weight: 700;
}
.sadf-check-conds strong { font-family: var(--heading); font-weight: 700; }

/* The same cycle at every depth -------------------------------------------- */
.sadf-map-cycle {
  display: grid;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1px dashed rgba(209, 107, 74, .32);
  border-radius: .85rem;
  background: rgba(255, 255, 255, .55);
}
.sadf-map-cycle-title {
  margin: 0;
  color: var(--sadf-accent-ink);
  font-family: var(--heading);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.sadf-map-cycle-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sadf-map-cycle-item {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-items: start;
  gap: .5rem;
}
.sadf-map-cycle-item > span {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--cycle-ink, var(--cycle-accent));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 700;
}
.sadf-map-cycle-item p { margin: 0; color: var(--ink-muted); font-size: .86rem; line-height: 1.55; }
.sadf-map-cycle-item strong { display: block; color: var(--ink-deep); font-family: var(--heading); font-size: .88rem; }
.sadf-map-cycle-item--s { --cycle-accent: var(--saffron-deep); }
.sadf-map-cycle-item--a { --cycle-accent: var(--leaf); }
.sadf-map-cycle-item--d { --cycle-accent: var(--terracotta); }
.sadf-map-cycle-item--f { --cycle-accent: var(--sadf-accent); --cycle-ink: var(--sadf-accent-ink); }

/* Who holds what ------------------------------------------------------------ */
.sadf-map-hands {
  margin: 0;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.6;
}
.sadf-map-hands strong { font-family: var(--heading); font-weight: 700; }

/* Plain translation, kept out of the diagram itself so that someone who has
   never worked this way can still read the picture. */
.sadf-map-dict { padding-top: 1.1rem; border-top: 1px solid var(--line); }
.sadf-map-dict-title {
  margin: 0 0 .8rem;
  color: var(--ink-muted);
  font-family: var(--heading);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.sadf-map-dict dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem 1.4rem;
  margin: 0;
}
.sadf-map-dict dl > div { display: flex; flex-wrap: wrap; gap: .4rem; }
.sadf-map-dict dt {
  color: var(--ink-deep);
  font-family: var(--heading);
  font-size: .92rem;
  font-weight: 700;
}
.sadf-map-dict dd { margin: 0; color: var(--ink-muted); font-size: .9rem; }
.sadf-map-dict dd::before { content: "→ "; color: var(--line); }
.sadf-map-figure figcaption { margin-top: 0; }

/* The three safety pillars ------------------------------------------------- */
.sadf-pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}
.sadf-pillar {
  display: flex;
  flex-direction: column;
  padding: clamp(1.6rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(9, 39, 31, .05);
}
.sadf-pillar-index {
  margin: 0 0 .8rem;
  color: var(--saffron-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
}
.sadf-pillar h3 {
  margin: 0 0 .5rem;
  color: var(--ink-deep);
  font-family: var(--heading);
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.3;
}
.sadf-pillar-en {
  display: block;
  margin-bottom: .9rem;
  color: var(--ink-muted);
  font-family: var(--heading);
  font-size: .92rem;
  font-weight: 600;
}
.sadf-pillar p { margin: 0; color: var(--ink-muted); font-size: 1.02rem; }

.sadf-evidence {
  margin: 1.6rem 0 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  color: var(--ink-muted);
  font-size: .98rem;
}
.sadf-evidence strong { color: var(--ink); }

/* Checklist ---------------------------------------------------------------- */
.sadf-checklist {
  padding: clamp(1.5rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(9, 39, 31, .05);
}
.sadf-checklist pre {
  margin: 0;
  overflow-x: auto;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--paper-soft);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: .9rem;
  line-height: 1.75;
  tab-size: 2;
  white-space: pre;
}
.sadf-checklist pre:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
}
.sadf-checklist-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .85rem;
  margin: 1.1rem 0 0;
}
.sadf-checklist-actions button {
  min-height: 44px;
  padding: .7rem 1.35rem;
  border-radius: 11px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--sadf-motion), background-color var(--sadf-motion), border-color var(--sadf-motion);
}
.sadf-copy {
  border: 1px solid transparent;
  background: var(--saffron);
  color: var(--ink-deep);
}
.sadf-copy:hover { transform: translateY(-1px); background: #f1b63e; }
.sadf-download {
  border: 1px solid rgba(21, 61, 51, .28);
  background: transparent;
  color: var(--ink);
}
.sadf-download:hover { transform: translateY(-1px); background: var(--paper-soft); }
.sadf-checklist-actions button:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
}
/* Reserved so the box never jumps when a status message appears. */
.sadf-checklist-status {
  min-height: 1.6em;
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--heading);
  font-size: .95rem;
  line-height: 1.6;
}

/* Closing links ------------------------------------------------------------ */
.sadf-next-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.4rem);
}
.sadf-next-link {
  display: block;
  overflow: hidden;
  padding: 0 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: transform var(--sadf-motion), border-color var(--sadf-motion), box-shadow var(--sadf-motion);
}
/* Each card shows the thing it links to rather than only naming it: the book
   cover, the episode frame, and the real Buddy screen. The frame sits flush to
   the card edges so the card reads as one object, and the 3:2 window keeps the
   three different source shapes from making the row ragged. */
.sadf-next-shot {
  display: block;
  margin: 0 0 1.1rem;
  background: var(--paper-soft);
}
.sadf-next-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}
.sadf-next-link > strong,
.sadf-next-link > span:not(.sadf-next-shot) {
  display: block;
  margin-inline: 1.6rem;
}
.sadf-next-link:hover {
  transform: translateY(-3px);
  border-color: rgba(29, 89, 72, .46);
  box-shadow: 0 14px 32px rgba(31, 52, 44, .1);
}
.sadf-next-link:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
}
.sadf-next-link strong {
  display: block;
  margin-bottom: .35rem;
  color: var(--ink-deep);
  font-family: var(--heading);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.02em;
}
.sadf-next-link span { color: var(--ink-muted); font-size: .98rem; }

/* Book examples use the same cover-first, padded-card treatment as the zone's
   book list. Grid stretching gives cards in each row equal height, while the
   copy area keeps its contents aligned from a shared top edge. */
.know-how-detail .sadf-book-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
}
.know-how-detail .sadf-book-grid > li { display: flex; min-width: 0; }
.know-how-detail .sadf-book-grid .sadf-next-link {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  padding: 0;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 24px #29372f09;
}
.know-how-detail .sadf-book-grid .sadf-next-shot { flex: 0 0 auto; margin: 0; }
.know-how-detail .sadf-book-grid .sadf-next-shot img { aspect-ratio: 3 / 2; }
.know-how-detail .sadf-book-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px 18px 18px;
}
.know-how-detail .sadf-book-copy .sadf-book-index {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: #edf1e9;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
}
.know-how-detail .sadf-book-copy > strong {
  margin: 9px 0 7px;
  color: var(--green);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.38;
}
.know-how-detail .sadf-book-copy > span:last-child {
  margin: 0;
  color: var(--muted, var(--ink-muted));
  font-size: 13px;
  line-height: 1.68;
}

/* Below the wide breakpoint the five-state rail becomes a vertical ladder:
   five nodes in a row cannot give each title room for its longest Thai word,
   and the line breaker then falls back to breaking mid-word. The connectors
   keep their label and swap the horizontal hairline for a short vertical
   drop, so "deeper" still reads downward. */
@media (max-width: 1199px) {
  .sadf-map-rail { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
  .sadf-map-arrow { justify-items: start; padding-left: .2rem; }
  .sadf-map-arrow::after { width: 1px; min-width: 0; height: 1.5rem; }
}
@media (max-width: 900px) {
  .sadf-pillar-grid,
  .sadf-next-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sadf-loop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sadf-check-grid { grid-template-columns: minmax(0, 1fr); }
  .sadf-map-cycle-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sadf-map-dict dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sadf-grid { grid-template-columns: 1fr; }
  /* Small screens do all their breathing through section padding and the
     single-column grid gap: the shared 2.75rem + 2.5rem leaves ~88px of air
     per section, which is what makes the phone feel like endless scrolling. */
  .know-how-detail .detail-grid { gap: 1.5rem; }
}
/* Tablets and phones never reach the wide-screen rhythm above, so they keep
   the roomy shared section padding all the way down. Cap it here instead. */
@media (max-width: 1099px) {
  .know-how-detail .detail-section {
    padding-block: clamp(1.75rem, 6vw, 2.75rem);
  }
}
@media (max-width: 620px) {
  .sadf-hero h1 { max-width: none; }
  .sadf-pillar-grid,
  .sadf-next-grid { grid-template-columns: 1fr; }
  .know-how-detail .sadf-book-grid { grid-template-columns: 1fr; }
  .sadf-card-head { gap: .7rem; }
  .sadf-card-letter { width: 2.7rem; height: 2.7rem; font-size: 1.35rem; }
  .sadf-loop-figure { grid-template-columns: 1fr; }
  .sadf-loop-mark { grid-row: auto; width: 2.6rem; height: 2.6rem; font-size: 2.2rem; }
  .sadf-loop-grid { grid-template-columns: 1fr; }
  .sadf-loop-node { min-height: 4.4rem; }
  .sadf-loop-figure figcaption { grid-column: auto; }
  .sadf-map-cycle-list { grid-template-columns: minmax(0, 1fr); }
  .sadf-map-dict dl { grid-template-columns: minmax(0, 1fr); }
  .sadf-checklist pre { padding: 1rem; font-size: .82rem; }
  .sadf-checklist-actions { flex-direction: column; align-items: stretch; }
  .sadf-checklist-actions button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sadf-copy,
  .sadf-download,
  .sadf-next-link { transition: none !important; }
}
