/* 給料マップ - ライトテーマ。統計データを読みやすく見せることを最優先にする。 */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #fafbfc;
  --text: #1a1d23;
  --text-muted: #5b6472;
  --text-faint: #8b939f;
  --border: #e2e6ec;
  --border-strong: #cbd2dc;

  --accent: #1a6fd4;
  --accent-dark: #135aad;
  --accent-soft: #eaf2fd;

  --cta: #e2670f;
  --cta-dark: #c4570a;

  --pos: #0f7d55;
  --neg: #c33f2c;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 30, 50, 0.06), 0 2px 8px rgba(20, 30, 50, 0.04);

  --max: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  font-feature-settings: "palt";
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- ヘッダ ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: .01em; }
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-mark { color: var(--accent); }
.site-nav { display: flex; gap: 18px; font-size: .9rem; margin-left: auto; }
.site-nav a { color: var(--text-muted); }

/* ---------- パンくず ---------- */
.breadcrumb {
  font-size: .82rem;
  color: var(--text-faint);
  padding: 14px 0 0;
  overflow-x: auto;
  white-space: nowrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb span + span::before { content: "›"; margin: 0 8px; color: var(--border-strong); }

/* ---------- 見出し ---------- */
h1 {
  font-size: clamp(1.5rem, 4vw, 2.05rem);
  line-height: 1.35;
  margin: 18px 0 6px;
  letter-spacing: -.01em;
}
h2 {
  font-size: 1.28rem;
  margin: 44px 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
h3 { font-size: 1.05rem; margin: 28px 0 10px; }
.lede { color: var(--text-muted); font-size: .96rem; margin: 0 0 24px; }

/* ---------- カード ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

/* ---------- 数値ハイライト ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: .78rem; color: var(--text-muted); margin-bottom: 4px; }
.stat-value {
  font-size: 1.62rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat-value .unit { font-size: .82rem; font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.stat-sub { font-size: .78rem; color: var(--text-faint); margin-top: 4px; }
.stat.is-primary { background: var(--accent-soft); border-color: #c6dcf8; }
.stat.is-primary .stat-value { color: var(--accent-dark); }

.delta-pos { color: var(--pos); font-weight: 600; }
.delta-neg { color: var(--neg); font-weight: 600; }

/* ---------- 表 ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  background: var(--surface-alt);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-alt); }
tr.is-highlight { background: var(--accent-soft) !important; }
tr.is-highlight td { font-weight: 600; }
.rank-cell { color: var(--text-faint); font-variant-numeric: tabular-nums; width: 3em; }

/* ---------- 横棒グラフ ---------- */
.bars { margin: 16px 0; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(84px, 8em) 1fr minmax(72px, auto);
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  font-size: .86rem;
}
.bar-row .bar-label { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #edf0f4; border-radius: 3px; height: 15px; overflow: hidden; }
.bar-fill { background: var(--accent); height: 100%; border-radius: 3px; }
.bar-row.is-self .bar-fill { background: var(--cta); }
.bar-row.is-self .bar-label { color: var(--text); font-weight: 600; }
.bar-row .bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }

/* ---------- CTA ---------- */
.cta {
  background: linear-gradient(180deg, #fff8f2 0%, #fff 100%);
  border: 1px solid #f5d6b8;
  border-radius: var(--radius);
  padding: 22px;
  margin: 32px 0;
}
.cta-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 8px; }
.cta-body { color: var(--text-muted); font-size: .9rem; margin: 0 0 16px; }
.cta-button {
  display: inline-block;
  background: var(--cta);
  color: #fff;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
}
.cta-button:hover { background: var(--cta-dark); text-decoration: none; }
.cta-note { font-size: .74rem; color: var(--text-faint); margin: 10px 0 0; }

/* ---------- フォーム（年収診断） ---------- */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-row select,
.form-row input {
  width: 100%;
  max-width: 380px;
  padding: 11px 13px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  appearance: none;
}
.form-row select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%235b6472' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
.form-row select:focus,
.form-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
button.cta-button { border: none; cursor: pointer; font-family: inherit; }

/* ---------- リンク一覧 ---------- */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.link-grid a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: .88rem;
  color: var(--text);
}
.link-grid a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.link-grid a .sub { display: block; font-size: .74rem; color: var(--text-faint); }

/* ---------- 出典 ---------- */
.source-note {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: .8rem;
  color: var(--text-muted);
  margin: 36px 0 0;
}
.source-note dt { font-weight: 600; color: var(--text); margin-top: 8px; }
.source-note dd { margin: 2px 0 0; }
.source-note dl { margin: 0; }

/* ---------- フッタ ---------- */
.site-footer {
  margin-top: 56px;
  padding: 28px 0 40px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: .84rem;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }

main { padding-bottom: 20px; }

@media (max-width: 640px) {
  body { font-size: 15px; }
  .card, .cta { padding: 17px; }
  th, td { padding: 8px 10px; }
  .bar-row { grid-template-columns: minmax(70px, 6.5em) 1fr minmax(62px, auto); font-size: .8rem; }
}
