/* =========================================================
   稲荷クラフト 共通スタイル
   和風モダン × ミニマル。色は墨・生成り・朱の3色と白が基本です。
   ガラス表現は写真の上（トップのヘッダーとサーバー状況）だけに使います。
   ========================================================= */
:root {
  /* 基本の3色＋白 */
  --sumi: #242725;           /* 墨：文字・ヘッダー */
  --kinari: #f6f4ef;         /* 生成り：背景 */
  --shu: #a94e42;            /* 朱：主要ボタン・リンク・アクセント（白文字 5.4:1、生成り上 5.0:1） */
  --white: #ffffff;          /* カード・入力欄 */

  /* 朱・墨の濃淡（同系色のみ） */
  --shu-strong: #8f3f35;
  --shu-tint: #f4e7e3;
  --ink: var(--sumi);
  --ink-soft: #5a5f5b;
  --ink-mute: #6b706c;       /* 生成り上 4.6:1 */
  --line: #e4e0d7;
  --line-strong: #cdc8bc;
  --surface: var(--white);
  --surface-2: #faf9f6;
  --sumi-glass: rgba(36, 39, 37, .56);

  /* 機能色（情報の区別にだけ使う） */
  --ok: #2e8b57;
  --up: #2e7d4f;
  --down: #b3392f;
  --chart-a: #a94e42;
  --chart-b: #3f6e8c;

  /* 旧名（スクリプト内のインライン指定が参照）→ 新しい役割へ */
  --bg: var(--kinari);
  --paper: var(--kinari);
  --green: var(--shu);
  --green-strong: var(--shu-strong);
  --green-deep: var(--sumi);
  --green-tint: var(--shu-tint);
  --green-900: var(--sumi);
  --green-800: var(--sumi);
  --green-700: var(--shu);
  --green-600: var(--shu);
  --green-100: var(--shu-tint);
  --green-50: var(--surface-2);
  --gold: var(--shu);
  --gold-500: var(--shu);
  --gold-600: var(--shu-strong);
  --gold-400: #e7b5ab;
  --gold-100: var(--shu-tint);
  --vermilion: var(--shu);
  --vermilion-text: var(--shu);

  /* 形・文字・動き */
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(36, 39, 37, .04);
  --shadow-hover: 0 8px 24px rgba(36, 39, 37, .08);
  --max: 1160px;
  --header-h: 64px;
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --dur: .4s;
  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

/* ---------- 基本 ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--kinari); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.8; letter-spacing: .03em;
  -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--shu); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .2s var(--ease-out); }
a:hover { color: var(--shu-strong); }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.45; letter-spacing: .06em; margin: 0 0 .6em; color: var(--ink); }
p { margin: 0 0 1em; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--shu); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--shu-tint); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .container { padding: 0 16px; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- ヘッダー（墨） ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--sumi); color: var(--kinari);
  transition: background-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--kinari); text-decoration: none; }
.brand:hover { color: var(--white); }
.brand-mark { width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm); object-fit: cover; image-rendering: pixelated; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.15rem; letter-spacing: .14em; }
.global-nav { margin-left: auto; }
.global-nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.global-nav .nav-discord { display: none; }
.header-discord { flex: none; }
.global-nav a {
  position: relative; display: block; padding: 8px 12px; color: rgba(246, 244, 239, .78); text-decoration: none;
  font-size: .9rem; font-weight: 600; transition: color .2s var(--ease-out);
}
/* 下線はホバーで伸び、現在のページでは常に表示 */
.global-nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--shu);
  transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease-out);
}
.global-nav a:hover { color: var(--white); }
.global-nav a:hover::after { transform: scaleX(1); background: rgba(246, 244, 239, .4); }
.global-nav a[aria-current="page"] { color: var(--white); }
.global-nav a[aria-current="page"]::after { transform: scaleX(1); background: var(--shu); }
.nav-toggle {
  display: none; background: none; border: 1px solid rgba(246, 244, 239, .35); border-radius: var(--radius-sm);
  color: var(--kinari); padding: 8px 12px; cursor: pointer; font-size: .9rem; min-height: 40px;
  transition: background-color .2s var(--ease-out);
}
.nav-toggle:hover { background: rgba(255, 255, 255, .08); }
@media (max-width: 1000px) {
  .site-header .header-discord { display: none; }
  .global-nav .nav-discord { display: block; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; }
  /* 開閉は opacity と transform だけで行い、閉じている間は操作対象から外す */
  .global-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--sumi);
    border-top: 1px solid rgba(255,255,255,.08); box-shadow: 0 12px 24px rgba(0,0,0,.2);
    opacity: 0; transform: translateY(-8px); visibility: hidden; pointer-events: none;
    transition: opacity .22s var(--ease-out), transform .22s var(--ease-out), visibility 0s linear .22s;
  }
  .global-nav.is-open { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity .22s var(--ease-out), transform .22s var(--ease-out); }
  .global-nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .global-nav a { padding: 14px 8px; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
  .global-nav li:last-child a { border-bottom: 0; }
  .global-nav a::after { left: 0; right: auto; top: 14px; bottom: 14px; width: 2px; height: auto; transform: scaleY(0); transform-origin: top; }
  .global-nav a:hover::after, .global-nav a[aria-current="page"]::after { transform: scaleY(1); }
}

