/* command-center-serving/public/app.css
   CC UI/UXデザイン標準 v1.0 適用＋Fidelity Tokens v1.6（質感採寸・参照実測）適用。
   全色 = tokens.css の var() 消費のみ（生hex禁止・grep検査対象）。
   4テーマ = <html data-surface>×<html data-theme>（切替は shell.js）。
   CSP style-src 'self' 準拠: inline style 不使用（動的幅は data-w → CSSOM・shell/app.js）。 */

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.65;
  /* FT-14 書体エンジン: 全数値=等幅数字 */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.num, .when, .kpi { font-variant-numeric: tabular-nums; }

/* FT-14 マイクロラベル様式（欧文大文字+0.08em・和文は +0.03em） */
.mlabel {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.mlabel.ja { text-transform: none; letter-spacing: 0.03em; }

/* FT-19 focus / hover / 押下 / disabled */
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
button, .btn, .tab, .side-nav a, .icon-btn, .list li, .ht-row, .alert-row, .leaderboard li,
.board-row, .cmdk-item, .avatar-chip, .period-pill, .chev-btn, .state, .topsearch,
details.fold summary, .tabbar a, .sheet a {
  transition: color var(--tr), background-color var(--tr), border-color var(--tr),
    box-shadow var(--tr), transform var(--tr), opacity var(--tr);
}
button:active:not(:disabled), .btn:active, .icon-btn:active, .tab:active { transform: scale(0.98); }
button:disabled { opacity: 0.4; cursor: default; }

/* FT-22 スクロールバー（既定太スクロールバーの露出禁止） */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ── topbar（FT-8 再構成: 左=ページ文脈／S面=検索窓／右=円形36ボタン群+アバターチップ） ── */
.topbar {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 10px var(--space-5); min-height: 60px;
}
.page-ctx { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.3; }
.ctx-page { font-weight: 700; font-size: var(--fs-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-app { font-size: var(--fs-1); color: var(--text-2); white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); flex: none; }

/* FT-2 ヘッダ円形アイコンボタン 36（SVG18のみ・light=ヘアライン枠／dark=枠なし1段明地） */
.icon-btn {
  width: var(--iconbtn-sz); height: var(--iconbtn-sz); border-radius: 999px;
  display: inline-grid; place-items: center; position: relative; flex: none;
  cursor: pointer; color: var(--text-2); padding: 0; font: inherit;
  border: 1px solid var(--line); background: var(--surface);
}
:root[data-theme="dark"] .icon-btn { border-color: transparent; background: var(--surface-raised); }
.icon-btn:hover { color: var(--text-1); background: var(--hover-bg); }
.icon-btn .ico-svg { width: 18px; height: 18px; vertical-align: middle; }
/* FT-8/FT-22 通知=赤ドット6〜8px */
.icon-btn .dot-badge {
  position: absolute; top: 5px; right: 5px; width: 7px; height: 7px;
  border-radius: 999px; background: var(--err); border: 1px solid var(--surface);
}
.icon-btn .dot-badge[hidden] { display: none; }

/* FT-8 アバターチップ（丸28頭文字＋名前＋役割小） */
.avatar-chip {
  display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); flex: none;
}
:root[data-theme="dark"] .avatar-chip { border-color: transparent; background: var(--surface-raised); }
.avatar {
  width: var(--chip-sz); height: var(--chip-sz); border-radius: 999px; flex: none;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: var(--fs-1); font-weight: 700;
}
.who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who-name { font-size: var(--fs-2); font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { font-size: 11px; color: var(--text-2); }
/* FT-22 アバター重ね（様式定義: 28円・地色2px縁・重なり-8px・末尾+nチップ） */
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar { border: 2px solid var(--surface); }
.avatar-stack .avatar + .avatar, .avatar-stack .avatar + .avatar-more { margin-left: -8px; }
.avatar-more {
  width: var(--chip-sz); height: var(--chip-sz); border-radius: 999px; border: 2px solid var(--surface);
  background: var(--bg-muted); color: var(--text-2); display: grid; place-items: center;
  font-size: var(--fs-1); font-weight: 700;
}

/* FT-21 検索窓（S面ヘッダ・高40・虫眼鏡16・右端 ⌘K キーキャップ） */
.topsearch {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
  color: var(--text-2); flex: 0 1 320px; min-width: 0; cursor: text;
}
.topsearch .ico-svg { width: 16px; height: 16px; flex: none; }
.topsearch input {
  border: none; background: transparent; flex: 1; min-width: 0;
  color: var(--text-1); font: inherit; font-size: var(--fs-3); padding: 0;
}
.topsearch input::placeholder { color: var(--text-2); }
.topsearch input:focus { outline: none; }
.kbd-hint { display: flex; gap: 3px; margin-left: auto; flex: none; }
kbd.kcap {
  border: 1px solid var(--line); border-radius: 6px; font-size: 11px; font-weight: 500;
  padding: 2px 6px; color: var(--text-2); background: var(--surface);
  font-family: var(--font-sans); line-height: 1.2;
}

/* 鮮度バナー（§3-3-4 偽装しない） */
.stale-banner {
  background: var(--warn-soft); color: var(--warn);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, var(--surface));
  padding: 6px var(--space-4); font-size: .85rem;
}

.main { max-width: 960px; margin: 0 auto; padding: var(--space-5) var(--space-4) 60px; }

.headline { display: flex; align-items: baseline; gap: var(--space-3); }
/* FT-4 ページ見出し h1 = 27/700・letter-spacing -0.02em */
.headline h1 { font-size: var(--fs-6); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; line-height: 1.2; }
.freshness { color: var(--text-2); font-size: .78rem; margin-left: auto; }

/* 10秒原則（§1-2）: 最上部の結論 */
.conclusion { margin: 10px 0 18px; }
.badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  font-weight: 700; font-size: 1rem; background: var(--ok-soft); color: var(--ok);
}
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.alert { background: var(--err-soft); color: var(--err); }
.badge.neutral { background: var(--bg-muted); color: var(--text-2); }
.conclusion .line { margin: 6px 0 0; color: var(--text-2); }

/* KPI カード（§3: ラベル→特大数値→文脈1行）— FT-3 padding20/gap16・FT-4 34/40 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); margin: var(--space-3) 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--raised-shadow);
}
.card .num { font-size: var(--kpi-size-2); font-weight: 700; line-height: 1.3; }
.card .label { color: var(--text-2); font-size: .85rem; }
.card .note { color: var(--text-2); font-size: .78rem; margin-top: 4px; }

.section {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; margin: var(--space-4) 0; box-shadow: var(--raised-shadow);
}
/* FT-9 カードヘッダ標準: タイトル15/600・下margin16 */
.section h2 { font-size: 15px; font-weight: 600; margin: 0 0 var(--space-4); }
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: var(--space-4); }
.sec-head h2 { margin: 0; flex: 1 1 auto; min-width: 0; }
.sec-head .head-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }
/* FT-9 期間ピル: 高28・font12/500・padding横10・radius999・ヘアライン枠 */
.period-pill {
  display: inline-flex; align-items: center; gap: 6px; height: var(--pill-h); padding: 0 10px;
  font-size: 12px; font-weight: 500; font-family: var(--font-sans); color: var(--text-2);
  border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: default;
}
.period-pill .caret { font-size: 10px; }
/* FT-9 シェブロン円ボタン28（1カード1個・折畳みトグル） */
.chev-btn {
  width: 28px; height: 28px; min-height: 0; border-radius: 999px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; padding: 0;
}
:root[data-theme="dark"] .chev-btn { border-color: transparent; background: var(--surface-raised); }
.chev-btn:hover { color: var(--text-1); background: var(--hover-bg); }
.chev-btn .ico-svg { width: 14px; height: 14px; transition: transform var(--tr); }
.section.collapsed .chev-btn .ico-svg { transform: rotate(-90deg); }
.section.collapsed > :not(.sec-head) { display: none; }

