:root {
  --primary: #1a6fb5;
  --primary-dark: #14567e;
  --primary-soft: #e8f2fa;
  --accent: #0d9467;
  --accent-soft: #e8f8f0;
  --ink: #17202a;
  --sub: #475569;
  --muted: #6b7280;
  --border: #dfe5eb;
  --surface: #ffffff;
  --surface-soft: #f5f8fb;
  --warm: #fffaf0;
  --warning: #9a5b00;
  --shadow: 0 14px 40px rgba(21, 68, 102, 0.1);
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid #f2a900;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  transition: top .2s;
}

.skip-link:focus { top: 16px; }

.container {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.narrow-container { width: min(920px, calc(100% - 48px)); }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid rgba(20, 86, 126, .09);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: .01em;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-size: .82rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav > a {
  color: var(--sub);
  font-size: .86rem;
  font-weight: 600;
  text-decoration: none;
}

.header-nav .header-cta {
  min-height: 48px;
  padding: 9px 18px;
  border-radius: 9px;
  color: #fff;
  background: var(--primary);
}

.hero {
  padding: 82px 0 78px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 86% 14%, rgba(13, 148, 103, .08), transparent 28%),
    linear-gradient(155deg, #f1f7fc 0%, #fff 58%, #f7faf8 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  align-items: center;
  gap: 70px;
}

.eyebrow, .step {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.42;
  letter-spacing: -.035em;
}

.hero h1 em {
  color: var(--primary);
  font-style: normal;
  background: linear-gradient(transparent 67%, rgba(26, 111, 181, .14) 67%);
}

.hero-copy {
  max-width: 690px;
  margin: 0 0 26px;
  color: var(--sub);
  font-size: 1rem;
}

.hero-points {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--sub);
  font-size: .9rem;
}

.hero-points li { display: flex; gap: 10px; align-items: flex-start; }
.hero-points span { color: var(--accent); font-weight: 800; }

.hero-note {
  padding: 30px;
  border: 1px solid #f1dcac;
  border-radius: var(--radius);
  background: rgba(255, 250, 240, .88);
  box-shadow: 0 10px 30px rgba(101, 75, 20, .07);
}

.note-label {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--warning);
  font-size: .7rem;
  font-weight: 800;
}

.hero-note h2 { margin: 0 0 10px; font-size: 1.08rem; line-height: 1.55; }
.hero-note p { margin: 0; color: #614d2a; font-size: .84rem; }

.calculator-section {
  padding: 84px 0 96px;
  background: var(--surface-soft);
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
  align-items: start;
  gap: 30px;
}

.input-panel, .results-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.input-panel { padding: 34px; }
.results-panel { position: sticky; top: 96px; padding: 34px; }

.section-heading h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
  line-height: 1.5;
}

.section-heading > p:not(.step) { margin: 0; color: var(--sub); font-size: .86rem; }

fieldset {
  margin: 30px 0 0;
  padding: 0;
  border: 0;
}

legend {
  width: 100%;
  margin-bottom: 16px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
}

.field-wide { grid-column: 1 / -1; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: .82rem;
  font-weight: 700;
}

.input-with-unit {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #bfc9d4;
  border-radius: 9px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

.input-with-unit:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 111, 181, .12);
}

.input-with-unit input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 10px 12px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
}

.input-with-unit input:focus { outline: 0; }

.input-with-unit span {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 12px;
  color: var(--sub);
  background: #f4f6f8;
  font-size: .74rem;
  white-space: nowrap;
}

.field-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .71rem;
  line-height: 1.55;
}

.field-help.warning { color: #805000; font-weight: 600; }

.form-error {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid #e2a5a5;
  border-radius: 8px;
  color: #861b1b;
  background: #fff3f3;
  font-size: .82rem;
}

.calculate-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  padding: 14px 20px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 7px 20px rgba(26, 111, 181, .24);
  font-size: .92rem;
  font-weight: 700;
  transition: background .2s, transform .2s;
}

.calculate-button:hover { background: var(--primary-dark); transform: translateY(-1px); }

.results-heading { margin-bottom: 22px; }

.highlight-card {
  padding: 24px;
  border: 1px solid #b8e3d1;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent-soft), #f8fdfb);
}

