/* ========================================
   PATAPI 共有スタイル（ライトテーマ）
   home.html / brokers.html / index.html(非公開) が共有。
   トークンは server.js の CMS_CSS と同一に揃える。
   ======================================== */

:root{
  --bg:#f7f6f2;          /* ページ背景 */
  --card:#ffffff;        /* カード／ヘッダー背景 */
  --soft:#ebeae4;        /* 薄い面（パネルヘッダー等） */
  --line:#e8e7e2;        /* 枠線（濃いめ） */
  --line2:#ecebe4;       /* 枠線（薄め） */
  --txt:#23252b;         /* 本文文字 */
  --head:#16181d;        /* 見出し文字 */
  --mut:#6b6e76;         /* 補助文字 */
  --mut2:#8a8d94;        /* 補助文字（薄め） */
  --acc:#157a3c;         /* アクセント */
  --lng:#1d9e75;         /* ロング（買い）バー */
  --lngT:#0f6e56;        /* ロング文字 */
  --sht:#d85a30;         /* ショート（売り）バー */
  --shtT:#993c1d;        /* ショート文字 */
  --warn:#a86b1d;        /* 中立／警戒（ライト用に調整） */
  --tintA:#f3f7f3;       /* アクセント淡色（平均行ハイライト等） */
  --tintAL:#cfe3d4;      /* アクセント淡色の枠 */
  --pr-bg:#fffaf2;       /* PR/広告 地 */
  --pr-line:#f0e2c8;     /* PR/広告 枠 */
  --pr-txt:#a78b4e;      /* PR/広告 文字 */
}

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

body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Segoe UI', 'Helvetica Neue', sans-serif;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

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

/* ========================================
   共通グローバルヘッダー（server.js の globalHeader と同一マークアップ）
   ======================================== */

.gh {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--line2);
}
.gh-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  position: relative;
}
.gh-logo { margin-right: 8px; }
.gh-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--head);
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gh-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--acc); }
.gh-nav { display: flex; align-items: center; gap: 10px 14px; font-size: 14px; flex-wrap:wrap}
.gh-link { color: #3f424a; padding-bottom: 3px; white-space:nowrap}
.gh-link.on { color: var(--acc); font-weight: 600; border-bottom: 2px solid var(--acc); }
.gh-toggle, .gh-burger { display: none; }

/* ========================================
   ダッシュボードのコントロールバー（ペア選択）
   ======================================== */

.dash-controls {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-controls .dash-label {
  font-size: 13px;
  color: var(--mut);
}

/* 旧ヘッダー（互換のため残置：index.html 等で使用） */
.header {
  padding: 10px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 100;
}

.header h1 {
  font-size: 24px;
  color: var(--head);
  font-weight: 700;
  letter-spacing: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}

#pairSelect {
  background: var(--card);
  color: var(--txt);
  border: 1px solid #d8d6cd;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  min-width: 120px;
}

#pairSelect:hover {
  border-color: #b9b7ac;
}

#pairSelect optgroup {
  background: var(--card);
  color: var(--mut);
  font-style: normal;
  font-size: 12px;
}

#pairSelect option {
  background: var(--card);
  color: var(--txt);
  padding: 2px 8px;
}

.status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cfcdc5;
}

.status-dot.ok { background: #1d9e75; }
.status-dot.warn { background: #e0922e; }
.status-dot.error { background: #d85a30; }

/* サマリーバー */
.summary-bar {
  padding: 10px 16px;
  background: var(--soft);
  border-bottom: 1px solid var(--line2);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 8px;
  min-width: 78px;
}

.summary-item .label {
  color: var(--mut2);
  font-size: 11px;
  line-height: 1.2;
}

.summary-item .value {
  color: var(--head);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.value.positive { color: var(--lngT); }
.value.negative { color: var(--shtT); }
.value.neutral  { color: var(--warn); }

/* 建値ゾーン */
.entry-zone {
  padding: 10px 16px 12px;
  background: var(--soft);
  border-bottom: 1px solid var(--line2);
  display: flex;
  gap: 10px;
  font-size: 13px;
  flex-wrap: wrap;
}

.entry-zone .zone-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 8px;
  min-width: 110px;
}

.entry-zone .zone-item .label {
  color: var(--mut2);
  font-size: 11px;
  line-height: 1.2;
}

.entry-zone .zone-item .value {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.zone-long { color: var(--lngT); }
.zone-short { color: var(--shtT); }

/* 指標パネル群 */
.panels-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--soft);
  border-bottom: 1px solid var(--line2);
  user-select: none;
}

.panel-header:hover {
  background: #f4f3ed;
}

.panel-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--head);
  font-variant-numeric: tabular-nums;
}