.list { margin: 0; padding: 0; list-style: none; }
.list li { padding: 10px 4px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.list li:first-child { border-top: none; }
.list .when { color: var(--text-2); font-size: .8rem; margin-left: auto; }
.sub { font-size: .78rem; color: var(--text-2); }
/* FT-19 行 hover = 1段明 */
.list li:hover, .ht-row:hover, .alert-row:hover, .leaderboard li:hover, .board-row:hover,
.chip-timeline li:hover { background: var(--hover-bg); }

/* FT-10 行アイコンチップ: 丸28=種別色10〜15%地+同色SVG18（点・裸アイコン禁止） */
.row-chip {
  width: var(--chip-sz); height: var(--chip-sz); border-radius: 999px; flex: none;
  display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.row-chip .ico-svg { width: 18px; height: 18px; }
.row-chip.tone-ok { background: var(--ok-soft); color: var(--ok); }
.row-chip.tone-warn { background: var(--warn-soft); color: var(--warn); }
.row-chip.tone-err, .row-chip.tone-halt { background: var(--err-soft); color: var(--err); }
.row-chip.tone-info { background: var(--info-soft); color: var(--info); }
.row-chip.tone-accent2 { background: color-mix(in srgb, var(--accent-2) 14%, var(--surface)); color: var(--accent-2); }

/* FT-16 状態ピル: 高22〜24・radius999・種別色地+同色文字12/600・先頭ドット6px */
.state {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px;
  font-size: 12px; font-weight: 600; border-radius: 999px;
  background: var(--bg-muted); color: var(--text-2); white-space: nowrap;
}
.state::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; }
.state.registered, .state.approved, .state.published, .state.confirmed { background: var(--ok-soft); color: var(--ok); }
.state.in_review, .state.pending, .state.held, .state.draft, .state.pending_approval { background: var(--warn-soft); color: var(--warn); }
.state.rejected, .state.returned { background: var(--err-soft); color: var(--err); }
.state.halt { background: var(--halt-soft); color: var(--halt); }
.state.preparing { background: var(--info-soft); color: var(--info); } /* UXF-C FT-50: 外部手続き未了の正直表示 */
/* FT-26 状態トーン（statePill が付与・無彩色ピルでの状態表示を禁止） */
.state.tone-ok { background: var(--ok-soft); color: var(--ok); }
.state.tone-warn { background: var(--warn-soft); color: var(--warn); }
.state.tone-err { background: var(--err-soft); color: var(--err); }
.state.tone-accent { background: var(--accent-soft); color: var(--accent); }
.state.tone-info { background: var(--info-soft); color: var(--info); }

/* 充足メーター（FT-20⑥ 参照1型: 高6・残余=斜線ハッチ。幅は data-w → CSSOM） */
.meter {
  background: repeating-linear-gradient(45deg, var(--bg-muted), var(--bg-muted) 4px, transparent 4px, transparent 8px);
  border: 1px solid var(--line);
  border-radius: 999px; height: 6px; overflow: hidden; margin: var(--space-2) 0;
}
.meter > div { height: 100%; width: 0; background: var(--accent); border-radius: 999px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tab { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-1); cursor: pointer; font-size: .85rem; text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.tab:hover { background: var(--hover-bg); }
.tab.active { background: var(--accent); color: var(--surface); border-color: var(--accent); }

.thumb { width: 88px; height: 88px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* FT-2 主要アクション: 高36・padding横16・r10・font13/600 */
button, .btn {
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: var(--radius-btn); border: 1px solid var(--accent);
  background: var(--accent); color: var(--surface); cursor: pointer; min-height: 36px;
}
button.secondary, .btn.secondary { background: var(--surface); color: var(--accent); }
button.secondary:hover, .btn.secondary:hover { background: var(--hover-bg); }
/* FT-23 主要ボタン hover = accent を1段暗く（--accent-hover）。
   class 無しの素の <button>（＝主要アクション）と .btn 主要のみ対象。
   icon-btn/chev-btn/filter-pill/secondary/tab 等の component ボタンは各自の hover を維持（誤爆回避）。 */
button:not([class]):hover:not(:disabled), .btn:hover:not(.secondary) { background: var(--accent-hover); border-color: var(--accent-hover); }
input, select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); width: 100%;
  background: var(--surface); color: var(--text-1);
}

.empty { color: var(--text-2); padding: 18px 4px; }
.error { color: var(--err); }
.ok { color: var(--ok); }

/* code/pre（S面 生JSON 表示） */
.code, pre.code {
  background: var(--bg-muted); color: var(--text-1); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px; overflow: auto; font-size: .8rem;
}
.mono { font-family: monospace; font-size: .8rem; }
textarea.mono { min-height: 180px; }

/* Agent管理 差分プレビュー */
.preview-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-top: var(--space-2); }
.diff-view { font-family: monospace; font-size: .76rem; max-height: 240px; overflow: auto; }
.diff-add { color: var(--ok); white-space: pre-wrap; }
.diff-del { color: var(--err); white-space: pre-wrap; }
.diff-ctx { color: var(--text-2); white-space: pre-wrap; }
.warn-text { color: var(--warn); }

/* push 許可ガイド */
.push-guide {
  background: var(--warn-soft); border: 1px solid var(--warn); color: var(--warn);
  padding: 10px 14px; margin: var(--space-2); border-radius: var(--radius-sm);
  font-size: .9rem; line-height: 1.8;
}

/* ── login ── */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; width: min(400px, 92vw); box-shadow: var(--raised-shadow);
}
.login-card h1 { font-size: 1.2rem; margin: 0 0 14px; }
.login-card h2 { font-size: .95rem; color: var(--text-2); }
.login-form { display: grid; gap: var(--space-3); margin: 10px 0; }
.login-form label { display: grid; gap: 4px; font-size: .85rem; color: var(--text-2); }
.form-narrow { max-width: 360px; }
/* UXF-D 是正 (FT-54-1): 必須マーク=ラベル横インライン小ピル。ラベル行を .lbl (flex) で包む —
   label は display:grid のため、直下 span は grid item 化して全幅 stretch する (旧 .login-form の
   label 直下 .req が「全幅バー」に見えた機序)。行 wrapper で構造的に防ぐ。 */
.login-form label .lbl { display: flex; align-items: center; gap: 6px; }
.login-form .lbl .req {
  display: inline-block; padding: 0 6px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 18px; background: var(--err-soft); color: var(--err);
}
/* UXF-D (FT-54-2): 欄幅=期待値幅 (ch 基準+入力余白)。郵便番号≒8字・都道府県≒10字・法人番号≒14字・
   登録番号≒15字・氏名≒20字。長文欄 (商号・住所・メール) は従来のフル幅を維持。 */
.login-form input.wch-8 { width: calc(8ch + 32px); max-width: 100%; }
.login-form input.wch-10 { width: calc(10ch + 32px); max-width: 100%; }
.login-form input.wch-14 { width: calc(14ch + 32px); max-width: 100%; }
.login-form input.wch-15 { width: calc(15ch + 32px); max-width: 100%; }
.login-form input.wch-20 { width: calc(20ch + 32px); max-width: 100%; }
.form-actions { display: flex; justify-content: flex-end; }
.form-actions button { width: auto; }
/* UXF-D (FT-56): 未保存変更がある間のみ表示する画面下固定の保存バー（保存・変更を破棄） */
.cc-savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: none; align-items: center; gap: 10px; justify-content: flex-end;
  padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--raised-shadow);
}
.cc-savebar.on { display: flex; }
.cc-savebar .msg { margin-right: auto; color: var(--text-2); font-size: .85rem; }
.cc-savebar button { width: auto; }
@media (max-width: 767px) {
  .cc-savebar { bottom: calc(56px + env(safe-area-inset-bottom)); padding-bottom: 10px; } /* tabbar の上に置く */
}
/* UXF-C SEG-C1 (FT-49-2): 必須欄の入力成功サイン（充足＝ok 色の縁）・郵便番号自動入力は左寄せ副操作 */
.login-form input.filled[data-cpreq] { border-color: var(--ok); }
.form-actions.postal-actions { justify-content: flex-start; }
/* UXF-D SEG-D1 (FT-55): 書類ライブラリ — 配下ファイル行 (インデント)・D&D 受入の視覚合図・絞込 UI */
.list li.doc-file { margin-left: 28px; }
.list li[data-dropzone].dropping { outline: 2px dashed var(--accent); outline-offset: -2px; }
.doc-filter { display: flex; gap: 8px; max-width: 520px; }
.doc-filter input[type="search"] { flex: 1; }
.doc-filter select { width: auto; }

/* ── モバイル bottom tab bar（§5・FT-2: 高56・アイコン22・label10） ── */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a, .tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 56px; text-decoration: none; font-size: 10px;
  color: var(--text-2); background: transparent; border: none; cursor: pointer; position: relative;
  font-family: var(--font-sans);
}
.tabbar a.active { color: var(--accent); font-weight: 600; }
.tabbar .ico { display: inline-flex; line-height: 1; }
.tabbar .ico .ico-svg { width: 22px; height: 22px; }
.tabbar .cnt {
  position: absolute; top: 6px; right: calc(50% - 22px);
  min-width: 16px; height: 16px; border-radius: 999px; padding: 0 4px;
  background: var(--err); color: var(--surface); font-size: .62rem; font-weight: 700;
  display: none; align-items: center; justify-content: center;
}
.tabbar .cnt.show { display: inline-flex; }

/* その他シート / S面ドロワー */
.sheet {
  display: none; position: fixed; left: 0; right: 0; bottom: 56px; z-index: 19;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: var(--shadow-card); padding: var(--space-2) 0 var(--space-3);
}
.sheet.open { display: block; }
.sheet a, .sheet button.sheet-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px var(--space-5); min-height: var(--tap-min);
  color: var(--text-1); text-decoration: none; font-size: .95rem;
  background: transparent; border: none; cursor: pointer; text-align: left; font-family: var(--font-sans);
}
.sheet a.active { color: var(--accent); font-weight: 600; }