/* トップ：写真の上に重なる間だけ、半透明の墨（ガラス） */
.has-photo-header .site-header { position: fixed; left: 0; right: 0; background: var(--sumi-glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.has-photo-header .site-header.is-solid { background: var(--sumi); box-shadow: 0 1px 0 rgba(255,255,255,.06); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .has-photo-header .site-header { background: rgba(36, 39, 37, .82); }
}
@media (max-width: 1000px) { .has-photo-header .global-nav { background: var(--sumi); } }

/* ---------- フッター ---------- */
.site-footer { background: var(--sumi); color: #c9cbc7; margin-top: 96px; padding: 48px 0 32px; font-size: .88rem; }
.site-footer a { color: var(--kinari); }
.site-footer a:hover { color: var(--white); }
.site-footer .brand, .site-footer .brand:hover { color: var(--kinari); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-note { margin-top: 32px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); font-size: .76rem; color: #b5b9b5; }

/* ---------- 下層ページの見出し ---------- */
.page-hero { background: var(--kinari); color: var(--ink); padding: 56px 0 32px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: .35em; }
.page-hero p { color: var(--ink-soft); margin: 0; max-width: 46em; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 700; letter-spacing: .18em; color: var(--shu); margin-bottom: 10px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--shu); }
.breadcrumb { font-size: .84rem; margin-bottom: 14px; color: var(--ink-mute); }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--shu); }
.page-hero .hero-actions { margin-top: 24px; }
@media (max-width: 560px) { .page-hero { padding: 32px 0 24px; } }

/* ---------- セクション ---------- */
.section { padding: 80px 0 0; }
@media (max-width: 720px) { .section { padding-top: 56px; } }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); margin: 0; }
.section-lead { color: var(--ink-soft); margin: 8px 0 0; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 11px 24px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.3; letter-spacing: .06em;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out), transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .08s; }
/* 主要ボタン（朱） */
.btn-gold, .btn-green, .btn-primary { background: var(--shu); color: var(--white); }
.btn-gold:hover, .btn-green:hover, .btn-primary:hover { background: var(--shu-strong); color: var(--white); box-shadow: 0 6px 16px rgba(169, 78, 66, .22); }
/* 写真・墨の上の副ボタン */
.btn-outline { border-color: rgba(255,255,255,.7); color: var(--white); background: rgba(36, 39, 37, .2); }
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,.14); color: var(--white); }
/* 生成り・白の上の副ボタン */
.btn-ghost { border-color: var(--line-strong); background: var(--white); color: var(--ink); }
.btn-ghost:hover { border-color: var(--shu); color: var(--shu); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn-sm { padding: 7px 16px; font-size: .88rem; min-height: 38px; }
.btn-lg { min-height: 52px; padding: 13px 30px; font-size: 1.02rem; }
.btn .arr { display: inline-block; transition: transform .2s var(--ease-out); }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- カード・グリッド ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 24px; }
@media (max-width: 560px) { .card-body { padding: 20px; } }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------- ラベル・お知らせ ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 2px 10px;
  border-radius: 999px; background: #ecebe6; color: var(--ink-soft); white-space: nowrap; letter-spacing: .04em;
}
.badge-gold, .badge-red { background: var(--shu-tint); color: var(--shu-strong); }
.badge-gray { background: #ecebe6; color: var(--ink-soft); }

.notice {
  display: flex; gap: 12px; align-items: flex-start; border: 1px solid #e8d2cc; background: #fbf1ee; color: #5c2f28;
  border-radius: var(--radius-sm); padding: 12px 16px; font-size: .9rem; margin-bottom: 20px;
}
.notice strong { color: #4a241e; }
.notice-icon { flex: none; font-weight: 700; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-mute); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.empty strong { display: block; color: var(--ink-soft); margin-bottom: 4px; }
.loading { color: var(--ink-mute); padding: 32px 0; text-align: center; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- 検索・並び替え（情報量の多い部分は不透明でシンプルに） ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1 1 260px; }
.input, .select {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--white); transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.input:hover, .select:hover { border-color: #b9b3a5; }
.input:focus, .select:focus { outline: none; border-color: var(--shu); box-shadow: 0 0 0 3px rgba(169, 78, 66, .15); }
.search-wrap { position: relative; }
.search-wrap .input { padding-left: 40px; }
.search-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-mute); }
.select { width: auto; min-width: 190px; padding-right: 32px; cursor: pointer; }
@media (max-width: 560px) { .toolbar > div { flex: 1 1 100%; } .select { width: 100%; } }

/* 切替タブ（市場・期間） */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.segmented button {
  border: 0; background: transparent; padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; min-height: 38px;
  font-size: .9rem; font-weight: 600; color: var(--ink-soft); transition: background-color .2s var(--ease-out), color .2s var(--ease-out), transform .2s var(--ease-out);
}
.segmented button:hover { color: var(--ink); background: var(--surface-2); }
.segmented button:active { transform: scale(.97); }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--sumi); color: var(--white); }