/* チャート領域 - position:relativeはクロスヘア同期用 */
.panel-chart {
  height: 120px;
  width: 100%;
  position: relative;
}

.panel-chart.tall {
  height: 200px;
}

.panel-chart.indicator-chart2 {
  height: 140px;
  border-top: 1px solid var(--line2);
}

/* クロスヘア同期線 */
.sync-crosshair {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(20, 22, 27, 0.22);
  pointer-events: none;
  display: none;
  z-index: 10;
}

/* 指標セレクタ */
.indicator-selector-header {
  padding: 8px 12px;
}

#indicatorSelect {
  background: var(--card);
  color: var(--txt);
  border: 1px solid #d8d6cd;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  max-width: 70%;
}

#indicatorSelect:hover {
  border-color: #b9b7ac;
}

/* チャート凡例 */
.chart-legend {
  display: flex;
  gap: 12px;
  padding: 4px 12px 6px;
  background: var(--soft);
  font-size: 11px;
  color: var(--mut);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-color {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 1px;
}

.legend-color.dashed {
  border-top: 2px dashed;
  background: none !important;
  height: 0;
}

/* 空データ表示 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  color: var(--mut);
  gap: 12px;
}

.empty-state h2 {
  font-size: 20px;
  color: var(--head);
}

.empty-state p {
  font-size: 14px;
  max-width: 500px;
  text-align: center;
  line-height: 1.6;
  color: var(--mut);
}

/* ========================================
   レスポンシブ（スマホ対応）
   ======================================== */

@media (max-width: 768px) {
  .header {
    padding: 8px 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .header h1 {
    font-size: 20px;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  #pairSelect {
    font-size: 14px;
    padding: 6px 8px;
    flex: 1;
    max-width: 45%;
  }

  #lastUpdate {
    display: none;
  }

  .summary-bar {
    padding: 6px 12px;
    gap: 10px;
    font-size: 12px;
  }

  .entry-zone {
    padding: 6px 12px;
    gap: 10px;
    font-size: 12px;
  }

  /* 価格チャート: スマホでも大きめに */
  #priceChart {
    height: 300px !important;
  }

  /* 指標チャート */
  .panel-chart.tall {
    height: 180px;
  }

  .panel-chart.indicator-chart2 {
    height: 120px;
  }

  .indicator-selector-header {
    padding: 6px 8px;
  }

  #indicatorSelect {
    font-size: 12px;
    max-width: 65%;
  }

  .chart-legend {
    gap: 8px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .panel-value {
    font-size: 11px;
  }
}

@media (max-width: 400px) {
  .header h1 {
    font-size: 18px;
  }

  .summary-bar {
    gap: 8px;
    font-size: 11px;
  }

  .summary-item {
    min-width: 64px;
    padding: 5px 9px;
  }

  .summary-item .value {
    font-size: 14px;
  }

  .entry-zone {
    gap: 8px;
  }

  .entry-zone .zone-item {
    min-width: 0;
    flex: 1 1 calc(50% - 8px);
    padding: 5px 9px;
  }

  .entry-zone .zone-item .value {
    font-size: 13px;
  }

  #priceChart {
    height: 250px !important;
  }

  .panel-chart.tall {
    height: 150px;
  }

  .panel-chart.indicator-chart2 {
    height: 100px;
  }
}

/* ========================================
   ブローカー比率ページ レイアウト
   ======================================== */

.broker-layout {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-areas:
    "main side"
    "main sidead";
  gap: 14px;
  align-items: start;
  padding: 14px 20px 24px;
}

.broker-main { grid-area: main; min-width: 0; }
.broker-side { grid-area: side; }
.broker-side-ad { grid-area: sidead; }

