:root {
  color-scheme: light;
  --background: #faf9f4;
  --surface: #fff;
  --ink: #29261e;
  --muted: #615a4e;
  --line: #e1dbcc;
  --line-strong: #cdbb86;
  --accent: #f7df88;
  --accent-hover: #efd070;
  --accent-soft: #fff7d9;
  --accent-ink: #594315;
  --radius: 16px;
  font-family: "Noto Sans JP", "Yu Gothic UI", "Hiragino Sans", Meiryo, sans-serif;
  line-height: 1.58;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--background); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
a { color: var(--accent-ink); }
:focus-visible { outline: 3px solid #956c10; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }

.page-width { width: min(1192px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: absolute; top: 8px; left: 12px; z-index: 2; padding: 8px 14px; transform: translateY(-150%); background: white; }
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header-inner { width: min(1256px, 100%); min-height: 64px; padding-inline: 32px; margin-inline: auto; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; flex: none; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-icon { display: block; width: 40px; height: 40px; border-radius: 10px; object-fit: contain; }
.brand-name { display: grid; font-size: 1.22rem; font-weight: 800; line-height: 1.22; letter-spacing: .08em; }
.brand-name small { font-size: .65rem; letter-spacing: .15em; font-weight: 700; color: var(--muted); }
.storage-status { margin-left: auto; font-size: .82rem; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 9px; border-radius: 7px; font-size: .87rem; font-weight: 720; text-decoration: none; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--accent-soft); }

.scene-picker { margin-inline: auto; padding-block: clamp(18px, 3.5vw, 44px) 42px; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr); align-items: center; gap: clamp(16px, 3.5vw, 48px); padding: clamp(16px, 2.5vw, 34px); border: 1px solid #ead48d; border-radius: 28px; background: linear-gradient(114deg, #fff8df 4%, #fbebae 68%, #f4d981 100%); }
.home-heading { padding-inline-start: clamp(2px, 2vw, 28px); }
.home-heading h1 { margin-bottom: 15px; color: #362813; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(2rem, 5vw, 4.25rem); font-weight: 750; line-height: 1.13; letter-spacing: -.025em; }
.home-heading p { max-width: 25em; color: #554625; font-size: clamp(.94rem, 1.5vw, 1.06rem); line-height: 1.65; }
.home-heading .home-subtitle { margin-bottom: 6px; color: var(--accent-ink); font-size: clamp(.94rem, 1.65vw, 1.16rem); font-weight: 760; line-height: 1.35; }
.home-free { display: block; margin-top: .28em; }
.home-actions { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 8px; }
.home-actions a { max-width: 100%; text-decoration: none; white-space: normal; }
.home-hero-image { padding: 6px; border: 1px solid #fff9e5; border-radius: 20px; background: #fff6dd; box-shadow: 0 9px 22px #6f4d1320; }
.home-hero-image img { display: block; width: 100%; height: auto; border-radius: 14px; }
.scene-categories-heading { margin: clamp(20px, 3vw, 36px) 0 12px; font-size: clamp(1.18rem, 2.5vw, 1.62rem); line-height: 1.35; }
.scene-categories { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; gap: 12px; }
.scene-category { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 14px #4d3c130b; }
.scene-category[open] { border-color: #c9a655; }
.scene-category > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px 6px; padding: 8px 8px 10px; border-radius: inherit; list-style: none; cursor: pointer; }
.scene-category > summary::-webkit-details-marker { display: none; }
.scene-category > summary:hover, .scene-category[open] > summary { background: var(--accent-soft); }
.scene-category[open] > summary { border-end-start-radius: 0; border-end-end-radius: 0; }
.category-image { display: block; grid-column: 1 / -1; width: 100%; height: auto; border-radius: 10px; background: #f5eee2; }
.category-copy { display: grid; align-content: start; gap: 3px; min-height: 3.2rem; min-width: 0; padding-inline-start: 4px; }
.category-copy strong { font-size: 1.05rem; line-height: 1.37; }
.category-copy > span { color: var(--muted); font-size: .875rem; line-height: 1.37; }
.category-toggle { align-self: center; display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid #ead7a2; border-radius: 50%; background: #fff5d6; }
.category-toggle::after { content: ""; width: 7px; height: 7px; border: solid #84641a; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.scene-category[open] .category-toggle::after { transform: translateY(2px) rotate(225deg); }
.category-content { padding: 12px; }
.workspace-options { display: grid; gap: 8px; }
.workspace-options button { min-height: 46px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fcfbf7; text-align: left; font-size: .96rem; font-weight: 720; overflow-wrap: anywhere; }
.workspace-options button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--accent-soft); }
.tool-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tool-cards button { display: grid; grid-template-columns: minmax(72px, 28%) minmax(0, 1fr); align-items: center; gap: 12px; min-height: 77px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; }
.tool-cards button:hover { border-color: var(--line-strong); background: var(--accent-soft); }
.tool-cards img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; border-radius: 7px; object-fit: cover; background: var(--accent-soft); }
.tool-cards strong, .tool-cards span span { display: block; overflow-wrap: anywhere; }
.tool-cards strong { font-size: 1rem; line-height: 1.3; }
.tool-cards span span { margin-top: 3px; color: var(--muted); font-size: .79rem; }
@media screen and (max-width: 800px) {
  .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 480px) {
  .tool-cards { grid-template-columns: minmax(0, 1fr); }
}
.workspace-variants { margin-top: 9px; }
.workspace-variants > summary { min-height: 44px; padding: 10px 8px; color: var(--accent-ink); font-weight: 730; cursor: pointer; }
.workspace-toolbar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 16px; }
.workspace-toolbar-links { display: flex; flex-wrap: wrap; gap: 0 5px; }

@media screen and (max-width: 1040px) {
  .scene-categories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.intro { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding-block: 8px 17px; }
.intro h1 { font-size: clamp(1.55rem, 3vw, 2.1rem); line-height: 1.3; letter-spacing: -.025em; margin-bottom: 5px; }
.intro-condition { background: var(--accent-soft); border-left: 3px solid #c6a447; border-radius: 4px 10px 10px 4px; padding: 0 13px; font-size: .85rem; color: #584821; }
.intro-condition > summary { min-height: 44px; padding-block: 11px; font-weight: 750; cursor: pointer; }
.intro-condition[open] { padding-block-end: 8px; }
.intro-condition > span { display: block; }
.intro-condition p { max-width: 46ch; margin-block-start: 3px; }

.workspace-jumps { display: flex; flex-wrap: wrap; gap: 4px; margin-block: 2px 10px; }
.workspace-jumps a { text-decoration: none; }
.workspace-jumps a:last-child { margin-inline-start: auto; }
:is(#walk-editor, #care-editor, #preview-heading, #paper-tool-guide, #tablet-tool-guide, [id^="paper-item-"]) { scroll-margin-top: 12px; }
.settings-panel { display: grid; gap: 12px; align-items: start; padding: 12px; }
.format-bar { display: grid; justify-items: start; gap: 5px; align-items: center; min-width: 0; }
.format-label { font-size: .9rem; font-weight: 750; }
.format-hint { color: var(--muted); font-size: .83rem; }
.format-switch { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: #f8f6ee; }
.format-switch button { min-height: 44px; padding: 4px 15px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); white-space: nowrap; font-size: .9rem; font-weight: 750; }
.format-switch button:hover { color: var(--accent-ink); background: var(--accent-soft); }
.format-switch button[aria-pressed="true"] { color: var(--accent-ink); background: #f8eab9; border-color: #d9c58a; }
.view-switch { display: flex; align-items: center; gap: 3px; min-width: 0; }
.view-switch button, .primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: .48em; min-height: 44px; padding: 7px 14px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); background: transparent; font-weight: 750; font-size: .92rem; white-space: nowrap; }
.view-switch button { color: var(--muted); }
.view-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: #d3c9aa; box-shadow: 0 1px 2px #3a2d0814; }
.view-switch button:hover { color: var(--accent-ink); background: #fbf8ec; }
.view-switch svg, .primary-button svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.primary-button { background: var(--accent); border-color: #d9bb62; color: #3d2f0e; }
.primary-button:hover:not(:disabled) { background: var(--accent-hover); }
.secondary-button { background: var(--surface); border-color: var(--line); }
.secondary-button:hover:not(:disabled) { background: var(--accent-soft); }
.text-button { display: inline-flex; align-items: center; min-height: 44px; border: 0; background: transparent; padding: 7px 8px; color: var(--accent-ink); font-size: .82rem; font-weight: 740; border-radius: 6px; }
.text-button:hover { background: var(--accent-soft); }
.text-button:not(button) { text-underline-offset: 3px; }

.workspace-disclosure { min-width: 0; overflow-wrap: anywhere; }
.workspace-disclosure > summary { min-height: 44px; padding: 10px 12px; color: var(--accent-ink); cursor: pointer; font-weight: 760; }
.work-area { display: grid; gap: 12px; padding: 0 12px 12px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 7px #4d3c1310; }
.scene-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 6px; }
.scene-panel-heading h3 { font-size: .95rem; }
.scene-panel-heading p { font-size: .83rem; color: var(--muted); }
.scene-list { list-style: none; display: grid; gap: 5px; margin: 0; padding: 0; }
.scene-row { min-height: 49px; display: flex; align-items: stretch; gap: 2px; background: #fcfbf8; border: 1px solid #ece7da; border-radius: 9px; }
.scene-row.is-active { border-color: #d8ba69; background: var(--accent-soft); }
.scene-row label { width: 41px; flex: none; display: grid; place-items: center; cursor: pointer; border-radius: 8px 0 0 8px; }
.scene-row label:hover { background: #f4e7b8; }
.scene-row input { width: 17px; height: 17px; margin: 0; accent-color: #79560e; cursor: pointer; }
.scene-row button { flex: 1; padding: 7px 8px 7px 0; min-width: 0; border: 0; border-radius: 0 8px 8px 0; background: none; text-align: left; color: var(--ink); font-size: .9rem; font-weight: 730; }
.scene-row button:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.brief-scene-row button { padding-inline: 12px; border-radius: 8px; }

.editor-panel { min-width: 0; border-top: 1px solid var(--line); padding-top: 12px; }
.title-field, .caption-field { display: grid; gap: 6px; }
.title-field label, .caption-field label { font-size: .9rem; font-weight: 750; }
.title-field input, .caption-field textarea, #preview-adjustment textarea, .figure-notes textarea, #print-note, .scene-metadata-fields :is(select, textarea) { display: block; width: 100%; border: 1px solid #d8d1c0; border-radius: 8px; padding: 8px 10px; color: var(--ink); background: var(--surface); }
.caption-field textarea { resize: vertical; min-height: 64px; }
.care-note { background: var(--accent-soft); border: 1px solid #d9c58a; border-radius: 9px; padding: 9px 12px; overflow-wrap: anywhere; }
.care-note label, .care-note h3 { display: block; margin-bottom: 4px; color: var(--accent-ink); font-weight: 800; font-size: 1rem; }
.care-note p { white-space: pre-line; }
.care-note-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: start; gap: 10px; }
.care-note-layout.care-note-text-only { grid-template-columns: minmax(0, 1fr); }
.care-figure-caption { margin: 0 0 5px; font-size: .89rem; font-weight: 720; }
.care-note-figure > :is(svg, .scene-illustration) { width: 100%; height: auto; background: white; border: 1px solid #e6dfcc; border-radius: 7px; }
.workspace-panel { min-width: 0; padding: 0 10px 12px; }
.balance-choice-count { margin-bottom: 10px; color: var(--muted); font-size: .89rem; font-weight: 700; }
.inline-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--accent-ink); background: var(--surface); text-decoration: none; font-size: .88rem; font-weight: 750; }
.inline-action:hover:not(:disabled) { background: var(--accent-soft); }
.direction-legend { margin: 8px 0; color: var(--muted); font-size: .86rem; }
.direction-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 10px; }
.direction-card { min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffdfa; break-inside: avoid; }
.sheet .direction-card:only-child { grid-column: 1 / -1; justify-self: center; width: min(100%, 133mm); }
.direction-card :is(h3, h4) { margin: 0 0 4px; color: var(--accent-ink); font-size: .97rem; }
.direction-card p { margin-block: 5px; font-size: .85rem; }
.direction-card .direction-equipment { color: var(--muted); font-size: .81rem; }
.direction-card .direction-support { color: var(--accent-ink); font-size: .94rem; font-weight: 760; }
.scene-illustration { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; }
.scene-illustration.is-portrait { width: auto; max-width: 100%; max-height: 68vh; margin-inline: auto; aspect-ratio: auto; }
:is(.safety-figure, .safety-knee-figures) > :is(svg, .scene-illustration) { width: 100%; height: auto; background: white; border: 1px solid #e6dfcc; border-radius: 7px; }
.belt-reference { margin-block: 9px 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fcfaf4; }
.belt-reference :is(summary, h4) { margin: 0; color: var(--accent-ink); font-size: .9rem; font-weight: 750; }
.belt-reference summary { min-height: 32px; padding-block: 5px; cursor: pointer; }
.belt-reference-body { display: grid; grid-template-columns: minmax(0, 270px) minmax(0, 1fr); align-items: center; gap: 11px 15px; margin-top: 5px; }
.belt-reference-body p { font-size: .88rem; }
#care-editor .direction-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 8px; }
#care-editor.single-care .direction-grid { grid-template-columns: minmax(0, 390px); }
#care-description { color: var(--muted); font-size: .86rem; margin-bottom: 6px; }
.care-option { display: flex; flex-direction: column; padding: clamp(7px, 1.1vw, 12px); border-radius: 12px; background: var(--surface); overflow-wrap: anywhere; }
.care-option:has(.care-choice[aria-pressed="true"]) { border-color: #b09143; box-shadow: inset 0 0 0 1px #dbc27f; }
.care-option h3 { line-height: 1.35; }
.care-option .direction-support { margin-block: 1px 4px; line-height: 1.4; }
.care-option .direction-equipment { margin-block: 0 7px; }
.care-choice { display: grid; align-content: start; width: 100%; min-width: 0; min-height: 44px; margin-top: auto; padding: 4px; border: 1px solid #dcd4be; border-radius: 8px; color: var(--accent-ink); background: #faf8ef; font-size: .88rem; font-weight: 760; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.care-choice:hover { border-color: #b89a4a; background: var(--accent-soft); }
.care-choice[aria-pressed="true"] { border-color: #ab873a; background: #f7e7ae; }
.care-choice > :is(figure, .figure-pair, .safety-figure, svg, img) { width: 100%; min-width: 0; margin: 0; }
.care-choice > :is(svg, img) { display: block; height: auto; }
.care-choice-label { display: block; min-width: 0; padding: 8px 3px; }
.care-choice .figure-pair { align-items: stretch; }
.variants { margin-block: 11px 0; border: 1px solid var(--line); border-radius: 12px; background: #fcfaf4; }
.variants > summary { min-height: 44px; padding: 10px 13px; color: var(--accent-ink); font-size: .91rem; font-weight: 750; cursor: pointer; }
.variants[open] > summary { border-bottom: 1px solid var(--line); }
.variants > .direction-grid { padding: 9px; }
.figure-notes { margin-top: 8px; padding-top: 6px; border-top: 1px solid #eae3d1; }
.figure-notes summary { min-height: 44px; padding: 9px 2px; color: var(--accent-ink); font-size: .84rem; font-weight: 740; cursor: pointer; }
.figure-notes label { display: block; font-weight: 740; }
.figure-notes textarea, #preview-adjustment textarea { min-height: 5rem; resize: vertical; }
.supplement-safety { font-weight: 680; }
.safety-knee-figures { margin-block: 9px; }
.safety-knee-figures.figure-pair { align-items: start; gap: 10px; }
.direction-card .direction-custom { color: var(--ink); font-weight: 680; white-space: pre-line; overflow-wrap: anywhere; }
.direction-card label { margin-block: 7px 4px; font-size: .85rem; }
.editor-scene-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.editor-scene-heading h3 { font-size: 1.13rem; }
.editor-scene-heading span { color: var(--muted); font-size: .86rem; }
.figure-well { display: grid; place-items: center; border: 1px solid #e6e1d5; border-radius: 12px; background: #fffefa; overflow: hidden; }
.figure-well > svg { width: 100%; height: auto; }
.figure-legend {
  width: 100%;
  max-width: 585px;
  margin: 0;
  padding: 6px 10px 6px 1.85em;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 1.5rem;
  border-top: 1px solid var(--line);
  line-height: 1.4;
  font-size: .86rem;
}
.figure-legend li::marker { font-weight: 700; }
.print-card .figure-legend { font-size: .78rem; }
.figure-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 1px; }
.figure-pair > :is(svg, .scene-illustration) { min-width: 0; width: 100%; height: auto; }
.figure-well.figure-pair { background: #e6e1d5; }
.figure-well.figure-pair > :is(svg, .scene-illustration) { background: #fffefa; }
#editor-figure > :is(svg, .scene-illustration) { max-width: 585px; }
.figure-unavailable { padding: 30px 15px; color: var(--muted); }
.caption-field { margin-top: 12px; }

#preview-editor { padding-block: 8px 36px; }
#paper-summary { color: var(--muted); font-size: .87rem; }
.preview-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; min-height: 44px; }
.preview-header a { text-decoration: none; white-space: normal; overflow-wrap: anywhere; }
.preview-header h2 { font-size: clamp(1.05rem, 2.6vw, 1.4rem); line-height: 1.35; }
.preview-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #f2eee2; }
.preview-toolbar #print-button { margin-inline-start: auto; }
.operation-guide { margin-block: 0 14px; }
.operation-guide > summary { padding: 10px 14px; min-height: 44px; color: var(--accent-ink); font-weight: 750; cursor: pointer; }
.operation-steps { display: grid; gap: 11px; }
.operation-guide .operation-steps { padding: 0 14px 14px; }
.operation-section { border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; }
.operation-section h3 { font-size: 1.02rem; line-height: 1.4; }
.operation-location { margin-block-start: 2px; color: var(--muted); font-size: .9rem; }
.operation-section ol { margin: 5px 0 0; padding-inline-start: 1.6em; }
.operation-section li + li { margin-block-start: 2px; }
.sheet > .operation-steps { margin-top: 12px; font-size: .92rem; line-height: 1.5; }
.figure-comparison { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; align-items: start; padding: 4px; }
.figure-with-label { min-width: 0; background: white; }
.figure-with-label p { padding: 4px; color: var(--accent-ink); background: var(--accent-soft); text-align: center; font-weight: 700; font-size: .83rem; }
.print-feedback { margin-block: 6px 12px; color: #643b21; font-size: .9rem; font-weight: 670; }
.print-note-settings { margin-top: 8px; border-top: 1px solid var(--line); }
.print-note-settings summary, .scene-metadata summary { min-height: 44px; padding-block: 9px; color: var(--accent-ink); font-size: .88rem; font-weight: 740; cursor: pointer; }
.print-note-fields { display: grid; gap: 5px; padding-block-end: 8px; }
.print-note-toggle, .scene-metadata-check { display: flex; align-items: center; justify-self: start; gap: 7px; min-height: 44px; cursor: pointer; }
.print-note-toggle input, .scene-metadata-check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent-ink); }
#print-note:disabled { color: var(--muted); background: var(--background); }
#print-note-reset { justify-self: start; }
.preview-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.preview-output, .workspace-controls { min-width: 0; }
.workspace-controls { display: grid; align-content: start; gap: 8px; }
@media screen and (min-width: 1000px) {
  .preview-layout { grid-template-columns: minmax(315px, .89fr) minmax(0, 1.86fr); }
  .workspace-controls { position: sticky; top: 10px; max-height: calc(100dvh - 20px); overflow: auto; scrollbar-gutter: stable; padding: 2px; }
  .workspace-jumps a[href="#preview-heading"] { display: none; }
  .workspace-controls .scene-list { max-height: 16rem; overflow: auto; padding: 2px; }
}
.preview-settings-body { padding: 0 12px 8px; }
.preview-settings h3 { font-size: 1rem; }
.preview-list { display: grid; gap: 7px; max-height: 27rem; overflow: auto; scroll-padding-block: 6px; list-style: none; margin: 8px 0 0; padding: 4px 4px 4px 3px; }
.preview-list-empty { padding: 8px; color: var(--muted); font-size: .85rem; }
.preview-item { min-width: 0; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fcfbf7; }
.preview-item:has(.preview-select[aria-pressed="true"]) { border-color: #b49342; background: var(--accent-soft); }
.preview-select { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; min-height: 44px; padding: 3px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); background: transparent; font-size: .84rem; font-weight: 740; line-height: 1.4; text-align: left; overflow-wrap: anywhere; }
.preview-select:hover { border-color: #ddca95; background: #fbf4dd; }
.preview-select[aria-pressed="true"] { color: var(--accent-ink); }
.preview-select > span { min-width: 0; }
.preview-select > :is(.preview-thumb, img, svg) { display: block; flex: none; width: 54px; height: 38px; margin: 0; border: 1px solid var(--line); border-radius: 4px; background: white; object-fit: contain; overflow: hidden; }
.preview-thumb > :is(img, svg) { width: 100%; height: 100%; object-fit: contain; }
.preview-select > .preview-thumb { display: grid; place-items: center; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 1px 1px; }
.preview-actions button { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 5px; border: 1px solid var(--line); border-radius: 6px; color: var(--accent-ink); background: var(--surface); font-size: .78rem; font-weight: 750; line-height: 1.3; white-space: normal; }
.preview-actions button:hover:not(:disabled) { border-color: #c6ad68; background: var(--accent-soft); }
#preview-adjustment { display: grid; gap: 5px; margin-top: 12px; }
#preview-adjustment label { font-size: .88rem; font-weight: 750; }
#preview-adjustment p { color: var(--muted); font-size: .83rem; }
#preview-scroll-to { justify-self: start; }
.scene-metadata { margin-block: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.scene-metadata-fields { display: grid; min-width: 0; gap: 6px; padding-block-end: 10px; }
.scene-metadata-fields > label, .scene-metadata-checks legend, .scene-metadata-references h4 { font-size: .88rem; font-weight: 750; }
.scene-metadata-fields select {
  appearance: none;
  min-width: 0;
  min-height: 44px;
  padding-inline-end: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent-ink) 50%), linear-gradient(135deg, var(--accent-ink) 50%, transparent 50%);
  background-position: right 15px center, right 10px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.scene-metadata-fields textarea { min-height: 5rem; resize: vertical; }
@media (forced-colors: active) {
  .scene-metadata-fields select { appearance: auto; }
}
.scene-metadata-references ul { margin: 4px 0; padding-inline-start: 1.2em; font-size: .85rem; }
.scene-metadata-references li + li { margin-block-start: 5px; }
.scene-metadata-references p { margin: 0; color: var(--muted); font-size: .82rem; }
.scene-metadata-checks { display: grid; margin: 4px 0 0; min-width: 0; padding: 0; border: 0; }
.paper-pages { display: grid; justify-items: center; gap: 22px; }
.sheet { width: min(100%, 210mm); min-height: 297mm; padding: 12mm; background: white; color: #212121; border: 1px solid #ded9cd; border-radius: 4px; box-shadow: 0 4px 18px #43360919; overflow-wrap: anywhere; }
.sheet-header { border-bottom: 1.5px solid #242424; padding-bottom: 3.5mm; }
.sheet-header h2 { font-size: 1.65rem; line-height: 1.3; }
.sheet-header p { font-size: .85rem; margin-top: 5px; }
.sheet-header .sheet-start-check { font-weight: 660; line-height: 1.4; }
.sheet .care-note { margin-top: 4mm; font-size: .93rem; line-height: 1.45; break-inside: avoid; }
.sheet .care-note-layout { grid-template-columns: minmax(0, 54mm) minmax(0, 1fr); align-items: center; gap: 3mm; }
.sheet .care-note-layout.care-note-text-only { grid-template-columns: minmax(0, 1fr); }
.sheet .care-note-figure > :is(svg, .scene-illustration) { border: 0; }
.sheet .care-note-layout p { white-space: normal; }
.sheet.directions-sheet .direction-grid { margin-top: 3mm; gap: 4mm; }
.sheet.directions-sheet .direction-card { border-color: #777; }
.sheet.directions-sheet .direction-card p { white-space: normal; }
.sheet.stacked-supplements .direction-grid { grid-template-columns: minmax(0, 1fr); }
.sheet.stacked-supplements .direction-card { width: 100%; }
.sheet.knee-sheet .safety-knee-figures { grid-template-columns: minmax(0, 1fr); width: min(100%, 133mm); margin-inline: auto; gap: 3mm; }
.sheet.knee-sheet .care-note p { white-space: normal; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4mm; margin-top: 4mm; }
.sheet-grid.is-single, .sheet-grid.is-brief { grid-template-columns: minmax(0, 1fr); }
.sheet-grid.is-brief .care-note { margin-top: 0; }
.brief-prep-figure { width: min(100%, 88mm); margin-inline: auto; }
.print-card { margin: 0; padding: 2.1mm; border: 1px solid #777; border-radius: 6px; break-inside: avoid; }
.print-card.is-wide { grid-column: 1 / -1; }
.print-card h3 { display: flex; align-items: baseline; gap: .5em; font-size: .99rem; line-height: 1.35; }
.print-card h3 span { flex: none; }
.print-card svg { width: 100%; height: auto; }
.print-card figcaption { font-size: .88rem; line-height: 1.45; white-space: pre-line; }
.sheet-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 4mm; padding-top: 2mm; border-top: 1px solid #777; font-size: .78rem; }
.sheet-footer span { flex: none; margin-inline-start: auto; }
.empty-state { padding: 28px; text-align: center; color: var(--muted); }

.tablet-view { max-width: 890px; margin-inline: auto; padding: clamp(16px, 3vw, 25px); }
.tablet-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 9px; }
.tablet-heading h3 { font-size: clamp(1.15rem, 3vw, 1.7rem); overflow-wrap: anywhere; }
.tablet-heading p { color: var(--muted); }
.tablet-section h3 { margin-bottom: 5px; font-size: 1.15rem; }
.tablet-section > .care-note { margin-block: 10px 14px; }
.tablet-condition { color: var(--muted); font-size: .88rem; }
.start-check { font-weight: 640; }
:is(.tablet-view .start-check, .tablet-view .supplement-safety, .figure-notes .supplement-safety) { margin-block-start: 7px; padding: 6px 10px; border-left: 3px solid #c6a447; background: var(--accent-soft); font-size: .9rem; }
#tablet-knee-note { white-space: pre-line; overflow-wrap: anywhere; }
#tablet-scene-title { margin-block: 12px 9px; font-size: clamp(1.15rem, 3vw, 1.45rem); overflow-wrap: anywhere; }
#tablet-figure > :is(svg, .scene-illustration) { max-width: min(100%, 700px); }
.tablet-caption { margin-block: 12px 16px; font-size: clamp(1.05rem, 3vw, 1.45rem); font-weight: 680; overflow-wrap: anywhere; white-space: pre-line; }
.tablet-caption.is-care-note { padding: 14px 17px; border: 1px solid #d9c58a; border-radius: 9px; background: var(--accent-soft); }
#tablet-details:not(:empty) { margin-bottom: 12px; }
.tablet-navigation { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-bottom: 13px; }
.tablet-navigation button { min-height: 48px; min-width: 95px; }
.tablet-jump { display: grid; gap: 4px; min-width: 0; }
.tablet-jump label { color: var(--muted); font-size: .86rem; font-weight: 740; }
.tablet-jump select { min-width: 0; max-width: 100%; min-height: 48px; padding: 6px 24px 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--surface); }

.distribution-note { margin: 0 3px; font-size: .82rem; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); background: #fffef9; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 25px; row-gap: 10px; padding-block: 18px; font-size: .86rem; }
.footer-name { font-weight: 800; }
.footer-links { display: flex; flex-wrap: wrap; gap: 7px 15px; }
.sister-sites { padding-block: 2px 28px; }
.sister-sites h2 { margin-bottom: 10px; font-size: 1.05rem; }
.sister-sites-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sister-site { display: flex; align-items: center; gap: 10px; min-height: 76px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.sister-site:hover { border-color: var(--line-strong); background: var(--accent-soft); }
.sister-site img { display: block; flex: none; width: 60px; height: 60px; border-radius: 12px; }
.sister-site strong, .sister-site > span > span { display: block; }
.sister-site > span > span { color: var(--muted); font-size: .85rem; line-height: 1.4; }
.site-info { max-width: 760px; margin-block: clamp(22px, 6vw, 68px); }
.site-info-card { padding: clamp(18px, 4.5vw, 42px); background: linear-gradient(#fff8de, var(--surface) 205px); }
.site-info-card h1 { margin-bottom: 16px; font-size: clamp(1.5rem, 4.8vw, 2.25rem); line-height: 1.34; }
.site-info-card p { margin-block: 0 13px; }
.site-info-card .contact-privacy { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf7ea; font-size: .9rem; }
.site-info-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.site-info-actions a { max-width: 100%; text-decoration: none; white-space: normal; }
.usage-guide { margin-top: 16px; scroll-margin-top: 12px; }
.usage-guide h2 { margin-bottom: 12px; font-size: clamp(1.3rem, 4vw, 1.75rem); }
.usage-purpose { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff9e7; }
.usage-purpose p:last-child { margin-bottom: 0; }
.usage-steps { margin: 16px 0 0; padding-inline-start: 1.55em; }
.usage-steps li + li { margin-top: 12px; }
.usage-steps li::marker { color: var(--accent-ink); font-weight: 750; }
.usage-steps h3 { font-size: 1rem; }
.usage-steps p { margin: 3px 0 0; }
.draft-controls { margin-top: 16px; background: var(--surface); }
.draft-controls h2 { margin-bottom: 8px; font-size: 1.2rem; }
.draft-controls #draft-feedback { margin: 8px 0 0; }
.draft-privacy { color: var(--muted); font-size: .8rem; }
.references { margin-left: auto; }
.references[open] { flex: 1 0 100%; }
.references summary { color: var(--accent-ink); cursor: pointer; }
.references ul { padding-left: 1.4em; }
.references p { color: var(--muted); }

@media screen {
  #preview-editor .is-preview-active { outline: 2px solid #af893c; outline-offset: 2px; }
  body:not(.is-tablet-presenting) #tablet-close { display: none; }
  .is-tablet-presenting :is(.site-nav, .storage-status, .workspace-head, .workspace-controls, .preview-header, .site-footer) { display: none; }
  .is-tablet-presenting #preview-editor { margin-block: 15px 20px; padding: 0; }
  .is-tablet-presenting .preview-layout { grid-template-columns: minmax(0, 1fr); }
}

@media screen and (orientation: landscape) and (min-width: 850px) {
  .is-tablet-presenting .tablet-scene:has(> #tablet-figure:not([hidden], .figure-pair)) {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
  }
  .is-tablet-presenting .tablet-scene:has(> #tablet-figure:not([hidden], .figure-pair)) .tablet-caption {
    margin-block-start: 0;
  }
}

@media screen and (max-width: 999px) {
  .preview-list { max-height: 18rem; }
}

@media screen and (min-width: 591px) and (max-width: 999px) {
  .settings-panel { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); }
  .work-area { grid-template-columns: minmax(196px, .8fr) minmax(0, 1.2fr); }
  .editor-panel { padding: 0 0 0 12px; border-top: 0; border-inline-start: 1px solid var(--line); }
  #care-editor:not(.single-care) .direction-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media screen and (max-width: 820px) {
  .page-width { width: calc(100% - 32px); }
  .site-header-inner { padding-inline: 16px; gap: 22px; }
  .intro { gap: 14px; padding-block: 18px 15px; }
  .wide-break { display: none; }
}

@media screen and (max-width: 590px) {
  .page-width { width: calc(100% - 24px); }
  .workspace-jumps { display: grid; grid-template-columns: repeat(auto-fit, minmax(66px, 1fr)); }
  .workspace-jumps a { justify-content: center; margin-inline: 0; padding-inline: 3px; font-size: .76rem; text-align: center; }
  .workspace-jumps a:last-child { margin-inline-start: 0; }
  .site-header-inner { min-height: 60px; padding-inline: 12px; gap: 8px; }
  .site-nav { gap: 2px; }
  .site-nav a { padding-inline: 4px; font-size: .75rem; }
  .brand-name { font-size: 1.04rem; }
  .brand-icon { width: 35px; height: 35px; }
  .scene-picker { padding-block: 14px 28px; }
  .home-hero { grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); gap: 8px; padding: 12px; border-radius: 19px; }
  .home-heading { padding-inline-start: 1px; }
  .home-heading h1 { margin-bottom: 6px; font-size: clamp(1.4rem, 5.4vw, 2rem); line-height: 1.16; }
  .home-heading p { font-size: .875rem; line-height: 1.45; }
  .home-hero-image { padding: 3px; border-radius: 11px; }
  .home-hero-image img { border-radius: 7px; }
  .sister-sites-grid { grid-template-columns: minmax(0, 1fr); }
  .scene-categories-heading { margin: 16px 0 8px; }
  .scene-categories { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .scene-category { border-radius: 12px; }
  .scene-category > summary { grid-template-columns: min(28vw, 104px) minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 9px 5px 5px; }
  .category-image { grid-column: auto; border-radius: 8px; }
  .category-copy { min-height: 0; padding-inline-start: 0; }
  .category-toggle { width: 26px; height: 26px; }
  .category-content { padding: 8px; }
  .intro { align-items: stretch; flex-direction: column; gap: 9px; padding-block: 6px 11px; }
  .intro-condition { padding-inline: 9px; }
  .storage-status { display: none; }
  .settings-panel { gap: 9px; padding: 10px; }
  .format-bar { grid-template-columns: auto 1fr; column-gap: 10px; }
  .format-hint { grid-column: 1 / -1; font-size: .8rem; }
  #preview-editor { padding-block-start: 12px; }
  .preview-header { gap: 9px; margin-bottom: 10px; }
  .preview-header a { padding-inline: 9px; }
  .preview-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 5px; }
  .preview-toolbar .view-switch { grid-column: 1 / -1; }
  .view-switch { justify-content: stretch; }
  .view-switch button { flex: 1 1 0; min-width: 0; padding-inline: 4px; font-size: .85rem; }
  .view-switch svg { display: none; }
  .preview-toolbar #print-button { margin-inline-start: 0; }
  .preview-toolbar > button { min-width: 0; padding-inline: 4px; font-size: .85rem; white-space: normal; }
  .care-option h3 { font-size: .9rem; }
  .care-option .direction-support { font-size: .84rem; }
  .care-option .direction-equipment { font-size: .76rem; }
  .care-choice { font-size: .8rem; }
  .scene-panel-heading { align-items: baseline; margin-bottom: 8px; padding-inline: 1px 0; }
  .scene-panel-heading > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; }
  .scene-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #brief-scene-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scene-row { min-height: 44px; }
  .scene-row label { width: 31px; }
  .scene-row button { font-size: .82rem; }
  .brief-scene-row button { padding-inline: 6px; text-align: center; }
  .figure-well.figure-pair { grid-template-columns: minmax(0, 1fr); }
  .figure-comparison { grid-template-columns: minmax(0, 1fr); }
  .sheet { min-height: 0; padding: 12px; }
  .sheet-header h2 { font-size: 1.2rem; }
  .sheet-grid, .sheet.directions-sheet .direction-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .print-card { padding: 5px; }
  .print-card h3, .print-card figcaption { font-size: .75rem; }
  .tablet-heading { flex-wrap: wrap; }
  .tablet-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .tablet-navigation button { min-width: 0; padding-inline: 5px; }
  .tablet-jump { grid-column: 1 / -1; grid-row: 1; }
  .care-note-layout { grid-template-columns: minmax(0, 1fr); }
  .tablet-section .direction-grid, .safety-knee-figures.figure-pair { grid-template-columns: minmax(0, 1fr); }
  .belt-reference-body { grid-template-columns: minmax(0, 1fr); }
  .sheet .care-note-layout { grid-template-columns: minmax(0, 36%) minmax(0, 1fr); }
  .references { margin-left: 0; }
}

@media screen and (max-width: 350px) {
  .scene-category > summary { grid-template-columns: 76px minmax(0, 1fr) auto; }
}

@page { size: A4 portrait; margin: 12mm; }
@media print {
  body { background: white; }
  .screen-only, .skip-link { display: none !important; }
  #main { width: auto; }
  #preview-editor, .preview-layout, .preview-output { display: block; margin: 0; padding: 0; }
  #paper-view, #paper-view[hidden], .paper-pages { display: block !important; }
  .sheet { width: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; break-after: page; }
  .sheet:last-child { break-after: auto; }
  .sheet-header { padding-bottom: 2.5mm; break-after: avoid; }
  .sheet-header h2 { font-size: 1.45rem; }
  .sheet .care-note { margin-top: 3mm; padding: 1.8mm 2.4mm; color: #212121; background: white; border-color: #505050; }
  .sheet .care-note h3 { color: inherit; }
  .sheet .care-note-layout { grid-template-columns: minmax(0, 48mm) minmax(0, 1fr); }
  .sheet .care-note-layout p { font-size: .86rem; line-height: 1.35; }
  .sheet .care-note-layout .care-figure-caption { margin-block: .8mm 0; }
  .sheet-grid { gap: 3mm; margin-top: 3mm; }
  .sheet-grid:not(.is-single) .print-card > div { width: min(100%, 70mm); margin-inline: auto; }
  .sheet-grid .print-card.is-wide > div { width: min(100%, 125mm); margin-inline: auto; }
  .sheet-grid .print-card.is-wide > .figure-comparison { width: 100%; }
  .figure-with-label p { color: #222; border: 1px solid #bbb; border-bottom: 0; background: white; }
  .sheet > .operation-steps { gap: 2.8mm; font-size: 10pt; }
  .operation-section { border-color: #aaa; break-inside: avoid; }
  .sheet-grid:has(> .print-card.is-wide ~ .print-card.is-wide) .print-card.is-wide > div { width: min(100%, 110mm); }
  .sheet-grid.is-brief .print-card > div { width: min(100%, 80mm); }
  .sheet-grid.is-brief .print-card > .figure-pair { width: min(100%, 160mm); }
  .print-card figcaption { white-space: normal; }
  .print-card .scene-illustration.is-portrait { max-height: 160mm; }
  .sheet.directions-sheet .direction-grid { gap: 3mm; }
  .sheet.directions-sheet .direction-card { padding: 1.4mm 2mm; }
  .sheet.stacked-supplements .direction-grid:has(> .direction-card + .direction-card) .safety-figure { width: min(100%, 105mm); margin-inline: auto; }
  .sheet.stacked-supplements .direction-grid:has(> .direction-card + .direction-card) .safety-figure.figure-pair { width: min(100%, 170mm); }
  .sheet.directions-sheet:has(.belt-reference) .direction-card:only-child .safety-figure { width: min(100%, 100mm); margin-inline: auto; }
  .sheet.directions-sheet .direction-card p { margin-block: 3px; font-size: .82rem; line-height: 1.35; }
  .sheet.directions-sheet .direction-card .direction-support { color: #212121; font-size: .9rem; }
  .sheet .belt-reference { margin-block: 2mm; padding: 1.5mm 2mm; background: white; border-color: #777; break-inside: avoid; }
  .sheet .belt-reference h4 { color: #212121; }
  .sheet .belt-reference-body { grid-template-columns: minmax(0, 55mm) minmax(0, 1fr); gap: 3mm; margin-top: 1mm; }
  .sheet .belt-reference-body > .safety-figure > img { border-color: #777; }
  .sheet.knee-sheet .safety-knee-figures > :is(svg, .scene-illustration) { border-color: #777; }
  .sheet :is(svg, .scene-illustration) { filter: grayscale(1); print-color-adjust: exact; }
  .sheet-footer { margin-top: 3mm; break-inside: avoid; }
}