/* ── レスポンシブ（§5 ブレークポイント）── */
@media (max-width: 767px) {
  .tabbar { display: flex; }
  .main { padding: 14px 10px calc(76px + env(safe-area-inset-bottom)); }
  .cards { gap: var(--space-3); } /* FT-3 mobile gap 12 */
  .card .num { font-size: 1.6rem; }
  .list li { align-items: flex-start; }
  .topbar { flex-wrap: nowrap; gap: var(--space-2); padding: 8px var(--space-3); }
  .topsearch { display: none; }
  .who { display: none; }
  .avatar-chip { padding: 3px; }
  .split > div + div, .split-3 > div + div { border-left: none; padding-left: 0; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

/* ── §5-1 世界観モード (S面・UI標準§6) ── */
.ambient-overlay {
  display: none; position: fixed; inset: 0; z-index: 30;
  background: var(--bg);
  place-items: center; grid-template-rows: 1fr auto auto; padding: var(--space-6);
  text-align: center;
}
.ambient-overlay.on { display: grid; }
.ambient-overlay canvas { max-width: min(70vmin, 480px); max-height: min(70vmin, 480px); }
.ambient-stats .kpi { font-size: var(--kpi-size-1); font-weight: 700; color: var(--text-1); }
.ambient-stats .amb-label { color: var(--text-2); font-size: .9rem; }
.ambient-stats .amb-note { color: var(--accent-2); font-size: .85rem; margin-top: var(--space-2); }
#ambient-exit { margin-top: var(--space-4); }

/* §4/§6: アニメーションは最小・reduced-motion 尊重 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   署名部品スタイル（Blueprints v2.0 BP-SIG/BP-UX ＋ Fidelity Tokens v1.2 採寸）
   色は全て var()/currentColor 消費（生hex禁止）。幅は data-w→CSSOM。
   ══════════════════════════════════════════════════════════════════════════ */

/* ── BP-SIG-6: サイドバーシェル（FT-21: 幅248・項目高40・アイコン18・セクション見出し=マイクロラベル） ── */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: var(--space-4) var(--space-3);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand-row { display: flex; align-items: center; gap: 10px; padding: 4px var(--space-3) var(--space-5); }
.sidebar .brand-mark {
  width: var(--chip-sz); height: var(--chip-sz); border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: var(--surface); flex: none;
}
.sidebar .brand-mark svg { width: 18px; height: 18px; }
.sidebar .brand-name { font-weight: 700; font-size: var(--fs-4); letter-spacing: -0.01em; }
.side-sec { padding: 0 var(--space-3) var(--space-2); }
/* FT-29: 2群め以降の見出しは上に間隔を空けて群を分離 */
.side-nav + .side-sec { margin-top: var(--space-4); }
.side-nav { display: flex; flex-direction: column; gap: 2px; list-style: none; margin: 0; padding: 0; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; height: var(--sidebar-item-h);
  padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--text-2);
  text-decoration: none; font-size: var(--fs-3); position: relative;
}
.side-nav a .ico-svg { width: var(--icon-sz); height: var(--icon-sz); flex: none; opacity: .85; }
.side-nav a:hover { background: var(--hover-bg); color: var(--text-1); }
/* active = 丸角12 のピル（C-light=淡accent地+accent文字 / S-dark=accent塗り+白文字・FT-6） */
.side-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
:root[data-surface="s"] .side-nav a.active { background: var(--accent); color: var(--surface); }
/* FT-21 数字バッジ: 12/600 */
.side-nav a .side-cnt {
  margin-left: auto; min-width: 20px; height: 20px; border-radius: 999px; padding: 0 6px;
  background: var(--bg-muted); color: var(--text-2); font-size: 12px; font-weight: 600;
  display: none; align-items: center; justify-content: center;
}
.side-nav a .side-cnt.show { display: inline-flex; }
.side-nav a.active .side-cnt { background: var(--accent-soft); color: var(--accent); }
:root[data-surface="s"] .side-nav a.active .side-cnt { background: color-mix(in srgb, var(--surface) 25%, var(--accent)); color: var(--surface); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: var(--space-4) var(--space-3) 0; }
.logout { color: var(--text-2); font-size: .85rem; text-decoration: none; }
.logout:hover { color: var(--text-1); }
.shell-main { min-width: 0; display: flex; flex-direction: column; }
.shell-main .topbar { position: sticky; top: 0; z-index: 10; }
.shell-main .main { max-width: 1120px; width: 100%; padding: var(--canvas-pad); }

/* モバイルはサイドバー畳んで既存 tabbar 継続 */
@media (max-width: 767px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ── ページ見出し（BP-SIG-8）＋ FT-4 hero 二段トーン（44〜48/700） ── */
.page-head { display: flex; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-4); }
.page-title { font-size: var(--fs-6); font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1.15; }
.page-head .freshness { margin-left: auto; }
.head-actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; }
.hero-title { font-size: var(--fs-7); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.hero-title .t2 { color: var(--text-2); }

/* ── KPI カード（FT-4 40/34・FT-3 min132・FT-15 単位小型化・FT-16 増減バッジ） ── */
.kpi-card { border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 6px; min-height: 132px; }
.kpi-card.has-corner { position: relative; }
.kpi-card .kpi-head { display: flex; align-items: center; gap: var(--space-2); }
.kpi-card .label { color: var(--text-2); font-size: var(--fs-1); font-weight: 500; }
/* FT-28 ラベル行小アイコン18 */
.kpi-ic { width: 18px; height: 18px; flex: none; display: inline-flex; color: var(--accent); }
.kpi-ic .ico-svg { width: 18px; height: 18px; }
.kpi-ic.tone-ok { color: var(--ok); } .kpi-ic.tone-warn { color: var(--warn); } .kpi-ic.tone-accent { color: var(--accent); } .kpi-ic.tone-info { color: var(--info); }
.kpi-ic.tone-cat1 { color: var(--cat-1); } .kpi-ic.tone-cat2 { color: var(--cat-2); } .kpi-ic.tone-cat3 { color: var(--cat-3); } .kpi-ic.tone-cat4 { color: var(--cat-4); } .kpi-ic.tone-cat5 { color: var(--cat-5); }
/* FT-28 S面 KPI 右上シェブロン円28（参照4型・装飾） */
.kpi-corner { position: absolute; top: 16px; right: 16px; width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-2); }
:root[data-theme="dark"] .kpi-corner { border-color: transparent; background: var(--surface-raised); }
.kpi-corner .ico-svg { width: 14px; height: 14px; }
.kpi-card.has-corner .kpi-head { padding-right: 34px; }
/* FT-28 C面ホーム KPI = 1カード内3分割ストリップ＋縦ヘアライン（参照1型） */
.kpi-strip { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin: var(--space-3) 0; }
.kpi-seg { padding: 20px; display: flex; flex-direction: column; gap: 6px; min-height: 132px; min-width: 0; }
.kpi-seg + .kpi-seg { border-left: 1px solid var(--divider); }
.kpi-seg .kpi-head { display: flex; align-items: center; gap: var(--space-2); }
.kpi-seg .label { color: var(--text-2); font-size: var(--fs-1); font-weight: 500; }
.kpi-seg .num.kpi { font-size: var(--kpi-size-2); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.kpi-seg .note { color: var(--text-2); font-size: var(--fs-1); }
@media (max-width: 767px) {
  .kpi-strip { grid-template-columns: 1fr; }
  .kpi-seg + .kpi-seg { border-left: none; border-top: 1px solid var(--divider); }
}
.kpi-card .num.kpi { font-size: var(--kpi-size-2); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.kpi-card.hero .num.kpi { font-size: var(--kpi-size-1); }
.kpi-unit { font-size: .55em; font-weight: 500; color: var(--text-2); }
.kpi-delta { margin-left: auto; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.kpi-delta.up { background: var(--pos-bg); color: var(--pos); }
.kpi-delta.down { background: var(--neg-bg); color: var(--neg); }
.kpi-spark { display: block; margin-top: 2px; height: var(--spark-h); color: var(--accent); }
.kpi-spark.tone-ok { color: var(--ok); } .kpi-spark.tone-warn { color: var(--warn); } .kpi-spark.tone-accent { color: var(--accent); }
.spark { width: 100%; height: var(--spark-h); display: block; }

/* ── BP-SIG-1: 放射ゲージ（FT-5: 径200） ── */
.gauge-wrap { display: grid; place-items: center; padding: var(--space-2); }
.gauge-num { font-size: 32px; font-weight: 700; fill: var(--text-1); font-variant-numeric: tabular-nums; }
.gauge-pct { font-size: 16px; fill: var(--text-2); font-weight: 500; }
.gauge-label { font-size: 12px; fill: var(--text-2); }
/* FT-27 放射tickセグメント（滑らかリング廃止） */
.gauge-tick { transition: none; }

/* ── ドーナツ（FT-5: 外径150・線幅15） ── */
.donut-wrap { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; position: relative; }
.donut { flex: none; }
.donut-center-svg { position: absolute; left: 0; top: 0; width: var(--donut-d); height: var(--donut-d); pointer-events: none; }
.donut-num { font-size: 24px; font-weight: 700; fill: var(--text-1); }
.donut-sub { font-size: 11px; fill: var(--text-2); }
/* FT-20⑤ 凡例=ドット8px+12px --text-2 */
.chart-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.chart-legend.row { flex-direction: row; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); align-items: center; }
.chart-legend li { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.chart-legend b { color: var(--text-1); margin-left: 4px; font-variant-numeric: tabular-nums; }
.chart-legend .lg-total { margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--dot, var(--accent)); flex: none; }

/* ── 積み上げ横バー ── */
.stacked-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--bg-muted); }
.sb-cell { height: 100%; }

