:root {
  color-scheme: light;
  --ink: #282326;
  --muted: #746c71;
  --line: #e7dfe2;
  --surface: #ffffff;
  --soft: #f7f2f4;
  --accent: #9d4968;
  --accent-dark: #713149;
  --positive: #1f6754;
  --danger: #a12d36;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; background: #f4f1f2; color: var(--ink); line-height: 1.5; }
.page-header, main { width: min(100% - 32px, 1080px); margin-inline: auto; }
.page-header { padding: 40px 0 24px; }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .15em; }
h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.2rem, 8vw, 3.6rem); line-height: 1; }
h1 > span { display: block; }
h1 > small { display: block; margin-top: 8px; font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif; font-size: .26em; font-weight: 700; letter-spacing: .08em; }
.page-header > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr); gap: 20px; align-items: start; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 28px rgba(55, 35, 43, .05); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.section-heading > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.step { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--accent); color: white; font-size: .72rem; font-weight: 800; }
h2, h3 { margin: 0; }
h2 { font-size: 1.05rem; }
h3 { font-size: .85rem; letter-spacing: .04em; }
button { flex: 0 0 auto; border: 0; background: transparent; color: var(--accent-dark); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
label:nth-child(odd) { border-right: 1px solid var(--line); }
label > span:first-child { min-width: 0; font-size: .84rem; font-weight: 700; }
label small { display: block; color: var(--muted); font-size: .67rem; font-weight: 500; }
.target { grid-column: 1 / -1; border-right: 0 !important; background: var(--soft); }
.control { display: flex; width: 116px; flex: 0 0 auto; align-items: center; overflow: hidden; border: 1px solid #d8ced2; border-radius: 8px; background: white; }
input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 8px 4px 8px 8px; background: transparent; color: var(--ink); font: inherit; font-size: .9rem; font-weight: 700; text-align: right; }
input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.control b { padding-right: 8px; color: var(--muted); font-size: .72rem; }
.hero-result { padding: 26px 20px; background: var(--accent-dark); color: white; text-align: center; }
.hero-result span, .hero-result small { display: block; }
.hero-result span { font-size: .8rem; font-weight: 700; opacity: .85; }
.hero-result strong { display: block; margin: 3px 0; font-size: clamp(2rem, 8vw, 2.8rem); font-variant-numeric: tabular-nums; }
.hero-result small { font-size: .68rem; opacity: .65; }
.hero-result .negative { color: #ffd6d8; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-grid div { min-width: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.result-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.result-grid span, .target-result span { display: block; color: var(--muted); font-size: .72rem; }
.result-grid strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.break-even { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.break-even h3, .target-result h3 { margin-bottom: 10px; color: var(--accent-dark); }
.metric { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.metric:last-child { border: 0; }
.metric span { color: var(--muted); font-size: .78rem; }
.metric strong { font-size: .92rem; }
.target-result { padding: 18px 20px; background: var(--soft); }
.target-result > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 5px; }
.target-result strong { font-size: 1.05rem; color: var(--positive); }
#capacity-warning { margin: 12px 0 0; border-left: 3px solid var(--danger); padding-left: 9px; color: var(--danger); font-size: .73rem; }
.notice { margin: 16px 2px 28px; border-left: 3px solid #c6a4b1; padding: 3px 0 3px 12px; color: var(--muted); font-size: .72rem; }
.notice strong { color: var(--ink); }
.notice p { margin: 3px 0 0; }
footer { display: flex; width: min(100% - 32px, 1080px); margin: 0 auto; padding: 18px 0 30px; border-top: 1px solid var(--line); gap: 18px; color: var(--muted); font-size: .72rem; }
footer a { color: var(--accent-dark); }
footer span { margin-left: auto; }
.legal-page main { width: min(100% - 32px, 760px); }
.legal-content { padding: clamp(20px, 5vw, 40px); }
.legal-content h2 { margin: 1.8em 0 .5em; font-size: 1rem; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li { font-size: .88rem; }
.legal-content ul { padding-left: 1.4em; }
.back-link { display: inline-block; margin-top: 22px; color: var(--accent-dark); font-weight: 700; }
.not-found { min-height: 72vh; display: grid; place-items: center; text-align: center; }
.not-found .panel { width: min(100%, 520px); padding: 42px 24px; }
.not-found .code { margin: 0; color: var(--accent); font: 700 clamp(3.5rem, 16vw, 6rem)/1 Georgia, serif; }
.not-found h1 { margin-top: 10px; font-family: inherit; font-size: 1.4rem; }
.not-found p { color: var(--muted); font-size: .86rem; }
@media (max-width: 760px) {
  .page-header, main, footer { width: min(100% - 24px, 560px); }
  .page-header { padding-top: 28px; }
  form { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .page-header, main, footer { width: calc(100% - 20px); }
  .field-grid { grid-template-columns: 1fr; }
  label, label:nth-child(odd) { border-right: 0; }
  .target { grid-column: auto; }
  .section-heading { padding-inline: 14px; }
  label { padding-inline: 13px; }
  .control { width: 112px; }
  footer { flex-wrap: wrap; gap: 10px 16px; }
  footer span { flex-basis: 100%; margin-left: 0; }
}