/* 表示トグル（凡例兼用） */
.toggle-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 4px 12px;
}

.toggle-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--txt);
  cursor: pointer;
  user-select: none;
  line-height: 1.2;
}

.toggle-item:hover { border-color: #c9c7bd; }

.toggle-item--avg {
  background: var(--tintA);
  border-color: var(--tintAL);
}

.toggle-item input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--acc);
  cursor: pointer;
  margin: 0;
}

.toggle-swatch {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 1px;
}

.toggle-swatch--avg { height: 4px; }

.toggle-label { font-weight: 600; color: var(--head); }

.toggle-val {
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}

.toggle-note {
  font-size: 10px;
  color: var(--pr-txt);
  border: 1px solid var(--pr-line);
  background: var(--pr-bg);
  border-radius: 3px;
  padding: 0 4px;
}

/* 価格チャート「データなし」 */
.price-empty {
  padding: 10px 12px;
  color: var(--mut);
  font-size: 12px;
}

/* ========================================
   現在値一覧（サイド）
   ======================================== */

.side-panel {
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 10px;
  overflow: hidden;
}

.side-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--soft);
  border-bottom: 1px solid var(--line2);
}

.side-panel-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.side-panel-sub {
  font-size: 11px;
  color: var(--mut2);
  font-variant-numeric: tabular-nums;
}

.current-list {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cur-row { display: flex; flex-direction: column; gap: 4px; }

.cur-row--avg {
  padding: 6px 8px;
  margin: -2px -4px 2px;
  background: var(--tintA);
  border: 1px solid var(--tintAL);
  border-radius: 6px;
}

.cur-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.cur-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cur-name {
  color: var(--head);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cur-row--avg .cur-name { color: var(--head); }

.cur-note {
  font-size: 9px;
  color: var(--pr-txt);
  margin-left: 5px;
  vertical-align: middle;
}

.cur-val {
  margin-left: auto;
  color: var(--mut);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cur-bar {
  display: flex;
  height: 8px;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  background: #eceae3;
}

.cur-bar-long { background: var(--lng); height: 100%; }
.cur-bar-short { background: var(--sht); height: 100%; }

/* ========================================
   広告枠（チャートに被せない）
   ======================================== */

/* === 広告枠 一時非表示（アクセスが集まるまで） ===
   復活させるときは、この .ad-hidden ブロックだけ削除すればよい。
   HTML側の枠は残してあるので、削除で即復活する。 */
.ad-slot,
.ad-footer-mobile,
.home-ad {
  display: none !important;
}
/* === ここまで（復活時はこのブロックを削除） === */

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pr-bg);
  border: 1px dashed var(--pr-line);
  border-radius: 8px;
  color: var(--pr-txt);
}

.ad-banner {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 14px auto 0;
}

.ad-rectangle {
  width: 300px;
  height: 250px;
  max-width: 100%;
  margin: 0 auto;
}

.ad-placeholder {
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* スマホ固定フッター広告 */
.ad-footer-mobile {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50px;
  align-items: center;
  justify-content: center;
  background: var(--pr-bg);
  border-top: 1px solid var(--pr-line);
  z-index: 200;
}

.ad-footer-close {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: #ece6d8;
  color: var(--pr-txt);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

/* ブローカーページ レスポンシブ */
@media (max-width: 900px) {
  .broker-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "side"
      "main"
      "sidead";
    padding: 12px;
    gap: 10px;
  }

  #brokerChart { height: 340px !important; }

  .ad-footer-mobile { display: flex; }

  /* フッター広告に被らないよう下部に余白 */
  body { padding-bottom: 58px; }
}

/* ========================================
   トップ（説明）ページ
   ======================================== */

.home-body { padding-bottom: 0; }

.home-tag {
  color: var(--mut2);
  font-size: 13px;
  letter-spacing: 1px;
}

.home-nav-link {
  color: var(--acc);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}
.home-nav-link:hover { text-decoration: underline; }

.home-hero {
  padding: 64px 20px 56px;
  background:
    radial-gradient(900px 360px at 78% -8%, rgba(21,122,60,0.07), transparent 70%),
    radial-gradient(700px 320px at 10% 4%, rgba(29,158,117,0.06), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line2);
}

.home-hero-inner { max-width: 920px; margin: 0 auto; }

.home-kicker {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--acc);
  font-weight: 700;
  margin-bottom: 16px;
}

.home-hero-title {
  font-size: 40px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--head);
  letter-spacing: 0.5px;
}

