/* =========================================================
   Noto Sans JP（ローカル同梱・閉域VPN対応 / 外部CDN不使用）
   ========================================================= */
@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-024F, U+2000-20CF, U+2100-214F, U+2190-21FF, U+2200-22FF;
}
@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/japanese-400-normal.woff2') format('woff2');
  unicode-range: U+3000-30FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
}
@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-024F, U+2000-20CF, U+2100-214F, U+2190-21FF, U+2200-22FF;
}
@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/japanese-500-normal.woff2') format('woff2');
  unicode-range: U+3000-30FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
}
@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-024F, U+2000-20CF, U+2100-214F, U+2190-21FF, U+2200-22FF;
}
@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/japanese-700-normal.woff2') format('woff2');
  unicode-range: U+3000-30FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
}

/* =========================================================
   MudBlazor タイポグラフィを Noto Sans JP に差し替え
   （このファイルは MudBlazor.min.css より後に読み込むこと）
   ========================================================= */
:root {
  --app-font: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', -apple-system,
    BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mud-typography-default-family: var(--app-font);
  --mud-typography-h1-family: var(--app-font);
  --mud-typography-h2-family: var(--app-font);
  --mud-typography-h3-family: var(--app-font);
  --mud-typography-h4-family: var(--app-font);
  --mud-typography-h5-family: var(--app-font);
  --mud-typography-h6-family: var(--app-font);
  --mud-typography-subtitle1-family: var(--app-font);
  --mud-typography-subtitle2-family: var(--app-font);
  --mud-typography-body1-family: var(--app-font);
  --mud-typography-body2-family: var(--app-font);
  --mud-typography-button-family: var(--app-font);
  --mud-typography-caption-family: var(--app-font);
  --mud-typography-overline-family: var(--app-font);
}