/* ── ステップ/予測バー共通（FT-20: 軸ラベル11/400・点線グリッド・棒r7） ── */
.axis-x { font-size: 11px; font-weight: 400; fill: var(--text-2); }
.grid-dot { stroke: var(--grid-line); stroke-width: 1; stroke-dasharray: 1 3; }
.stepbar, .forecast-bar, .proc-columns { width: 100%; display: block; }
/* FT-38 柱/棒の値直書き（柱上・タブラー） */
.bar-val { font-size: 12px; font-weight: 700; fill: var(--text-1); font-variant-numeric: tabular-nums; }
/* FT-35 工程柱チャート（c-home ヒーロー） */
.proc-columns { height: auto; }
.pc-bar { transition: none; }
/* FT-33 反復折畳み（run 単位・「残りn件を表示」） */
details.run-fold { border-top: 1px solid var(--line); margin-top: 0; }
details.run-fold > summary { color: var(--accent); font-weight: 600; }
.fc-key, .fck { font-size: var(--fs-1); }
.fc-key { display: flex; gap: var(--space-4); color: var(--text-2); margin-top: 6px; }
.fc-key span { display: inline-flex; align-items: center; gap: 6px; }
.fck { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.fck.solid { background: var(--accent); }
.fck.hatch { background: repeating-linear-gradient(45deg, var(--accent), var(--accent) 2px, transparent 2px, transparent 4px); border: 1px solid var(--accent); }
/* FT-20⑦ 値コールアウトチップ（dark面でも白地・影・r8） */
.co-chip { filter: drop-shadow(var(--callout-shadow)); }
.co-bg { fill: var(--callout-bg); }
.co-tx { fill: var(--callout-text); font-size: 11px; font-weight: 600; }

/* ── BP-SIG-3: ファネル ── */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-stage { display: flex; flex-direction: column; gap: 3px; }
.funnel-top { display: flex; justify-content: space-between; font-size: var(--fs-2); }
.funnel-cap { font-weight: 700; color: var(--text-1); font-variant-numeric: tabular-nums; }
.funnel-lab { color: var(--text-2); }
.funnel-bar { height: 26px; border-radius: var(--radius-sm); background: var(--accent-soft); border-left: 3px solid var(--accent); width: 0; }

/* ── BP-SIG-4: リーダーボード ── */
.leaderboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.leaderboard li { display: flex; align-items: center; gap: 10px; height: var(--row-h); padding: 0 4px; border-top: 1px solid var(--line); }
.leaderboard li:first-child { border-top: none; }
.lb-rank { width: 22px; text-align: center; color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-ico { color: var(--accent); display: inline-flex; }
.lb-name { flex: none; width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-track { flex: 1; height: 8px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; }
.lb-fill { display: block; height: 100%; background: var(--accent); width: 0; border-radius: 999px; }
.lb-pct { width: 44px; text-align: right; font-weight: 700; }

/* ── BP-SIG-5: アラート行（FT-10: 丸地チップ28） ── */
.alert-rows { list-style: none; margin: 0; padding: 0; }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); }
.alert-row:first-child { border-top: none; }
.ar-ico { width: var(--chip-sz); height: var(--chip-sz); border-radius: 999px; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info); }
.ar-ico .ico-svg { width: 18px; height: 18px; }
.ar-ico.tone-ok { background: var(--ok-soft); color: var(--ok); }
.ar-ico.tone-warn { background: var(--warn-soft); color: var(--warn); }
.ar-ico.tone-err, .ar-ico.tone-halt { background: var(--err-soft); color: var(--err); }
.ar-body { display: flex; flex-direction: column; min-width: 0; }
.ar-title { font-size: var(--fs-3); }
.ar-sub { font-size: var(--fs-1); color: var(--text-2); }
.ar-when { margin-left: auto; font-size: var(--fs-1); color: var(--text-2); white-space: nowrap; }
/* FT-13 折畳み（同文連続 ×n）— details.fold の ▸ marker/accent 色は継承しない */
details.feed-fold summary { padding: 0; border: none; min-height: 0; color: inherit; font-weight: 400; }
details.feed-fold summary::before, details.feed-fold[open] summary::before { content: none; margin: 0; }
.feed-fold summary .alert-row { border-top: 1px solid var(--line); }
.feed-fold .fold-body { padding-left: calc(var(--chip-sz) + 12px); }
.fold-count { margin-left: 6px; font-size: var(--fs-1); font-weight: 600; color: var(--text-2); background: var(--bg-muted); border-radius: 999px; padding: 1px 8px; }

/* ── BP-SIG-7: ミニカレンダー ── */
.mini-cal { max-width: 260px; }
.cal-title { font-size: var(--fs-2); color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 10px; color: var(--text-2); padding: 2px 0; }
.cal-cell { position: relative; aspect-ratio: 1; display: grid; place-items: center; font-size: 11px; color: var(--text-1); border-radius: 6px; }
.cal-cell.empty { visibility: hidden; }
.cal-cell.today { outline: 1.5px solid var(--accent); }
.cal-cell.marked { color: var(--accent); font-weight: 700; }
.cal-dot { position: absolute; bottom: 2px; width: 4px; height: 4px; border-radius: 999px; background: var(--accent); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head .cal-title { margin-bottom: 0; }
/* FT-31 accent 塗りカレンダーカード（参照2型・白文字・当日/選択日=白地ピル・月ナビ矢印円24） */
.mini-cal.filled { background: var(--accent); color: var(--on-accent); border-radius: var(--radius-lg); padding: 16px; max-width: 320px; }
.mini-cal.filled .cal-title { color: var(--on-accent); font-weight: 700; }
.mini-cal.filled .cal-navs { display: flex; gap: 6px; }
.mini-cal.filled .cal-nav { width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: color-mix(in srgb, var(--on-accent) 18%, transparent); color: var(--on-accent); font-size: 14px; }
.mini-cal.filled .cal-wd { color: color-mix(in srgb, var(--on-accent) 60%, transparent); }
.mini-cal.filled .cal-cell { color: var(--on-accent); }
.mini-cal.filled .cal-cell.today, .mini-cal.filled .cal-cell.marked { background: var(--on-accent); color: var(--accent); font-weight: 700; border-radius: 999px; outline: none; }

/* FT-30 フィルタピル型セレクタ（「ラベル: 値 ▾」・高36・radius999・dark=1段明地/light=ヘアライン枠） */
.filter-pill-wrap { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.filter-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-1); font: inherit; font-size: var(--fs-3); font-weight: 400; cursor: pointer; }
:root[data-theme="dark"] .filter-pill { border-color: transparent; background: var(--surface-raised); }
.filter-pill:hover { background: var(--hover-bg); }
.filter-pill .fp-label { color: var(--text-2); }
.filter-pill .fp-label::after { content: ':'; }
.filter-pill .fp-value { color: var(--text-1); font-weight: 600; }
.filter-pill .fp-chev { color: var(--text-2); font-size: 11px; }
.fp-editor { display: flex; gap: var(--space-2); align-items: center; }
.fp-editor[hidden] { display: none; }
.fp-editor input { width: auto; min-width: 220px; }

/* ── BP-SIG-9: チップ横タイムライン ── */
.chip-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.chip-timeline li { display: flex; align-items: center; gap: 10px; padding: 8px 2px; }
.ct-date { width: 74px; flex: none; font-size: var(--fs-1); color: var(--text-2); }
.ct-line { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); flex: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.ct-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ct-chip { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-1); padding: 3px 10px; border-radius: var(--radius-pill); background: var(--bg-muted); color: var(--text-2); }
.ct-chip.tone-ok { background: var(--ok-soft); color: var(--ok); }
.ct-chip.tone-warn { background: var(--warn-soft); color: var(--warn); }
.ct-chip.tone-err { background: var(--err-soft); color: var(--err); }
.ct-chip b { font-variant-numeric: tabular-nums; }

/* ── BP-SIG-10: ドット行列 ── */
.dot-matrix { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; max-width: 240px; } /* 既定10列・data-cols で CSSOM 上書き */
.dm-dot { aspect-ratio: 1; border-radius: 3px; background: var(--bg-muted); }
.dm-dot.on { background: var(--accent); }
.dm-label { margin-top: 8px; font-size: var(--fs-3); font-weight: 700; }
.dm-total { color: var(--text-2); font-weight: 400; }

/* ── BP-SIG-12: 履歴テーブル（FT-17: 行高52・ヘアライン・右揃え数値） ── */
.history-table { list-style: none; margin: 0; padding: 0; }
.ht-row { display: flex; align-items: center; gap: 10px; height: var(--row-h); border-top: 1px solid var(--line); padding: 0 4px; }
.ht-row:first-child { border-top: none; }
.ht-ico { color: var(--text-2); display: inline-flex; flex: none; }
.ht-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-when { color: var(--text-2); font-size: var(--fs-1); white-space: nowrap; margin-left: auto; text-align: right; }