.meta-line { font-size: .82rem; color: var(--ink-mute); margin-bottom: 12px; }

/* ---------- 表 ---------- */
.table-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; overflow-y: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.data-table th, .data-table td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table thead th { background: var(--surface-2); font-size: .78rem; color: var(--ink-soft); font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background-color .15s var(--ease-out); }
.data-table tbody tr.is-link { cursor: pointer; }
.data-table tbody tr.is-link:hover { background: #faf6f4; }
.data-table tbody tr.is-link:focus-visible { outline-offset: -2px; }
.data-table .num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-sort { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; display: inline-flex; gap: 4px; align-items: center; letter-spacing: inherit; }
.th-sort:hover { color: var(--shu); }
.th-sort .arrow { opacity: .35; font-size: .7rem; }
.th-sort[aria-sort] .arrow { opacity: 1; color: var(--shu); }

.rank-no { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: var(--radius-sm); font-family: var(--font-num); font-weight: 700; font-size: .88rem; background: #ecebe6; color: var(--ink-soft); }
.rank-no.r1 { background: var(--shu); color: var(--white); }
.rank-no.r2 { background: var(--sumi); color: var(--white); }
.rank-no.r3 { background: #8a8d89; color: var(--white); }

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--ink-mute); }

.item-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item-icon {
  width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm); background: #efede8;
  display: grid; place-items: center; overflow: hidden; image-rendering: pixelated;
  font-family: var(--font-serif); font-weight: 600; color: var(--ink-soft); font-size: .95rem;
}
.item-icon img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.item-name { font-weight: 700; }
a.item-name { color: var(--ink); text-decoration: none; }
a.item-name:hover { color: var(--shu); text-decoration: underline; }
.item-sub { display: block; font-size: .76rem; color: var(--ink-mute); }

@media (max-width: 720px) {
  .data-table.responsive thead { display: none; }
  .data-table.responsive, .data-table.responsive tbody, .data-table.responsive tr, .data-table.responsive td { display: block; width: 100%; }
  .data-table.responsive tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .data-table.responsive tbody tr:last-child { border-bottom: 0; }
  .data-table.responsive td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .data-table.responsive td::before { content: attr(data-label); color: var(--ink-mute); font-size: .8rem; text-align: left; font-family: var(--font-sans); }
  .data-table.responsive td.cell-main { padding-bottom: 8px; display: block; text-align: left; }
  .data-table.responsive td.cell-main::before { display: none; }
  .data-table.responsive td.num { font-size: .95rem; }
}

