/* ==========================================================
   手取りメーター — 和モダン・エディトリアル
   藍(あい) × 朱(あけ) × 生成り(きなり)
   ========================================================== */

:root {
  --paper: #f6f1e7;
  --paper-deep: #efe8d9;
  --ink: #1d2433;
  --indigo: #16324f;
  --indigo-deep: #0e2238;
  --vermilion: #c73a23;
  --vermilion-soft: #e0512f;
  --gold: #b08d3e;
  --line: rgba(29, 36, 51, 0.16);
  --line-strong: rgba(29, 36, 51, 0.32);
  --net: #2e6e5e;
  --ins: #b08d3e;
  --tax: #c73a23;
  --radius: 6px;
  --font-display: "Shippori Mincho", serif;
  --font-body: "Zen Kaku Gothic New", sans-serif;
  --shadow-panel: 0 1px 0 rgba(29,36,51,.08), 0 12px 32px -16px rgba(22,50,79,.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* 紙のテクスチャと罫線 */
.bg-texture {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(22,50,79,.07), transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 100%, rgba(199,58,35,.05), transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 119px, rgba(29,36,51,.035) 119px 120px);
}
.bg-texture::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pc-only { display: inline; }

/* ---------- ヘッダー ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(246, 241, 231, .85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--vermilion);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  border-radius: 50%;
  box-shadow: 0 2px 0 var(--indigo-deep);
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .08em;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-text small {
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: .42em;
  color: var(--gold);
  font-weight: 700;
}
.header-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--indigo);
  border: 1px solid var(--line-strong);
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--paper);
}

/* ---------- ヒーロー ---------- */
.hero { padding: 64px 0 36px; text-align: center; position: relative; }
.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .24em;
  color: var(--vermilion);
  border-top: 1px solid var(--vermilion);
  border-bottom: 1px solid var(--vermilion);
  padding: 6px 4px;
  margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: .04em;
  color: var(--indigo-deep);
  line-height: 1.3;
}
.hero-title em {
  font-style: normal;
  color: var(--vermilion);
  position: relative;
  padding: 0 2px;
}
.hero-title em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  height: 10px;
  background: rgba(199,58,35,.14);
  z-index: -1;
}
.hero-lead {
  margin-top: 18px;
  font-size: 15px;
  color: rgba(29,36,51,.78);
}

/* ---------- シミュレーター ---------- */
.simulator {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 24px;
  align-items: start;
  padding-top: 16px;
}

.panel {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  padding: 28px;
  position: relative;
}
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--indigo);
  border-radius: var(--radius) var(--radius) 0 0;
}
.result-panel::before { background: var(--vermilion); }

.panel-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .1em;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--indigo-deep);
}
.num-chip {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--indigo);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
}
.result-panel .num-chip { background: var(--vermilion); }

/* 入力フィールド */
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
.field label, .field-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  margin-bottom: 8px;
  color: var(--indigo-deep);
}
.field-note { font-size: 11px; color: rgba(29,36,51,.55); margin-top: 6px; line-height: 1.6; }

.income-input-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-bottom: 2px solid var(--indigo);
  padding-bottom: 4px;
}
#income-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--indigo-deep);
  text-align: right;
  outline: none;
  min-width: 0;
}
#income-input:focus { color: var(--vermilion); }
#income-input::-webkit-outer-spin-button,
#income-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.unit { font-size: 15px; font-weight: 700; color: var(--ink); }

/* スライダー */
#income-slider {
  width: 100%;
  margin-top: 16px;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--indigo) var(--fill, 21%), var(--paper-deep) var(--fill, 21%));
  outline: none;
  cursor: pointer;
}
#income-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--vermilion);
  border: 3px solid #fffdf8;
  box-shadow: 0 1px 6px rgba(29,36,51,.35);
  cursor: grab;
  transition: transform .15s ease;
}
#income-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
#income-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--vermilion);
  border: 3px solid #fffdf8;
  box-shadow: 0 1px 6px rgba(29,36,51,.35);
  cursor: grab;
}
.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(29,36,51,.5);
  margin-top: 4px;
  letter-spacing: .04em;
}

.field-row { display: grid; gap: 18px; }

