/* nbn-features.css — 2026-11-08 ベンチマーク実装（#1 推移の一等地化 / #2 よく調べられた商品 / #3 前回比 / #6 期間平均 / #7 FBA導線 / #9 動き / #10 ツール）
   style.css のトークンだけを使う。グラデーション無し・角丸は最大 8px・数字は tabular-nums。 */

/* ── 共通: 前回比の記号 ── */
.nbn-dl { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.nbn-dl-up { color: var(--ok); }             /* BSR改善（順位が小さくなった） */
.nbn-dl-down { color: var(--neg); }          /* BSR後退 */
.nbn-dl-down-price { color: var(--ok); }     /* 値下がり */
.nbn-dl-up-price { color: var(--neg); }      /* 値上がり */
.nbn-dl-flat { color: var(--fg-dim); }
.nbn-dl-na { color: var(--fg-faint); font-weight: 600; }

/* ── #1 /product/ 推移セクション ── */
.pd-history {
  margin: 18px 0 8px; padding: 18px; background: var(--bg-1);
  border: 1px solid var(--border); border-radius: 8px;
}
.pd-history-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.pd-history-head h2 { font-size: 17px; font-weight: 700; margin: 0; color: var(--fg); }
.pd-chart-controls-label { font-size: 13px; font-weight: 600; color: var(--fg-dim); margin-right: 4px; }
.pd-history-badges { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 12px 0 4px; }
.pd-hb {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--bg-2);
  font-size: 13px; color: var(--fg); font-variant-numeric: tabular-nums;
}
.pd-hb-k { font-size: 11px; font-weight: 600; color: var(--fg-muted); }
.pd-hb-note { font-size: 11px; color: var(--fg-faint); }
.pd-hb-low { border-color: var(--primary-ring); background: var(--primary-soft); }
.pd-history-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.pd-history .pd-chart-card { margin-bottom: 0; }
.pd-chart-sub { display: block; font-size: 11px; font-weight: 400; color: var(--fg-muted); margin-top: 2px; }
.pd-chart-avg { stroke-width: 1.5; stroke-dasharray: 5,4; opacity: .7; }
.pd-chart-foot { margin-top: 6px; font-size: 11px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .pd-history { padding: 14px; }
  .pd-history-grid { grid-template-columns: 1fr; }
  .pd-chart-controls { flex-wrap: wrap; }
}

/* ── #7/#10 /product/ 利益計算タブ: 計算機導線 + 公式外部ツール列 ── */
.nbn-ext-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.nbn-ext-link {
  display: inline-block; padding: 7px 11px; font-size: 12.5px; font-weight: 600;
  color: var(--fg-dim); background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; text-decoration: none;
}
.nbn-ext-link:hover { border-color: var(--primary); color: var(--primary); }
.nbn-ext-primary { color: #fff; background: #147a6e; border-color: #147a6e; }
.nbn-ext-primary:hover { color: #fff; background: var(--primary); border-color: var(--primary); }

/* ── #6 /ranking/ 期間切替 ── */
.nbn-period { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; font-size: 12.5px; }
.nbn-period-label { color: var(--fg-dim); font-weight: 600; }
.nbn-period-btn {
  display: inline-block; padding: 5px 11px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-1); color: var(--fg-dim); font-weight: 600; text-decoration: none; font-size: 12.5px;
}
.nbn-period-btn:hover { border-color: var(--primary); color: var(--primary); }
.nbn-period-btn.is-active { background: #147a6e; border-color: #147a6e; color: #fff; }
.nbn-period-note { flex-basis: 100%; color: var(--fg-muted); font-size: 11.5px; }

/* ── #2 よく調べられた商品（/ranking/ ハブ・トップ） ── */
.nbn-pop-note { font-size: 12.5px; color: var(--fg-dim); margin: -6px 0 12px; }
.nbn-pop-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.nbn-pop-item {
  display: grid; grid-template-columns: 28px 56px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px;
}
.nbn-pop-rank { font-weight: 800; font-size: 15px; color: var(--fg-dim); text-align: center; font-variant-numeric: tabular-nums; }
.nbn-pop-img img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--border-soft); display: block; }
.nbn-pop-body { min-width: 0; }
.nbn-pop-title { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--fg); text-decoration: none; overflow-wrap: anywhere; }
.nbn-pop-title:hover { color: var(--primary); text-decoration: underline; }
.nbn-pop-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 12px; color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.nbn-pop-count { color: var(--fg-muted); }
.nbn-pop-amz {
  padding: 6px 10px; font-size: 12px; font-weight: 700; color: #fff; background: #147a6e; border-radius: 6px; text-decoration: none; white-space: nowrap;
}
.nbn-pop-amz:hover { background: var(--primary); }
@media (max-width: 640px) {
  .nbn-pop-list { grid-template-columns: 1fr; }
  .nbn-pop-item { grid-template-columns: 24px 48px 1fr; }
  .nbn-pop-amz { grid-column: 2 / -1; justify-self: start; }
}