/* ── BP-SIG-13: セグメントカラム ── */
.seg-column { display: flex; gap: var(--space-3); align-items: flex-end; height: 150px; padding-top: var(--space-3); }
.seg-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.seg-track { flex: 1; width: 100%; max-width: 48px; display: flex; align-items: flex-end; background: var(--bg-muted); border-radius: var(--radius-sm); overflow: hidden; }
.seg-fill { width: 100%; height: 0; background: var(--accent); border-radius: var(--radius-sm) var(--radius-sm) 0 0; display: grid; place-items: start center; padding-top: 4px; min-height: 18px; }
.seg-pct { font-size: 10px; font-weight: 700; color: var(--surface); }
/* FT-23 明るい cat 塗り（ミント/ライム/琥珀）上の % ラベルは可読な濃色に */
.seg-fill.bg-cat3 .seg-pct, .seg-fill.bg-cat4 .seg-pct, .seg-fill.bg-cat5 .seg-pct { color: var(--text-1); }
.seg-lab { font-size: var(--fs-1); color: var(--text-2); text-align: center; }

/* ── BP-UX-6: 空状態 ── */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: var(--space-6) var(--space-4); text-align: center; }
.es-ico { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: var(--bg-muted); color: var(--text-2); }
.es-ico svg { width: 24px; height: 24px; }
.es-title { color: var(--text-2); margin: 0; }
.es-cta { margin-top: 4px; }
.empty-inline { color: var(--text-2); }

/* ── BP-UX-7: skeleton（loading 用・FT-12 の接続待ちゴーストは trend-frame） ── */
.sk-line { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-muted), var(--line), var(--bg-muted)); background-size: 200% 100%; animation: sk 1.3s ease-in-out infinite; margin: 6px 0; }
.sk-line.tall { height: 30px; } .sk-line.w15 { width: 15%; } .sk-line.w30 { width: 30%; } .sk-line.w40 { width: 40%; } .sk-line.w50 { width: 50%; } .sk-line.w60 { width: 60%; } .sk-line.w70 { width: 70%; } .sk-line.w80 { width: 80%; }
.sk-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.sk-dot { width: 28px; height: 28px; border-radius: 999px; background: var(--bg-muted); flex: none; }
.card.sk { pointer-events: none; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── BP-UX-4: ⌘K コマンドパレット ── */
.cmdk { display: none; position: fixed; inset: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(2px); }
.cmdk.on { display: grid; place-items: start center; padding-top: 12vh; }
.cmdk-panel { width: min(560px, 92vw); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.cmdk-input-row { display: flex; align-items: center; gap: 10px; padding: 14px var(--space-5); border-bottom: 1px solid var(--line); color: var(--text-2); }
#cmdk-input { border: none; background: transparent; font-size: var(--fs-4); padding: 0; }
#cmdk-input:focus { outline: none; }
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); cursor: pointer; }
.cmdk-item.sel { background: var(--accent-soft); }
.cmdk-ico { color: var(--accent); display: inline-flex; }
.cmdk-lab { flex: 1; }
.cmdk-hint { font-size: var(--fs-1); color: var(--text-2); }
.cmdk-empty { padding: 16px; text-align: center; color: var(--text-2); }

/* ── 承認3段（BP-UX-8）トースト ── */
.cc-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 45; background: var(--text-1); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-size: var(--fs-3); box-shadow: var(--shadow-card); display: none; align-items: center; gap: 8px; }
.cc-toast.show { display: inline-flex; }
.cc-toast.ok { background: var(--ok); color: var(--surface); }
.cc-toast.err { background: var(--err); color: var(--surface); }
.approve-dialog { position: fixed; inset: 0; z-index: 44; background: color-mix(in srgb, var(--bg) 55%, transparent); display: none; place-items: center; padding: var(--space-4); }
.approve-dialog.on { display: grid; }
.approve-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; width: min(400px, 92vw); box-shadow: var(--raised-shadow); }
.approve-card h3 { margin: 0 0 8px; font-size: var(--fs-4); }
.approve-card .ad-body { color: var(--text-2); font-size: var(--fs-3); margin-bottom: var(--space-4); }
.approve-card .ad-actions { display: flex; gap: var(--space-2); justify-content: flex-end; }

/* ── 2カラム分割（FT-3: 統計分割の区切り=ヘアライン縦線） ── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.split-3 { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-4); }
.section .split > div + div, .section .split-3 > div + div { border-left: 1px solid var(--divider); padding-left: var(--space-4); }
@media (max-width: 900px) {
  .split, .split-3 { grid-template-columns: 1fr; }
  .section .split > div + div, .section .split-3 > div + div { border-left: none; padding-left: 0; }
}
.section h2 .sec-sub, .sec-head h2 .sec-sub { font-weight: 400; font-size: var(--fs-1); color: var(--text-2); margin-left: 8px; }

/* ── CSP style-src 'self' 準拠: 動的色は tone クラス（var() は CSS 内でのみ・inline style 不使用） ── */
.fill-accent { fill: var(--accent); } .fill-accent2 { fill: var(--accent-2); }
.fill-info { fill: var(--info); } .fill-ok { fill: var(--ok); } .fill-warn { fill: var(--warn); } .fill-err { fill: var(--err); }
.stroke-accent { stroke: var(--accent); } .stroke-accent2 { stroke: var(--accent-2); }
.stroke-info { stroke: var(--info); } .stroke-ok { stroke: var(--ok); } .stroke-warn { stroke: var(--warn); } .stroke-err { stroke: var(--err); }
.bg-accent { background: var(--accent); } .bg-accent2 { background: var(--accent-2); }
.bg-info { background: var(--info); } .bg-ok { background: var(--ok); } .bg-warn { background: var(--warn); } .bg-err { background: var(--err); }
.dot.d-accent { background: var(--accent); } .dot.d-accent2 { background: var(--accent-2); }
.dot.d-info { background: var(--info); } .dot.d-ok { background: var(--ok); } .dot.d-warn { background: var(--warn); }
.dot.d-err { background: var(--err); }
.seg-fill.bg-accent2, .lb-fill.bg-accent2 { background: var(--accent-2); }
/* FT-23 カテゴリ配色 tone クラス（複数系列チャート・凡例・種別別バー・stacked bar 専用・lavender-wash 根絶） */
.fill-cat1 { fill: var(--cat-1); } .fill-cat2 { fill: var(--cat-2); } .fill-cat3 { fill: var(--cat-3); } .fill-cat4 { fill: var(--cat-4); } .fill-cat5 { fill: var(--cat-5); }
.stroke-cat1 { stroke: var(--cat-1); } .stroke-cat2 { stroke: var(--cat-2); } .stroke-cat3 { stroke: var(--cat-3); } .stroke-cat4 { stroke: var(--cat-4); } .stroke-cat5 { stroke: var(--cat-5); }
.bg-cat1 { background: var(--cat-1); } .bg-cat2 { background: var(--cat-2); } .bg-cat3 { background: var(--cat-3); } .bg-cat4 { background: var(--cat-4); } .bg-cat5 { background: var(--cat-5); }
.dot.d-cat1 { background: var(--cat-1); } .dot.d-cat2 { background: var(--cat-2); } .dot.d-cat3 { background: var(--cat-3); } .dot.d-cat4 { background: var(--cat-4); } .dot.d-cat5 { background: var(--cat-5); }
.seg-fill.bg-cat1 { background: var(--cat-1); } .seg-fill.bg-cat2 { background: var(--cat-2); } .seg-fill.bg-cat3 { background: var(--cat-3); } .seg-fill.bg-cat4 { background: var(--cat-4); } .seg-fill.bg-cat5 { background: var(--cat-5); }
.row-chip.tone-cat1 { background: var(--cat-1-soft); color: var(--cat-1); } .row-chip.tone-cat2 { background: var(--cat-2-soft); color: var(--cat-2); }
.row-chip.tone-cat3 { background: var(--cat-3-soft); color: var(--cat-3); } .row-chip.tone-cat4 { background: var(--cat-4-soft); color: var(--cat-4); } .row-chip.tone-cat5 { background: var(--cat-5-soft); color: var(--cat-5); }
/* 軽量ユーティリティ余白（inline style 置換） */
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.my-3 { margin: var(--space-3) 0; }

/* SVG stroke ユーティリティ（gauge 目盛/背景弧・trend-frame 罫線） */
.stroke-line { stroke: var(--line); }
.stroke-muted { stroke: var(--bg-muted); }

/* VM-ICON: ボタン内 inline SVG の整列 */
button .ico-svg, .btn .ico-svg { vertical-align: -4px; }

/* KPI hero の長数値は tabular + 自動縮小せず折り返さない（数値は2dp整形済） */
.kpi-card.hero .num.kpi { overflow-wrap: normal; word-break: keep-all; }