html, body {
  font-family: var(--app-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* =========================================================
   共通トークン（MudBlazor パレット変数を参照＝ライト/ダーク自動追従）
   ダイアログは .lb の外（body 直下）に出るため、.mud-dialog にも同じトークンを定義する
   （定義しないとダイアログの中で var(--lb-line) 等が空になり、罫線・背景が消える）。
   ========================================================= */
.lb, .mud-dialog {
  --lb-line: var(--mud-palette-lines-default);
  --lb-surface: var(--mud-palette-surface);
  --lb-muted: var(--mud-palette-text-secondary);
  --lb-ink: var(--mud-palette-text-primary);
  --lb-accent: var(--mud-palette-primary);
  --lb-accent-soft: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
  --lb-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
}

/* ---- ページヘッダ ---- */
.lb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.lb-title { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
/* Routes.razor の <FocusOnNavigate Selector="h1" /> は、ページ表示・遷移のたびに
   最初の h1 へプログラム的にフォーカスを移す（スクリーンリーダーの読み上げ起点）。
   このとき Blazor が h1 に tabindex="-1" を付けるため、ブラウザ標準のフォーカスリングが
   「ページタイトルの枠線」として見えてしまう。h1 はキーボード操作では到達できないので、
   フォーカス自体は残したまま輪郭だけ消す（読み上げ起点の挙動は維持される）。 */
h1:focus,
h1:focus-visible {
  outline: none;
}
.lb-sub { font-size: .85rem; color: var(--lb-muted); margin: 0; max-width: 60ch; word-break: auto-phrase; text-wrap: pretty; }

/* 集計軸・指標トグル（メーカー/業者/施設 × 値引き前/後/額）＋期間 */
.lb-controls { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; margin: 2px 0 20px; }
.lb-range { font-size: .78rem; color: var(--lb-muted); font-variant-numeric: tabular-nums; }

/* 値引き（負値）の強調表示。増減・伸び率はプラス側も色分けする（符号も併記して色に頼らない） */
.lb-neg { color: var(--mud-palette-error, #d1495b); }
.lb-pos { color: var(--mud-palette-success, #2e7d32); }
.lb-warn { color: var(--mud-palette-warning, #ed6c02); }
.lb-strong { font-weight: 700; }
.lb-badge-warn { background: color-mix(in srgb, var(--mud-palette-warning, #ed6c02) 16%, transparent); color: var(--mud-palette-warning, #ed6c02); }
.lb-link { color: var(--lb-accent); text-decoration: none; }
.lb-link:hover { text-decoration: underline; }
.lb-head-actions { display: flex; gap: 8px; align-items: center; }

/* ---- 汎用カード ---- */
.lb-card {
  background: var(--lb-surface);
  border: 1px solid var(--lb-line);
  border-radius: 14px;
  box-shadow: var(--lb-shadow);
}
.lb-card-head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 18px 6px; }
.lb-card-title { font-size: .92rem; font-weight: 700; margin: 0; }
.lb-muted { font-size: .72rem; color: var(--lb-muted); }

/* ---- カード見出し＋操作ツールバー（抽出条件の保存/呼び出し/クリア） ---- */
.lb-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.lb-toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 条件の保存・呼び出し専用バー（薄い背景で他フィルタと視覚的に分離） */
.lb-condbar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px 24px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--lb-accent-soft);
  border: 1px solid var(--lb-line);
  border-radius: 10px;
}
.lb-condbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lb-condbar-label { font-size: .72rem; font-weight: 700; color: var(--lb-muted); white-space: nowrap; }

/* ---- 折りたたみパネル（品目リスト管理など補助機能）: カード見た目に合わせる ---- */
.lb-panels { background: var(--lb-surface); overflow: hidden; }
.lb-panels.mud-expansion-panels .mud-expand-panel { background: transparent; }
.lb-panels .mud-expand-panel-text { padding: 0 20px 18px; }

/* =========================================================
   抽出条件エディタ（サイドスライドパネル + 複数選択フィルタ）
   ページ本体には条件サマリーだけを置き、入力はパネル側で行う。
   ========================================================= */

/* ---- 条件サマリー（ページ本体・クリックでパネルを開く） ---- */
.lb-condsum { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-condsum-item {
  display: inline-flex; flex-direction: column; gap: 1px;
  padding: 6px 12px; border: 1px solid var(--lb-line); border-radius: 10px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
  max-width: 100%;
}
.lb-condsum-item:hover, .lb-condsum-item:focus-visible { border-color: var(--lb-accent); background: var(--lb-accent-soft); }
.lb-condsum-k { font-size: .64rem; font-weight: 700; color: var(--lb-muted); letter-spacing: .02em; }
.lb-condsum-v { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; }
.lb-condrun { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* ---- スライドパネル ---- */
.lb-sp-scrim {
  position: fixed; inset: 0; z-index: 1140;
  background: rgba(16, 24, 40, .38);
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.lb-sp-scrim.is-open { opacity: 1; pointer-events: auto; }

.lb-sp {
  position: fixed; z-index: 1150; right: 0;
  top: var(--mud-appbar-height, 64px);
  height: calc(100vh - var(--mud-appbar-height, 64px));
  width: min(620px, 100vw);
  display: flex; flex-direction: column;
  background: var(--lb-surface); border-left: 1px solid var(--lb-line);
  box-shadow: -10px 0 34px rgba(16, 24, 40, .16);
  transform: translateX(101%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}
.lb-sp.is-open { transform: none; }
.lb-sp-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 14px 18px 12px; border-bottom: 1px solid var(--lb-line);
}
.lb-sp-title { font-size: 1rem; font-weight: 700; margin: 0 0 3px; }
.lb-sp-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.lb-sp-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--lb-line); background: var(--lb-surface);
}
.lb-sp-foot-actions { display: flex; align-items: center; gap: 8px; }

@media (max-width: 700px) {
  .lb-sp { width: 100vw; }
}

/* ---- 条件のグループ枠（年月・表示項目・集計軸） ---- */
.lb-fset { border: 1px solid var(--lb-line); border-radius: 12px; padding: 12px 14px 14px; }
.lb-fset-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.lb-fset-title { font-size: .8rem; font-weight: 700; }
.lb-fset-note { font-size: .7rem; color: var(--lb-muted); font-weight: 400; }

/* グループ枠の中をさらに区切る（設定ダイアログの「基本情報／対象範囲／…」）。
   罫線1本で区切りだけを示し、枠の入れ子で視線が散らからないようにする。 */
.lb-fsub { padding: 14px 0 6px; border-top: 1px solid var(--lb-line); }
.lb-fsub:first-of-type { padding-top: 2px; border-top: 0; }
.lb-fsub-title {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: .78rem; font-weight: 700; margin-bottom: 10px;
}

/* ---- セクション見出しの横並びタブ（フォーム・登録画面で共用） ----
   常に1区分だけを表示することで、区分が増えても画面が縦に伸び続けないようにする。 */
.lb-tabs { display: flex; gap: 4px; background: var(--mud-palette-background-gray); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.lb-tab-btn {
  flex: 1 1 0; appearance: none; border: none; cursor: pointer; font: inherit;
  font-size: .82rem; font-weight: 700; color: var(--mud-palette-text-secondary); background: transparent;
  padding: 9px 10px; border-radius: 8px;
}
.lb-tab-btn.is-active { background: var(--mud-palette-surface); color: var(--mud-palette-primary); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.lb-tab-page { display: none; padding-top: 6px; }
.lb-tab-page.is-active { display: block; }

/* ---- 複数選択フィルタ ---- */
.lb-ms {
  border: 1px solid var(--lb-line); border-radius: 12px; background: var(--lb-surface);
  padding: 10px 14px 12px; transition: border-color .15s ease, box-shadow .15s ease;
}
.lb-ms.is-open { border-color: var(--lb-accent); box-shadow: 0 0 0 3px var(--lb-accent-soft); }
.lb-ms-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lb-ms-label { font-size: .8rem; font-weight: 700; }
.lb-ms-count { font-size: .66rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--lb-accent-soft); color: var(--lb-accent); white-space: nowrap; }
.lb-ms-head-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.lb-ms-box {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--lb-line); border-radius: 10px; padding: 2px 8px;
  background: var(--mud-palette-background);
}
.lb-ms-box:focus-within { border-color: var(--lb-accent); }
.lb-ms-input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent; color: inherit; font: inherit; font-size: .84rem; padding: 7px 2px; }
.lb-ms-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--lb-muted); cursor: pointer; padding: 3px; border-radius: 7px;
}
.lb-ms-iconbtn:hover { background: var(--mud-palette-action-default-hover); color: var(--lb-ink); }
.lb-ms-menu { margin-top: 8px; border: 1px solid var(--lb-line); border-radius: 10px; overflow: hidden; }
.lb-ms-menu-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 6px 4px 12px; background: var(--lb-accent-soft); font-size: .7rem; color: var(--lb-muted);
}
.lb-ms-list { max-height: 244px; overflow-y: auto; }
.lb-ms-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 12px; border: 0; background: transparent; color: inherit;
  font: inherit; font-size: .82rem; text-align: left; cursor: pointer;
}
.lb-ms-item:hover { background: var(--mud-palette-action-default-hover); }
.lb-ms-item.is-selected { background: var(--lb-accent-soft); }
.lb-ms-item + .lb-ms-item { border-top: 1px solid color-mix(in srgb, var(--lb-line) 55%, transparent); }
.lb-ms-item-main { flex: 1 1 auto; min-width: 0; }
.lb-ms-item-sub { font-size: .7rem; color: var(--lb-muted); margin-left: 6px; }
.lb-ms-empty { padding: 10px 12px; font-size: .74rem; color: var(--lb-muted); }
.lb-ms-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-height: 138px; overflow-y: auto; }
.lb-ms-all { font-size: .74rem; color: var(--lb-muted); }
/* 対象外指定は選択の意味が反転するため、件数バッジと注記で対象指定と見分けられるようにする */
.lb-ms-count-ex { background: var(--lb-neg-soft, rgba(211, 47, 47, .12)); color: var(--lb-neg, #d32f2f); }
.lb-ms-exnote { width: 100%; }

/* ---- 選択中チップ ---- */
.lb-chip {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%;
  padding: 3px 5px 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 600;
  background: var(--lb-accent-soft); color: var(--lb-accent);
}
.lb-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
.lb-chip-x { display: inline-flex; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 1px; border-radius: 999px; opacity: .7; }
.lb-chip-x:hover { opacity: 1; background: color-mix(in srgb, var(--lb-accent) 20%, transparent); }
.lb-chip .mud-icon-root { width: .95rem; height: .95rem; font-size: .95rem; }

/* ---- チップ選択（表示項目・集計軸） ---- */
.lb-tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-tchip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--lb-line);
  background: transparent; color: var(--lb-muted);
  font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.lb-tchip:hover { border-color: var(--lb-accent); color: var(--lb-ink); }
.lb-tchip.is-on { background: var(--lb-accent); border-color: var(--lb-accent); color: var(--mud-palette-primary-text, #fff); }
.lb-tchip.is-locked { opacity: .7; cursor: default; }
.lb-tchip .mud-icon-root { width: .95rem; height: .95rem; font-size: .95rem; }

/* ---- 複数選択ダイアログ ---- */
.lb-pick-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.lb-pick-list { border: 1px solid var(--lb-line); border-radius: 10px; max-height: min(46vh, 380px); overflow-y: auto; }
.lb-pick-selected { margin-top: 12px; }

/* ---- KPI カード ---- */
.lb-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.lb-kpi { padding: 16px 18px; }
.lb-kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lb-kpi-label { font-size: .74rem; color: var(--lb-muted); }
.lb-kpi-val { font-size: 1.75rem; font-weight: 750; letter-spacing: -.01em; line-height: 1.1; }
.lb-unit { font-size: .82rem; font-weight: 600; color: var(--lb-muted); margin-left: 3px; }
.lb-kpi-foot { font-size: .72rem; color: var(--lb-muted); margin-top: 6px; }
.lb-badge { font-size: .66rem; padding: 3px 9px; border-radius: 999px; font-weight: 700; background: var(--lb-accent-soft); color: var(--lb-accent); white-space: nowrap; }

/* ---- 共同購買PJ の KPI 帯（全体・施設別で共有） ----
   もとは全体ダッシュボードのコンポーネント内に置いていたが、施設別ダッシュボードが
   同じ KPI 帯（着地予測カード＋個別カード＋目標までの帯）を使うようになったため、
   ここへ出した。コンポーネント内の <style> はそのページを描いたときしか DOM に出ず、
   クラスだけ共有すると片方の画面が無スタイルになる。 */
/* KPI は同じ大きさのカードを並べる（1枚＝1つの問い）。
   着地予測だけは主役なので数値を一回り大きくし、目標までの距離を帯で添える。
   全体ダッシュボードは .jpd-kpis-tall で着地予測を2行ぶんの高さにする（下記）。 */
.jpd-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}

.jpd-hero {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.jpd-hero-head { font-size: .78rem; color: var(--lb-muted); }

.jpd-hero-val {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
}

.jpd-unit { font-size: 1.1rem; font-weight: 700; margin-left: 4px; }

.jpd-hero-sub { font-size: .8rem; color: var(--lb-muted); line-height: 1.7; }
.jpd-hero-sep { margin: 0 6px; }

/* 目標までの距離を示す帯。前年度実績・最低ライン・最終目標の位置に目盛りを立てる */
.jpd-bar {
    position: relative;
    display: flex;
    height: 14px;
    margin-top: 6px;
    border-radius: 7px;
    background: var(--lb-line);
    overflow: visible;
}

.jpd-bar-actual {
    background: #1f6fd0;
    border-radius: 7px 0 0 7px;
}

.jpd-bar-forecast {
    background: #9dc4ee;
}

[data-lb-theme="dark"] .jpd-bar-actual { background: #4b95e8; }
[data-lb-theme="dark"] .jpd-bar-forecast { background: #2f5c8a; }

.jpd-bar-mark {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 0;
    border-left: 1.5px solid var(--lb-ink);
}

/* 前年度実績の目盛りはグラフの水準線と同じく破線にして Tier と区別する */
.jpd-bar-mark-prior { border-left-style: dashed; }

.jpd-bar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 10px;
    font-size: .7rem;
    color: var(--lb-muted);
}

.jpd-lg { display: inline-flex; align-items: center; gap: 5px; }
.jpd-sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.jpd-sw-actual { background: #1f6fd0; }
.jpd-sw-forecast { background: #9dc4ee; }
[data-lb-theme="dark"] .jpd-sw-actual { background: #4b95e8; }
[data-lb-theme="dark"] .jpd-sw-forecast { background: #2f5c8a; }

/* 補足1行に2つの値を並べるときの区切り。中黒を CSS で入れて、
   マークアップ側に記号を書き散らさない。 */
.jpd-foot-sep::before {
    content: "・";
    margin: 0 4px;
    color: var(--lb-line);
}

.jpd-chip-neg, .jpd-chip-pos {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
}

.jpd-chip-neg { background: rgba(209, 73, 91, .1); color: var(--mud-palette-error, #d1495b); }
.jpd-chip-pos { background: rgba(46, 125, 50, .12); color: var(--mud-palette-success, #2e7d32); }

/* 全体ダッシュボードの KPI（5枚）。着地予測を左に2行ぶんの高さで置き、
   残り4枚を右に 2×2 で並べる。着地予測には目盛りの金額と Tier ごとの不足額まで載せる
   （最終目標カードを別に置くより、1枚で「どの目標にあといくらか」が読めるため）。 */
.jpd-kpis-tall { grid-template-columns: 1.4fr 1fr 1fr; }
.jpd-kpis-tall .jpd-hero { grid-row: span 2; }

/* 縦積み用の「.lb-card + .lb-card」の上余白がグリッド内でも効き、2枚目以降だけ下がって
   高さが揃わなくなるため、KPI 帯の中では打ち消す（間隔は gap で取る）。
   後ろにある同じ詳細度の規則に負けないよう、セレクタを1段強くしてある。 */
.jpd-kpis > .lb-card + .lb-card { margin-top: 0; }

/* ---- 全体ダッシュボードの KPI カードの補足（進捗バー・月別ミニ棒・前年比較・次の Tier） ----
   着地予測カードが2行ぶんの高さになるぶん、右の4枚にも「次に読む数字」を1つずつ添える。 */
.jpd-kpi-note { font-size: .72rem; color: var(--lb-muted); margin-top: 6px; line-height: 1.6; }
.jpd-kpi-note b { color: var(--lb-ink); font-variant-numeric: tabular-nums; }

.jpd-progress {
    height: 8px;
    margin-top: 12px;
    border-radius: 4px;
    background: var(--lb-line);
    overflow: hidden;
}

.jpd-progress-fill { height: 100%; border-radius: 4px; background: var(--mud-palette-success, #2e7d32); }
.jpd-progress-fill.is-behind { background: #1f6fd0; }
[data-lb-theme="dark"] .jpd-progress-fill.is-behind { background: #4b95e8; }

/* 期間内の月別ミニ棒。棒の高さはその期間の最大月を満高にする */
.jpd-mini-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 54px;
    margin-top: 12px;
}

.jpd-mini-col {
    flex: 1 1 0;
    max-width: 28px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 棒の高さの基準（ラベルを除いた残り）。棒を直接列に置くとラベルぶん縮んで高さが揃ってしまう */
.jpd-mini-track { flex: 1 1 auto; min-height: 0; display: flex; align-items: flex-end; }

.jpd-mini-bar { width: 100%; min-height: 2px; border-radius: 2px 2px 0 0; background: #1f6fd0; }
[data-lb-theme="dark"] .jpd-mini-bar { background: #4b95e8; }
.jpd-mini-label { margin-top: 2px; font-size: .62rem; line-height: 1.2; text-align: center; color: var(--lb-muted); }

/* 今年・前年の比較バー（ラベル｜バー｜金額 の3列） */
.jpd-compare {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px 8px;
    margin-top: 12px;
    font-size: .72rem;
}

.jpd-compare-label { color: var(--lb-muted); }
.jpd-compare-val { font-variant-numeric: tabular-nums; text-align: right; min-width: 4em; }
.jpd-compare-track { height: 10px; border-radius: 5px; background: var(--lb-line); overflow: hidden; }
.jpd-compare-bar { height: 100%; border-radius: 5px; background: #1f6fd0; }
.jpd-compare-bar.is-prior { background: #9aa3ad; }
[data-lb-theme="dark"] .jpd-compare-bar { background: #4b95e8; }
[data-lb-theme="dark"] .jpd-compare-bar.is-prior { background: #6b737c; }

/* 予測リベートの「次の Tier まで」 */
.jpd-next-tier {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--lb-line);
    font-size: .74rem;
    line-height: 1.7;
    color: var(--lb-muted);
}

.jpd-next-tier b { color: var(--lb-ink); font-variant-numeric: tabular-nums; }
.jpd-next-tier b.lb-pos { color: var(--mud-palette-success, #2e7d32); }

/* 目盛りのラベル（前年・T1…）。常に目盛りの真下に中央揃え。段（top）と高さは画面側で決める */
.jpd-bar-ticks {
    position: relative;
    margin-top: 4px;
    font-size: .68rem;
    color: var(--lb-muted);
}

.jpd-bar-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}


/* 目標（Tier）ごとの着地予測との差 */
.jpd-gap-table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
    font-size: .76rem;
    font-variant-numeric: tabular-nums;
}

.jpd-gap-table th {
    padding: 4px 6px;
    font-weight: 600;
    font-size: .7rem;
    color: var(--lb-muted);
    text-align: left;
    border-bottom: 1px solid var(--lb-line);
}

.jpd-gap-table td {
    padding: 5px 6px;
    border-bottom: 1px solid var(--lb-line);
}

.jpd-gap-table tr:last-child td { border-bottom: none; }
.jpd-gap-table .r { text-align: right; white-space: nowrap; }

@media (max-width: 1280px) {
    .jpd-kpis { grid-template-columns: 1fr 1fr; }
    /* 2列では着地予測を1行ぶん全幅にし、残り4枚を 2×2 にする */
    .jpd-kpis-tall .jpd-hero { grid-column: 1 / -1; grid-row: auto; }
}

@media (max-width: 720px) {
    .jpd-kpis { grid-template-columns: 1fr; }
}

/* ---- 2カラムグリッド ---- */
.lb-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 14px; margin-bottom: 16px; }
/* 縦に積むカードセクション間の余白（グリッド・KPI の後に続く単体カード等） */
.lb-card + .lb-card { margin-top: 16px; }

/* ---- ランキングバー ---- */
.lb-bars { padding: 10px 18px 20px; display: flex; flex-direction: column; gap: 15px; }
.lb-bar-row { display: grid; grid-template-columns: 120px 1fr 78px; align-items: center; gap: 12px; }
.lb-bar-name { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-bar-track { height: 9px; background: var(--lb-accent-soft); border-radius: 999px; overflow: hidden; }
.lb-bar-fill { height: 100%; background: var(--lb-accent); border-radius: 999px; transition: width .5s ease; }
.lb-bar-val { font-size: .76rem; color: var(--lb-muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ---- 明細テーブル ---- */
.lb-tscroll { overflow-x: auto; padding: 2px 8px 10px; }
/* 結果テーブル: 高さを固定して内部スクロールし、列見出しを上部に固定（明細を見る時もヘッダーが見える） */
.lb-tscroll-fill { max-height: calc(100vh - 230px); overflow: auto; padding-top: 0; }
.lb-tscroll-fill thead th { position: sticky; top: 0; z-index: 3; background: var(--lb-surface); }
.lb-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.lb-table th { text-align: left; font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; color: var(--lb-muted); font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--lb-line); }
.lb-table td { padding: 12px; border-bottom: 1px solid var(--lb-line); vertical-align: middle; }
.lb-table tbody tr:last-child td { border-bottom: 0; }
.lb-table tbody tr { transition: background .12s ease; }
.lb-table tbody tr:hover { background: var(--lb-accent-soft); }
.lb-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.lb-table tr.lb-clickable { cursor: pointer; }
.lb-table tfoot tr.lb-total td { border-top: 2px solid var(--lb-line); border-bottom: 0; font-variant-numeric: tabular-nums; }
.lb-table tfoot tr.lb-total:hover { background: transparent; }
/* リベート試算の表は2列（項目・金額）。金額列を右に寄せて桁を揃える（ダイアログで使う） */
.jpd-rebate td:last-child { width: 34%; font-variant-numeric: tabular-nums; }
.jpd-rebate-sub td { color: var(--lb-muted); }

.lb-code { font-size: .68rem; color: var(--lb-muted); margin-top: 2px; }
.lb-rankpill { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--lb-accent-soft); color: var(--lb-muted); font-weight: 700; font-size: .72rem; }
.lb-r1 { background: #fef3c7; color: #b45309; }
.lb-r2 { background: #e2e8f0; color: #475569; }
.lb-r3 { background: #fde3cf; color: #c2410c; }

/* ---- ブランド（ドロワー） ---- */
.lb-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 6px 8px 2px; }
/* アプリバー内のブランド（開閉ボタンの右横）: ロゴのみ */
.lb-appbar-brand { display: flex; align-items: center; margin-left: 4px; min-width: 0; }
.lb-logo-wordmark { height: 44px; width: auto; max-width: 100%; display: block; }
/* ドロワー先頭の余白（ロゴをアプリバーへ移したぶん） */
.lb-drawer-top { height: 10px; }
/* ヘッダー右側の「同期中」表示 */
.lb-sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: 8px;
    padding: 4px 12px 4px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--mud-palette-warning);
    background: color-mix(in srgb, var(--mud-palette-warning) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--mud-palette-warning) 35%, transparent);
    white-space: nowrap;
}
/* ヘッダー右側の外部アプリ（Chatis の AIエージェント。別タブで開く。MainLayout）。
   右隣のこのシステムの AIアシスタント（✨・🎤。アイコンだけのボタン）と取り違えないよう、
   枠線と名前の付いたボタンにし、縦の区切り線（.lb-appbar-divider）で分ける。
   文字は控えめの色にし、別タブで開く印（↗）は小さく薄くする。画面が狭いときは名前を縮める。 */
.lb-appbar-external.mud-button-root {
    margin-right: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    border-style: dashed;
    color: var(--mud-palette-text-secondary);
    text-transform: none;
    font-weight: 500;
    white-space: nowrap;
}
.lb-appbar-external .mud-button-icon-end .mud-icon-root { font-size: .95rem; opacity: .75; }
.lb-appbar-divider {
    display: inline-block;
    width: 1px;
    height: 24px;
    margin: 0 8px 0 6px;
    background: var(--mud-palette-lines-default);
}
@media (max-width: 959.98px) { .lb-appbar-external-long { display: none; } }
/* スマホ幅はロゴが潰れないよう、Chatis はロボットのアイコンだけ（枠線の点線は残す）にし、
   上部バーのアイコンボタンの余白も詰める。別のアプリであることはツールチップと読み上げ（aria-label）で伝える。 */
@media (max-width: 599.98px) {
    .lb-appbar-external-label,
    .lb-appbar-external .mud-button-icon-end { display: none; }
    .lb-appbar-external.mud-button-root { min-width: 0; padding: 2px 7px; margin: 0 0 0 4px; }
    .lb-appbar-external .mud-button-icon-start { margin: 0; }
    .lb-appbar-divider { margin: 0 2px 0 6px; }
    .mud-appbar .mud-icon-button { padding: 8px; }
}
/* セクション見出し。上を大きく・下を詰めることで、見出しが「直後のリンク群のもの」に
   見えるようにする（上下が等間隔だと、どちらのグループの見出しか一瞬迷う）。 */
.lb-nav-label { display: flex; align-items: center; gap: 6px; font-size: .62rem; letter-spacing: .08em; color: var(--lb-muted); text-transform: uppercase; margin: 28px 16px 6px; }

/* 先頭のセクションだけは上の余白を詰める。区切る相手がドロワーの上端しかないため、
   セクション間と同じ余白を取ると頭だけ間延びして見える。 */
.lb-drawer-top + .lb-nav-section .lb-nav-label { margin-top: 14px; }

/* セクションのまとめの画面（ハブ。データ分析＝施設ダッシュボード F006、部会管理＝ポータルサイト F030）と、配下の機能。
   ハブは「セクションの入口」と分かるよう、薄い色の面・太字・色付きのアイコンにする。
   配下の機能は字下げし、ハブのアイコンの真下から縦線を引いて「この入口の中の機能」に見せる（ファイルの木構造と同じ見せ方）。
   細いメニュー（アイコンだけ）では字下げ・縦線を外してアイコンの列をそろえ、開くと字下げが戻る（下の「細いメニュー」）。 */
.lb-nav-hub { padding: 0 8px; }
.lb-nav-hub .mud-nav-link {
    padding-left: 8px; padding-right: 8px; border-radius: 10px; font-weight: 700;
    background: color-mix(in srgb, var(--mud-palette-primary) 9%, transparent);
}
.lb-nav-hub .mud-nav-link:hover { background: color-mix(in srgb, var(--mud-palette-primary) 16%, transparent); }
.lb-nav-hub .mud-nav-link .mud-nav-link-icon { color: var(--mud-palette-primary); }
.lb-nav-hub .mud-nav-link.active { background: color-mix(in srgb, var(--mud-palette-primary) 20%, transparent); }
.lb-nav-children { position: relative; margin-top: 2px; }
.lb-nav-children::before {
    content: ""; position: absolute; left: 27px; top: 0; bottom: 12px;
    border-left: 2px solid var(--mud-palette-lines-default); pointer-events: none;
    transition: opacity 150ms ease;
}
.lb-nav-children .mud-nav-link { padding-left: 40px; transition: padding-left 150ms ease; }
.lb-nav-children .mud-nav-link .mud-nav-link-icon { opacity: .85; }

/* ドロワーのセクション（見出し＋その配下のリンク）。
   配下のリンクはすべて <AuthorizeView Policy="feature:XXX"> で出し分けるため、
   権限によっては1本も描画されず「見出しだけが残る」ことがある。
   認可の判定を見出し側へ書き写すと二重管理になるので、
   リンク（<a>）が1本も無いセクションを CSS で畳む。判定の出どころは
   AuthorizeView ひとつのままにする。 */
.lb-nav-section:not(:has(a)) { display: none; }

/* ---- 細いメニュー（アイコンだけ）とカーソルで一時的に開く（MainLayout の .lb-drawer。PC のみ） ----
   ☰ で閉じたとき（Mini の .mud-drawer--closed）はアイコンだけの細いバーにする。
   カーソルを当てる・Tab で入る（:focus-visible。マウスでクリックした後に開いたまま残らないよう :focus-within は使わない）と、CSS だけで幅を広げて本文の上に重ねて開く
   （Open は変えないため本文の余白は細いバーのまま＝本文がずれない。サーバーとの往復も無い）。
   見出しは高さを保ったまま文字を消して線に置き換え、開いたときにアイコンが上下に動かないようにする。
   スマホ・タブレットは Responsive（.mud-drawer-mini が付かない）なので対象外。 */
.lb-drawer.mud-drawer-mini { overflow-x: hidden; }
/* MudBlazor は細いときドロワー直下のメニュー（システム管理・情報）の文字を display:none にする。
   セクションの枠に入ったメニューと揃えて、文字の出し入れは下の opacity だけで行う（開いたときに文字が出ないのを防ぐ）。 */
.lb-drawer.mud-drawer--closed.mud-drawer-mini > .mud-drawer-content > .mud-navmenu .mud-nav-link .mud-icon-root:first-child + .mud-nav-link-text { display: block; }
/* スマホ・タブレットでは Mini を使わない（画面幅を受け取って Responsive に切り替えるまでの一瞬も細いバーを出さない）。 */
@media (max-width: 959.98px) { .lb-drawer.mud-drawer-mini { visibility: hidden; } }
.lb-drawer.mud-drawer-mini .mud-nav-link-text { white-space: nowrap; transition: opacity 150ms ease; }
.lb-drawer.mud-drawer-mini .lb-nav-label { position: relative; white-space: nowrap; }
.lb-drawer.mud-drawer-mini .lb-nav-label::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid var(--mud-palette-lines-default);
    opacity: 0;
    transition: opacity 150ms ease;
}
/* 細いバー（カーソルが当たっていない間）。縦が長いときは開いてからスクロールする（細い幅にスクロールバーを出さない）。 */
.lb-drawer.mud-drawer-mini.mud-drawer--closed:not(:hover):not(:has(:focus-visible)) { overflow-y: hidden; }
.lb-drawer.mud-drawer-mini.mud-drawer--closed:not(:hover):not(:has(:focus-visible)) .mud-nav-link-text { opacity: 0; }
.lb-drawer.mud-drawer-mini.mud-drawer--closed:not(:hover):not(:has(:focus-visible)) .lb-nav-label { color: transparent; margin-left: 12px; margin-right: 12px; }
.lb-drawer.mud-drawer-mini.mud-drawer--closed:not(:hover):not(:has(:focus-visible)) .lb-nav-label::after { opacity: 1; }
/* 細いバーではハブ・配下の機能の字下げと縦線を外し、アイコンの列をほかのメニューとそろえる（開くと字下げが戻る）。 */
.lb-drawer.mud-drawer-mini.mud-drawer--closed:not(:hover):not(:has(:focus-visible)) .lb-nav-hub { padding: 0; }
.lb-drawer.mud-drawer-mini.mud-drawer--closed:not(:hover):not(:has(:focus-visible)) .lb-nav-hub .mud-nav-link { padding-left: 16px; border-radius: 0; }
.lb-drawer.mud-drawer-mini.mud-drawer--closed:not(:hover):not(:has(:focus-visible)) .lb-nav-children .mud-nav-link { padding-left: 16px; }
.lb-drawer.mud-drawer-mini.mud-drawer--closed:not(:hover):not(:has(:focus-visible)) .lb-nav-children::before { opacity: 0; }
/* カーソル・フォーカスで一時的に開く。左端をかすめただけで開かないよう、開くときだけ少し待つ。 */
.lb-drawer.mud-drawer-mini.mud-drawer-pos-left.mud-drawer--closed:is(:hover, :has(:focus-visible)) {
    width: var(--mud-drawer-width-left);
    box-shadow: var(--mud-elevation-8);
    transition-delay: 120ms;
}
.lb-drawer.mud-drawer-mini.mud-drawer-pos-left.mud-drawer--closed:is(:hover, :has(:focus-visible)) .mud-nav-link-text { transition-delay: 120ms; }

/* ---- ベータ版バッジ ---- */
/* 正式稼働前の機能に付ける印。ページタイトルに付ける
   （AIアシスタント・AIボイスHUD の入口の β は 2026-11-06 に外した）。
   警告色（--mud-palette-warning）は「同期中」「速報を含む」で使用済みのため、
   注意喚起ではなく状態表示であることが伝わるよう情報色を使う。 */
.lb-beta {
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.7;
  text-transform: none;
  color: var(--mud-palette-info, #2196f3);
  background: color-mix(in srgb, var(--mud-palette-info, #2196f3) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--mud-palette-info, #2196f3) 35%, transparent);
  white-space: nowrap;
  vertical-align: middle;
}

/* ページタイトル（h1）の横に置く場合。字送りぶんの間隔だけ足す。
   高さ合わせは .lb-beta の vertical-align: middle に任せる（h1 は行高が大きいので
   ベースライン合わせだと沈んで見える）。 */
.lb-title .lb-beta { margin-left: 8px; }

/* =========================================================
   このシステムについて（About）— 枠なしの紹介文
   ========================================================= */
.about { margin-top: 8px; max-width: 880px; }

.about-content { padding: 8px 12px 8px 16px; }
.about-eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--lb-accent); font-weight: 700; margin: 0 0 10px; }
.about-tagline { font-size: 1.7rem; font-weight: 750; line-height: 1.45; letter-spacing: .01em; color: var(--lb-ink); margin: 0 0 22px; text-wrap: pretty; }
.about-body p {
  font-size: .9rem; line-height: 1.95; color: var(--lb-ink); margin: 0 0 14px;
  /* 日本語を文節単位で改行し、単語途中や行末の孤立文字を防ぐ（Chromium系。非対応は既定動作） */
  word-break: auto-phrase;
  text-wrap: pretty;
}
.about-body p:last-child { margin-bottom: 0; }
.about-body .em { color: var(--lb-accent); font-weight: 700; }
/* ブランド名は行途中で分割しない */
.about-body .brand { white-space: nowrap; }

@media (max-width: 900px) {
  .about-tagline { font-size: 1.4rem; }
  .about-content { padding: 8px 4px 24px; }
}

/* ---- このシステムについて：紹介資料（2026-11-12。「利用データ」から差し替え） ---- */
.about-materials { margin-top: 28px; padding: 24px 28px 28px; }
.about-materials-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.about-materials-title { font-size: 1.25rem; font-weight: 750; letter-spacing: .01em; color: var(--lb-ink); margin: 0 0 10px; }
.about-materials-lead {
  font-size: .88rem; line-height: 1.8; color: var(--lb-muted); margin: 0; max-width: 74ch;
  word-break: auto-phrase; text-wrap: pretty;
}
.about-materials-lead .brand { white-space: nowrap; color: var(--lb-accent); font-weight: 700; }

/* MudExpansionPanels をカードのトーンに合わせて素朴に見せる */
.about-materials-panels {
  border: 1px solid var(--lb-line); border-radius: 12px; overflow: hidden; background: var(--lb-surface);
}
.about-materials-panels .mud-expand-panel { background: transparent; }
.about-materials-panels .mud-expand-panel:not(:last-child) { border-bottom: 1px solid var(--lb-line); }
.about-materials-panels .mud-expand-panel-header { padding: 14px 18px; }
.about-materials-panels .mud-expand-panel-content { padding: 0 18px 16px; }

.about-materials-panel-title { display: grid; grid-template-columns: auto 1fr; align-items: start; column-gap: 10px; }
.about-materials-panel-icon { color: var(--lb-accent); margin-top: 2px; }
.about-materials-panel-name { font-size: .95rem; font-weight: 700; line-height: 1.5; color: var(--lb-ink); margin-right: 8px; }
.about-materials-panel-summary { margin-top: 2px; font-size: .78rem; line-height: 1.6; color: var(--lb-muted); }
.about-materials-badge {
  display: inline-block; vertical-align: 2px;
  font-size: .7rem; font-weight: 700; color: var(--lb-accent); background: var(--lb-accent-soft);
  border-radius: 999px; padding: 1px 8px; white-space: nowrap;
}

/* スライドの横長（16:9）に合わせ、画面の高さを超えない大きさで表示する */
.about-materials-pdf {
  display: block; width: 100%; height: min(78vh, 760px); border: 1px solid var(--lb-line); border-radius: 8px; background: #fff;
}
.about-materials-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 10px; }
.about-materials-updated { font-size: .74rem; color: var(--lb-muted); }
.about-materials-admin { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.about-materials-note { margin: 6px 0 0; font-size: .74rem; color: var(--lb-muted); }
.about-materials-empty {
  display: flex; align-items: center; gap: 8px; padding: 18px; border: 1px dashed var(--lb-line); border-radius: 12px;
  font-size: .86rem; color: var(--lb-muted);
}

@media (max-width: 900px) {
  .about-materials { padding: 20px 18px 22px; }
  .about-materials-panels .mud-expand-panel-content { padding: 0 10px 12px; }
  .about-materials-pdf { height: 60vh; }
  .about-materials-admin { margin-left: 0; }
}

/* ---- レスポンシブ ---- */
@media (max-width: 900px) {
  .lb-kpis { grid-template-columns: repeat(2, 1fr); }
  .lb-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   既存（バリデーション・エラー表示）
   ========================================================= */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.blazor-error-boundary {
  background: #b32121;
  padding: 1rem 1rem 1rem 1rem;
  color: white;
}
.blazor-error-boundary::after { content: "エラーが発生しました。"; }

/* =========================================================
   メーカー別シェアのカテゴリパレット（共同購買 データ抽出・集計「シェア」）

   構成比バー・ランキング・シェア率推移の3つのグラフと表で同じ色を使うため、
   系列色はコンポーネントごとに持たせずここに1か所だけ置く
   （3つで別々に定義すると、片方だけ直したときに同じメーカーが違う色になる）。

   スロットは固定順に割り当て、循環させない（8社目以降は「その他」のニュートラル）。
   スロット0は既存のダッシュボード（プロジェクト対象）と同じ青にして、
   注目メーカー＝プロジェクト対象の色が画面間で揃うようにしている。
   隣接ペアの色覚多様性・通常視の識別性はライト/ダークとも検証済み。
   ライトではスロット2/3/4が背景とのコントラスト3:1を下回るため、
   グラフには必ず値ラベルか数値表を併記する（色だけに情報を持たせない）。
   ========================================================= */
.jps-palette {
  --jps-s0: #1f6fd0;  /* 青（注目メーカー＝プロジェクト対象と同色） */
  --jps-s1: #eb6834;  /* オレンジ */
  --jps-s2: #1baf7a;  /* アクア */
  --jps-s3: #eda100;  /* イエロー */
  --jps-s4: #e87ba4;  /* マゼンタ */
  --jps-s5: #008300;  /* グリーン */
  --jps-s6: #4a3aa7;  /* バイオレット */
  --jps-other: #b6bcc4;  /* その他（ニュートラル。既存チャートの「他メーカー」と同色） */
  --jps-grid: var(--lb-line);
  --jps-ink: var(--lb-ink);
  --jps-muted: var(--lb-muted);
  --jps-surface: var(--lb-surface);
}

/* ダイアログ（MudDialogProvider）は data-lb-theme を持つ MudMainContent の外に描かれるため、
   :has() でページ側がダークかを見て同じ色を当てる（施設別 Tier グラフの拡大表示など） */
[data-lb-theme="dark"] .jps-palette,
:root:has([data-lb-theme="dark"]) .mud-dialog .jps-palette {
  --jps-s0: #4b95e8;
  --jps-s1: #d95926;
  --jps-s2: #199e70;
  --jps-s3: #c98500;
  --jps-s4: #d55181;
  --jps-s5: #008300;
  --jps-s6: #9085e9;
  --jps-other: #5b626b;
}

/* 塗り（SVG の fill）と凡例・表の色見本（currentColor）で同じクラスを使う */
.jps-s0 { fill: var(--jps-s0); color: var(--jps-s0); }
.jps-s1 { fill: var(--jps-s1); color: var(--jps-s1); }
.jps-s2 { fill: var(--jps-s2); color: var(--jps-s2); }
.jps-s3 { fill: var(--jps-s3); color: var(--jps-s3); }
.jps-s4 { fill: var(--jps-s4); color: var(--jps-s4); }
.jps-s5 { fill: var(--jps-s5); color: var(--jps-s5); }
.jps-s6 { fill: var(--jps-s6); color: var(--jps-s6); }
.jps-s-other { fill: var(--jps-other); color: var(--jps-other); }

/* 折れ線は線色に同じトークンを使う（塗りは無し） */
.jps-line.jps-s0 { stroke: var(--jps-s0); }
.jps-line.jps-s1 { stroke: var(--jps-s1); }
.jps-line.jps-s2 { stroke: var(--jps-s2); }
.jps-line.jps-s3 { stroke: var(--jps-s3); }
.jps-line.jps-s4 { stroke: var(--jps-s4); }
.jps-line.jps-s5 { stroke: var(--jps-s5); }
.jps-line.jps-s6 { stroke: var(--jps-s6); }
.jps-line.jps-s-other { stroke: var(--jps-other); }
.jps-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

/* 凡例（3つのグラフで共通） */
.jps-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 0 4px 8px; font-size: .74rem; color: var(--jps-muted);
}
.jps-lg { display: inline-flex; align-items: center; gap: 6px; }
.jps-lg-strong { color: var(--jps-ink); font-weight: 700; }
/* 単位の注記は凡例の右端に寄せる */
.jps-lg-unit { margin-left: auto; font-variant-numeric: tabular-nums; }
.jps-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: currentColor; }
/* 注目メーカーは色だけでなく枠でも示す（色覚・白黒印刷でも読めるようにする） */
.jps-sw-strong { box-shadow: 0 0 0 2px var(--jps-surface), 0 0 0 3px var(--jps-ink); }

.jps-svg { width: 100%; height: auto; display: block; overflow: visible; }
.jps-grid-line { stroke: var(--jps-grid); stroke-width: 1; }
.jps-axis-line { stroke: var(--jps-grid); stroke-width: 1; }
.jps-axis-text { font-size: 10px; fill: var(--jps-muted); font-variant-numeric: tabular-nums; }
.jps-axis-text-end { text-anchor: end; }
.jps-axis-text-mid { text-anchor: middle; }

/* 値ラベル。塗りの上・目盛り線の上どちらでも読めるよう、背景色で縁取ってから本文色で描く
   （塗りの上に白文字を載せる方式はライトのイエロー・アクアで読めなくなるため採らない）。 */
.jps-value {
  font-size: 11px; font-weight: 700; fill: var(--jps-ink);
  font-variant-numeric: tabular-nums;
  paint-order: stroke fill; stroke: var(--jps-surface); stroke-width: 3px; stroke-linejoin: round;
}

/* 注目メーカーの名前は太字にする（色だけに情報を持たせない）。SVG の text にも効かせる */
.jps-name-strong { fill: var(--jps-ink); font-weight: 700; }

/* 「プロジェクト対象外」は同じ系列色を薄くして示す
   （別の色を割り当てると、その色を持つ他メーカーと混同するため）。 */
.jps-faded { opacity: .38; }

/* ---- コストチェック（F017）: 全体ビュー・施設別ビューと部品（CostCheck*.razor）で共通 ---- */
.cc-section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 24px 0 10px; }
.cc-section-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
/* 「i」ボタンは見出しの文字に寄せて小さく置く。 */
.cc-info { margin-left: 2px; padding: 2px !important; vertical-align: middle; }
.cc-info .mud-icon-root { font-size: 1.05rem; color: var(--lb-muted); }
.cc-card-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
/* 開始〜終了・施設の選択欄は幅を固定する（MudSelect は既定で横に伸び、間が大きく空くため）。 */
/* 施設別ビューの「全体に戻る」（全体ビューで施設を押して開いたときだけ出す）。 */
.cc-back { margin: 0 0 2px -8px; }
.cc-period { display: flex; align-items: center; gap: 8px; }
.cc-period .mud-select, .cc-period .mud-input-control { flex: 0 0 150px; width: 150px; }
.cc-facility .mud-select, .cc-facility .mud-input-control { flex: 0 0 300px; width: 300px; }
.cc-kpis { grid-template-columns: repeat(3, 1fr); align-items: start; }
/* 税引前利益のカードがあるときは4枚（幅が足りない画面では2列に折り返す）。 */
.cc-kpis.cc-kpis-4 { grid-template-columns: repeat(4, 1fr); }
/* 縦積み用の「.lb-card + .lb-card」の上余白がグリッド内でも効き、2枚目以降だけ下がるのを打ち消す（.jpd-kpis と同じ）。 */
.cc-kpis > .lb-card + .lb-card { margin-top: 0; }
@media (max-width: 1400px) { .cc-kpis.cc-kpis-4 { grid-template-columns: repeat(2, 1fr); } }
.cc-kpi-label { display: inline-flex; align-items: center; font-size: .85rem; font-weight: 600; color: var(--mud-palette-text-primary); }
.cc-kpi-dir { font-size: 1rem; font-weight: 700; margin-left: 6px; }
.cc-kpi-rows {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 14px 0 0;
  font-size: .92rem; font-variant-numeric: tabular-nums;
}
.cc-kpi-rows dt { color: var(--mud-palette-text-secondary); white-space: nowrap; }
.cc-kpi-rows dd { margin: 0; text-align: right; font-weight: 600; white-space: nowrap; }
.cc-kpi-rows .cc-kpi-bench { border-top: 1px dashed var(--lb-line); padding-top: 6px; }
.cc-kpi-sub { display: block; font-size: .75rem; color: var(--lb-muted); }
@media (max-width: 900px) { .cc-kpis, .cc-kpis.cc-kpis-4 { grid-template-columns: 1fr; } }
.lb-kpi-label .cc-sw { margin-right: 6px; vertical-align: middle; }
/* 系列の色の印（グラフ CostCheckTrendChart の線と同じ色）。 */
.cc-sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.cc-sw-total { background: #2a78d6; }
.cc-sw-redemption { background: #eb6834; }
.cc-sw-nonredemption { background: #1baf7a; }
.cc-sw-bench { background: repeating-linear-gradient(90deg, #52514e 0 2px, transparent 2px 4px); }
/* 税引前利益は材料費と別の量のため、4色目の系列色を足さず、濃い文字色の長い破線で区別する（グラフと同じ）。 */
.cc-sw-profit { background: repeating-linear-gradient(90deg, #26251f 0 6px, transparent 6px 8px); }
[data-lb-theme="dark"] .cc-sw-total { background: #3987e5; }
[data-lb-theme="dark"] .cc-sw-redemption { background: #d95926; }
[data-lb-theme="dark"] .cc-sw-nonredemption { background: #199e70; }
[data-lb-theme="dark"] .cc-sw-bench { background: repeating-linear-gradient(90deg, #c3c2b7 0 2px, transparent 2px 4px); }
[data-lb-theme="dark"] .cc-sw-profit { background: repeating-linear-gradient(90deg, #ecebe4 0 6px, transparent 6px 8px); }
.lb-tchip:disabled { cursor: default; opacity: .85; }
/* 選択中のチップは背景が塗られるため、色の印に縁を付けて見分けられるようにする。 */
.lb-tchip .cc-sw { box-shadow: 0 0 0 1.5px var(--mud-palette-surface); }
.lb-table th.cc-group { text-align: center; border-bottom: 1px solid var(--lb-line); }
/* 月別の年計: 全体・償還・非償還（・比べる相手）の列のまとまりを、縦の区切り線と見出しの色帯で分ける。
   色はグラフの線（CostCheckTrendChart）と同じ。薄く敷くだけなので、数字の読みやすさは変えない。 */
.cc-monthly { --cc-g-total: #2a78d6; --cc-g-redemption: #eb6834; --cc-g-nonredemption: #1baf7a; --cc-g-bench: #7c8591; --cc-g-profit: #26251f; }
[data-lb-theme="dark"] .cc-monthly { --cc-g-total: #3987e5; --cc-g-redemption: #d95926; --cc-g-nonredemption: #199e70; --cc-g-bench: #9aa2ad; --cc-g-profit: #ecebe4; }
.cc-monthly .lb-table .cc-gs { border-left: 2px solid var(--lb-line); }
.cc-monthly .lb-table th.cc-group { border-top: 3px solid var(--cc-g); background: color-mix(in srgb, var(--cc-g) 12%, transparent); color: var(--mud-palette-text-primary); }
.cc-monthly .lb-table th.cc-group .cc-sw { width: 10px; height: 10px; border-radius: 2px; }
.cc-monthly .lb-table th[class*="cc-sub-"] { background: color-mix(in srgb, var(--cc-g) 6%, transparent); }
.cc-monthly .cc-group-total, .cc-monthly .cc-sub-total { --cc-g: var(--cc-g-total); }
.cc-monthly .cc-group-redemption, .cc-monthly .cc-sub-redemption { --cc-g: var(--cc-g-redemption); }
.cc-monthly .cc-group-nonredemption, .cc-monthly .cc-sub-nonredemption { --cc-g: var(--cc-g-nonredemption); }
.cc-monthly .cc-group-bench, .cc-monthly .cc-sub-bench { --cc-g: var(--cc-g-bench); }
.cc-monthly .cc-group-profit, .cc-monthly .cc-sub-profit { --cc-g: var(--cc-g-profit); }
/* 税引前利益の注記（損益の最新月・算出できない理由など）。 */
.cc-profit-notes { margin: 6px 0 0; padding: 0; list-style: none; font-size: .75rem; color: var(--mud-palette-text-secondary); }
.cc-profit-notes li::before { content: "※ "; }
.cc-th-sub { font-size: 0.68rem; font-weight: 400; color: var(--mud-palette-text-secondary); text-transform: none; }
.cc-base-row { background: var(--mud-palette-action-default-hover); }
.cc-tag {
  display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; border: 1px solid var(--lb-line); color: var(--lb-muted);
}
.cc-warn {
  display: inline-block; padding: 1px 8px; border-radius: 999px; white-space: nowrap;
  font-size: 0.72rem; font-weight: 700; background: rgba(237, 108, 2, .14); color: #b25400;
}
[data-lb-theme="dark"] .cc-warn { color: #ffb74d; }
/* 全体／施設別の画面切替（共同購買PJ の JointPurchaseNav と同じ見た目）。 */
.ccscr {
  display: flex; gap: 4px; margin: 0 0 16px; overflow-x: auto; overflow-y: hidden;
  box-shadow: inset 0 -1px 0 var(--mud-palette-lines-default);
}
.ccscr-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; white-space: nowrap;
  font-size: .86rem; font-weight: 600; color: var(--mud-palette-text-secondary); text-decoration: none;
  border-bottom: 2px solid transparent;
}
.ccscr-item:hover { color: var(--mud-palette-text-primary); background: var(--mud-palette-action-default-hover); }
/* 選択中は色だけでなく下線でも示す（色覚に依存させない）。 */
.ccscr-item.is-current { color: var(--mud-palette-primary); border-bottom-color: var(--mud-palette-primary); }

/* =========================================================
   メニューなしの案内画面（404 の NotFound・例外の Error。EmptyLayout）
   EmptyLayout には MudThemeProvider が無く MudBlazor のパレット変数が使えないため、
   ログイン画面と同じ値を直接持ち、OS のダーク設定に合わせる。
   ========================================================= */
.lb-status-page {
  --lbs-bg: #f6f7f9;
  --lbs-ink: #0f172a;
  --lbs-muted: #64748b;
  --lbs-accent: #4f46e5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  text-align: center;
  background: var(--lbs-bg);
  color: var(--lbs-ink);
}
@media (prefers-color-scheme: dark) {
  .lb-status-page {
    --lbs-bg: #0b0f17;
    --lbs-ink: #e8ecf3;
    --lbs-muted: #93a0b4;
    --lbs-accent: #818cf8;
  }
}
.lb-status-logo { width: 180px; height: auto; margin-bottom: 8px; }
.lb-status-title { margin: 0; font-size: 1.5rem; font-weight: 700; }
.lb-status-text { margin: 0; color: var(--lbs-muted); }
.lb-status-text code { font-size: .85em; }
.lb-status-link {
  margin-top: 12px;
  padding: 8px 20px;
  border-radius: 8px;
  background: var(--lbs-accent);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
}
.lb-status-link:hover,
.lb-status-link:focus-visible { opacity: .9; }

/* ---- 管理画面（ユーザー管理・施設管理）の一覧 ----
   連絡先の画面（lb-ct-*）と同じ形にそろえる: タブの中にカード、上部に「検索・件数・切替・追加」、その下に一覧。
   スマホ幅では各行を「見出し: 値」のカードにする（td の data-label を見出しに使う）。 */
.lb-adm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 18px 10px; }
.lb-adm-search { flex: 1 1 260px; max-width: 420px; }
.lb-adm-dept { flex: 0 0 160px; }
/* 部会管理者のロールの割り当て（ユーザー管理の一覧の中の選択欄。2026-11-11） */
.lb-adm-role-select { min-width: 150px; max-width: 200px; }
.lb-adm-count { font-size: .8rem; color: var(--lb-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-adm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-left: auto; }
.lb-adm-empty { padding: 16px 18px 20px; color: var(--lb-muted); margin: 0; }
.lb-adm-scroll { overflow: auto; max-height: calc(100vh - 280px); }
.lb-adm-table thead th { position: sticky; top: 0; background: var(--mud-palette-surface); z-index: 1; white-space: nowrap; }
.lb-adm-table td { vertical-align: middle; }
.lb-adm-table .lb-adm-sub { display: block; font-size: .74rem; color: var(--lb-muted); }
.lb-adm-table .lb-adm-code { font-size: .78rem; color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.lb-adm-table tr.is-deleted td { color: var(--lb-muted); }
.lb-adm-table td.lb-adm-select { min-width: 180px; width: 220px; padding-top: 6px; padding-bottom: 6px; }
.lb-adm-row-actions { text-align: right; white-space: nowrap; width: 1%; }
.lb-adm-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; white-space: nowrap; background: var(--lb-accent-soft); }
.lb-adm-badge.is-deleted { background: color-mix(in srgb, var(--mud-palette-error) 14%, transparent); color: var(--mud-palette-error); }
.lb-adm-badge.is-warn { background: color-mix(in srgb, var(--mud-palette-warning) 18%, transparent); }
.lb-adm-hidden-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 768px) {
  .lb-adm-toolbar { padding: 12px 14px 8px; gap: 8px 12px; }
  .lb-adm-search { flex-basis: 100%; max-width: none; }
  .lb-adm-actions { margin-left: 0; }
  .lb-adm-empty { padding: 12px 14px 16px; }
  .lb-adm-scroll { max-height: none; overflow: visible; }
  .lb-adm-table thead { display: none; }
  .lb-adm-table, .lb-adm-table tbody, .lb-adm-table tr { display: block; width: 100%; }
  .lb-adm-table tr { border-top: 1px solid var(--lb-line); padding: 10px 14px; }
  .lb-adm-table tbody tr:hover { background: none; }
  .lb-adm-table td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 6.5em minmax(0, 1fr);
                     column-gap: 10px; align-items: baseline; }
  .lb-adm-table td::before { content: attr(data-label); color: var(--lb-muted); font-size: .72rem; }
  /* 値の2行目（施設コード・カナ・更新者など）やバッジも値の列に置く（見出しの列へ回り込ませない）。 */
  .lb-adm-table td > * { grid-column: 2; }
  .lb-adm-table td > .lb-adm-badge { justify-self: start; }
  .lb-adm-table td > .lb-adm-badge + .lb-adm-badge { margin-left: 0 !important; margin-top: 2px; }
  .lb-adm-table td.lb-adm-select { width: 100%; min-width: 0; align-items: center; }
  .lb-adm-table td.lb-adm-row-actions { display: flex; justify-content: flex-end; gap: 4px; width: 100%; }
  .lb-adm-table td.lb-adm-row-actions::before { content: none; }
}

/* クリップボードへのコピーの通知（wwwroot/js/download.js の zbiShowToast。日程調整 F022 のメール文など） */
.zbi-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 3000;
    max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 6px;
    background: #2e7d32; color: #fff; font-size: .875rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.zbi-toast.is-error { background: #c62828; }

/* =============================================================================
   リンク集（F026）。画像のタイルを並べる（LinkCollectionPage / LinkTile / LinkEditDialog）。
   ============================================================================= */
.lb-lk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 18px; min-height: 40px; }
.lb-lk-search { flex: 1 1 280px; max-width: 460px; }
.lb-lk-count { font-size: .8rem; color: var(--lb-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-lk-nohit { color: var(--lb-muted); margin: 8px 2px; }
.lb-lk-edit-hint {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: .8rem; color: var(--lb-ink); background: var(--lb-accent-soft);
}

.lb-lk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 20px; }
.lb-lk-cell { position: relative; min-width: 0; }

/* タイル本体 */
.lb-lk-tile {
  position: relative; display: flex; flex-direction: column; height: 100%;
  border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--lb-ink);
  background: var(--lb-surface); border: 1px solid var(--lb-line); box-shadow: var(--lb-shadow);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease, border-color .25s ease;
}
a.lb-lk-tile:hover, a.lb-lk-tile:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--lb-accent) 45%, var(--lb-line));
  box-shadow: 0 10px 28px -6px color-mix(in srgb, var(--lb-accent) 30%, rgba(16, 24, 40, .25)), 0 2px 6px rgba(16, 24, 40, .08);
}
a.lb-lk-tile:focus-visible { outline: 3px solid color-mix(in srgb, var(--lb-accent) 55%, transparent); outline-offset: 3px; }
a.lb-lk-tile:active { transform: translateY(-1px) scale(.99); }

/* 画像の領域（正方形寄り）。画像が無ければ色のグラデーションに頭文字 */
.lb-lk-visual {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; display: grid; place-items: center;
  background: color-mix(in srgb, var(--lb-ink) 4%, var(--lb-surface));
}
.lb-lk-backdrop {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(22px) saturate(1.5); transform: scale(1.35); opacity: .5;
}
.lb-lk-image {
  position: absolute; inset: 0; width: 100%; height: 100%; box-sizing: border-box; object-fit: contain; padding: 16px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .18));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
a.lb-lk-tile:hover .lb-lk-image { transform: scale(1.06); }

.lb-lk-initial {
  position: relative; font-size: 3rem; font-weight: 800; line-height: 1; color: #fff; letter-spacing: -.02em;
  text-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
a.lb-lk-tile:hover .lb-lk-initial { transform: scale(1.1) rotate(-4deg); }
/* 頭文字のタイルの光沢（左上のハイライトと右下の円） */
.lb-lk-visual.is-initial::before,
.lb-lk-visual.is-initial::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.lb-lk-visual.is-initial::before {
  width: 140%; height: 140%; left: -60%; top: -80%; background: radial-gradient(circle, rgba(255, 255, 255, .35), transparent 60%);
}
.lb-lk-visual.is-initial::after {
  width: 70%; aspect-ratio: 1; right: -18%; bottom: -30%; border: 14px solid rgba(255, 255, 255, .14);
}
.lb-lk-visual.lb-lk-hue-0 { background: linear-gradient(135deg, #6366f1, #a855f7); }
.lb-lk-visual.lb-lk-hue-1 { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.lb-lk-visual.lb-lk-hue-2 { background: linear-gradient(135deg, #14b8a6, #047857); }
.lb-lk-visual.lb-lk-hue-3 { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.lb-lk-visual.lb-lk-hue-4 { background: linear-gradient(135deg, #fb7185, #db2777); }
.lb-lk-visual.lb-lk-hue-5 { background: linear-gradient(135deg, #8b5cf6, #c026d3); }
.lb-lk-visual.lb-lk-hue-6 { background: linear-gradient(135deg, #06b6d4, #0f766e); }
.lb-lk-visual.lb-lk-hue-7 { background: linear-gradient(135deg, #22c55e, #15803d); }

/* 右上の「別タブで開く」の印（マウスを乗せたときに出す） */
.lb-lk-open {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(-4px); transition: opacity .2s ease, transform .2s ease;
}
a.lb-lk-tile:hover .lb-lk-open, a.lb-lk-tile:focus-visible .lb-lk-open { opacity: 1; transform: none; }

/* 説明（マウスを乗せると下から出る） */
.lb-lk-desc {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px;
  font-size: .76rem; line-height: 1.45; color: #fff;
  background: linear-gradient(to top, rgba(15, 23, 42, .82), rgba(15, 23, 42, .55) 60%, transparent);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease;
}
a.lb-lk-tile:hover .lb-lk-desc, a.lb-lk-tile:focus-visible .lb-lk-desc, .lb-lk-tile.is-static .lb-lk-desc { opacity: 1; transform: none; }

.lb-lk-body { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px 13px; min-width: 0; }
.lb-lk-title {
  font-size: .9rem; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
.lb-lk-host { font-size: .72rem; color: var(--lb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 編集モード */
.lb-lk-grid.is-editing .lb-lk-tile { border-style: dashed; border-color: color-mix(in srgb, var(--lb-accent) 40%, var(--lb-line)); cursor: grab; }
.lb-lk-grid.is-editing img { pointer-events: none; -webkit-user-drag: none; user-select: none; }
/* 編集モードでは操作ボタンと重ならないよう説明を出さない（説明は編集ダイアログのプレビューで見る） */
.lb-lk-grid.is-editing .lb-lk-desc { display: none; }
.lb-lk-grid.is-editing .lb-lk-cell { transition: transform .2s ease, opacity .2s ease; }
.lb-lk-cell.is-dragging { opacity: .4; transform: scale(.96); }
.lb-lk-cell.is-drop-target .lb-lk-tile {
  border: 2px solid var(--lb-accent);
  box-shadow: 0 0 0 4px var(--lb-accent-soft), var(--lb-shadow);
}
.lb-lk-edit-bar {
  position: absolute; top: 8px; left: 8px; right: 8px; display: flex; align-items: center; gap: 2px;
  padding: 2px 4px; border-radius: 12px;
  background: color-mix(in srgb, var(--lb-surface) 82%, transparent); backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(16, 24, 40, .14);
}
.lb-lk-handle { display: grid; place-items: center; color: var(--lb-muted); cursor: grab; padding: 0 2px; }
.lb-lk-edit-spacer { flex: 1 1 auto; }

.lb-lk-add-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 180px;
  border-radius: 18px; border: 2px dashed color-mix(in srgb, var(--lb-accent) 45%, var(--lb-line));
  background: color-mix(in srgb, var(--lb-accent) 5%, transparent); color: var(--lb-accent);
  font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.lb-lk-add-tile:hover:not(:disabled) { background: var(--lb-accent-soft); transform: translateY(-2px); }
.lb-lk-add-tile:disabled { opacity: .5; cursor: default; }
.lb-lk-add-icon {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--lb-accent); color: var(--mud-palette-primary-text, #fff);
}

/* まだ 1 件も無いとき */
.lb-lk-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 56px 20px; border-radius: 18px; border: 1px dashed var(--lb-line);
  background: radial-gradient(circle at 50% 0%, var(--lb-accent-soft), transparent 70%);
}
.lb-lk-empty-icon {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 8px;
  color: #fff; background: linear-gradient(135deg, #6366f1, #0ea5e9); box-shadow: 0 10px 24px -8px rgba(37, 99, 235, .55);
  transform: rotate(-6deg);
}
.lb-lk-empty-title { font-weight: 700; margin: 0; }
.lb-lk-empty-text { color: var(--lb-muted); font-size: .85rem; margin: 0 0 12px; max-width: 46ch; }

/* 登録ダイアログ（左に入力、右にプレビュー） */
.lb-lk-form { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; }
.lb-lk-form-fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lb-lk-form-preview { position: sticky; top: 0; }
.lb-lk-preview-label { font-size: .72rem; font-weight: 700; color: var(--lb-muted); letter-spacing: .08em; margin-bottom: 8px; }
.lb-lk-image-field { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--lb-line); }
.lb-lk-image-label { font-size: .82rem; font-weight: 700; margin-bottom: 8px; }
.lb-lk-image-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lb-lk-image-hint { font-size: .74rem; color: var(--lb-muted); margin-top: 8px; line-height: 1.5; }
.lb-lk-image-file { font-size: .74rem; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 768px) {
  .lb-lk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .lb-lk-search { flex-basis: 100%; max-width: none; }
  .lb-lk-tile { border-radius: 14px; }
  .lb-lk-initial { font-size: 2.3rem; }
  .lb-lk-body { padding: 9px 11px 11px; }
  .lb-lk-form { grid-template-columns: minmax(0, 1fr); }
  .lb-lk-form-preview { position: static; max-width: 220px; }
  /* タッチ端末ではマウスを乗せられないため、説明は出さない（タイトルだけで選べるように） */
  .lb-lk-desc { display: none; }
  .lb-lk-tile.is-static .lb-lk-desc { display: -webkit-box; }
}

@media (prefers-reduced-motion: reduce) {
  .lb-lk-tile, .lb-lk-image, .lb-lk-initial, .lb-lk-open, .lb-lk-desc, .lb-lk-cell, .lb-lk-add-tile { transition: none; }
  a.lb-lk-tile:hover, a.lb-lk-tile:focus-visible, a.lb-lk-tile:hover .lb-lk-image, a.lb-lk-tile:hover .lb-lk-initial { transform: none; }
}

/* =========================================================
   画面内ヘルプ（説明モーダル）の共通の見た目
   使い方: <MudDialog Class="lb-help-dialog"> と、本文の最上位の要素に class="lb-help"。
   表が多く横に広いヘルプは "lb-help-dialog is-wide"。各ヘルプの <style> には、そのヘルプだけの印（判定の色など）だけを書く。
   ========================================================= */
.mud-dialog.lb-help-dialog { width: min(760px, calc(100vw - 32px)); max-width: none; }
.mud-dialog.lb-help-dialog.is-wide { width: min(960px, calc(100vw - 32px)); }
.lb-help-dialog .mud-dialog-title { padding: 16px 56px 12px 20px; border-bottom: 1px solid var(--lb-line); }
.lb-help-dialog .mud-dialog-title .mud-typography { font-size: 1.1rem; font-weight: 700; line-height: 1.4; }
.lb-help-dialog .mud-dialog-content { padding: 18px 20px 22px; }
.lb-help-dialog .mud-dialog-actions { border-top: 1px solid var(--lb-line); padding: 10px 16px; }
.lb-help { font-size: .875rem; line-height: 1.75; color: var(--mud-palette-text-primary); }
.lb-help p { margin: 0 0 10px; }
/* 冒頭の説明文（最初の段落）は、薄い色の枠で「この画面は何か」を目立たせる。 */
.lb-help > p:first-child { background: var(--lb-accent-soft); padding: 12px 14px; border-radius: 8px; margin-bottom: 20px; }
/* 見出しは左の色の帯で区切りを分かりやすくする。 */
.lb-help h3 { font-size: .95rem; font-weight: 700; line-height: 1.5; margin: 26px 0 10px; padding: 1px 0 1px 10px;
              border-left: 4px solid var(--mud-palette-primary); }
.lb-help h3:first-child { margin-top: 0; }
.lb-help ul, .lb-help ol { margin: 0 0 10px; padding-left: 1.4em; }
.lb-help li { margin: 0 0 6px; padding-left: 2px; }
.lb-help li::marker { color: var(--mud-palette-primary); }
.lb-help li > ul, .lb-help li > ol { margin: 6px 0 0; }
.lb-help code { background: var(--mud-palette-action-default-hover); padding: 0 4px; border-radius: 4px; font-size: .9em; }
.lb-help table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: .84rem; }
.lb-help th, .lb-help td { border: 1px solid var(--lb-line); padding: 8px 10px; text-align: left; vertical-align: top; }
.lb-help th { background: var(--lb-accent-soft); font-weight: 700; }
@media (max-width: 600px) {
  .lb-help-dialog .mud-dialog-title { padding: 14px 52px 10px 16px; }
  .lb-help-dialog .mud-dialog-content { padding: 14px 16px 18px; }
  .lb-help { font-size: .85rem; }
  .lb-help th, .lb-help td { padding: 6px 8px; }
}

/* 長い名前を「…」で省いた要素のツールチップ（wwwroot/js/overflow-tip.js。省かれているときだけ、マウス・キーボードで出す）。
   ダイアログの上にも出るよう z-index は MudBlazor のダイアログ（1400 台）より上にする。 */
.lb-overflow-tip { position: fixed; z-index: 2000; max-width: min(480px, calc(100vw - 16px)); padding: 6px 10px; border-radius: 6px;
                   background: rgba(33, 33, 33, .94); color: #fff; font-size: .8rem; font-weight: 500; line-height: 1.5;
                   overflow-wrap: anywhere; white-space: normal; pointer-events: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.lb-overflow-tip[hidden] { display: none; }

/* =============================================================================
   部会ポータルサイト（F030）。12 列のグリッドに部品を置く（PortalSitePage / PortalBlockContent / portal-grid.js）。
   部品の位置は Blazor が CSS の変数（--pt-col・--pt-row・--pt-w・--pt-h）で描き、ドラッグ中だけ JS が直接の値で上書きする。
   ============================================================================= */
/* 見出し・説明は出さず、バナーをいちばん上に置く（2026-11-11）。操作はタブの帯の右端、帯が無ければ右上に小さく重ねる。 */
.lb-pt-page { position: relative; }
.lb-pt-topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap;
  margin: 0 0 16px; border-bottom: 1px solid var(--lb-line);
}
/* 編集中は帯を画面の上に留める（長いページの下で部品を動かしているときも、追加・終了をすぐ押せるように）。 */
.lb-pt-topbar.is-editing {
  position: sticky; top: var(--mud-appbar-height, 64px); z-index: 20; padding-top: 8px;
  background: var(--mud-palette-background);
}
.lb-pt-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.lb-pt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 6px; }
.lb-pt-float {
  position: absolute; z-index: 5; top: 10px; right: 10px; display: flex; align-items: center; gap: 4px;
  padding: 2px; border-radius: 999px; background: color-mix(in srgb, var(--lb-surface) 72%, transparent);
  backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(16, 24, 40, .12);
  opacity: .75; transition: opacity .2s ease;
}
.lb-pt-float:hover, .lb-pt-float:focus-within { opacity: 1; }
.lb-pt-tab {
  display: inline-flex; align-items: center; padding: 8px 16px; margin-bottom: -1px; white-space: nowrap;
  border: 1px solid transparent; border-bottom: none; border-radius: 10px 10px 0 0;
  font: inherit; font-size: .88rem; font-weight: 600; color: var(--lb-muted); text-decoration: none; background: none; cursor: pointer;
}
.lb-pt-tab:hover { color: var(--lb-ink); background: var(--lb-accent-soft); }
.lb-pt-tab.is-active { color: var(--mud-palette-primary); background: var(--lb-surface); border-color: var(--lb-line); }
.lb-pt-tab:disabled { opacity: .5; cursor: default; }
.lb-pt-edit-hint {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; margin: 0 0 16px; border-radius: 999px;
  font-size: .8rem; color: var(--lb-ink); background: var(--lb-accent-soft);
}
.lb-pt-note { display: flex; align-items: center; gap: 6px; margin: 4px 0; color: var(--lb-muted); font-size: .85rem; }
.lb-pt-note.is-page { margin: 8px 2px 16px; }

/* まだページが無いとき */
.lb-pt-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 56px 20px; border-radius: 18px; border: 1px dashed var(--lb-line);
  background: radial-gradient(circle at 50% 0%, var(--lb-accent-soft), transparent 70%);
}
.lb-pt-empty-icon {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 8px;
  color: #fff; background: linear-gradient(135deg, #0ea5e9, #14b8a6); box-shadow: 0 10px 24px -8px rgba(14, 165, 233, .55);
  transform: rotate(-6deg);
}
.lb-pt-empty-title { font-weight: 700; margin: 0; }
.lb-pt-empty-text { color: var(--lb-muted); font-size: .85rem; margin: 0 0 12px; max-width: 52ch; }
.lb-pt-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* グリッドと部品 */
.lb-pt-grid {
  position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: var(--pt-row-h, 36px); gap: var(--pt-gap, 12px);
}
/* 枠なしの部品も、枠ありと同じ透明な線と余白を持たせる。枠の有無で見出し・中身の位置がずれず、枠なしが端に詰まって見えないように
   （2026-11-12 のフィードバック。以前は枠ありだけに余白があり、並べると見出しが 17px ずれていた）。
   バナー・見出しは部品いっぱいに広げるため余白を付けない（見出しは .lb-pt-heading の左右 16px で文字の位置がそろう）。 */
.lb-pt-block {
  position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  grid-column: var(--pt-col) / span var(--pt-w); grid-row: var(--pt-row) / span var(--pt-h);
  border: 1px solid transparent; border-radius: 14px;
}
.lb-pt-block.has-frame { background: var(--lb-surface); border-color: var(--lb-line); box-shadow: var(--lb-shadow); }
.lb-pt-content { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.lb-pt-block:not(.is-banner, .is-heading) .lb-pt-content { padding: 12px 16px; }
.lb-pt-block-title { margin: 0 0 8px; font-size: .95rem; font-weight: 700; }
.lb-pt-block-body { flex: 1 1 auto; min-height: 0; }
.lb-pt-more { margin-top: 8px; text-align: right; font-size: .8rem; }

/* バナー（背景の画像は枠いっぱいに切り取って敷く。文字が読めるよう下から暗くする） */
.lb-pt-block.is-banner .lb-pt-content { overflow: hidden; }
.lb-pt-banner {
  position: relative; flex: 1 1 auto; display: flex; align-items: center; overflow: hidden; border-radius: 14px;
  padding: 20px clamp(16px, 4vw, 40px); color: #fff; min-height: 100%;
}
.lb-pt-banner.is-plain { background: linear-gradient(120deg, #0f4c81, #1e88e5 55%, #26a69a); }
.lb-pt-banner.is-center { justify-content: center; text-align: center; }
.lb-pt-banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lb-pt-banner:not(.is-plain)::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(15, 23, 42, .55), rgba(15, 23, 42, .18) 60%, rgba(15, 23, 42, .1));
}
.lb-pt-banner-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lb-pt-banner-title {
  font-size: clamp(1.6rem, 4vw, 3rem); font-weight: 800; letter-spacing: .06em; line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35); overflow-wrap: anywhere;
}
.lb-pt-banner-sub { font-size: clamp(.85rem, 1.6vw, 1.05rem); font-weight: 600; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); overflow-wrap: anywhere; }

/* 見出し */
.lb-pt-heading { flex: 1 1 auto; display: flex; align-items: center; min-height: 100%; padding: 0 16px; }
.lb-pt-heading h2 { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--mud-palette-primary); overflow-wrap: anywhere; }
.lb-pt-heading.is-center { justify-content: center; text-align: center; }
.lb-pt-heading.is-band { border-radius: 12px; background: color-mix(in srgb, var(--lb-ink) 6%, var(--lb-surface)); }
.lb-pt-heading.is-underline h2 { padding-bottom: 6px; border-bottom: 3px solid var(--mud-palette-primary); }

/* 自由文 */
.lb-pt-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; font-size: .9rem; }
.lb-pt-text.is-center { text-align: center; }

/* 部会のお知らせ（日付・タイトルを点線で区切って並べる） */
.lb-pt-ann { list-style: none; margin: 0; padding: 0; }
.lb-pt-ann li + li { border-top: 1px dotted var(--lb-line); }
.lb-pt-ann-row {
  display: flex; align-items: baseline; gap: 16px; width: 100%; padding: 9px 6px; border: none; border-radius: 6px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.lb-pt-ann-row:hover:not(:disabled) { background: var(--lb-accent-soft); }
.lb-pt-ann-row:disabled { cursor: default; }
.lb-pt-ann-date { flex: none; font-size: .85rem; font-weight: 600; color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.lb-pt-ann-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.lb-pt-ann-row.is-unread .lb-pt-ann-title { font-weight: 700; }
.lb-pt-ann-new {
  flex: none; padding: 0 8px; border-radius: 999px; font-size: .68rem; font-weight: 700;
  color: var(--mud-palette-primary-text); background: var(--mud-palette-primary);
}

/* 機能ボタンとリンク集のタイル（同じ大きさ・同じ組み立て。2026-11-12 のフィードバック）。
   どちらも「上の面（高さ --pt-tile-visual）＋名前と説明（1 行ずつ）」で、幅は決まった値（--pt-tile-w）にする。
   以前は機能ボタン（最小 150px・背が低い）とリンク集（最小 140px・画像 16:10 で背が高い）で幅も高さも違い、
   残りの幅を分け合う（1fr）ため部品の幅でも大きさが変わって、並べるとずれていた。機能ボタンを少し大きく、
   リンク集を少し小さくして中間にそろえた。幅の狭い画面（スマホ）では部品が 1 列になるため、両方とも幅いっぱいに分け合う。 */
.lb-pt-features, .lb-pt-links {
  --pt-tile-w: 156px; --pt-tile-visual: 80px;
  display: grid; grid-template-columns: repeat(auto-fill, var(--pt-tile-w)); gap: 14px;
}
.lb-pt-links .lb-lk-tile { border-radius: 16px; }
.lb-pt-links .lb-lk-visual { aspect-ratio: auto; height: var(--pt-tile-visual); }
.lb-pt-links .lb-lk-image { padding: 10px; }
.lb-pt-links .lb-lk-initial { font-size: 2rem; }
.lb-pt-links .lb-lk-desc { padding-top: 12px; -webkit-line-clamp: 2; }
.lb-pt-feature-label, .lb-pt-links .lb-lk-title {
  display: block; font-size: .9rem; font-weight: 700; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-pt-feature-caption, .lb-pt-links .lb-lk-host {
  display: block; font-size: .72rem; line-height: 1.35; color: var(--lb-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 機能ボタン（白いカード＋主色の淡いアイコン。色数を抑えたモダンな見た目。2026-11-11 のフィードバックで色分けをやめた）。
   上の面にアイコン、下に名前と説明（リンク集のタイルの .lb-lk-body と同じ余白）。名前・説明は折り返さず、狭いときは末尾を「…」にする。
   マウスを乗せると枠とアイコンが主色になり、右上に矢印が出る。 */
.lb-pt-feature {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border-radius: 16px; border: 1px solid var(--lb-line); background: var(--lb-surface);
  color: var(--lb-ink); text-decoration: none; box-shadow: var(--lb-shadow);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}
.lb-pt-feature:hover, .lb-pt-feature:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--mud-palette-primary) 45%, var(--lb-line));
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--mud-palette-primary) 45%, rgba(16, 24, 40, .3));
}
.lb-pt-feature:focus-visible { outline: 3px solid color-mix(in srgb, var(--lb-accent) 45%, transparent); outline-offset: 2px; }
.lb-pt-feature-visual {
  flex: none; height: var(--pt-tile-visual); display: grid; place-items: center;
  background: color-mix(in srgb, var(--mud-palette-primary) 6%, var(--lb-surface));
}
.lb-pt-feature-icon {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px;
  color: var(--mud-palette-primary); background: color-mix(in srgb, var(--mud-palette-primary) 12%, var(--lb-surface));
  transition: background .2s ease, color .2s ease;
}
.lb-pt-feature-icon .mud-icon-root { font-size: 1.6rem; }
.lb-pt-feature:hover .lb-pt-feature-icon, .lb-pt-feature:focus-visible .lb-pt-feature-icon {
  color: var(--mud-palette-primary-text); background: var(--mud-palette-primary);
}
.lb-pt-feature-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 11px 14px 13px; }
.lb-pt-feature-go {
  position: absolute; top: 10px; right: 10px; display: grid; place-items: center; color: var(--mud-palette-primary);
  opacity: 0; transform: translateX(-4px); transition: opacity .2s ease, transform .2s ease;
}
.lb-pt-feature:hover .lb-pt-feature-go, .lb-pt-feature:focus-visible .lb-pt-feature-go { opacity: 1; transform: none; }

/* 新着の一覧（ファイル共有の新着・QA掲示板の新着。F030 第 2 弾）。1 行＝アイコン（状態）・タイトルと補足・NEW・日付 */
.lb-pt-list { list-style: none; margin: 0; padding: 0; }
.lb-pt-list li + li { border-top: 1px dotted var(--lb-line); }
.lb-pt-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 8px; color: inherit; text-decoration: none; min-width: 0;
}
.lb-pt-row:hover { background: var(--lb-accent-soft); }
.lb-pt-row-icon {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px;
  color: var(--mud-palette-primary); background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
}
.lb-pt-row-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lb-pt-row-title { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-pt-row-sub { font-size: .72rem; color: var(--lb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-pt-row-date { flex: none; font-size: .78rem; color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.lb-pt-new {
  flex: none; padding: 0 6px; border-radius: 999px; font-size: .62rem; font-weight: 800; letter-spacing: .04em;
  color: var(--mud-palette-primary); background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent);
}
.lb-pt-status { flex: none; padding: 1px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.lb-pt-status.is-open { color: var(--mud-palette-warning); background: color-mix(in srgb, var(--mud-palette-warning) 14%, transparent); }
.lb-pt-status.is-done { color: var(--mud-palette-success); background: color-mix(in srgb, var(--mud-palette-success) 14%, transparent); }

/* ファイル共有のフォルダ（F030。2026-11-17）。上にパンくず（起点より上は出さない）、行は新着の一覧（.lb-pt-row）と同じ見た目。
   行はボタン（フォルダを開く・ビュワーで開く）。ファイルの行の右にダウンロード。長い名前は 1 行で「…」にし、title で全体を見せる。 */
.lb-pt-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0 0 6px; min-width: 0; font-size: .8rem; }
.lb-pt-crumb {
  max-width: 16em; padding: 2px 6px; border: 0; border-radius: 6px; background: none; font: inherit; color: var(--mud-palette-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.lb-pt-crumb:hover { background: var(--lb-accent-soft); }
.lb-pt-crumb.is-current { color: var(--lb-ink); font-weight: 700; cursor: default; }
.lb-pt-crumb.is-current:hover { background: none; }
.lb-pt-crumb-sep { flex: none; color: var(--lb-muted); }
.lb-pt-fb-open { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.lb-pt-fb-open:focus-visible, .lb-pt-crumb:focus-visible, .lb-pt-fb-download:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--lb-accent) 55%, transparent); outline-offset: 1px;
}
.lb-pt-fb-go { flex: none; color: var(--lb-muted); }
.lb-pt-row-icon.is-folder { color: #b7791f; background: color-mix(in srgb, #f6ad55 20%, transparent); }
.lb-pt-fb-file { display: flex; align-items: center; gap: 2px; min-width: 0; }
.lb-pt-fb-file .lb-pt-fb-open { flex: 1 1 auto; min-width: 0; }
.lb-pt-fb-download {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--lb-muted);
}
.lb-pt-fb-download:hover { color: var(--mud-palette-primary); background: var(--lb-accent-soft); }
.lb-pt-fb-more { margin-top: 4px; text-align: center; }

/* 施設対応状況のまとめ（項目ごとの ◯・× の横棒。F030 第 2 弾） */
.lb-pt-fs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 20px; }
.lb-pt-fs-row { display: flex; flex-direction: column; gap: 5px; padding: 8px 6px; border-radius: 8px; color: inherit; text-decoration: none; }
.lb-pt-fs-row:hover { background: var(--lb-accent-soft); }
.lb-pt-fs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.lb-pt-fs-name { font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-pt-fs-rate { flex: none; display: inline-flex; align-items: baseline; gap: 6px; font-size: .72rem; color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.lb-pt-fs-rate strong { font-size: .95rem; color: var(--lb-ink); }
.lb-pt-fs-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--lb-ink) 8%, transparent); }
.lb-pt-fs-bar > .is-done { background: var(--mud-palette-success); }
.lb-pt-fs-bar > .is-notdone { background: color-mix(in srgb, var(--mud-palette-error) 75%, transparent); }
.lb-pt-fs-legend { font-size: .7rem; color: var(--lb-muted); font-variant-numeric: tabular-nums; }

/* スケジュール（小さな月表示とこれからの予定） */
.lb-pt-sc { display: flex; flex-direction: column; gap: 6px; }
.lb-pt-sc-nav { display: flex; align-items: center; gap: 4px; }
.lb-pt-sc-month { min-width: 7.5em; text-align: center; font-weight: 700; }
.lb-pt-sc-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--lb-line); border-left: 1px solid var(--lb-line);
}
.lb-pt-sc-dow, .lb-pt-sc-day { border-right: 1px solid var(--lb-line); border-bottom: 1px solid var(--lb-line); }
.lb-pt-sc-dow { padding: 2px; text-align: center; font-size: .72rem; color: var(--lb-muted); }
.lb-pt-sc-day { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 76px; padding: 2px 3px; }
.lb-pt-sc-day.is-other { background: var(--mud-palette-background-gray); }
.lb-pt-sc-day.is-other .lb-pt-sc-num { color: var(--mud-palette-text-disabled); }
.lb-pt-sc-num { align-self: center; width: 1.8em; height: 1.8em; line-height: 1.8em; border-radius: 50%; text-align: center; font-size: .75rem; font-weight: 600; }
.lb-pt-sc-day.is-sun .lb-pt-sc-num { color: var(--mud-palette-error); }
.lb-pt-sc-day.is-sat .lb-pt-sc-num { color: var(--mud-palette-info); }
.lb-pt-sc-day.is-today .lb-pt-sc-num { color: var(--mud-palette-primary-text); background: var(--mud-palette-primary); }
.lb-pt-sc-chip {
  display: flex; align-items: baseline; gap: 3px; padding: 0 4px; border-radius: 4px; overflow: hidden; white-space: nowrap;
  font-size: .7rem; line-height: 1.45; text-decoration: none; color: #fff; background: var(--mud-palette-error);
}
.lb-pt-sc-chip.is-timed { color: var(--lb-ink); background: transparent; border-left: 3px solid var(--mud-palette-error); }
.lb-pt-sc-chip.is-mine { box-shadow: inset 0 0 0 1px var(--mud-palette-secondary); }
.lb-pt-sc-time { opacity: .85; font-variant-numeric: tabular-nums; }
.lb-pt-sc-title { overflow: hidden; text-overflow: ellipsis; }
.lb-pt-sc-more { padding: 0 4px; font-size: .68rem; color: var(--lb-muted); text-decoration: none; }
.lb-pt-sc-list { list-style: none; margin: 0; padding: 0; }
.lb-pt-sc-list li + li { border-top: 1px dotted var(--lb-line); }
.lb-pt-sc-item { display: flex; gap: 16px; padding: 8px 4px; color: inherit; text-decoration: none; border-radius: 6px; }
.lb-pt-sc-item:hover { background: var(--lb-accent-soft); }
.lb-pt-sc-date { flex: 0 0 12em; font-size: .85rem; color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.lb-pt-sc-item-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* 編集モード: 部品の枠を点線にし、上端のバー（種類・設定・削除）とつまみを出す。
   中身は覆い（.lb-pt-cover）で押せなくし、覆いとバーをドラッグして移動する。 */
.lb-pt-grid.is-editing { min-height: 120px; padding-bottom: 48px; }
.lb-pt-grid.is-editing .lb-pt-block { outline: 1px dashed color-mix(in srgb, var(--mud-palette-primary) 50%, var(--lb-line)); outline-offset: 3px; border-radius: 14px; }
.lb-pt-grid.is-editing .lb-pt-block:hover { outline: 2px solid var(--mud-palette-primary); }
.lb-pt-bar {
  position: absolute; z-index: 3; top: 4px; left: 4px; right: 4px; display: flex; align-items: center; gap: 4px; height: 32px;
  padding: 0 2px 0 8px; border-radius: 10px; font-size: .75rem; font-weight: 600; color: #fff;
  background: color-mix(in srgb, var(--mud-palette-primary) 88%, #000); box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
  cursor: grab; touch-action: none; user-select: none;
  opacity: 0; transition: opacity .15s ease;
}
.lb-pt-bar .mud-icon-button { color: #fff; }
.lb-pt-bar .mud-icon-button.mud-error-text { color: #ffcdd2; }
.lb-pt-block:hover .lb-pt-bar, .lb-pt-block:focus-within .lb-pt-bar { opacity: 1; }
@media (hover: none) { .lb-pt-bar { opacity: 1; } }
.lb-pt-bar-label { white-space: nowrap; }
.lb-pt-bar-tag { padding: 0 6px; border-radius: 999px; font-size: .65rem; font-weight: 600; background: rgba(255, 255, 255, .22); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-pt-bar-spacer { flex: 1 1 auto; }
.lb-pt-bar-actions { display: inline-flex; cursor: default; }
.lb-pt-cover { position: absolute; inset: 0; z-index: 2; cursor: grab; touch-action: none; border-radius: 14px; }
.lb-pt-resize { position: absolute; z-index: 4; touch-action: none; }
.lb-pt-resize::after { content: ""; position: absolute; background: var(--mud-palette-primary); border-radius: 3px; box-shadow: 0 0 0 2px var(--lb-surface); }
.lb-pt-resize.is-e { top: 25%; bottom: 25%; right: -8px; width: 14px; cursor: ew-resize; }
.lb-pt-resize.is-e::after { top: 50%; left: 5px; width: 4px; height: 28px; transform: translateY(-50%); }
.lb-pt-resize.is-s { left: 25%; right: 25%; bottom: -8px; height: 14px; cursor: ns-resize; }
.lb-pt-resize.is-s::after { left: 50%; top: 5px; width: 28px; height: 4px; transform: translateX(-50%); }
.lb-pt-resize.is-se { right: -9px; bottom: -9px; width: 20px; height: 20px; cursor: nwse-resize; }
.lb-pt-resize.is-se::after { right: 5px; bottom: 5px; width: 11px; height: 11px; border-radius: 3px; }
.lb-pt-block.is-dragging { z-index: 10; opacity: .88; cursor: grabbing; box-shadow: 0 18px 40px -12px rgba(16, 24, 40, .45); }
.lb-pt-block.is-dragging .lb-pt-cover, .lb-pt-block.is-dragging .lb-pt-bar { cursor: grabbing; }
.lb-pt-block.is-resizing { z-index: 10; }
.lb-pt-grid.is-dragging { user-select: none; }
.lb-pt-ghost {
  z-index: 1; pointer-events: none; border-radius: 14px; border: 2px dashed var(--mud-palette-primary);
  background: color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
}

/* 部品の設定ダイアログ */
.lb-pt-form { display: flex; flex-direction: column; gap: 12px; }
.lb-pt-field-label { font-size: .8rem; font-weight: 600; color: var(--lb-muted); }
.lb-pt-hint { font-size: .75rem; color: var(--lb-muted); }
.lb-pt-image-field { display: flex; flex-direction: column; gap: 6px; }
.lb-pt-image-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lb-pt-checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 8px; max-height: 300px; overflow: auto; }
.lb-pt-order {
  display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; margin-right: 6px; border-radius: 999px;
  font-size: .7rem; font-weight: 700; color: var(--mud-palette-primary-text); background: var(--mud-palette-primary);
}
/* 機能ボタンの並べ替え（設定ダイアログ。チェックで表示・矢印で並びを変える） */
.lb-pt-sortlist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--lb-line); border-radius: 8px; max-height: 320px; overflow: auto; }
.lb-pt-sortlist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 0 2px; }
.lb-pt-sortlist li + li { border-top: 1px dotted var(--lb-line); }
.lb-pt-sortlist li.is-off { color: var(--lb-muted); }
.lb-pt-sortlist-actions { flex: none; display: inline-flex; }
.lb-pt-position { border-top: 1px solid var(--lb-line); padding-top: 8px; }
.lb-pt-position summary { cursor: pointer; font-size: .85rem; font-weight: 600; }
.lb-pt-position-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 4px; }

/* 画面の幅が狭いとき: 部品を上から・左からの順に 1 列に並べ、高さは中身に合わせる（マス目の高さで中身を切らない）。 */
@media (max-width: 699.98px) {
  .lb-pt-grid { display: flex; flex-direction: column; }
  .lb-pt-content { overflow: visible; }
  .lb-pt-features, .lb-pt-links { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .lb-pt-block.is-banner { min-height: 180px; }
  .lb-pt-block.is-heading { min-height: 56px; }
  .lb-pt-resize { display: none; }
  .lb-pt-position-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-pt-sc-day { min-height: 56px; }
  .lb-pt-sc-time { display: none; }
  .lb-pt-sc-item { flex-direction: column; gap: 2px; }
  .lb-pt-sc-date { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lb-pt-feature, .lb-pt-feature-icon, .lb-pt-feature-go, .lb-pt-float, .lb-pt-bar, .lb-nav-children .mud-nav-link, .lb-nav-children::before { transition: none; }
}

/* =========================================================
   スマホ表示の共通調整（全画面）
   - ボタン・切り替えボタン・タブの文字は改行させない。並びに入りきらないときは、ボタンごと次の行へ回す
     （ボタンが縮んで「一 / 括 / 設 / 定」のように 1 文字ずつ改行されて読みにくかったため）。
   - 管理・設定・取り込み・ファイル出力など使う機会の少ない操作は「⋮」（Shared/MoreActionsMenu）にまとめる。
     項目の説明は <div class="lb-menu-note"> で書く。基準は .claude/rules/ui-design.md「操作ボタンの置き方」。
   - スマホ幅では、画面の表のセルを改行させず、表の枠（lb-tscroll など）で横にスクロールさせる
     （列が細くなってメーカー名などが 1 文字ずつ改行されていたため）。
     長い文章の列（品目名・備考・本文など）は、セルに lb-wrap を付けると適度な幅で折り返す。
     :where() で詳細度を 0 にしてあるので、各画面でセルに改行の指定（折り返す・省略するなど）がある列はそちらが優先される。
     カードの形に組み替える表（lb-adm-table・lb-ct-table）と、列幅を固定している表（lb-qal-table）は対象外。
   ========================================================= */
.mud-button-root .mud-button-label,
.mud-toggle-item,
.mud-tab { white-space: nowrap; }
.lb-head-actions { flex-wrap: wrap; justify-content: flex-end; }
.lb-card-head { flex-wrap: wrap; gap: 8px 12px; }
.lb-menu-note { font-size: .72rem; line-height: 1.45; color: var(--lb-muted); margin-top: 2px; white-space: normal; max-width: 34ch; }

/* 表の枠: 横にはみ出す表を、表の枠の中で横にスクロールさせる（枠を持たない表に付ける） */
.lb-xscroll { overflow-x: auto; max-width: 100%; }

@media (max-width: 599.98px) {
  /* ページ見出し: タイトルと操作の間を詰め、操作は左寄せで折り返す */
  .lb-head { gap: 10px; margin-bottom: 14px; }
  .lb-title { font-size: 1.3rem; }
  .lb-head-actions { justify-content: flex-start; }

  /* 切り替えボタン（MudToggleGroup）は縮めずに、入りきらない分は横にスクロールさせる */
  .lb .mud-toggle-group { max-width: 100%; overflow-x: auto; }

  /* 画面の表（ダイアログは対象外）: セルを改行させない */
  :where(.lb .mud-main-content table:not(.lb-adm-table, .lb-ct-table, .lb-qal-table)) :where(th, td) { white-space: nowrap; }
  .lb .mud-main-content .lb-wrap { white-space: normal; min-width: 11em; max-width: 18em; overflow-wrap: anywhere; }
}

/* =========================================================
   電波の悪い回線での表示（F004 §9）
   ========================================================= */

/* 回線の準備ができるまで（最初の HTML のまま操作できない間）上端に出す読み込み中の帯（MainLayout）。
   ui-state.js が <html> に lb-ready を付けると消える。すぐ準備できたときにちらつかないよう、0.3 秒待ってから出す。 */
.lb-boot-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2500; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--mud-palette-primary) 50%, transparent 100%);
  background-size: 50% 100%; background-repeat: no-repeat;
  opacity: 0; animation: lb-boot-bar-in 0s linear .3s forwards, lb-boot-bar-move 1.2s ease-in-out .3s infinite;
}
html.lb-ready .lb-boot-bar { display: none; }
@keyframes lb-boot-bar-in { to { opacity: 1; } }
@keyframes lb-boot-bar-move { from { background-position: -100% 0; } to { background-position: 200% 0; } }

/* サーバーとの接続が切れている間（ReconnectModal.razor.js が <html> に lb-offline を付ける）。
   押した操作はサーバーに届かず消えるため、上端の帯（再接続の表示）のほかは押せなくする。
   短い途切れで画面がちらつかないよう、暗くするのは 1.5 秒続いてから。 */
html.lb-offline body > :not(#components-reconnect-modal) { pointer-events: none; }
html.lb-offline .mud-layout { opacity: .55; transition: opacity .3s ease 1.5s; }

/* ---- 通信の診断（/connection-check。ConnectionCheck.razor・js/connection-test.js） ---- */
.lb-conn-test { padding: 18px 20px 20px; }
@media (max-width: 599.98px) { .lb-conn-test { padding: 14px 14px 16px; } }
.lb-conn-test-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 8px; }
.lb-conn-test-lead { margin: 0 0 10px; line-height: 1.7; }
.lb-conn-test-note { margin: 10px 0 0; font-size: .85rem; color: var(--lb-muted); }
.lb-conn-test-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0; }
.lb-conn-test-copy {
  border: 1px solid var(--mud-palette-lines-default); background: transparent; color: inherit;
  border-radius: 4px; padding: 5px 14px; cursor: pointer; font: inherit; white-space: nowrap;
}
.lb-conn-test-rtt { color: var(--lb-muted); font-size: .9rem; }
.lb-conn-test-result { overflow-x: auto; }
.lb-conn-test-summary { font-weight: 600; margin: 8px 0; }
.lb-conn-test-summary.is-ok { color: var(--mud-palette-success); }
.lb-conn-test-summary.is-ng { color: var(--mud-palette-error); }
.lb-conn-test-meta { font-size: .75rem; color: var(--lb-muted); margin: 6px 0 0; overflow-wrap: anywhere; }
.lb-conn-test-table, .lb-conn-test-guide { border-collapse: collapse; width: 100%; font-size: .9rem; }
.lb-conn-test-table :is(th, td), .lb-conn-test-guide :is(th, td) {
  border: 1px solid var(--mud-palette-lines-default); padding: 6px 10px; text-align: left; vertical-align: top;
}
.lb-conn-test-table th, .lb-conn-test-guide th { background: var(--mud-palette-background-gray); white-space: nowrap; }
.lb-conn-test-table td:first-child, .lb-conn-test-table td:nth-child(2) { white-space: nowrap; }
.lb-conn-test-table td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; min-width: 14em; }
/* 説明の表は文章なので、スマホでもセルの中で折り返す（スマホ表示の共通調整はセルを改行させない） */
.lb-conn-test-guide td { white-space: normal; overflow-wrap: anywhere; }
.lb-conn-test-guide td:first-child { min-width: 8em; }
.lb-conn-test-table .is-ok { color: var(--mud-palette-success); font-weight: 700; }
.lb-conn-test-table .is-ng { color: var(--mud-palette-error); font-weight: 700; }
.lb-conn-test-table .is-skip { color: var(--lb-muted); }
