:is(#inputViewBar,#otherInputViewBar){display:flex;align-items:center;justify-content:center;gap:10px;padding:12px;background:var(--surface);border-bottom:1px solid var(--border);flex-wrap:wrap}
:is(#inputViewBar,#otherInputViewBar)[hidden],:is(#guidedInput,#otherGuidedInput)[hidden]{display:none}
:is(#inputViewBar,#otherInputViewBar) button,:is(#guidedInput,#otherGuidedInput) button{font:inherit;border:1px solid var(--border);border-radius:10px;padding:10px 18px;background:var(--card);color:var(--text);cursor:pointer;min-height:44px}
:is(#inputViewBar,#otherInputViewBar) button[aria-pressed=true],:is(#wizardNext,#otherWizardNext){background:var(--accent)!important;color:white!important}
:is(#guidedInput,#otherGuidedInput){overflow:auto;flex:1;padding:32px 16px;background:var(--bg)}
.wizard-card{max-width:660px;margin:0 auto;background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:32px;box-shadow:0 8px 30px #00000008}
:is(#wizardTitle,#otherWizardTitle){font-size:clamp(22px,4vw,30px);line-height:1.5;margin:24px 0 12px}
:is(#wizardHelp,#otherWizardHelp){color:var(--muted);line-height:1.8;font-size:15px}
.wizard-progress-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:10px;flex-wrap:wrap}
:is(#wizardProgress,#otherWizardProgress){margin:0;color:var(--text);font-size:clamp(18px,3vw,24px);font-weight:800;letter-spacing:.02em}
.wizard-step-total{flex:0 0 auto;padding:7px 13px;border-radius:999px;background:color-mix(in srgb,var(--accent) 12%,var(--surface));border:1px solid color-mix(in srgb,var(--accent) 32%,var(--border));color:var(--accent);font-size:13px;line-height:1.2;white-space:nowrap}
.wizard-privacy{color:var(--muted);font-size:12px}
:is(#wizardMeter,#otherWizardMeter){display:block;width:100%;height:12px;border:0;border-radius:999px;overflow:hidden;appearance:none;accent-color:var(--accent);background:var(--inp)}
:is(#wizardMeter,#otherWizardMeter)::-webkit-progress-bar{background:var(--inp);border-radius:999px}
:is(#wizardMeter,#otherWizardMeter)::-webkit-progress-value{background:var(--accent);border-radius:999px}
:is(#wizardMeter,#otherWizardMeter)::-moz-progress-bar{background:var(--accent);border-radius:999px}
:is(#wizardField,#otherWizardField){display:flex;align-items:center;gap:12px;margin-top:24px}
:is(#wizardField,#otherWizardField)>span{flex:none;white-space:nowrap}
:is(#wizardField,#otherWizardField) input,:is(#wizardField,#otherWizardField) select{min-width:0;width:100%;font:inherit;font-size:22px;padding:16px;border:1px solid var(--border);border-radius:12px;background:var(--inp);color:var(--text)}
:is(#wizardError,#otherWizardError){color:var(--red);min-height:24px;line-height:1.6}
.wizard-actions{display:flex;justify-content:space-between;gap:16px;margin:20px 0 28px}
:is(#guidedInput,#otherGuidedInput) button:disabled{opacity:.4;cursor:default}
:is(#guidedInput,#otherGuidedInput) details{border-top:1px solid var(--border);padding-top:16px}
:is(#guidedInput,#otherGuidedInput) summary{cursor:pointer;font-size:14px}
:is(#wizardSummary,#otherWizardSummary){display:grid;grid-template-columns:1fr 1fr;gap:10px;font-size:14px;line-height:1.6}
:is(#wizardSummary,#otherWizardSummary) dd{margin:0;overflow-wrap:anywhere}
body.guided-forward .layout>aside{display:none!important}
body.guided-forward .layout:has(#resultArea[style*="display: none"]){display:none!important}
body.guided-forward .layout:has(#resultArea[style*="display:none"]){display:none!important}
body.guided-forward #menuBtn{display:none}
@media(max-width:600px){:is(#guidedInput,#otherGuidedInput){padding:16px 10px}.wizard-card{padding:22px 18px}.wizard-progress-head{gap:10px}.wizard-step-total{padding:6px 10px;font-size:12px}:is(#inputViewBar,#otherInputViewBar){font-size:12px;gap:6px}:is(#inputViewBar,#otherInputViewBar) button{padding:8px 10px}}
@media print{:is(#inputViewBar,#otherInputViewBar),:is(#guidedInput,#otherGuidedInput){display:none!important}}

body.other-guided-input #reverseMode,body.other-guided-input #shakaiMode{display:none!important}
body.other-guided-result #reverseAside,body.other-guided-result #shakaiAside{display:none!important}
body.other-guided-result #reverseMode>div,body.other-guided-result #shakaiMode>div{width:100%;min-width:0}
#otherEdit[hidden]{display:none}

/* Guided input: a visible, progressively confirmed summary. */
#inputViewBar button[hidden]{display:none}
:is(#guidedInput,#otherGuidedInput) .wizard-grid{display:grid;grid-template-columns:minmax(0,660px) minmax(240px,320px);gap:24px;max-width:1004px;margin:auto;align-items:start}
:is(#guidedInput,#otherGuidedInput) .wizard-card{box-sizing:border-box;width:100%;min-width:0;margin:0}
:is(#guidedInput,#otherGuidedInput) .wizard-summary{position:sticky;top:0;padding:24px}
:is(#wizardSummary,#otherWizardSummary){grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
#otherWizardSummary{grid-template-columns:minmax(0,1fr) auto}
:is(#wizardSummary,#otherWizardSummary)>p{grid-column:1/-1}
:is(#wizardField,#otherWizardField){align-items:start}
#wizardField{flex-wrap:wrap}
:is(#wizardField,#otherWizardField)>label,.wizard-period-fields>label{display:block;flex:1 1 200px;min-width:0;font-size:14px}
:is(#wizardField,#otherWizardField)>label:only-child{flex-basis:100%}
.wizard-period-fields{display:flex;flex:1 0 100%;flex-wrap:wrap;align-items:start;gap:12px;min-width:0}
.wizard-field-row{display:flex;align-items:center;gap:12px;margin-top:8px}
.wizard-field-row>.wizard-unit{flex:0 0 auto;font-size:24px;font-weight:700;line-height:1;white-space:nowrap}
.wizard-single-row{flex:1 0 100%;margin-top:0;max-width:570px}
.wizard-single-row>input{flex:1 1 auto;width:auto!important}
.wizard-detail-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;flex:1 0 100%;min-width:0;max-width:570px}
.wizard-detail-fields>label{font-size:14px;min-width:0}
.wizard-detail-fields .wizard-field-row>input{flex:1 1 auto;width:auto!important}
.wizard-options{border:0;padding:0;margin:0;width:100%;min-width:0;display:grid;gap:12px}
.wizard-option{border:1px solid var(--border);border-radius:12px;background:var(--card);padding:16px}
.wizard-option:has(input:checked){border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.wizard-option label{display:flex;gap:12px;align-items:start;cursor:pointer}
:is(#wizardField,#otherWizardField) .wizard-option input[type=radio]{width:20px;height:20px;flex:0 0 20px;padding:0;margin:3px 0;accent-color:var(--accent)}
.wizard-option strong,.wizard-option label span span{display:block}
.wizard-option label span span{font-size:14px;color:var(--muted);line-height:1.7;margin-top:6px}
.wizard-source{margin:10px 0 0 32px;font-size:12px;line-height:1.8}
.wizard-index-details{margin:12px 0 0 32px!important;padding:0!important;border:0!important}
.wizard-index-details>summary{display:inline-block;color:var(--accent);font-size:12px;text-decoration:underline;cursor:pointer;list-style:none}
.wizard-index-details>summary::-webkit-details-marker{display:none}
.wizard-index-details>summary::before{content:'＋ ';text-decoration:none}
.wizard-index-details[open]>summary::before{content:'－ '}
.wizard-index-chart{margin:8px 0 0;padding:10px 12px 6px;background:var(--inp);border-radius:10px;overflow:hidden}
.wizard-index-chart figcaption{font-size:11px;color:var(--muted);line-height:1.5;margin-bottom:4px}
.wizard-index-chart svg{display:block;width:100%;height:122px;overflow:visible}
.wizard-index-zero{stroke:var(--border);stroke-width:1}
.wizard-index-positive{fill:var(--accent)}
.wizard-index-negative{fill:var(--red)}
.wizard-cumulative-line{fill:none;stroke:var(--dim);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;opacity:.8;pointer-events:none}
.wizard-cumulative-line.is-selected{stroke:var(--accent);stroke-width:4;opacity:1}
.wizard-cumulative-point{fill:var(--accent);opacity:0;pointer-events:all}
.wizard-cumulative-point:hover,.wizard-cumulative-point:focus{opacity:1}
.wizard-annual-details{margin:10px 0 0!important;padding:8px 0 0!important;border-top:1px solid var(--border)!important}
.wizard-annual-details>summary{color:var(--muted)!important;font-size:11px!important;text-decoration:underline}
.wizard-annual-details figure{margin:8px 0 0;padding:8px 10px 4px;background:var(--inp);border-radius:8px;overflow:hidden}
.wizard-annual-details figcaption{font-size:11px;color:var(--muted);margin-bottom:4px}
.wizard-annual-details svg{display:block;width:100%;height:96px}
.wizard-index-static{margin:12px 0 0 32px;padding:10px 12px;background:var(--inp);border-radius:10px;color:var(--muted);font-size:12px;line-height:1.6}
#wizardReferences{display:grid;gap:8px;font-size:13px;margin-top:16px}
:is(#guidedInput,#otherGuidedInput) a{color:var(--accent);text-decoration:underline;overflow-wrap:anywhere}
#otherWizardReferences{display:grid;gap:8px;font-size:13px;margin-top:16px}
.wizard-period-note{flex-basis:100%;font-size:14px;line-height:1.8;background:var(--inp);padding:12px;border-radius:10px}
.wizard-period-chart{flex:1 0 100%;box-sizing:border-box;margin-top:4px;padding:16px;background:var(--card);border:1px solid var(--border);border-radius:12px}
.wizard-period-chart h3{font-size:16px;margin:0 0 4px}
.wizard-period-chart-help{font-size:12px;color:var(--muted);line-height:1.6;margin:0 0 10px}
.wizard-period-chart figure{margin:0;padding:10px 12px 4px;background:var(--inp);border-radius:10px;overflow:hidden}
.wizard-period-chart figcaption{font-size:11px;color:var(--muted);line-height:1.5;margin-bottom:4px}
.wizard-period-chart svg{display:block;width:100%;height:132px}
.wizard-period-chart svg.is-clickable{cursor:crosshair}
.wizard-period-band{fill:var(--accent);opacity:.09;pointer-events:none}
.wizard-period-bar{fill:var(--dim);opacity:.3;transition:opacity .12s,fill .12s}
.wizard-period-bar.is-selected{opacity:1}
.wizard-period-bar.is-selected.is-positive{fill:var(--accent)}
.wizard-period-bar.is-selected.is-negative{fill:var(--red)}
.wizard-period-year-label{fill:var(--text);font-size:12px;font-weight:700;pointer-events:none}
:is(#wizardField,#otherWizardField) :is(#wizardPeriodRange,#otherWizardPeriodRange){box-sizing:border-box;width:100%;padding:0;margin:12px 0 0;min-height:32px;accent-color:var(--accent);cursor:ew-resize}
.wizard-age-table{width:100%;border-collapse:collapse;font-size:14px}
.wizard-age-table th,.wizard-age-table td{padding:8px;border-bottom:1px solid var(--border);text-align:left}
.wizard-age-table th[scope=row]{width:25%}
#wizardField .wizard-age-table input{box-sizing:border-box;font-size:18px;padding:10px}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:850px){:is(#guidedInput,#otherGuidedInput) .wizard-grid{grid-template-columns:minmax(0,660px);justify-content:center}:is(#guidedInput,#otherGuidedInput) .wizard-summary{position:static}:is(#wizardField,#otherWizardField)>label,.wizard-period-fields>label{flex-basis:100%}.wizard-index-details,.wizard-index-static{margin-left:0!important}}
@media(max-width:600px){.wizard-detail-fields,.wizard-single-row{max-width:none}}