/* FT-11⑤ 極薄ドットグリッド地（1画面1箇所・主役チャートの背景） */
.dotgrid {
  background-image: radial-gradient(circle, var(--grid-line) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* §134 工程ボード: 案件ごとの5段ステップバー（FT-24 再設計） */
.step-flow { list-style: none; display: flex; gap: 4px; margin: 8px 0 0; padding: 0; }
.step-flow li { flex: 1; display: flex; flex-direction: column; gap: 3px; }
/* FT-24: 未到達段=中立track（紫tint禁止）・完了段=accent実色・現在段=accent */
.step-flow li i { display: block; height: 6px; border-radius: 999px; background: var(--bg-muted); }
.step-flow li.sf-done i { background: var(--accent); }
.step-flow li.sf-cur i { background: var(--accent); }
/* FT-24: 段名ラベルは現在段のみ（5段ラベルの全行反復を廃止） */
.step-flow li span { display: none; font-size: 10px; color: var(--text-2); text-align: center; }
.step-flow li.sf-cur span { display: block; color: var(--accent); font-weight: 700; }

/* 案件ボード行（C-home 進行状況の個票 + 5段） */
.board-list { list-style: none; margin: 0; padding: 0; }
.board-row { padding: 10px 4px; border-top: 1px solid var(--line); }
.board-row:first-child { border-top: none; }
.br-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.br-name { font-size: var(--fs-3); }
.br-head .ht-when { margin-left: auto; color: var(--text-2); font-size: var(--fs-1); }

/* FT-34 案件行（行内多段メーターを廃し FT-10チップ＋タイトル＋現在段ピル＋右端時刻） */
.case-list { list-style: none; margin: 0; padding: 0; }
.case-row { display: flex; align-items: center; gap: 10px; height: var(--row-h); border-top: 1px solid var(--line); padding: 0 4px; }
.case-row:first-child { border-top: none; }
.case-row .br-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-3); }
.case-row .ht-when { color: var(--text-2); font-size: var(--fs-1); white-space: nowrap; flex: none; }
.case-list details.fold summary { padding-left: 4px; }

/* FT-36 c-home 右レール（最近の動き＋ご確認いただいた履歴3件を縦積み・空白の谷を解消） */
.home-rail { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.home-rail .section { margin: 0; }

/* FT-39 s-agents 行解剖: 下線リンク露出を廃止・行全体クリック・部門群見出し・部門内fold */
.ag-group-head { margin-top: var(--space-3); }
.ag-group-head:first-child { margin-top: 0; }
.agent-list { list-style: none; margin: 0; padding: 0; }
.agent-li { border-top: 1px solid var(--line); }
.agent-li:first-child { border-top: none; }
.agent-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; text-decoration: none; color: var(--text-1); }
.agent-row:hover { background: var(--hover-bg); }
.agent-row .ag-name { font-size: var(--fs-3); color: var(--text-1); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.agent-row:hover .ag-name { text-decoration: underline; } /* 常時下線なし・hover 時のみ可 */
.agent-row .ag-llm { margin-left: auto; color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 44%; flex: none; }

/* VM-MAP: ヒートマップ（テナント×部署・セル5値 lv-0..4・lv-na=接続待ちハッチ） */
.heatmap { display: flex; flex-direction: column; gap: 4px; }
.hm-row { display: flex; align-items: center; gap: 8px; }
.hm-lab { width: 96px; flex: none; font-size: var(--fs-1); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-cells { display: grid; gap: 4px; flex: 1; grid-template-columns: repeat(6, 1fr); }
.hm-col { font-size: 10px; color: var(--text-2); text-align: center; }
.hm-cell { height: 22px; border-radius: 4px; background: var(--bg-muted); }
.hm-cell.lv-0 { background: var(--bg-muted); }
.hm-cell.lv-1 { background: color-mix(in srgb, var(--accent) 25%, var(--surface)); }
.hm-cell.lv-2 { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.hm-cell.lv-3 { background: color-mix(in srgb, var(--accent) 70%, var(--surface)); }
.hm-cell.lv-4 { background: var(--accent); }
.hm-cell.lv-na { background: repeating-linear-gradient(45deg, var(--bg-muted), var(--bg-muted) 4px, var(--surface) 4px, var(--surface) 8px); }
.hm-note { color: var(--text-2); font-size: var(--fs-1); margin: 6px 0 0; }

/* FT-12 ゴースト骨格（源未接続・破線/中央文言を廃し実チャート同寸の静止骨格+右下注記） */
.trend-frame { position: relative; }
.trend-frame svg { width: 100%; height: 150px; display: block; }
.tf-line { stroke: var(--text-2); opacity: .3; }
.tf-area { fill: var(--bg-muted); opacity: .55; }
.tf-note {
  position: absolute; right: 10px; bottom: 6px; color: var(--text-2);
  font-size: var(--fs-1); text-align: right; max-width: 70%;
}

/* VM-RULE-3: C-actions 個票の折畳み（N連を最上段に置かない） */
details.fold { border-top: 1px solid var(--line); margin-top: var(--space-2); }
details.fold summary { cursor: pointer; padding: 12px 4px; color: var(--accent); font-weight: 600; list-style: none; min-height: var(--tap-min); display: flex; align-items: center; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::before { content: '▸'; margin-right: 6px; }
details.fold[open] summary::before { content: '▾'; }
.fold-head { font-size: var(--fs-2); color: var(--err); margin: var(--space-3) 0 4px; }

/* 最近の動き: 当日種別ミニ棒の余白 */
.mini-summary { margin-bottom: var(--space-3); }

/* ── PACK-CMDC-UXF-A SEG-1 ─────────────────────────────────────────────── */
/* FT-43 タップ標的: 円形36アイコンボタンのヒット領域を44×44へ（視覚寸法はFT-2のまま・擬似要素で拡張） */
.icon-btn::after { content: ''; position: absolute; inset: -4px; border-radius: inherit; }

/* FT-41 行アクション（成果物行）: 右端の常置クラスタ（hover出現に依存しない・可視3まで） */
.row-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.row-actions .secondary { min-height: 32px; padding: 4px 12px; position: relative; }
.row-actions .secondary::after { content: ''; position: absolute; inset: -6px 0; }
.row-title { overflow-wrap: anywhere; }
.list .when { margin-left: auto; }
.list .row-actions { margin-left: 0; }
.row-menu { position: relative; flex: none; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-panel {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 180px;
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); padding: 6px; display: grid;
}
.row-menu-panel button {
  background: transparent; border: none; color: var(--text-1); text-align: left;
  padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 500; min-height: 40px;
}
.row-menu-panel button:hover { background: var(--hover-bg); }

/* FT-42 確認/入力ダイアログ: 対象名の再掲・danger変種・既定フォーカス=キャンセル（parts.js modal が担保） */
.cc-modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(2px);
}
.cc-modal-panel {
  width: min(440px, 92vw); background: var(--surface-raised); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: var(--space-5); display: grid; gap: 12px;
}
.cc-modal-title { font-size: 15px; font-weight: 600; margin: 0; }
.cc-modal-target { font-weight: 600; margin: 0; padding: 8px 12px; background: var(--hover-bg); border-radius: var(--radius-md); overflow-wrap: anywhere; }
.cc-modal-body { display: grid; gap: 8px; font-size: 14px; }
.cc-modal-body p { margin: 0; }
.cc-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
button.danger { background: var(--err); border-color: var(--err); color: var(--surface); }
button.danger:hover:not(:disabled) { filter: brightness(0.92); }

/* FT-40.4 インライン形式検証（欄の直下） */
.field-note { color: var(--err); font-size: 0.8rem; margin: 2px 0 0; }

/* ── UXF-E SEG-E0 ─────────────────────────────────────────────────────────── */
/* E-A3 (FT-61-3): 状態文言の色調=意味。field-note 既定は err — 進捗/成功は明示クラスで上書き */
.field-note.plain { color: var(--text-2); }
.field-note.ok { color: var(--ok); }
/* FT-49-2 必須残数ガイド: 肯定的案内をエラー色で出さない (E-A3)。揃ったら ok トーン */
.field-guide { color: var(--text-2); font-size: 0.8rem; margin: 2px 0 0; }
.field-guide.done { color: var(--ok); }

/* E-A2 (FT-61-2): ブラウザ autofill 装飾のテーマ整合上書き — ダークテーマで白発光させない。
   background は inset shadow でトークン色に塗り潰し、文字/caret もトークンで指定 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--text-1);
  caret-color: var(--text-1);
  transition: background-color 999999s ease-out 0s;
}
input:autofill {
  box-shadow: 0 0 0 1000px var(--surface) inset;
}

/* E-A5: 編集中の保存はページ下の固定保存バーに一本化 — セクション内保存ボタンは経路として残し非表示 */
.cc-save-hidden { display: none; }

/* FT-57 表示モード: 読み取り専用の値リスト＋最終保存時刻＋「編集」 */
.cc-view .view-list { display: grid; gap: 0; margin: 10px 0; }
.cc-view .vrow {
  display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: var(--space-3);
  padding: 8px 0; border-bottom: 1px solid var(--divider); align-items: baseline;
}
.cc-view .vrow:last-child { border-bottom: none; }
.cc-view dt { font-size: .85rem; color: var(--text-2); margin: 0; }
.cc-view dd { font-size: .95rem; color: var(--text-1); margin: 0; overflow-wrap: anywhere; }
.cc-view dd.is-empty { color: var(--text-2); }
.cc-view .view-meta { color: var(--text-2); font-size: .8rem; margin: 8px 0 0; }
.cc-view .form-actions { margin-top: 10px; }
.cc-view .form-actions button { width: auto; }

/* FT-58 フォルダ型書類ライブラリ: フォルダカードのグリッド */
.folder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3); margin: 10px 0 0;
}
.folder-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: var(--space-4); min-height: 112px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  color: var(--text-1); cursor: pointer; transition: background var(--tr), border-color var(--tr);
  font: inherit; text-decoration: none;
}
button.folder-card { width: 100%; }
.folder-card:hover { background: var(--hover-bg); border-color: var(--accent); }
.folder-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.folder-card .fc-ico { color: var(--accent); display: inline-flex; }
.folder-card .fc-ico svg { width: 22px; height: 22px; }
.folder-card .fc-name { font-weight: 600; font-size: .9rem; line-height: 1.35; }
.folder-card .fc-sub { font-size: .75rem; color: var(--text-2); line-height: 1.4; }
.folder-card .fc-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.folder-card .fc-count { font-size: .78rem; color: var(--text-2); }
.folder-card-preparing { cursor: default; }
.folder-card-preparing:hover { background: var(--surface); border-color: var(--line); }
.folder-card-link .fc-ico { color: var(--info); }

