/* tokens: brand.css (:root colours / fonts — do not redeclare here)
 *
 * KPI board (sample packs + /live): L0 いまの状態 → L1 どこで → L2 詳しい数字
 *
 * File eras (keep in this order; later blocks override earlier):
 *   1) Base layout — .top / .content / L0–L2 tables / 説明 / 業界目安 popover
 *   2) Board v3   — stacked 詳しい数字, drawers, 編集モード, guess notice
 * Do not resurrect list/card/bar/比較/トレンド view-mode selectors (removed 2026-11).
 */
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font-family: var(--font-ui);
  background: var(--bg);
}
.main { min-width: 0; }
.top {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 14px 28px; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
}
.top h1 { margin: 0; font-size: 1.125rem; font-weight: 800; font-family: var(--font-num); }
.top .meta { color: var(--muted); font-size: 0.8125rem; font-weight: 600; margin-top: 2px; }
.top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.period select {
  font: inherit; font-size: 0.8125rem; font-weight: 700;
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.content {
  padding: 22px 28px 64px; display: flex; flex-direction: column; gap: 18px;
  max-width: 1480px;
}
.content > section {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 24px;
}
.sample-tag {
  font-size: 0.75rem; font-weight: 800; color: #92400e; background: #fef3c7;
  border-radius: 999px; padding: 2px 8px; letter-spacing: 0.02em; vertical-align: 2px;
}
.focus-tag {
  font-size: 0.75rem; font-weight: 800; padding: 1px 7px; border-radius: 999px;
  background: #eaf1ff; color: var(--accent-ink); letter-spacing: 0.02em; flex-shrink: 0;
  white-space: nowrap; vertical-align: 1px;
}
.muted { color: var(--faint); }
.tone-up { color: var(--up); }
.tone-down { color: var(--down); }
.tone-mid { color: #475569; }
.tone-na { color: var(--faint); }
code {
  font-size: 0.92em; background: #f1f5f9; padding: 2px 6px;
  border-radius: 4px; font-weight: 700;
}

/* ---- 仮の流れのお知らせ (numbers-first entry) ---- */
.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 12px 16px; border-radius: 12px; background: #eef4ff; border: 1px solid #c9dbfb;
}
.notice p { margin: 0; font-size: 0.8125rem; font-weight: 600; color: #1e3a8a; line-height: 1.55; }
.notice-actions { display: flex; gap: 8px; align-items: center; }
.notice-actions form { margin: 0; }
.notice-fit {
  display: inline-block; padding: 8px 14px; border-radius: 8px; background: var(--accent); color: #fff;
  font-size: 0.8125rem; font-weight: 700; text-decoration: none;
}
.notice-keep {
  font: inherit; font-size: 0.8125rem; font-weight: 700; padding: 8px 12px; border-radius: 8px;
  border: 1px solid #c9dbfb; background: #fff; color: var(--accent-ink); cursor: pointer;
}

/* ---- L0 いまの状態 ---- */
.kicker { margin: 0; font-size: 0.75rem; font-weight: 800; color: var(--muted); letter-spacing: 0.06em; }
.verdict-text {
  margin: 8px 0 18px; font-size: 1.375rem; line-height: 1.6; font-weight: 800; max-width: 54em;
  text-wrap: pretty;
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tile {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; min-width: 0;
}
.tile.is-issue { background: #fffaf3; border-color: #f3d9b5; }
.tile-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.tile-tag {
  font-size: 0.75rem; font-weight: 800; color: var(--accent-ink); background: #eaf1ff;
  border-radius: 999px; padding: 2px 8px;
}
.tile.is-issue .tile-tag { color: #92400e; background: #fde7c7; }
.tile-label { font-size: 0.8125rem; font-weight: 800; min-width: 0; }
.tile-head .help-btn { margin-left: auto; }
.tile-value {
  font-family: var(--font-num); font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.tile-yards { margin: 0; border-top: 1px solid #eef1f5; padding-top: 10px; display: grid; gap: 8px; }
.tile-yards > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile-yards dt { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.tile-yards dd { margin: 0; font-size: 0.8125rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.tile-yards dd b { font-weight: 800; }
.tile-note { margin: 0; font-size: 0.75rem; color: var(--muted); text-align: right; min-height: 1.2em; }

/* ---- 判定チップ (vs 業界目安) ---- */
.judge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font: inherit;
  font-size: 0.75rem; font-weight: 800; line-height: 1.5; white-space: nowrap; border: 0;
}
.judge-up { background: #e6f6f2; color: #0f766e; }
.judge-mid { background: #e8eefc; color: #1e40af; }
.judge-down { background: #fde7c7; color: #92400e; }
.judge-none { background: #f1f3f5; color: var(--muted); font-weight: 600; cursor: pointer; }
.judge-none:hover { background: #e7ebf0; }
.judge-na-chip { background: #f1f3f5; color: var(--muted); font-weight: 600; }
.judge-na { color: var(--faint); font-weight: 600; }

/* ---- L1 どこで離れているか ---- */
.where-head, .detail-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
}
.where-head h2, .detail-head h2 { margin: 0; font-size: 1.125rem; font-weight: 800; }
.where-head .sub, .detail-head .sub { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--muted); }
.where-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.where-edit { font-size: 0.8125rem; font-weight: 700; color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
.where-edit:hover { text-decoration: underline; }
.where-grid {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line);
}
.where-grid.is-single { grid-template-columns: minmax(0, 1fr); }
.where-grid.is-single .watch-list { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
@media (max-width: 1100px) { .where-grid { grid-template-columns: minmax(0, 1fr); } }
.where-grid h3 { margin: 0; font-size: 0.9375rem; font-weight: 800; }

/* 行動フロー (compact funnel: one row of columns, scrolls sideways before it stacks) */
.flow { container-type: inline-size; container-name: flow; }
.flow-chs-wrap { margin-top: 12px; margin-bottom: 18px; }
.flow-chs { display: flex; flex-wrap: wrap; gap: 6px; }
.flow-ch {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 0.75rem; font-weight: 700;
  color: #334155; background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px; cursor: pointer; min-height: 32px;
}
.flow-ch i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.flow-ch.is-on { background: #1e293b; border-color: #1e293b; color: #fff; }
.flow-ch-now {
  margin: 10px 0 0; font-size: 0.8125rem; font-weight: 700; color: #475569;
}
.flow-ch-now.is-filtered {
  color: #1e40af; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 8px 12px; margin-top: 12px;
}
.flow.is-ch-filtered .flow-track .flow-node {
  background: #f8fbff; box-shadow: inset 0 0 0 2px #93c5fd;
}
.flow.is-ch-filtered .flow-track .flow-bar { background: #e0effe; }
.flow.is-ch-filtered .where-answer,
.flow.is-ch-filtered .q-h.where-answer { outline: 2px solid #93c5fd; outline-offset: 4px; border-radius: 8px; }
.flow-error { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #fff1f2; color: #9f1239; font-size: 0.8125rem; font-weight: 700; }
.flow-insights { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.flow-insights li { font-size: 0.8125rem; line-height: 1.55; color: #1e293b; padding-left: 16px; position: relative; }
.flow-insights li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.flow-scroll { overflow-x: auto; margin-top: 14px; padding-bottom: 4px; }
/* Track = grid: row 1 other behaviours above, row 2 the main path (+ arrows), row 3 below.
   Each stage <li> is display:contents; its parts sit in column --c. */
.flow-track {
  --link-w: 62px;
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-rows: auto auto auto; row-gap: 6px; column-gap: 0;
  min-width: calc(var(--n) * 92px + (var(--n) - 1) * var(--link-w));
}
.flow-stage { display: contents; }
.flow-up, .flow-node, .flow-down, .flow-link { grid-column: var(--c); min-width: 0; }
.flow-up { grid-row: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 6px; }
.flow-node { grid-row: 2; }
.flow-down { grid-row: 3; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 6px; }
.flow-link { grid-row: 2; }
.flow-up:empty, .flow-down:empty { display: none; }
/* Outside 編集モード, hide columns that only held a ＋ (no 別の行動 yet) */
.where:not(.is-editing) .flow-up:not(:has(.flow-branch)),
.where:not(.is-editing) .flow-down:not(:has(.flow-branch)) { display: none; }
.flow-node {
  min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  text-align: left; font: inherit; color: inherit; background: #fff;
  border: 1px solid transparent; border-radius: 12px; padding: 8px 8px 10px;
  position: relative;
}
button.flow-node { cursor: pointer; }
button.flow-node:hover, button.flow-node[aria-expanded="true"] { border-color: #9db8ea; background: #f6f9ff; }
.flow-step { position: absolute; top: 8px; right: 8px; font-size: 0.75rem; font-weight: 800; color: var(--faint); display: none; }
.flow-bar {
  order: -1; width: 100%; height: 72px; margin-bottom: 6px; display: flex; align-items: flex-end;
  background: #f1f4f8; border-radius: 8px; overflow: hidden;
}
.flow-bar i { display: block; width: 100%; height: var(--r); min-height: 3px; background: #93b4f5; border-radius: 6px 6px 0 0; }
.flow-stage:last-child .flow-bar i { background: var(--accent-ink); }
.flow-stage.is-entry .flow-bar i { background: #bcd0f7; }
.flow-label { font-size: 0.8125rem; font-weight: 800; line-height: 1.3; min-height: 2.6em; }
.flow-event {
  font-size: 0.75rem; color: var(--muted); background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 1px 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.flow-event.is-mapped { color: #6d28d9; border-color: #ddd6fe; background: #f5f3ff; }
.flow-users { margin-top: 2px; font-variant-numeric: tabular-nums; }
.flow-users strong { font-family: var(--font-num); font-size: 1.125rem; font-weight: 800; letter-spacing: -0.01em; }
.flow-users small { font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.flow-reach { font-size: 0.75rem; color: var(--muted); }
.flow-reach b { color: #1e40af; font-variant-numeric: tabular-nums; }
.flow-mix { width: 100%; height: 4px; display: flex; border-radius: 99px; overflow: hidden; gap: 1px; margin-top: 4px; }
.flow-mix i { display: block; height: 100%; transition: opacity 0.15s; }
.flow:not([data-ch="all"]) .flow-mix i:not(.is-on) { opacity: 0.18; }
.flow-src { font-size: 0.75rem; color: #475569; line-height: 1.4; }
.flow-node .flow-src { display: none; }  /* visits / sources: in 流入別 and 詳しい数字 */
.flow-missing { margin-top: 6px; font-size: 0.8125rem; font-weight: 800; color: var(--faint); }
.flow-em { margin-top: 4px; font-size: 0.75rem; font-weight: 700; color: var(--accent); line-height: 1.4; }
.flow-em::after { content: " ↗"; }
.flow-cta { font-size: 0.75rem; font-weight: 700; color: var(--accent-ink); }
.flow-stage.is-missing .flow-node { border: 1px dashed #cbd5e1; }
.flow-stage.is-missing .flow-bar { background: repeating-linear-gradient(135deg, #f1f4f8 0 6px, #fff 6px 12px); }

.flow-link {
  display: flex; flex-direction: column; justify-content: flex-start; align-items: center;
  gap: 2px; padding: 34px 2px 0; text-align: center; font-size: 0.75rem; color: var(--muted);
}
.flow-arrow { width: 100%; height: 10px; position: relative; }
.flow-arrow::before { content: ""; position: absolute; left: 4px; right: 9px; top: 4px; height: 2px; background: #cbd5e1; }
.flow-arrow::after {
  content: ""; position: absolute; right: 3px; top: 0; border: 5px solid transparent; border-left: 7px solid #cbd5e1; border-right: 0;
}
.flow-go b { font-size: 0.8125rem; color: #0f172a; font-variant-numeric: tabular-nums; }
.flow-drop { font-variant-numeric: tabular-nums; }
.flow-link.is-worst .flow-arrow::before { background: #d97706; }
.flow-link.is-worst .flow-arrow::after { border-left-color: #d97706; }
.flow-link.is-worst .flow-drop { color: #92400e; font-weight: 800; }
.flow-worst { font-size: 0.75rem; font-weight: 800; color: #92400e; background: #fde7c7; border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.flow-note { margin: 10px 0 0; font-size: 0.75rem; color: var(--muted); line-height: 1.5; }
.ev-alias { margin-left: 6px; font-size: 0.75rem; font-weight: 700; color: #6d28d9; white-space: nowrap; }

/* 流入別 */
.flow-chtable { min-width: 0; }
.flow-chtitle { margin: 0 0 10px !important; }
.flow-chtable ul { list-style: none; margin: 0; padding: 0; border: 1px solid #eef1f5; border-radius: 12px; overflow: hidden; }
.flow-chtable li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name rate" "entry rate";
  align-items: center; padding: 9px 12px; border-bottom: 1px solid #eef1f5;
}
.flow-chtable li:last-child { border-bottom: 0; }
.flow-chtable li.is-on { background: #eef4ff; }
.flow-chname { grid-area: name; font-size: 0.8125rem; font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; }
.flow-chname i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.flow-chentry { grid-area: entry; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 17px; }
.flow-chrate { grid-area: rate; text-align: right; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.flow-chrate b { font-family: var(--font-num); font-size: 0.9375rem; }
.flow-chrate em { font-style: normal; font-size: 0.75rem; font-weight: 800; border-radius: 999px; padding: 2px 8px; }
.tag-best { color: #0f766e; background: #e6f6f2; }
.tag-low { color: #92400e; background: #fde7c7; }

/* 今見るべきこと */
.watch-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.watch-head .sub { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.watch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.watch-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fbfcfe; }
.watch-item.tone-down { background: #fffaf3; border-color: #f3d9b5; }
.watch-item.tone-up { background: #f5fbf9; border-color: #cdebe3; }
.watch-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.watch-title strong { font-size: 0.9375rem; line-height: 1.4; }
.watch-numbers { margin: 6px 0 0; font-size: 0.8125rem; color: #334155; font-weight: 600; font-variant-numeric: tabular-nums; }
.watch-trend { margin: 2px 0 0; font-size: 0.8125rem; color: #334155; }
.watch-trend span { color: var(--muted); font-weight: 700; margin-right: 6px; }
.watch-trend b { font-variant-numeric: tabular-nums; margin-right: 4px; }
.watch-tip { margin: 6px 0 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.6; }
.watch-tip > span { font-weight: 800; color: #475569; margin-right: 6px; }
.watch-tip .help-btn { margin-left: 4px; vertical-align: 1px; }
.watch-none { margin: 0; font-size: 0.8125rem; color: #475569; }
.watch-sample { margin: 8px 0 0; font-size: 0.75rem; color: var(--faint); font-weight: 600; }

/* ---- L2 詳しい数字 ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin: 14px 0 0; }
.tab {
  font: inherit; font-size: 0.9375rem; font-weight: 600; color: var(--muted); background: none; border: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 14px; cursor: pointer; min-height: 44px;
}
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); font-weight: 800; border-bottom-color: var(--accent); }
.tab-n { margin-left: 5px; font-size: 0.75rem; font-weight: 700; color: var(--faint); }
.tabpanel { padding-top: 6px; }
.table-wrap { overflow-x: auto; }
table.dense { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 0.8125rem; min-width: 520px; }
table.dense col.c-name { width: 46%; }
table.dense col.c-num { width: 18%; }
table.dense col.c-judge { width: 18%; }
table.dense thead th {
  text-align: left; font-size: 0.75rem; font-weight: 700; color: var(--muted); letter-spacing: 0.04em;
  padding: 10px 12px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.dense th.num, table.dense td.num { text-align: right; }
.drow-main th, .drow-main td { padding: 0 12px; height: 50px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.drow-main { cursor: pointer; }
.drow-main:hover th, .drow-main:hover td { background: #f8fafc; }
.drow.is-focus .drow-main th, .drow.is-focus .drow-main td { background: #f6f9ff; }
.drow.is-open .drow-main th, .drow.is-open .drow-main td { border-bottom-color: transparent; background: #f8fafc; }
.name-cell { text-align: left; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow-toggle {
  font: inherit; color: inherit; background: none; border: 0; padding: 6px 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; text-align: left; min-height: 36px;
}
.drow-toggle .caret {
  width: 7px; height: 7px; flex: none; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint);
  transform: rotate(-45deg); transition: transform 0.15s; margin-right: 2px;
}
.drow-toggle[aria-expanded="true"] .caret { transform: rotate(45deg); }
.row-name { font-size: 0.9375rem; font-weight: 700; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
code.row-name { font-size: 0.8125rem; }
td.num { font-family: var(--font-num); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.9375rem; }
td.prev-cell { font-weight: 700; font-size: 0.8125rem; }
td.judge-cell { font-family: var(--font-ui); }
.drow-more td { padding: 4px 12px 16px 34px; background: #f8fafc; border-bottom: 1px solid #eef1f5; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; align-items: start; font-size: 0.8125rem; }
.more-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.more-meaning { grid-column: span 2; line-height: 1.6; color: #334155; }
@media (max-width: 640px) { .more-meaning { grid-column: auto; } }
.more-k { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.more-cell .bench-v, .more-cell .bench-gap { font-family: var(--font-num); font-size: 0.9375rem; font-weight: 800; align-self: flex-start; }
.more-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.more-btn, .more-actions .help-btn {
  font: inherit; font-size: 0.75rem; font-weight: 700; padding: 6px 10px; border-radius: 8px;
  border: 1px solid #cbd5e1; background: #fff; color: var(--accent-ink); cursor: pointer; white-space: nowrap;
}
.more-btn:hover, .more-actions .help-btn:hover { border-color: var(--accent); background: #eef4ff; }
.bench-gap { font-weight: 800; font-variant-numeric: tabular-nums; }
.bench-gap.tone-up { color: var(--up); }
.bench-gap.tone-down { color: var(--down); }
.bench-gap.tone-mid { color: #475569; }
.bench-gap.tone-na { color: var(--faint); }
.bench-v { font-weight: 800; color: #1e40af; font-variant-numeric: tabular-nums; }
.bench-cell.is-custom .bench-v, .bench-v.is-custom { color: #6d28d9; }
.chan-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.chan-stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #eef2f7; margin: 14px 0 6px; }
.chan-stack-seg { display: block; height: 100%; min-width: 2px; }
.ev-count { display: block; }
.ev-bar { display: block; height: 4px; margin-top: 4px; margin-left: auto; width: 100%; max-width: 120px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.ev-bar i { display: block; height: 100%; margin-left: auto; background: #93b4f5; border-radius: 99px; }
.drow.is-focus .ev-bar i { background: var(--accent-ink); }
.drow.is-more { display: none; }
.tabpanel.is-expanded .drow.is-more { display: table-row-group; }
.more-wrap { display: flex; justify-content: center; padding: 12px 0 2px; }
.more-chip {
  font: inherit; font-size: 0.8125rem; font-weight: 800; padding: 8px 16px; border-radius: 999px;
  border: 1px solid #bfd2f8; background: #eaf1ff; color: var(--accent-ink); cursor: pointer; min-height: 40px;
}
.more-chip:hover { background: #dbe7ff; }
.ev-missing { margin: 10px 0 0; font-size: 0.75rem; line-height: 1.6; color: var(--muted); }
.ev-missing-k { font-weight: 700; margin-right: 4px; }
.ev-missing code { font-size: 0.75rem; color: var(--muted); }
.ev-empty { margin: 10px 0 8px; font-size: 0.8125rem; color: var(--muted); }

/* 業務KPI 未連携 (collapsed) */
.biz-collapsed { padding: 14px 4px 6px; }
.biz-collapsed-title { margin: 0; font-weight: 800; font-size: 0.9375rem; color: #475569; }
.biz-collapsed-hint { margin: 6px 0 8px; font-size: 0.8125rem; color: var(--muted); line-height: 1.6; }
.biz-collapsed-list summary { cursor: pointer; font-size: 0.8125rem; font-weight: 700; color: var(--accent-ink); }
.biz-collapsed-list ul {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 12px;
}
.biz-collapsed-list li { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 600; }

/* 説明 */
.help-btn {
  font: inherit; font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; flex-shrink: 0;
  line-height: 1.2; white-space: nowrap;
}
.help-btn:hover { border-color: #bfd2f8; color: var(--accent-ink); background: #eaf1ff; }
.help-dialog {
  border: 1px solid var(--line); border-radius: 14px; padding: 0;
  width: min(440px, calc(100vw - 32px));
  box-shadow: 0 18px 48px rgba(21,32,51,0.18);
}
.help-dialog::backdrop { background: rgba(21,32,51,0.28); }
.help-sheet { margin: 0; padding: 18px; }
.help-sheet header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.help-sheet h3 { margin: 0; font-size: 1.125rem; font-weight: 800; font-family: var(--font-num); }
.help-kind { margin: 0 0 4px; font-size: 0.75rem; font-weight: 800; color: var(--accent-ink); }
.help-close {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 1.125rem; cursor: pointer; color: var(--muted);
}
.help-sheet section { margin-top: 12px; }
.help-sheet h4 { margin: 0 0 4px; font-size: 0.75rem; font-weight: 800; color: var(--muted); }
.help-sheet p { margin: 0; line-height: 1.65; font-size: 0.9375rem; }
.help-sheet .formula {
  font-family: var(--font-num); font-weight: 700; background: #f8fafc; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font-size: 0.9375rem;
}

/* Phones / narrow: the mobile bar is the sticky header */
@media (max-width: 900px) {
  .main > .top { position: static; }
  .top { padding: 12px 16px; }
  .content { padding: 14px 12px 40px; gap: 14px; }
  .content > section { padding: 16px 14px; border-radius: 14px; }
  .verdict-text { font-size: 1.125rem; }
  .tile-value { font-size: 1.625rem; }
}

/* ---- 自社目安 ---- */
.adjust-link {
  font-size: 0.8125rem; font-weight: 700; color: var(--accent); text-decoration: none;
  padding: 7px 4px;
}
.adjust-link:hover { text-decoration: underline; }
.src-tag {
  display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 800;
  color: #7c3aed; letter-spacing: 0.02em;
}
td.bench-cell.is-custom .bench-v { color: #6d28d9; }

/* ---- 業界目安: anchored popover ---- */
button.adjust-link { border: none; background: none; cursor: pointer; font: inherit; font-size: 0.8125rem; font-weight: 700; }
button.bench-open {
  font: inherit; font-weight: 800; background: none; border: none;
  padding: 0; cursor: pointer; border-bottom: 1px dashed currentColor;
}
button.bench-open:hover, button.bench-open[aria-expanded="true"] { color: var(--accent); }
.pop {
  position: absolute; z-index: 60; width: min(340px, calc(100vw - 24px));
  overflow-y: auto; background: #fff; color: var(--ink);
  border: 1px solid #d5deea; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
  padding: 12px 14px; font-size: 0.8125rem; animation: pop-in 0.12s ease-out;
}
.pop[hidden] { display: none; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pop[data-side="above"] { animation-name: pop-in-up; }
@keyframes pop-in-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } }
.pop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.pop-head strong { display: block; font-size: 0.9375rem; font-weight: 800; line-height: 1.35; }
.pop-sub { display: block; margin-top: 2px; font-size: 0.75rem; color: var(--muted); }
.pop-close {
  border: none; background: none; cursor: pointer; color: var(--muted);
  font-size: 1.125rem; line-height: 1; padding: 2px 4px; border-radius: 6px;
}
.pop-close:hover { background: #f1f5f9; color: var(--ink); }
.pop-inputs { display: flex; align-items: center; gap: 6px; }
.pop-inputs input {
  flex: 1 1 0; min-width: 0; font: inherit; font-size: 0.9375rem; text-align: right;
  font-variant-numeric: tabular-nums; padding: 8px 9px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.pop-inputs input:focus { outline: 2px solid #bfd2f8; border-color: var(--accent); }
.pop-inputs input[aria-invalid="true"] { border-color: #e11d48; background: #fff1f2; }
.pop-inputs .sep, .pop-inputs .unit { color: var(--muted); font-weight: 700; }
.pop-error { margin: 8px 0 0; color: #be123c; font-size: 0.75rem; font-weight: 700; }
.pop-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin: 10px 0 0; font-size: 0.75rem; color: var(--muted);
}
.src-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  border: 1px solid #c7d6ee; border-radius: 999px; background: #f5f8fe;
  color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.src-btn::after { content: "↗"; font-size: 0.75rem; }
.src-btn:hover { background: #e8f0fd; }
.src-grp { display: inline-flex; align-items: center; gap: 6px; }
.src-checked { color: var(--muted); white-space: nowrap; }
.src-none {
  padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: #64748b;
  font-weight: 700; white-space: nowrap;
}
.pop-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 12px; }
.pop-actions button { font: inherit; font-weight: 700; border-radius: 8px; padding: 7px 14px; cursor: pointer; }
.pop-actions .primary { border: 0; background: var(--accent); color: #fff; }
.pop-actions .primary:disabled { opacity: 0.6; }
.pop-actions .ghost { border: 1px solid var(--line); background: #fff; color: #334155; }
.pop-actions .link { border: 0; background: none; color: var(--accent); padding: 7px 4px; }
.pop-about { margin: 0 0 6px; font-size: 0.75rem; color: #475569; }
.pop-about summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.pop-about p { margin: 6px 0; line-height: 1.6; }
.pop-group { margin: 10px 0 4px; font-size: 0.75rem; font-weight: 800; color: var(--muted); letter-spacing: 0.02em; }
.pop-list ul { list-style: none; margin: 0; padding: 0; }
.pop-row {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px;
  align-items: baseline; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer;
}
.pop-row:hover, .pop-row:focus-visible { background: #f1f5fb; }
.pop-row-name { font-weight: 700; min-width: 0; }
.pop-row-range { font-weight: 800; color: #1e40af; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pop-row-src { grid-column: 1 / -1; font-size: 0.75rem; color: var(--muted); }
.pop-row.is-custom .pop-row-range { color: #6d28d9; }
.pop-row.is-custom .pop-row-src { color: #7c3aed; font-weight: 700; }


/* ---- 行動フロー: popovers / branches ---- */
.pop-select {
  width: 100%; font: inherit; font-size: 0.8125rem; padding: 8px 9px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff;
}
.pop-text { margin: 0; font-size: 0.8125rem; line-height: 1.6; color: #334155; }
.pop-sub code, .pop-text code { font-size: 0.75rem; }
.primary-link {
  display: inline-block; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none;
  border-radius: 8px; padding: 7px 14px;
}


/* 行動フロー: other behaviours at the same stage (分岐) */
.flow-branch {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: #faf5ff; border: 1px solid #ddd6fe; border-radius: 10px; padding: 7px 10px;
}
.flow-branch:hover, .flow-branch[aria-expanded="true"] { border-color: #a78bfa; }
.flow-branch.is-missing { background: #fff; border-style: dashed; }
.flow-branch::before {  /* connector to the main box */
  content: ""; position: absolute; left: 50%; width: 0; height: 6px; border-left: 2px dotted #c4b5fd;
}
.flow-branch.is-above::before { bottom: -8px; }
.flow-branch.is-below::before { top: -8px; }
.flow-branch-mark { font-size: 0.75rem; font-weight: 800; color: #6d28d9; letter-spacing: 0.02em; }
.flow-branch .flow-label { font-size: 0.8125rem; }
.flow-branch .flow-users strong { font-size: 0.9375rem; }
.flow-branch .flow-reach b { color: #6d28d9; }
/* ＋ = add 別の行動 — only while 「流れを直す」編集モード (.where.is-editing) */
.flow-add {
  display: none;
  align-self: center; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; border: 1px dashed #94a3b8;
  background: #fff; color: #475569; font: inherit; font-size: 0.8125rem; line-height: 1; cursor: pointer; padding: 0;
  opacity: 0.55; transition: opacity 0.15s;
}
.where.is-editing .flow-add { display: inline-flex; }
.where.is-editing .flow:hover .flow-add, .where.is-editing .flow-add:focus-visible { opacity: 1; }
.where.is-editing .flow-add:hover, .where.is-editing .flow-add[aria-expanded="true"] {
  opacity: 1; border-style: solid; border-color: #7c3aed; color: #7c3aed;
}
@media (hover: none) { .where.is-editing .flow-add { opacity: 1; } }
.pop-field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.pop-field input {
  font: inherit; font-size: 0.8125rem; color: var(--ink); padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px;
}
.pop-delete { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; display: flex; justify-content: flex-start; }
.pop-delete .link.danger {
  font: inherit; font-size: 0.8125rem; font-weight: 700; color: #be123c; background: none; border: 0; padding: 6px 2px; cursor: pointer;
}


/* 行動フロー stacked when the panel is narrow (phones): one column, bar turns horizontal */
@container flow (max-width: 520px) {
  .flow-track { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: none; row-gap: 0; min-width: 0; }
  .flow-up, .flow-node, .flow-down, .flow-link { grid-column: 1; grid-row: auto; }
  .flow-up { padding: 0 0 6px 22px; }
  .flow-down { padding: 6px 0 0 22px; }
  .where.is-editing .flow-add { align-self: flex-end; margin-right: 6px; }
  .where.is-editing .flow-up .flow-add { display: none; } /* phones: add only below the box */
  .where.is-editing .flow-down:has(> .flow-add:only-child) { padding-top: 0; margin-top: -11px; position: relative; z-index: 1; }
  .flow-branch { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "mark mark" "label users" "event reach"; column-gap: 12px; }
  .flow-branch-mark { grid-area: mark; }
  .flow-branch .flow-label { grid-area: label; }
  .flow-branch .flow-event { grid-area: event; justify-self: start; }
  .flow-branch .flow-users { grid-area: users; text-align: right; }
  .flow-branch .flow-reach { grid-area: reach; text-align: right; }
  .flow-branch .flow-missing { grid-area: users; justify-self: end; }
  .flow-branch::before { left: -12px; height: auto; top: -6px; bottom: 50%; border-left: 2px dotted #c4b5fd; border-bottom: 2px dotted #c4b5fd; width: 10px; }
  .flow-branch.is-above::before { top: 50%; bottom: -6px; border-bottom: 0; border-top: 2px dotted #c4b5fd; }
  .flow-link { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 4px 0 4px 18px; text-align: left; }
  .flow-arrow { width: 10px; height: 22px; flex: none; }
  .flow-arrow::before { left: 4px; right: auto; top: 0; bottom: 6px; width: 2px; height: auto; }
  .flow-arrow::after { left: 0; right: auto; top: auto; bottom: 0; border: 5px solid transparent; border-top: 7px solid #cbd5e1; border-bottom: 0; }
  .flow-link.is-worst .flow-arrow::after { border-top-color: #d97706; border-left-color: transparent; }
  .flow-node { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; grid-template-areas: "label users" "event reach" "bar bar" "mix mix"; align-items: center; padding: 9px 12px; background: #f8fafc; border-color: #e2e8f0; }
  .flow-node .flow-label { grid-area: label; min-height: 0; }
  .flow-node .flow-event { grid-area: event; justify-self: start; }
  .flow-node .flow-users { grid-area: users; margin-top: 0; text-align: right; }
  .flow-node .flow-reach { grid-area: reach; text-align: right; }
  .flow-node .flow-bar { grid-area: bar; order: 0; height: 6px; margin: 4px 0 0; align-items: stretch; }
  .flow-node .flow-bar i { width: var(--r); height: 100%; min-height: 0; border-radius: 99px; }
  .flow-node .flow-mix { grid-area: mix; }
  .flow-node .flow-missing { grid-area: users; margin-top: 0; justify-self: end; }
  .flow-node .flow-cta { grid-area: reach; justify-self: end; }
}

.pop.is-saving { cursor: progress; }
.pop.is-saving .pop-actions .primary { opacity: 0.75; }

.switch-link { color: var(--accent); font-weight: 700; text-decoration: none; }
.switch-link:hover { text-decoration: underline; }


/* 基準なし / 全業種 */
button.bench-open.is-none { color: #94a3b8; font-weight: 700; border-bottom-style: dotted; }
.src-btn.is-all { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.pop-why { margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; background: #f8fafc; font-size: 0.8125rem; line-height: 1.6; color: #334155; }
.pop-why p { margin: 0 0 6px; }
.pop-why p:last-child { margin: 0; }
.pop-why-set { color: var(--muted); }
.pop-note { margin: 6px 0 0; font-size: 0.75rem; color: #9a3412; line-height: 1.5; }

/* ===== Board v3 — one-sentence L0 + popups, stacked L2, drawers, 編集モード =====
   Overrides denser table chrome above; keep this section last for those rules. */
.top { padding: 10px 28px 0; box-shadow: 0 4px 14px rgba(21, 32, 51, 0.05); }
.top-l { min-width: 0; }
.top .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ind-chip {
  font: inherit; font-size: 0.75rem; font-weight: 700; display: inline-flex; align-items: center; gap: 4px;
  min-height: 28px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid #c9dbfb; background: #f8fbff; color: var(--accent-ink);
}
.ind-chip:hover, .ind-chip[aria-expanded="true"] { border-color: var(--accent); background: #eef4ff; }
.nav-warn { font-size: 0.75rem; font-weight: 800; border-radius: 999px; padding: 1px 7px; background: #fde7c7; color: #92400e; }
.content > section { scroll-margin-top: calc(var(--top-h, 80px) + 16px); }

/* L0 */
.verdict-text { font-size: 1.375rem; font-weight: 800; line-height: 1.5; }
.tile { gap: 10px; }
.tile-value { font-size: 1.625rem; }
.tile-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tile-prev { font-size: 0.9375rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile-prev.tone-up { color: var(--up); } .tile-prev.tone-down { color: var(--down); } .tile-prev.tone-mid, .tile-prev.tone-na { color: #475569; }

/* L1 */
.where-title { display: flex; align-items: center; gap: 10px; }
.where-edit { border: 0; background: none; cursor: pointer; font: inherit; font-size: 0.8125rem; font-weight: 700; color: var(--accent-ink); padding: 0 4px; }
.where-worst { margin: 12px 0 0; font-size: 0.9375rem; font-weight: 800; color: #92400e; }
.flow-link { padding-top: 30px; }
.flow-go { font-size: 0.9375rem; color: #0f172a; font-variant-numeric: tabular-nums; }
.flow-link.is-worst .flow-go { color: var(--down); }
.flow-users strong { font-size: 1.125rem; }
.watch h3, .flow-chtitle h3 { margin: 0 0 10px; }
.flow-chtitle { display: flex; align-items: center; gap: 10px; }
.flow-chtitle h3 { margin: 0; }
.flow-chtable ul { margin-top: 10px; }
.watch-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; }
.watch-name { flex: 1 1 150px; font-size: 0.9375rem; }
.watch-item.tone-down .watch-name { color: #92400e; }
.watch-value { font-family: var(--font-num); font-size: 1.125rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.watch-bench { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* popovers with the supplementary lines */
.pop-info { display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.pop-info .pop-head { margin-bottom: 2px; }
.pop-line { margin: 0; font-size: 0.8125rem; line-height: 1.65; color: #334155; }
.pop-k { font-weight: 800; color: var(--muted); margin-right: 6px; }
.pop-links { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.pop-link { font: inherit; font-size: 0.75rem; font-weight: 700; color: var(--accent-ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.pop-link:hover { text-decoration: underline; }

/* 指標名の説明ツールチップ: hover (desktop) / tap (phones) — text comes from the 説明 dialog already on the page */
.kpi-tip {
  position: absolute; z-index: 70; max-width: min(280px, calc(100vw - 24px));
  background: #1e293b; color: #fff; border-radius: 8px;
  padding: 7px 10px; font-size: 0.75rem; line-height: 1.55; font-weight: 500;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22); animation: pop-in 0.1s ease-out;
}
.kpi-tip[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .kpi-tip { animation: none; } }

/* L2 — stacked categories */
.detail-head .sub { margin-top: 4px; }
.dgroups { display: flex; flex-direction: column; gap: 22px; padding: 14px 0 6px; }
.dgroup { border: 1px solid #eef1f5; border-radius: 14px; padding: 6px 8px 4px; scroll-margin-top: calc(var(--top-h, 104px) + 64px); }
.dgroup-head { display: flex; align-items: center; gap: 10px; padding: 8px 6px 10px; }
.dgroup-head h3 { margin: 0; font-size: 1.125rem; font-weight: 800; }
.dgroup-n { font-size: 0.75rem; font-weight: 700; color: var(--faint); }
.dgroup-toggle {
  margin-left: auto; font: inherit; font-size: 0.75rem; font-weight: 700; border: 1px solid #d5dce6; background: #fff;
  color: var(--accent-ink); border-radius: 8px; min-height: 30px; padding: 0 12px; cursor: pointer;
}
.dgroup-summary, .dgroup-note {
  margin: 0 6px 10px; padding: 10px 14px; background: #f8fafc; border-radius: 10px; font-size: 0.8125rem; font-weight: 600; color: #475569;
  font-variant-numeric: tabular-nums;
}
.dgroup-summary.is-warn { background: #fffbeb; color: #92400e; }
.dgroup-note { border: 1px dashed #d5dce6; font-weight: 500; }
.dtable { overflow-x: auto; }
.dt-row {
  display: grid; grid-template-columns: minmax(0, 30fr) minmax(0, 12fr) minmax(0, 10fr) minmax(0, 11fr) minmax(0, 13fr) minmax(0, 15fr) minmax(0, 11fr);
  gap: 14px; align-items: center; min-height: 60px; padding: 8px 14px; border-bottom: 1px solid #eef1f5; min-width: 860px;
}
.dt-row:last-child { border-bottom: 0; }
.dt-head { min-height: 0; padding-top: 8px; padding-bottom: 8px; border-bottom-color: var(--line); font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.dt-row .num { text-align: right; }
.dt-row .ctr { display: flex; justify-content: center; }
.dt-row.is-focus { background: #f6f9ff; }
.dt-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.dt-name .row-name { font-size: 0.9375rem; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.dt-name code.row-name { font-family: ui-monospace, Menlo, monospace; font-size: 0.9375rem; background: #f1f5f9; padding: 3px 8px; border-radius: 4px; }
.dt-sub { flex-basis: 100%; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.dt-sub.is-warn { color: #92400e; font-weight: 800; }
.dt-value { font-family: var(--font-num); font-size: 0.9375rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dt-row .prev-cell { font-size: 0.9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.prev-cell.tone-up { color: var(--up); } .prev-cell.tone-down { color: var(--down); } .prev-cell.tone-na, .prev-cell.tone-flat { color: #8792a2; }
.dt-bench { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 0.9375rem; line-height: 1.25; }
.dt-bench small { font-size: 0.75rem; font-weight: 800; }
.bench-gap.tone-down { color: var(--down); } .bench-gap.tone-up { color: var(--up); } .bench-gap.tone-mid, .bench-gap.tone-na { color: #8792a2; }
.spark { overflow: visible; }
.spark polyline { fill: none; stroke: #94a3b8; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: #94a3b8; }
.spark.tone-up polyline { stroke: var(--up); } .spark.tone-up circle { fill: var(--up); }
.spark.tone-down polyline { stroke: var(--down); } .spark.tone-down circle { fill: var(--down); }
.details-loading { margin: 14px 0 8px; font-size: 0.9375rem; color: var(--muted); font-weight: 600; }
.skeleton { display: grid; gap: 10px; padding: 6px 0 12px; }
.skeleton i { display: block; height: 44px; border-radius: 10px; background: linear-gradient(90deg, #f1f4f8 0%, #e7ecf3 50%, #f1f4f8 100%); background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.muted { color: var(--faint); }

/* right-top drawers (比べる業種 · 段の編集) — follow the top bar */
.drawer {
  position: absolute; top: calc(100% + 8px); right: 20px; width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - var(--top-h, 104px) - 24px); overflow-y: auto;
  background: #fff; border: 1px solid #d5dce6; border-radius: 16px; box-shadow: 0 20px 48px rgba(21, 32, 51, 0.18);
  padding: 20px; display: flex; flex-direction: column; gap: 14px; z-index: 30;
}
.drawer[hidden] { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.drawer-head h2 { margin: 0; font-size: 1.125rem; font-weight: 800; }
.drawer-lead { margin: 4px 0 0; font-size: 0.75rem; color: var(--muted); }
.drawer-x { width: 32px; height: 32px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer; font-size: 0.9375rem; }
.drawer-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid #eef1f5; padding-top: 12px; }
.drawer-row .drawer-lead { margin: 0; }
.drawer-primary {
  font: inherit; font-size: 0.9375rem; font-weight: 800; border: 0; border-radius: 10px; min-height: 46px;
  background: var(--accent); color: #fff; cursor: pointer;
}
.drawer-primary:hover { background: var(--accent-ink); }
.drawer-form { display: flex; flex-direction: column; gap: 14px; }
.drawer-events { grid-template-columns: 1fr 1fr; }
.ind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ind-card {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; position: relative;
}
.ind-card:has(input:checked) { border-color: var(--accent); background: #f3f7fe; }
.ind-card input { position: absolute; opacity: 0; pointer-events: none; }
.ind-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ind-card b { font-size: 0.8125rem; }
.ind-card span { font-size: 0.75rem; color: var(--muted); line-height: 1.45; }
.ind-preview { border-top: 1px solid #eef1f5; padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.ind-preview > b { font-size: 0.8125rem; }

/* 編集モード */
.where.is-editing { border: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.12); }
.edit-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: -6px -8px 16px; padding: 10px 14px;
  border-radius: 12px; background: #eef4ff;
}
.edit-bar[hidden] { display: none; }
.edit-badge { font-size: 0.75rem; font-weight: 800; color: #fff; background: var(--accent); border-radius: 999px; padding: 3px 10px; }
.edit-note { font-size: 0.8125rem; font-weight: 600; color: #1e3a8a; }
.edit-tpl { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.edit-tpl select { font: inherit; font-size: 0.8125rem; font-weight: 700; color: var(--ink); padding: 6px 10px; border: 1px solid #c9dbfb; border-radius: 8px; background: #fff; min-height: 36px; }
.edit-actions { display: flex; gap: 8px; margin: 0; }
.edit-cancel { font: inherit; font-size: 0.8125rem; font-weight: 700; border: 1px solid #c9dbfb; background: #fff; color: var(--accent-ink); border-radius: 8px; min-height: 36px; padding: 0 12px; cursor: pointer; }
.edit-save { font: inherit; font-size: 0.8125rem; font-weight: 800; border: 0; background: var(--accent); color: #fff; border-radius: 8px; min-height: 36px; padding: 0 16px; cursor: pointer; }
.edit-error { flex-basis: 100%; margin: 0; padding: 8px 12px; border-radius: 8px; background: #fff1f2; color: #9f1239; font-size: 0.8125rem; font-weight: 700; }
.edit-demo { flex-basis: 100%; margin: 0; font-size: 0.75rem; color: #475569; }
.edit-track { margin-top: 14px; }
.edit-track .sx-cover { display: inline-block; margin: 10px 0 0; }

@media (max-width: 900px) {
  .top { padding: 10px 16px 0; }
  .drawer { position: fixed; top: auto; bottom: 0; right: 0; left: 0; width: auto; max-height: 80vh; border-radius: 16px 16px 0 0; }
  .ind-grid, .drawer-events { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .top { position: static; }
}

/* 比べる業種 · 流れを直す: real buttons (were too faint as text links) */
.ind-chip {
  min-height: 34px; padding: 0 12px; gap: 6px; font-size: 0.8125rem;
  border: 1.5px solid var(--accent); background: #fff; color: var(--ink); border-radius: 10px;
  box-shadow: 0 1px 3px rgba(47, 111, 237, 0.15);
}
.ind-chip .ind-k { font-weight: 600; color: var(--muted); }
.ind-chip b { font-weight: 800; color: var(--accent-ink); }
.ind-chip .ind-caret { color: var(--accent-ink); font-size: 0.75rem; }
.ind-chip:hover, .ind-chip[aria-expanded="true"] { background: #eef4ff; border-color: var(--accent-ink); }
.where-edit {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border: 1.5px solid var(--accent); border-radius: 10px; background: #fff; color: var(--accent-ink);
  font: inherit; font-size: 0.8125rem; font-weight: 800; text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 3px rgba(47, 111, 237, 0.15); white-space: nowrap;
}
.where-edit:hover { background: #eef4ff; text-decoration: none; }
.where.is-editing .where-edit { display: none; }

/* 気づかせ方: the guess notice names both guesses with their own buttons; nudges appear where they matter */
.notice-actions { flex-wrap: wrap; }
.notice-item {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 5px 5px 12px; border-radius: 10px;
  background: #fff; border: 1px solid #c9dbfb; font-size: 0.9375rem;
}
.notice-k { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.notice-btn, .nudge-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 12px; border-radius: 8px;
  border: 1.5px solid var(--accent); background: #fff; color: var(--accent-ink); font: inherit;
  font-size: 0.8125rem; font-weight: 800; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.notice-btn:hover, .nudge-btn:hover { background: #eef4ff; }
.notice-btn .caret, .nudge-btn .caret { font-size: 0.75rem; }
.flow-nudge { margin-top: 6px; font-size: 0.75rem; font-weight: 600; color: #92400e; line-height: 1.4; }
.flow-node .nudge-btn { align-self: flex-start; margin-top: 6px; min-height: 28px; padding: 0 8px; font-size: 0.75rem; }
.watch-ind {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  margin-top: 12px; padding: 10px 12px; border: 1.5px dashed #c9dbfb; border-radius: 10px;
  font-size: 0.8125rem; color: #334155; line-height: 1.5;
}
.watch-ind .nudge-btn { min-height: 30px; padding: 0 10px; font-size: 0.75rem; }
.drawer-adjust {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid #eef1f5; padding-top: 12px; font-size: 0.75rem; color: var(--muted);
}
.where.is-editing .flow-node .nudge-btn { display: none; }

/* 期間 is a small GET form; 段 drawer saves too (it covers the 編集中 bar) */
form.period { margin: 0; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer-secondary {
  font: inherit; font-size: 0.9375rem; font-weight: 800; border: 1.5px solid var(--accent); border-radius: 10px;
  min-height: 46px; background: #fff; color: var(--accent-ink); cursor: pointer;
}
.drawer-secondary:hover { background: #eef4ff; }
.drawer .drawer-actions { position: sticky; bottom: -20px; margin: 0 -20px -20px; padding: 12px 20px 20px; background: #fff; border-top: 1px solid #eef1f5; }

/* 今 · 業界(範囲) · あと(範囲) */
.rg-k { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.rg-band { font-family: var(--font-num); font-weight: 800; color: #1e40af; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rg-gap { font-family: var(--font-num); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rg-gap b { font-size: 0.9375rem; font-weight: 800; }
.rg-gap small { font-size: 0.75rem; font-weight: 700; opacity: 0.75; }
.rg-gap.is-short { color: var(--down); } .rg-gap.is-over { color: var(--up); } .rg-gap.is-in { color: #1e40af; }
.rg-in { font-family: var(--font-ui); font-size: 0.8125rem; font-weight: 800; }
.rg-over { font-family: var(--font-ui); font-size: 0.75rem; font-weight: 700; margin-right: 4px; }
.rg-box { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: #f8fafc; }
.rg-box .rg-band { font-size: 0.9375rem; }
.rg-bar { grid-column: 1 / -1; position: relative; height: 12px; margin-top: 4px; background: linear-gradient(#eef1f5, #eef1f5) 0 3px / 100% 6px no-repeat; border-radius: 3px; }
.rg-range { position: absolute; top: 3px; height: 6px; border-radius: 3px; background: #c9dbfb; }
.rg-dot { position: absolute; top: 0; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; border: 2px solid #fff; box-sizing: border-box; background: #1e40af; box-shadow: 0 0 0 1px #1e40af; }
.rg-bar.is-short .rg-dot { background: var(--down); box-shadow: 0 0 0 1px var(--down); }
.rg-bar.is-over .rg-dot { background: var(--up); box-shadow: 0 0 0 1px var(--up); }
.watch-nums { display: grid; grid-template-columns: repeat(3, auto); gap: 0 18px; align-items: baseline; text-align: right; }
.dt-row .dt-gap { font-size: 0.9375rem; }
.dt-bench .bench-v { font-family: var(--font-num); font-weight: 800; color: #1e40af; }

/* 離れた人数 under each step */
.flow-lost { display: inline-block; margin-top: 6px; line-height: 1.35; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.flow-lost b { font-family: var(--font-num); font-weight: 800; }
.flow-lost small { display: block; font-size: 0.75rem; }
.flow-lost.is-worst { color: var(--down); background: #fff4e5; border-radius: 6px; padding: 2px 6px; }

/* ---- v5 (docs/plan s03 · screens/03-board.dc.html): three cards, no box-in-box, no chips,
   buttons as blue text (only 保存 is filled), 判定 as colored text, ? circles for 説明 ---- */
.top { padding: 14px 32px; box-shadow: none; }
.top-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ex-tag { font-size: 0.75rem; font-weight: 800; color: #fff; background: #b7791f; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.top-right { margin-left: auto; gap: 18px; font-size: 0.8125rem; }
.top-item { display: inline-flex; align-items: baseline; gap: 6px; color: var(--muted); white-space: nowrap; }
.top-item b { color: var(--ink); font-weight: 800; }
.top-k { color: var(--muted); font-weight: 600; }
.top-item label { display: inline-flex; align-items: baseline; gap: 6px; }
.period select { border: 0; padding: 2px 4px; background: none; color: var(--ink); font-weight: 800; cursor: pointer; }
.period select:hover { color: var(--accent-ink); }
.link-btn {
  font: inherit; font-size: 0.8125rem; font-weight: 700; color: var(--accent-ink); background: none; border: 0;
  padding: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.link-btn:hover { text-decoration: underline; }
.top-help { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent-ink); }
.share-item { gap: 8px; }
.share-msg { font-size: 0.75rem; font-weight: 700; color: var(--up); }
.ex-wrap { padding: 12px 32px 0; max-width: 1360px; margin: 0 auto; box-sizing: border-box; }
.content { padding: 16px 32px 56px; gap: 20px; max-width: 1360px; margin: 0 auto; box-sizing: border-box; }
.content > section.card { border: 0; border-radius: 16px; padding: 24px 28px; box-shadow: 0 1px 2px rgba(21, 32, 51, 0.06); }
.card h2 { margin: 0; font-size: 1.125rem; font-weight: 800; }

/* ? circles (説明) */
.help-btn.help-q {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0;
  margin-left: 6px; border-radius: 50%; border: 1px solid #c3cad5; background: #fff; color: var(--muted);
  font-size: 0.75rem; font-weight: 700; line-height: 1; vertical-align: 1px;
}
.help-btn.help-q:hover { border-color: var(--accent); color: var(--accent-ink); background: #eef4ff; }

/* 判定 as colored text */
.jt { font-weight: 800; font-style: normal; white-space: nowrap; }
.jt-up { color: var(--up); } .jt-mid { color: #1e40af; } .jt-down { color: #b45309; }
button.jt-none { font: inherit; font-size: inherit; color: var(--muted); font-weight: 700; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; }

/* 仮で決めた設定: a small line at the top of the verdict card */
.notice { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: 0 0 14px; padding: 0; background: none; border: 0; font-size: 0.8125rem; color: var(--muted); }
.notice b { color: var(--ink); }
.notice-k { font-size: 0.8125rem; }
.notice-acts { display: inline-flex; align-items: baseline; gap: 6px; margin-left: 8px; color: var(--faint); }
.notice-acts form { display: inline; margin: 0; }

/* いまの状態: sentence + 3 columns with dividers */
.verdict-text { margin: 0 0 18px; font-size: 1.375rem; font-weight: 800; line-height: 1.45; }
.v-issue { color: #b45309; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 4px 20px; border-left: 1px solid #eef1f5; min-width: 0; }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat p { margin: 0; }
.stat-label { font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.stat-name[data-tip], .row-name[data-tip] { border-bottom: 1px dashed #c3cedb; cursor: help; }
.stat-name[data-tip]:hover, .row-name[data-tip]:hover,
.stat-name[data-tip]:focus-visible, .row-name[data-tip]:focus-visible { border-bottom-color: var(--accent); color: var(--accent-ink); }
.stat-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px !important; }
.stat-value { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.625rem; font-weight: 800; line-height: 1.25; }
.stat.is-issue .stat-value { color: #b45309; }
.stat-prev { font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-prev.tone-up { color: var(--up); } .stat-prev.tone-down { color: #b45309; } .stat-prev.tone-mid, .stat-prev.tone-na { color: var(--muted); }
.stat-note { margin-top: 2px !important; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat-note .rg-gap b, .stat-note .rg-in { font-size: 0.75rem; }
.stat-note .rg-gap small { font-size: 0.75rem; }

/* どこで離れているか */
.where-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.where-tools { margin-left: auto; display: flex; gap: 18px; }
.where-edit { display: inline; min-height: 0; padding: 0; border: 0; box-shadow: none; background: none; color: var(--accent-ink); font-size: 0.8125rem; font-weight: 700; }
.where-edit:hover { background: none; text-decoration: underline; }
.ch-toggle {
  border: 1px solid transparent; background: none; padding: 4px 10px; border-radius: 999px;
  color: var(--accent-ink); font: inherit; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
}
.ch-toggle[aria-expanded="true"] {
  background: #1e40af; border-color: #1e40af; color: #fff;
}
.ch-toggle[aria-expanded="true"] .caret { display: inline-block; transform: rotate(180deg); }
.ch-toggle.is-filtered {
  background: #eff6ff; border-color: #93c5fd; color: #1e40af;
}
.ch-toggle.is-filtered[aria-expanded="true"] {
  background: #1e40af; border-color: #1e40af; color: #fff;
}
[data-ch-part][hidden] { display: none !important; }
/* .flow-chs-wrap carries vertical spacing (chips + 「いま見ている流入」) */
.where-worst { margin: 6px 0 18px; font-size: 0.9375rem; font-weight: 700; color: #b45309; }
.where-grid { margin-top: 28px; gap: 28px; }
.watch h3, .flow-chtitle { margin: 0 0 4px; font-size: 0.9375rem; font-weight: 800; }

/* 今見るべきこと: indented rows, orange left line */
.wtable { margin-left: 8px; }
.wrow { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(64px, 110px) minmax(96px, 130px) minmax(104px, 150px); gap: 0 16px; align-items: center; }
.whead { padding: 6px 0 6px 21px; font-size: 0.75rem; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.wrow .num { text-align: right; font-variant-numeric: tabular-nums; }
.wrow.watch-item { padding: 12px 0 12px 18px; border: 0; border-bottom: 1px solid #eef1f5; border-left: 3px solid #cbd5e1; border-radius: 0; background: none; font-size: 0.9375rem; }
.wrow.watch-item.tone-down { border-left-color: #f59e0b; background: none; }
.wrow.watch-item.tone-up { border-left-color: #5eb8a6; background: none; }
.wrow .watch-name { font-weight: 700; color: var(--ink) !important; }
.wrow .watch-value { font-size: 0.9375rem; }
.wrow .rg-band { font-size: 0.9375rem; }
.watch-ind { display: block; margin: 12px 0 0 8px; padding: 0; border: 0; font-size: 0.8125rem; color: var(--muted); }
.flow-chtable ul { margin-left: 8px; }

/* 詳しい数字: categories with a chevron; tables indented under a left line */
.dgroups { gap: 0; padding: 8px 0 0; }
.dgroup { border: 0; border-bottom: 1px solid #eef1f5; border-radius: 0; padding: 0; }
.dgroup-head { margin: 0; padding: 0; font-size: 0.9375rem; font-weight: 400; }
.dgroup-head.is-static { padding: 12px 0 6px 34px; }
.dgroup-toggle {
  width: 100%; margin: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 0;
  border: 0; border-radius: 0; background: none; color: var(--ink); font: inherit; font-size: 0.9375rem; text-align: left; cursor: pointer;
}
.dgroup-toggle b { font-weight: 800; }
.chev {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none;
  border-radius: 6px; color: var(--muted); background: #f1f4f9; transition: transform 0.15s;
}
.dgroup-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); color: var(--accent-ink); background: #eef4ff; }
.dgroup-n { font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
.dgroup-warn { font-size: 0.8125rem; font-weight: 700; color: #b45309; }
.dtable, .dgroup-note, .ev-missing { margin: 0 0 14px 8px; }
.dtable { padding: 4px 0 4px 18px; border-left: 3px solid #dbe4f3; }
.dt-row { grid-template-columns: minmax(0, 1fr) 100px 90px 100px 130px 150px; gap: 0 16px; min-height: 0; padding: 9px 0; border-bottom: 0; border-top: 1px solid #f3f5f8; min-width: 760px; }
.dt-head { border-top: 0; padding: 4px 0 6px; }
.dt-row.is-focus { background: none; }
.dt-name .row-name { font-weight: 600; }

@media (max-width: 900px) {
  .top { padding: 10px 16px; }
  .top-right { gap: 12px; margin-left: 0; }
  .ex-wrap { padding: 12px 16px 0; }
  .content { padding: 14px 16px 48px; }
  .content > section.card { padding: 18px 16px; }
  .stats { grid-template-columns: 1fr; gap: 12px; }
  .stat { padding: 10px 0 0; border-left: 0; border-top: 1px solid #eef1f5; }
  .stat:first-child { padding-top: 0; border-top: 0; }
  .wtable { margin-left: 0; overflow-x: auto; }
  .wrow { grid-template-columns: minmax(120px, 1fr) 80px 110px 120px; min-width: 460px; }
  .dtable { overflow-x: auto; }
}
/* v5: the flow fits the 1120px column (7 steps without scrolling) */
/* only while the flow is laid out sideways (the stacked phone layout below 700px keeps min-width 0); between 521px and the full width the flow scrolls sideways */
@container flow (min-width: 521px) {
  .flow-track { --link-w: 50px; min-width: calc(var(--n) * 80px + (var(--n) - 1) * var(--link-w)); }
  .flow-users { white-space: nowrap; }
}
.verdict .notice { display: block; justify-content: normal; border-radius: 0; line-height: 1.7; }
.verdict .notice-acts { display: inline; }
.verdict .notice-acts form { display: inline; }
.verdict .notice-keep { padding: 0; border: 0; border-radius: 0; background: none; font-weight: 700; }
.edit-save:disabled { opacity: 0.45; cursor: not-allowed; }

/* v5.1: 編集中 — the card gets a blue outline + glow, a band across its top */
.content > section.card.where.is-editing { outline: 2px solid var(--accent); outline-offset: 0; box-shadow: 0 0 0 6px rgba(47, 111, 237, 0.14); border: 0; }
.where.is-editing .edit-bar { margin: -24px -28px 20px; padding: 10px 28px; border-radius: 14px 14px 0 0; border-bottom: 1px solid #c9dbfb; }
.edit-badge::before { content: "✎ "; }
@media (max-width: 900px) { .where.is-editing .edit-bar { margin: -18px -16px 16px; padding: 10px 16px; } }

/* v6: story — 総評 is the verdict h2; 0〜3 is a slim TOC (no mini-answers). Issue stretch stays orange. */
.story-toc {
  display: flex; flex-wrap: wrap; gap: 8px 4px; margin: 0 0 14px; padding: 0 0 14px;
  border-bottom: 1px dashed var(--line);
}
.story-toc-step {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px;
  border-radius: 999px; background: #f1f5f9; color: var(--ink); text-decoration: none;
  font-size: 0.8125rem; font-weight: 700;
}
.story-toc-step:hover { background: #e2e8f0; }
.story-toc-step.is-lede { background: #1e293b; color: #fff; }
.story-toc-step.is-lede .qn { background: #fff; color: #1e293b; }
.story-toc-step .qn { width: 20px; height: 20px; font-size: 0.75rem; }
/* Jump targets sit at the card top so sticky .top doesn't clip the qk / sentence. */
.story-mark {
  position: absolute; top: 0; left: 0; width: 1px; height: 1px;
  overflow: hidden; pointer-events: none;
}
.content > section.card { position: relative; }
#q0, #q2, #q3, #q4,
.content > section.card {
  scroll-margin-top: calc(var(--top-h, 80px) + 16px);
}
/* Same rhythm for 0〜3: label → 12px → sentence → 16px → body */
.qk { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 0.8125rem; font-weight: 800; color: var(--accent-ink); }
.qn { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 800; align-items: center; justify-content: center; flex: none; }
.qk-ref { color: var(--muted); }
.qk-ref .qn { width: auto; padding: 0 9px; border-radius: 999px; background: #eef1f5; color: var(--muted); }
.where-head { margin: 0 0 12px; }
.where-head .qk { margin-bottom: 0; }
.verdict-text,
.card h2.q-h {
  margin: 0 0 16px; font-weight: 800; line-height: 1.5;
}
.card h2.q-h { font-size: 1.125rem; }
.verdict-text { font-size: 1.375rem; }
.q-note { margin: -4px 0 16px; font-size: 0.8125rem; color: var(--muted); line-height: 1.55; }
.q-note-gap { height: 0; margin: 0; }
.q-next { margin: 18px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.stat { padding: 8px 24px 10px; }
.stat-line { margin-top: 6px !important; }
.stat-note { margin-top: 6px !important; line-height: 1.6; }
/* the issue's stretch: orange steps and arrows */
.flow-stage.is-issue .flow-bar { box-shadow: inset 0 3px 0 #f59e0b; }
.flow-stage.is-issue .flow-label { color: #92400e; }
.flow-lost.is-blank { visibility: hidden; }
/* ③ rows: 今 · 前期 · 業界 · あと */
.wrow.why-row { grid-template-columns: minmax(150px, 1fr) minmax(64px, 90px) minmax(64px, 110px) minmax(96px, 130px) minmax(104px, 150px); }
.why-step { display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.q-others { margin: 12px 0 0 8px; font-size: 0.8125rem; color: var(--muted); line-height: 1.6; }
/* ④ actions */
.acts { list-style: none; margin: 0 0 0 8px; padding: 0; }
.act { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 0 16px; padding: 14px 0 14px 18px; border-left: 3px solid var(--accent); border-bottom: 1px solid #eef1f5; }
.act-n { font-family: var(--font-num); font-size: 1.125rem; font-weight: 800; color: var(--accent-ink); }
.act-t { display: block; font-size: 0.9375rem; font-weight: 800; }
.act-l { display: block; margin-top: 4px; font-size: 0.8125rem; color: #334155; line-height: 1.6; }
.act-l b { color: var(--muted); font-weight: 700; margin-right: 8px; }
.act-go { align-self: center; text-align: right; }
.q-foot { margin: 12px 0 0 8px; font-size: 0.75rem; color: #8792a2; }
/* ✦ 自分の AI に聞く */
.ai { margin-top: 18px; }
.ai-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 18px 20px; border-radius: 16px; background: linear-gradient(135deg, #2f6fed 0%, #1d4ed8 100%); color: #fff; box-shadow: 0 10px 24px rgba(29, 78, 216, 0.22); }
.ai-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.125rem; }
.ai-card .ai-icon, .ai-dlg-head .ai-icon { background: rgba(255, 255, 255, 0.18); }
.ai-card .ai-icon { width: 44px; height: 44px; }
.ai-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-txt b { font-size: 0.9375rem; }
.ai-lead { font-size: 0.8125rem; color: var(--muted); }
.ai-card .ai-lead { color: rgba(255, 255, 255, 0.88); }
.ai-btns { display: flex; gap: 10px; align-items: center; }
.ai-open { font: inherit; font-size: 0.8125rem; font-weight: 700; color: #fff; background: transparent; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 10px; padding: 9px 14px; cursor: pointer; }
.ai-open:hover { background: rgba(255, 255, 255, 0.12); }
.ai-card .ai-copy { padding: 10px 16px; border-radius: 10px; background: #fff; color: var(--accent-ink); }
.ai-card .ai-msg { grid-column: 2 / -1; font-size: 0.75rem; font-weight: 700; color: #fff; }
.ai-card button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ai-card .ai-msg:empty { display: none; }
.ai-box { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.ai-ask { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; font-size: 0.8125rem; }
.ai-ask b { color: var(--muted); }
.ai-ask .link-btn[aria-pressed="true"] { color: var(--ink); font-weight: 800; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.ai-text { font: inherit; font-family: ui-monospace, Menlo, monospace; font-size: 0.8125rem; line-height: 1.6; min-height: 260px; resize: vertical; padding: 12px 14px; border: 1px solid #d5dce6; border-radius: 10px; color: var(--ink); background: #f8fafc; }
.ai-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-size: 0.8125rem; color: #334155; }
.ai-opts label { display: inline-flex; align-items: center; gap: 6px; }
.ai-copy-wrap { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.ai-msg { font-size: 0.75rem; font-weight: 700; color: var(--up); }
.ai-copy { font: inherit; font-size: 0.8125rem; font-weight: 800; color: #fff; background: var(--accent); border: 0; border-radius: 8px; padding: 8px 18px; cursor: pointer; }
.ai-note { margin: 0; font-size: 0.75rem; color: #8792a2; }
@media (max-width: 900px) {
  .act { grid-template-columns: 24px minmax(0, 1fr); } .act-go { grid-column: 2; text-align: left; margin-top: 6px; }
  .wrow.why-row { grid-template-columns: minmax(120px, 1fr) 70px 70px 100px 110px; min-width: 520px; }
}
@container flow (max-width: 520px) { .flow-lost.is-blank { display: none; } }
/* ② without 今見るべきこと (moved to ③): no empty block while 流入別 is closed */
.where-grid:not(:has(> :not([hidden]))) { display: none; }
.q-note-gap { height: 14px; }

/* 詳しい数字: the category's one line is plain text under its name (no box in a box) */
.dgroup-summary { margin: 0 0 8px 37px; padding: 0; background: none; border-radius: 0; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.dgroup-summary.is-warn { background: none; color: #b45309; }
/* 「基準なし」 in tables: whole word, underline clear of the text */
button.jt-none { white-space: nowrap; text-underline-offset: 3px; line-height: 1.6; }
.dt-row .dt-gap { overflow: visible; }

.dt-meta-sp { display: none; }
/* 8週: the line's direction also as an arrow (not colour only) */
.spark-dir { margin-left: 4px; font-size: 0.75rem; font-weight: 800; }
.spark-dir.tone-up { color: var(--up); }
.spark-dir.tone-down { color: var(--down); }

/* ── phones (≤640px): the same cards, laid out for one hand — nothing hidden, nothing sideways ── */
@media (max-width: 640px) {
  /* 0 総評 · 1 · 2 · 3: one line that scrolls sideways, kept under the top bar */
  .story-toc {
    position: sticky; top: 57px; z-index: 20; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin: 0 -16px 12px; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .story-toc::-webkit-scrollbar { display: none; }
  .story-toc-step { flex: none; min-height: 36px; box-sizing: border-box; }
  /* ② どこがおかしい？: name + value, then 前期比 · 業界 · あと on the next line */
  .wtable { overflow: visible; }
  .wtable .wrow.whead { display: none; }
  .wrow.why-row, .wrow.watch-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; padding: 12px 0 12px 12px; }
  .wrow.why-row .watch-name, .wrow.watch-item .watch-name { flex: 1 1 60%; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
  .wrow .watch-value { font-size: 1.125rem; }
  .wrow.why-row > .num:not(.watch-value) { flex: none; text-align: left; font-size: 0.75rem; color: var(--muted); }
  .wrow.why-row > .num:not(.watch-value)::before { content: attr(data-k) " "; color: var(--faint); font-weight: 400; }
  .wrow.why-row > .prev-cell { flex-basis: auto; }
  /* 詳しい数字: the name in full (wraps), ? right after it, value on the right; 前期比 · 業界 · あと + 8週 below */
  .dtable { overflow: visible; padding-left: 10px; margin-left: 0; }
  .dt-row.dt-head { display: none; }
  .dt-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name value" "name trend"; gap: 2px 10px; padding: 11px 0; }
  .dt-row .dt-name { grid-area: name; }
  .dt-row .dt-value { grid-area: value; align-self: start; font-size: 1.125rem; font-weight: 800; }
  .dt-row .ctr { grid-area: trend; justify-content: flex-end; align-items: center; }
  .dt-row .ctr .spark { width: 56px; height: 20px; }
  .dt-row > .prev-cell, .dt-row > .dt-bench, .dt-row > .dt-gap { display: none; }
  .dt-row .dt-name { grid-row: span 2; }
  .dt-meta-sp { display: block; flex-basis: 100%; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
  .dt-meta-sp b { font-weight: 700; }
  .dt-meta-sp .tone-up { color: var(--up); } .dt-meta-sp .tone-down { color: var(--down); }
  /* tap targets: the ? keeps its look, the hit area grows to about 40px */
  .help-btn.help-q { position: relative; }
  .help-btn.help-q::after { content: ""; position: absolute; inset: -11px; }
  .link-btn { min-height: 36px; display: inline-flex; align-items: center; }
  .where-tools { display: flex; flex-wrap: wrap; gap: 0 14px; }
}

/* v7 story: うまくいっていること · なぜ変わった？ · 誰が成果を出している？ · どこで起きている？ · いつから？ · 効いた？ */
#qch, #qb, #q5 { scroll-margin-top: calc(var(--top-h, 80px) + 16px); }
.content .sp-only { display: none; }
.goods { display: flex; align-items: center; gap: 10px 20px; flex-wrap: wrap; margin-top: 18px; padding: 12px 16px; border-radius: 12px; background: #eefaf7; }
.goods-k { font-size: 0.8125rem; font-weight: 800; color: var(--up); flex: none; }
.goods ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 26px; font-size: 0.8125rem; }
.goods li { display: flex; align-items: baseline; gap: 6px; }
.goods-ok { color: var(--up); font-weight: 800; }
.goods-v { font-size: 0.75rem; color: var(--muted); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.x-eq { display: flex; align-items: stretch; gap: 10px; }
.x-term { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: #f4f6fa; }
.x-term.is-result { background: #eef4ff; }
.x-term-k { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.x-term-v { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.x-term-v b { font-size: 1.125rem; font-weight: 800; }
.x-term.is-result .x-term-v b { font-size: 1.375rem; }
.x-term-v small { font-size: 0.75rem; color: var(--muted); }
.x-term-d { font-size: 0.8125rem; font-weight: 800; }
.x-term-d.tone-mid { color: var(--muted); }
.x-op { flex: none; align-self: center; font-size: 1.125rem; font-weight: 800; color: #8792a2; }
.x-split { margin-top: 14px; }
.x-split-k { margin: 0 0 6px; font-size: 0.8125rem; font-weight: 700; }
.x-split-bar { display: flex; gap: 2px; height: 16px; border-radius: 6px; overflow: hidden; }
.x-split-bar .x-seg { display: flex; align-items: center; min-width: 0; padding: 0 8px; color: #fff; font-size: 0.75rem; font-weight: 800; white-space: nowrap; overflow: hidden; }
.x-seg span { overflow: hidden; text-overflow: ellipsis; }
.x-seg.tone-up { background: var(--up); }
.x-seg.tone-up.k-per, .x-seg.tone-up.k-rate { background: #5fb3a6; }
.x-seg.tone-down { background: #f59e0b; }
.x-split-list { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 0; font-size: 0.75rem; color: var(--muted); }
.x-split-list span { display: inline-flex; align-items: center; gap: 6px; }
.x-split-list b { color: var(--ink); }
.x-seg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.x-seg-dot.tone-up { background: var(--up); }
.x-seg-dot.tone-up.k-per, .x-seg-dot.tone-up.k-rate { background: #5fb3a6; }
.x-seg-dot.tone-down { background: #f59e0b; }
.x-split-flat { margin: 6px 0 0; font-size: 0.75rem; color: var(--muted); }
.x-take { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; border-left: 3px solid #f59e0b; background: #fffaf0; font-size: 0.8125rem; line-height: 1.7; }
.x-take.tone-up { border-left-color: var(--up); background: #f5fbf9; }
.x-first { margin: -6px 0 14px; font-size: 0.8125rem; font-weight: 700; color: #92400e; }

.x-sub { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.x-sub-k { margin: 0 0 4px; font-size: 0.9375rem; font-weight: 800; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.x-sub-k small { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.x-sub-lead { margin: 0 0 10px; font-size: 0.9375rem; line-height: 1.6; }
.x-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 6px; font-size: 0.75rem; color: var(--muted); }
.x-legend span { display: inline-flex; align-items: center; gap: 6px; }
.x-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.lg-band { background: rgba(47, 111, 237, 0.12); border-left: 1px dashed #93b4f5; }
.lg-ref { width: 2px !important; background: #64748b; }
.lg-low { background: #f59e0b; }
.x-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.x-bars-col { display: flex; flex-direction: column; }
.x-bars-k { font-size: 0.8125rem; color: var(--muted); margin: 4px 0 2px; }
.x-bar-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 58px; gap: 0 12px; align-items: center; padding: 7px 0; }
.x-bar-name { font-size: 0.8125rem; font-weight: 700; line-height: 1.35; }
.x-bar-name small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.x-bar-track { position: relative; height: 14px; border-radius: 4px; background: #f1f4f9; }
.x-bar-band { position: absolute; top: -3px; bottom: -3px; background: rgba(47, 111, 237, 0.10); border-left: 1px dashed #93b4f5; }
.x-bar-ref { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #64748b; }
.x-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.x-bar-row.is-low .x-bar-fill { background: #f59e0b; }
.x-bar-row.is-few { opacity: 0.6; }
.x-bar-v { font-size: 0.9375rem; text-align: right; }
.x-bar-row.is-low .x-bar-v { color: #b45309; }

.x-when { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 16px 32px; align-items: start; }
.x-when-svg { display: block; width: 100%; height: auto; overflow: visible; }
.x-when-band { fill: rgba(47, 111, 237, 0.08); }
.x-when-low { stroke: #93b4f5; stroke-dasharray: 4 3; }
.x-when-bk { font-size: 0.75rem; font-weight: 700; fill: var(--accent-ink); }
.x-grid { stroke: #eef1f5; }
.x-guide { stroke: #c3cad6; stroke-dasharray: 3 3; }
.x-axis { stroke: var(--line); }
.x-tick, .x-axis-k { font-size: 0.75rem; fill: #8792a2; }
.x-axis-k { font-weight: 700; fill: var(--muted); }
.x-when-line { fill: none; stroke: #f59e0b; stroke-width: 2.5; stroke-linejoin: round; }
.x-when-pt { fill: #fff; stroke: #f59e0b; stroke-width: 2; }
.x-when-pt.is-cur { fill: #f59e0b; }
.x-when-last { font-size: 0.8125rem; font-weight: 800; fill: #b45309; font-family: var(--font-num); }
.x-when-side { display: flex; flex-direction: column; gap: 10px; font-size: 0.8125rem; line-height: 1.7; }
.x-when-side p { margin: 0; }
.x-when-side b { margin-right: 6px; }
.x-when-side .ws-down b { color: #b45309; }
.x-when-side .ws-up b { color: var(--up); }
.x-when-side .ws-box { padding: 10px 12px; border-radius: 10px; background: #f4f6fa; }
.x-when-side .ws-box b { display: block; }

.x-map { display: grid; grid-template-columns: minmax(0, 620px) minmax(0, 1fr); gap: 14px 32px; align-items: start; }
.x-map-svg { display: block; width: 100%; height: auto; overflow: visible; }
.x-map-svg .q-grow { fill: #eefaf7; }
.x-map-svg .q-fix { fill: #fff7ea; }
.x-q { font-size: 0.75rem; font-weight: 800; }
.t-grow { fill: var(--up); color: var(--up); }
.t-core { fill: var(--accent-ink); color: var(--accent-ink); }
.t-fix { fill: #b45309; color: #b45309; }
.t-watch { fill: #8792a2; color: #8792a2; }
.x-dot { fill-opacity: 0.85; }
.x-dot.q-grow { fill: var(--up); }
.x-dot.q-core { fill: var(--accent); }
.x-dot.q-fix { fill: #f59e0b; }
.x-dot.q-watch { fill: #94a3b8; }
.x-dot-k { font-size: 0.75rem; font-weight: 700; fill: var(--ink); }
.x-map-notes p { margin: 0 0 10px; font-size: 0.8125rem; line-height: 1.7; }
.x-map-notes b { margin-right: 10px; }
.x-ml-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 60px 56px; gap: 6px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.8125rem; }
.x-ml-row.is-head { border-top: 0; padding-bottom: 4px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.x-ml-row > :nth-child(2), .x-ml-row > :nth-child(3) { text-align: right; }
.x-ml-q { justify-self: end; font-size: 0.75rem; font-weight: 800; }
.x-ml-q.q-grow { color: var(--up); } .x-ml-q.q-core { color: var(--accent-ink); } .x-ml-q.q-fix { color: #b45309; } .x-ml-q.q-watch { color: #8792a2; }
.x-stack { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 0; font-size: 0.8125rem; font-weight: 700; }
.x-stack small { display: block; margin-top: 3px; font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.x-stack-bar { display: flex; gap: 2px; height: 16px; border-radius: 6px; overflow: hidden; font-size: 0.75rem; font-weight: 800; color: #fff; }
.x-stack-bar span { display: flex; align-items: center; padding: 0 8px; white-space: nowrap; overflow: hidden; }
.s-new { background: #94a3b8; }
.s-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 1px; }
.lg-q { border-radius: 50% !important; width: 10px !important; height: 10px !important; }
.lg-q.q-grow { background: var(--up); } .lg-q.q-core { background: var(--accent); } .lg-q.q-fix { background: #f59e0b; } .lg-q.q-watch { background: #94a3b8; }
.s-ret { background: var(--accent); }
.x-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.x-card { padding: 10px 12px; border-radius: 10px; background: #f4f6fa; }
.x-card span { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.x-card p { margin: 2px 0 0; display: flex; gap: 8px; align-items: baseline; }
.x-card b { font-size: 1.125rem; }
.x-card p span { font-size: 0.8125rem; font-weight: 800; }

.x-eff-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px; border-radius: 12px; background: #f4f6fa; }
.x-f { display: flex; flex-direction: column; gap: 4px; flex: none; }
.x-f-wide { flex: 1; min-width: 220px; }
.x-f[hidden] { display: none; }
.x-f span { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.x-f select, .x-f input { font: inherit; font-size: 0.9375rem; min-height: 40px; padding: 0 12px; border: 1px solid #c3cad6; border-radius: 10px; background: #fff; color: var(--ink); max-width: 100%; }
.x-f-btn { font: inherit; font-size: 0.8125rem; font-weight: 800; min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; cursor: pointer; }
.x-f-btn:disabled, .x-f select:disabled, .x-f input:disabled { opacity: 0.6; cursor: not-allowed; }
.x-rels { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; }
.x-rels li { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 6px 0 12px; border-radius: 999px; background: #eef4ff; border: 1px solid #c9dbfb; color: var(--accent-ink); font-size: 0.8125rem; font-weight: 700; }
.x-rels form { display: inline; }
.x-rel-del { font: inherit; width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: var(--accent-ink); cursor: pointer; }
.x-rel-del:hover { background: #dbe6fd; }
.x-eff-wait { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: #f4f6fa; font-size: 0.8125rem; }
.x-eff-h { margin-top: 18px !important; }
.x-eff-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 120px 90px 180px; gap: 0 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eef1f5; font-size: 0.9375rem; }
.x-eff-row > :nth-child(2), .x-eff-row > :nth-child(3), .x-eff-row > :nth-child(4) { text-align: right; }
.x-eff-row.is-head { padding: 6px 0; font-size: 0.75rem; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.x-eff-row.is-head small { display: block; font-weight: 500; }
.x-eff-row.is-ref { color: var(--muted); }
.x-before { color: var(--muted); }
.x-eff-row .tone-mid { color: var(--muted); }
.x-pair { display: flex; flex-direction: column; gap: 3px; }
.x-pair i { display: block; height: 8px; border-radius: 3px; background: #cbd5e1; }
.x-pair i.tone-up { background: var(--up); } .x-pair i.tone-down { background: #f59e0b; } .x-pair i.tone-mid { background: #64748b; }

@media (max-width: 900px) {
  .x-when, .x-map { grid-template-columns: 1fr; }
  .x-bars { grid-template-columns: 1fr; gap: 14px; }
  .x-eff-row { grid-template-columns: minmax(0, 1fr) 90px 90px 80px; }
  .x-eff-row .x-pair, .x-eff-row.is-head > :last-child { display: none; }
}
@media (max-width: 640px) {
  .content .pc-only { display: none; }
  .content .sp-only { display: block; }
  .content small.sp-only { display: inline; }
  .goods { flex-direction: column; align-items: stretch; gap: 4px; }
  .goods ul { flex-direction: column; gap: 4px; }
  .x-eq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .x-eq > .x-op { display: none; }
  .x-term { padding: 10px 12px; }
  .x-bar-row { grid-template-columns: 104px minmax(0, 1fr) 52px; }
  .x-stack { grid-template-columns: 64px minmax(0, 1fr); }
  .x-cards { grid-template-columns: 1fr; }
  .x-eff-form { flex-direction: column; align-items: stretch; }
  .x-f-wide { min-width: 0; }
  .x-f select, .x-f input { width: 100%; box-sizing: border-box; }
  .x-eff-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .x-eff-row.is-head { display: none; }
  .x-eff-row > [data-k] { grid-column: 1; text-align: left !important; font-size: 0.8125rem; }
  .x-eff-row > [data-k]::before { content: attr(data-k) " "; color: var(--muted); font-weight: 500; }
  .x-eff-row > :nth-child(4) { grid-column: 2; grid-row: 1; }
}


/* v7.1: 効いた？ inside どうする？ · まとめ */
.act-go { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.act-rec { font: inherit; display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: 999px; border: 1px dashed #c3cad6; background: #fff; color: var(--muted); font-size: 0.75rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.act-rec:hover { border-color: var(--accent); color: var(--accent-ink); }
.act-rec.is-done { border: 0; background: #eefaf7; color: var(--up); font-weight: 800; cursor: default; }
.x-eff { margin: 12px 0 0 8px; padding-left: 21px; }
.x-eff-res { padding: 12px 14px; border-radius: 12px; background: #f5fbf9; border: 1px solid #cdeee6; }
.x-eff-k { margin: 0 0 6px; font-size: 0.8125rem; font-weight: 800; color: var(--up); }
.x-eff-res .x-eff-row { grid-template-columns: minmax(0, 1fr) 110px 110px 80px; padding: 6px 0; font-size: 0.8125rem; border-bottom: 0; border-top: 1px solid #dff2ed; }
.x-eff-res .x-eff-row.is-head { border-top: 0; }
.x-eff-h { margin: 8px 0 0; font-size: 0.8125rem; line-height: 1.7; }
.x-eff-rec { margin-top: 10px; }
.x-eff-rec summary { cursor: pointer; font-size: 0.8125rem; font-weight: 700; color: var(--accent-ink); list-style: none; }
.x-eff-rec summary::-webkit-details-marker { display: none; }
.x-eff-rec summary::before { content: "＋ "; }
.x-eff-rec[open] summary::before { content: "− "; }
.x-eff-rec .x-eff-form { margin-top: 8px; }
.x-mark { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 3; }
.x-mark-k { font-size: 0.75rem; font-weight: 800; fill: var(--accent-ink); }
.sum.card { border: 2px solid var(--ink); }
.sum .qn { background: var(--ink); color: #fff; }
.sum .q-h { font-size: 1.375rem; }
.sum-rows { margin: 10px 0 0; }
.sum-rows div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 20px; padding: 12px 0; border-top: 1px solid var(--line); }
.sum-rows dt { font-size: 0.8125rem; font-weight: 700; color: var(--muted); padding-top: 2px; }
.sum-rows dd { margin: 0; font-size: 0.9375rem; line-height: 1.7; }
.sum-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.sum-btn { font: inherit; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 0.8125rem; font-weight: 700; cursor: pointer; text-decoration: none; }
.sum-btn.is-ai { border-color: #c9dbfb; color: var(--accent-ink); }
.sum-msg { font-size: 0.75rem; font-weight: 700; color: var(--up); }
.sum-below { margin-left: auto; font-size: 0.75rem; color: #8792a2; }
@media (max-width: 640px) {
  .act-go { align-items: flex-start; }
  .x-eff { margin-left: 0; padding-left: 0; }
  .x-eff-res .x-eff-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ai-card { grid-template-columns: 32px minmax(0, 1fr); }
  .ai-icon { width: 32px; height: 32px; border-radius: 10px; }
  .ai-btns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .ai-btns button { min-height: 44px; justify-content: center; }
  .sum .q-h { font-size: 1.125rem; }
  .sum-rows div { grid-template-columns: 1fr; gap: 2px; }
  .sum-acts { display: grid; grid-template-columns: 1fr 1fr; }
  .sum-btn { justify-content: center; min-height: 44px; }
  .sum-below { grid-column: 1 / -1; margin-left: 0; }
}

/* v7.2b — pictures and numbers stay open; only the explaining prose folds (「説明を読む ▾」) */
.x-more { margin-top: 10px; }
.x-more > summary, .x-more-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 0.8125rem; font-weight: 700; color: #1d4ed8; list-style: none; }
.x-more > summary::-webkit-details-marker { display: none; }
.x-more-c { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: #eef4ff; font-size: 0.75rem; transition: transform 0.15s; }
.x-more[open] > summary .x-more-c, .x-more-btn[aria-expanded="true"] .x-more-c { transform: rotate(180deg); }
.x-more > summary:focus-visible, .x-more-btn:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; border-radius: 6px; }
.x-more-b > :first-child { margin-top: 6px; }
.x-more .x-map-notes { margin-top: 6px; }
.acts:not(.show-check) .act-check { display: none; }
.x-more-btn { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .x-more-c { transition: none; } }

/* v7.3 — page-level numbers: ② 入口ページ別 · ④ どのページで？ · 詳しい数字 › ページ別 */
.x-pg-row { display: grid; grid-template-columns: minmax(0, 1fr) 300px 70px 70px; gap: 0 16px; align-items: center; padding: 8px 0; border-top: 1px solid #f3f5f8; }
.x-pg-row.is-head { border-top: 0; padding: 4px 0 6px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.x-pg-row > :nth-child(3), .x-pg-row > :nth-child(4) { text-align: right; justify-self: end; }
.x-pg-name, .x-bar-name, .x-pt-name { min-width: 0; overflow-wrap: anywhere; }
.x-pg-name { font-size: 0.8125rem; font-weight: 700; line-height: 1.35; }
.x-pg-name small, .x-pt-name small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-pg-vol { display: flex; align-items: center; gap: 8px; }
.x-pg-track { flex: 1; height: 10px; border-radius: 4px; background: #f1f4f9; position: relative; }
.x-pg-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: #a9c1f2; }
.x-pg-vol small { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.x-pg-rate { font-size: 0.9375rem; }
.x-pgw-rows { max-width: 820px; }
.x-pgw .x-bar-row { grid-template-columns: 300px minmax(0, 1fr) 58px; }
.x-pgw .x-bar-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-bar-row.is-worst .x-bar-track { outline: 2px solid #f59e0b; outline-offset: 2px; }
.x-pt { margin-top: 10px; }
.x-pt-body { margin: 0 0 14px 8px; padding: 4px 0 4px 18px; border-left: 3px solid #dbe4f3; }
.x-pt-lead, .x-pt-note { margin: 0 0 6px; font-size: 0.75rem; color: var(--muted); line-height: 1.6; }
.x-pt-note { margin-top: 8px; color: var(--faint); }
.x-pt-scroll { overflow-x: auto; }
.x-pt-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.x-pt-table th, .x-pt-table td { padding: 9px 8px; border-top: 1px solid #f3f5f8; text-align: left; vertical-align: middle; }
.x-pt-table thead th { border-top: 0; padding: 4px 8px 6px; }
.x-pt-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.x-pt-table thead button { font: inherit; font-size: 0.75rem; font-weight: 700; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; min-height: 32px; }
.x-pt-table thead button[aria-sort] { color: #1d4ed8; }
.x-pt-table thead button[aria-sort="descending"]::after { content: " ▼"; }
.x-pt-table thead button[aria-sort="ascending"]::after { content: " ▲"; }
.x-pt-table thead button:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; border-radius: 4px; }
.x-pt-name { font-size: 0.8125rem; font-weight: 700; max-width: 420px; }
@media (max-width: 640px) {
  .x-pg-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 10px; padding: 9px 0; }
  .x-pg-row.is-head { display: none; }
  .x-pg-row .x-pg-vol { grid-column: 1 / -1; grid-row: 2; }
  .x-pgw .x-bar-row { grid-template-columns: minmax(0, 1fr) 52px; gap: 4px 12px; }
  .x-pgw .x-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .x-pt-body { margin-left: 0; padding-left: 10px; }
  /* phones: one small card per page instead of a wide table */
  .x-pt-table thead { display: none; }
  .x-pt-table, .x-pt-table tbody { display: block; }
  .x-pt-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
  .x-pt-table tr[hidden] { display: none; }
  .x-pt-table th, .x-pt-table td { padding: 0; border: 0; }
  .x-pt-table .x-pt-name { grid-column: 1 / -1; max-width: none; }
  .x-pt-table td.num { text-align: left; font-size: 0.9375rem; font-weight: 700; }
  .x-pt-table td::before { content: attr(data-k); display: block; font-size: 0.75rem; font-weight: 500; color: var(--muted); white-space: normal; }
}
.x-pg-a { color: inherit; text-decoration: none; }
.x-pg-a:hover { color: #1d4ed8; text-decoration: underline; text-underline-offset: 3px; }
.x-pg-a:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; border-radius: 4px; }
.x-pg-ext { margin-left: 4px; font-size: 0.75rem; color: #1d4ed8; }


/* v7.4 — 「✦ AI に聞く」 in the top bar, and the question in a popup (docs/plan s03) */
.ai-top { font: inherit; font-size: 0.8125rem; font-weight: 800; color: #fff; background: var(--accent); border: 0; border-radius: 10px; padding: 8px 14px; min-height: 36px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ai-top:hover { background: var(--accent-ink); }
.ai-top:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.mobile-bar .ai-top-m { margin-left: auto; padding: 0 12px; }
.mobile-bar .ai-top-m + .memo-open-btn { margin-left: 6px; }
.ai-dlg { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 80px); margin: 56px auto auto; padding: 0; border: 0; border-radius: 18px; box-shadow: 0 24px 60px rgba(21, 32, 51, 0.3); color: var(--ink); background: #fff; overflow: auto; }
.ai-dlg::backdrop { background: rgba(21, 32, 51, 0.45); }
.ai-dlg-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: linear-gradient(135deg, #2f6fed 0%, #1d4ed8 100%); color: #fff; }
.ai-dlg-txt { display: flex; flex-direction: column; min-width: 0; }
.ai-dlg-txt b { font-size: 0.9375rem; }
.ai-dlg-txt span { font-size: 0.75rem; color: rgba(255, 255, 255, 0.85); }
.ai-x { margin-left: auto; flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.16); color: #fff; font: inherit; font-size: 1.125rem; cursor: pointer; }
.ai-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
html.ai-dlg-on { overflow: hidden; }
@media (max-width: 900px) {
  .top .ai-top { display: none; }
}
@media (max-width: 640px) {
  .ai-dlg { width: 100vw; max-width: 100vw; max-height: calc(100vh - 56px); margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .ai-box { padding: 14px 16px 18px; }
  .ai-text { min-height: 220px; }
  .ai-copy-wrap { margin-left: 0; width: 100%; }
  .ai-copy-wrap .ai-copy { flex: 1; min-height: 48px; border-radius: 12px; }
  .ai-card .ai-icon { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: no-preference) {
  .ai-dlg[open] { animation: ai-in 0.16s ease-out; }
  @keyframes ai-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* --- powered-by: footer credit shown on every board, hidden from print/PDF (see .powered-by below) --- */
.powered-by { margin: 16px 0 0; padding: 0 0 24px; text-align: center; font-size: 0.75rem; color: #94a3b8; }
.powered-by a { color: #64748b; font-weight: 600; text-decoration: none; }
.powered-by a:hover { text-decoration: underline; }

/* --- print · PDF (「印刷・PDF」 → board.js prepares → browser print → 「PDF に保存」) ----------------------
   Layout rules hang off html.is-printing (set by board.js for the print and for the hidden measuring
   iframe), so what is measured is what is printed. Page rules stay in @media print. */
.print-meta { display: none; }
html.is-printing, html.is-printing body { background: #fff !important; }
html.is-printing .shell { display: block !important; }
html.is-printing .main { width: 718px; max-width: 718px; margin: 0; }
html.is-printing :is(.rail, .mobile-bar, .memo, .story-toc, .ex-wrap, dialog, [data-drawer],
  .top-right, .link-btn, .nudge-btn, .flow-nudge, .flow-add, .ai-top, .notice-btn, .pop-actions,
  .survey, [data-survey], .dgroup-chev, .powered-by) { display: none !important; }
html.is-printing .top { position: static !important; box-shadow: none !important; padding: 0 0 4px !important; }
html.is-printing .print-meta { display: block; margin: 0 0 10px; font-size: 0.75rem; color: #475569; }
html.is-printing .content { max-width: none !important; padding: 0 !important; gap: 12px !important; overflow: visible; }
html.is-printing .content > section.card { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
html.is-printing .flow-scroll { overflow: visible !important; }
html.is-printing .print-unit { transform-origin: top left; }
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-page { break-before: page; page-break-before: always; }
  .print-unit { break-inside: avoid; page-break-inside: avoid; }
  .content > section.card.detail, .print-split { break-inside: auto; page-break-inside: auto; }
  .print-split { display: block !important; }
  /* page breaks on items of a flex column leave a blank page in Chrome: lay categories out as blocks */
  .dgroups { display: block !important; }
  .dgroups > .dgroup { margin-top: 12px; }
  a[href]::after { content: none !important; }
  /* no board.js (old browser): at least drop the menu and keep cards whole */
  .rail, .mobile-bar, .memo, .story-toc { display: none !important; }
  .shell { display: block !important; }
}
