:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eaf2ff;
  --text: #111827;
  --muted: #6b7280;
  --light: #9ca3af;
  --border: #e5eaf0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 18px max(20px, calc((100vw - 1080px) / 2));
  background: rgba(247, 249, 252, 0.88);
  border-bottom: 1px solid rgba(229, 234, 240, 0.8);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 42%),
    var(--primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.top-nav a {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.top-nav a:hover,
.top-nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.page-shell {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 64px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy,
.page-title {
  padding: 20px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 700px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-copy p:last-child,
.page-title p:last-child {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.banner-panel {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  padding: 0;
}

.banner-panel img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.banner-summary {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 4px;
  min-width: 132px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(229, 234, 240, 0.82);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
}

.banner-summary strong {
  color: var(--text);
  font-size: 38px;
  line-height: 1;
}

.banner-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mini-card {
  display: grid;
  gap: 7px;
  min-height: 172px;
  padding: 22px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}

.mini-card strong {
  color: var(--text);
  font-size: 52px;
  line-height: 1;
}

.mini-label,
.mini-card span:last-child {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-list span {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  background: var(--surface-muted);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.menu-grid.expanded {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.popular-section {
  margin: 0 0 28px;
}

.compact-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.compact-heading h2 {
  margin: 0;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  background: #e9fbf4;
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 999px;
  color: #047857;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.live-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.48);
  animation: livePulse 1600ms ease-out infinite;
}

.popular-list {
  display: grid;
  gap: 8px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 240ms ease, transform 240ms ease;
}

.popular-list.is-fading-out {
  opacity: 0;
  transform: translateY(-6px);
}

.popular-list.is-fading-in {
  animation: popularFadeIn 280ms ease both;
}

.popular-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.popular-card:hover {
  transform: translateX(3px);
  border-color: rgba(37, 99, 235, 0.28);
  background: #fbfdff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.popular-rank {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--primary-soft);
  border-radius: 8px;
  color: var(--primary);
  font-size: 15px;
  font-weight: 900;
}

.popular-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.popular-card strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
}

.popular-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popular-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.popular-trend.up,
.popular-trend.new {
  background: #e9fbf4;
  color: #047857;
}

.popular-trend.down {
  background: #fff1f2;
  color: #be123c;
}

.popular-trend.same {
  background: var(--surface-muted);
  color: var(--muted);
}

@keyframes popularFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes livePulse {
  to {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

.hub-jump {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 32px;
}

.hub-jump a {
  display: grid;
  gap: 6px;
  min-height: 94px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.hub-jump a:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.hub-jump strong {
  color: var(--text);
  font-size: 18px;
}

.hub-jump span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.hub-section {
  scroll-margin-top: 96px;
  margin-top: 40px;
}

.hub-section + .hub-section {
  padding-top: 8px;
}

.menu-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 168px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.menu-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.icon-box {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 8px;
}

.icon-box svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-loan {
  background: var(--primary-soft);
  color: var(--primary);
}

.icon-pension {
  background: #e9fbf4;
  color: var(--success);
}

.icon-saving {
  background: #fff7e6;
  color: var(--warning);
}

.menu-content {
  display: grid;
  gap: 9px;
}

.menu-content strong {
  font-size: 22px;
}

.menu-content span {
  color: var(--muted);
  line-height: 1.5;
}

.arrow {
  color: var(--primary);
  font-size: 26px;
  font-weight: 700;
}

.page-title {
  margin-bottom: 24px;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
  align-items: start;
}

.calculator-layout.wide {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.form-card,
.result-card,
.standard-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-card {
  display: grid;
  gap: 20px;
  padding: 24px;
}

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

.field-group {
  display: grid;
  gap: 9px;
}

.field-group label,
legend,
.choice-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.input-unit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 8px;
}

.input-unit:focus-within {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-unit input {
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-weight: 750;
}

.input-unit span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select {
  min-height: 52px;
  width: 100%;
  padding: 0 14px;
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  font-weight: 750;
  outline: 0;
}

select:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

fieldset {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0 0 20px;
  border: 0;
  border-bottom: 1px solid var(--border);
}

fieldset:last-of-type {
  padding-bottom: 0;
  border-bottom: 0;
}

legend {
  margin-bottom: 2px;
  padding: 0;
}

.choice-group {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: var(--surface-muted);
  border-radius: 8px;
}

.choice-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.choice-group input {
  accent-color: var(--primary);
}

.switch-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  background: var(--surface-muted);
  border-radius: 8px;
}

.switch-group label {
  min-width: 0;
}

.switch-group input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-group span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.switch-group input:checked + span {
  background: var(--surface);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--primary);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.switch-group input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  width: 100%;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button.primary {
  background: var(--primary);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--primary-hover);
}

.button.secondary {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
}

.button.secondary:hover {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary);
}

.result-card {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.result-card.accent {
  background:
    linear-gradient(180deg, var(--primary-soft), rgba(255, 255, 255, 0) 42%),
    var(--surface);
}

.result-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.result-number {
  color: var(--text);
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1.08;
  word-break: keep-all;
}

.result-caption,
.notice {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.summary-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.summary-list div:last-child {
  border-bottom: 0;
}

.summary-list dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.summary-list dd {
  margin: 0;
  color: var(--text);
  text-align: right;
  font-weight: 800;
  word-break: keep-all;
}

.standard-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 22px;
  background: var(--border);
}

.standard-strip div {
  display: grid;
  gap: 6px;
  padding: 18px;
  background: var(--surface);
}

.standard-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.standard-strip strong {
  font-size: 20px;
}

.button-stack {
  display: grid;
  gap: 10px;
}

.seo-section {
  margin-top: 44px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.25;
}

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

.faq-grid article {
  display: grid;
  gap: 10px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.faq-grid h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.faq-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.notice {
  padding: 14px;
  background: var(--surface-muted);
  border-radius: 8px;
}

.source-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.source-list a {
  color: var(--primary);
  font-weight: 750;
}

.compact-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.is-success {
  color: var(--success);
}

.is-warning {
  color: var(--warning);
}

.is-danger {
  color: var(--danger);
}

@media (max-width: 840px) {
  .site-header {
    padding: 14px 20px;
  }

  .page-shell {
    padding-top: 28px;
  }

  .home-hero,
  .calculator-layout,
  .calculator-layout.wide,
  .popular-list,
  .hub-jump,
  .menu-grid,
  .menu-grid.expanded,
  .standard-strip,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .result-card {
    position: static;
  }

  .menu-card {
    min-height: 138px;
  }
}

@media (max-width: 560px) {
  .brand span:last-child {
    display: none;
  }

  .page-shell {
    width: min(100% - 32px, 1080px);
  }

  h1 {
    font-size: 34px;
  }

  .hero-copy p:last-child,
  .page-title p:last-child {
    font-size: 16px;
  }

  .field-grid,
  .choice-group,
  .switch-group {
    grid-template-columns: 1fr;
  }

  .choice-group label {
    min-height: 36px;
  }

  .menu-card {
    grid-template-columns: 48px 1fr auto;
    gap: 14px;
    padding: 18px;
  }

  .icon-box {
    width: 48px;
    height: 48px;
  }

  .menu-content strong {
    font-size: 19px;
  }
}