.home-accent { color: var(--acc); }

.home-hero-sub {
  margin-top: 22px;
  max-width: 640px;
  color: var(--mut);
  font-size: 15px;
  line-height: 1.8;
}

.home-cta-row {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.home-cta-row--center { justify-content: center; margin-top: 24px; }

.home-cta {
  display: inline-block;
  background: var(--acc);
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: 8px;
  text-decoration: none;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 22px rgba(21,122,60,0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.home-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(21,122,60,0.26); }

.home-cta-note { color: var(--mut2); font-size: 13px; }

.home-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 20px;
  border-bottom: 1px solid var(--line2);
}

.home-section--quiet { padding: 28px 20px 36px; }

.home-section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--head);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.home-section-sub {
  color: var(--mut);
  font-size: 14px;
  margin-bottom: 22px;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.home-card {
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 22px 20px;
}

.home-card-icon {
  font-size: 26px;
  color: var(--acc);
  margin-bottom: 12px;
  line-height: 1;
}

.home-card h4 {
  font-size: 16px;
  color: var(--head);
  margin-bottom: 8px;
  font-weight: 700;
}

.home-card p {
  font-size: 13.5px;
  color: var(--mut);
  line-height: 1.75;
}

.home-broker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.home-broker-item {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 14px;
}

.home-broker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.home-broker-name { color: var(--head); font-weight: 600; }

.home-broker-note {
  margin-left: auto;
  font-size: 11px;
  color: var(--mut2);
  text-align: right;
}

.home-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.home-steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: var(--txt);
  font-size: 14px;
  line-height: 1.7;
}

.home-steps strong { color: var(--head); }

.home-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tintA);
  border: 1px solid var(--tintAL);
  color: var(--acc);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.home-disclaimer {
  max-width: 920px;
  margin: 0 auto;
  color: var(--mut);
  font-size: 12.5px;
  line-height: 1.9;
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px 40px;
  color: var(--mut2);
  font-size: 13px;
  letter-spacing: 1px;
}

.home-footer-dot { color: var(--line); }

@media (max-width: 768px) {
  .home-hero { padding: 44px 16px 40px; }
  .home-hero-title { font-size: 28px; }
  .home-hero-sub { font-size: 14px; }
  .home-section { padding: 36px 16px; }
  .home-feature-grid { grid-template-columns: 1fr; }
  .home-broker-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 460px) {
  .home-broker-grid { grid-template-columns: 1fr; }
  .home-hero-title { font-size: 24px; }
}

/* ========================================
   グローバルヘッダー レスポンシブ（CSSのみのハンバーガー）
   ======================================== */
@media (max-width: 1080px) {
  .gh-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--card);
    border-bottom: 1px solid var(--line2);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 6px 0;
    display: none;
  }
  .gh-nav .gh-link { width: 100%; padding: 11px 20px; }
  .gh-link.on { border-bottom: none; background: var(--tintA); }
  .gh-toggle:checked ~ .gh-nav { display: flex; }
  .gh-burger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 6px;
  }
  .gh-burger span { width: 22px; height: 2px; background: #3f424a; border-radius: 2px; }
}

/* ========================================
   広告ブロック検知 お願いポップアップ
   ======================================== */

.adblock-modal {
  position: fixed;
  inset: 0;
  display: none;            /* JSで flex に */
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 18, 0.45);
  z-index: 1000;
  padding: 20px;
}

.adblock-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 440px;
  width: 100%;
  padding: 24px 22px 20px;
  box-shadow: 0 20px 60px rgba(20, 22, 27, 0.18);
}

.adblock-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--head);
  margin-bottom: 12px;
}

.adblock-text {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--txt);
}

.adblock-text strong { color: var(--acc); font-weight: 700; }

