:root {
  color-scheme: light;
  --paper: #edf3ef;
  --ink: #172820;
  --muted: #465b50;
  --green: #145641;
  --deep: #123f32;
  --rule: #cedbd2;
  font-family: "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: .24em; }
a:hover { color: var(--deep); }
:focus-visible { outline: 3px solid #a7611f; outline-offset: 4px; }
h1, h2, p, dl, dd { margin: 0; }
.wrap { max-width: 65rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.header { border-bottom: 1px solid var(--rule); }
.header-inner { display: flex; gap: 1rem; justify-content: space-between; align-items: center; min-height: 4rem; }
.wordmark { color: var(--ink); font-size: .98rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.ad-label { color: var(--muted); font-size: .81rem; }
.intro { padding-block: clamp(2rem, 6.6vw, 4rem) clamp(1.5rem, 4vw, 2.65rem); }
.intro h1 { font-size: clamp(2.05rem, 5.6vw, 3.85rem); line-height: 1.24; font-weight: 800; letter-spacing: -.055em; }
.intro p { color: var(--muted); margin-top: .9rem; }
.mobile-break { display: none; }

.panel { background: #fff; border: 1px solid var(--rule); border-radius: 1.15rem; padding: clamp(1.1rem, 3vw, 2rem); box-shadow: 0 12px 32px #1737270a; }
.form-heading, .result-heading { display: flex; gap: 1rem; justify-content: space-between; align-items: start; }
h2 { font-size: 1.35rem; line-height: 1.4; letter-spacing: -.02em; }
.form-heading p, .result-heading p:not(.difference) { color: var(--muted); margin-top: .2rem; }
.text-button { border: 1px solid #8caa9a; color: var(--deep); background: #f5faf7; border-radius: .55rem; padding: .5rem .75rem; font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.text-button:hover { background: #e6f2eb; }
.context-grid, .bills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.context-grid { max-width: 35rem; }
fieldset { margin: 0; padding: .65rem .9rem 1rem; min-width: 0; border: 1px solid var(--rule); border-radius: .75rem; background: #f9fbfa; }
legend { padding-inline: .3rem; font-size: 1.05rem; font-weight: 750; }
.field-note { color: var(--muted); min-height: 3em; margin-bottom: .55rem; }
label { display: block; font-size: .95rem; font-weight: 700; }
fieldset label + label { margin-top: .7rem; }
.label-hint { color: var(--muted); font-size: .875rem; font-weight: 500; }
input, select { width: 100%; min-width: 0; min-inline-size: 0; min-height: 2.8rem; border: 1px solid #a9baaf; border-radius: .45rem; padding: .45rem .6rem; background: white; margin-top: .2rem; font: inherit; font-size: 1rem; font-weight: 500; color: var(--ink); }
select { appearance: none; padding-inline-end: 2rem; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23465b50' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round' d='m4 6 4 4 4-4'/%3E%3C/svg%3E") right .65rem center / 1rem no-repeat; }
input::placeholder { color: #697d71; }
[aria-invalid="true"] { border-color: #b52c20; }
.comparison-note { margin-top: .9rem; color: var(--muted); }
.error { margin-top: .75rem; color: #982719; font-weight: 650; }
.primary { display: inline-flex; justify-content: center; align-items: center; text-align: center; min-height: 2.9rem; padding: .6rem 1.15rem; border: 1px solid transparent; border-radius: .55rem; color: #fff; background: var(--green); font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.primary:hover { background: var(--deep); color: #fff; }
.compare-button { margin-top: .95rem; }

.result { margin-top: 1rem; border-top: 4px solid var(--green); }
.difference { font-size: clamp(1.3rem, 3.5vw, 2rem); font-weight: 800; color: var(--deep); font-variant-numeric: tabular-nums; }
.result-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-block: .8rem; }
.result-values div { background: var(--paper); border-radius: .62rem; padding: .65rem .85rem; }
.result-values dt { color: var(--muted); }
.result-values dd { font-size: 1.36rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.referral { border-top: 1px solid var(--rule); padding-top: .9rem; }
.referral p { margin-bottom: .75rem; color: var(--muted); }
.conditions-link { display: inline-block; margin: .5rem .75rem; }
.footer { padding-block: 1.15rem 2.5rem; color: var(--muted); font-size: .89rem; }
.footer a { display: inline-block; margin-top: .2rem; }
.visually-hidden { width: 1px; height: 1px; overflow: hidden; white-space: nowrap; clip-path: inset(50%); position: absolute; }

@media (max-width: 40rem) {
  .mobile-break { display: initial; }
  .bills { grid-template-columns: 1fr; gap: .75rem; }
  .field-note { min-height: 0; }
  .form-heading { flex-wrap: wrap; gap: .6rem; }
  .result-heading { flex-direction: column; gap: .3rem; }
  .primary { width: 100%; }
  .conditions-link { margin-inline: 0; }
}
