:root {
  --bg: #F8F7F3;
  --surface: #FFFFFF;
  --text: #20211F;
  --muted: #666862;
  --border: #D9D8D1;
  --accent: #315C74;
  --accent-dark: #24485D;
  --accent-soft: #E8EFF3;
  --relax-soft: #EEF0E9;
  --warning-soft: #FFF5E8;
  --max-shell: 1160px;
  --reading: 760px;
  --radius-panel: 18px;
  --radius-control: 9px;
  --header-h: 58px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.66;
  text-rendering: optimizeLegibility;
}
button, select, input { font: inherit; }
a { color: var(--accent); text-underline-offset: 0.16em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-dark); }
button { color: inherit; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 1000;
  background: var(--text);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
}
.skip-link:focus { top: 12px; }

.shell { width: min(calc(100% - 80px), var(--max-shell)); margin-inline: auto; }
.site-header {
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(217,216,209,.82);
  background: rgba(248,247,243,.95);
  backdrop-filter: blur(10px);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { color: var(--text); font-weight: 650; font-size: 16px; text-decoration: none; letter-spacing: -.01em; }
.header-nav { display: flex; gap: 24px; font-size: 14px; }
.header-nav a { color: var(--muted); text-decoration: none; }
.header-nav a:hover { color: var(--text); }

.hero { padding-top: 42px; padding-bottom: 36px; }
.hero-copy { max-width: 850px; margin-bottom: 28px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.024em; }
h1 { margin: 0 0 16px; max-width: 900px; font-size: clamp(34px, 4vw, 52px); font-weight: 700; line-height: 1.04; }
.hero-intro { margin: 0 0 8px; max-width: 720px; font-size: clamp(17px, 2vw, 20px); line-height: 1.48; }
.privacy-line { margin: 0; color: var(--muted); font-size: 15px; }

.trainer-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 24px 28px 20px;
}
.trainer-setup { max-width: 860px; margin-inline: auto; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, .field > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 650; color: var(--text); }
.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  overflow: hidden;
  background: #f3f3ef;
}
.segmented label { position: relative; min-width: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  border-right: 1px solid var(--border);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span { background: var(--surface); color: var(--accent-dark); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.segmented input:focus-visible + span { outline: 3px solid rgba(49,92,116,.28); outline-offset: -3px; }
.field-note { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 34px 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  color: var(--text);
  background: var(--surface);
}
.field select:focus-visible, .button:focus-visible, .text-button:focus-visible, .text-link-button:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgba(49,92,116,.28);
  outline-offset: 3px;
}
.more-options { margin-top: 10px; font-size: 14px; color: var(--muted); }
.more-options summary { width: max-content; cursor: pointer; color: var(--accent); }
.compact-field { max-width: 320px; margin-top: 10px; }

.trainer-display { margin-top: 18px; text-align: center; transition: background-color .25s ease; border-radius: 14px; padding: 14px 10px 4px; }
.trainer-display.theme-squeeze { background: var(--accent-soft); }
.trainer-display.theme-relax { background: var(--relax-soft); }
.trainer-display.theme-rest { background: #f3f3ef; }
.session-context { min-height: 21px; margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 650; }
.timer-wrap {
  width: clamp(264px, 29vw, 300px);
  aspect-ratio: 1;
  position: relative;
  margin: 2px auto 8px;
  font-variant-numeric: tabular-nums;
}
.timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track, .ring-progress { fill: transparent; stroke-width: 3; }
.ring-track { stroke: var(--border); }
.ring-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke .2s ease;
}
.timer-content {
  position: absolute;
  inset: 13%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.phase-label {
  margin: 0;
  max-width: 88%;
  font-size: clamp(29px, 3.5vw, 38px);
  line-height: .98;
  font-weight: 750;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.phase-label.is-long { font-size: clamp(27px, 3.2vw, 34px); }
.phase-label.is-very-long { font-size: clamp(24px, 2.9vw, 31px); }
.countdown { margin: 15px 0 0; font-size: clamp(66px, 8vw, 84px); line-height: .84; font-weight: 630; letter-spacing: -.04em; }
.phase-guidance {
  min-height: 68px;
  max-width: 560px;
  margin: 0 auto 5px;
  padding-inline: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.phase-cue { margin: 0; max-width: 520px; color: var(--muted); font-size: 14px; line-height: 1.42; }
.next-cue { margin: 4px 0 0; min-height: 20px; color: var(--accent-dark); font-size: 13px; line-height: 1.35; font-weight: 750; }
.session-progress { max-width: 360px; margin: 0 auto 12px; }
.session-progress p { margin: 0 0 5px; color: var(--muted); font-size: 13px; }
.progress-track { height: 3px; overflow: hidden; background: var(--border); border-radius: 99px; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--accent); }
.setup-action, .session-controls, .completion-actions { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 18px; }
.button {
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  min-height: 44px;
  padding: 9px 22px;
  font-weight: 700;
  cursor: pointer;
}
.button-primary { background: var(--accent); color: #fff; min-width: 190px; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.button-secondary:hover { border-color: #b9b8b0; }
.text-button, .text-link-button {
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.17em;
  cursor: pointer;
}
.text-button:hover, .text-link-button:hover { color: var(--accent-dark); }
.trainer-help-links { margin: 7px 0 0; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 13px; }
.inline-status { max-width: 620px; margin: 10px auto 0; padding: 8px 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.technique-strip { margin: 16px auto 0; padding-top: 14px; max-width: 740px; border-top: 1px solid var(--border); display: flex; justify-content: center; gap: 0; color: var(--text); font-size: 14px; font-weight: 650; }
.technique-strip span:not(:last-child)::after { content: "·"; margin: 0 12px; color: var(--muted); }
.limit-line, .safety-line { max-width: 820px; margin: 10px auto 0; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.45; }
.safety-line { margin-top: 6px; }
.safety-line strong { color: var(--text); }
.noscript-note { max-width: 760px; padding: 10px 12px; border: 1px solid var(--border); background: var(--warning-soft); }

.help-dialog { width: min(92vw, 620px); border: 1px solid var(--border); border-radius: 14px; padding: 0; color: var(--text); background: var(--surface); box-shadow: 0 18px 50px rgba(32,33,31,.14); }
.help-dialog::backdrop { background: rgba(32,33,31,.28); }
.dialog-inner { padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin: 0 0 12px; font-size: 25px; }
.dialog-close { border: 0; background: transparent; font-size: 30px; line-height: 1; cursor: pointer; color: var(--muted); }
.dialog-inner p { margin: 0 0 12px; }
.dialog-inner ul { margin-top: 8px; }
.dialog-actions { margin-top: 18px; }

.quick-start { padding-top: 28px; padding-bottom: 54px; border-top: 1px solid var(--border); }
.section-heading { max-width: var(--reading); }
.section-kicker { margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .055em; }
h2 { margin: 0 0 16px; font-size: clamp(26px, 3vw, 32px); font-weight: 700; }
h3 { margin: 30px 0 10px; font-size: 20px; font-weight: 700; }
p { margin: 0 0 18px; }
sup a { font-size: 11px; text-decoration: none; margin-left: 2px; }
.do-avoid-grid, .mistake-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; max-width: 940px; margin-top: 24px; }
.do-avoid-grid h3, .mistake-grid h3 { margin-top: 0; }
ul { padding-left: 1.25em; }
.check-list, .plain-list { margin: 0; }
.check-list li, .plain-list li { margin: 0 0 8px; }
.note-callout, .soft-callout, .warning-callout, .urgent-callout { padding: 14px 16px; border-left: 3px solid var(--accent); background: rgba(255,255,255,.58); margin: 28px 0; }
.note-callout { max-width: 900px; }
.soft-callout { background: var(--relax-soft); border-left-color: #7d8574; }
.warning-callout { background: var(--warning-soft); border-left-color: #a66b2a; }
.urgent-callout { background: var(--warning-soft); border-left-color: #8e4d2f; }
.note-callout p:last-child, .soft-callout p:last-child, .warning-callout p:last-child, .urgent-callout p:last-child { margin-bottom: 0; }

.article-shell { display: grid; grid-template-columns: 230px minmax(0, var(--reading)); gap: 64px; align-items: start; justify-content: center; padding-bottom: 72px; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); padding-top: 4px; font-size: 14px; }
.toc-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.toc a { display: block; position: relative; padding: 4px 0 4px 12px; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--text); font-weight: 700; border-left-color: var(--accent); }
.toc-mobile { display: none; }
.guide { min-width: 0; }
.content-section { padding: 54px 0; border-top: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + 20px); }
.content-section:first-child { border-top: 0; padding-top: 4px; }
.table-wrap { overflow-x: auto; margin: 22px 0 28px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
th, td { padding: 12px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: #f3f3ef; font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
.evidence-label { font-weight: 700; white-space: nowrap; }
.review-date { color: var(--muted); font-size: 14px; }
.faq-section details { border-top: 1px solid var(--border); padding: 0; }
.faq-section details:last-child { border-bottom: 1px solid var(--border); }
.faq-section summary { padding: 15px 2px; font-weight: 700; cursor: pointer; }
.faq-section details p { padding: 0 2px 16px; margin: 0; }
.bibliography { padding-left: 1.4em; font-size: 14px; line-height: 1.55; }
.bibliography li { margin: 0 0 10px; scroll-margin-top: calc(var(--header-h) + 18px); }

.site-footer { border-top: 1px solid var(--border); padding: 34px 0 46px; color: var(--muted); font-size: 13px; }
.footer-inner { max-width: var(--max-shell); }
.footer-inner p { margin-bottom: 8px; }

[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 1099px) {
  .shell { width: min(calc(100% - 60px), 980px); }
  .article-shell { display: block; max-width: 800px; }
  .toc-desktop { display: none; }
  .toc-mobile { display: block; margin: 0 0 32px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .toc-mobile summary { padding: 13px 0; cursor: pointer; font-weight: 700; }
  .toc-mobile nav { padding: 0 0 13px; columns: 2; }
  .toc-mobile a { display: block; padding: 3px 0; color: var(--muted); text-decoration: none; break-inside: avoid; }
}

@media (max-width: 767px) {
  :root { --header-h: 50px; }
  body { font-size: 16.25px; line-height: 1.64; }
  .shell { width: calc(100% - 40px); }
  .site-header { height: var(--header-h); }
  .header-nav { display: none; }
  .hero { padding-top: 28px; padding-bottom: 30px; }
  h1 { font-size: clamp(34px, 9.7vw, 40px); }
  .hero-copy { margin-bottom: 22px; }
  .trainer-panel { padding: 18px 14px 16px; border-radius: 16px; }
  .setup-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .segmented span { min-height: 41px; padding-inline: 5px; font-size: 13px; }
  .timer-wrap { width: min(76vw, 250px); }
  .trainer-display { margin-top: 14px; padding-inline: 4px; }
  .phase-label { font-size: clamp(27px, 8.3vw, 32px); }
  .phase-label.is-long { font-size: clamp(25px, 7.7vw, 30px); }
  .phase-label.is-very-long { font-size: clamp(22px, 7vw, 27px); }
  .countdown { margin-top: 13px; font-size: clamp(60px, 19vw, 76px); }
  .phase-guidance { min-height: 74px; padding-inline: 8px; }
  .phase-cue { font-size: 13.5px; }
  .button-primary { width: 100%; max-width: 420px; }
  .setup-action { padding-inline: 4px; }
  .technique-strip { flex-wrap: wrap; gap: 2px 0; line-height: 1.5; }
  .technique-strip span:not(:last-child)::after { margin: 0 8px; }
  .limit-line, .safety-line { text-align: left; }
  .quick-start { padding-top: 30px; padding-bottom: 42px; }
  .do-avoid-grid, .mistake-grid { grid-template-columns: 1fr; gap: 24px; }
  .content-section { padding: 42px 0; }
  .toc-mobile nav { columns: 1; }
  th, td { padding: 10px 11px; min-width: 150px; }
  th:first-child, td:first-child { min-width: 120px; }
}

@media (max-width: 479px) {
  .shell { width: calc(100% - 40px); }
  .setup-grid { grid-template-columns: 1fr; }
  .trainer-panel { margin-inline: -4px; }
  .session-controls, .completion-actions { flex-direction: column; gap: 6px; }
  .session-controls .button, .completion-actions .button { width: 100%; }
}

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

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --border: #bbb; }
  body { font-size: 11pt; line-height: 1.45; background: #fff; }
  .site-header, .trainer-setup, .trainer-display, .trainer-help-links, .toc, .toc-mobile, .site-footer, .privacy-line, .limit-line, .safety-line, .noscript-note, .text-link-button { display: none !important; }
  .shell, .article-shell { width: 100%; max-width: none; display: block; }
  .hero { padding: 0 0 18pt; }
  .trainer-panel { border: 0; padding: 0; }
  .technique-strip { justify-content: flex-start; border: 1px solid #bbb; padding: 8pt; margin: 10pt 0; }
  .quick-start, .content-section { padding: 16pt 0; break-inside: auto; }
  .content-section { border-top: 1px solid #bbb; }
  .faq-section details { display: block; }
  .faq-section details > * { display: block; }
  .faq-section summary { list-style: none; }
  .table-wrap { overflow: visible; border-color: #bbb; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; overflow-wrap: anywhere; }
  h1 { font-size: 25pt; }
  h2 { font-size: 18pt; }
  .sources-section { break-before: page; }
}