/* ── #9 /kaidoki/ ハブの「動き」3本 ── */
.nbn-mv-date { font-size: 12px; font-weight: 400; color: var(--fg-muted); margin-left: 6px; }
.nbn-mv-lead { font-size: 13px; color: var(--fg-dim); margin: -4px 0 12px; }
.nbn-mv-empty { font-size: 13px; color: var(--fg-muted); padding: 12px 14px; background: var(--bg-2); border-radius: 6px; }
.nbn-mv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.nbn-mv-item {
  display: grid; grid-template-columns: 64px 64px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px;
}
.nbn-mv-badge {
  display: inline-block; text-align: center; padding: 6px 4px; border-radius: 6px; font-size: 13px; font-weight: 800;
  font-variant-numeric: tabular-nums; border: 1px solid transparent;
}
.nbn-mv-drop { color: var(--neg); background: rgba(185,28,28,.08); border-color: rgba(185,28,28,.3); }
.nbn-mv-rise { color: #0f5f55; background: var(--primary-soft); border-color: var(--primary-ring); }
.nbn-mv-low  { color: #a8500f; background: var(--cta-soft); border-color: rgba(168,80,15,.35); }
.nbn-mv-img img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--border-soft); display: block; }
.nbn-mv-body { min-width: 0; }
.nbn-mv-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--fg); text-decoration: none; overflow-wrap: anywhere; }
.nbn-mv-title:hover { color: var(--primary); text-decoration: underline; }
.nbn-mv-line { margin-top: 4px; font-size: 13px; color: var(--fg); font-variant-numeric: tabular-nums; }
.nbn-mv-line strong { font-size: 15px; }
.nbn-mv-sub { margin-top: 2px; font-size: 11px; color: var(--fg-faint); }
.nbn-mv-amz {
  padding: 7px 11px; font-size: 12px; font-weight: 700; color: #fff; background: #147a6e; border-radius: 6px; text-decoration: none; white-space: nowrap;
}
.nbn-mv-amz:hover { background: var(--primary); }
@media (max-width: 640px) {
  .nbn-mv-item { grid-template-columns: 52px 52px 1fr; gap: 8px; }
  .nbn-mv-img img { width: 52px; height: 52px; }
  .nbn-mv-amz { grid-column: 1 / -1; text-align: center; }
}

/* ── #7 /fba-calc/ プリフィルの案内 ── */
.nbn-prefill {
  display: none; margin: 0 0 14px; padding: 12px 14px; font-size: 13px; color: var(--fg);
  background: var(--primary-soft); border: 1px solid var(--primary-ring); border-radius: 8px;
}
.nbn-prefill.is-on { display: block; }
.nbn-prefill a { color: var(--primary); font-weight: 600; }
.nbn-prefill-note { display: block; margin-top: 4px; font-size: 11.5px; color: var(--fg-dim); }

/* ── #10 /tools/ ── */
.nbn-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; }
.nbn-tool {
  display: block; padding: 16px; background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; color: var(--fg);
}
.nbn-tool:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.nbn-tool-name { display: block; font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.nbn-tool-desc { display: block; font-size: 12.5px; color: var(--fg-dim); line-height: 1.6; }
.nbn-tool-tag { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--primary); }
.nbn-tools-ext { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nbn-bsr-calc { margin-top: 14px; padding: 16px; background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px; }
.nbn-bsr-calc-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.nbn-bsr-calc label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--fg-dim); }
.nbn-bsr-calc input, .nbn-bsr-calc select { height: 40px; padding: 0 10px; font-size: 15px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--fg); font-family: inherit; }
.nbn-bsr-calc-out { margin-top: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.nbn-bsr-calc-out strong { font-size: 22px; }
