:root {
  --bg: #f5f5f7; --card: #ffffff; --text: #1c1c1e; --muted: #6b6b73; --line: #e3e3e8;
  --accent: #7a3cff; --up: #0a8f4d; --down: #d0342c; --warn-bg: #fff4e5; --warn: #9a5b00;
  --err-bg: #fdecea; --err: #a1261f; --ok-bg: #e8f6ee; --gold: #b8860b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f12; --card: #1b1b20; --text: #f2f2f5; --muted: #9a9aa5; --line: #2c2c34;
    --accent: #a98bff; --up: #4cd08a; --down: #ff6b61; --warn-bg: #3a2c10; --warn: #ffc56b;
    --err-bg: #3b1715; --err: #ff9d95; --ok-bg: #12301f; --gold: #e6c15a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
header.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
header.bar h1 { font-size: 17px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.bar a.nav { color: var(--accent); font-size: 14px; padding: 8px 4px; min-height: 44px; min-width: 44px; display: flex; align-items: center; }
/* どの画面からも 1 回でトップへ (2026-10-07・templates/_top_nav.html)。ヘッダーの左端・アイコン + 小さな「トップ」。
   権限ごとの色 (今後) は body[data-tier] / .tier-○○ に載せる。いまは全員同じ見た目 */
header.bar a.nav.top { flex: none; gap: 3px; flex-direction: column; justify-content: center; min-width: 44px; padding: 2px 4px; font-size: 10px; font-weight: 600; line-height: 1; }
header.bar a.nav.top svg { width: 20px; height: 20px; }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 64px; }
h2 { font-size: 13px; letter-spacing: .06em; color: var(--muted); margin: 28px 4px 8px; font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.card + .card { margin-top: 10px; }
.row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 52px;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { color: var(--muted); font-size: 13px; }
.eval { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.eval.black { color: var(--down); }
.rank-head {
  padding: 6px 14px; font-size: 13px; font-weight: 700; color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, transparent); border-top: 1px solid var(--line);
}
.rank-head:first-child { border-top: 0; }
.up { color: var(--up); font-weight: 700; }
.down { color: var(--down); font-weight: 700; }
.chip {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); white-space: nowrap;
}
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.err { background: var(--err-bg); color: var(--err); }
.chip.off { background: var(--line); color: var(--muted); }
.banner { padding: 12px 14px; border-radius: 12px; margin: 0 0 10px; font-size: 14px; }
.banner.err { background: var(--err-bg); color: var(--err); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.ok { background: var(--ok-bg); color: var(--up); }
.big { font-size: 34px; font-weight: 800; letter-spacing: .01em; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { padding: 14px; color: var(--muted); font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; border-top: 0; }
th:first-child, td:first-child { text-align: left; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hist { padding: 12px 14px; border-top: 1px solid var(--line); }
.hist:first-child { border-top: 0; }
.hist .top { display: flex; gap: 8px; align-items: baseline; }
.hist .top .grow { flex: 1; }
details > summary { list-style: none; cursor: pointer; padding: 14px; min-height: 48px; font-weight: 600; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "＋"; float: right; color: var(--muted); }
details[open] > summary::after { content: "－"; }
form.stack { display: grid; gap: 10px; padding: 0 14px 14px; }
form.inline { display: inline; }
label { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 15px; min-height: 44px; }
input, select, button {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%;
}
input[type=radio], input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; padding: 0; }
button { background: var(--accent); color: #fff; border: 0; font-weight: 700; cursor: pointer; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button.danger { background: var(--down); }
button.small { width: auto; min-height: 44px; padding: 8px 14px; font-size: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }

a.row.card { margin-top: 10px; }
a.btn-danger { color: var(--down); font-weight: 700; border-color: color-mix(in srgb, var(--down) 40%, var(--line)); }
details details > summary { padding: 8px 0 0; min-height: 36px; font-weight: 400; }
td a { color: var(--accent); }
.hist .sub { word-break: break-all; }

.sheet-head { display: flex; align-items: baseline; gap: 12px; margin: 14px 4px 8px; }
.sheet-title { font-size: 18px; font-weight: 700; flex: 1; }
.sheet-range { color: #2b5fc2; font-size: 14px; white-space: nowrap; }
table.sheet th, table.sheet td { text-align: center; border: 1px solid var(--line); padding: 7px 8px; }
table.sheet th { background: color-mix(in srgb, var(--muted) 12%, transparent); }
table.sheet tr.attn td, table.sheet tr.attn td a { color: var(--down); }
table.sheet td.pct, table.sheet th.pct { border-left: 3px double var(--muted); font-weight: 700; }
table.sheet tr.total td { font-weight: 700; border-top: 2px solid var(--muted); }
/* Excel ランキング: 社交詳細からの補完の行は原本の行と見分けられるように */
table.sheet tr.supp td { background: color-mix(in srgb, var(--muted) 8%, transparent); }
table.sheet.excel-rank td.name { text-align: left; white-space: nowrap; }
/* スマホで表を横にずらしても氏名が見えるように */
table.sheet.excel-rank td.name { position: sticky; left: 0; z-index: 1; background: var(--card); }
/* スマホで横にずらしても氏名が見えるように (ランキング表) */
table.sheet.rank td.name, table.sheet.rank th.name { position: sticky; left: 0; z-index: 1; background: var(--card); }
table.sheet.rank tr.attn td.name { background: inherit; }
table.sheet.excel-rank tr.supp td.name { background: color-mix(in srgb, var(--muted) 8%, var(--card)); }

/* 実績推移 (積み上げ棒グラフ) */
.fy-form { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; }
.fy-form select { flex: 1; }
.chart svg { display: block; width: 100%; height: auto; padding: 0 8px; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .slot { fill: transparent; }
.chart .slot.sel { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.chart .bar.first { fill: var(--accent); }
.chart .bar.second { fill: color-mix(in srgb, var(--accent) 45%, var(--card)); }
.chart .bar.prov { opacity: .45; }
.chart .flag { fill: var(--down); }
.chart .mlabel { font-size: 9px; fill: var(--muted); }
.chart .mlabel.sel { fill: var(--text); font-weight: 700; }
.chart .nodata { font-size: 8px; fill: var(--muted); }
.chart-note { padding: 4px 14px 12px; }
.legend { font-size: 12px; color: var(--muted); white-space: nowrap; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 3px 0 8px; }
.legend .sw.first { background: var(--accent); }
.legend .sw.second { background: color-mix(in srgb, var(--accent) 45%, var(--card)); }
table.kv th, table.kv td { text-align: right; }
table.kv td:first-child, table.kv th:first-child { text-align: left; color: var(--muted); }
.hint { margin: 6px 4px; }
table.kv { table-layout: fixed; }
table.kv th, table.kv td { white-space: normal; padding: 8px 6px; font-size: 12.5px; }
table.kv td:first-child, table.kv th:first-child { width: 17%; }
/* 新人確認: 見出しを折り返さず、値は左寄せ (スマホで読みやすく) */
table.kv.nc td:first-child { width: 8.5em; white-space: nowrap; }
table.kv.nc td { text-align: left; }

/* ---- 2026-09 UI 整理: 店舗一覧 → 店舗トップ → 各メニュー ---- */
header.bar .titles { flex: 1; min-width: 0; }
header.bar .titles h1 { flex: none; }
header.bar .titles .page { font-size: 12px; color: var(--muted); line-height: 1.2; }
header.bar a.nav.back { font-weight: 600; white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; flex: none; min-width: 44px; }

.store-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.store-card .top { display: flex; align-items: baseline; gap: 8px; }
.store-card .title { font-size: 20px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 14px; color: var(--muted); }
.store-card .issue { margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--warn); }
.store-card .issue.err { color: var(--err); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--up); }
.status.warn::before { background: var(--warn); }
.status.err::before { background: var(--down); }
.status.off::before { background: var(--muted); }
.add-card { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 72px; margin-top: 18px;
  border: 2px dashed color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 16px; color: var(--accent);
  font-size: 17px; font-weight: 800; background: color-mix(in srgb, var(--accent) 5%, transparent); }
.footer-links { display: flex; gap: 18px; justify-content: center; margin-top: 28px; font-size: 14px; }
.footer-links a { color: var(--accent); padding: 10px 4px; }

.store-head { padding: 4px 4px 12px; }
.store-head .month { color: var(--muted); font-size: 14px; }
.store-head .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 14px; color: var(--muted); }
.issues .row .grow { font-weight: 600; }
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.menu a { display: flex; flex-direction: column; justify-content: center; min-height: 96px; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.menu a .label { font-size: 19px; font-weight: 800; }
.menu a .desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.menu a.wide { grid-column: 1 / -1; min-height: 64px; }
.setup { border: 2px solid color-mix(in srgb, var(--warn) 45%, var(--line)); border-radius: 16px; background: var(--card); padding: 14px 16px; }
.setup .head { font-size: 17px; font-weight: 800; color: var(--warn); margin-bottom: 8px; }
.setup ol { list-style: none; padding: 0; margin: 0 0 12px; }
.setup li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
.setup li:first-child { border-top: 0; }
.setup li .mark { width: 1.4em; text-align: center; }
.setup li.done { color: var(--muted); }
.setup li.doing { font-weight: 700; }
.setup li .note { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
a.button { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 800; }

.sec-head { display: flex; align-items: baseline; gap: 8px; margin: 26px 4px 8px; }
.sec-head .t { font-size: 16px; font-weight: 800; }
.sec-head .n { color: var(--muted); font-size: 13px; }
.cast-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 60px; border-top: 1px solid var(--line); }
.cast-row:first-child { border-top: 0; }
.cast-row .who { flex: 1; min-width: 0; }
.cast-row .who .name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-row .trend { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cast-row .trend span { margin-right: 10px; white-space: nowrap; }
.cast-row .rank { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cast-row .rank.black { color: var(--down); }
.t-up { color: var(--up); font-weight: 700; }
.t-down { color: var(--down); font-weight: 700; }

.counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.counts .total { grid-column: 1 / -1; }
.counts > div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.counts .v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.counts .total .v { font-size: 34px; }
.counts .k { font-size: 12.5px; color: var(--muted); }
form.search { display: flex; gap: 8px; margin: 14px 0 0; }
form.search input { flex: 1; }
form.search button { width: auto; padding: 0 16px; }

details.cast { border-top: 1px solid var(--line); }
details.cast:first-child { border-top: 0; }
details.cast > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 56px; font-weight: 400; }
details.cast > summary::after { content: "▽"; float: none; margin-left: 4px; }
details.cast[open] > summary::after { content: "▼"; }
details.cast > summary .name { flex: 1; font-weight: 700; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.cast[open] > summary { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.cast-body { padding: 4px 14px 16px; }
.cast-body form.fy { display: flex; gap: 8px; align-items: center; margin: 8px 0; padding: 0; }
.cast-body form.fy select { flex: 1; }
.cast-body form.fy button { width: auto; padding: 0 14px; }
details.month { border-top: 1px solid var(--line); }
details.month > summary { display: flex; gap: 8px; align-items: baseline; padding: 10px 2px; min-height: 44px; font-weight: 400; font-variant-numeric: tabular-nums; }
details.month > summary::after { content: "▽"; float: none; color: var(--muted); }
details.month[open] > summary::after { content: "▼"; }
details.month > summary .m { width: 3em; font-weight: 700; }
details.month > summary .v { flex: 1; font-size: 14px; }
details.month > summary .v.none { color: var(--muted); }
.half { background: var(--bg); border-radius: 10px; padding: 8px 12px; margin: 0 0 8px; font-size: 13.5px; }
.half .h { font-weight: 700; margin-bottom: 2px; }
.half .h .sub { font-weight: 400; }
.half dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.half dt { color: var(--muted); }
.half dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mini-hist { font-size: 13px; margin: 12px 0 0; }
.mini-hist .h { font-weight: 700; margin-bottom: 4px; }
.mini-hist div.e { display: flex; gap: 8px; padding: 4px 0; border-top: 1px dashed var(--line); }
.mini-hist div.e .grow { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.retire-zone { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
a.retire { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--down) 45%, var(--line)); color: var(--down); font-weight: 700; font-size: 14px; }
.steps { display: flex; gap: 6px; margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.steps span { flex: 1; text-align: center; padding: 6px 2px; border-bottom: 3px solid var(--line); }
.steps span.on { color: var(--accent); font-weight: 800; border-color: var(--accent); }
.fields { display: grid; gap: 10px; padding: 0 0 10px; }
form.stack.flush { padding: 12px 0 0; }

/* ランキング: 年月選択・前期/後期/月間タブ・エリアランキングへの導線 */
form.month-form { display: flex; gap: 8px; margin: 0 0 12px; }
form.month-form select { flex: 1; min-width: 0; }
form.month-form button { width: auto; padding: 0 16px; }
nav.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 12px; }
nav.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 800; }
nav.tabs a span { font-size: 11px; font-weight: 400; color: var(--muted); }
nav.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
nav.tabs a.on span { color: #fff; opacity: .85; }
a.area-link { display: flex; flex-direction: column; gap: 2px; margin-top: 26px; padding: 16px; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); }
a.area-link .t { font-size: 17px; font-weight: 800; color: var(--accent); }

.button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.button-grid form { margin: 0; }
.chip.ok { background: var(--ok-bg); color: var(--up); }
input.folder-input { width: 9em; flex: none; }

/* PDF 出力ボタン (管理用は POST のフォーム)。リンクの行カードと同じ見た目にする */
form.pdf-form { margin: 10px 0 0; }
/* 共通の PDF viewer (2026-10-07 案 B): ヘッダーの下に PDF を大きく。高さは 見えている高さ - ヘッダーと「PDF を開く」 */
.pdf-viewer { display: grid; gap: 10px; }
.pdf-frame { display: block; width: 100%; height: 70vh; height: calc(100dvh - 190px); min-height: 320px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); }
.pdf-open { margin: 0; }
button.pdf-button { width: 100%; background: var(--card); color: inherit; font-weight: inherit; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; }
/* 閲覧専用サーバーの表示 */
.banner.readonly { background: var(--card); border: 1px solid var(--line); }

/* 動いているコードの表示 (バージョン・ビルド・起動日時) */
footer.build-info { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 16px 28px; }

/* 店舗の売上ページ */
.sales-kpi .stat .note { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
/* 売上ページの補助の数字 (出勤延べ・1日平均・1出勤あたり): 3 つを 1 行に小さく */
.stats.sales-sub { grid-template-columns: repeat(3, 1fr); margin-top: 10px; }
.stats.sales-sub .stat { padding: 8px 10px; }
.stats.sales-sub .stat .v { font-size: 15px; }
nav.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 8px; }
nav.seg a { text-align: center; padding: 10px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--text); font-size: 14px; }
nav.seg a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chart.daily svg { padding: 8px 4px 0; }
.chart .bar.sales { fill: var(--accent); }
.chart .bar.nom { fill: color-mix(in srgb, var(--up) 70%, var(--card)); }
.chart .open { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 2 2; }
.chart .dlabel { font-size: 9px; fill: var(--muted); }
.chart .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 14px 12px; font-size: 12px; }
.chart .legend .key::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px;
  vertical-align: -1px; background: var(--accent); }
.chart .legend .key.nom::before { background: color-mix(in srgb, var(--up) 70%, var(--card)); }
.chart .legend .key.open::before { background: transparent; border-top: 2px dashed var(--muted); height: 0; vertical-align: 3px; }
.day-list { display: grid; gap: 8px; }
.day-row { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.day-row.open { opacity: .7; }
.day-row .top { display: flex; justify-content: space-between; align-items: center; }
.day-row .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.day-row .grid b { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.compare .row > span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
h3 { font-size: 15px; margin: 18px 0 8px; }

/* 売上ページ: 概算・入出金 */
.chart .bar.out { fill: color-mix(in srgb, var(--down) 65%, var(--card)); }
.chart .legend .key.out::before { background: color-mix(in srgb, var(--down) 65%, var(--card)); }
details.fold { margin-top: 8px; }
details.fold > summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .grow { flex: 1; min-width: 0; }
.cash-list details.fold + details.fold { margin-top: 6px; }
table.cash-admin { width: 100%; border-collapse: collapse; font-size: 13px; }
table.cash-admin td, table.cash-admin th { border-top: 1px solid var(--line); padding: 8px 6px; vertical-align: top; text-align: left; }
form.cash-classify { display: grid; gap: 4px; }
form.cash-classify select, form.cash-classify input { min-height: 36px; font-size: 13px; }
form.cash-classify button { min-height: 36px; font-size: 13px; }

/* --- 店舗経営ダッシュボード ------------------------------------------------------------------ */
/* 店舗ページの共通ナビ。項目が多いので横スクロールする帯にする (スマホで折り返さない) */
.storenav { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 0 12px; padding-bottom: 4px; scrollbar-width: none; }
.storenav::-webkit-scrollbar { display: none; }
.storenav a { flex: 0 0 auto; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); font-size: 14px; font-weight: 700; white-space: nowrap; }
.storenav a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 店舗切替 (一番上)。下の storenav と見た目を分ける: こちらは「どの店舗か」だけを変える。
   店舗が増えても 1 行のまま。はみ出す分はこのバーの中だけ横に流れる (ページは横に動かさない) */
.storeswitch { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 0 8px; padding-bottom: 4px; scrollbar-width: none; }
.storeswitch::-webkit-scrollbar { display: none; }
.storeswitch a { flex: 0 0 auto; padding: 7px 12px; border-radius: 8px; font-size: 13px;
  font-weight: 700; white-space: nowrap; border: 1px solid var(--line); background: transparent;
  color: var(--muted); }
.storeswitch a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.chip.live { background: var(--warn-bg); color: var(--warn); }
.picker { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; flex-wrap: wrap; }
.picker select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: inherit; font-size: 15px; }

/* 一番上の大きい数字 */
.headline { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 10px; }
.headline .label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.headline .v { font-size: 38px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.headline .sub { margin-top: 4px; }
.up { color: var(--up); }
.down { color: var(--down); }

/* カードの中の余白 (インライン style は CSP で効かないので、必ずクラスにする) */
.pad { padding: 0 14px 14px; }
/* 目標の進捗。幅を inline style で書けないので <progress> の value で表す */
progress.goal { width: 100%; height: 10px; margin-top: 8px; border: 0; border-radius: 999px;
  background: var(--line); appearance: none; -webkit-appearance: none; display: block; }
progress.goal::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress.goal::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.goal::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

/* 状態つきの表の行 */
tr.attn td { color: var(--down); font-weight: 700; }
tr.muted td { color: var(--muted); }
td.state, th.state { text-align: center; }

/* 掘り下げ */
details.drill { border-top: 1px solid var(--line); }
details.drill > summary { padding: 10px 14px; min-height: 44px; display: flex; align-items: center;
  gap: 8px; cursor: pointer; font-size: 14px; }
details.drill > summary::-webkit-details-marker { display: none; }
details.drill > summary::before { content: "＋"; color: var(--muted); }
details.drill[open] > summary::before { content: "−"; }
details.drill .body { padding: 0 14px 12px; }

/* 警告 */
.alert { border-top: 1px solid var(--line); padding: 12px 14px; }
.alert:first-child { border-top: 0; }
.alert .top { display: flex; gap: 8px; align-items: baseline; }
.alert .title { font-weight: 700; flex: 1; min-width: 0; }
.alert ul { margin: 6px 0 0; padding-left: 1.2em; color: var(--muted); font-size: 13px; }
nav.tabs.four { grid-template-columns: repeat(4, 1fr); }

/* 月・年を選ぶ UI (全画面で共通)。スマホでも 1 行に収める */
form.month-form { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
form.month-form .mf-label { flex: 0 0 auto; color: var(--muted); font-size: 14px; }
form.month-form select { flex: 1 1 auto; min-width: 0; padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: inherit; font-size: 15px; }
form.month-form button { flex: 0 0 auto; width: auto; min-width: 64px; padding: 0 14px; min-height: 40px; }
h2.period { margin: 14px 4px 8px; font-size: 17px; }

/* AI の理解カード: スマホ (375px) で横に流れないよう、見出しと中身を縦に積む
   (利用者確定 2026-09-22。表だと 800px 超になり、横スクロールしないと理由が読めなかった) */
.kv { display: grid; grid-template-columns: 1fr; gap: 2px; }
.kv > dt { color: var(--muted); font-size: 13px; margin-top: 10px; }
.kv > dt:first-child { margin-top: 0; }
.kv > dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 560px) {
  .kv { grid-template-columns: 9em 1fr; column-gap: 12px; align-items: baseline; }
  .kv > dt, .kv > dt:first-child { margin-top: 6px; }
  .kv > dd { margin-top: 6px; }
}

/* 店舗TOPの「確認する」から来た対象 (2026-09-26) */
.card.focus { border: 2px solid var(--accent); }
/* 年と月を分けて選ぶ UI・前月/翌月 (2026-09-26) */
form.month-form.ym select { flex: 1 1 0; }
nav.ym-step { display: flex; justify-content: space-between; margin: -4px 2px 12px; font-size: 14px; }
nav.ym-step a { color: var(--accent); padding: 8px 4px; min-height: 40px; display: inline-flex; align-items: center; }
nav.ym-step .off { color: var(--muted); opacity: .5; padding: 8px 4px; }

/* 店舗TOP (2026-09-26): 9 項目・カードを低く (スマホ 375px で 1 画面に主要機能が入るように)。説明は 1 行 */
.menu.top { gap: 8px; margin-top: 10px; }
.menu.top a { min-height: 74px; padding: 10px 14px; border-radius: 14px; }
.menu.top a .label { font-size: 18px; }
.menu.top a .desc { font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu.top a.wide { min-height: 52px; }
.menu.top a .badge { align-self: flex-start; margin-top: 4px; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.menu.top a .badge.warn { background: var(--warn-bg); color: var(--warn); }
/* 在籍・評価 (2026-09-26): 上部は件数と行き先だけ。行に現在の評価と今月の本指・小計 */
nav.hub { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 2px 0 6px; }
nav.hub > a, nav.hub > span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 54px;
  padding: 6px 4px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: inherit; }
nav.hub .k { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
nav.hub .v { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
nav.hub a.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
nav.hub a.warn .v { color: var(--warn); }
nav.hub .off { opacity: .55; }
nav.hub a.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
nav.hub a.on .k { color: var(--accent); font-weight: 700; }
/* 在籍中 (2026-09-27): 名前のタイル。押すと在籍の操作 */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.tiles .tile { display: flex; flex-direction: column; gap: 4px; min-height: 64px; padding: 10px 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; min-width: 0; }
.tiles .tile .nm { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles .tile .meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12.5px; }
.tiles .tile.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-bg); }
.tiles .tile.leave { opacity: .75; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
details.month > summary .st { font-size: 11.5px; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.card.planned .row { min-height: 44px; padding: 8px 14px; }
p.hub-sub { display: flex; justify-content: space-between; gap: 8px; margin: 4px 4px 8px; }
p.hub-sub a { white-space: nowrap; }
details.cast > summary .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
details.cast > summary .who .name { flex: none; }
details.cast > summary .mm { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* エリアランキング (2026-09-26): エリアの下に 年 ▼｜月 ▼｜期間 ▼｜表示 を 1 行 (375px で横にはみ出さない) */
form.area-form { margin: 0 0 12px; }
form.area-form select.area { width: 100%; margin-bottom: 6px; }
form.area-form .ymk { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
form.area-form select { min-width: 0; padding: 9px 8px; border-radius: 10px; min-height: 42px; }
form.area-form button { width: auto; min-width: 58px; padding: 0 12px; min-height: 42px; }

/* AI 秘書への提出: 原本の画像 (2026-09-29) */
.submission-original { max-width: 100%; height: auto; display: block; margin: 8px 0; }

/* AI秘書: 選ぶ・押すで入れる画面 (2026-09-30)。カレンダー・曜日・「なし」・写真の提出 */
form.pick .event-row { display: grid; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
form.pick .event-row:last-child { border-bottom: 0; }
form.pick #event-rows.disabled { opacity: .35; }
form.pick button.ghost { margin-top: 10px; }
label.toggle { display: block; margin-top: 10px; }
label.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.toggle span { display: block; text-align: center; padding: 12px; min-height: 44px; border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); font-size: 15px; font-weight: 700; }
label.toggle input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.weekdays { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.weekdays .wd { min-height: 40px; padding: 6px 2px; font-size: 13px; background: transparent; color: var(--accent);
  border: 1px solid var(--line); border-radius: 8px; }
.weekdays .wd.on { background: var(--accent); color: #fff; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.cal-h:first-child { color: #c0392b; }
.cal-e { min-height: 42px; }
label.cal-d { display: block; }
label.cal-d input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.cal-d span { display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--text); font-size: 16px; }
label.cal-d input:checked + span { background: #c0392b; color: #fff; border-color: #c0392b; font-weight: 700; }
.upload-buttons { display: grid; gap: 10px; }
label.upload { display: block; }
label.upload input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.upload span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 700; }
label.upload.alt span { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.day-list .row .count { font-weight: 700; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.choice button { min-height: 44px; padding: 6px 4px; font-size: 14px; }
details.hist > summary { display: flex; gap: 8px; align-items: center; list-style: none; cursor: pointer; min-height: 44px; }
details.hist > summary::-webkit-details-marker { display: none; }
details.hist > summary::after { content: "›"; color: var(--muted); margin-left: 4px; }
details.hist[open] > summary::after { content: "⌄"; }
form.inline { display: inline; }
.weekdays { margin-top: 4px; }
button[disabled] { opacity: .5; cursor: default; }
.choice form, .choice form button { width: 100%; }
.picks { padding: 4px 0; }
label.pick-row { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 16px; }
label.pick-row:last-child { border-bottom: 0; }
label.pick-row input { width: 22px; height: 22px; min-height: 22px; margin-right: 12px; accent-color: var(--accent); }
details.extra > summary { list-style: none; cursor: pointer; color: var(--accent); font-weight: 700; }
details.extra > summary::-webkit-details-marker { display: none; }

/* AI秘書: 訂正 (2026-09-30)。「修正」・種類を選ぶ・削除・その人だけ 出勤 / 休み / わからない */
a.chip { text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
#review-events a.chip, #review-closures a.chip, #declared-empty a.chip { border: 1px solid var(--line); color: var(--accent); background: transparent; }
form.event-edit { display: grid; gap: 8px; margin-top: 8px; }
.type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.type-pick label.toggle { margin-top: 0; }
.type-pick label.toggle span { font-size: 14px; padding: 10px 6px; }
button.danger-text { color: var(--down); }
a.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.hist.person { padding: 8px 0; border-bottom: 1px solid var(--line); }
.hist.person:last-child { border-bottom: 0; }
.event-row button.remove-event { justify-self: start; margin-top: 0; }

/* OWNER の店長体験 (2026-10): 店舗TOP のカード (既存の .menu.top a と同じ見た目)・体験中の小さな帯 */
.menu form.menu-card { display: contents; }
.menu form.menu-card button { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left; width: 100%;
  min-height: 96px; padding: 16px; margin: 0; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px;
  font-weight: normal; cursor: pointer; }
.menu form.menu-card button .label { font-size: 19px; font-weight: 800; }
.menu form.menu-card button .desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.menu.top form.menu-card button { min-height: 74px; padding: 10px 14px; border-radius: 14px; }
.menu.top form.menu-card button .label { font-size: 18px; }
.menu.top form.menu-card button .desc { font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.exp-banner { display: inline-block; margin: 0 0 8px; padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: 700;
  background: #fff4d6; color: #7a5a00; border: 1px solid #e8cf86; }
body.aisec-page .exp-banner { position: absolute; z-index: 20; top: 4px; left: 50%; transform: translateX(-50%); margin: 0;
  background: rgba(20, 16, 10, .85); color: #e2bf6a; border-color: rgba(226, 191, 106, .6); white-space: nowrap; }
body.aisec-page .exp-banner { top: 6px; }
body.aisec-page .exp-banner ~ .aisec .aisec-top { padding-top: 38px; }

/* --- 経営ダッシュボード (オーナー・経営管理者・システム管理者・2026-10-03) と 体験中の小さな印 ------------------------- */
.vx-tag { display: flex; align-items: center; gap: 6px; margin: 0; flex: 0 0 auto; }
.vx-tag span { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 999px;
  padding: 3px 8px; white-space: nowrap; display: flex; gap: 4px; align-items: baseline; max-width: 46vw; overflow: hidden; }
.vx-tag span small { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.vx-tag button { font: inherit; font-size: 12px; min-height: 44px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--accent); white-space: nowrap; }
/* 体験中のヘッダー (2026-10-07): 1 段目 = トップ・戻る・見出し / 2 段目 = 体験中の札 (左) と「体験を終了」(右)。
   1 段に詰めると 360〜390px で 戻る が潰れて文字が切れたため。体験を終了は トップ とは別の操作のまま */
header.bar.has-vx { flex-wrap: wrap; row-gap: 6px; }
header.bar.has-vx .vx-tag { order: 99; flex: 1 0 100%; justify-content: space-between; min-width: 0; }
header.bar.has-vx .vx-tag span { max-width: none; min-width: 0; }
header.bar.has-vx .vx-tag button { flex: none; width: auto; }
.mg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 4px 4px 12px; color: var(--muted); font-size: 13px; }
.mg-head b { color: var(--text); font-size: 15px; }
.mg-total { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.mg-kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.mg-kpi .k { font-size: 12px; color: var(--muted); }
.mg-kpi .v { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.mg-kpi .v.na { font-size: 14px; font-weight: 600; color: var(--muted); }
.mg-store { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.mg-store .top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.mg-store .title { font-size: 18px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-store dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; }
.mg-store dt { font-size: 12px; color: var(--muted); }
.mg-store dd { margin: 0 0 4px; font-weight: 700; overflow-wrap: anywhere; }
.mg-store dd.na { color: var(--muted); font-weight: 500; font-size: 13px; }
.mg-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.mg-links a { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-weight: 600; min-height: 44px; }
.mg-switch-label { font-size: 12px; color: var(--muted); margin: 0 4px 6px; }
.mg-note { font-size: 12px; color: var(--muted); margin: 10px 4px; }
.xv-list { display: grid; gap: 8px; }
.xv-item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.xv-item .n { flex: 1; min-width: 0; }
.xv-item .n small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.xv-item form { margin: 0; }
.xv-item button, .xv-item a.btn { min-height: 40px; font: inherit; font-size: 14px; border-radius: 10px; border: 1px solid var(--accent);
  background: var(--card); color: var(--accent); padding: 0 12px; display: inline-flex; align-items: center; white-space: nowrap; }
/* 表示確認モードの 経営管理者体験 (2026-10-07): 組織ごとに 店舗を選ぶ (全店舗 / 複数)。スマホは 1 列・押しやすい行 (pick-row と同じ) */
.xv-exec { margin: 0; }
.xv-exec .pad { padding: 8px 0 4px; }
.xv-exec-head { padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--line); }
.xv-exec-head small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.xv-exec label.pick-row span small { display: block; color: var(--muted); font-size: 12px; }
@media (min-width: 640px) { .mg-total { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 過去Excelデータの再出力 (2026-10-05 DEV): 1 冊ずつのダウンロード。スマホでは 1 列、PC では 3 列 */
.reexport-note { line-height: 1.6; }
.reexport-file .hist { display: grid; gap: 6px; }
.reexport-file a.button.reexport-dl { margin-top: 6px; }
#reexport-runs a.hist { display: block; }
#reexport-files { margin-top: 10px; display: grid; gap: 10px; }
#reexport-files .card + .card { margin-top: 0; }
@media (min-width: 720px) { #reexport-files { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* 処理中の表示 (ボタンを押した後・二重送信の防止は static/reexport.js) */
.reexport-progress { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px;
  background: var(--warn-bg); color: var(--warn); }
.reexport-progress[hidden] { display: none; }
.reexport-spinner { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor;
  border-right-color: transparent; animation: reexport-spin 1s linear infinite; }
@keyframes reexport-spin { to { transform: rotate(360deg); } }
#reexport-form button[disabled] { opacity: .55; cursor: wait; }
.reexport-link { margin-top: 10px; }

/* --- 役割ごとの見た目 (2026-10-07 OWNER ② §1)。body[data-tier] の色の token だけを替える (表示だけ・権限の判定には使わない)。
   システム管理者 = 黒 + 紫・オーナー = 黒 + 落ち着いたゴールド・経営管理者 = 黒 + シルバー/プラチナ。店長 (manager)・閲覧は今のまま。
   体験中は data-tier = 体験している役割 (app.py の _top_nav)。背景はほぼ黒・カードは少し明るいチャコール・数字は白・補足はグレー・
   役割の色は 選択状態と主要なアクセントだけ。警告の色 (--warn) は本当に確認が要る所だけ ---------------------------------------- */
body[data-tier="system"], body[data-tier="owner"], body[data-tier="executive"] {
  --bg: #0b0b0d; --card: #18181c; --text: #f5f5f7; --muted: #9c9ca7; --line: #2b2b32;
  --up: #57c98c; --down: #ff7a70; --warn-bg: #36290f; --warn: #f2bd62; --err-bg: #3b1715; --err: #ff9d95; --ok-bg: #12301f;
  color-scheme: dark;
}
body[data-tier="system"] { --accent: #a98bff; --tier: #a98bff; }
body[data-tier="owner"] { --accent: #c9a75b; --tier: #c9a75b; --gold: #c9a75b; }
body[data-tier="executive"] { --accent: #cdd2da; --tier: #cdd2da; }
body[data-tier="system"] header.bar, body[data-tier="owner"] header.bar, body[data-tier="executive"] header.bar { background: #111114; }
.tier-badge { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--tier, var(--accent)); white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--tier, var(--accent)) 55%, transparent); border-radius: 999px; padding: 1px 8px; }
.tier-badge:empty { display: none; }

/* 体験中の札を小さく (2026-10-07 OWNER ② §20): 2 段目は 小さな札 1 つ + 小さな「体験を終了」。押せる所は 44px のまま (見た目だけ小さく)。
   通常のオーナーには出さない (base.html の view_experience)。終了は 今までどおり POST */
header.bar.has-vx { row-gap: 0; padding-bottom: 4px; }
header.bar.has-vx > .vx-tag { justify-content: flex-end; gap: 4px; }
header.bar.has-vx .vx-tag span { font-size: 10px; padding: 2px 8px; min-width: 0; }
body[data-tier] header.bar.has-vx .vx-tag span { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
header.bar.has-vx .vx-tag button { position: relative; margin: -9px 0; padding: 0 10px; border: 0; background: transparent; font-size: 11px; }
header.bar.has-vx .vx-tag button::before { content: ""; position: absolute; left: 2px; right: 2px; top: 50%; height: 24px; transform: translateY(-50%);
  border: 1px solid var(--line); border-radius: 999px; pointer-events: none; }

/* 0 / 未取得 / 集計中 / 確定 (2026-10-07 OWNER ② §4・templates/_values.html) */
.fv.na { color: var(--muted); font-weight: 600; }
.phase { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; color: var(--muted);
  border: 1px solid var(--line); white-space: nowrap; }
.phase-final { color: var(--up); }

/* オーナー TOP (2026-10-07 OWNER ② §5): 店舗ごとの「今日」のカード。正常は派手にしない・不足だけ 落ち着いた警告の色 */
.mg-legend { font-size: 12px; color: var(--muted); margin: 0 4px 8px; }
.mg-alert { margin: 0 0 10px; }
.mg-alert a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 14px; font-weight: 700;
  color: var(--warn); background: var(--warn-bg); }
.mg-total-owner .mg-kpi .s { font-size: 12px; color: var(--muted); }
.mg-cards { display: grid; gap: 10px; }
.mg-cards .mg-store { margin-bottom: 0; }
.mg-today { padding: 12px 14px; }
.mg-today .top { align-items: center; margin-bottom: 4px; }
.mg-today .title { font-size: 17px; }
.mg-today.st-short { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.mg-badge { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); background: color-mix(in srgb, var(--muted) 16%, transparent); }
.mg-badge.st-ok { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.mg-badge.st-short { color: var(--warn); background: var(--warn-bg); }
.mg-sales { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.mg-sales .k, .mg-people .k { font-size: 12px; color: var(--muted); }
.mg-sales .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mg-sales .v.na { font-size: 15px; font-weight: 600; color: var(--muted); }
.mg-people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.mg-people > div { min-width: 0; padding: 6px 8px; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.mg-people .k { display: block; }
.mg-people b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-people b.na, .mg-people .bal-na b { font-size: 13px; font-weight: 600; color: var(--muted); }
.mg-people .bal-short b { color: var(--warn); }
.mg-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.mg-foot b { color: var(--text); font-weight: 600; }
.mg-prev { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.mg-prev-tag { font-size: 10px; padding: 0 5px; border: 1px dashed var(--line); border-radius: 4px; }
.mg-month { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.mg-month .k { font-size: 12px; color: var(--muted); }
.mg-month b { font-size: 15px; font-variant-numeric: tabular-nums; }
.mg-month b.na { font-size: 13px; font-weight: 600; color: var(--muted); }
.phase-closed { color: var(--text); }
.mg-store dd .nw { white-space: nowrap; }
@media (min-width: 640px) { .mg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* オーナーの店舗詳細のメニュー (2026-10-07 OWNER ② §8): 6 個・スマホは 2 列 × 3 段 */
.mg-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.mg-menu a { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 8px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-weight: 700; }
@media (min-width: 640px) { .mg-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 上の権限のカレンダー (読むだけ・2026-10-07 OWNER ② §15) */
.mg-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.mg-cal-head b { font-size: 17px; }
.mg-cal-step { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--accent); font-size: 20px; }
.mg-cal-step.off { visibility: hidden; }
.mg-cal-status { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0 4px 10px; font-size: 13px; }
.mg-cal-status dt { color: var(--muted); }
.mg-cal-status dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.mg-cal-day { margin-bottom: 10px; }
.mg-cal-day .row a.sub { min-height: 44px; display: flex; align-items: center; padding: 0 4px; }
.mg-cal-roster .grow { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-cal-name { font-size: 13px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.mg-cal-name.added { color: var(--accent); }
.mg-cal-row { min-height: 48px; padding: 6px 12px; gap: 8px; }
.mg-cal-row.today { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mg-cal-row.closed .grow { color: var(--muted); }
.mg-cal-row .grow { font-size: 13px; overflow-wrap: anywhere; }
.mg-cal-names { display: block; font-size: 11px; line-height: 1.4; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.mg-cal-row .eval.na { color: var(--muted); font-weight: 600; font-size: 13px; }
.mg-cal-date { flex: none; width: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mg-cal-date small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); }
.mg-cal-date.sun small { color: var(--down); }
.mg-cal-date.sat small { color: #6aa7ff; }
/* 役割の色 (ゴールド・シルバー・紫) を塗った 選択状態・主要ボタンの文字は 濃い色 (白い文字では ゴールド・シルバーの上で読めない)。AI秘書の画面は ai_secretary.css のまま */
body:is([data-tier="system"], [data-tier="owner"], [data-tier="executive"]):not(.aisec-page) :is(button:not(.ghost):not(.danger), a.button,
  nav.tabs a.on, nav.tabs a.on span, nav.seg a.on, .storenav a.on, .storeswitch a.on, label.toggle input:checked + span, .weekdays .wd.on,
  label.upload span) { color: #141416; }
body #view-experience-exit { color: var(--accent); }

/* === p4 calendar (2026-10-08) === */
/* 上の権限のカレンダー: 3 段階 (シフト / 店長確定 / D-system参照出勤)。一覧は 日付・イベント・人数 1 つ・札 1 つ (名前は開いた日だけ) */
.mg-cal-row .mg-cal-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.mg-cal-row .mg-cal-count { flex: none; min-width: 3.2em; text-align: right; font-size: 14px; }
.mg-cal-chip { flex: none; width: 104px; display: flex; justify-content: flex-end; }
.mg-cal-chip .chip { font-size: 10px; padding: 2px 7px; }
.chip.conf { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.mg-cal-stages { display: grid; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); }
.mg-cal-stage { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.mg-cal-stage .eval.na, .mg-cal-pending { color: var(--muted); font-size: 12px; font-weight: 600; }
.mg-cal-roster { padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.mg-cal-roster-head { display: block; font-size: 11px; color: var(--muted); margin: 0 0 6px; }
.mg-cal-roster-names { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-cal-legend { font-size: 11px; line-height: 1.5; }
@media (max-width: 380px) {
  .mg-cal-chip { width: 96px; }
  .mg-cal-row { padding: 6px 10px; gap: 6px; }
}
/* 月間カレンダー (2026-10-08 OWNER): AI秘書と同じ系統の 7 列。1 日 = 日付・人数・状態 (シフト / 確定 / 実績) だけ。スマホで月全体を 1 画面 */
/* クラス名は .mg-calgrid (オーナートップのカードの .mg-month = 現在売上の行 と ぶつけない・2026-10-08 修正) */
.mg-calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin: 0 0 8px; align-items: stretch; }
.mg-month-h { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 0; }
.mg-month-h.sun, .mg-month-n.sun { color: var(--down); }
.mg-month-h.sat, .mg-month-n.sat { color: #6aa7ff; }
.mg-month-d { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; min-height: 58px; padding: 4px 1px 3px;
  background: var(--card); border: 1px solid var(--line); border-radius: 9px; color: var(--text); text-decoration: none; overflow: hidden; }
.mg-month-d.today { border-color: var(--accent); }
.mg-month-d.on { background: color-mix(in srgb, var(--accent) 14%, var(--card)); border-color: var(--accent); }
.mg-month-d.closed { opacity: .6; }
.mg-month-e { min-height: 58px; }
.mg-month-n { font-size: 13px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mg-month-k { font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.mg-month-k.na { font-size: 10px; color: var(--muted); font-weight: 600; }
.mg-month-d.closed .mg-month-k { font-size: 10px; color: var(--muted); }
.mg-month-st { display: inline-block; font-size: 9px; line-height: 1.3; padding: 1px 4px; border-radius: 999px; white-space: nowrap; font-weight: 700; }
.mg-month-st.st-shift { background: var(--line); color: var(--muted); }
.mg-month-st.st-confirmed { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.mg-month-st.st-dsystem { background: var(--ok-bg); color: var(--up); }
.mg-cal-legend .mg-month-st { font-size: 10px; }
/* === end p4 calendar === */

/* === p4 sales (2026-10-08) === */
/* 上位の売上ページ: バナーの右に 小さい「詳細 ›」。KPI の注記は 1 行 (360〜412px で はみ出さない) */
.banner.sales-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner.sales-banner .sales-detail-link { margin-left: auto; font-size: 13px; color: inherit; white-space: nowrap; }
.sales-kpi.sales-upper .stat { min-width: 0; }
.sales-kpi.sales-upper .stat .v { overflow-wrap: anywhere; }
.sales-kpi.sales-upper .stat .note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.sales-fill .row .sub { overflow-wrap: anywhere; }
.sales-stored { margin: 6px 2px 0; font-size: 11px; }
/* === end p4 sales === */

/* === p4 roster (2026-10-08) === */
/* 上の権限の在籍一覧: 2 列のカード (360〜412px で 2 列・広い画面は 3〜4 列)。押すとキャスト詳細 */
.p4-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
@media (min-width: 600px) { .p4-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 740px) { .p4-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.p4-card { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 10px 10px 9px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; line-height: 1.35; }
.p4-card:active { background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.p4-card .name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p4-card .eval { font-size: 15px; }
.p4-card .mm { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p4-chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.p4-chips .chip { font-size: 10px; padding: 1px 6px; }
.p4-cards .empty { grid-column: 1 / -1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
/* 上の権限のキャスト詳細: 今の要約 + 開閉式の段 (既定で閉じる) */
.p4-sum { padding: 12px 14px; }
.p4-sum .row { padding: 0; }
.p4-now { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.p4-now dt { color: var(--muted); }
.p4-now dd { margin: 0; font-weight: 700; }
details.p4-sec { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-top: 10px; }
details.p4-sec > summary { padding: 14px; }
details.p4-sec[open] > summary { border-bottom: 1px solid var(--line); }
details.p4-sec > :not(summary) { margin-left: 12px; margin-right: 12px; }
details.p4-sec > :last-child { margin-bottom: 12px; }
details.p4-sec form.fy { display: flex; gap: 8px; align-items: center; margin-top: 10px; margin-bottom: 8px; padding: 0; }
details.p4-sec form.fy select { flex: 1; }
details.p4-sec form.fy button { width: auto; padding: 0 14px; }
details.p4-sec h2 { font-size: 15px; }
/* === end p4 roster === */

/* === p4 expenses (2026-10-08) === */
/* 上位の経費 = 半月ごとの POS ⇔ 出納帳 照合 (expenses.html の upper)。スマホでも横に動かない */
nav.seg.exp-half { grid-template-columns: repeat(2, 1fr); }
.card.exp-sum { padding: 12px 14px; }
.card.exp-sum .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.card.exp-sum .top strong { min-width: 0; overflow-wrap: anywhere; }
.stats.exp-sum-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.stats.exp-sum-stats .stat { padding: 8px 8px; min-width: 0; }
.stats.exp-sum-stats .stat .v { font-size: 15px; overflow-wrap: anywhere; }
.card.exp-sum > .sub { margin-top: 4px; }
.card.exp-sum a.exp-more { display: flex; align-items: center; justify-content: flex-end; min-height: 44px; margin-top: 4px;
  color: var(--accent); font-weight: 700; }
p.exp-note { margin: 6px 4px 12px; font-size: 12px; }
.card.exp-diff-card { padding: 4px 0 8px; }
.card.exp-diff-card > .sub { padding: 6px 10px 0; font-size: 11px; }
table.exp-diff { table-layout: fixed; width: 100%; font-size: 12px; }
table.exp-diff th, table.exp-diff td { padding: 7px 2px; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
table.exp-diff th:first-child, table.exp-diff td:first-child { padding-left: 8px; width: 13%; }
table.exp-diff th:nth-child(2), table.exp-diff td:nth-child(2) { text-align: left; width: 23%; }
table.exp-diff th:nth-child(3), table.exp-diff th:nth-child(4), table.exp-diff td:nth-child(3), table.exp-diff td:nth-child(4) { width: 17%; }
table.exp-diff th:nth-child(5), table.exp-diff td:nth-child(5) { width: 16%; }
table.exp-diff th:last-child, table.exp-diff td:last-child { text-align: center; padding-right: 4px; width: 14%; }
table.exp-diff td small { display: block; font-size: 10px; color: var(--muted); }
table.exp-diff .chip { padding: 2px 4px; font-size: 10px; }
/* === end p4 expenses === */

/* === 売上・利益・経費の［更新］(システム管理者だけ・2026-10-11) === */
.refresh-box { padding: 10px 12px; margin: 0 0 10px; }
.refresh-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.refresh-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; }
.refresh-help { margin-top: 6px; font-size: 13px; }
.refresh-plan { margin: 6px 0; padding-left: 1.4em; }
.refresh-last { margin-top: 8px; }
table.refresh-steps td.msg { text-align: left; white-space: normal; word-break: break-all; }
/* === end data refresh === */
/* === 経費のタブ・差額専用ページ (2026-10-12 DEV・exp12) === */
nav.seg.exp-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
nav.seg.exp-tabs a { overflow-wrap: anywhere; }
.exp-counts span { white-space: nowrap; }
.card.exp-acc { padding: 12px 14px; }
.card.exp-acc .top { margin-bottom: 8px; }
table.exp-lines { table-layout: fixed; width: 100%; font-size: 12px; }
table.exp-lines th, table.exp-lines td { padding: 6px 3px; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
table.exp-lines th:first-child, table.exp-lines td:first-child { width: 14%; }
table.exp-lines th:last-child, table.exp-lines td:last-child { text-align: right; width: 24%; }
nav.storeswitch.exp-diff-filter a, nav.storeswitch.exp-diff-periods a { white-space: nowrap; }
.card.exp-diff-sum { padding: 12px 14px; }
/* === end 経費のタブ === */
/* === year ranking (2026-10-12 DEV): キャスト年度ランキングの一覧 (スマホ 1 列・グラフなし) === */
nav.tabs.yr-scope { grid-template-columns: repeat(2, 1fr); }
nav.tabs.yr-scope a { min-height: 44px; }
form.yr-form { flex-wrap: wrap; }
form.yr-form select { min-width: 8em; }
ol.yr-list { list-style: none; margin: 0 0 10px; padding: 0; }
.yr-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.yr-row:last-child { border-bottom: 0; }
.yr-row.empty { color: var(--muted); }
.yr-row.podium .yr-rank { background: var(--accent); color: #fff; }
.yr-rank { flex: none; width: 2.2em; height: 2.2em; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; background: var(--line); }
.yr-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.yr-name small, .yr-value small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.yr-value { flex: none; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
/* === end year ranking === */
/* === 上の権限の共通の画面 (2026-10-09 OWNER UPPER_UI_COMMON_SPEC) === */
/* 経営管理者・システム管理者の「今日」カードの AI必要人数の行 (オーナーには出さない)。補足の大きさ・色 */
.mg-ai { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.mg-ai b { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.mg-ai.na b { color: var(--muted); }
/* システム管理者だけの「必要な警告」: 要対応のある店舗を 1 行ずつ (押すと 店舗の管理画面) */
.mg-sys-list { display: grid; gap: 6px; margin: -4px 0 12px; }
.mg-sys-item { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 44px; padding: 6px 12px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); min-width: 0; }
.mg-sys-item b { font-size: 14px; }
.mg-sys-item span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.mg-sys-item.err { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
/* === end 上の権限の共通の画面 === */

/* 2026-10-14 OWNER: 「更新」の箱は普段 1 行 */
#data-refresh-last-line { margin: 6px 0 0; }
.refresh-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
/* === KPI の見張り (2026-10-15 DEV kpi1・上の権限だけ) === */
/* 一覧: 要約 1 行 + 店舗ごとの 1 行 (スマホは 4 マスを 1 行に。気づきのあるマスだけ色) */
.kpi-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 12px; margin-bottom: 10px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); }
.kpi-sum b { font-size: 16px; }
.kpi-sum span { font-size: 12px; color: var(--muted); }
.kpi-sum.has { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.kpi-rows { display: grid; gap: 8px; }
.kpi-row { display: block; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.kpi-row.flagged { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.kpi-name { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.kpi-name b { font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-badge { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: var(--warn); background: var(--warn-bg); white-space: nowrap; }
.kpi-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kpi-cell { min-width: 0; padding: 6px 6px; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.kpi-cell .k { display: block; font-size: 11px; color: var(--muted); }
.kpi-cell b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-cell small { display: block; font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.kpi-cell.na b { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi-cell.flag { background: var(--warn-bg); }
.kpi-cell.flag b { color: var(--warn); }
/* 店舗の画面: 月の列 (当月 / 先月 / 先々月)。スマホは 1 列ずつ縦に */
.kpi-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.kpi-month { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.kpi-mhead { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.kpi-mhead b { font-size: 15px; }
.kpi-mhead small { font-size: 12px; color: var(--muted); }
.kpi-month dl, .kpi-compare dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13px; }
.kpi-month dt, .kpi-compare dt { color: var(--muted); }
.kpi-month dd, .kpi-compare dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-month dd small, .kpi-compare dd small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.kpi-month dd.na, .kpi-compare dd.na { color: var(--muted); font-weight: 500; }
.kpi-compare { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
/* 気づき: 定型文 + 下書き。断定の色は使わない (確認が必要の薄い色だけ) */
.kpi-findings { display: grid; gap: 8px; }
.kpi-finding { padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); }
.kpi-finding b { display: block; font-size: 13px; color: var(--warn); margin-bottom: 4px; }
.kpi-finding p { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.kpi-finding p.draft { margin-top: 6px; font-size: 12px; color: var(--muted); }
.kpi-na { margin-top: 8px; }
/* === end KPI の見張り === */