/* セグメントコントロール */
.seg-control {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.seg-control label { flex: 1; margin: 0; cursor: pointer; }
.seg-control input { position: absolute; opacity: 0; }
.seg-control span {
  display: block;
  text-align: center;
  padding: 9px 4px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(29,36,51,.6);
  background: #fffdf8;
  transition: all .18s ease;
  border-left: 1px solid var(--line);
}
.seg-control label:first-child span { border-left: none; }
.seg-control input:checked + span {
  background: var(--indigo);
  color: var(--paper);
}
.seg-control input:focus-visible + span { outline: 2px solid var(--vermilion); outline-offset: -2px; }

select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--indigo-deep);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fffdf8;
  cursor: pointer;
}

/* ---------- 結果パネル ---------- */
.result-hero {
  text-align: center;
  padding: 8px 0 20px;
  border-bottom: 1px dashed var(--line-strong);
  margin-bottom: 20px;
}
.result-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3em;
  color: var(--vermilion);
  margin-bottom: 4px;
}
.result-amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 7vw, 56px);
  color: var(--indigo-deep);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.result-amount .yen { font-size: 22px; margin-left: 4px; color: var(--ink); }
.result-sub {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-top: 10px;
}
.sub-label { font-size: 11px; color: rgba(29,36,51,.55); margin-right: 6px; letter-spacing: .1em; }
.sub-value {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--indigo-deep);
  font-variant-numeric: tabular-nums;
}

/* 積み上げバー */
.stack-bar-wrap { margin-bottom: 20px; }
.stack-bar {
  display: flex;
  height: 38px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
}
.seg {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: width .6s cubic-bezier(.22,1,.36,1);
  min-width: 0;
}
.seg span {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,253,248,.95);
  white-space: nowrap;
  letter-spacing: .08em;
}
.seg-net { background: var(--net); width: 78%; }
.seg-ins { background: var(--ins); width: 14.5%; }
.seg-tax { background: var(--tax); width: 7.5%; }
.stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(29,36,51,.7);
}
.stack-legend b { font-variant-numeric: tabular-nums; color: var(--ink); margin-left: 2px; }
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}
.dot-net { background: var(--net); }
.dot-ins { background: var(--ins); }
.dot-tax { background: var(--tax); }

/* 内訳テーブル */
.breakdown { width: 100%; border-collapse: collapse; font-size: 14px; }
.breakdown th { text-align: left; font-weight: 500; color: rgba(29,36,51,.8); }
.breakdown td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--indigo-deep);
}
.breakdown tr:not(.group-head) th,
.breakdown tr:not(.group-head) td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.group-head th {
  padding: 14px 4px 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--indigo-deep);
  letter-spacing: .08em;
  border-bottom: 2px solid var(--indigo);
}
.group-total { float: right; font-variant-numeric: tabular-nums; color: var(--vermilion); }

/* インサイトカード */
.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.insight-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-top: 3px solid var(--gold);
}
.insight-card[hidden] { display: none; }
.insight-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  color: rgba(29,36,51,.65);
}
.insight-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--indigo-deep);
  font-variant-numeric: tabular-nums;
}
.insight-value small { font-size: 12px; font-family: var(--font-body); margin-left: 2px; }
.insight-note { font-size: 10px; color: rgba(29,36,51,.5); line-height: 1.5; }

.share-btn {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--paper);
  background: var(--indigo);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s ease, transform .12s ease;
}
.share-btn:hover { background: var(--indigo-deep); transform: translateY(-1px); }
.share-btn.copied { background: var(--net); }

/* ---------- 広告スロット ---------- */
.ad-slot { margin: 48px auto; }
.ad-placeholder {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .2em;
  color: rgba(29,36,51,.35);
  background: rgba(255,253,248,.5);
}

/* ---------- 早見表 ---------- */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--indigo-deep);
  margin-bottom: 8px;
  padding-left: 16px;
  border-left: 4px solid var(--vermilion);
}
.section-lead { font-size: 13px; color: rgba(29,36,51,.6); margin-bottom: 20px; }

