/* Integration-specific controls; colors and responsive typography come from the approved stylesheet. */
#start,#next {background:#F56A00;color:#fff;border-color:#F56A00}
#moves {display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:20px}
#moves[data-stage="chapter_end"] {display:grid}
#moves[data-stage="chapter_end"] button {width:100%;text-align:left}
#moves[data-stage="chapter_end"] button:last-child {margin-top:16px}
#message:empty {display:none}
#message.error {color:#812915}
#resumeBox,#access {margin-top:18px}
#resumeBox button,#access button {margin-top:8px}
#resumeBox input,#access input,#linkToKeep {box-sizing:border-box;width:100%;padding:8px}
#questionBody p,#questionBody h2 {white-space:pre-wrap;overflow-wrap:anywhere}
#questionBody .option input {flex-shrink:0}
button:focus-visible,summary:focus-visible {outline:3px solid #b35300}
/* Approved chapter and question layout. Both font modes use the same scroll surface. */
body:has(#form:not([hidden])) > header {display:none}
#surveyMain:has(#form:not([hidden])) {
  padding:0;max-width:720px;font:16px/1.55 Meiryo,"Yu Gothic",sans-serif;color:#322f2a;
  --answer-size:16px;--intro-size:13px;--question-size:20px;--title-size:18px;--meta-size:13px;
}
#surveyMain.pilot-large:has(#form:not([hidden])) {--answer-size:21px;--intro-size:21px;--question-size:24px;--title-size:24px;--meta-size:18px}
#displayTools {padding:12px 12px 9px;background:#fff9f2}
#allTopics {margin:0;padding:0;border:1px solid #c3b3a4;border-radius:7px}
#allTopics summary {list-style:none;text-align:center;padding:8px 4px;color:#322f2a;font:bold 16px/1.4 Meiryo,sans-serif}
#allTopics summary::-webkit-details-marker {display:none}
#allTopics ol {text-align:left;margin:8px 12px 12px}
.size-switch {gap:4px;margin:8px 0 0;font-size:14px}
.size-switch button {min-width:0;min-height:0;padding:4px 10px;border:1px solid #baad9f;border-radius:5px;background:#fff;color:#322f2a}
.size-switch button[aria-pressed="true"] {background:#fff0d9;border-color:#aa571f;color:#823b0b;font-weight:bold}
#chapterHead {box-sizing:border-box;position:sticky;top:0;z-index:2;margin:0;padding:12px 16px 11px;background:#fff4e5;border-block:1px solid #dfc9ad;border-radius:0}
#surveyMain:not(.pilot-large) #chapterHead {padding:5px 12px}
#surveyMain:not(.pilot-large) #chapterIntro {line-height:1.4}
#chapterHead.compact-bar {padding-block:4px}
#chapterBar {display:flex;align-items:baseline;justify-content:space-between;gap:6px;flex-wrap:wrap}
#chapterBar h3 {margin:0;font-size:var(--title-size);line-height:1.45;letter-spacing:.01em;overflow-wrap:anywhere}
#chapterBar #localQ {margin:0;color:#834618;font-size:var(--meta-size);font-weight:700}
#chapterIntro {font-size:var(--intro-size);line-height:1.55;white-space:pre-line;overflow-wrap:anywhere}
#chapterHead #chapterIntro {margin:6px 0 0;white-space:pre-line}
#chapterFlow:has(#chapterIntro:not([hidden])) {padding:10px 16px 4px}
#chapterFlow #chapterIntro {margin:0}
.chapter-help {min-height:36px;min-width:0;padding:4px 8px;font-size:13px;margin-bottom:8px}
#form:has(#chapterHead:not([hidden])) .panel {padding:0;border:0;background:transparent;box-shadow:none;font-size:var(--answer-size)}
#form:has(#chapterHead:not([hidden])) #questionCard {background:white;border:1px solid #dfd5c9;border-radius:10px;margin:12px;padding:14px}
#chapterOrdinal {font-size:var(--meta-size);font-weight:bold;color:#795639}
#surveyMain #question,#surveyMain.pilot-large #question {font-size:var(--question-size);line-height:1.5;margin:3px 0 14px}
#answerField .option {min-height:45px;align-items:center;gap:10px;margin:7px 0 0;padding:9px 12px;border-radius:7px}
#answerField .option input {width:18px;height:18px;margin:0;accent-color:#a8470c}
#routeCountNote {font-size:.85em;color:#6c432e;margin:4px 0 8px}
#answerIssue:empty {display:none}
#answerIssue {margin:12px 0 4px;color:#812915}
#moves[data-stage="question"] {margin:12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
#moves[data-stage="question"] button {min-width:0;width:100%;min-height:44px;padding:7px;border-radius:7px;font-weight:700}
#moves[data-stage="question"] #next {background:#ac490b;color:white;border-color:#ac490b}
#moves[data-stage="question"] #next:disabled {background:#ece9e5;color:#706b66;border-color:#d8d2cb;opacity:1}
#moves[data-stage="question"] #next:first-child,#moves[data-stage="question"] .pause {grid-column:1/-1}
#form:has(#chapterHead:not([hidden])) #access {margin:12px}
#form:has(#chapterHead:not([hidden])) #moves:not([data-stage="question"]) {margin:12px}
html:has(#form:not([hidden])) {scroll-padding-top:var(--chapter-height,0px)}
/* A saved review contains answers, not resume credentials or on-screen controls. */
@media print {
  @page {size:A4;margin:15mm}
  html:has(.answer-review) {background:white}
  body:has(.answer-review) {background:white;color:black}
  body:has(.answer-review) > header,
  body:has(.answer-review) #displayTools,
  body:has(.answer-review) #message,
  body:has(.answer-review) #moves,
  body:has(.answer-review) #access,
  body:has(.answer-review) #chapterHead,
  body:has(.answer-review) #chapterFlow,
  body:has(.answer-review) #answerIssue,
  .answer-review > :not(.reviewTitle):not(.reviewItem) {display:none!important}
  body:has(.answer-review) #surveyMain,
  body:has(.answer-review) .panel,
  body:has(.answer-review) #questionCard {max-width:none;margin:0;padding:0;border:0;box-shadow:none;background:white;font:11pt/1.6 Meiryo,"Yu Gothic",sans-serif}
  .answer-review .reviewTitle {font-size:16pt;margin:0 0 8mm}
  .answer-review .reviewItem {break-inside:avoid;margin:0 0 5mm}
  .answer-review h3 {font-size:11pt;margin:0 0 2mm;break-after:avoid}
  .answer-review p {margin:0;white-space:pre-wrap;overflow-wrap:anywhere;orphans:3;widows:3}
}
