/* Kasane Guides: long-form pages built by scripts/build_guides.py, in the 3.0 design (v3/README.md).
   Enchant's structure with Kasane's layer: sand ground, ink type, the k, and one bright per topic
   (gut coral, energy marigold, sleep lavender, visits emerald, method cobalt) as a wash at the top
   and on the index cards. Editorial rhythm: Inter with optical sizes, a ~68-character measure,
   generous leading, more space above a heading than below it, and figures that step slightly wider
   than the text column. */
:root {
  --canvas: #FBF5EC;
  --paper: #FFFDF8;
  --card: #F3E9DB;
  --card-deep: #E9DDCB;
  --ink: #151515;
  --ink-soft: #5E574D;
  --ink-faint: #8A8073;
  --line: rgba(21, 21, 21, 0.12);
  --hair: rgba(21, 21, 21, 0.07);
  --ocean: #044056;
  --ocean-tint: rgba(4, 64, 86, 0.08);
  --care: rgba(238, 90, 62, 0.08);
  --care-edge: rgba(238, 90, 62, 0.5);
  --sev-0: #7E9C74;
  --sev-1: #D9A94E;
  --sev-2: #CF8A4A;
  --sev-3: #B8573E;
  --bar: #B7A99A;
  /* the topic's bright; set per page on <body> */
  --topic: #2F5BE0;
  --topic-soft: #DCE4FB;
  --measure: 660px;
  --fig: 800px;
  --font: 'Inter', -apple-system, 'SF Pro Text', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
}
body.topic-gut { --topic: #EE5A3E; --topic-soft: #FBDDD4; }
body.topic-energy { --topic: #F6B400; --topic-soft: #FCEBB8; }
body.topic-sleep { --topic: #B9A8F0; --topic-soft: #E8E1FB; }
body.topic-visits { --topic: #0E8C6A; --topic-soft: #CFEBDF; }
body.topic-method, body.topic-index { --topic: #2F5BE0; --topic-soft: #DCE4FB; }
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #16130F;
    --paper: #1D1914;
    --card: #231E18;
    --card-deep: #2E2720;
    --ink: #F3ECE2;
    --ink-soft: #B9AE9F;
    --ink-faint: #8A7F72;
    --line: rgba(243, 236, 226, 0.14);
    --hair: rgba(243, 236, 226, 0.08);
    --ocean: #8CC6D9;
    --ocean-tint: rgba(140, 198, 217, 0.12);
    --care: rgba(238, 90, 62, 0.12);
    --care-edge: rgba(238, 90, 62, 0.55);
    --sev-0: #93B08A;
    --sev-1: #E2B866;
    --sev-2: #DB9A5E;
    --sev-3: #D07A62;
    --bar: #7A6E62;
  }
  body[class*="topic-"] { --topic-soft: color-mix(in srgb, var(--topic) 22%, #16130F); }
  header.site nav a.get { background: #FBF5EC; color: #151515; }
  header.site nav a.get:hover { background: #fff; }
  aside.cta .badge img { filter: invert(1); }
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 18px/1.72 var(--font);
  font-optical-sizing: auto;
  font-feature-settings: 'cv11' 1, 'ss01' 1;
}
/* The topic's color as light at the top of the page. */
body::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 520px; background: linear-gradient(180deg, var(--topic-soft) 0%, color-mix(in srgb, var(--topic-soft) 45%, var(--canvas)) 48%, var(--canvas) 100%); z-index: -1; }
a { color: var(--ink); text-decoration-color: var(--topic); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-thickness: 3px; }

/* ---------- the k ---------- */
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 22.37%; background: #044056; color: #FBF5EC; overflow: hidden; flex-shrink: 0; }
.mark svg { width: 100%; height: 100%; display: block; }

header.site { max-width: 1120px; margin: 0 auto; padding: 22px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 21px; letter-spacing: -0.035em; }
header.site nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
header.site nav a { color: var(--ink); text-decoration: none; }
header.site nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
header.site nav a[aria-current] { font-weight: 600; }
header.site nav a.get { background: #151515; color: #FBF5EC; padding: 10px 18px; border-radius: 999px; font-weight: 500; }
header.site nav a.get:hover { text-decoration: none; background: #33312C; }
@media (max-width: 560px) { header.site nav a:not(.get):not([aria-current]) { display: none; } }

/* ---------- the article ---------- */
main.guide { max-width: var(--measure); margin: 0 auto; padding: 40px 20px 72px; }
.crumbs { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-soft); margin-bottom: 22px; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .topic { padding: 5px 12px; border-radius: 999px; background: var(--topic); color: #151515; font-weight: 500; font-size: 13px; }
body.topic-visits .crumbs .topic { background: #0A6E53; color: #fff; }
body.topic-method .crumbs .topic { color: #fff; }
h1 {
  font-size: clamp(36px, 5.8vw, 56px); line-height: 1.04; letter-spacing: -0.035em;
  font-weight: 430; margin: 0 0 22px; text-wrap: balance;
}
.byline { font-size: 14px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 40px; }
.byline a { color: var(--ink-soft); }
p.lead { font-size: 21px; line-height: 1.55; letter-spacing: -0.008em; margin: 0 0 1.5em; text-wrap: pretty; }

article p { margin: 0 0 1.15em; text-wrap: pretty; hanging-punctuation: first; }
article section { margin-top: 3.4em; }
article h2 {
  font-size: 30px; line-height: 1.15; letter-spacing: -0.028em; font-weight: 500;
  margin: 0 0 0.7em; text-wrap: balance;
}
article h3 { font-size: 20px; line-height: 1.35; letter-spacing: -0.012em; font-weight: 600; margin: 1.9em 0 0.5em; text-wrap: balance; }
article h2 + h3 { margin-top: 1em; }

article ul, article ol { padding-left: 1.35em; margin: 0 0 1.4em; }
article li { margin: 0 0 0.7em; padding-left: 0.2em; }
article li:last-child { margin-bottom: 0; }
article ul li::marker { color: var(--topic); }
article ol li::marker { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
article p + ul, article p + ol { margin-top: -0.2em; }

article blockquote { margin: 1.8em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--topic); font-size: 19px; line-height: 1.6; }
article blockquote p { margin: 0; }
article code { font-size: .88em; background: var(--card); padding: 1px 5px; border-radius: 5px; }
article strong { font-weight: 620; }

.table-wrap { overflow-x: auto; margin: 1.6em 0 1.9em; border-radius: 18px; background: var(--card); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 16px; line-height: 1.55; font-variant-numeric: tabular-nums; }
.table-wrap.wide table { min-width: 560px; }
th, td { text-align: left; vertical-align: top; padding: 13px 16px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; font-size: 14.5px; line-height: 1.4; color: var(--ink-soft); padding-top: 15px; padding-bottom: 11px; }
td:first-child { font-weight: 550; }
.table-wrap.wide td:first-child { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* The see-a-doctor sections read as one unit, set apart from the method. */
article section.care { background: var(--care); border-radius: 24px; padding: 30px 30px 24px; margin-top: 3.2em; }
article section.care h2 { font-size: 26px; }
article section.care > :last-child { margin-bottom: 0; }

/* Questions people ask: hairlines between entries, like a printed Q&A. */
article section.faq h3 { font-size: 19px; margin: 0; padding-top: 1.1em; border-top: 1px solid var(--line); }
article section.faq h3 + p { margin-top: 0.45em; }
article section.faq p { color: var(--ink); }
article section.faq h2 + h3 { margin-top: 0.4em; }

/* The call to action takes the topic's color as a whole block. */
aside.cta { margin: 64px 0 0; padding: 32px; border-radius: 26px; background: var(--topic-soft); }
aside.cta h2 { margin: 0 0 10px; font-size: 26px; line-height: 1.2; letter-spacing: -0.025em; font-weight: 500; }
aside.cta p { margin: 0 0 18px; color: var(--ink); font-size: 17px; line-height: 1.6; }
aside.cta .badge img { display: block; }
aside.cta .story-link { margin: 20px 0 0; font-size: 16px; }
.related { margin-top: 48px; }
.related h2 { font-size: 20px; margin: 0 0 12px; letter-spacing: -0.015em; font-weight: 500; }
.related ul { padding-left: 20px; margin: 0; }
.related li { margin: 0 0 6px; }

/* ---------- the index: one colored card per topic ---------- */
main.guide.index { max-width: 1120px; }
main.guide.index > h1, main.guide.index > .lead { max-width: var(--measure); }
.topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 12px; }
.topics section { padding: 26px 24px 22px; border-radius: 26px; background: var(--topic-soft); }
.topics section.topic-gut { --topic: #EE5A3E; --topic-soft: #FBDDD4; }
.topics section.topic-energy { --topic: #F6B400; --topic-soft: #FCEBB8; }
.topics section.topic-sleep { --topic: #B9A8F0; --topic-soft: #E8E1FB; }
.topics section.topic-visits { --topic: #0E8C6A; --topic-soft: #CFEBDF; }
.topics section.topic-method { --topic: #2F5BE0; --topic-soft: #DCE4FB; }
@media (prefers-color-scheme: dark) { .topics section[class*="topic-"] { --topic-soft: color-mix(in srgb, var(--topic) 22%, #16130F); } }
.index h2 { display: inline-block; font-size: 14px; font-weight: 500; letter-spacing: 0; margin: 0 0 16px; padding: 5px 12px; border-radius: 999px; background: var(--topic); color: #151515; }
.topics section.topic-visits h2 { background: #0A6E53; color: #fff; }
.topics section.topic-method h2 { color: #fff; }
.guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.guide-list a { display: block; padding: 16px 18px; background: var(--paper); border-radius: 18px; color: var(--ink); text-decoration: none; box-shadow: 0 10px 22px -18px rgba(21,21,21,.4); transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.guide-list a:hover { transform: translateY(-2px); }
.guide-list strong { display: block; font-size: 18px; line-height: 1.3; letter-spacing: -0.015em; margin-bottom: 6px; font-weight: 550; }
.guide-list span { color: var(--ink-soft); font-size: 15px; line-height: 1.55; display: block; }
.guide-list a:hover strong { text-decoration: underline; text-decoration-color: var(--topic); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- footer, like the homepage's ---------- */
footer.site { max-width: 1120px; margin: 40px auto 0; padding: 56px 20px calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
footer.site .foot-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; }
footer.site .foot-brand p { margin: 14px 0 0; font-size: 15px; line-height: 1.55; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 15px; }
footer.site nav a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
footer.site nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
footer.site .foot-base { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
footer.site .foot-base p { margin: 0; }
footer.site .foot-base p + p { white-space: nowrap; }

@media (max-width: 560px) {
  body { font-size: 17px; line-height: 1.7; }
  main.guide { padding-top: 28px; }
  p.lead { font-size: 19px; }
  article section { margin-top: 2.9em; }
  article h2 { font-size: 26px; }
  article section.care { padding: 24px 20px 18px; border-radius: 20px; }
  article section.care h2 { font-size: 22px; }
  aside.cta { padding: 24px 20px; }
  th, td { padding: 11px 13px; }
  .topics { grid-template-columns: 1fr; }
  footer.site .foot-top, footer.site .foot-base { flex-direction: column; }
  footer.site .foot-top { gap: 20px; }
  footer.site .foot-base { gap: 8px; }
}

/* ---------- figures ----------
   Drawn in HTML/SVG from guides/_src/figures/. A figure steps a little wider than the text on
   desktop and sits on the page under a hairline, like a figure in a printed article; only document
   examples (a summary page, a note) get a paper surface. Every figure ends with a caption that
   says what to notice. */
figure.fig {
  --w: min(var(--fig), calc(100vw - 40px));
  width: var(--w); margin: 2.2em 0 2.5em calc((100% - var(--w)) / 2);
}
.plate {
  border-top: 1px solid var(--line); padding: 22px 0 4px;
  font-size: 15.5px; line-height: 1.45; font-variant-numeric: tabular-nums;
}
figure.fig figcaption {
  max-width: calc(var(--measure) - 40px); margin: 18px auto 0; font-size: 15px; line-height: 1.55;
  color: var(--ink-soft); text-wrap: pretty;
}
figure.fig figcaption strong { color: var(--ink); font-weight: 600; }
.fig-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.fig-title { font-weight: 620; font-size: 16.5px; letter-spacing: -0.01em; }
.chip { display: inline-block; font-size: 13px; font-weight: 550; line-height: 1.2; color: var(--ink-faint); white-space: nowrap; letter-spacing: 0.01em; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 14.5px; line-height: 1.45; }
.sev { display: inline-block; width: 10px; height: 10px; border-radius: 99px; vertical-align: 0; }
.sev.s0 { background: var(--sev-0); } .sev.s1 { background: var(--sev-1); } .sev.s2 { background: var(--sev-2); } .sev.s3 { background: var(--sev-3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; font-size: 14px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Stretches: the shared "timeline of phases" used across guides. Ruled segments, read left to right. */
.stretches { display: grid; gap: 14px; grid-template-columns: var(--cols, repeat(3, 1fr)); }
.stretch { position: relative; padding: 14px 2px 0; border-top: 5px solid var(--card-deep); }
.stretch.accent { border-top-color: var(--ocean); }
.stretch .step { font-size: 13px; font-weight: 650; color: var(--ocean); margin-bottom: 3px; }
.stretch .name { font-weight: 620; font-size: 16.5px; letter-spacing: -0.012em; line-height: 1.3; }
.stretch .dur { font-size: 14.5px; color: var(--ink-soft); margin-top: 4px; line-height: 1.45; }
.stretch .rail { height: 6px; border-radius: 99px; background: var(--card-deep); margin-top: 14px; overflow: hidden; }
.stretch .rail i { display: block; height: 100%; border-radius: 99px; background: var(--bar); }
.stretch.accent .rail i { background: var(--ocean); }
@media (max-width: 640px) {
  .stretches { grid-template-columns: 1fr; gap: 16px; }
}

/* fig: ibs-day-timeline */
.day { position: relative; margin: 6px 0 0; }
.day .lane { position: relative; }
.day .meals { height: 64px; }
.day .ev { position: absolute; bottom: 10px; left: var(--t); translate: -50% 0; width: max-content; max-width: 34%; text-align: center; font-size: 14px; line-height: 1.3; }
.day .ev.start { translate: -8px 0; text-align: left; }
.day .ev.end { translate: calc(-100% + 8px) 0; text-align: right; }
.day .ev b { display: block; font-weight: 620; font-size: 14px; }
.day .ev span { color: var(--ink-soft); }
.day .axis { position: relative; height: 2px; background: var(--line); }
.day .dot { position: absolute; top: 50%; left: var(--t); width: 12px; height: 12px; border-radius: 99px; background: var(--ink); translate: -50% -50%; box-shadow: 0 0 0 3px var(--canvas); }
.day .hours { position: relative; height: 26px; font-size: 13px; color: var(--ink-faint); }
.day .hours span { position: absolute; top: 7px; left: var(--t); translate: -50% 0; }
.day .hours span:first-child { translate: 0 0; }
.day .gap { height: 40px; }
.day .gap .span { position: absolute; top: 28px; left: var(--a); width: calc(var(--b) - var(--a)); border-top: 1.5px dashed var(--ocean); }
.day .gap .span::before, .day .gap .span::after { content: ''; position: absolute; top: -5px; width: 1.5px; height: 9px; background: var(--ocean); }
.day .gap .span::before { left: 0; } .day .gap .span::after { right: 0; }
.day .gap .span span { position: absolute; left: 50%; top: -22px; translate: -50% 0; font-size: 12.5px; font-weight: 600; color: var(--ocean); white-space: nowrap; background: var(--canvas); padding: 0 6px; }
.day .sym { height: 96px; }
.day .bar { position: absolute; top: 0; left: var(--t); translate: -50% 0; width: 28px; height: calc(var(--v) * 18px); border-radius: 4px 4px 10px 10px; }
.day .bar.s3 { background: var(--sev-3); } .day .bar.s1 { background: var(--sev-1); }
.day .bar span { position: absolute; top: calc(100% + 6px); left: 50%; translate: -50% 0; font-size: 14px; font-weight: 550; white-space: nowrap; }
.day .bar:last-child span { left: auto; right: -10px; translate: 0 0; }
@media (max-width: 640px) { .day .meals { height: 40px; } .day .ev span { display: none; } }

/* fig: diary-method */
.rail-days { height: 10px; margin: 18px 0 8px; border-radius: 99px;
  background: radial-gradient(circle, var(--bar) 3px, transparent 3.5px) 0 50% / 14px 10px repeat-x; }

/* fig: low-fodmap-phases */
.reintro { display: flex; gap: 3px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.reintro span { font-size: 12.5px; font-weight: 600; line-height: 1; padding: 7px 7px; border-radius: 2px; white-space: nowrap; }
.reintro .t { background: var(--ocean); color: var(--paper); flex: 3; text-align: center; }
.reintro .b { background: var(--card-deep); color: var(--ink-soft); flex: 2.5; text-align: center; }
.reintro .more { color: var(--ink-soft); padding: 0 2px; }

/* fig: igg-exposure */
.igg2 { display: grid; grid-template-columns: 1fr 1.25fr; gap: 36px; }
.igg-row { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--hair); font-size: 15px; }
.igg-row:last-child { border-bottom: 0; }
.igg-row .flag { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.igg-row .flag.hi { color: var(--sev-3); }
.igg-row .flag.lo { color: var(--ink-faint); font-weight: 500; }
.igg-reading .fig-title { margin-bottom: 12px; }
.igg-reading p { margin: 0 0 12px; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.igg-reading p b { color: var(--ink); font-weight: 620; }
@media (max-width: 640px) { .igg2 { grid-template-columns: 1fr; gap: 20px; } }

/* fig: elimination-reintroduction */
.branch { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.branch .out { display: grid; gap: 3px; padding: 2px 0 2px 16px; border-left: 2px solid var(--line); }
.branch .out b { font-weight: 620; font-size: 16px; letter-spacing: -0.01em; }
.branch .out.yes { border-left-color: var(--ocean); }
@media (max-width: 640px) { .branch { grid-template-columns: 1fr; } }

/* fig: try-timeline */
.checkins { position: relative; display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin: 16px 0 10px; padding-right: 0; }
.checkins span { height: 10px; background: radial-gradient(circle, var(--bar) 3px, transparent 3.5px) 0 50% / 14px 10px repeat-x; }
.checkins span.on { background-image: radial-gradient(circle, var(--bar) 3px, transparent 3.5px); }
.checkins { margin-bottom: 34px; }
.checkins .flag { position: absolute; right: 0; top: 20px; font-style: normal; font-size: 12.5px; font-weight: 650; color: var(--ocean); padding-right: 10px; }
.checkins .flag::after { content: ''; position: absolute; right: 0; top: -22px; width: 2px; height: 36px; background: var(--ocean); border-radius: 2px; }
.try-notes { display: grid; gap: 6px; font-size: 14px; color: var(--ink-soft); margin-top: 6px; }
.try-notes span { display: flex; gap: 8px; align-items: baseline; }
.try-notes .sev { flex: none; }

/* fig: daily-noise */
.noise { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.stretchbars .lbl { font-size: 14.5px; font-weight: 600; margin-bottom: 10px; }
.stretchbars .bars { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 96px; border-bottom: 1px solid var(--line); }
.stretchbars .bars i { flex: 1; height: max(3px, calc(var(--v) / 3 * 100%)); background: var(--bar); border-radius: 3px 3px 0 0; }
.stretchbars.try .bars i { background: color-mix(in srgb, var(--ocean) 55%, var(--bar)); }
.stretchbars .bars::after { content: ''; position: absolute; left: -4px; right: -4px; bottom: calc(var(--mean) / 3 * 100%); border-top: 2px solid var(--ink); }
.meanline { display: inline-block; width: 16px; border-top: 2px solid var(--ink); }
@media (max-width: 640px) { .noise { grid-template-columns: 1fr; } .stretchbars .bars { height: 72px; } }

/* fig: try-lengths */
.lens { display: grid; gap: 12px; }
.len { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: center; }
.len-l { font-size: 15px; font-weight: 550; line-height: 1.3; }
.len-t { position: relative; height: 30px; border-radius: 8px; background: repeating-linear-gradient(90deg, var(--hair) 0 1px, transparent 1px 25%) 0 0 / 100% 100%; }
.len-t i { position: absolute; top: 9px; height: 12px; left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); border-radius: 99px; background: var(--ocean); }
.len-t i.blk { border-radius: 4px 0 0 4px; } .len-t i.brk { background: var(--card-deep); border-radius: 0 4px 4px 0; }
.len-t i.open { background: linear-gradient(90deg, var(--ocean) 85%, transparent); border-radius: 99px 0 0 99px; }
.len-t i.open::after { content: ''; position: absolute; right: -14px; top: 50%; translate: 0 -50%; border: 6px solid transparent; border-left: 8px solid var(--ocean); }
.len-t i.fuzzy { background: linear-gradient(90deg, var(--ocean) 55%, transparent); }
.len-t i.hatch { background: repeating-linear-gradient(135deg, var(--sev-1) 0 4px, transparent 4px 7px); box-shadow: inset 0 0 0 1px var(--sev-1); }
.len-t em { position: absolute; left: calc(var(--x) * 100% + 14px); top: 50%; translate: 0 -50%; font-style: normal; font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; }
.len-scale { position: relative; height: 18px; margin-left: 226px; font-size: 12.5px; color: var(--ink-faint); }
.len-scale span { position: absolute; left: calc(var(--x) * 100%); translate: -50% 0; }
.len-scale span:first-child { translate: 0 0; } .len-scale span:last-child { translate: -100% 0; }
@media (max-width: 640px) {
  .len { grid-template-columns: 1fr; gap: 4px; }
  .len-scale { margin-left: 0; order: 9; }
  .len { padding-bottom: 20px; }
  .len-t em { top: 42px; left: 0 !important; translate: 0 -50%; white-space: normal; }
}

/* fig: energy-pattern */
.heat { display: grid; grid-template-columns: 112px repeat(14, 1fr); gap: 4px; align-items: center; }
.heat .rl { font-size: 14px; color: var(--ink-soft); font-weight: 550; }
.heat i { aspect-ratio: 1; border-radius: 5px; }
.heat em { font-style: normal; font-size: 12.5px; color: var(--ink-faint); }
.heat em.end { text-align: right; }
.e0 { background: var(--card-deep); } .e1 { background: color-mix(in srgb, var(--ocean) 28%, var(--card)); }
.e2 { background: color-mix(in srgb, var(--ocean) 58%, var(--card)); } .e3 { background: var(--ocean); }
@media (max-width: 640px) { .heat { grid-template-columns: 1fr; gap: 3px; } .heat { display: grid; grid-template-columns: repeat(14, 1fr); } .heat .rl { grid-column: 1 / -1; margin-top: 8px; } .heat > span:not(.rl) { display: none; } .heat em { display: none; } }

/* fig: sleepy-vs-fatigued */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.pair .side { display: grid; gap: 4px; padding: 4px 24px 4px 0; }
.pair .side:last-child { padding: 4px 0 4px 24px; border-left: 1px solid var(--line); }
.pair .step { font-size: 12.5px; font-weight: 650; color: var(--ocean); }
.pair b { font-size: 19px; font-weight: 620; letter-spacing: -0.015em; }
@media (max-width: 480px) { .pair { grid-template-columns: 1fr; gap: 16px; } .pair .side:last-child { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); } }

/* fig: gi-one-page — a printed page on the plate */
.plate.page-plate { background: var(--card); border-top: 0; border-radius: 22px; padding: 30px; }
@media (max-width: 640px) { .plate.page-plate { padding: 14px; border-radius: 16px; } }
.page { max-width: 600px; margin: 0 auto; background: var(--paper); border-radius: 6px; padding: 28px 30px 26px; box-shadow: 0 1px 2px rgba(36,27,21,.06), 0 18px 40px -22px rgba(36,27,21,.35); font-size: 14.5px; line-height: 1.45; }
.page-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.page .flags { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.page .flags b { color: var(--ink); font-weight: 600; }
.page .k { display: block; font-size: 12px; font-weight: 650; color: var(--ocean); margin-bottom: 3px; }
.page .concern { padding: 12px 14px; background: var(--ocean-tint); border-radius: 8px; margin-bottom: 14px; }
.page .concern b { font-size: 17px; font-weight: 620; letter-spacing: -0.01em; }
.page dl { margin: 0; }
.page dl div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--hair); }
.page dt { font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.page dd { margin: 0; }
.page .qs { margin-top: 14px; }
.page .qs ol { margin: 0; padding-left: 20px; }
.page .qs li { margin: 0 0 3px; }
@media (max-width: 640px) { .page { padding: 20px 16px; } .page dl div { grid-template-columns: 1fr; gap: 2px; } }

/* fig: ibs-timing */
.tl { padding: 4px 8px 0; }
.tl-track { position: relative; height: 2px; background: var(--line); margin: 34px 0 10px; }
.tl-track > span { position: absolute; }
.tl-start, .tl-now { left: calc(var(--x) * 100%); top: -5px; width: 12px; height: 12px; border-radius: 99px; background: var(--ink); translate: -50% 0; }
.tl-start b, .tl-now b { position: absolute; bottom: 20px; left: 0; white-space: nowrap; font-size: 14px; font-weight: 620; }
.tl-now b { left: auto; right: 0; }
.tl-start em { position: absolute; bottom: 4px; left: 0; translate: 0 -100%; display: none; }
.tl-weekly { left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); top: -9px; height: 20px;
  background: repeating-linear-gradient(90deg, var(--ocean) 0 3px, transparent 3px calc(100% / 13)); border-radius: 2px; opacity: .9; }
.tl-axis { position: relative; height: 18px; font-size: 13px; color: var(--ink-faint); }
.tl-axis span { position: absolute; left: calc(var(--x) * 100%); translate: -50% 0; white-space: nowrap; }
.tl-axis span:first-child { translate: 0 0; } .tl-axis span:last-child { translate: -100% 0; }
.tl-note { margin: 14px 0 0 calc(var(--a) * 100%); font-size: 14.5px; font-weight: 550; color: var(--ocean); display: flex; gap: 8px; align-items: baseline; }
.tl-note .tick { flex: none; width: 3px; height: 12px; background: var(--ocean); border-radius: 2px; }
@media (max-width: 640px) { .tl-note { margin-left: 0; } }

/* fig: sleep-log */
.slog { display: grid; gap: 5px; }
.slog .n, .slog-scale { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.slog .tag { font-size: 13.5px; color: var(--ink-soft); text-align: right; white-space: nowrap; }
.slog .bar { position: relative; height: 14px; border-radius: 4px; background: var(--card); }
.slog .bar i { position: absolute; top: 0; bottom: 0; left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); background: var(--ocean); border-radius: 4px; }
.slog .bar::before { content: ''; position: absolute; top: -3px; bottom: -3px; left: 50%; border-left: 1px dashed var(--line); }
.slog-scale div { position: relative; height: 18px; font-size: 12.5px; color: var(--ink-faint); }
.slog-scale em { position: absolute; left: calc(var(--x) * 100%); translate: -50% 0; font-style: normal; white-space: nowrap; }
.slog-scale em:first-child { translate: 0 0; } .slog-scale em:last-child { translate: -100% 0; }
@media (max-width: 640px) { .slog .n, .slog-scale { grid-template-columns: 72px 1fr; gap: 8px; } .slog .tag { font-size: 11px; white-space: normal; line-height: 1.15; } .slog-scale em:nth-child(2), .slog-scale em:nth-child(4) { display: none; } }

/* fig: evening-countdown */
.eve { padding: 8px 4px 0; }
.eve-track { position: relative; height: 2px; background: var(--line); margin: 112px 0 12px; }
.eve-track .mk { position: absolute; left: calc(var(--x) * 100%); top: -6px; width: 14px; height: 14px; translate: -50% 0; border-radius: 99px; background: var(--ocean); box-shadow: 0 0 0 3px var(--canvas); }
.eve-track .mk.bed { background: var(--ink); }
.eve-track .mk.mid { background: transparent; box-shadow: none; }
.eve-track .mk b { position: absolute; bottom: 22px; left: 50%; translate: -50% 0; font-size: 14px; font-weight: 650; white-space: nowrap; }
.eve-track .mk em { position: absolute; bottom: 44px; left: 50%; translate: -50% 0; width: 170px; text-align: center; font-style: normal; font-size: 14px; line-height: 1.3; }
.eve-track .mk.bed b, .eve-track .mk.bed em { left: auto; right: -2px; translate: 0 0; text-align: right; width: auto; }
.eve-track .rng { position: absolute; left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); top: -5px; height: 12px; border-radius: 99px; background: var(--sev-1); }
.eve-axis { position: relative; height: 18px; font-size: 13px; color: var(--ink-faint); }
.eve-axis span { position: absolute; left: calc(var(--x) * 100%); translate: -50% 0; }
.eve-axis span:first-child { translate: 0 0; }
.eve-list { display: none; }
@media (max-width: 640px) {
  .eve-track { margin-top: 40px; }
  .eve-track .mk em { display: none; }
  .eve-list { display: grid; gap: 6px; list-style: none; padding: 0; margin: 16px 0 0; font-size: 13.5px; line-height: 1.4; }
  .eve-list b { display: inline-block; min-width: 54px; font-weight: 650; }
}

/* fig: notes-to-page */
.n2p { display: grid; grid-template-columns: 1fr 28px 1fr; gap: 14px; align-items: start; }
.n2p .colh { font-size: 13.5px; font-weight: 650; color: var(--ink-soft); margin-bottom: 10px; }
.n2p .note { position: relative; background: var(--card); border-radius: 10px; padding: 10px 13px; margin-bottom: 8px; font-size: 14.5px; line-height: 1.4; }
.n2p .note .d { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-faint); }
.n2p .note .to { display: block; font-size: 13px; font-weight: 600; color: var(--ocean); margin-top: 3px; }
.n2p .arrow { align-self: center; font-size: 22px; color: var(--ink-faint); text-align: center; }
.n2p .sheet { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; box-shadow: 0 14px 30px -22px rgba(36,27,21,.4); }
.n2p .sec { font-size: 14.5px; line-height: 1.4; padding: 7px 0; border-bottom: 1px solid var(--hair); }
.n2p .sec:last-child { border-bottom: 0; }
.n2p .sec .k { display: block; font-size: 12.5px; font-weight: 650; color: var(--ocean); }
.n2p .sec.lead { font-weight: 620; font-size: 14.5px; }
@media (max-width: 640px) { .n2p { grid-template-columns: 1fr; } .n2p .arrow { rotate: 90deg; } }

/* fig: sourced-line */
.src-line { display: grid; gap: 10px; max-width: 560px; margin: 0 auto; }
.sline { padding: 14px 16px; border-radius: 12px; background: var(--card); }
.sline .k, .page .k { font-size: 12px; font-weight: 650; color: var(--ocean); display: block; margin-bottom: 2px; }
.sline b { font-weight: 620; font-size: 16px; }
.squote { position: relative; margin-left: 22px; padding: 10px 14px; border-left: 2px solid var(--ocean); font-size: 15px; color: var(--ink-soft); }
.squote .d { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-faint); margin-bottom: 2px; }
