:root {
  color-scheme: light;
  --ink: #141a4e;
  --ink-strong: #10164a;
  --muted: #606989;
  --line: #e5e9f5;
  --line-soft: #eef1f8;
  --panel: #fff;
  --blue: #3538d4;
  --blue-dark: #242a97;
  --blue-soft: #eef0ff;
  --navy: #0d1152;
  --gold: #f6b21b;
  --silver: #d9dee9;
  --bronze: #dd8a4e;
  --up: #167a45;
  --up-soft: #e3f5ea;
  --down: #b43d37;
  --down-soft: #fdeceb;
}

* { box-sizing: border-box; }
/* display を指定した要素にも hidden 属性を効かせる（.persona-bar や .view が該当） */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  position: relative;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% -8%, rgba(120, 108, 255, .55), transparent 30rem),
    radial-gradient(circle at 96% 16%, rgba(38, 120, 255, .30), transparent 30rem),
    linear-gradient(150deg, #4147dd 0%, #2a2fb5 48%, #3036c5 100%);
  color: var(--ink);
  font-family: Inter, "Noto Sans JP", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
body:before {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  pointer-events: none;
}
button, select { font: inherit; }
.shell { position: relative; z-index: 1; width: min(1520px, calc(100% - 48px)); margin: 0 auto; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(164,175,255,.22); background: rgba(11,15,74,.96); color: #fff; backdrop-filter: blur(16px); }
.site-header-inner { display: grid; grid-template-columns: minmax(250px,1fr) auto minmax(250px,1fr); gap: 30px; align-items: center; width: min(1580px, calc(100% - 48px)); min-height: 64px; margin: 0 auto; }
.brand { color: #fff; font-size: 18px; font-weight: 800; letter-spacing: .01em; text-decoration: none; white-space: nowrap; }
.brand span { margin-right: 8px; color: #bac4ff; }
.site-header nav { display: flex; align-self: stretch; gap: 36px; }
.site-header nav a { position: relative; display: grid; place-items: center; color: #c9cfff; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.site-header nav a:hover, .site-header nav a.active { color: #fff; }
.site-header nav a.active:after { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; border-radius: 3px 3px 0 0; background: #fff; content: ""; }
.site-header .connection { justify-self: end; }
.connection { display: flex; flex: none; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid rgba(168,178,255,.4); border-radius: 8px; background: rgba(13,17,82,.55); }
.connection div { display: grid; gap: 1px; }
.connection strong { color: #fff; font-size: 12px; line-height: 1.3; }
.connection span:last-child { color: #aeb6f4; font-size: 11px; line-height: 1.3; }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #58dcae; box-shadow: 0 0 0 4px rgba(88,220,174,.16); animation: pulse-core 1.8s ease-in-out infinite; }
.pulse:after { position: absolute; inset: 0; border-radius: 50%; background: rgba(88,220,174,.55); animation: pulse-ring 1.8s cubic-bezier(.25,.6,.35,1) infinite; content: ""; }
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: .9; }
  75%, 100% { transform: scale(3.2); opacity: 0; }
}
@keyframes pulse-core {
  0%, 100% { background: #58dcae; }
  50% { background: #8cf0cd; }
}
.connection.error .pulse, .connection.error .pulse:after { animation: none; }
.connection.error .pulse { background: var(--down); box-shadow: 0 0 0 4px rgba(226,87,79,.16); }
.connection.error .pulse:after { content: none; }
@media (prefers-reduced-motion: reduce) {
  .pulse, .pulse:after { animation: none; }
}

/* ---------- hero ---------- */
.masthead {
  display: grid;
  grid-template-columns: minmax(400px, 1fr) minmax(520px, 720px);
  gap: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 44px 4px 36px;
  color: #fff;
}
.eyebrow { margin: 0 0 10px; color: #c6ccff; font-size: 13px; font-weight: 700; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(32px, 2.9vw, 42px); line-height: 1.3; letter-spacing: -.02em; font-weight: 800; }
.lead { max-width: 640px; margin: 14px 0 0; color: #dfe3ff; font-size: 14px; line-height: 1.8; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { position: relative; min-width: 0; min-height: 104px; padding: 15px 16px; border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(8, 12, 80, .22); }
.metric span { display: block; padding-right: 34px; color: #2d34a8; font-size: 12px; font-weight: 700; }
.metric strong { display: block; margin-top: 8px; color: var(--ink-strong); font-size: 31px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric em { display: block; margin-top: 4px; color: #9298b8; font-size: 11px; font-style: normal; }
.metric .metric-icon { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #dfe4fb; border-radius: 8px; color: #4d55d8; background: #f6f7ff; }
.metric .metric-icon svg { width: 16px; height: 16px; }

/* ---------- board (white container: sidebar + main) ---------- */
.board {
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  overflow: hidden;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 26px 64px rgba(6, 10, 70, .28);
}
.board-side { padding: 24px 14px; border-right: 1px solid var(--line-soft); }
.side-label { margin: 0 12px 14px; color: #9aa0bd; font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.side-label-gap { margin-top: 22px; }
.side-nav { display: grid; gap: 4px; }
.side-nav button, .side-nav a {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 12px 14px;
  border: 0; border-radius: 10px; background: transparent;
  color: #454c78; font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer;
}
.side-nav button svg, .side-nav a svg { width: 18px; height: 18px; flex: none; opacity: .72; }
.side-nav button:hover, .side-nav a:hover { background: #f3f5fc; color: var(--ink-strong); }
.side-nav button.selected, .side-nav a.selected { background: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(53,56,212,.32); }
.side-nav button.selected svg, .side-nav a.selected svg { opacity: 1; }
.side-nav a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav .nav-logo { width: 20px; height: 20px; border-radius: 5px; }
.side-nav .shop-link { padding: 9px 14px; font-size: 13px; }
.side-nav .shop-link-all { padding: 10px 14px; color: var(--blue); font-size: 12px; font-weight: 700; }
.side-divider { margin: 20px 12px; border: 0; border-top: 1px solid var(--line); }
.side-note { margin: 18px 12px 0; color: #a7acc5; font-size: 11px; line-height: 1.6; }

.board-main { display: grid; gap: 18px; align-content: start; min-width: 0; padding: 26px 28px 30px; }
.board-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.board-head h1, .board-head h2 { margin: 0; color: #171e5a; font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.board-head h1 i, .board-head h2 i { margin: 0 10px; color: #c3c8e2; font-style: normal; font-weight: 400; }
.board-page-description { max-width: 900px; margin: 7px 0 0; color: #606989; font-size: 12px; line-height: 1.65; }
.trend-card, .table-card, .prompts-card { scroll-margin-top: 84px; }

/* ---------- persona toolbar ---------- */
.persona-bar { display: grid; grid-template-columns: auto minmax(230px, 300px) minmax(280px, 1fr) auto; gap: 18px; align-items: center; padding: 12px 16px; border: 1px solid #e7ebf7; border-radius: 10px; background: #f6f8fd; }
.persona-bar label { color: #2b3270; font-size: 13px; font-weight: 700; }
.persona-bar label span { display: block; margin-bottom: 2px; color: #626b8f; font-size: 10px; letter-spacing: .12em; }
.persona-bar select { width: 100%; padding: 10px 34px 10px 12px; border: 1px solid #d3d8ec; border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 650; }
.persona-select-wrap { position: relative; min-width: 0; }
.persona-avatar { position: absolute; top: 50%; left: 9px; width: 26px; height: 26px; border: 1px solid #dde1f0; border-radius: 50%; background: #eef0ff; object-fit: cover; transform: translateY(-50%); pointer-events: none; }
.persona-select-wrap:has(.persona-avatar:not([hidden])) select { padding-left: 43px; }
.persona-copy { min-width: 0; padding-left: 18px; border-left: 1px solid var(--line); }
.persona-copy strong { font-size: 13px; }
.persona-copy p { margin: 3px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.active-badge { width: max-content; padding: 6px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 750; }

/* ---------- cards ---------- */
.card { min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.card-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; color: #1a2153; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.card-sub { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.card-note { flex: none; color: #626b8f; font-size: 11px; font-weight: 600; white-space: nowrap; }
.card-foot { margin: 12px 0 0; color: #626b8f; font-size: 11px; }

.board-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: stretch; }

/* trend card */
.trend-metrics { display: flex; flex: none; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f2f4fb; }
.trend-metrics button { padding: 7px 12px; border: 0; border-radius: 7px; background: transparent; color: #666e91; font-size: 12px; font-weight: 700; cursor: pointer; }
.trend-metrics button:hover { color: var(--blue); }
.trend-metrics button.selected { background: var(--blue); color: #fff; box-shadow: 0 5px 13px rgba(53,56,212,.25); }
.trend-summary { margin-bottom: 8px; padding: 10px 12px; border-radius: 8px; background: #f7f8fd; color: #59608b; }
.trend-summary p { margin: 0; font-size: 12px; line-height: 1.6; }
.trend-body { display: flex; gap: 22px; align-items: center; }
.trend-chart { flex: 1; min-width: 0; }
.trend-chart svg { display: block; width: 100%; height: auto; max-height: 320px; overflow: visible; }
.trend-grid-line { stroke: #e6e9f4; stroke-width: 1; }
.trend-axis-label { fill: #8a90ad; font-size: 11px; font-family: inherit; }
.trend-point { cursor: crosshair; transform-box: fill-box; transform-origin: center; transition: r .15s ease, filter .15s ease; }
.trend-point:hover, .trend-point:focus { r: 7px; filter: drop-shadow(0 2px 4px rgba(31, 36, 92, .28)); outline: none; }
.trend-legend { display: flex; flex: none; flex-direction: column; justify-content: center; gap: 15px; width: 200px; }
.trend-legend-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.trend-legend-item i { width: 10px; height: 10px; border-radius: 50%; }
.trend-legend-item span { overflow: hidden; color: #454c78; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.trend-legend-item strong { font-weight: 750; font-variant-numeric: tabular-nums; }

/* latest ranking card */
.rank-rows { display: grid; }
.rank-row { display: grid; grid-template-columns: 27px 28px minmax(0, 1fr) auto auto; gap: 9px; align-items: center; min-height: 50px; padding: 4px 0; }
.rank-logo { width: 28px; height: 28px; border-radius: 7px; }
.rank-row + .rank-row { border-top: 1px solid var(--line-soft); }
.rank-badge { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #f1f3fa; color: #454c72; font-size: 13px; font-weight: 800; }
.rank-badge.rank-1 { background: var(--gold); color: #fff; }
.rank-badge.rank-2 { background: var(--silver); color: #6a7188; }
.rank-badge.rank-3 { background: var(--bronze); color: #fff; }
.rank-row > b { overflow: hidden; color: #262d61; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.rank-row > strong { font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.delta { min-width: 50px; padding: 3px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.delta.up { background: var(--up-soft); color: var(--up); }
.delta.down { background: var(--down-soft); color: var(--down); }
.delta.flat { background: #f1f3fa; color: #626b8f; }

/* ---------- ranking table ---------- */
.table-card { padding-right: 0; padding-left: 0; }
.table-card .card-head { padding: 0 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 13px; border-top: 1px solid var(--line-soft); text-align: left; white-space: nowrap; font-size: 13px; }
th { background: #f7f8fc; color: #59627f; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.table-head-help { display: inline-flex; gap: 4px; align-items: center; border-bottom: 1px dotted #afb5cc; cursor: help; }
.table-head-help i { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1px solid #cbd0e1; border-radius: 50%; font-size: 9px; font-style: normal; }
td:first-child, th:first-child { padding-left: 20px; }
td:last-child, th:last-child { padding-right: 20px; }
.rank-number { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #f1f3fa; color: #454c72; font-size: 13px; font-weight: 800; }
/* メダル色は総合ランキング表だけ。個社ページの表は行の位置と順位が一致しない */
#shops-body tr:first-child .rank-number, .rank-number.rank-1 { background: var(--gold); color: #fff; }
#shops-body tr:nth-child(2) .rank-number, .rank-number.rank-2 { background: var(--silver); color: #6a7188; }
#shops-body tr:nth-child(3) .rank-number, .rank-number.rank-3 { background: var(--bronze); color: #fff; }
.shop-name { min-width: 180px; font-weight: 650; }
.shop-identity { display: flex; align-items: center; gap: 9px; }
.type-pill { display: inline-block; padding: 4px 9px; border-radius: 999px; background: #edf0f7; color: #646b88; font-size: 11px; font-weight: 600; }
.type-pill.marketplace { background: #e6ecff; color: #4057ad; }
.type-pill.electronics_retailer { background: #f8eddf; color: #825015; }
.type-pill.brand_store { background: #eee8f8; color: #74579c; }
.coverage { position: relative; display: flex; align-items: center; gap: 8px; min-width: 108px; }
.coverage:before { width: 70px; height: 5px; border-radius: 5px; background: #e9ebf5; content: ""; }
.coverage i { position: absolute; left: 0; height: 5px; max-width: 70px; border-radius: 5px; background: var(--blue); }
.coverage span { color: var(--muted); font-size: 12px; }
.coverage[data-tooltip], .metric-hover, .trend-legend-item[data-tooltip] { cursor: help; }
.metric-hover { display: inline-flex; border-radius: 4px; outline: none; }
.metric-stack { flex-direction: column; align-items: flex-start; }
.metric-hover:hover, .metric-hover:focus, .coverage[data-tooltip]:hover, .coverage[data-tooltip]:focus, .trend-legend-item[data-tooltip]:hover strong, .trend-legend-item[data-tooltip]:focus strong, .table-head-help:hover, .table-head-help:focus { background: var(--blue-soft); box-shadow: 0 0 0 3px var(--blue-soft); }
.data-tooltip { position: fixed; z-index: 10000; max-width: min(300px, calc(100vw - 20px)); padding: 10px 12px; border: 1px solid rgba(107, 115, 162, .24); border-radius: 9px; background: #181d4d; box-shadow: 0 10px 28px rgba(19, 24, 70, .24); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.55; letter-spacing: 0; pointer-events: none; white-space: pre-line; }
.data-tooltip[hidden] { display: none; }
.table-more { padding: 14px 20px 2px; border-top: 1px solid var(--line-soft); text-align: center; }
.table-more button { padding: 9px 18px; border: 1px solid #d2d6ee; border-radius: 8px; background: #fff; color: var(--blue); font-size: 13px; font-weight: 650; cursor: pointer; }
.table-more button:hover { border-color: var(--blue); background: var(--blue-soft); }
.rate-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.rate-cell small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; font-weight: 500; }
.primary-rate { color: var(--blue); }
.top3-rate { color: #168bbd; }

/* ---------- prompts card ---------- */
.prompts-card { padding-right: 0; padding-left: 0; }
.prompts-card .card-head { margin-bottom: 6px; padding: 0 20px; }
.prompts-list { display: grid; }
.prompt { border-top: 1px solid var(--line-soft); }
.prompt summary { display: grid; grid-template-columns: 40px 74px minmax(260px, 1fr) auto 20px; gap: 14px; align-items: center; padding: 15px 20px; cursor: pointer; list-style: none; }
.prompt summary::-webkit-details-marker { display: none; }
.prompt summary:after { grid-column: 5; color: #8a90ad; content: "＋"; }
.prompt[open] summary:after { content: "−"; }
.prompt-order { color: #626b8f; font-size: 12px; font-variant-numeric: tabular-nums; }
.category-tag { padding: 6px 8px; border-radius: 7px; background: #eef0f7; color: #596181; text-align: center; font-size: 11px; font-weight: 600; }
.prompt-text { font-size: 14px; font-weight: 650; line-height: 1.5; }
.prompt-counts { display: flex; gap: 6px; align-items: center; }
.prompt-counts b, .prompt-counts i { padding: 5px 9px; border-radius: 999px; background: #eef0f6; color: #505a78; font-size: 11px; font-weight: 600; font-style: normal; white-space: nowrap; }
.prompt.observed .prompt-counts b { background: var(--blue-soft); color: var(--blue); }
.prompt.pending { opacity: .72; }
.prompt-detail { padding: 0 20px 20px 148px; }
.prompt-meta { display: flex; gap: 14px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.hierarchy-label { display: flex; gap: 8px; align-items: center; margin-bottom: 11px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.hierarchy-label span { padding: 5px 9px; border-radius: 6px; background: #eceeff; color: #464bc0; }
.hierarchy-label i { color: #969db8; font-style: normal; }
.product-tree { display: grid; gap: 12px; }
.product-node { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.product-node-head { display: grid; grid-template-columns: 58px auto minmax(220px, 1fr) auto; gap: 13px; align-items: center; padding: 12px 14px; background: #f7f8fc; }
.product-copy { display: grid; gap: 2px; min-width: 0; }
.product-node-head strong { font-size: 13px; }
.product-node-head small { color: var(--muted); font-size: 11px; }
.product-rank { display: inline-grid; place-items: center; min-height: 27px; padding: 5px 9px; border-radius: 7px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 750; white-space: nowrap; }
.evidence-badges { display: flex; gap: 6px; }
.evidence-badge { padding: 5px 9px; border: 1px solid #d6daec; border-radius: 999px; background: #fff; color: #687091; font-size: 11px; white-space: nowrap; }
.merchant-table { border-top: 1px solid var(--line); }
.merchant-head, .merchant-row { display: grid; grid-template-columns: 90px 225px 155px minmax(200px, 1fr); gap: 12px; align-items: center; padding: 10px 14px; }
.merchant-head { background: #fafbfe; color: var(--muted); font-size: 11px; font-weight: 600; }
.merchant-row { border-top: 1px solid var(--line-soft); font-size: 13px; }
.merchant-row > strong { color: var(--blue); font-variant-numeric: tabular-nums; }
.merchant-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.merchant-copy { display: grid; gap: 1px; min-width: 0; }
.merchant-row b { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.merchant-row small { color: var(--muted); font-size: 11px; }
.merchant-row > span { overflow: hidden; color: #545c7c; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.merchant-mobile-label { display: none; }
.product-no-merchants { padding: 14px; color: var(--muted); font-size: 13px; }
.empty, .prompt-empty { padding: 32px; color: var(--muted); text-align: center; font-size: 13px; }

.image-thumb { position: relative; display: grid; flex: none; place-items: center; width: 32px; height: 32px; overflow: hidden; border: 1px solid #dde1ef; border-radius: 7px; background: linear-gradient(145deg,#f1f3fa,#fff); color: #737b9e; font-size: 12px; font-style: normal; font-weight: 800; }
.image-thumb > i { font-style: normal; }
.image-thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; background: #fff; object-fit: contain; }
.shop-thumb, .merchant-logo { width: 29px; height: 29px; }
/* 観測対象AIのバッジ。ロゴは使わず名前だけ出す（中立性のため） */
.ai-badge { display: inline-flex; gap: 5px; align-items: center; margin-right: 8px; padding: 3px 9px; border: 1px solid #d9def7; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.ai-badge svg { width: 13px; height: 13px; }
.doc-source { margin: 12px 0 0 !important; }

.listing-pill { display: inline-block; margin-right: 4px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.listing-pill.card { background: var(--blue-soft); color: var(--blue); }
.listing-pill.text { background: #f1f3fa; color: #7b8199; }
.variant-note { display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: #f1f3fa; color: #8b91ad; font-size: 10px; font-style: normal; font-weight: 600; vertical-align: middle; }
.product-mini { width: 34px; height: 34px; border-radius: 8px; background: #fff; }
.product-mini > img { padding: 2px; }
.product-thumb { width: 58px; height: 58px; border-radius: 10px; background: #fff; }
.product-thumb > img { padding: 3px; }

footer { display: flex; justify-content: space-between; gap: 12px; padding: 24px 6px 38px; color: #c9cffa; font-size: 12px; }

/* ---------- views / navigation ---------- */
.view { display: grid; gap: 18px; align-content: start; min-width: 0; }
a.rank-row, a.trend-legend-item { color: inherit; text-decoration: none; }
a.rank-row:hover b, a.trend-legend-item:hover span { color: var(--blue); }
.shop-identity-link { color: inherit; text-decoration: none; }
.shop-identity-link:hover span { color: var(--blue); text-decoration: underline; }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.crumbs a { color: var(--blue); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs i { color: #c3c8e2; font-style: normal; }

/* ---------- home ---------- */
.home-hero { padding: 30px 32px 26px; }
.home-eyebrow { margin: 0 0 10px; color: #6d75c6; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.home-hero h2, .home-hero h3 { margin: 0; color: #141a4e; font-size: clamp(22px, 2.1vw, 30px); font-weight: 800; letter-spacing: -.02em; line-height: 1.35; }
.home-lead { max-width: 900px; margin: 14px 0 22px; color: #444b73; font-size: 14px; line-height: 1.95; }
.home-lead strong { color: var(--ink-strong); }
.home-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.home-guide-item { display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 11px; align-items: center; padding: 15px 16px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.home-guide-item:hover { border-color: #b9c0ee; background: #f8f9ff; }
.home-guide-step { grid-row: 1 / 3; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 800; }
.home-guide-item strong { color: var(--ink-strong); font-size: 14px; font-weight: 750; }
.home-guide-note { color: var(--muted); font-size: 12px; }

.home-why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.home-why-item { display: grid; gap: 7px; align-content: start; }
.home-why-item + .home-why-item { padding-left: 18px; border-left: 1px solid var(--line-soft); }
.home-why-label { display: inline-block; width: max-content; padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 750; }
.home-why-item p { margin: 0; color: #444b73; font-size: 13px; line-height: 1.95; }
.home-why-item strong { color: var(--ink-strong); }
.card-link { flex: none; color: var(--blue); font-size: 12px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.card-link:hover { text-decoration: underline; }
.home-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.home-step { display: grid; gap: 3px; padding: 13px 15px; border-radius: 10px; background: #f7f8fd; }
.home-step i { display: grid; place-items: center; width: 21px; height: 21px; margin-bottom: 3px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 11px; font-style: normal; font-weight: 800; }
.home-step strong { font-size: 13px; font-weight: 700; }
.home-step span { color: var(--muted); font-size: 11.5px; line-height: 1.6; }

/* 今日のヘッドライン：カードに入れず、ページ最上段で一番強く見せる */
.headline-block { padding: 4px 4px 2px; }
.headline-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 16px; }
.headline-head h2, .headline-head h3 { margin: 0; color: #141a4e; font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.headline-head span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.headlines { display: grid; gap: 11px; }
.headline { display: flex; gap: 14px; align-items: center; }
.headline p { margin: 0; color: #1c2358; font-size: 17px; font-weight: 700; line-height: 1.5; }
.headline p strong { color: var(--blue); font-weight: 800; }
.headline-icon { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.headline-icon svg { width: 18px; height: 18px; }
.headline-icon.crown { border: 1px solid #f0dcae; background: #fdf6e6; color: #b98a15; }
.headline-icon.swap { border: 1px solid #d9def7; background: var(--blue-soft); color: var(--blue); }
.headline-icon.up { border: 1px solid #c7e9d6; background: var(--up-soft); color: var(--up); }
.headline-icon.down { border: 1px solid #f6d3d0; background: var(--down-soft); color: var(--down); }
.headline-icon.new { border: 1px solid #d9def7; background: var(--blue-soft); color: var(--blue); }
.headline-icon.flat { border: 1px solid var(--line); background: #f4f5fa; color: #9aa0bd; }

/* 動いた店だけ：4区分を横並び */
.move-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 0; }
.move-group { min-width: 0; padding: 0 16px; }
.move-group:first-child { padding-left: 0; }
.move-group:last-child { padding-right: 0; }
.move-group + .move-group { border-left: 1px solid var(--line-soft); }
.move-title { display: flex; gap: 7px; align-items: center; margin-bottom: 6px; color: #6d7396; font-size: 12px; font-weight: 700; }
.move-title i { padding: 2px 7px; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 800; }
.move-title.up i { background: var(--up-soft); color: var(--up); }
.move-title.down i { background: var(--down-soft); color: var(--down); }
.move-title.new i { background: var(--blue-soft); color: var(--blue); }
.move-title.out i { background: #f1f3fa; color: #8b91ad; }
.move-rows { display: grid; }
.move-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px 0; color: inherit; text-decoration: none; }
.move-row + .move-row { border-top: 1px solid var(--line-soft); }
.move-row:hover b { color: var(--blue); }
.move-row b { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.move-logo { width: 26px; height: 26px; border-radius: 6px; }
.move-shift { display: flex; gap: 5px; align-items: center; color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.move-shift i { color: #c3c8e2; font-style: normal; }
.move-shift em { color: var(--ink-strong); font-style: normal; font-weight: 750; }
.move-empty { margin: 0; padding: 10px 0; color: #b3b8cc; font-size: 12px; }

/* カテゴリ別 今日の首位 */
.leader-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.leader-card { display: grid; gap: 11px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 11px; color: inherit; text-decoration: none; }
.leader-card:hover { border-color: #b9c0ee; background: #f8f9ff; }
.leader-category { display: flex; gap: 8px; align-items: center; color: #6d7396; font-size: 12px; font-weight: 700; }
.leader-category svg { width: 17px; height: 17px; opacity: .75; }
.leader-shop { display: flex; gap: 9px; align-items: center; min-width: 0; }
.leader-shop b { overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.leader-none { color: var(--muted); font-weight: 600; }
.leader-chip { width: max-content; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.leader-chip.up { background: var(--up-soft); color: var(--up); }
.leader-chip.down { background: var(--down-soft); color: var(--down); }
.leader-chip.new { background: var(--blue-soft); color: var(--blue); }
.leader-chip.flat { background: #f1f3fa; color: #8b91ad; }

/* 観測ステータスの導線 */
.home-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.home-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.home-link:hover { border-color: #b9c0ee; background: #f8f9ff; }
.home-link strong { grid-area: 1 / 1; color: var(--blue); font-size: 13px; font-weight: 750; }
.home-link span { grid-area: 2 / 1; color: var(--muted); font-size: 11px; }
.home-link i { grid-area: 1 / 2 / 3 / 3; color: var(--blue); font-style: normal; }

/* ---------- stat tiles ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-tile { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfe; }
.stat-tile span { display: block; color: #2d34a8; font-size: 12px; font-weight: 700; }
.stat-tile strong { display: block; margin-top: 6px; color: var(--ink-strong); font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-tile em { display: block; margin-top: 3px; color: #9298b8; font-size: 11px; font-style: normal; line-height: 1.5; }

/* ---------- shop hero / summary ---------- */
.shop-hero-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.hero-logo { width: 54px; height: 54px; border-radius: 12px; }
.shop-hero-copy h2, .shop-hero-copy h3 { margin: 0; color: #171e5a; font-size: 21px; font-weight: 780; letter-spacing: -.01em; }
.shop-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 7px; }
.shop-domain { color: var(--muted); font-size: 12px; }
.shop-rank-pill { padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 750; }
.summary-text { margin: 0; padding: 14px 16px; border: 1px solid #e3e8f8; border-radius: 10px; background: #f7f9ff; color: #333b6b; font-size: 13px; line-height: 1.95; }
.copy-button { flex: none; padding: 8px 15px; border: 1px solid #d2d6ee; border-radius: 8px; background: #fff; color: var(--blue); font-size: 12px; font-weight: 700; cursor: pointer; }
.copy-button:hover { border-color: var(--blue); background: var(--blue-soft); }
.badge-rows { display: grid; gap: 12px; margin-top: 16px; }
.badge-rows > div { display: grid; grid-template-columns: 138px minmax(0, 1fr); gap: 12px; align-items: start; }
.badge-label { color: #6d7396; font-size: 12px; font-weight: 700; line-height: 30px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; gap: 7px; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge i { font-style: normal; font-weight: 600; opacity: .78; }
.badge.strong { background: var(--up-soft); color: #157a46; }
.badge.weak { background: var(--down-soft); color: #b83c35; }
.badge.neutral { background: #f1f3fa; color: #7b8199; font-weight: 600; }
.badge.compact { padding: 4px 9px; font-size: 11px; }

/* ---------- category bars ---------- */
.cat-bars { display: grid; gap: 15px; }
.cat-bar-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.cat-bar-head strong { font-size: 13px; font-weight: 700; }
.cat-bar-head span { color: var(--muted); font-size: 11px; }
.cat-bar-track { position: relative; height: 9px; border-radius: 9px; background: #eef0f8; }
.cat-bar-track i { position: absolute; top: 0; left: 0; height: 9px; border-radius: 9px; }
.cat-bar-track .coverage-fill { background: #c3c8f4; }
.cat-bar-track .top3-fill { background: var(--blue); }
.cat-bar-foot { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.cat-bar-foot b { color: #454c78; font-variant-numeric: tabular-nums; }

/* ---------- shop cards ---------- */
.shop-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.shop-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: inherit; text-decoration: none; }
.shop-card:hover { border-color: #b9c0ee; box-shadow: 0 10px 24px rgba(8,12,80,.10); }
.shop-card-head { display: flex; gap: 11px; align-items: center; min-width: 0; }
.shop-card-head strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.shop-card-head small { display: block; color: var(--muted); font-size: 11px; }
.shop-card-stats { display: flex; gap: 14px; padding-top: 11px; border-top: 1px solid var(--line-soft); }
.shop-card-stats i { display: block; color: var(--muted); font-size: 10px; font-style: normal; }
.shop-card-stats b { font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- shop page tables ---------- */
.prompt-cell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.row-absent { color: var(--muted); }
.row-absent .prompt-cell { opacity: .7; }
.absent-pill { padding: 4px 9px; border-radius: 999px; background: #f1f3fa; color: #9aa0bd; font-size: 11px; font-weight: 600; }
.of-shops { margin-left: 5px; color: var(--muted); font-size: 11px; }
.self-first { padding: 4px 9px; border-radius: 999px; background: var(--up-soft); color: #157a46; font-size: 11px; font-weight: 700; }
.score { padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score.win { background: var(--up-soft); color: #157a46; }
.score.lose { background: var(--down-soft); color: #b83c35; }
.cheapest { color: #157a46; font-weight: 700; }
.excluded-pill { padding: 3px 8px; border-radius: 999px; background: #f4f0e6; color: #92793d; font-size: 11px; font-weight: 600; }
/* 累積シェアの進捗バー。0〜100%の固定目盛りで「どこまで進んだか」を読む。
   目盛りはバーの下（::before）と上（::after）の両方に描き、塗りに隠れないようにする。 */
.cum-axis-head { width: 300px; padding-bottom: 6px; }
.cum-axis-title { display: block; margin-bottom: 5px; }
.cum-axis { display: flex; justify-content: space-between; color: #a4aac4; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cum-cell { width: 300px; }
.cum-bar {
  position: relative;
  min-width: 200px;
  height: 13px;
  overflow: hidden;
  border-radius: 3px;
  background: #eef0f8;
  box-shadow: inset -1px 0 0 #c4cae4;
}
.cum-bar:before, .cum-bar:after {
  position: absolute;
  inset: 0;
  background-repeat: repeat-x, repeat-x;
  background-size: 10% 100%, 5% 45%;
  background-position: 0 0, 0 100%;
  content: "";
  pointer-events: none;
}
.cum-bar:before {
  background-image:
    repeating-linear-gradient(90deg, #c4cae4 0 1px, transparent 1px 100%),
    repeating-linear-gradient(90deg, #d5daec 0 1px, transparent 1px 100%);
}
.cum-bar > i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 3px 0 0 3px;
  background: var(--blue);
}
.cum-bar:after {
  z-index: 2;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 1px, transparent 1px 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.32) 0 1px, transparent 1px 100%);
}
.mini-bar { min-width: 90px; height: 6px; border-radius: 6px; background: #eef0f8; }
.mini-bar i { display: block; height: 6px; border-radius: 6px; background: var(--blue); }

/* ---------- matrix ---------- */
.matrix th { text-align: center; }
.matrix td.heat { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.matrix td:first-child { min-width: 190px; }

/* ---------- document pages ---------- */
.doc-card { padding: 26px 30px 30px; }
.doc-card.compact { padding: 18px 20px; }
.doc-card h2 { margin: 0 0 14px; color: #171e5a; font-size: 19px; font-weight: 780; }
.doc-card h3 { margin: 26px 0 8px; color: #2b3270; font-size: 14px; font-weight: 750; }
.doc-card p { margin: 0 0 10px; color: #444b73; font-size: 13px; line-height: 1.95; }
.doc-lead { margin: 0 !important; color: #333b6b !important; font-size: 13.5px !important; }
.doc-list { margin: 0 0 10px; padding-left: 20px; color: #444b73; font-size: 13px; line-height: 1.95; }
.doc-list li { margin-bottom: 5px; }
.doc-table { display: grid; gap: 0; margin: 0 0 10px; }
.doc-table > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.doc-table dt { color: #6d7396; font-size: 12px; font-weight: 700; }
.doc-table dd { margin: 0; color: #333b6b; font-size: 13px; }
.doc-table a, .doc-link { color: var(--blue); }
.doc-note { margin-top: 20px !important; color: var(--muted) !important; font-size: 11px !important; }

/* ---------- in-page CTA ---------- */
.cta-card { display: flex; justify-content: space-between; gap: 22px; align-items: center; border: 0; background: linear-gradient(120deg, #2f34c4 0%, #4348dd 55%, #5b57e6 100%); color: #fff; }
.cta-card h2, .cta-card h3 { margin: 0 0 6px; color: #fff; font-size: 16px; font-weight: 760; }
.cta-card p { max-width: 640px; margin: 0; color: #dde0ff; font-size: 12.5px; line-height: 1.8; }
.cta-button { flex: none; padding: 12px 22px; border-radius: 9px; background: #fff; color: var(--blue-dark); font-size: 13px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.cta-button:hover { background: #eef0ff; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .masthead { grid-template-columns: 1fr; gap: 28px; }
  .metrics { max-width: 720px; }
  .shell { width: min(100% - 34px, 1520px); }
  .site-header-inner { grid-template-columns: auto 1fr auto; width: calc(100% - 34px); }
  .site-header nav { justify-content: center; gap: 22px; }
  .board { grid-template-columns: 1fr; }
  .board-side { padding: 18px 18px 4px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .side-nav { display: flex; flex-wrap: wrap; }
  .side-nav button { width: auto; padding: 10px 14px; }
  .side-note { margin: 10px 2px 12px; }
  .board-grid { grid-template-columns: 1fr; }
  .trend-legend { flex-direction: row; flex-wrap: wrap; gap: 10px 20px; width: auto; }
  .trend-body { flex-direction: column; align-items: stretch; }
}
@media (max-width: 820px) {
  .site-header nav { display: none; }
  .site-header-inner { grid-template-columns: 1fr auto; }
  .masthead { padding-top: 30px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connection { min-width: 0; }
  .persona-bar { grid-template-columns: 1fr 1fr; }
  .persona-copy { grid-column: 1 / -1; padding: 12px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .active-badge { justify-self: end; }
  .prompt summary { grid-template-columns: 34px 64px minmax(180px, 1fr) auto 18px; padding: 14px; }
  .prompt-detail { padding-left: 14px; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 18px); }
  .site-header-inner { width: calc(100% - 22px); min-height: 58px; }
  .brand { font-size: 15px; }
  .site-header .connection { padding: 6px 9px; }
  .site-header .connection span:last-child { display: none; }
  .masthead { padding: 24px 2px 22px; }
  .metrics { gap: 10px; }
  .metric { min-height: 92px; padding: 13px 14px; }
  .metric strong { font-size: 25px; }
  .board-main { padding: 18px 14px 22px; }
  .persona-bar { grid-template-columns: 1fr; padding: 14px; }
  .persona-copy { padding-left: 0; }
  .persona-copy p { overflow: visible; text-overflow: initial; white-space: normal; }
  .active-badge { justify-self: start; }
  .card { padding: 16px 14px; }
  .table-card, .prompts-card { padding-right: 0; padding-left: 0; }
  .card-head { flex-wrap: wrap; gap: 9px; }
  .table-card .card-head, .prompts-card .card-head { padding: 0 14px; }
  .card-note { width: 100%; white-space: normal; }
  .trend-metrics { width: 100%; overflow-x: auto; }
  .trend-metrics button { flex: 1 0 auto; }
  .trend-summary { margin-right: -2px; margin-left: -2px; }
  .trend-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .trend-legend-item { grid-template-columns: 8px minmax(0, 1fr) auto; gap: 7px; font-size: 11px; }
  .table-wrap { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .prompt summary {
    grid-template-columns: auto minmax(0, 1fr) 18px;
    grid-template-areas:
      "order category toggle"
      "text text toggle"
      "counts counts counts";
    gap: 8px 10px;
    padding: 13px 12px;
  }
  .prompt-order { grid-area: order; }
  .category-tag { grid-area: category; justify-self: start; }
  .prompt-text { grid-area: text; font-size: 13px; }
  .prompt-counts { grid-area: counts; flex-wrap: wrap; justify-content: flex-start; }
  .prompt summary:after { grid-area: toggle; align-self: center; }
  .prompt-detail { padding: 0 12px 16px; }
  .prompt-meta, .hierarchy-label { flex-wrap: wrap; gap: 6px 10px; }
  .product-node-head { grid-template-columns: 58px minmax(0, 1fr); gap: 9px 11px; padding: 12px; }
  .product-rank { grid-column: 1 / -1; grid-row: 1; justify-self: start; }
  .product-thumb { grid-column: 1; grid-row: 2; }
  .product-copy { grid-column: 2; grid-row: 2; }
  .product-copy strong { overflow-wrap: anywhere; }
  .evidence-badges { grid-column: 1 / -1; grid-row: 3; flex-wrap: wrap; }
  .merchant-head { display: none; }
  .merchant-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "rank merchant"
      "price price"
      "status status";
    gap: 8px 10px;
    padding: 12px;
  }
  .merchant-row > strong { grid-area: rank; align-self: center; }
  .merchant-identity { grid-area: merchant; }
  .merchant-row > span { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; overflow: visible; text-overflow: initial; white-space: normal; }
  .merchant-row > span:nth-of-type(1) { grid-area: price; }
  .merchant-row > span:nth-of-type(2) { grid-area: status; }
  .merchant-mobile-label { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
  footer { flex-direction: column; }
}