.table-scroll { overflow-x: auto; }
#reference-table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf8;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-panel);
  font-size: 14px;
  min-width: 520px;
}
#reference-table th, #reference-table td {
  padding: 11px 16px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line);
}
#reference-table thead th {
  background: var(--indigo);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
}
#reference-table th:first-child, #reference-table td:first-child { text-align: left; }
#reference-table td:first-child {
  font-weight: 700;
  color: var(--indigo-deep);
}
#reference-table tbody tr:nth-child(even) { background: rgba(239,232,217,.4); }
#reference-table tbody tr.current-row {
  background: rgba(199,58,35,.08);
  outline: 2px solid var(--vermilion);
  outline-offset: -2px;
}

/* ---------- 年収別リンク ---------- */
.nenshu-links { margin-top: 64px; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-cloud a {
  display: inline-block;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--indigo-deep);
  background: #fffdf8;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: all .15s ease;
}
.chip-cloud a:hover {
  background: var(--indigo);
  color: var(--paper);
  border-color: var(--indigo);
}
.chip-cloud a[aria-current="page"] {
  background: var(--vermilion);
  color: var(--paper);
  border-color: var(--vermilion);
}

/* ---------- FAQ ---------- */
.faq { margin-top: 64px; max-width: 800px; }
.faq-item {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 14px;
  color: var(--indigo-deep);
  list-style: none;
  position: relative;
  padding-left: 44px;
  transition: background .15s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "Q";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--vermilion);
  font-size: 16px;
}
.faq-item summary:hover { background: rgba(239,232,217,.5); }
.faq-item p {
  padding: 0 20px 18px 44px;
  font-size: 14px;
  color: rgba(29,36,51,.85);
}
.faq-item strong { color: var(--vermilion); }

/* ---------- フッター ---------- */
.site-footer {
  margin-top: 72px;
  background: var(--indigo-deep);
  color: rgba(246,241,231,.85);
}
.footer-inner { padding: 44px 20px; text-align: center; }
.footer-brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--paper);
  margin-bottom: 14px;
}
.footer-note { font-size: 12px; line-height: 1.9; opacity: .75; margin-bottom: 20px; }
.footer-nav { display: flex; justify-content: center; gap: 24px; margin-bottom: 20px; flex-wrap: wrap; }
.footer-nav a {
  color: rgba(246,241,231,.9);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid rgba(246,241,231,.3);
  padding-bottom: 2px;
}
.footer-nav a:hover { color: var(--paper); border-bottom-color: var(--vermilion-soft); }
.copyright { font-size: 11px; opacity: .5; letter-spacing: .1em; }

/* ---------- 法的ページ ---------- */
.legal-page { max-width: 760px; padding-top: 48px; padding-bottom: 48px; }
.legal-page h1 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: .08em;
  color: var(--indigo-deep);
  margin-bottom: 28px;
  padding-left: 16px;
  border-left: 4px solid var(--vermilion);
}
.legal-page h2 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--indigo-deep);
  margin: 32px 0 10px;
  letter-spacing: .06em;
}
.legal-page p, .legal-page li { font-size: 14px; color: rgba(29,36,51,.88); margin-bottom: 10px; }
.legal-page ul { padding-left: 22px; }
.legal-page .updated { font-size: 12px; color: rgba(29,36,51,.5); margin-top: 36px; }
.back-link {
  display: inline-block;
  margin-top: 28px;
  color: var(--vermilion);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* ---------- 出現アニメーション ---------- */
.reveal {
  animation: rise .7s cubic-bezier(.22,1,.36,1) both;
}
.reveal:nth-of-type(2) { animation-delay: .08s; }
.reveal:nth-of-type(3) { animation-delay: .16s; }
.hero .reveal:nth-child(1) { animation-delay: .05s; }
.hero .reveal:nth-child(2) { animation-delay: .15s; }
.hero .reveal:nth-child(3) { animation-delay: .25s; }
.input-panel { animation-delay: .3s; }
.result-panel { animation-delay: .4s; }

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

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
  .seg { transition: none; }
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 860px) {
  .simulator { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 24px; }
  .pc-only { display: none; }
  .header-badge { display: none; }
  .panel { padding: 22px 18px; }
  .result-sub { gap: 20px; }
}