/* FT-58-2 フォルダ内ビュー: パンくず＋ファイル行＋その場アップロード＋受入種別/上限の明示 */
.folder-view .crumbs { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .9rem; }
.folder-view .crumb-back {
  background: transparent; border: none; color: var(--accent); cursor: pointer; padding: 4px 6px;
  border-radius: var(--radius-sm); font: inherit; font-weight: 600; min-height: 32px;
}
.folder-view .crumb-back:hover { background: var(--hover-bg); }
.folder-view .crumb-sep { color: var(--text-2); }
.folder-view .fv-head { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.folder-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-4); margin: var(--space-3) 0 0; color: var(--text-2);
  transition: border-color var(--tr), background var(--tr);
}
.folder-drop.dropping { border-color: var(--accent); background: var(--hover-bg); }
.folder-drop .fd-note { font-size: .82rem; }
.folder-drop button { width: auto; }
.fv-accept { color: var(--text-2); font-size: .8rem; margin: 8px 0 0; }

/* FT-58 モバイル挙動 (~380px): 表示リストは縦積み・フォルダグリッドは1列縦積み
   (CTO検品是正 2026-07-15: 2列では窮屈・カード内折返し多発 — カード全幅で名前/状態を1行に収める) */
@media (max-width: 480px) {
  .cc-view .vrow { grid-template-columns: 1fr; gap: 2px; }
  .folder-grid { grid-template-columns: 1fr; }
  .folder-view .crumbs { flex-wrap: wrap; }
}

/* FT-57 の表示⇄編集切替は hidden 属性で行う — display 指定クラス (.login-form 等) が
   UA の [hidden] 規則を上書きして「隠れない」事故を構造で封じる */
[hidden] { display: none !important; }

/* ── SCUX-241 SEG-2: S1 カード（部門タブ最上部・fixture verdict/metrics の byte 不変表示） ── */
.s1-card { background: var(--bg-muted); border-radius: var(--radius-md); padding: var(--space-4); margin: var(--space-3) 0; }
.s1-head { display: flex; align-items: center; gap: 10px; }
.s1-period { color: var(--text-2); font-size: .82rem; }
.s1-text { margin: 8px 0 0; color: var(--text-2); }
.s1-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.s1-metric .s1-label { color: var(--text-2); font-size: .78rem; }
.s1-metric .s1-value { font-size: 1.5rem; font-weight: 700; }
.s1-metric .s1-unit { font-size: .82rem; font-weight: 400; color: var(--text-2); margin-left: 2px; }

/* ── SCUX-241 SEG-3: 金額主役化（demo メーター実額 hero）＋予算インライン設定 ── */
.hero-amount { font-size: 2.2rem; font-weight: 800; margin: 4px 0 0; }
.hero-breakdown { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-3); }
.budget-inline { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: var(--space-3); }
.budget-inline label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--text-2); }
.budget-inline input { width: 180px; }
.budget-inline button { width: auto; }

/* ── SCUX-242 SEG-1: KPI セグのリンク化（タップ導線） ── */
a.kpi-seg.kpi-link { color: inherit; text-decoration: none; }
a.kpi-seg.kpi-link:hover { background: var(--hover-bg); }
.svc-stages { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── SCUX-242 SEG-2: インラインビューア＋検索・絞り込み ── */
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: var(--space-3) 0; }
.filter-bar label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--text-2); }
.filter-bar select { width: auto; min-width: 140px; }
button.row-title-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-align: left; cursor: pointer; text-decoration: underline; }
.cc-viewer { width: min(80vw, 960px); height: 70vh; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg); }
.row-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: var(--radius-sm); }

/* ── SCUX-242 SEG-3: C7 予定 ── */
.sched-day { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
#sched-views button.tab { cursor: pointer; }

/* ══ SCUX-244 §UI詳細仕様 v1.1 — 視覚系統一（U-1〜U-8・値は全て tokens.css 由来・生px色ゼロ）══ */

/* U-1 基盤: コンテナ幅・グリッド・角丸・境界線（影なし＝階層は字重と余白で作る） */
.shell-main .main { max-width: var(--u-container); padding: var(--u-sec-gap) var(--u-pad-x) 60px; }
.u-scorecards, .u-dept-grid, .u-zone3 { display: grid; gap: var(--u-col-gap); margin-bottom: var(--u-sec-gap); }
.section.u-zone2, .section.u-upcoming, .section.u-recent { border-radius: var(--u-radius); padding: var(--u-card-pad); }

/* U-2 判定色: ①バッジ（10%淡地+同色文字・文字ラベル併記）②左縁3px アクセント。他に意味色を使わない */
.u-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: var(--u-fs-label); font-weight: 600; white-space: nowrap;
}
.u-badge.j-good { background: var(--judge-good-soft); color: var(--judge-good); }
.u-badge.j-fine { background: var(--judge-fine-soft); color: var(--judge-fine); }
.u-badge.j-watch { background: var(--judge-watch-soft); color: var(--judge-watch); }
.u-badge.j-act { background: var(--judge-act-soft); color: var(--judge-act); }
/* 左縁3px は カード/セクションの 1px 枠より後に解決させる（.u-dept/.u-s1 の border 指定へ確実に勝たせる） */
.u-dept.j-good, .u-s1.j-good, .j-good { border-left: var(--u-accent-bar) solid var(--judge-good); }
.u-dept.j-fine, .u-s1.j-fine, .j-fine { border-left: var(--u-accent-bar) solid var(--judge-fine); }
.u-dept.j-watch, .u-s1.j-watch, .j-watch { border-left: var(--u-accent-bar) solid var(--judge-watch); }
.u-dept.j-act, .u-s1.j-act, .j-act { border-left: var(--u-accent-bar) solid var(--judge-act); }
/* delta チップ: 矢印+数値の二重伝達（増=緑▲・減=赤▼・±0=muted→） */
.u-delta { margin-left: auto; font-size: var(--u-fs-label); font-weight: 600; white-space: nowrap; }
.u-delta.up { color: var(--pos); }
.u-delta.down { color: var(--neg); }
.u-delta.flat { color: var(--text-2); }