/* ---------- トップ：メインビジュアル ---------- */
.hero { position: relative; overflow: hidden; color: var(--white); background: var(--sumi); }
.hero-photo { min-height: min(92vh, 820px); display: flex; align-items: flex-end; }
.hero-bg, .hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-bg img { object-fit: cover; object-position: 50% 40%; }
/* 写真の色はそのまま。文字の読みやすさのため、下側と上端（ヘッダー部分）だけを暗くする */
.hero-photo::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(36,39,37,.35) 0%, rgba(36,39,37,0) 18%),
    linear-gradient(0deg, rgba(36,39,37,.82) 0%, rgba(36,39,37,.45) 30%, rgba(36,39,37,0) 58%);
}
.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: end; padding-top: calc(var(--header-h) + 96px); padding-bottom: 56px; }
.hero-text { max-width: 640px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 700; letter-spacing: .2em; color: #f3e6e2; margin: 0 0 12px; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.hero-kicker::before { content: ""; width: 24px; height: 2px; background: var(--shu); }
.hero h1 { color: var(--white); font-size: clamp(2.6rem, 7vw, 4.4rem); font-weight: 600; letter-spacing: .16em; margin: 0 0 16px; text-shadow: 0 2px 16px rgba(0,0,0,.35); }
.hero-lead { font-size: clamp(1rem, 2.2vw, 1.12rem); color: rgba(255,255,255,.94); margin: 0; max-width: 34em; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-credit { position: absolute; left: 16px; bottom: 12px; z-index: 2; margin: 0; font-size: .7rem; color: rgba(255,255,255,.7); text-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* 写真の上のサーバー状況（控えめなガラス） */
.status-card {
  background: var(--sumi-glass); -webkit-backdrop-filter: blur(10px) saturate(115%); backdrop-filter: blur(10px) saturate(115%);
  border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius); padding: 20px 22px; color: var(--white);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .status-card { background: rgba(36, 39, 37, .84); } }
.status-card h2 { color: var(--white); font-family: var(--font-sans); font-size: .95rem; font-weight: 700; letter-spacing: .1em; margin: 0 0 2px; }
.status-card .status-sub { font-size: .8rem; color: rgba(255,255,255,.75); margin: 0 0 12px; }
.status-panel { margin: 0; }
.status-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.12); margin: 0; }
.status-row:first-child { border-top: 0; }
.status-row .label { font-size: .8rem; color: rgba(255,255,255,.72); flex: none; }
.status-row .value { font-family: var(--font-num); font-weight: 700; font-size: .9rem; text-align: right; word-break: break-all; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 6px; margin: 0; }
.status-note { margin: 10px 0 0; font-size: .86rem; text-align: right; }
.status-note a { color: var(--white); }
.status-note a:hover { color: #f3e6e2; }
.status-card .copy-btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.28); color: var(--white); }
.status-card .copy-btn:hover { background: rgba(255,255,255,.2); border-color: var(--white); color: var(--white); }
.status-card .copy-btn.is-copied { background: var(--white); color: var(--sumi); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #9aa09b; margin-right: 6px; vertical-align: middle; flex: none; }
.status-dot.on { background: #4cc082; box-shadow: 0 0 0 3px rgba(76,192,130,.22); }
.status-dot.off { background: #e0675a; }
.port-line { font-weight: 400; font-size: .85rem; }
@media (max-width: 960px) {
  .hero-photo { min-height: 0; display: block; }
  .hero-grid { grid-template-columns: 1fr; padding-top: calc(var(--header-h) + 34vw); padding-bottom: 32px; gap: 28px; }
  .hero-photo::before { background: linear-gradient(180deg, rgba(36,39,37,.35) 0%, rgba(36,39,37,0) 14%), linear-gradient(0deg, rgba(36,39,37,.92) 0%, rgba(36,39,37,.7) 45%, rgba(36,39,37,0) 75%); }
  .hero-credit { left: auto; right: 12px; bottom: auto; top: calc(var(--header-h) + 8px); }
}
@media (max-width: 560px) {
  .hero-grid { padding-top: calc(var(--header-h) + 46vw); }
  .hero-actions .btn { flex: 1 1 100%; }
}

/* コピー（成功時だけ表示を切り替える） */
.copy-btn {
  display: inline-flex; align-items: center; gap: 4px; background: var(--white); border: 1px solid var(--line-strong); color: var(--ink);
  border-radius: var(--radius-sm); font-size: .74rem; padding: 3px 9px; cursor: pointer; font-family: var(--font-sans); font-weight: 600;
  min-height: 28px; letter-spacing: .04em; transition: background-color .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out), transform .12s var(--ease-out);
}
.copy-btn:hover { border-color: var(--shu); color: var(--shu); }
.copy-btn:active { transform: scale(.95); }
.copy-btn.is-copied { background: var(--sumi); border-color: var(--sumi); color: var(--white); }
.copy-btn svg { width: 12px; height: 12px; }

/* トップ：特徴 */
.feature { padding: 28px 24px 26px; }
.feature-kanji {
  font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; color: var(--shu);
  width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  margin-bottom: 16px; background: var(--surface-2);
}
.feature h3 { font-size: 1.15rem; margin-bottom: .45em; }
.feature p { color: var(--ink-soft); font-size: .94rem; margin: 0; }

/* クリックできるカード：わずかに浮き、枠が朱に。情報だけのカードは動かない */
.link-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; height: 100%; transition: border-color .25s var(--ease-out), box-shadow .25s var(--ease-out), transform .25s var(--ease-out); }
.link-card:hover { border-color: var(--shu); color: inherit; box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.link-card:active { transform: translateY(0); }
.link-card .card-body { flex: 1; display: flex; flex-direction: column; }
.link-card h3 { font-size: 1.12rem; }
.link-card p { color: var(--ink-soft); font-size: .92rem; flex: 1; }
.link-card .more { font-weight: 700; color: var(--shu); font-size: .9rem; }
.link-card .more::after { content: "→"; display: inline-block; margin-left: 6px; transition: transform .25s var(--ease-out); }
.link-card:hover .more::after { transform: translateX(4px); }
.link-card-icon { width: 32px; height: 32px; color: var(--shu); margin-bottom: 14px; }

/* お知らせ */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-item { display: grid; grid-template-columns: 110px auto 1fr; gap: 6px 16px; align-items: baseline; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-date { font-family: var(--font-num); color: var(--ink-mute); font-size: .86rem; }
.news-title { font-weight: 700; }
.news-body { grid-column: 3; color: var(--ink-soft); font-size: .92rem; margin: 0; }
@media (max-width: 640px) {
  .news-item { grid-template-columns: auto 1fr; padding: 16px 20px; }
  .news-title, .news-body { grid-column: 1 / -1; }
}

/* 参加への導線（墨） */
.cta-band {
  background: var(--sumi); color: var(--white); border-radius: var(--radius); padding: 40px;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.cta-band h2 { color: var(--white); margin: 0 0 6px; font-size: 1.5rem; }
.cta-band p { margin: 0; color: rgba(255,255,255,.8); }
.cta-band .hero-actions { margin: 0; }
@media (max-width: 560px) { .cta-band { padding: 28px 22px; } .cta-band .btn { flex: 1 1 100%; } }

/* ---------- 参加方法 ---------- */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.conn-card h2 { font-size: 1.2rem; margin-bottom: 4px; }
.conn-card .section-lead { margin: 0 0 16px; font-size: .9rem; }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps > li { counter-increment: step; position: relative; padding: 20px 24px 20px 72px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 24px; top: 20px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--shu); color: var(--shu); display: grid; place-items: center; font-weight: 700; font-family: var(--font-num); font-size: .9rem;
}
.steps h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 700; letter-spacing: .03em; margin-bottom: .3em; }
.steps p { margin: 0; color: var(--ink-soft); font-size: .93rem; }
@media (max-width: 560px) { .steps > li { padding: 18px 18px 18px 60px; } .steps > li::before { left: 16px; top: 18px; } }
.addr-box {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 12px; margin-top: 10px; font-family: var(--font-num); font-weight: 700; max-width: 100%;
}
.rule-list { margin: 0; padding-left: 1.3em; color: var(--ink-soft); }
.rule-list li { margin-bottom: .4em; }
.conn-summary { margin-bottom: 20px; }
.conn-summary .dl-grid, .card .dl-grid { align-items: center; }
.conn-summary .addr-box, .dl-grid .addr-box { margin-top: 0; }
.method-title { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; letter-spacing: .03em; }
.addr-text { white-space: nowrap; }
@media (max-width: 560px) {
  .card .dl-grid { grid-template-columns: 1fr; gap: 2px; }
  .card .dl-grid dd { margin-bottom: 10px; }
  .card .dl-grid dd:last-child { margin-bottom: 0; }
  .addr-text { white-space: normal; word-break: break-all; }
}

/* ---------- 詳細ダイアログ ---------- */
dialog.panel {
  border: 0; padding: 0; border-radius: var(--radius); width: min(780px, calc(100% - 24px)); max-height: calc(100vh - 32px);
  box-shadow: 0 24px 60px rgba(20,22,21,.28); color: var(--ink); background: var(--white);
}
dialog.panel[open] { animation: dialog-in .25s var(--ease-out); }
dialog.panel::backdrop { background: rgba(36, 39, 37, .5); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.99); } }
.panel-head { display: flex; align-items: center; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--white); z-index: 1; }
.panel-head h2 { margin: 0; font-size: 1.25rem; flex: 1; }
.panel-close { border: 1px solid var(--line); background: var(--surface-2); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; line-height: 1; transition: border-color .2s var(--ease-out), transform .12s var(--ease-out); }
.panel-close:hover { border-color: var(--shu); }
.panel-close:active { transform: scale(.94); }
.panel-body { padding: 20px 24px 24px; }