.highlight-card span { display: block; color: #215a47; font-size: .78rem; font-weight: 700; }
.highlight-card strong { display: block; margin: 5px 0 2px; color: var(--accent); font-size: clamp(1.9rem, 5vw, 2.7rem); line-height: 1.3; letter-spacing: -.03em; }
.highlight-card strong.negative { color: #a33b28; }
.highlight-card small { color: var(--sub); font-size: .68rem; }

.comparison-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.comparison-table {
  width: 100%;
  min-width: 510px;
  border-collapse: collapse;
  font-size: .78rem;
}

.comparison-table th, .comparison-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.comparison-table th:first-child, .comparison-table td:first-child { text-align: left; }
.comparison-table thead { color: var(--sub); background: #f6f8fa; }
.comparison-table th { font-size: .7rem; }
.comparison-table tbody tr:last-child td { border-bottom: 0; }
.comparison-table tbody tr.best { background: #f0faf6; }
.comparison-table td strong { color: var(--ink); }
.best-badge { margin-left: 6px; padding: 2px 7px; border-radius: 999px; color: #fff; background: var(--accent); font-size: .62rem; }
.saving-positive { color: #06754f; font-weight: 700; }
.saving-negative { color: #a33b28; font-weight: 700; }

.bar-chart { display: grid; gap: 11px; margin: 24px 0 0; }

.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 86px;
  align-items: center;
  gap: 10px;
  font-size: .72rem;
}

.bar-label { color: var(--sub); font-weight: 600; }
.bar-track { height: 13px; overflow: hidden; border-radius: 999px; background: #e9edf1; }
.bar-fill { width: 0; height: 100%; border-radius: inherit; background: #9fb4c6; transition: width .5s ease; }
.bar-row.best .bar-fill { background: var(--accent); }
.bar-value { text-align: right; font-weight: 700; }

.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }

.secondary-button {
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #aebcc8;
  border-radius: 9px;
  color: var(--primary-dark);
  background: #fff;
  font-size: .77rem;
  font-weight: 700;
}

.secondary-button:hover { border-color: var(--primary); background: var(--primary-soft); }

.action-status { min-height: 1.6em; margin: 7px 0 0; color: var(--accent); font-size: .72rem; text-align: center; }

.result-disclaimer {
  margin-top: 18px;
  padding: 18px;
  border-radius: 10px;
  color: var(--sub);
  background: #f6f8fa;
  font-size: .69rem;
}

.result-disclaimer strong { color: var(--ink); font-size: .73rem; }
.result-disclaimer ul { margin: 7px 0; padding-left: 18px; }
.result-disclaimer p { margin: 8px 0 0; }

.consultation-card {
  margin-top: 20px;
  padding: 24px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #184e73, var(--primary));
}

.consultation-label { margin: 0 0 5px; color: #cde8fa; font-size: .7rem; font-weight: 700; }
.consultation-card h3 { margin: 0 0 8px; font-size: 1rem; line-height: 1.55; }
.consultation-card > p:not(.consultation-label) { margin: 0 0 16px; color: #e5f2fb; font-size: .75rem; }

.consultation-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  color: var(--primary-dark);
  background: #fff;
  font-size: .8rem;
  font-weight: 800;
  text-decoration: none;
}

.guide-section { padding: 92px 0; }
.guide-section h2, .faq-section h2 { margin: 0 0 34px; font-size: clamp(1.55rem, 3vw, 2rem); line-height: 1.55; }

.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.guide-grid article {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
}

.guide-grid article > span { color: var(--primary); font-size: .72rem; font-weight: 800; }
.guide-grid h3 { margin: 6px 0 10px; font-size: 1rem; line-height: 1.55; }
.guide-grid p { margin: 0; color: var(--sub); font-size: .78rem; }
.related-link { margin: 26px 0 0; text-align: center; }
.related-link a { color: var(--primary-dark); font-size: .85rem; font-weight: 700; }

.faq-section { padding: 88px 0; background: var(--surface-soft); }
.faq-list { display: grid; gap: 12px; }
.faq-list details { border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.faq-list summary { position: relative; padding: 20px 54px 20px 22px; cursor: pointer; font-size: .9rem; font-weight: 700; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; top: 15px; right: 21px; color: var(--primary); font-size: 1.4rem; font-weight: 400; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { margin: 0; padding: 0 22px 20px; color: var(--sub); font-size: .82rem; }

.site-footer { padding: 40px 0; border-top: 1px solid #34495b; color: #dae5ed; background: #172c3d; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-brand { color: #fff; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: #dae5ed; font-size: .75rem; text-decoration: none; }
.site-footer p { margin: 0; color: #9db0bd; font-size: .68rem; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-note { max-width: 650px; }
  .calculator-layout { grid-template-columns: 1fr; }
  .results-panel { position: static; }
  .guide-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .container, .narrow-container { width: min(100% - 32px, 1120px); }
  .header-inner { min-height: 64px; }
  .header-nav > a:not(.header-cta) { display: none; }
  .header-nav .header-cta { padding-inline: 13px; font-size: .75rem; }
  .hero { padding: 58px 0 52px; }
  .hero h1 { font-size: 2rem; }
  .hero h1 br { display: none; }
  .hero-note { padding: 23px; }
  .calculator-section { padding: 52px 0 64px; }
  .input-panel, .results-panel { padding: 23px 18px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .share-actions { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 76px 1fr 74px; gap: 7px; font-size: .66rem; }
  .guide-section, .faq-section { padding: 60px 0; }
  .guide-section h2, .faq-section h2 { margin-bottom: 24px; }
  .footer-links { flex-wrap: wrap; gap: 12px 18px; }
}

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

@media print {
  .site-header, .hero, .input-panel, .share-actions, .consultation-card, .guide-section, .faq-section, .site-footer { display: none !important; }
  .calculator-section { padding: 0; background: #fff; }
  .calculator-layout { display: block; }
  .results-panel { position: static; border: 0; box-shadow: none; }
}
