/* 分析の画面：スマホは1列、PC は2〜3列。グラフの色は dataviz の決まり（検証済み・2026-11-18） */
.az {
  --surface-1: #fcfcfb; --text-primary: #1c1c1e; --text-secondary: #5f5f66; --grid: #e4e4e8;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --ref: #8e8e93;
  max-width: 1320px; margin: 0 auto; padding: 0 16px 40px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .az { --surface-1: #1c1c1e; --text-primary: #f2f2f7; --text-secondary: #a1a1a8; --grid: #333336; --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --ref: #8e8e93; }
}
:root[data-theme="dark"] .az { --surface-1: #1c1c1e; --text-primary: #f2f2f7; --text-secondary: #a1a1a8; --grid: #333336; --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; }
.az .large-title { margin-left: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters .seg { margin: 0; flex: 1 1 360px; }
.filters input[type=date], .filters select { min-height: 40px; border-radius: 10px; border: 0; background: var(--card); padding: 0 10px; font-size: 15px; }
.filters .range { display: flex; gap: 6px; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border-radius: 14px; padding: 12px 14px; }
.kpi .k { font-size: 13px; color: var(--sub); }
.kpi .v { font-size: clamp(20px, 2.1vw, 26px); white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 2px 0 4px; }
.kpi .d { font-size: 12px; color: var(--sub); display: flex; flex-direction: column; gap: 1px; font-variant-numeric: tabular-nums; }
.kpi .d b { font-weight: 700; color: var(--text); }
.cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .cards { grid-template-columns: 1fr 1fr; } .card.wide { grid-column: 1 / -1; } }
.card { background: var(--card); border-radius: 16px; padding: 16px; min-width: 0; }
.card h2 { font-size: 17px; margin: 0 0 2px; }
.card .sub { font-size: 13px; margin-bottom: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-secondary); margin: 4px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--ref) 0 4px, transparent 4px 7px); height: 2px; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart text { fill: var(--text-secondary); font-size: 11px; font-family: inherit; }
svg.chart .grid { stroke: var(--grid); stroke-width: 1; }
svg.chart .hit { fill: transparent; cursor: crosshair; }
.viz-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--card); color: var(--text); border-radius: 10px; padding: 8px 10px; font-size: 13px; box-shadow: var(--shadow); opacity: 0; transition: opacity .12s; max-width: 260px; font-variant-numeric: tabular-nums; }
.viz-tip.on { opacity: 1; }
.viz-tip b { display: block; margin-bottom: 2px; }
details.tbl { margin-top: 8px; }
details.tbl summary { cursor: pointer; color: var(--tint); font-size: 14px; padding: 6px 0; min-height: 32px; }
table.dt { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.dt th, table.dt td { padding: 7px 6px; text-align: right; border-bottom: .5px solid var(--sep); white-space: nowrap; }
table.dt th:first-child, table.dt td:first-child { text-align: left; white-space: normal; }
table.dt th { color: var(--sub); font-weight: 600; position: sticky; top: 0; background: var(--card); cursor: pointer; }
.tscroll { overflow-x: auto; max-height: 460px; }
.mix { display: flex; height: 26px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 6px 0 10px; }
.mix div { min-width: 2px; }
.mixrows { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; font-size: 14px; align-items: center; }
.mixrows i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.inbar { height: 6px; border-radius: 3px; background: var(--series-1); min-width: 2px; }
.rank { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; margin-right: 6px; }
.rank.rA { background: var(--tint); color: #fff; } .rank.rB { background: var(--fill); } .rank.rC { box-shadow: inset 0 0 0 1.5px var(--sep); color: var(--sub); }
.up { color: var(--green); } .down { color: var(--red); }
.foot-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
/* 2026-11-18 作り直し：数字の札は 2列（スマホ）／4列（PC）にそろえる（8つが 7＋1 に割れないように） */
.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi, .card { box-shadow: 0 0 0 1px var(--sep); }