/* 数値のまとめ */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.panel .stat { background: var(--surface-2); }
.stat .k { font-size: .76rem; color: var(--ink-mute); font-weight: 700; letter-spacing: .06em; }
.stat .v { font-family: var(--font-num); font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.4; }
.stat .v small { font-size: .68em; color: var(--ink-mute); margin-left: 2px; font-family: var(--font-sans); }

/* ---------- グラフ ---------- */
.chart-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; }
.chart-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.chart-head h3 { margin: 0; font-size: 1rem; font-family: var(--font-sans); font-weight: 700; letter-spacing: .03em; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis-label { fill: var(--ink-mute); font-size: 11px; font-family: var(--font-num); }
.chart-legend { display: flex; gap: 18px; font-size: .84rem; color: var(--ink-soft); margin-top: 8px; flex-wrap: wrap; }
.chart-legend span::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--c); margin-right: 6px; vertical-align: middle; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--sumi); color: var(--white); font-size: .78rem;
  padding: 6px 10px; border-radius: var(--radius-sm); white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .12s;
  font-family: var(--font-num);
}
.chart-tip.show { opacity: 1; }
.chart-empty { padding: 40px 16px; text-align: center; color: var(--ink-mute); font-size: .9rem; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }

/* ---------- 会社・自治体の詳細 ---------- */
.company-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.company-head h1 { margin: 0 0 6px; }
.company-emblem {
  width: 64px; height: 64px; border-radius: var(--radius); background: var(--sumi); color: var(--white);
  display: grid; place-items: center; font-family: var(--font-serif); font-size: 1.8rem; font-weight: 600; flex: none;
}
.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; font-size: .94rem; }
.dl-grid dt { color: var(--ink-mute); font-weight: 700; font-size: .84rem; }
.dl-grid dd { margin: 0; }
.member-list { list-style: none; margin: 0; padding: 0; }
.member-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .94rem; }
.member-list li:last-child { border-bottom: 0; }
.member-list .role { color: var(--ink-mute); font-size: .84rem; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* 自治体カード（詳細へ移動できるカード） */
.muni-card { display: flex; flex-direction: column; transition: border-color .25s var(--ease-out), box-shadow .25s var(--ease-out), transform .25s var(--ease-out); }
.muni-card:hover { border-color: var(--shu); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.muni-card h3 { font-size: 1.2rem; margin-bottom: .3em; }
.muni-card h3 a { color: var(--ink); text-decoration: none; }
.muni-card h3 a::after { content: "→"; display: inline-block; margin-left: 6px; color: var(--shu); font-size: .85em; transition: transform .25s var(--ease-out); }
.muni-card:hover h3 a::after { transform: translateX(4px); }
.muni-card h3 a:hover { color: var(--shu); }
.muni-card .muni-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.muni-card p { color: var(--ink-soft); font-size: .9rem; margin-bottom: 12px; }
.muni-card .dl-grid { font-size: .9rem; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- リアルタイム同期の状態表示 ---------- */
.live-status { display: flex; gap: 10px; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 20px; font-size: .88rem; color: var(--ink-soft); transition: border-color .3s var(--ease-out), background-color .3s var(--ease-out); }
.live-status .status-dot { margin-top: .55em; }
.live-status strong { display: block; color: var(--ink); }
.live-status.is-off { border-left-color: var(--down); background: #fbf1ee; }
.territory-map { width: 100%; max-width: 420px; max-height: 320px; height: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.territory-map rect.cell { fill: var(--sumi); fill-opacity: .35; stroke: var(--sumi); stroke-width: .06; }
.territory-map circle.center { fill: var(--shu); stroke: var(--white); stroke-width: .12; }
.dissolved-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .92rem; color: var(--ink-soft); }
details.card > summary { cursor: pointer; font-weight: 700; }

/* 価格の見方 */
.price-help { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 16px; font-size: .88rem; color: var(--ink-soft); }
.price-help summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.price-help ul { margin: 8px 0 0; padding-left: 1.2em; }
.price-help li + li { margin-top: 4px; }

/* プレイヤーが付けた長い名前（区切りのない英数字など）でも表やカードがはみ出さないように折り返す */
.data-table td, .item-name, .muni-card h3, .company-head h1, .dl-grid dd, .breadcrumb span { overflow-wrap: anywhere; word-break: normal; }
.data-table td.cell-main { min-width: 0; }

/* =========================================================
   アニメーション
   ・ページを開いたとき：ヘッダー → 見出し → 説明・ボタン → サーバー状況 の順に 250〜450ms で表示
   ・スクロール：セクションとカードを初回だけフェードイン（表の行は対象外）
   ・ページ遷移：対応ブラウザだけ View Transitions で短くクロスフェード
   すべて opacity と transform だけを使い、prefers-reduced-motion では無効にします。
   ========================================================= */
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-8px); } }
@keyframes fade-in { from { opacity: 0; } }

.site-header { animation: fade-down .35s var(--ease-out) both; }
.hero-bg img { animation: fade-in .5s var(--ease-out) both; }
.hero-kicker { animation: rise-in .45s var(--ease-out) .06s both; }
.hero h1 { animation: rise-in .45s var(--ease-out) .12s both; }
.hero-lead { animation: rise-in .45s var(--ease-out) .2s both; }
.hero-actions { animation: rise-in .45s var(--ease-out) .28s both; }
.status-card { animation: rise-in .45s var(--ease-out) .36s both; }
.page-hero .container > * { animation: rise-in .4s var(--ease-out) both; }
.page-hero .container > :nth-child(1) { animation-delay: .04s; }
.page-hero .container > :nth-child(2) { animation-delay: .1s; }
.page-hero .container > :nth-child(3) { animation-delay: .16s; }
.page-hero .container > :nth-child(4) { animation-delay: .22s; }

/* スクロールで現れる要素。JS が準備できた要素（画面外のもの）だけを隠すため、JS が動かなくても内容は表示されます */
.reveal-wait { opacity: 0; transform: translateY(12px); }
.reveal-in { opacity: 1; transform: none; transition: opacity .45s var(--ease-out) var(--reveal-delay, 0s), transform .45s var(--ease-out) var(--reveal-delay, 0s); }

/* ページ遷移（同一オリジンの移動だけが対象。非対応ブラウザは通常の遷移） */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .18s var(--ease-out) both vt-out; }
::view-transition-new(root) { animation: .28s var(--ease-out) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-wait { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
