/* Mobile-first. 112.5% of the browser's default 16px is 18px; respect larger user defaults. */
:root{font-family:system-ui,-apple-system,"Noto Sans JP",sans-serif;font-size:112.5%;color:#183330;background:#f4f6f2;font-synthesis:none;line-height:1.85}
*{box-sizing:border-box}
body{margin:0;overflow-wrap:anywhere}
a{color:#11614e;text-underline-offset:.22em;text-decoration-thickness:.08em}
a:hover{color:#092e25}
header,main,footer{max-width:1100px;margin:auto;padding:20px}
header{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px 20px;align-items:center}
header a,.card a,.crumb a,.notes a{display:inline-flex;align-items:center;min-height:48px;padding-block:8px}
.brand{font-size:1.5rem;font-weight:850;letter-spacing:-.02em;text-decoration:none}
.brand span{display:none}
.preview{background:#e7eddf;border-bottom:1px solid #c9d4c1;text-align:center;padding:12px 20px;font-size:1rem}
.eyebrow{font-size:1rem;color:#445e51;letter-spacing:.05em;font-weight:700}
h1{font-size:clamp(1.8rem,5vw,2.7rem);line-height:1.45;letter-spacing:-.02em;margin:12px 0 20px}
h2{font-size:1.4rem;line-height:1.55}
.lead{color:#445e51;max-width:700px}
.hero{padding:20px 0 32px}
.cards,.layout,.fields{display:grid;grid-template-columns:minmax(0,1fr);gap:24px}
.card,.panel{min-width:0;border:1px solid #c4d0c1;border-radius:18px;background:white;padding:20px}
.card{display:flex;flex-direction:column}
.card h2{margin:10px 0}
.card p{font-size:1rem;color:#445e51}
.card a{margin-top:auto;font-weight:700}
.layout{align-items:start}
.fields{gap:22px}
label{display:block;font-size:1rem;font-weight:650;line-height:1.65}
input,select,textarea{width:100%;max-width:100%;min-width:0;min-height:52px;font:inherit;background:#fbfcfa;border:1px solid #738d7c;border-radius:8px;padding:12px;color:inherit;margin-top:8px}
input{font-size:1.1112rem;font-variant-numeric:tabular-nums}
select{font-size:1rem}
button{max-width:100%;font:inherit;font-weight:700;line-height:1.6;white-space:normal;overflow-wrap:anywhere;cursor:pointer;border:0;border-radius:9px;min-height:52px;padding:14px 20px;background:#175b47;color:white}
button.secondary{background:#e7eee8;color:#294a3d}
button:disabled{opacity:.5;cursor:default}
.actions{display:flex;flex-direction:column;gap:14px;margin-top:24px}
:focus-visible{outline:3px solid #a96104;outline-offset:4px}
.help{font-size:1rem;color:#445e51}
.error{color:#922020;font-size:1rem;font-weight:650}
.result{border-color:#8aab93;background:#f7fbf4}
.result:focus{outline:3px solid #175b47;outline-offset:3px}
dl{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;font-size:1rem}
dt{margin-top:16px}
dd{font-size:1.3334rem;font-weight:750;line-height:1.55;margin:0 0 8px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
dt:first-child{font-size:1.1112rem;color:#0e553e}
dt:first-child+dd{font-size:1.5556rem;color:#0e553e}
textarea{font-size:1rem;min-height:240px;resize:vertical;line-height:1.8}
.notes{margin-top:36px;max-width:900px}
.notes p{font-size:1rem}
.crumb{font-size:1rem}
footer{font-size:1rem;color:#445e51;border-top:1px solid #d7dfd5;margin-top:48px}
fieldset{border:0;padding:0;margin:0;min-width:0}
.settings{margin-top:24px;border:1px solid #b5c4b6;border-radius:10px;padding:4px 14px;background:#f7faf4}
summary{min-height:52px;padding:12px 0;font-size:1rem;font-weight:650;cursor:pointer;line-height:1.6}
.settings label{margin:4px 0 16px}
.skip{position:absolute;left:10px;top:-200px}
.skip:focus{top:10px;background:white;padding:12px;z-index:5}
[hidden]{display:none!important}
@media(min-width:60rem){
 header,main,footer{padding:24px}
 .brand span{display:inline;font-size:1rem;color:#445e51;letter-spacing:.05em;margin-left:14px}
 .cards{grid-template-columns:repeat(3,minmax(0,1fr))}
 .layout{grid-template-columns:minmax(0,1fr)}
 .panel,.card{padding:26px}
 .fields{grid-template-columns:repeat(2,minmax(0,1fr))}
 .actions{flex-direction:row;flex-wrap:wrap}
}
@media(max-width:22rem){header,main,footer{padding-inline:14px}.panel,.card{padding:16px}}

/* Clear input/result/explanation hierarchy without reducing mobile type sizes. */
.service-badge{display:inline-block;background:#143f38;color:#fff;border-radius:100px;padding:8px 18px;font-size:1rem;font-weight:750;margin:0 0 14px}
.section-number{font-size:1rem;letter-spacing:.08em;font-weight:800;color:#445e51;margin:0 0 4px}
.input-panel{box-shadow:0 8px 24px #1833300c}
.result{background:#f0f8ec;box-shadow:0 8px 24px #18333012}
.notes{background:#e9eee6;padding:24px;border-radius:18px;border:1px solid #c4d0c1}
.card{transition:border-color .15s}
.card:hover{border-color:#175b47}
.comparison{margin-top:28px;background:#f6f9fc}
.comparison-card{padding:20px 0;border-bottom:1px solid #b6c6d4}
.comparison-card h3{font-size:1.2rem;color:#213e58}
.comparison-card .help{max-height:none}
@media(max-width:30rem){.notes{padding:18px}}

.field-heading{grid-column:1/-1;font-size:1.15rem;border-bottom:2px solid #c4d0c1;padding:12px 0 8px;margin:12px 0 0;color:#174d40}

.comparison-table-wrap{overflow-x:auto;max-width:100%;border:1px solid #b6c6d4;border-radius:10px;margin-block:20px}
.comparison-table{border-collapse:collapse;min-width:34rem;width:100%;font-size:1rem}
.comparison-table caption{text-align:left;font-weight:750;padding:14px}
.comparison-table th,.comparison-table td{border:1px solid #b6c6d4;padding:14px;text-align:left;vertical-align:top}
.comparison-table th{background:#e6eef5}.comparison-table td{font-variant-numeric:tabular-nums}

.local-save{margin-top:28px;background:#fffdf4}
@media print{
 body{background:white;color:black;font-size:12pt}
 header,footer,.preview,.hero,.crumb,.input-panel,.notes,.local-save,.comparison,button,.skip{display:none!important}
 main{max-width:none;padding:0}.layout{display:block}.result{border:0;box-shadow:none;background:white;padding:0}
 .result textarea{height:auto;min-height:0;overflow:visible}.result dl{display:none}
 body[data-print="comparison"] .result{display:none!important}
 body[data-print="comparison"] .comparison{display:block!important;border:0;background:white;padding:0}
 .comparison-table-wrap{overflow:visible;border:0}.comparison-table{min-width:0;font-size:11pt}
 .comparison-card{break-inside:avoid}.comparison-card .actions,#comparison-report{display:none!important}
}

.result-note{display:block;font-size:1rem;font-weight:400;color:#445e51;margin-top:8px}
@media print{.result #report,.result label,.result .help,#copy-status{display:none!important}.result #print-summary{display:block!important;white-space:pre-wrap;font-size:11pt;line-height:1.6}}

.condition-group{grid-column:1/-1;border:1px solid #b5c4b6;border-radius:10px;background:#f7faf4;padding:4px 14px}
.condition-group .fields{padding-block:12px 18px}
.group-summary{display:block;font-size:1rem;font-weight:400;color:#445e51;line-height:1.65;margin-top:4px}
.early-calculate{width:100%;margin-top:6px}.compact-help{margin:10px 0 24px}
.result-breakdown,.report-details{border-top:1px solid #b5c4b6;margin-top:20px;padding-top:8px}
.comparison>summary,.local-save>summary{font-size:1.2rem;font-weight:750}
.comparison:not([open]),.local-save:not([open]){padding-block:12px}
@media print{.result-breakdown,.report-details,.result a{display:none!important}}

/* Input and result keep one stable vertical column on every screen. */
.layout{max-width:900px}.result-placeholder{min-height:180px;background:#edf2e9;border-style:dashed}.result-placeholder h2{margin-top:0}
@media print{.result-placeholder{display:none!important}}

/* Tool sections share one edge and width; frame borders are uniform. */
.comparison,.local-save{max-width:900px;width:100%}

/* Group the privacy heading words; allow each group to reflow at enlarged text sizes. */
.privacy-title>span{display:inline-block;max-width:100%}

/* Keep examples and validation beside the relevant input. */
.field-help{display:block;font-weight:400;line-height:1.65;margin:7px 0 0;overflow-wrap:anywhere}.field-error{display:block;color:#98251f;font-size:1rem;font-weight:650;line-height:1.7;margin:8px 0 0;overflow-wrap:anywhere}.field-error[hidden]{display:none!important}

/* Explicit-success discovery; no layout width changes or floating overlay. */
#result-preview,#output{scroll-margin-block-start:16px}
.result-preview{margin:18px 0 0;padding:16px;border:1px solid currentColor;border-radius:8px;background:#f2f7f2;overflow-wrap:anywhere}.result-preview h3{margin:0;font-size:1.2rem;line-height:1.6}.result-preview p{margin:10px 0 0;font-size:18px}.result-preview a{display:inline-block;padding:8px 0;min-height:44px}#result-preview-title:focus-visible{outline:3px solid currentColor;outline-offset:4px}@media print{#result-preview{display:none!important}}

/* Substituted equations stay readable without horizontal page scrolling. */
.result-equations,.result-conditions{margin-block:1.5rem;min-width:0}.result-equations ol{padding-inline-start:1.3em}.result-equations li{margin-block:1rem;line-height:1.8;overflow-wrap:anywhere}.result-conditions dl{font-size:1rem}.result-conditions dd{overflow-wrap:anywhere}

@media print{.result-equations,.result-conditions{display:none!important}}

.input-rules{margin-block:1rem}.input-rules summary{font-weight:400}

/* Conditions are secondary metadata, not another set of headline results. */
#result-conditions{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:8px 16px;align-items:start;margin:0}
#result-conditions dt,#result-conditions dd{font-size:1rem;font-weight:400;line-height:1.6;color:inherit;margin:0;min-width:0;overflow-wrap:anywhere}
.result-conditions h3{margin-bottom:12px}

.field-group-title{grid-column:1 / -1;margin:1rem 0 0;padding-top:.7rem;border-top:1px solid #d8e2df}.sensitivity-scroll{overflow-x:auto}.sensitivity-table{border-collapse:collapse;width:100%;min-width:380px}.sensitivity-table th,.sensitivity-table td{border:1px solid #cbd5d1;padding:.6rem;text-align:right}.sensitivity-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}

.decision-print-report{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit}.decision-actions textarea{width:100%;min-height:12rem}
@media print{body[data-print="decision"] main>*{display:none!important}body[data-print="decision"] #decision-print-report{display:block!important;white-space:pre-wrap;overflow-wrap:anywhere;font:11pt/1.5 sans-serif;border:0;margin:0;padding:0}.decision-actions,.decision-storage{display:none!important}}