/* U-3 KPI タイル解剖: label12 → value28(tabular)+unit13+delta → ミニスパーク h28 */
.u-tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--u-tile-min), 1fr)); gap: var(--u-col-gap); }
.u-tile { min-width: 0; }
.u-tile-label { font-size: var(--u-fs-label); font-weight: 400; color: var(--text-2); }
.u-tile-vrow { display: flex; align-items: baseline; gap: 4px; margin-top: 2px; }
.u-tile-value { font-size: var(--u-fs-kpi); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.u-tile.hero .u-tile-value { font-size: var(--u-fs-hero); }
.u-tile-unit { font-size: var(--u-fs-unit); font-weight: 400; color: var(--text-2); }
.u-tile-note { font-size: var(--u-fs-label); color: var(--text-2); margin-top: 4px; }
.u-tile-spark { display: block; height: var(--u-spark-h); margin-top: 6px; color: var(--accent); }
.u-tile-spark .spark { width: 100%; height: var(--u-spark-h); }

/* U-5-2 Zone1 スコアカード3 */
.u-scorecards { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.u-score {
  display: block; background: var(--surface); border: var(--u-border) solid var(--line);
  border-radius: var(--u-radius); padding: var(--u-card-pad); color: inherit; text-decoration: none;
}
a.u-score:hover { background: var(--hover-bg); }

/* U-4 部門カード解剖（左縁3px=判定色・5段積層） */
.u-dept-grid { margin-bottom: 0; }
.u-dept {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  background: var(--surface); border: var(--u-border) solid var(--line); border-radius: var(--u-radius);
  padding: var(--u-card-pad); color: inherit; text-decoration: none;
}
.u-dept:hover { background: var(--hover-bg); }
.u-dept-head { display: flex; align-items: center; gap: 8px; }
.u-dept-name { font-size: var(--u-fs-card); font-weight: 600; }
.u-dept-head .u-badge { margin-left: auto; }
.u-dept-hero { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; }
.u-dept-heroval { font-size: var(--u-fs-kpi); font-weight: 700; font-variant-numeric: tabular-nums; }
.u-dept-herounit { font-size: var(--u-fs-unit); color: var(--text-2); }
.u-dept-herolabel { font-size: var(--u-fs-label); color: var(--text-2); width: 100%; }
.u-dept-subs { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.u-dept-sub { display: flex; flex-direction: column; min-width: 0; }
.u-dept-sub b { font-size: var(--u-fs-card); font-weight: 600; font-variant-numeric: tabular-nums; }
.u-dept-sub .u-dept-subunit { font-size: var(--u-fs-aux); font-weight: 400; color: var(--text-2); font-style: normal; margin-left: 2px; }
.u-dept-sub span { font-size: var(--u-fs-aux); color: var(--text-2); }
.u-dept-spark { display: block; height: var(--u-spark-h); color: var(--accent); }
.u-dept-spark .spark { width: 100%; height: var(--u-spark-h); }
.u-dept-more { font-size: var(--u-fs-label); color: var(--accent); text-align: right; margin-top: auto; }

/* U-5-4 Zone3左 今後の予定（7列幅）／U-5-5 Zone3右 最近の動き（5列幅） */
.u-zone3 { grid-template-columns: 7fr 5fr; align-items: start; }
.u-uplist, .u-recent-list { list-style: none; margin: 0; padding: 0; }
.u-uprow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.u-uprow:first-child { border-top: none; }
.u-datechip {
  flex: none; font-size: var(--u-fs-label); font-variant-numeric: tabular-nums; color: var(--text-2);
  background: var(--bg-muted); border-radius: var(--radius-sm); padding: 2px 8px;
}
.u-pfchip {
  flex: none; font-size: var(--u-fs-aux); background: var(--u-pf-chip-bg); color: var(--text-2);
  border-radius: var(--radius-pill); padding: 2px 8px; white-space: nowrap;
}
.u-uprow-title {
  flex: 1 1 auto; min-width: 0; font-size: var(--u-fs-body);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.u-seeall { display: inline-block; margin-top: var(--space-3); font-size: var(--u-fs-label); color: var(--accent); }
.u-recent-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.u-recent-row:first-child { border-top: none; }
.u-recent-ico { flex: none; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.u-recent-ico .ico-svg { width: 16px; height: 16px; }
.u-recent-ico.tone-ok { color: var(--ok); }
.u-recent-ico.tone-warn { color: var(--warn); }
.u-recent-ico.tone-err { color: var(--err); }
.u-recent-title { flex: 1 1 auto; min-width: 0; font-size: var(--u-fs-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-recent-kind { flex: none; font-size: var(--u-fs-aux); color: var(--text-2); background: var(--bg-muted); border-radius: var(--radius-pill); padding: 1px 7px; }
.u-recent-when { flex: none; font-size: var(--u-fs-aux); color: var(--text-2); font-variant-numeric: tabular-nums; }

/* U-6 成果レポート: S1ヒーロー（左縁=判定色）・線チャート・稼働1行・一覧コンパクト40px */
.u-s1 { border-left: var(--u-accent-bar) solid var(--line); padding-left: var(--space-4); margin-bottom: var(--space-4); }
.u-s1-head { display: flex; align-items: center; gap: 10px; }
.u-s1-period { font-size: var(--u-fs-label); color: var(--text-2); font-variant-numeric: tabular-nums; }
.u-s1-text { font-size: var(--u-fs-card); font-weight: 400; margin: 8px 0 var(--space-4); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.u-linechart { width: 100%; height: var(--u-chart-h); color: var(--accent); }
.u-linechart .lc-dot { fill: currentColor; }
.u-linechart .lc-end { fill: var(--text-1); font-size: var(--u-fs-label); font-weight: 600; }
.u-linechart .axis-x { fill: var(--text-2); font-size: var(--u-fs-aux); }
.u-chart-none { font-size: var(--u-fs-body); color: var(--text-2); margin: var(--space-3) 0; }
.u-cadence { font-size: var(--u-fs-body); color: var(--text-2); margin: var(--space-4) 0; font-variant-numeric: tabular-nums; }
.u-artlist { list-style: none; margin: 0; padding: 0; }
.u-artrow { display: flex; align-items: center; gap: 10px; min-height: var(--u-row-h); border-top: 1px solid var(--line); }
.u-artrow:first-child { border-top: none; }
.u-artrow-title { flex: 1 1 auto; min-width: 0; font-size: var(--u-fs-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-artrow-when { flex: none; font-size: var(--u-fs-label); color: var(--text-2); font-variant-numeric: tabular-nums; }
.u-sec-title { font-size: var(--u-fs-sec); font-weight: 700; }

/* U-7 予定仕上げ: pending 最上部固定（琥珀縁）・月ビューのセル・今日セル */
.u-pending-top { border-left: var(--u-accent-bar) solid var(--judge-watch); }
.u-monthgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.u-mcell {
  min-height: 64px; border: var(--u-border) solid var(--line); border-radius: var(--radius-sm);
  padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.u-mcell.today { border-color: var(--accent); }
.u-mcell-d { font-size: var(--u-fs-aux); color: var(--text-2); font-variant-numeric: tabular-nums; }
.u-mcell-n { font-size: var(--u-fs-aux); background: var(--bg-muted); border-radius: var(--radius-pill); padding: 0 6px; align-self: flex-start; }
.u-mcell-t { font-size: var(--u-fs-aux); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* U-8 ご請求ヒーローを U-3 体裁へ（値34px・内訳チップ12px） */
.hero-amount { font-size: var(--u-fs-hero); font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-breakdown .state { font-size: var(--u-fs-label); }

/* mobile（390px）: 全カード1列・左右padding 16・カード内padding 16 */
@media (max-width: 700px) {
  .shell-main .main { padding: var(--space-4) var(--u-pad-x-m) calc(76px + env(safe-area-inset-bottom)); }
  .u-zone3, .u-scorecards, .u-dept-grid { grid-template-columns: 1fr; }
  .section.u-zone2, .section.u-upcoming, .section.u-recent, .u-score, .u-dept { padding: var(--u-card-pad-m); }
  .u-monthgrid { grid-template-columns: repeat(4, 1fr); }
  /* 390px では 1 行 4 要素に題を収めると数文字で切れるため、題のみ次行へ送る（省略は維持） */
  .u-uprow { flex-wrap: wrap; }
  .u-uprow-title { order: 9; width: 100%; flex-basis: 100%; }
}

/* ══ SCUX-245 SEG-1: AVIS 相談導線（リンク型 v1・埋込は CC_SSO 設計後の別便）══ */

/* A-12 desktop: ピル型（アイコン＋ラベル・高さ44・padding横16・右下 24/24 固定・影なし・境界1px） */
.avis-fab {
  position: fixed; right: var(--avis-fab-inset); bottom: var(--avis-fab-inset);
  z-index: var(--z-avis-fab);
  height: var(--avis-fab-h); padding: 0 var(--avis-fab-pad-x);
  display: inline-flex; align-items: center; gap: var(--space-2);
  border: var(--u-border) solid var(--accent); border-radius: var(--radius-pill);
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  font-size: var(--u-fs-body); font-weight: 600; box-shadow: none;
}
.avis-fab:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.avis-fab .ico-svg { width: var(--icon-sz); height: var(--icon-sz); }
.avis-fab-ico { display: inline-flex; align-items: center; }

/* A-12 mobile（〜768px）: 円形52px・アイコンのみ・右下 16/16・下部ナビ/セーフエリアと非干渉 */
@media (max-width: 768px) {
  .avis-fab {
    right: var(--avis-fab-inset-m);
    bottom: calc(var(--avis-fab-inset-m) + var(--tabbar-h) + env(safe-area-inset-bottom));
    width: var(--avis-fab-d-m); height: var(--avis-fab-d-m); padding: 0;
    justify-content: center; border-radius: 50%;
  }
  .avis-fab-tx { display: none; }
}

/* A-13 文脈導線: 素のテキストリンク（identity/文脈 param を持たない） */
.avis-req { font-size: var(--u-fs-body); color: var(--accent); text-decoration: none; white-space: nowrap; }
.avis-req:hover { text-decoration: underline; }

/* ══ SCUX-246 目視審査是正束（V-2 部門グリッド／V-5 Zone0 1行文）══
   色は tokens.css 由来のみ（生 hex ゼロ）。V-2 は列数を固定ブレークポイントで宣言する。 */

/* V-2（F-244-1 の確定処置）: auto-fit を捨て、列数を viewport で固定する。
   原因 = sidebar 248px 控除後の実効幅 ≈1100px に対し auto-fit minmax(230px) が 5 列に足りず
   4+1 の孤児（最終行 1 枚）になっていた。列数を宣言すれば実効幅に依らず孤児が構造的に消える。
   minmax(0,1fr) の 0 は「トラックが内容幅で押し広がらない」ための下限（採寸値ではない）。 */
@media (min-width: 1360px) { .u-dept-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 960px) and (max-width: 1359px) { .u-dept-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 959px) { .u-dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .u-dept-grid { grid-template-columns: minmax(0, 1fr); } }

/* V-5: Zone0 バッジ横の 1 行文（バッジと同一行・狭幅では折り返す） */
.u-zone0-line { margin-left: var(--space-3); font-size: var(--u-fs-body); color: var(--text-2); }
@media (max-width: 639px) {
  .u-zone0-line { display: block; margin-left: 0; margin-top: 6px; }
}
.avis-ask { font-size: var(--u-fs-label); color: var(--accent); text-decoration: none; margin-left: auto; white-space: nowrap; }
.avis-ask:hover { text-decoration: underline; }
.cc-modal-actions .avis-req { margin-right: auto; }
