:root {
  --ink: #18231e;
  --muted: #69746f;
  --line: #dfe5e1;
  --paper: #f6f7f5;
  --card: #fff;
  --green: #0d6b50;
  --green-dark: #074a38;
  --green-soft: #dcebe4;
  --orange: #db7b3f;
  --orange-soft: #f7e6d9;
  --danger: #b84238;
  --shadow: 0 12px 36px rgba(30, 54, 43, 0.07);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  overflow-x: hidden;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }

.topbar {
  width: min(1180px, calc(100% - 40px));
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(24, 35, 30, 0.1);
}
.brand { color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 720; letter-spacing: -0.02em; }
.local-badge { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, 0.82fr);
  background: var(--card);
  border: 1px solid rgba(39, 67, 54, 0.12);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 28px;
}
.input-panel { padding: 34px 38px 38px; }
.result-panel { padding: 34px 38px; background: var(--green-dark); color: white; position: relative; overflow: hidden; }

.section-heading, .section-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading > div, .section-title-row > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.section-heading h2, .section-title-row h2 { font-size: 20px; margin: 0; letter-spacing: -0.02em; }
.section-title-row > div > p { width: 100%; margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.section-heading.compact { margin-top: 2px; }
.text-button { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 5px 0; }
.text-button:hover { color: var(--green); }
.divider { height: 1px; background: var(--line); margin: 30px 0; }

.field-grid { display: grid; gap: 18px; margin-top: 24px; }
.two-columns { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.field.full { margin-top: 24px; }
.field > span { color: #53605a; font-size: 12px; font-weight: 650; display: flex; justify-content: space-between; gap: 8px; }
.field > span em { color: var(--green); font-style: normal; font-size: 11px; font-weight: 600; }
.number-input, .select-wrap { position: relative; height: 48px; }
.number-input input, .select-wrap select {
  width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--ink); background: rgba(250, 251, 248, 0.82); transition: border .2s, box-shadow .2s;
}
.number-input input { padding: 0 56px 0 14px; font-weight: 700; }
.number-input b { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #839089; font-size: 12px; font-weight: 500; pointer-events: none; }
.select-wrap select { padding: 0 38px 0 14px; appearance: none; font-weight: 600; }
.select-wrap::after { content: "⌄"; position: absolute; right: 15px; top: 11px; color: var(--muted); pointer-events: none; }
.number-input input:focus, .select-wrap select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(13, 107, 80, 0.09); }
input::-webkit-inner-spin-button { appearance: none; }

.segmented {
  height: 48px; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(242, 245, 241, 0.9);
}
.segmented.triple { grid-template-columns: repeat(3, 1fr); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { min-width: 0; display: grid; place-items: center; border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; transition: .2s ease; white-space: nowrap; }
.segmented input:checked + label { background: white; color: var(--green); box-shadow: 0 2px 8px rgba(32, 55, 45, 0.08); }
.segmented input:focus-visible + label { outline: 2px solid var(--green); outline-offset: 1px; }
.policy-hint { min-height: 18px; margin-top: 10px; font-size: 11px; color: var(--muted); line-height: 1.55; }
.policy-hint.warning { color: var(--danger); }
.validation-message { min-height: 20px; margin-top: 15px; color: var(--danger); font-size: 12px; line-height: 1.6; }
.field.is-hidden { display: none; }
.rate-grid:has(.field.is-hidden) { grid-template-columns: 1fr; }

.benefit-panel { margin-top: 20px; border: 1px solid #d9e3dd; border-radius: 14px; background: rgba(238, 245, 240, .7); overflow: hidden; }
.benefit-panel.is-hidden { display: none; }
.benefit-panel summary { min-height: 68px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; list-style: none; }
.benefit-panel summary::-webkit-details-marker { display: none; }
.benefit-panel summary::after { content: "＋"; flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: white; font-size: 14px; box-shadow: 0 2px 8px rgba(32,55,45,.08); }
.benefit-panel[open] summary::after { content: "−"; }
.benefit-panel summary > span:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.benefit-panel summary b { font-size: 12px; }
.benefit-panel summary small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.benefit-cap { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; margin-left: auto; white-space: nowrap; }
.benefit-cap strong { color: var(--green); font-size: 16px; }
.benefit-content { padding: 2px 16px 16px; border-top: 1px solid rgba(13,107,80,.1); }
.benefit-fields { display: grid; gap: 16px; padding-top: 16px; }
.benefit-field { display: grid; gap: 8px; }
.benefit-field > span { color: #53605a; font-size: 11px; font-weight: 650; }
.choice-row { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-row input { position: absolute; opacity: 0; pointer-events: none; }
.choice-row label { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.66); font-size: 10px; font-weight: 650; cursor: pointer; transition: .2s ease; }
.choice-row input:checked + label { color: white; border-color: var(--green); background: var(--green); box-shadow: 0 4px 12px rgba(13,107,80,.14); }
.choice-row input:focus-visible + label { outline: 2px solid var(--green); outline-offset: 2px; }
.benefit-toggle { display: flex; align-items: flex-start; gap: 9px; color: #53605a; font-size: 11px; line-height: 1.5; cursor: pointer; }
.benefit-toggle input { appearance: none; flex: 0 0 auto; width: 17px; height: 17px; margin: 0; border: 1px solid #b6c4bd; border-radius: 5px; background: white; display: grid; place-items: center; }
.benefit-toggle input:checked { border-color: var(--green); background: var(--green); }
.benefit-toggle input:checked::after { content: "✓"; color: white; font-size: 11px; font-weight: 800; }
.benefit-select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: rgba(255,255,255,.78); outline: none; font-size: 11px; }
.benefit-result { margin-top: 17px; padding: 12px 13px; border-radius: 10px; background: white; display: flex; align-items: flex-start; gap: 10px; }
.benefit-result span { flex: 0 0 auto; padding: 4px 7px; border-radius: 6px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 750; }
.benefit-result p, .benefit-footnote { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.benefit-footnote { margin-top: 10px; }

.result-topline { position: relative; display: flex; justify-content: space-between; color: rgba(255,255,255,.62); font-size: 11px; letter-spacing: .08em; }
.monthly-payment { position: relative; padding: 35px 0 28px; border-bottom: 1px solid rgba(255,255,255,.14); }
.monthly-payment > span { color: rgba(255,255,255,.7); font-size: 13px; }
.monthly-payment strong { display: flex; align-items: baseline; margin: 9px 0 7px; font-size: clamp(46px, 5vw, 64px); line-height: 1; letter-spacing: -.045em; font-weight: 520; font-variant-numeric: tabular-nums; }
.monthly-payment strong small { font-size: 22px; margin-right: 7px; font-weight: 500; }
.monthly-payment p { margin: 0; color: rgba(255,255,255,.52); font-size: 11px; }
.share-area { position: relative; padding: 20px 0 0; }
.share-button { width: 100%; height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(255,255,255,.3); border-radius: 11px; color: var(--green-dark); background: #fff; font-size: 12px; font-weight: 750; transition: transform .15s ease, background .15s ease; }
.share-button:hover { background: #f4faf7; }
.share-button:active { transform: scale(.99); }
.share-button:disabled { cursor: wait; opacity: .72; }
.share-button:focus-visible { outline: 2px solid #bce3d1; outline-offset: 2px; }
.share-icon { font-size: 16px; line-height: 1; }
.share-status { min-height: 16px; margin: 7px 0 0; color: rgba(255,255,255,.5); font-size: 10px; text-align: center; }
.share-status.success { color: #bce3d1; }
.share-status.error { color: #ffc6b5; }
.result-metrics { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px; padding: 27px 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.result-metrics div { display: flex; flex-direction: column; gap: 7px; }
.result-metrics span { color: rgba(255,255,255,.52); font-size: 11px; }
.result-metrics b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.loan-mix { position: relative; padding: 25px 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.mix-heading { display: flex; justify-content: space-between; color: rgba(255,255,255,.66); font-size: 11px; }
.mix-bar { display: flex; width: 100%; height: 7px; margin: 14px 0 12px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.1); }
.fund-part { background: #9ecbb7; transition: width .35s ease; }
.commercial-part { background: #e19a69; transition: width .35s ease; }
.mix-legend { display: flex; justify-content: space-between; gap: 10px; color: rgba(255,255,255,.56); font-size: 10px; }
.mix-legend span { display: flex; align-items: center; gap: 6px; }
.mix-legend i { width: 6px; height: 6px; border-radius: 50%; }
.mix-legend b { color: white; font-weight: 600; }
.fund-dot { background: #9ecbb7; }
.commercial-dot { background: #e19a69; }
.policy-section, .schedule-section { padding-top: 60px; scroll-margin-top: 20px; }
.section-title-row { align-items: center; margin-bottom: 30px; }
.updated-at { color: var(--muted); font-size: 11px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.policy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.policy-card { min-height: 128px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; align-items: flex-start; }
.policy-card.accent { background: var(--green-soft); border-color: transparent; }
.policy-card > span { color: var(--muted); font-size: 11px; }
.policy-card strong { font-size: 23px; margin: 7px 0; font-weight: 650; }
.policy-card p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: auto 0 0; }
.policy-detail { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.policy-detail summary { padding: 16px 20px; color: var(--green); font-size: 12px; font-weight: 650; cursor: pointer; }
.policy-detail-body { display: grid; grid-template-columns: 1.4fr .6fr; gap: 32px; padding: 0 20px 20px; }
.policy-detail h3 { margin: 0 0 8px; font-size: 14px; }
.policy-detail p { color: var(--muted); margin: 0; font-size: 12px; line-height: 1.75; }
.source-links { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; gap: 8px; }
.source-links a { color: var(--green); text-decoration: none; border: 1px solid rgba(13,107,80,.2); background: rgba(255,255,255,.55); border-radius: 999px; padding: 7px 11px; font-size: 10px; }
.source-links a:hover { background: white; }

.outline-button { border: 1px solid #b9c5bf; color: var(--green); background: transparent; border-radius: 10px; padding: 10px 14px; font-size: 11px; font-weight: 650; }
.outline-button:hover { background: white; border-color: var(--green); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,252,.7); }
table { width: 100%; border-collapse: collapse; min-width: 650px; font-size: 12px; font-variant-numeric: tabular-nums; }
th, td { padding: 17px 22px; text-align: right; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: rgba(237,241,236,.66); font-size: 10px; font-weight: 650; letter-spacing: .04em; }
th:first-child, td:first-child { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(220,235,228,.25); }
td:first-child { color: var(--green); font-weight: 650; }

.disclaimer { display: flex; align-items: flex-start; gap: 13px; color: var(--muted); margin: 42px 0 45px; padding: 16px 18px; border-radius: 12px; background: #ecefeb; font-size: 11px; line-height: 1.65; }
.disclaimer > span { flex: 0 0 auto; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #98a59e; border-radius: 50%; font-family: Georgia, serif; font-size: 11px; }
.disclaimer p { margin: 0; }
@media (max-width: 900px) {
  .calculator-shell { grid-template-columns: 1fr; }
  .result-panel { min-height: auto; }
  .policy-grid { grid-template-columns: 1fr 1fr; }
  .policy-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .topbar, main { width: min(100% - 24px, 1180px); }
  .topbar { height: 64px; }
  .local-badge { display: none; }
  .calculator-shell { margin-top: 18px; }
  .calculator-shell { border-radius: 20px; }
  .input-panel, .result-panel { padding: 30px 22px; }
  .two-columns, .policy-grid, .policy-detail-body { grid-template-columns: 1fr; }
  .field-grid { margin-top: 18px; }
  .policy-card:last-child { grid-column: auto; }
  .policy-section, .schedule-section { padding-top: 48px; }
  .section-title-row { align-items: flex-start; }
  .section-title-row > div > p { margin-left: 0; }
  .updated-at { display: none; }
  .source-links { justify-content: flex-start; }
  .segmented.triple label { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