.adblock-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.adblock-btn {
  flex: 1;
  min-width: 140px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--txt);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.adblock-btn:hover { border-color: #c9c7bd; }

.adblock-btn--primary {
  background: var(--acc);
  border-color: var(--acc);
  color: #ffffff;
  font-weight: 800;
}

.adblock-btn--primary:hover {
  background: #11692f;
  border-color: #11692f;
}

@media (max-width: 480px) {
  .adblock-btn { min-width: 100%; }
}

/* トップページの広告枠（センタリング＋区切りの余白） */
.home-ad {
  display: flex;
  justify-content: center;
  padding: 22px 16px;
}
.home-ad .ad-banner { margin: 0; }


/* ============================================================
   CMS/記事テンプレ共通スタイル（旧 lib.php patapi_cms_css を統合）
   色は :root に統一済み。本文サイズは .art-body 側で用途別。
   ============================================================ */
.wrap{max-width:1480px;margin:0;padding:24px clamp(16px,2.5vw,32px) 64px}
.shell{max-width:1560px;margin:0 auto;padding:20px clamp(12px,2vw,24px) 56px;display:flex;gap:28px;align-items:flex-start}
.shell-main{flex:1;min-width:0}
.shell-side{width:300px;flex-shrink:0}
.shell-full .shell-main{width:100%}
@media (max-width:980px){
  .shell{flex-direction:column;gap:24px;padding-top:16px}
  .shell-side{width:100%;position:static;top:auto}
}
.page-fw{max-width:1480px;margin:0;padding:24px clamp(16px,2.5vw,32px) 0}
.layout{display:flex;gap:30px;align-items:flex-start}
.layout.single{display:block}
.main{flex:1;min-width:0}
.side{width:300px;flex-shrink:0}
.side-list{margin-top:104px}
.bc{font-size:13px;color:var(--mut2);margin:0 0 6px}
.page-title{font-size:21px;font-weight:700;color:var(--head);line-height:1.35;margin:0 0 5px}
.page-lead{font-size:13.5px;color:var(--mut);line-height:1.55;margin:0 0 12px}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 20px}
.chip{font-size:15px;background:var(--card);color:#5a5d65;border:1px solid #e2e0d9;padding:5px 14px;border-radius:20px}
.chip.on{background:var(--acc);color:#fff;border-color:var(--acc)}
.cards{display:flex;flex-direction:column;gap:14px}
.card{display:flex;gap:14px;background:var(--card);border:1px solid var(--line2);border-radius:10px;padding:12px}
.card:hover{border-color:#d8d6cd}
.thumb{width:150px;flex-shrink:0;border-radius:7px;overflow:hidden;min-height:96px;display:flex}
.thumb img{width:100%;height:100%;object-fit:cover}
.thumb-cat{align-items:center;justify-content:center;font-size:15px;font-weight:600;text-align:center;padding:8px}
.thumb-data{flex-direction:column;justify-content:center;gap:7px;background:#f2f1ec;padding:14px 12px}
.td-pair{font-size:14px;color:var(--mut2)}
.td-bar{display:flex;height:14px;border-radius:4px;overflow:hidden}
.td-bar span:first-child{background:var(--lng)}.td-bar span:last-child{background:var(--sht)}
.td-pct{display:flex;justify-content:space-between;font-size:13px}
.td-pct .lng{color:var(--lngT)}.td-pct .sht{color:var(--shtT)}
.card-body{flex:1;min-width:0}
/* 一覧サムネ無し（B）：カードはテキストのみ。左の余白を詰める */
.card-nothumb{display:block;padding:16px 18px}
.card-nothumb .card-body{flex:none}
.card-nothumb .card-title{margin-top:4px}
.cat{display:inline-block;font-size:13px;padding:2px 9px;border-radius:4px}
.card-title{font-size:19px;font-weight:600;color:var(--head);line-height:1.5;margin:8px 0 5px}
.card-lead{font-size:15px;color:var(--mut);line-height:1.7;margin:0 0 8px}
.card-date{font-size:14px;color:var(--mut2)}
.empty{color:var(--mut);font-size:17px;padding:24px 0}

/* 通貨ペア別ハブ：拾い読み行レイアウト */
.bias-list{display:flex;flex-direction:column;border:1px solid var(--line2);border-radius:10px;overflow:hidden;background:var(--card)}
.bias-row{display:flex;align-items:center;gap:16px;padding:12px 16px;text-decoration:none;border-bottom:1px solid var(--line2)}
.bias-row:last-child{border-bottom:none}
.bias-row:nth-child(even){background:#faf9f5}
.bias-row:hover{background:#f1f5f2}
.bias-row .br-pair{flex:0 0 116px;font-size:17px;font-weight:700;color:var(--head)}
.bias-row .br-bar{flex:1;min-width:120px;display:flex;height:16px;border-radius:5px;overflow:hidden;background:#eceae3}
.bias-row .br-bar .l{background:var(--lng)}
.bias-row .br-bar .s{background:var(--sht)}
.bias-row .br-bar--empty{background:#eceae3}
.bias-row .br-pct{flex:0 0 132px;display:flex;justify-content:space-between;gap:10px;font-size:14px;font-family:ui-monospace,Menlo,Consolas,monospace}
.bias-row .br-pct .lng{color:var(--lngT);font-weight:600}
.bias-row .br-pct .sht{color:var(--shtT);font-weight:600}
.bias-row .br-side{flex:0 0 150px;font-size:14px;color:var(--mut)}
.bias-row--quiet .br-pair{color:var(--mut2)}
.bias-row--quiet .br-side{color:var(--mut2)}
@media (max-width:640px){
  .bias-row{flex-wrap:wrap;gap:8px 14px;padding:12px 14px}
  .bias-row .br-pair{flex:0 0 auto}
  .bias-row .br-bar{flex:1 1 100%;order:3}
  .bias-row .br-pct{flex:0 0 auto;order:2;justify-content:flex-start}
  .bias-row .br-side{flex:1 1 auto;order:1;text-align:right}
}
/* アラート：期間タブ＋時間帯グループ */
.al-tabs{display:flex;gap:6px;margin:16px 0 6px;flex-wrap:wrap}
.al-tab{font-size:13px;font-weight:600;color:var(--mut);background:var(--card);border:1px solid var(--line2);border-radius:8px;padding:7px 16px;cursor:pointer}
.al-tab.on{color:#fff;background:var(--acc);border-color:var(--acc)}
.al-group{margin:0 0 8px}
.al-group .entry{max-width:760px}
.al-group-title{font-size:15px;font-weight:700;color:var(--head);margin:22px 0 10px;padding:6px 0;border-bottom:1px solid var(--line2)}

.art-head{margin:0 0 18px}
.art-card{background:#fff;border:1px solid var(--line2);border-radius:14px;padding:30px 36px;margin:0 auto 22px;max-width:880px}
.art-cover{width:100%;aspect-ratio:16/9;object-fit:cover;display:block;border-radius:12px;border:1px solid var(--line2);margin:0 0 22px;background:#f2f1ec}
.art-cover-data{display:flex;flex-direction:column;gap:12px;justify-content:center;background:#f2f1ec;padding:30px 28px;box-sizing:border-box}
.art-cover-data .acd-pair{font-size:18px;color:var(--mut2);font-weight:600}
.art-cover-data .acd-bar{display:flex;height:22px;border-radius:6px;overflow:hidden}
.art-cover-data .acd-bar span:first-child{background:var(--lng)}
.art-cover-data .acd-bar span:last-child{background:var(--sht)}
.art-cover-data .acd-pct{display:flex;justify-content:space-between;font-size:15px}
.art-cover-data .acd-pct .lng{color:var(--lngT)}
.art-cover-data .acd-pct .sht{color:var(--shtT)}
.art-cover-cat{display:flex;align-items:center;justify-content:center;text-align:center;font-size:22px;font-weight:700;min-height:160px;border-radius:12px;border:1px solid var(--line2);margin:0 0 22px;padding:24px}
.art-cover-svg{margin:0 0 22px}
.art-cover-svg svg{width:100%;height:auto;display:block;border-radius:12px;border:1px solid var(--line2)}
.thumb-svg{padding:0;overflow:hidden}
.thumb-svg svg{width:100%;height:auto;display:block}
.art-inline-img{width:85%;max-width:85%;height:auto;display:block;margin:10px auto 26px;border-radius:10px;border:1px solid var(--line2)}
.art-cat{display:inline-block;font-size:14px;padding:3px 10px;border-radius:4px}
.art-title{font-size:28px;font-weight:700;color:var(--head);line-height:1.45;margin:12px 0 10px}
.art-dates{display:flex;gap:14px;font-size:14px;color:var(--mut2)}
.toc{background:var(--card);border:1px solid var(--line2);border-radius:9px;padding:14px 18px;margin:0 0 22px}
.toc-title{font-size:15px;font-weight:600;color:#3f424a;margin:0 0 9px}
.toc-item{display:block;font-size:15px;color:var(--acc);padding:3px 0}
.toc-item.lv3{padding-left:14px}
.art-body{font-size:18px;color:#34373e;line-height:2.0;letter-spacing:.03em;max-width:680px}
.art-body > p:first-of-type{font-size:19px;color:#2c2f36}
.art-body h2{font-size:22px;font-weight:700;color:var(--head);line-height:1.55;margin:50px 0 22px;padding:11px 16px;background:#f1f5f2;border-left:5px solid var(--acc);border-radius:0 7px 7px 0;scroll-margin-top:70px}
.art-body h3{font-size:19px;font-weight:700;color:var(--head);line-height:1.55;margin:36px 0 14px;padding-left:12px;border-left:3px solid #b9ddc6;scroll-margin-top:70px}
.art-body p{margin:0 0 1.8em}
.art-body strong{font-weight:700;background:linear-gradient(transparent 64%, rgba(29,158,117,.22) 64%)}
.art-body a{color:var(--acc);text-decoration:underline;text-underline-offset:3px}
.art-body ul,.art-body ol{margin:0 0 1.8em;padding-left:1.5em}
.art-body li{margin:9px 0;line-height:1.85}
.art-body li::marker{color:var(--acc)}
.art-body img{max-width:100%;height:auto;border-radius:8px}
.art-body blockquote{background:#f4f3ee;border-left:4px solid #b9ddc6;border-radius:0 8px 8px 0;margin:0 0 1.8em;padding:14px 18px;color:#4a4d54}
.art-body code{background:#efeee8;padding:1px 6px;border-radius:4px;font-size:16px}
.cms-data{background:#f2f1ec;border:1px solid #e6e4dc;border-radius:9px;padding:16px 18px;margin:0 0 22px}
.cms-data-cap{font-size:14px;color:var(--mut2);margin:0 0 12px}
.cms-data-link{display:inline-block;font-size:15px;color:var(--acc);margin:13px 0 0}
.cms-data-note{font-size:16px;color:var(--mut);margin:0}
.cms-ratiorow{margin:0 0 11px}
.cms-ratiorow:last-of-type{margin-bottom:0}
.cms-ratiohead{display:flex;justify-content:space-between;font-size:15px;margin:0 0 4px}
.cms-ratiohead .nm{color:var(--head);font-weight:600}
.cms-lng{color:var(--lngT)}.cms-sht{color:var(--shtT)}
.cms-mini{display:flex;height:12px;border-radius:4px;overflow:hidden}
.cms-mini span:first-child{background:var(--lng)}.cms-mini span:last-child{background:var(--sht)}
.cms-alertrow{display:flex;gap:10px;font-size:15px;padding:5px 0;border-top:1px solid #e6e4dc}
.cms-alertrow .d{color:var(--mut2);white-space:nowrap}
.cms-alertrow .t{color:var(--txt)}
.aff{background:#fffaf2;border:1px solid #f0e2c8;border-radius:10px;padding:14px 16px;margin:0 0 22px;position:relative}
.aff .pr{position:absolute;top:10px;right:12px;font-size:13px;color:#a78b4e;background:#f7eed6;padding:2px 8px;border-radius:4px}
.aff-cap{font-size:15px;color:#8a6d2e;font-weight:600;margin:0 0 10px}
.aff-row{display:flex;align-items:center;gap:12px}
.aff-logo{width:46px;height:46px;flex-shrink:0;background:#ece6d8;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:13px;color:#a78b4e;overflow:hidden}
.aff-logo img{width:100%;height:100%;object-fit:contain}
.aff-name{font-size:17px;font-weight:600;color:var(--head)}
.aff-line{font-size:14px;color:var(--mut);line-height:1.6}
.aff-cta{font-size:15px;background:var(--acc);color:#fff;padding:9px 16px;border-radius:7px;white-space:nowrap}
.related{margin:26px auto 0;max-width:880px}
.related-title{font-size:16px;font-weight:600;color:#3f424a;margin:0 0 12px}
.rel{display:flex;gap:12px;align-items:center;background:var(--card);border:1px solid var(--line2);border-radius:9px;padding:10px 12px;margin:0 0 10px}
.rel .thumb{width:64px;min-height:46px}
.rel .thumb-data{padding:8px}
.rel .td-pair,.rel .td-pct{display:none}
.rel-t{font-size:16px;color:var(--head);line-height:1.5}
.rel-d{font-size:13px;color:var(--mut2);margin-top:3px}
.side .aff{position:sticky;top:78px}
.sb-card{background:var(--card);border:1px solid var(--line2);border-radius:10px;padding:14px;margin:0 0 14px}
.sb-title{font-size:15px;font-weight:600;color:#3f424a;margin:0 0 11px}
.sb-row{margin:0 0 10px}
.sb-row:last-child{margin-bottom:0}
.sb-head{display:flex;justify-content:space-between;font-size:14px;margin:0 0 3px}
.sb-head .nm{color:var(--head)}
.sb-head .lng{color:var(--lngT)}.sb-head .sht{color:var(--shtT)}
.sb-link{display:inline-block;font-size:14px;color:var(--acc);margin:11px 0 0}
.sb-rel{display:block;font-size:14px;line-height:1.45;color:var(--head);text-decoration:none;padding:8px 0;border-top:1px solid var(--line2)}
.sb-rel:first-of-type{border-top:none}
.sb-rel:hover{color:var(--acc)}
.sb-rank{display:block;text-decoration:none;color:inherit;padding:9px 0;border-top:1px solid var(--line2)}
.sb-rank:first-of-type{border-top:none}
.sb-rank:hover .nm{color:var(--acc)}
.sb-note{font-size:15px;color:var(--mut)}
.gf{border-top:1px solid var(--line2);background:var(--card)}
.gf-inner{max-width:1040px;margin:0 auto;padding:18px 20px;font-size:15px;color:var(--mut)}
.gf-inner a{color:var(--acc)}
.backlink{display:inline-block;font-size:15px;color:var(--acc);margin:0 0 16px}
.pairnav{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 14px}
.pairnav a{font-size:13px;color:#5a5d65;background:var(--card);border:1px solid #e2e0d9;border-radius:7px;padding:6px 11px}
.pairnav a.on{color:#fff;background:var(--acc);border-color:var(--acc)}
.weeknav{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 22px}
.weeknav a{font-size:14px;color:#3f424a;background:var(--card);border:1px solid var(--line2);border-radius:8px;padding:7px 13px}
.weeknav a.on{color:#fff;background:var(--acc);border-color:var(--acc)}
.entry{background:var(--card);border:1px solid var(--line2);border-radius:10px;padding:16px;margin:0 0 16px}
.entry .meta{display:flex;gap:10px;align-items:center;flex-wrap:wrap;font-size:13px;color:var(--mut2);margin:0 0 10px}
.entry .tag{font-size:12px;background:#eef2ee;color:var(--acc);padding:2px 9px;border-radius:5px}
.entry .tag.alert{background:#fdf0e8;color:var(--shtT)}
.entry .c{font-size:16px;line-height:1.85;color:var(--txt);margin:0 0 12px}
.entry svg{max-width:100%;height:auto;display:block;border-radius:8px}
.entry .plink{display:inline-block;font-size:14px;color:var(--acc);margin-top:10px}
@media (max-width:860px){
  .layout{flex-direction:column}
  .side{width:100%}
  .side-list{margin-top:0}
  .side .aff{position:static}
}
@media (max-width:520px){
  .thumb{width:120px;min-height:84px}
  .art-title{font-size:24px}
  .card-title{font-size:18px}
  .art-card{padding:20px 16px}
}