/* RECOG Design System v2 — cache-bust */
  :root {
    /* Brand */
    --brand-navy: #001951;
    --brand-navy-600: #0B2C7A;
    --brand-navy-50: #EEF0FB;
    --brand-navy-100: #DCE1F3;
    --brand-navy-200: #D5DCEF;

    /* Banner の枠と面。**tag のトーンとは別のランプ**で、tag より一段濃い
       （tag danger 枠 #FDC7C7 / banner danger 枠 #F3C3C3）。同じ役割に見えても値が違うので
       別に持つ——寄せると色が変わる（DS 監査 2026-09-01 に実際に変えてしまって戻した）。 */
    --banner-info-border:    #C7D0EC;
    --banner-success-border: #B8E8DB;
    --banner-warning-border: #F5DC8E;
    --banner-warning-bg:     #FFF9E6;
    --banner-danger-border:  #F3C3C3;
    /* 記事本文の「注意」の囲みの地。**ヒントと同じ薄さの赤**で、`--bg-danger`（#FEE2E2）は
       使わない——あれはエラーの帯の地で、読み進める文章の途中に置くと「そこで止められている」
       ように見える。ヘルプの読者側（`.hc-callout.is-caution`）と編集側（`.recog-callout`）の
       **両方がこれを見る**ので、DS に置く（2 か所に書くと必ず片方だけ変わる）。 */
    --hc-caution-bg:         #FDEDEE;
    --banner-magenta-border: #F3BFCD;
    /* アイコン選択の既定セルの枠（`.tag--brand` の #D5DCEF とは別値）。 */
    --icon-cell-border:      #CDD4EC;
    /* `.tag--subtle` の枠と文字（gray-100 / chart-ink とは別値）。 */
    --tag-subtle-border:     #E0E3EB;
    --tag-subtle-text:       #4D5A82;
    /* Notion select-option colors (bg / text). Used where a value was managed in Notion and staff
       know it by its Notion color — e.g. 契約管理's 契約種別. Same values as Notion's light theme. */
    --notion-gray-bg:        #E3E2E0;  --notion-gray-text:   #32302C;
    --notion-brown-bg:       #EEE0DA;  --notion-brown-text:  #442A1E;
    --notion-orange-bg:      #FADEC9;  --notion-orange-text: #49290E;
    --notion-yellow-bg:      #FDECC8;  --notion-yellow-text: #402C1B;
    --notion-green-bg:       #DBEDDB;  --notion-green-text:  #1C3829;
    --notion-blue-bg:        #D3E5EF;  --notion-blue-text:   #183347;
    --notion-purple-bg:      #E8DEEE;  --notion-purple-text: #412454;
    --notion-pink-bg:        #F5E0E9;  --notion-pink-text:   #4C2337;
    --notion-red-bg:         #FFE2DD;  --notion-red-text:    #5D1715;

    /* Neutrals (from Tailwind slate-like tokens used in file) */
    --gray-0:   #FFFFFF;
    --gray-50:  #F3F4F6;
    --gray-100: #E5E7EB;
    --gray-200: #D1D5DB;
    --gray-300: #9CA3AF;
    /* 400〜600 と 950 は、このファイル内で生の hex として使われていた段。名前を与えて拾えるようにした
       （既存の 0/50/100/200/300/900 の値と名前は変えていない）。 */
    --gray-400: #6B7280;
    --gray-500: #4B5563;
    --gray-600: #374151;
    --gray-900: #1F2937;
    --gray-950: #111827;

    /* Semantic colors */
    --red-500:    #DC2626;
    /* 赤の面に乗せる文字・アイコン（`.tag--danger` の文字色と同じ濃さ）。フォールバックとして
       各所に散っていた #B42121 に名前を与えたもの。 */
    --red-600:    #B42121;
    /* tag / banner のトーンが使う段階。**枠は 200、面の上の文字は 700〜800。**
       ここが無かったので各トーンが生 hex を持っていた（DS 監査 2026-09-01）。 */
    --red-50:     #FEE2E2;
    --red-100:    #FBD5D5;   /* 50 と 200 の間。`var(--red-100)` を参照する箇所があった */
    --red-200:    #FDC7C7;
    --red-800:    #991B1B;
    --amber-500:  #F59E0B;
    /* amber の面に乗せる文字の 2 段。見出し（700）と本文（600）で濃さを分ける。
       `--text-warning`（#B25209）はちょうどこの 2 色の中間だが、amber の帯は
       「注意」ではないので warning の意味を持つトークンは使わない。 */
    --amber-700:  #92510A;
    --amber-600:  #C47C10;
    --amber-50:   #FEF3C7;
    --amber-200:  #FCE0A3;
    --amber-800:  #92400E;
    --amber-25:   #FFFBEB;      /* amber-50 より薄い面。グラデの明るい側の止め（`.lc-react`） */
    /* 銅メダル。金＝amber / 銀＝gray では 3 位を出せないので、受賞歴の 3 位専用に持つ
       （Figma design-system 1238:78484 の #FFE8D1 / #BA661B / #8F4E14）。 */
    --bronze-700: #8F4E14;
    --bronze-500: #BA661B;
    --bronze-50:  #FFE8D1;
    --teal-500:   #0E9E8A;
    /* 文字色として使える濃さの teal。`--teal-500`/`--teal-600` は白の上で 3.3〜3.4、
       `--teal-50` の上で 3.0 しか無く、本文サイズの 4.5:1 を満たさない（塗り・アイコン用）。
       値は `.tag--success` が直書きしていた #0B7B65（白 5.20 / teal-50 4.70）を昇格したもの。 */
    --teal-700:   #0B7B65;
    --teal-600:   #1D9E75;
    --teal-50:    #E6F7F3;
    --teal-200:   #BDE5D9;
    --teal-800:   #0E7A65;
    --magenta-500:#C42D58;
    --magenta-50: #FCE7EF;
    --magenta-100:#F9DDE7;   /* .icotxt.is-on の hover。50 と 200 の間が空いていた */
    --magenta-200:#F5C1D2;
    --magenta-700:#9C1F3E;
    --magenta-800:#92254A;
    --magenta-glow: rgba(196,45,88,.18); /* SaveBar 等の attention pulse 用の半透明アクセント */
    /* AI アクション（「AIで気持ちを伝える」など）。navy の主要操作と競合させないための独立色。
       Figma design-system 644:24058 の #5D5FEF。 */
    --indigo-500: #5D5FEF;
    --indigo-600: #4B4DDB;
    --purple-500: #9747FF;
    --purple-50:  #F1E8FF;
    --purple-200: #DCC5F5;
    --purple-700: #6E2BC5;

    /* 青の階調（プリミティブ）。`--brand-navy` は「ブランドの主役」という意味を持つトークンで、
       ダークでは明るい側へ振れる（意味が先、色は後）。こちらは意味を持たない素の階調で、
       グラフの系列のように「同じ色で濃淡だけ変えたい」場面が使う。50→900 で濃くなる。
       両端と中間は既存の値（brand-navy-50/100, brand-navy-600, brand-navy）と一致させてあるので、
       画面の中で青が2系統に割れることはない。運用は `/design-rules/colors`。 */
    /* ================= 分析画面のチャート・パレット =================
       出典は `PC/sample/recog_usage2_spec.md` §1.1（親仕様）と各画面の仕様書。
       **画面側に生 hex を書かない。** ここに無い色が要るときは、まずこの表に足す。

       ・面（figure）はクロームより淡い。濃紺 `--brand-navy` はタイトル・見出し・選択中 UI の
         色で、図の面に同じ濃さを置くと、画面でいちばん強いインクが図と枠の両方になる。
       ・ダークでは既存の青階調に寄せる（値ではなく役割で持つ）。 */

    /* 系列。濃い側＝毎月値がある主系列 / 淡い側＝散発的に出る系列。 */
    --chart-primary:   #3B5A9E;  /* 主系列。単独の系列も常にこれ */
    /* 対等な 2 本目（PC/スマホ、送信/受信…）。**階調を指す**——生の値だと
       ライト 2.53 / ダーク 2.67 で 3:1 を割っていた（系列そのものなので 1.4.11 の対象）。
       `--blue-400` はライト 3.27 / ダーク 3.40 で、両テーマで通る（DS-31）。 */
    --chart-sub:       var(--blue-400);
    --chart-2:         #7D93C4;  /* 積み上げの 3 段目 */
    --chart-muted:     #8592A6;  /* 基準ではない項目・比較対象。#B9C0CC は 1.83 で割れていた */
    --chart-baseline:  #8491AE;  /* 基準線の破線。#8F9BB5 は 2.79 で 3:1 をわずかに割っていた */

    /* 表の中の棒（`MetricCell`）。値＝面 / 器＝最大値までの残り。 */
    --table-bar:       #425999;
    --table-bar-track: #EEF0F5;

    /* クローム。区画の枠・面・文字。 */
    --chart-ink:       #1B2233;  /* 図の中の文字（項目名・値ラベル） */
    --chart-ink-sub:   #6B7385;  /* 図の中の弱い文字（役割・注記） */
    --chart-ink-70:    #4A5A85;  /* ラベルのピル文字 */
    --chart-line:      #E2E5EC;  /* 区画・カードの罫線 */
    --chart-line-soft: #DFE3EC;  /* 破線のラベル枠 */
    --chart-surface:   #EEF0F5;  /* 淡い面（ラベルの地・グリッド線） */

    /* 状態。**面積は画面全体の数パーセントに収める**（5.2-C ③）。 */
    --chart-bad:       #C0392B;  /* 悪化・基準を下回る */
    --chart-good:      #1F7A5C;  /* 改善 */

    --blue-50:  #EEF0FB;
    --blue-100: #DCE1F3;
    --blue-200: #C6DEF5;
    --blue-300: #7FB3E8;
    --blue-400: #5B8FDE;
    --blue-500: #3F72D4;
    --blue-600: #2450AF;
    --blue-700: #12358F;
    --blue-800: #0B2C7A;
    --blue-900: #001951;

    /* Background tokens */
    --bg-page:        #FAFAFA;
    --bg-default:     #FFFFFF;
    --bg-canvas:      #F5F6F8;
    --bg-subtle:      #F3F4F6;
    --bg-danger:      #FEE2E2;
    --bg-unread:      #EEF0FB;
    /* 一覧を区切る見出しの帯（`.tf-section`）。**青寄りのグレー**にしてある——中立の
       `--gray-100`（#E5E7EB, B-R=+6）だと、この列の他の面が全部青寄り（未読 #EEF0FB は
       B-R=+13、選択中は濃紺）なので、帯だけ色温度が浮いて別の素材に見えた。
       未読の面（#EEF0FB）より一段濃くして、見出しと未読の行を混同させない。 */
    --bg-section:     #E7EAF2;
    /* ファイルの**種類**の識別色。状態の色（`--fill-danger` など）とは別の軸で、
       ロゴに近い「素性の印」。赤系だが `--red-500` は使わない——あれは削除・エラー専用で、
       ファイルの種類に流用すると赤の意味が薄まる（PC/CLAUDE.md のカラー運用）。
       白い文字を載せるので `--fill-*` と同じ条件（両テーマで 4.5:1）を満たす値にする。 */
    --fill-file-pdf:   #A6314A;
    --fill-file-sheet: #17694A;
    --fill-file-doc:   #1B4F97;
    /* 画像・動画・リンクの識別色（2026-09-21、ファイル一覧）。pdf / sheet / doc と同じ家系で、
       いずれも白文字が乗る濃さ（`check-on-fill-contrast.py` で確認する）。 */
    --fill-file-img:   #0F6B5C;
    --fill-file-mov:   #4B3A9E;
    --fill-file-link:  #8A5A16;

    /* Interactive */
    --int-hover:      #E5E7EB;
    --int-selected:   #E0E7FF;
    --int-brand:      #001951;
    --int-brand-h:    #0B2C7A;
    --int-disabled:   #F3F4F6;

    /* Text tokens */
    --text-primary:     #1F2937;
    --text-secondary:   #4B5563;
    /* 文字の段階は**ページの面だけでなく「行に敷かれる面」の上でも 4.5 を通す**こと。
       DS-02 の掃除は --bg-default / -page / -canvas / -subtle / -unread の5面しか見ておらず、
       hover・選択・未読のホバーで敷かれる面が一覧に無かった（DS-17）。
       いちばん濃い状態面は `--brand-navy-100`（未読行のホバー）。
       確認：python3 PC/tools/check-text-contrast.py web/public/recog-design-system.css */
    --text-tertiary:    #5E6471;
    --text-placeholder: #5E646F;
    --text-disabled:    #D1D5DB;
    /* **`var(--x, #hex)` のフォールバックは書かない（2026-09-01 に77箇所削除）。**
       トークンはこのファイルの `:root` に必ず在るのでフォールバックは到達不能で、
       **57箇所は値が食い違っていた**——`var(--gray-200, #E5E7EB)`（実値 #D1D5DB）、
       `var(--text-tertiary, #6B7280)`（DS-02 で #656C7A に直した後の残骸）など。
       読み手はフォールバックを「その色」と誤読するし、トークンを直しても追従しない。 */

    /* 塗りの上に載る文字・アイコン。navy / red / teal などの面に置く。
       白そのものだが、**意味が「面の上の文字」なので背景の白（--bg-default）とは別に持つ**
       ——ダークテーマで面の色が変わっても、面の上の文字は白のままでよい場面がある。 */
    --text-on-fill:     #FFFFFF;

    /* ── 塗りの上に白い文字を置くための面（2026-09-02 追加・known-issues DS-23）
       **パレットを直に塗りに使わない。** ダークではパレットが反転するので、
       `--red-500` は #F26D6D（明るい赤）になり、その上の白い文字が 2.92 に落ちる。
       `--gray-900` はダークで #E6E9EE（ほぼ白）になり、トーストの白文字が 1.22 で消えた。
       ここに置く値は**両テーマで白が 4.5:1 を通る**（相対輝度 ≤ 0.1833）ことを条件とする。
       navy（`--brand-navy` / `--int-brand`）は両テーマで暗いので、そのまま塗りに使える。 */
    --fill-danger:       var(--red-500);      /* 白 4.83 / 4.83 */
    --fill-magenta:      var(--magenta-500);  /* 白 5.44 / 5.44 */
    --fill-ai:           var(--indigo-500);   /* 白 4.83 / 4.83 */
    --fill-ai-strong:    var(--indigo-600);   /* .btn--ai の hover。白 6.21 / 6.21 */
    /*
      AI の塗りのグラデーション（藍 → 菫）。`/settings/mypage3-1` の「AIで気持ちを伝える」が
      持っていた見た目を**トークンにして 1 か所に置く**（2026-09-28、依頼で `/settings/letters2`
      にも合わせた）。

      元は #6a7ff0 → #8f6ae8 だったが、**白い文字が 3.56 / 3.89 で 4.5:1 を割っていた**ので
      14% 落とした（実測 4.72 / 5.13）。色みは変えていない。
    */
    --fill-ai-grad:      linear-gradient(120deg, #5A6CCC 0%, #7A5AC5 100%);
    --fill-ai-grad-strong: linear-gradient(120deg, #4F60BC 0%, #6C4EB4 100%);
    --fill-success:      var(--teal-700);     /* 白 5.20 / 5.20（--teal-500 は 3.35 で通らない） */
    --fill-inverse:      var(--gray-900);     /* 白 14.68 / 13.44。ダークは階段の反対端を指す */
    --fill-neutral:      var(--gray-500);     /* 白 7.56 / 4.83 */
    --fill-brand-strong: var(--int-brand-h);  /* navy の塗りの hover・選択中。白 12.68 / 5.79 */
    /* 琥珀だけは例外。白が通るまで落とすと #A26907 の茶色になり警告の色みが消えるので、
       **色を保って文字側を濃くする**（琥珀・黄に濃い文字は定石）。 */
    --fill-warning:      var(--amber-500);
    /* 押している最中の primary。以前は `.btn--primary:active` に生 hex で置いていて、
       **テーマに反応しなかった**——ダークでは base が明るい navy になるのに、押すと
       いきなり真っ暗になっていた（2026-09-02・DS-28）。 */
    --fill-brand-active: #0A1F5E;
    /* アバターの下地（画像が載るまでの色）。`.avatar` は #C8D0E4、`.letter-avatar` と
       `.na-fi-av` は #D9D9D9 と**同じ役割で色が2つ**あった。役割は1つなので揃える。 */
    --avatar-bg:         #C8D0E4;
    --text-on-warning:   #3D2A00;             /* 琥珀の上で 6.39 / 7.28 */
    /* 成功トーストは**ブランド色（navy）の塗り**にした（2026-09-18）。以前は青→シアンの
       グラデーション（`--toast-success-from/-to`）で、RECOG の主色とは別の色が
       「保存できた」の色として画面に出ていた。navy は両テーマで暗く、白が 12.68 / 4.65 を
       通るのでそのまま塗りに使える（`.btn--primary` と同じ `--brand-navy`）。
       **失敗は navy にしない**——結果が違うものは色も違えないと、色で区別できない。 */
    --text-brand:       #001951;
    --text-danger:      #A31919;
    --text-success:     #137154;
    --text-warning:     #A24A08;

    /* Border */
    /* **操作要素の輪郭専用**（WCAG 1.4.11 は 3:1）。入力欄・セレクト・アイコンボタン・
       チェックボックスなど「どこを操作するか」を境界で示すものはこれを使う。
       **トーンの面（red-50 等）も含めて**全面で 3:1 を満たす最も明るい値
       （白 3.71 / bg-page 3.55 / bg-subtle 3.37 / bg-unread 3.27 / 最悪は red-50 の 3.03）。
       トーンの面を数えるのは、**banner の中に secondary ボタンが入る**——その面の上でも
       輪郭が見えないといけないため（5面だけで決めて red-50 で 2.83 に落ちた）。
       **装飾の枠（カード・表の外枠）には使わない**——一律に濃くすると罫線だらけになる。
       `.input` の塗り（白）とページの地（#FAFAFA）の差は 1.05:1 しかなく、
       **塗りでは境界を代替できない**ので境界が 3:1 を負う（known-issues DS-14）。 */
    --border-control:  #828589;
    --border-default:  #D1D5DB;  /* 装飾の枠（カード・表の外枠）。操作要素には --border-control */
    --border-subtle:   #E5E7EB;  /* default より薄い区切り（modal header/footer 等） */
    --border-strong:   #9CA3AF;  /* WCAG: 3.0:1 達成 (外枠・hover state 用) */
    --border-focus:    #001951;
    /* 選択中・現在・オンを示す「印」の色（2026-09-02・known-issues DS-19）。
       状態の面（`--brand-navy-50` 1.14 等）は素の面と 3:1 に届かないので、**色以外の印**
       ——左バー・下線・輪郭——で示す。その印は 1.4.11 で 3:1 が要る。
       **`--brand-navy` は使えない**：ダークの `--brand-navy-100` の上で 2.67 と割る。
       `--border-focus` も流用しない（フォーカスと選択が同じ見え方になる）。
       この値は全状態面の上で最小 3.75。 */
    --border-selected: #001951;
    /* ── メインナビ（`.gn`）。**明暗どちらのテーマでも濃紺のまま**にする（`.an-hero` と
       同じ扱い）——テーマで反転させると、明るいテーマでは主役・暗いテーマでは背景、という
       別の扱いになってしまう。面が固定なので、その上に載る色も固定でよい。
       白い文字は濃紺の上で 16.69。 */
    --gn-bg:           #001951;
    --gn-fg:           #FFFFFF;
    --gn-chip:         rgba(255, 255, 255, 0.12);   /* hover のチップ */
    --gn-divider:      rgba(255, 255, 255, 0.16);
    --border-brand:    #001951;
    --border-danger:   #DC2626;
    --border-disabled: #E5E7EB;

    /* Legacy thread tab (/threads), ported pixel-for-pixel from the old Angular
       posts_feed_ver2.scss. Used only by components/screens/threads/Legacy*.
       The DS has no mid-blue on purpose (see .rxn-chip.is-on); this palette is
       scoped to that one screen and must not leak into other components. */
    --legacy-blue:       #3D81C6;   /* buttons, hashtag text, selected chip */
    --legacy-active-bg:  #EFF6FB;   /* hover / active row */
    --legacy-border:     #E1E1E1;
    --legacy-muted:      #828282;   /* team path above a thread name */
    --legacy-badge:      #FF2828;   /* unread count, filter count */
    --legacy-pill-bg:    #F2F2F2;   /* member-count pill */
    --legacy-feed-bg:    rgba(242, 242, 242, 0.30);
    --legacy-text:       #333333;   /* post body, author name */
    --legacy-time:       #616770;   /* post timestamp */
    --legacy-link:       #337AB7;   /* link preview, file actions */
    --legacy-link-border:#E4E3E3;   /* link preview frame */
    --legacy-card-shadow: 3px 3px 4px 0 rgba(7, 0, 2, 0.40);
    --legacy-gold:       #BDA12F;   /* ranking 1st name */
    --legacy-rule:       #CCCCCC;   /* hr and blockquote bar in post bodies (Quill) */
    --legacy-frame:      #B4B4B4;   /* hot word / new member box */
    --legacy-gold-light: #CAB44A;   /* month-end ranking name */
    --legacy-silver:     #999DA0;   /* ranking 2nd name */
    --legacy-bronze:     #BA661B;   /* ranking 3rd name */
    --legacy-check-border: #A9A9A9; /* checkbox frame (bookmark tutorial) */
    --legacy-strong:     #373737;   /* emoticon search results title */
    --legacy-selected-bg: #DBE4F4;  /* reaction the viewer has added */
    --legacy-title-bg:   #E5E5E5;   /* title bar of the viewers / reacters lists */
    --legacy-hairline:   #E6E6E6;   /* divider between people in those lists */
    --legacy-menu-line:  #B4B4B4;   /* post menu frame and dividers */
    --legacy-menu-text:  #011B50;   /* post menu items */
    --legacy-menu-hover: rgba(0, 25, 81, 0.10);
    --legacy-label:      #7C87A2;   /* "Search:" / "Selecting:" in pickers */
    --legacy-input-line: #CCCCCC;   /* picker search box, calendar frame */
    --legacy-ink:        #1E1E1E;   /* people rows in the publisher picker */
    --legacy-row-hover:  #F2F3F6;
    --legacy-check:      #5FBB33;   /* chosen person tick */
    --legacy-search-bg:  #EEEEEF;   /* thread picker search */
    --legacy-cal-bg:     #F6F6F6;   /* date range calendar */
    --legacy-cal-muted:  #999999;   /* weekday titles, days after today */
    --legacy-cal-range:  #E2E1EB;   /* days inside the picked range */
    --legacy-tag-label:  rgba(0, 25, 81, 0.40); /* "Selecting:" in the hashtag picker */

    /* Shadow (elevation) */
    --shadow-1: 0 1px 2px rgba(0,25,81,.08), 0 0 0 1px rgba(0,0,0,.02);
    --shadow-2: 0 2px 6px rgba(0,25,81,.10), 0 0 0 1px rgba(0,0,0,.02);
    --shadow-3: 0 8px 24px rgba(0,25,81,.12), 0 2px 6px rgba(0,25,81,.08);
    --shadow-4: 0 4px 12px rgba(0,25,81,.10), 0 0 0 1px rgba(0,0,0,.02);
    --shadow-8: 0 8px 16px rgba(0,25,81,.10), 0 0 0 1px rgba(0,0,0,.02);
    --shadow-16:0 16px 32px rgba(0,25,81,.13), 0 0 0 1px rgba(0,0,0,.04);
    --shadow-24:0 24px 48px rgba(0,25,81,.16), 0 0 0 1px rgba(0,0,0,.04);
    --shadow-focus: 0 0 0 3px rgba(99,102,241,.25);

    /* Radius */
    --r-2:    2px;
    --r-4:    4px;
    /* 6px の段。**欠けていたので `var(--r-6)` を参照する42箇所が角丸 0 になっていた**
       （CSS 側では生の `border-radius: 6px` が38回出ている＝実在する段階）。2026-09-02・DS-29 */
    --r-6:    6px;
    --r-8:    8px;
    --r-12:   12px;   /* メインナビのアイコンチップ */
    --r-10:   10px;
    --r-16:   16px;

    /* Spacing (4px sub-unit, 8px unit) */

    /* Type */
    --ff-sans:    'Plus Jakarta Sans','Noto Sans JP','Hiragino Kaku Gothic ProN','Hiragino Sans','Yu Gothic',system-ui,sans-serif;
    --ff-display: 'Plus Jakarta Sans','Noto Sans JP',sans-serif;
    --ff-mono:    'JetBrains Mono','SFMono-Regular',Menlo,monospace;

    /* Layout — シェルの寸法。確定仕様は PC/recog-design-system.md。
       ヘッダー高さは `calc(100vh - …)` として画面側からも参照されるので、
       数値を各所に直書きせず必ずこのトークンを使う。 */
    --gh-h: 52px;

    /* **読むカラム**の上限。**幅を止めるのはここだけ。**
       シェル・行・カラムに max-width を掛けない——SideNav が中央に寄る、季節背景が
       全幅に伸びなくなる、の2通りで失敗している（PC/recog-design-system.md 1-4）。
       2 つあるのは中身の性格が違うため。数値を画面に直書きしない。 */
    /* 文章を読む列（レター・スレッド）。和文16pxで43字＝#14 の50字を構造的に超えない。 */
    --read-max: 720px;
    /* 図表が主役の列（プロフィールの成長履歴・資格・職歴）。1 本の文章ではないので
       行長の制約が効かず、720px だと図が窮屈になる。 */
    --read-max-wide: 1084px;
    /* アプリの下限。ここより狭くはしない（レスポンシブ対応しない）。 */
    --app-min-w: 1280px;
  }

  /* =====================================================
     Dark mode — カラートークンだけを上書き（全コンポーネントは
     トークン参照なので、ここを差し替えるだけで暗転する）。
     有効化: <html data-theme="dark">
     ===================================================== */
  :root[data-theme="dark"] {
    /* トーンの段階（2026-09-01 追加）。**ライトの値を継承すると読めない**——
       `--red-800`(#991B1B) はダークの danger 面(#3A1F1F)の上で 1.81 だった。
       ライトのトーンは生 hex だったのでテーマに反応せず、**元から壊れていた**。
       トークンにしたので直せるようになった（known-issues DS-22）。
       文字は面の上で 4.5 以上・色相維持。枠は装飾なので 3:1 は問わず、面を1段明るく。
       ダークのパレットの作法どおり、文字の段階（600〜800）は明るい側へ倒す。 */
    --red-100:                  #4A2828;
    --red-200:                  #5D3232;
    --red-800:                  #E46767;
    --teal-200:                 #1D4D42;
    --teal-700:                 #0FA98A;
    --teal-800:                 #13A98C;
    --amber-200:                #5A481D;
    --amber-800:                #EB7832;
    --magenta-200:              #5D3245;
    --magenta-700:              #E16A88;
    --magenta-800:              #DA6D92;
    --purple-200:               #40305D;
    --purple-700:               #A475E1;
    --brand-navy-200:           #39456C;
    --icon-cell-border:         #39456C;
    --tag-subtle-border:        #393F4C;
    --tag-subtle-text:          #B6BDC8;
    /* Notion select-option colors, dark theme (Notion's own dark values). */
    --notion-gray-bg:           #5A5A5A;  --notion-gray-text:   #FFFFFFCF;
    --notion-brown-bg:          #603B2C;  --notion-brown-text:  #FFFFFFCF;
    --notion-orange-bg:         #854C1D;  --notion-orange-text: #FFFFFFCF;
    --notion-yellow-bg:         #89632A;  --notion-yellow-text: #FFFFFFCF;
    --notion-green-bg:          #2B593F;  --notion-green-text:  #FFFFFFCF;
    --notion-blue-bg:           #28456C;  --notion-blue-text:   #FFFFFFCF;
    --notion-purple-bg:         #492F64;  --notion-purple-text: #FFFFFFCF;
    --notion-pink-bg:           #69314C;  --notion-pink-text:   #FFFFFFCF;
    --notion-red-bg:            #6E3630;  --notion-red-text:    #FFFFFFCF;
    --banner-info-border:       #2B3350;
    --banner-success-border:    #184137;
    --banner-warning-border:    #4C3D18;
    --banner-danger-border:     #4E2A2A;
    --hc-caution-bg:            #331D20;
    --banner-magenta-border:    #4E2A3A;

    /* 塗りの面（DS-23）。ライトの -500 はダークでも白が通るので、**同じ値を使う**
       ——色を発明せず、テーマ間で danger / magenta / ai / success の色みが揃う。
       グレーの階段はダークで反転するため、`--fill-inverse` / `--fill-neutral` だけ
       反対端の段階を指す。`--fill-brand-strong` は base(#4F6BE0) が 4.65 で余裕が無いので、
       **ダークでは hover を暗い側へ倒す**（ライトは明るい側。方向がテーマで反転する）。 */
    --fill-danger:              #DC2626;
    --fill-magenta:             #C42D58;
    --fill-ai:                  #5D5FEF;
    --fill-ai-strong:           #4B4DDB;
    --fill-success:             #0B7B65;
    --fill-inverse:             var(--gray-100);
    --fill-neutral:             var(--gray-300);
    --fill-brand-strong:        #4358D8;
    --fill-brand-active:        #3E51CE;   /* base 4F6BE0 → hover 4358D8 → active */
    --avatar-bg:                #39456C;
    /* **文字が載る面なので上限が決まる。** `--magenta-700`(#E16A88) が 4.5 を通る
       一番明るい値がこれ（4.51）。もっと明るくすると `.icotxt.is-on:hover` の
       件数が読めなくなる。素の面との差は 1.04 しかないが、**hover は識別の要件では
       ない**ので文字の可読性を優先する（DS-19）。 */
    --magenta-100:              #3F212E;
    --banner-warning-bg:        #2A2110;

    /* Brand（暗背景でも視認できる中〜明インディゴ。solid bg+白文字／アクセント文字の両用） */
    --brand-navy: #4F6BE0;
    --brand-navy-600: #6E86F0;
    --brand-navy-50: #20263B;   /* 暗いインディゴ面（未読・選択チップ背景） */
    --brand-navy-100: #2A3350;

    /* Neutrals */
    --gray-0:   #181B20;
    --gray-50:  #1F232B;
    --gray-100: #2A2F38;
    --gray-200: #3A404B;
    --gray-300: #6B7280;
    --gray-400: #8A919C;
    --gray-500: #A8AEB8;
    --gray-600: #C2C7D0;
    --gray-900: #E6E9EE;
    --gray-950: #F5F7FA;

    /* Semantic（-50 背景は暗いトーンへ、-500 は暗背景向けに少し明るく） */
    --red-500:    #F26D6D;
    --red-600:    #F79A9A;
    --red-50:     #3A1F1F;
    --amber-500:  #F0B23E;
    /* dark では明暗が反転する（light は 700 が最も濃い＝コントラスト最大、dark は
       700 が最も明るい＝コントラスト最大）。見出しの方が強い、の関係は保つ。 */
    --amber-700:  #F7DDA6;
    --amber-600:  #D9A94E;
    --amber-50:   #382D12;
    /* dark では番号が小さいほど暗い（`--brand-navy-50` < `--brand-navy-100` と同じ向き）。 */
    --amber-25:   #2A2110;
    /* dark は amber と同じ向き（700 が最も明るい＝コントラスト最大）。 */
    --bronze-700: #F0C9A5;
    --bronze-500: #C98A4E;
    --bronze-50:  #3A2415;
    --teal-500:   #2BB7A2;
    --teal-600:   #2BB7A2;
    --teal-50:    #123029;
    --magenta-500:#E0598A;
    --magenta-50: #3A1F2B;
    --magenta-glow: rgba(224,89,138,.22);
    --indigo-500: #8486F5;
    --indigo-600: #9B9DF8;
    --purple-500: #B07DFF;
    --purple-50:  #281E3A;

    /* dark の青階調。番号の向き（50 が最も淡い＝暗い面、900 が最も濃い＝明るい面）は light と
       同じに保つので、`--blue-700` を主役に使うコードは両モードで同じ意味のまま動く。 */
    /* 分析画面のチャート・パレット（dark）。値ではなく役割で持ち、既存の階調に寄せる。 */
    --chart-primary:   var(--blue-500);
    /* `--chart-sub` はライト側で `--blue-400` を指すようにしたので、ここで上書きしない
       （`--blue-400` 自体がテーマで変わる）。 */
    --chart-2:         var(--blue-400);
    --chart-muted:     var(--gray-500);
    --chart-baseline:  var(--gray-500);
    --table-bar:       var(--blue-400);
    --table-bar-track: var(--blue-50);
    --chart-ink:       var(--text-primary);
    --chart-ink-sub:   var(--text-tertiary);
    --chart-ink-70:    var(--text-secondary);
    --chart-line:      var(--border-default);
    --chart-line-soft: var(--border-subtle);
    --chart-surface:   var(--blue-50);
    --chart-bad:       var(--red-500);
    --chart-good:      var(--teal-500);

    --blue-50:  #20263B;
    --blue-100: #2A3350;
    --blue-200: #2B3A63;
    --blue-300: #3A5AAE;
    --blue-400: #456AC7;
    --blue-500: #4E74E0;
    --blue-600: #5B82EA;
    --blue-700: #6E90F5;
    --blue-800: #8AA6F8;
    --blue-900: #A8BEFB;

    /* Background */
    --bg-page:        #0F1216;
    --bg-default:     #181B20;
    --bg-canvas:      #14171C;
    --bg-subtle:      #22262E;
    --bg-danger:      #3A1F1F;
    --bg-unread:      #20263B;
    --bg-section:     #2A2F3E;

    /* Interactive */
    --int-hover:      #262B33;
    --int-selected:   #2A3350;
    --int-brand:      #4F6BE0;
    --int-brand-h:    #6E86F0;
    --int-disabled:   #22262E;

    /* Text */
    --text-primary:     #E6E9EE;
    --text-secondary:   #B6BDC8;
    --text-tertiary:    #959EA9;
    --text-placeholder: #969DA9;
    --text-disabled:    #4B515C;
    --text-brand:       #8AA2FF;
    --text-danger:      #F37777;
    --text-success:     #2BB7A2;
    --text-warning:     #F0B23E;

    /* Border */
    --border-selected: #6E86F0;   /* navy は 2.67 で割るので 1段明るく（最小 3.75） */
    --border-default:  #2E343D;
    --border-subtle:   #23272F;
    --border-strong:   #434A55;
    --border-focus:    #6E86F0;
    --border-brand:    #4F6BE0;
    --border-danger:   #F26D6D;
    --border-disabled: #2A2F38;

    /* Shadow（暗背景では黒ベースで深く） */
    --shadow-1: 0 1px 2px rgba(0,0,0,.40);
    --shadow-2: 0 2px 6px rgba(0,0,0,.45);
    --shadow-3: 0 8px 24px rgba(0,0,0,.50), 0 2px 6px rgba(0,0,0,.40);
    --shadow-4: 0 4px 12px rgba(0,0,0,.45);
    --shadow-8: 0 8px 16px rgba(0,0,0,.50);
    --shadow-16:0 16px 32px rgba(0,0,0,.55);
    --shadow-24:0 24px 48px rgba(0,0,0,.60);
    --shadow-focus: 0 0 0 3px rgba(110,134,240,.35);
  }
  :root[data-theme="dark"] body { background: var(--bg-page); }
  /* ハッシュタグのリンク系の色は暗い面では沈むので、明るい側へ寄せる
     （実測：#8AA2FF on #181B20 は 6.9、白 on #3A6EE8 は 4.59）。 */
  :root[data-theme="dark"] .htag {
    --htag-ink: #8AA2FF;
    --htag-ink-hover: #A9BBFF;
    --htag-on-fill: #3A6EE8;
  }
  /* 表彰台の名前・順位の数字は、暗い面では濃い側が沈むので飾りと同じ明るさに寄せる
     （実測：#E0B44A on #181B20 は 8.88、#C9D0DB は 11.1、#E0A46A は 7.96）。 */
  :root[data-theme="dark"] .rkp__item.is-r1 { --rk-ink: #E0B44A; }
  :root[data-theme="dark"] .rkp__item.is-r2 { --rk-ink: #C9D0DB; }
  :root[data-theme="dark"] .rkp__item.is-r3 { --rk-ink: #E0A46A; }
  /* ハードコードの白ガラス面はトークンに乗らないので dark で個別に暗転 */
  :root[data-theme="dark"] .subpanel {
    background: rgba(24,27,32,0.96);
    border-color: rgba(255,255,255,0.05);
    border-right-color: var(--border-default);
    box-shadow: 8px 9px 24px rgba(0,0,0,.40), inset 0 0 0 2px rgba(255,255,255,.04);
  }
  :root[data-theme="dark"] .let-comp-glass {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.40);
  }
  :root[data-theme="dark"] .gh { background: rgba(20,23,28,0.92); }
  /* Dark mode: swap the wordmark to the light-ink variant (HTML untouched, replaced via content).
     URL must stay relative so it resolves under the basePath (/settings) like the other url() refs. */
  :root[data-theme="dark"] .gh-logo img,
  :root[data-theme="dark"] .svpv-logo,
  :root[data-theme="dark"] .dn-brand__img { content: url("assets/brand/logo-long-dark.svg?v=3"); }

  /* フロントの面の最小幅。PC 版 Web の確定値（1280px）。ここを 1 か所で持つ。 */
  :root { --gs-min-w: 1280px; }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: var(--ff-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  a { color: var(--text-brand); }
  a:hover { text-decoration: underline; }

  /* 本文の中に置くリンク。ブランドの navy は本文色（--text-primary）とのコントラストが 1.14:1 しかなく、
     色だけでは本文と区別できないため下線を常時出す（WCAG 1.4.1 色だけで情報を伝えない）。
     単独で置く操作リンク（「← 一覧へ戻る」など）は形と位置で区別できるので .btn--link を使う。 */
  .link {
    color: var(--text-brand);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
  }
  .link:hover { text-decoration-thickness: 2px; }

  /* ============ Layout ============ */
  .app {
    display: grid;
    grid-template-columns: 240px minmax(0,1fr);
    min-height: 100vh;
  }

  .side {
    position: sticky; top: 0;
    align-self: start;
    height: 100vh;
    overflow: auto;
    border-right: 1px solid var(--border-default);
    background: var(--bg-default);
    padding: 24px 16px;
  }
  .side .brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px 16px;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: 12px;
  }
  .side .brand h1 {
    font-size: 15px; margin: 0; font-weight: 700; letter-spacing: .02em;
  }
  .side .brand p {
    font-size: 11px; margin: 0; color: var(--text-tertiary);
    font-family: var(--ff-mono);
  }

  .side .group { margin-top: 18px; }
  .side .group h4 {
    font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--text-tertiary);
    margin: 0 8px 8px;
  }
  .side a.nav {
    display: block; padding: 6px 10px; border-radius: 6px;
    color: var(--text-secondary); text-decoration: none; font-size: 13px;
  }
  .side a.nav:hover { background: var(--int-hover); color: var(--text-primary); text-decoration: none; }

  .main { padding: 48px 56px 96px; max-width: 1200px; }
  header.page-head {
    display: flex; gap: 24px; align-items: flex-end;
    border-bottom: 1px solid var(--border-default);
    padding-bottom: 32px; margin-bottom: 48px;
  }
  header.page-head h1 {
    font-family: var(--ff-display);
    font-size: 56px; line-height: 1; letter-spacing: -0.02em;
    margin: 0; font-weight: 800;
  }
  header.page-head p { color: var(--text-tertiary); margin: 0 0 6px; max-width: 520px; }
  header.page-head .badge {
    margin-left: auto;
    font-family: var(--ff-mono); font-size: 11px;
    color: var(--text-tertiary);
    padding: 4px 8px; border: 1px solid var(--border-default); border-radius: 999px;
    background: var(--bg-default);
  }

  section.sec { margin-bottom: 80px; scroll-margin-top: 24px; }
  section.sec > h2 {
    font-family: var(--ff-display);
    font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 700; margin: 0 0 8px;
  }
  section.sec > h3 {
    font-family: var(--ff-display);
    font-size: 32px; letter-spacing: -0.01em; margin: 0 0 8px; font-weight: 700;
  }
  section.sec > p.lead {
    color: var(--text-secondary); max-width: 680px; margin: 0 0 24px;
  }

  .sub {
    font-family: var(--ff-display);
    font-size: 18px; font-weight: 700; letter-spacing: -0.005em;
    margin: 32px 0 12px;
  }
  .sub small {
    color: var(--text-tertiary); font-family: var(--ff-mono); font-size: 12px;
    font-weight: 500; margin-left: 10px;
  }

  /* ============ Tokens ============ */
  .grid { display: grid; gap: 16px; }
  .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .g6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
  .g8 { grid-template-columns: repeat(8, minmax(0,1fr)); }

  .tok {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-4);
    padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
  }
  .tok .swatch {
    height: 72px; border-radius: var(--r-4);
    border: 1px solid rgba(0,0,0,0.06);
  }
  .tok .name { font-weight: 600; font-size: 13px; }
  .tok .mono { font-family: var(--ff-mono); font-size: 11px; color: var(--text-tertiary); }
  .tok .desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

  .color-row {
    display: grid; grid-template-columns: 120px 1fr 160px 120px; gap: 16px;
    align-items: center; padding: 10px 14px;
    border-bottom: 1px solid var(--border-default);
  }
  .color-row:last-child { border-bottom: 0; }
  .color-row .dot {
    width: 32px; height: 32px; border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.06);
  }
  .color-row .label { font-weight: 600; font-size: 13px; }
  .color-row .role { color: var(--text-secondary); font-size: 12px; }
  .color-row .hex { font-family: var(--ff-mono); font-size: 12px; color: var(--text-tertiary); }
  .card-panel {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-4);
    overflow: hidden;
  }

  /* Type sample */
  .type-row {
    display: grid; grid-template-columns: 1fr 220px;
    gap: 24px; align-items: baseline;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-default);
  }
  .type-row:last-child { border-bottom: 0; }
  .type-row .meta {
    font-family: var(--ff-mono); font-size: 11px; color: var(--text-tertiary);
    line-height: 1.7;
  }
  .type-row .meta b { color: var(--text-secondary); font-weight: 600; }

  /* Radius */
  .radius-tok { padding: 16px; background: var(--bg-default); border: 1px solid var(--border-default); border-radius: var(--r-4);
    display:flex; flex-direction:column; align-items:center; gap:10px; }
  .radius-tok .shape { width:96px; height:64px; background: var(--brand-navy-50); border: 1px solid var(--border-brand); }
  .radius-tok .shape.r-100 { border-radius: 9999px; width:64px; }

  /* Shadow cards */
  .elev-tok {
    padding: 24px; background: var(--bg-default); border-radius: var(--r-4);
    display: flex; flex-direction: column; align-items: center; gap: 12px; justify-content: center;
    min-height: 140px;
    border: 1px solid rgba(0,0,0,0.03);
  }
  .elev-label { font-family: var(--ff-mono); font-size: 11px; color: var(--text-tertiary); }

  /* Spacing */
  .spacing-row {
    display: grid; grid-template-columns: 80px 120px 80px 1fr; align-items: center;
    gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--border-default);
  }
  .spacing-row:last-child{ border-bottom: 0; }
  .spacing-box {
    height: 16px;
    background: repeating-linear-gradient(135deg, rgba(246,89,72,.14), rgba(246,89,72,.14) 4px, transparent 4px, transparent 8px);
    border: 1px dashed rgb(246,89,72);
  }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--ff-sans); font-weight: 600; font-size: 14px; line-height: 1;
    padding: 0 16px; height: 40px;
    border-radius: var(--r-4);
    border: 1px solid transparent; cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
    white-space: nowrap;
    text-decoration: none;
  }
  /* Anchors styled as buttons inherit no underline in any state.
     (.btn--link is the only variant that intentionally enables underline on hover.) */
  a.btn:not(.btn--link):hover,
  a.btn:not(.btn--link):focus,
  a.btn:not(.btn--link):active { text-decoration: none; }
  .btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
  .btn--primary {
    background: var(--int-brand); color: var(--text-on-fill); border-color: var(--int-brand);
    box-shadow: var(--shadow-1);
  }
  .btn--primary:hover { background: var(--fill-brand-strong); border-color: var(--fill-brand-strong); }
  .btn--primary:active { background: var(--fill-brand-active); }
  .btn--secondary {
    background: var(--bg-default); color: var(--text-primary); border-color: var(--border-control);
  }
  .btn--secondary:hover { background: var(--int-hover); }
  .btn--ghost {
    background: transparent; color: var(--text-primary); border-color: transparent;
  }
  .btn--ghost:hover { background: var(--int-hover); }
  .btn--danger {
    background: var(--fill-danger); color: var(--text-on-fill); border-color: var(--fill-danger);
  }
  .btn--danger:hover { filter: brightness(.92); }
  /* 控えめな danger。**一覧の中で繰り返し出る否定の操作**用（却下・除外など）。
     塗りつぶしの danger は 1 画面に 1 つの「取り返しのつかない操作」用なので、
     4 件並ぶカードに使うと画面が赤くなって、どれが重いのか読めなくなる。
     アイコンボタンには既にこの濃さがある（.iconbtn.is-danger）——文字ボタンに無かっただけ。 */
  .btn--danger-quiet {
    background: var(--red-50); color: var(--text-danger); border-color: var(--border-danger);
  }
  .btn--danger-quiet:hover { background: var(--red-100, var(--red-50)); filter: brightness(.97); }
  /*
    amber の淡い塗り（2026-09-21）。`danger-quiet` と同じ作りで、色だけ `.tag--warning` に揃える。
    **塗りつぶしの amber は作らない**——`--amber-500`（#F59E0B）に白文字は 2.1:1 で本文の基準を
    割る。amber を「押されている」の印に使いたい場面は、この淡い面が上限。
  */
  .btn--warning-quiet {
    background: var(--amber-50); color: var(--text-warning); border-color: var(--amber-200);
  }
  .btn--warning-quiet:hover { background: var(--amber-50); filter: brightness(.97); }
  /*
    ブランドの淡い塗り（2026-09-24）。`danger-quiet` / `warning-quiet` と同じ作りの navy 版。
    **塗りつぶしの primary を置きたくないが、素の secondary では弱い**場所用——
    一覧に何十個も並ぶ操作（フォローなど）は、塗りが並ぶと名前より先に目が行く。
  */
  .btn--brand-quiet {
    background: var(--brand-navy-50); color: var(--text-brand); border-color: var(--brand-navy-200);
  }
  .btn--brand-quiet:hover { background: var(--brand-navy-100); border-color: var(--brand-navy-200); }
  .btn--link {
    background: transparent; color: var(--text-brand); border: 0; padding: 0; height: auto;
    text-decoration: none;
  }
  .btn--link:hover { text-decoration: underline; }
  .btn[disabled], .btn.is-disabled {
    background: var(--int-disabled); color: var(--text-disabled);
    border-color: var(--border-disabled); cursor: not-allowed; box-shadow: none;
  }
  /* display:inline-flex が UA default [hidden]{display:none} を上書きするので明示 */
  .btn[hidden] { display: none; }
  /* Loading state — spinner overlays the button label */
  /* 処理中でも**ラベルは消さない**（41法則 #28「処理中もボタンのテキストが隠れていないか」。
     以前は `color: transparent !important` で消していた＝DS-15）。ボタンが複数並ぶ場所
     （SaveBar・モーダルのフッター）で、どれが処理中かを位置だけで当てさせないため。
     スピナーはラベルの左に置き、そのぶんの幅を `padding-left` で先に確保する
     ——後から足すとラベルが横にずれて、押した瞬間に文字が動く。 */
  .btn.is-loading {
    pointer-events: none;
  }
  /* 元のアイコンは畳む。`visibility: hidden` だと場所が残り、スピナーとラベルの間に
     余分な gap が1つ入る（スピナーが flex の子になったため）。 */
  .btn.is-loading .ic { display: none; }
  /* スピナーは flex の子として流し込む（`.btn` は inline-flex ＋ gap: 8px）。
     絶対配置＋padding 計算にすると、サイズ違い（xs 10px / sm 12px / lg 20px / xl 24px）
     ごとに位置がずれる。flex に乗せれば gap が間隔を持つので、どのサイズでも揃う。 */
  .btn.is-loading::before {
    content: '';
    flex: none;
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin .6s linear infinite;
  }
  .btn--secondary.is-loading::after,
  .btn--ghost.is-loading::after { color: var(--text-secondary); }
  @keyframes btn-spin { to { transform: rotate(360deg); } }
  .btn.xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 4px; }
  .btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
  .btn.md { height: 40px; }
  .btn.lg { height: 48px; padding: 0 20px; font-size: 15px; }
  .btn.xl { height: 56px; padding: 0 24px; font-size: 16px; }
  .btn.icon-only { width: 40px; padding: 0; }
  /* AI アクション。primary（navy）と並べても主従が読めるように独立色にする。
     1 画面に 1 つだけ。AI 以外の操作には使わない。 */
  /*
    AI のボタンは**グラデーション**（2026-09-28、依頼で全画面に広げた）。塗りは
    `--fill-ai-grad` の 1 か所——`/settings/letters2` の作成枠・`/settings/mypage3-1` の
    「AIで気持ちを伝える」・管理画面の AI 実行が同じ見た目になる。

    単色の `--fill-ai` はトークンとして残す（AI の**印**として文字やアイコンに使っている
    箇所がある。塗りだけを変えた）。
  */
  .btn--ai {
    background: var(--fill-ai-grad); color: var(--text-on-fill); border-color: transparent;
    box-shadow: var(--shadow-1);
  }
  .btn--ai:hover { background: var(--fill-ai-grad-strong); border-color: transparent; }

  /* 丸ピル。プロフィールの主要アクション（レターを贈る / トークを開く）で使う。
     角丸ボタンとの違いは「1 画面に 1〜2 個だけの主役」であること。一覧やフォームには使わない。 */
  .btn.pill { border-radius: 999px; padding-left: 24px; padding-right: 24px; }
  /* Icon sizing inside .btn (Lucide <i data-lucide> with .ic class) */
  .btn    .ic { width: 16px; height: 16px; flex: none; }
  .btn.xs .ic { width: 14px; height: 14px; }
  .btn.sm .ic { width: 14px; height: 14px; }
  .btn.lg .ic { width: 18px; height: 18px; }
  .btn.xl .ic { width: 20px; height: 20px; }

  /* ---------- SplitButton ----------
     メインアクション + 隣接メニュートリガー。中身は 2 つの独立した button で、
     外枠 .sbtn-group が radius/border/shadow を担当し、内側の .sbtn-main と
     .sbtn-trigger は border 無しで divider を共有する。 */
  .sbtn-group {
    display: inline-flex;
    align-items: stretch;
    position: relative;
    border-radius: var(--r-4);
    vertical-align: middle;
  }
  .sbtn-group .sbtn-main,
  .sbtn-group .sbtn-trigger {
    border-radius: 0;
    border: 0;
    box-shadow: none;
    margin: 0;
  }
  /* 外枠側で border/radius/shadow を描画（主ボタンの装飾を継承） */
  .sbtn-group .sbtn-main {
    border-top-left-radius: inherit;
    border-bottom-left-radius: inherit;
  }
  .sbtn-group .sbtn-trigger {
    border-top-right-radius: inherit;
    border-bottom-right-radius: inherit;
    padding: 0;
    width: 40px;
    flex: 0 0 auto;
    position: relative;
  }
  /* Size sync — trigger width follows height */
  .sbtn-group .sbtn-main.xs + .sbtn-trigger,
  .sbtn-group .sbtn-trigger.xs { width: 28px; }
  .sbtn-group .sbtn-main.sm + .sbtn-trigger,
  .sbtn-group .sbtn-trigger.sm { width: 32px; }
  .sbtn-group .sbtn-main.lg + .sbtn-trigger,
  .sbtn-group .sbtn-trigger.lg { width: 48px; }
  .sbtn-group .sbtn-main.xl + .sbtn-trigger,
  .sbtn-group .sbtn-trigger.xl { width: 56px; }

  /* Divider — 擬似要素で 1px 線。色はバリアントごとに上書き */
  .sbtn-group .sbtn-trigger::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: rgba(255, 255, 255, .3);
    pointer-events: none;
  }
  /* Secondary / Ghost 系は暗い divider */
  .sbtn-group .sbtn-main.btn--secondary + .sbtn-trigger::before,
  .sbtn-group .sbtn-main.btn--ghost + .sbtn-trigger::before {
    background: var(--border-default);
  }
  /* Disabled: the white divider disappears on the light disabled fill, whatever
     variant it came from, so it darkens to stay visible. */
  .sbtn-group .sbtn-trigger[disabled]::before,
  .sbtn-group .sbtn-trigger.is-disabled::before {
    background: var(--border-disabled);
  }
  /* Secondary は外枠に枠線（単体の secondary ボタンと同じ縁取り。primary は地色で縁が立つので不要） */
  .sbtn-group--secondary { border: 1px solid var(--border-strong); }

  /* Rounded / Pill 対応 — 外枠の radius をそのまま継承 */
  .sbtn-group.is-pill { border-radius: 9999px; }
  .sbtn-group.is-rounded { border-radius: 12px; }

  /* Focus ring は片側のみに表示される（button 単位の outline） */
  .sbtn-group .sbtn-main:focus-visible,
  .sbtn-group .sbtn-trigger:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
    z-index: 1;
  }

  /* Open 状態（メニュー展開中）— トリガー側のみ暗めに */
  .sbtn-group .sbtn-trigger.is-open {
    background: rgba(0, 0, 0, .15);
  }
  .sbtn-group .sbtn-main.btn--secondary + .sbtn-trigger.is-open,
  .sbtn-group .sbtn-main.btn--ghost + .sbtn-trigger.is-open {
    background: var(--int-hover);
  }
  .sbtn-group .sbtn-trigger.is-open .lucide[data-name="chevron-down"] {
    transform: rotate(180deg);
  }
  .sbtn-group .sbtn-trigger .lucide[data-name="chevron-down"] {
    transition: transform .12s ease;
  }

  /* Button shapes */
  .btn--pill    { border-radius: 9999px; }
  .btn--rounded { border-radius: 12px; }
  .btn--circle  {
    border-radius: 9999px;
    width: 40px; height: 40px; padding: 0; flex: none;
  }
  .btn--circle.xs { width: 28px; height: 28px; }
  .btn--circle.sm { width: 32px; height: 32px; }
  .btn--circle.lg { width: 48px; height: 48px; }
  .btn--circle.xl { width: 56px; height: 56px; }

  /* Icon button (circle) */
  .iconbtn {
    width: 40px; height: 40px; border-radius: 9999px;
    display: inline-grid; place-items: center;
    background: var(--bg-default); border: 1px solid var(--border-control);
    cursor: pointer; color: var(--text-secondary);
    transition: background .12s ease, border-color .12s ease, color .12s ease;
  }
  .iconbtn:hover { background: var(--int-hover); color: var(--text-primary); }
  /* 無効：見た目でも押せないと分かるようにする（.btn と同じ扱い）。`disabled` を渡しても
     見た目が変わらないと、押せるボタンだと思って何度も押される。hover の色替えも止める。 */
  .iconbtn[disabled], .iconbtn.is-disabled {
    background: var(--int-disabled); color: var(--text-disabled);
    border-color: var(--border-disabled); cursor: not-allowed;
  }
  .iconbtn[disabled]:hover, .iconbtn.is-disabled:hover {
    background: var(--int-disabled); color: var(--text-disabled);
  }
  /* フラット：枠・背景なし（丸で囲わない）。ホバー時だけ角丸の背景。ツールチップは併用可。 */
  .iconbtn.is-flat { background: none; border-color: transparent; border-radius: 6px; }
  .iconbtn.is-flat:hover { background: var(--int-hover); color: var(--text-primary); }
  .iconbtn.xs { width: 28px; height: 28px; }
  .iconbtn.sm { width: 32px; height: 32px; }
  .iconbtn.lg { width: 48px; height: 48px; }
  /* Icon sizing inside .iconbtn — tuned so the glyph doesn't feel heavy */
  .iconbtn .ic     { width: 18px; height: 18px; }
  .iconbtn.xs .ic  { width: 14px; height: 14px; }
  .iconbtn.sm .ic  { width: 16px; height: 16px; }
  .iconbtn.lg .ic  { width: 20px; height: 20px; }
  .iconbtn.brand { background: var(--int-brand); border-color: var(--int-brand); color: var(--text-on-fill); }
  .iconbtn.brand:hover { background: var(--fill-brand-strong); border-color: var(--fill-brand-strong); }
  /* Destructive variant — delete / trash 用。 hover で red 系に。 */
  .iconbtn.is-danger { color: var(--red-500); }
  .iconbtn.is-danger .ic { color: var(--red-500); }
  .iconbtn.is-danger:hover {
    background: var(--red-50);
    border-color: var(--red-200);
    color: var(--red-600);
  }
  .iconbtn.is-danger:hover .ic { color: var(--red-600); }
  /* 無効が赤より後に来るようにここでも打つ（.is-danger は同じ詳細度で後ろに書かれているため、
     上の [disabled] だけだと赤が勝って「押せそうな赤いゴミ箱」に見える）。 */
  .iconbtn.is-danger[disabled], .iconbtn.is-danger[disabled] .ic,
  .iconbtn.is-danger[disabled]:hover, .iconbtn.is-danger[disabled]:hover .ic {
    color: var(--text-disabled); background: var(--int-disabled);
    border-color: var(--border-disabled); cursor: not-allowed;
  }
  /* Toggled/selected state — e.g. Bold/Italic active at cursor in a rich-text toolbar. */
  /* 押されている状態。淡い塗り（1.14）＋アイコンの色だけだと「色だけ」になるので、
     `.iconbtn.brand` と同じく塗りを入れ替えて明度を跳ばす（16.69 / 4.65）。DS-19。 */
  .iconbtn.is-active { background: var(--int-brand); border-color: var(--int-brand); color: var(--text-on-fill); }
  .iconbtn.is-active:hover { background: var(--fill-brand-strong); border-color: var(--fill-brand-strong); color: var(--text-on-fill); }

  /* ==== IconBox =========================================================
     色付き box にアイコンを 1 つ並べる小型インジケータ。
     用途：リスト先頭のロール / カテゴリ / チャネル種別の視覚アンカー。
     サイズ：s-24 / s-28 / s-32 / s-36 (既定) / s-40
     トーン：is-navy (既定) / is-teal / is-danger / is-warning / is-subtle
     注意：.iconbtn (操作可能なボタン) とは別物。.iconbox は静的な装飾。
  ======================================================================= */
  .iconbox {
    width: 36px; height: 36px;
    border-radius: var(--r-4);
    background: var(--brand-navy-50);
    color: var(--brand-navy);
    display: grid; place-items: center;
    flex: none;
  }
  .iconbox .ic { width: 16px; height: 16px; }
  .iconbox.s-24 { width: 24px; height: 24px; }
  .iconbox.s-24 .ic { width: 12px; height: 12px; }
  .iconbox.s-28 { width: 28px; height: 28px; }
  .iconbox.s-28 .ic { width: 14px; height: 14px; }
  .iconbox.s-32 { width: 32px; height: 32px; }
  .iconbox.s-32 .ic { width: 16px; height: 16px; }
  .iconbox.s-40 { width: 40px; height: 40px; }
  .iconbox.s-40 .ic { width: 20px; height: 20px; }
  /* Tones */
  .iconbox.is-navy    { background: var(--brand-navy-50); color: var(--brand-navy); }
  .iconbox.is-teal    { background: var(--teal-50); color: var(--teal-600); }
  .iconbox.is-danger  { background: var(--red-50); color: var(--red-500); }
  .iconbox.is-warning { background: var(--amber-50); color: var(--text-warning); }
  .iconbox.is-subtle  { background: var(--bg-subtle); color: var(--text-secondary); }

  /* ==== HelpIcon ===========================================================
     ラベルの右に小さく置く "?" アイコン。クリック / ホバー / フォーカスで
     既存の .tt (Tooltip) コンポーネントを開く。専門用語・固有名詞・複雑な
     設定の補足説明に使用。
     用法: <span class="help-i" data-tooltip="..."><i data-lucide="help-circle" class="ic"></i></span>
     スクリプト: assets/js/help-tooltip.js を <script src> で読み込む。
  ======================================================================= */
  .help-i {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    /* 色はクラスで持つ（インラインにすると .help-i--lg の色が効かなくなる） */
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: 4px;
    vertical-align: -3px;
    border-radius: 999px;
    border: 0; background: transparent; padding: 0;
    transition: color .12s ease, background .12s ease;
  }
  /* 透明な拡張クリック領域 — 視覚は 16px のまま hit-area を 24px に */
  .help-i::before {
    content: '';
    position: absolute; inset: -4px;
  }
  .help-i:hover { color: var(--text-primary); background: var(--bg-subtle); }
  .help-i:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }
  /* 分析のセクション見出し用（jubel SectionHeader の ⓘ）: 20px・テーマ primary 色。
     ホバーでも navy のまま・丸い地は敷かない（jubel はアイコンが outline→filled になるだけ）。
     基底の .help-i:hover より後に置いて上書きする。 */
  /* 分析ダッシュボードの ⓘ（設定画面の `？` より一回り大きい）。色は jubel のテーマ値を固定 hex で
     持っていたが、揃える必要が無くなったので RECOG の青階調へ（`SERIES_PEER` と同じ段）。 */
  .help-i--lg, .help-i--lg:hover { width: 20px; height: 20px; color: var(--blue-500); background: none; }
  .help-i--lg .ic { width: 20px; height: 20px; }
  /* ダーク専用の上書きなので、ここが値そのもの（トークンにしても指す先が1つしかない）。 */
  :root[data-theme="dark"] .help-i--lg, :root[data-theme="dark"] .help-i--lg:hover { color: #A6C8FF; }
  .help-i .ic { width: 14px; height: 14px; stroke-width: 2; }
  /* hover/focus で出る説明ツールチップ（長文は折返し）。iconbtn の .tt と同方式。 */
  .help-i > .tt {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity .12s ease, transform .12s ease;
    white-space: pre-line;
    width: max-content;
    max-width: 280px;
    text-align: left;
    font-weight: 500;
  }
  .help-i:hover > .tt,
  .help-i:focus-visible > .tt {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  /* body へポータルされた HelpTip ツールチップ（SidePanel/モーダルの overflow に切られない）。
     位置は JS で fixed 指定、見た目は .tt。中央下の矢印がアイコンを指す。 */
  /* .tt.help-tt-pop で specificity を上げ、基底 .tt（nowrap 等）を確実に上書き */
  .tt.help-tt-pop {
    z-index: 1200;
    white-space: pre-line;
    width: max-content;
    max-width: 280px;
    text-align: left;
    /* **本体にマウスを移せること**（WCAG 2.2 SC 1.4.13 Hoverable）。none にすると、
       読もうとしてカーソルを動かした瞬間に消える。閉じる遅延は HelpTip 側が持つ。 */
    pointer-events: auto;
  }
  /* リッチ内容（絵文字プレビュー + 複数行の氏名など）を入れるとき。
     幅を決め打ちして折返させ、中身は中央寄せにする。 */
  .tt.help-tt-pop.is-rich {
    width: 240px;
    max-width: 240px;
    white-space: normal;
    text-align: center;
    padding: 10px 12px;
    line-height: 1.5;
  }
  /* HelpTip の説明のうち、**白い面で出すほう**。細い navy の帯に数行を流すと読めないので、
     数行あるものと**セクション見出しの ⓘ**（長さを問わず）はこの形にする。
     見出しを長さで出し分けないのは、隣り合う見出しからピルとパネルが交互に出ると
     同じ ⓘ が別の部品に見えるため（CLAUDE.md「ツールチップ / トグルチップの使い分けルール」）。 */
  .tt.help-tt-pop.is-panel {
    width: max-content;
    max-width: 560px;
    padding: 14px 16px;
    /* 面はほんのり navy 寄り、枠はその面を少し濃くした色。白 + グレー枠だと硬く見えるので、
       ブランド色に寄せた淡いトーンで「読んで大丈夫なやつ」の空気にする。
       ダークテーマでは両トークンとも暗い側に定義されているので、そのまま反転する。 */
    background: color-mix(in srgb, var(--brand-navy-50) 45%, var(--bg-default));
    color: var(--text-primary);
    /* 枠は面と同じ色みを一段濃くしたもの（別の色を持ってくると硬く見える）。 */
    border: 1px solid color-mix(in srgb, var(--brand-navy) 18%, var(--brand-navy-100));
    border-radius: 12px;
    box-shadow: var(--shadow-3);
    font-size: 13px;
    line-height: 1.9;
    text-align: left;
  }
  /* パネルは面が大きいので、矢印が無くても指している場所が分かる（付けると白い面から
     navy の三角が飛び出してしまう）。 */
  .tt.help-tt-pop.is-panel::after { display: none; }

  /* 矢印はアイコン位置（JS が --tt-arrow を設定）を指す */
  .tt.help-tt-pop::after { left: var(--tt-arrow, 50%); }
  /* 下に出す（フリップ）ときは矢印を上辺に */
  .tt.help-tt-pop.is-below::after { top: -4px; bottom: auto; }

  /* ==== Modal / Dialog (Figma-aligned) ==================================
     4 パターン:
     - .modal.is-centered         … 縦積み中央（single/wide）
     - .modal.is-simple           … 横並び（icon + content, 右下 actions）
     - .modal.is-simple-footer    … simple + gray footer
     - + .modal.is-dismiss        … 右上 X を追加（simple のみ）
     = 共通の Modal shell:
       white bg, radius 12, shadow-16, padding 24, flex col
  ======================================================================= */
  .modal-demo {
    position: relative;
    background:
      linear-gradient(rgba(107,114,128,.12), rgba(107,114,128,.12)),
      repeating-linear-gradient(45deg, var(--bg-subtle), var(--bg-subtle) 8px, var(--bg-page) 8px, var(--bg-page) 16px);
    border: 1px solid var(--border-default);
    border-radius: var(--r-8);
    padding: 56px 40px;
    min-height: 340px;
    display: flex; align-items: center; justify-content: center;
  }
  /* Modal overlay (backdrop) — full-viewport fixed layer that hosts a .modal.
     Toggle visibility with .is-open. Click backdrop or [data-action="close-modal"]
     to close (page-level JS responsibility). */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 25, 81, 0.4);
    display: none;
    align-items: center; justify-content: center;
    z-index: 1000;
    padding: 32px;
    overflow-y: auto;
  }
  .modal-overlay.is-open { display: flex; }
  /* Prevent body scroll while a modal is open (apply to <body>) */
  body.has-modal-open { overflow: hidden; }
  .modal {
    position: relative;
    background: var(--bg-default);
    border-radius: 12px;
    box-shadow: var(--shadow-16);
    overflow: hidden;
  }
  /* ---- Centered variant (single / wide) ---- */
  .modal.is-centered {
    width: 100%; max-width: 384px;
    padding: 24px;
    display: flex; flex-direction: column; gap: 24px; align-items: center;
    text-align: center;
  }
  .modal.is-centered.is-wide { max-width: 512px; }
  /* centered は illust/text/actions を直下に置く想定だが、.modal__body で包んでも
     同じ縦積み + 24px gap になるようにする（PC 正本と同じ余白に揃える）。 */
  .modal.is-centered .modal__body {
    display: flex; flex-direction: column; gap: 24px; align-items: center; width: 100%;
  }
  .modal__illust {
    width: 48px; height: 48px;
    border-radius: 9999px;
    display: inline-grid; place-items: center;
    background: var(--teal-50);
    color: var(--teal-600);
    flex: none;
  }
  .modal__illust .ic,
  .modal__illust svg,
  .modal__illust [data-lucide] { width: 22px; height: 22px; stroke-width: 2; }
  .modal__illust.is-warn { background: var(--teal-50); color: var(--text-primary); }
  .modal__illust.is-warning { background: var(--amber-50); color: var(--text-warning); } /* 黄色の「注意」。is-warning は iconbox / banner / tag と共通の amber 運用 */
  .modal__illust.is-danger { background: var(--red-50); color: var(--red-500); }
  .modal__illust.is-navy { background: var(--brand-navy-50); color: var(--brand-navy); }
  .modal__text {
    display: flex; flex-direction: column; gap: 8px; align-items: inherit;
    width: 100%;
  }
  .modal__title {
    margin: 0;
    font-family: var(--ff-display);
    font-weight: 600;
    font-size: 18px; line-height: 24px;
    color: var(--text-primary);
    letter-spacing: 0;
  }
  .modal__desc {
    margin: 0;
    font-size: 14px; line-height: 20px;
    color: var(--text-secondary);
  }
  .modal__desc.is-danger { color: var(--text-danger); }
  .modal__desc .danger { color: var(--text-danger); font-weight: 700; }
  /* centered で ModalContent を挟んだ場合も、直下に置いたときと同じ 24px 縦間隔にする
     （gap の指定が .is-simple にしか無く、本文とボタンがくっついていた）。 */
  .modal.is-centered .modal__content {
    display: flex; flex-direction: column; gap: 24px; align-items: center; width: 100%;
  }
  .modal.is-centered .modal__actions {
    display: flex; gap: 12px; width: 100%;
  }
  .modal.is-centered .modal__actions .btn { flex: 1 1 0; min-width: 0; }
  .modal.is-centered .modal__actions.is-single .btn { width: 100%; }

  /* ---- Simple variant (icon + content, right-aligned actions) ---- */
  .modal.is-simple {
    width: 100%; max-width: 512px;
  }
  .modal.is-simple .modal__body {
    padding: 24px;
    display: flex; flex-direction: row; gap: 16px;
    align-items: flex-start;
  }
  .modal.is-simple.is-simple-footer .modal__body { padding-bottom: 16px; }
  .modal.is-simple .modal__illust {
    width: 40px; height: 40px;
  }
  /* simple モーダル（削除・警告・確認）の illust アイコンは一回り小さく（40px 円に対し 18px） */
  .modal.is-simple .modal__illust .ic,
  .modal.is-simple .modal__illust svg,
  .modal.is-simple .modal__illust [data-lucide] { width: 18px; height: 18px; }
  .modal.is-simple .modal__content {
    flex: 1 1 auto; min-width: 0;
    display: flex; flex-direction: column; gap: 16px;
  }
  .modal.is-simple .modal__text { align-items: flex-start; text-align: left; }
  .modal.is-simple .modal__actions {
    display: flex; gap: 12px; justify-content: flex-end;
  }
  /* simple の actions は `.modal__content` の**中**に置くのが正だが、外（body の兄弟）に
     置かれても崩れないようにする。外に出ると body の padding が効かず、ボタンが
     モーダルの端に貼り付く（実際に貼り付いた）。gray footer 指定のときは footer 側の
     padding が正なので、そちらは触らない。 */
  .modal.is-simple:not(.is-simple-footer) > .modal__actions {
    padding: 0 24px 24px;
  }
  .modal.is-simple-footer .modal__actions {
    padding: 12px 24px;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-subtle);
  }
  .modal__close {
    position: absolute;
    top: 16px; right: 16px;
    width: 28px; height: 28px;
    display: inline-grid; place-items: center;
    border: 0; background: transparent; cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: color .12s ease, background .12s ease;
  }
  .modal__close:hover:not(:disabled) { color: var(--text-primary); background: var(--int-hover); }
  /* 閉じられない瞬間（保存中など）。消すと見出しの右端が空いて画面が跳ねるので、
     位置は保ったまま押せないことを見せる。 */
  .modal__close:disabled { opacity: .35; cursor: default; }
  .modal__close .ic { width: 16px; height: 16px; }
  .modal.is-dismiss .modal__body { padding-right: 56px; }

  /* ---- E. Panel variant (composer / レター編集など) ----
     ヘッダーレス、モーダルの "外側上" に丸い白 X ボタンが浮く。
     作業空間として使うので背景は白、内側の構成は自由。 */
  .modal.is-panel {
    width: 100%; max-width: 960px;
    border-radius: 16px;
    overflow: visible; /* 外側 X を表示するため */
  }
  .modal.is-panel > .modal__body {
    padding: 24px 24px 20px;
    display: flex; flex-direction: column; gap: 16px;
    background: var(--bg-default);
    border-radius: 16px;
  }
  .modal__close-out {
    position: absolute;
    top: -56px; right: 0;
    width: 40px; height: 40px;
    display: inline-grid; place-items: center;
    border: 1px solid var(--border-default);
    background: var(--bg-default);
    box-shadow: var(--shadow-4);
    color: var(--text-secondary);
    border-radius: 9999px;
    cursor: pointer;
    transition: color .12s ease, box-shadow .12s ease, transform .12s ease;
  }
  .modal__close-out:hover {
    color: var(--text-primary);
    box-shadow: var(--shadow-8);
  }
  .modal__close-out:active { transform: scale(.96); }

  /* ---------- ImageLightbox（`.lightbox`）。画像 1 枚を拡大して見るだけの面 ----------
     器は `.modal-overlay`（backdrop / Esc / 裏スクロール停止をそこから貰う）。
     `.modal` は使わない — 白い面・padding・角丸が画像の額縁になってしまい、
     写真の縁が分からなくなる。閉じるは Panel と同じ外側の丸い ✕（`.modal__close-out`）。

     backdrop は `.modal-overlay` の navy 40% より濃くする（写真を見るので周りを落とす）。 */
  .modal-overlay.is-lightbox { background: rgba(0, 6, 20, .82); padding: 24px; }
  /* Motion: a short fade in only. Closing is instant: a fade-out reads as lag on a viewer. */
  .modal-overlay.is-lightbox.is-open { animation: lb-fade-in .08s ease-out both; }
  @keyframes lb-fade-in { from { opacity: 0; } to { opacity: 1; } }
  @media (prefers-reduced-motion: reduce) {
    .modal-overlay.is-lightbox.is-open { animation: none; }
  }
  .lightbox {
    position: relative;
    display: inline-flex;
    max-width: 100%;
    /* 画面から溢れさせない。上の余白 24px x2 と ✕ の逃げ 56px を引く。 */
    max-height: calc(100vh - 104px);
  }
  .lightbox > img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 104px);
    width: auto; height: auto;
    object-fit: contain;
    border-radius: var(--r-8);
    /* 白い画像でも縁が分かるように、暗い地に対して薄い縁を置く。 */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 24px 60px rgba(0, 0, 0, .5);
  }
  /* 画像の下に出す説明（記事タイトルなど）。無ければ出さない。 */
  .lightbox > .lb-cap {
    position: absolute;
    left: 0; right: 0; bottom: -28px;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 20px;
    color: rgba(255, 255, 255, .82);
    text-align: center;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* The ✕ sits at the screen's top right, not on the photo: a white circle with a dark ✕, the same
     as the support widget's image viewer (`.sw-viewer-close`), so it stays visible on any backdrop. */
  .lightbox > .modal__close-out {
    position: fixed;
    top: 16px; right: 16px;
    border: 0;
    background: #FFFFFF;
    color: #1F2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  }
  .lightbox > .modal__close-out:hover { background: #E5E7EB; color: #1F2937; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
  .lightbox > .modal__close-out .ic { width: 20px; height: 20px; }

  /* ---- F. Large variant (header + body + footer) ----
     「バッジを選択する」系の大型選択ダイアログ。
     ヘッダーにタイトル + X、フッターにヒント + キャンセル。 */
  .modal.is-large {
    width: 100%; max-width: 960px;
    display: flex; flex-direction: column;
    max-height: 80vh;
  }
  .modal__header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    flex: none;
  }
  .modal__header .modal__title { font-size: 16px; line-height: 20px; }
  .modal__header .modal__close {
    position: static; /* ヘッダーの flex 右端に置く */
  }
  .modal.is-large > .modal__body {
    padding: 24px;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
  }
  /* large のボタン領域。ModalFooter が正規だが、ModalActions を置いても同じ見た目になるようにする
     ——`.modal__actions` の指定は is-centered / is-simple にしか無く、large の中では素の div のまま
     左寄せ・余白なしで出てしまう（実際に複数画面で起きた）。呼び側が間違えても崩れない側に倒す。 */
  .modal__footer,
  .modal.is-large > .modal__actions {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-default);
    flex: none;
  }
  /* .modal__hint (left-side info text) pushes itself to the left,
     leaving the action buttons clustered on the right. */
  .modal__footer .modal__hint {
    margin-right: auto;
    font-size: 12px; line-height: 18px;
    color: var(--text-tertiary);
  }
  .modal__footer .modal__hint kbd {
    display: inline-block;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    padding: 0 2px;
  }

  /* ====================================================================
     SidePanel — 右からスライドインするフォーム用パネル
     ====================================================================
     一覧を見ながら 1 件ずつ編集 / 連続編集 (Fluent UI Panel / Material side sheet 相当)。
     モーダルより心理的圧が弱く、 中規模フォーム (5〜10 項目) に向く。

     構造:
       <div class="sidepanel-overlay" id="…">
         <aside class="sidepanel">     ← .is-md/.is-lg/.is-xl/.is-2xl で幅を変更
           <header class="sidepanel__header">
             <h3 class="sidepanel__title">タイトル</h3>
             <button class="sidepanel__close iconbtn"><i data-lucide="x" class="ic"></i></button>
           </header>
           <div class="sidepanel__body">…</div>
           <footer class="sidepanel__footer">    ← .is-split で 左右に分離
             <button class="btn btn--secondary">キャンセル</button>
             <button class="btn btn--primary">保存</button>
           </footer>
         </aside>
       </div>

     - 開閉: `.sidepanel-overlay.is-open` を toggle。 既存モーダル JS と同じパターン。
     - backdrop クリック / Esc で閉じる (ページ側 JS の責任)。 */
  .sidepanel-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 25, 81, 0.32);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }
  .sidepanel-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  body.has-sidepanel-open { overflow: hidden; }

  .sidepanel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 560px;
    max-width: 100vw;
    background: var(--bg-default);
    box-shadow: -8px 0 24px rgba(0, 25, 81, 0.18);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .sidepanel-overlay.is-open .sidepanel {
    transform: translateX(0);
  }
  .sidepanel.is-sm { width: 400px; }
  .sidepanel.is-md { width: 480px; }
  .sidepanel.is-lg { width: 640px; }
  .sidepanel.is-xl { width: 720px; }
  /* 2xl … 中身がグラフの2列組みになるパネル（会社1社の月次指標など）。
     720px だと 12ヶ月の折れ線を2列に置けず、横軸ラベルが斜めに潰れる。 */
  .sidepanel.is-2xl { width: 960px; }

  .sidepanel__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px 14px 24px;
    border-bottom: 1px solid var(--border-default);
    flex: none;
  }
  .sidepanel__title {
    flex: 1; min-width: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
  }
  .sidepanel__close {
    /* 通常は .iconbtn を併用する想定だが、 単独でも使えるよう最低限のスタイル */
    background: transparent; border: 0; padding: 6px;
    border-radius: var(--r-4);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .sidepanel__close:hover { background: var(--int-hover); color: var(--text-primary); }
  .sidepanel__close .ic { width: 18px; height: 18px; }

  .sidepanel__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
  }

  .sidepanel__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--border-default);
    background: var(--bg-default);
    flex: none;
  }
  /* 左に破壊的アクション、 右にキャンセル/保存 を置く配置 */
  .sidepanel__footer.is-split { justify-content: space-between; }

  /* demo stage helper: E の外側 X を表示するため余白を足す */
  .modal-demo.is-panel-stage { padding-top: 96px; }

  /* Avatar */
  .avatar {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    flex: none;
    width: 40px; height: 40px;
    border-radius: 9999px;
    background: var(--brand-navy-50);
    color: var(--brand-navy);
    font-family: var(--ff-sans); font-weight: 600; letter-spacing: 0.01em;
    overflow: visible; /* allow badge to bleed out */
    /* Outer white ring + inner contrast border (0.5px @ #000/8%) */
    --av-ring: 1.5px;
    box-shadow:
      0 0 0 var(--av-ring) var(--bg-default),
      inset 0 0 0 0.5px rgba(0,0,0,0.08);
  }
  .avatar .av-inner {
    width: 100%; height: 100%;
    border-radius: inherit;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
  }
  .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }

  /* Group avatar — a single circle split into 2 / 3 / 4 slots */
  .avatar.is-group {
    background: var(--brand-navy-50);
    /* overflow stays visible so .av-badge can sit outside the circle. */
  }
  .avatar.is-group .av-inner {
    display: grid; gap: 1px;
    background: var(--bg-default); /* seam between slots */
    overflow: hidden;  /* circle-crop the grid itself */
    border-radius: 9999px;
    padding: 0;
    width: 100%; height: 100%;
    align-items: stretch; justify-items: stretch;
    align-content: stretch; justify-content: stretch;
  }
  .avatar.is-group.g-2 .av-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
  }
  .avatar.is-group.g-3 .av-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .avatar.is-group.g-3 .av-inner > .av-slot:nth-child(1) {
    grid-row: 1 / span 2; /* left slot spans both rows */
  }
  .avatar.is-group.g-4 .av-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .avatar.is-group .av-slot {
    overflow: hidden;
    background: var(--brand-navy-50);
    display: flex; align-items: center; justify-content: center;
  }
  .avatar.is-group .av-slot img {
    width: 100%; height: 100%; object-fit: cover; display: block;
  }
  /* fallback initials in a slot */
  .avatar.is-group .av-slot .av-txt {
    font-size: 9px; font-weight: 700; color: var(--brand-navy);
    letter-spacing: 0.02em;
  }
  .avatar.s-24.is-group .av-slot .av-txt { font-size: 7px; }
  .avatar.s-32.is-group .av-slot .av-txt { font-size: 8px; }
  .avatar.s-40.is-group .av-slot .av-txt { font-size: 9px; }
  .avatar.s-48.is-group .av-slot .av-txt { font-size: 10px; }
  .avatar.s-56.is-group .av-slot .av-txt { font-size: 11px; }
  .avatar.s-64.is-group .av-slot .av-txt { font-size: 12px; }
  .avatar.s-96.is-group .av-slot .av-txt { font-size: 16px; }
  .avatar.s-150.is-group .av-slot .av-txt { font-size: 22px; }

  /* ---------- Avatar group stacked ----------
     Horizontal row of avatars overlapping right-to-left. Last visible slot is a
     "99+" counter showing remaining members. Order=Bottom to top: left avatars
     sit on top of right avatars. */
  .avatar-stack {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
  }
  .avatar-stack > .avatar,
  .avatar-stack > .av-count {
    position: relative;
  }
  /* Overlap siblings except the first; left child sits on top of the next. */
  .avatar-stack > .avatar + .avatar,
  .avatar-stack > .avatar + .av-count,
  .avatar-stack > .av-count + .avatar {
    margin-left: calc(-1 * var(--stack-gap, 6px));
  }
  /* Order=Bottom to top: right child sits on top of the left one. */
  .avatar-stack > * { z-index: 1; }
  .avatar-stack > *:nth-child(2) { z-index: 2; }
  .avatar-stack > *:nth-child(3) { z-index: 3; }
  .avatar-stack > *:nth-child(4) { z-index: 4; }
  .avatar-stack > *:nth-child(5) { z-index: 5; }
  .avatar-stack > *:nth-child(6) { z-index: 6; }
  .avatar-stack > *:nth-child(7) { z-index: 7; }
  /* Per-size overlap from Figma: 24→4, 32→5, 40→6, 48→7, 56→8, 64→9 */
  .avatar-stack.s-24 { --stack-gap: 4px; }
  .avatar-stack.s-32 { --stack-gap: 5px; }
  .avatar-stack.s-40 { --stack-gap: 6px; }
  .avatar-stack.s-48 { --stack-gap: 7px; }
  .avatar-stack.s-56 { --stack-gap: 8px; }
  .avatar-stack.s-64 { --stack-gap: 9px; }

  /* "99+" counter avatar — reuses .avatar ring + contrast border for consistency */
  .avatar-stack .av-count {
    background: var(--gray-50);
    color: var(--text-secondary);
    font-family: var(--ff-sans);
    font-weight: 600;
    line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .avatar-stack.s-24 .av-count { font-size: 10px; }
  .avatar-stack.s-32 .av-count { font-size: 11px; }
  .avatar-stack.s-40 .av-count { font-size: 12px; }
  .avatar-stack.s-48 .av-count { font-size: 13px; }
  .avatar-stack.s-56 .av-count { font-size: 14px; }
  .avatar-stack.s-64 .av-count { font-size: 15px; }
  .avatar.s-24  { width: 24px;  height: 24px;  font-size: 10px; --av-ring: 1.5px; }
  .avatar.s-32  { width: 32px;  height: 32px;  font-size: 12px; --av-ring: 2px; }
  .avatar.s-40  { width: 40px;  height: 40px;  font-size: 14px; --av-ring: 2.5px; }
  .avatar.s-48  { width: 48px;  height: 48px;  font-size: 16px; --av-ring: 3px; }
  .avatar.s-56  { width: 56px;  height: 56px;  font-size: 18px; --av-ring: 4px; }
  .avatar.s-64  { width: 64px;  height: 64px;  font-size: 20px; --av-ring: 5px; }
  .avatar.s-96  { width: 96px;  height: 96px;  font-size: 30px; --av-ring: 5px; }
  .avatar.s-150 { width: 150px; height: 150px; font-size: 44px; font-weight: 700; --av-ring: 6px; }

  /* Avatar badge (top-right / bottom-right icon) */
  .avatar .av-badge {
    position: absolute;
    width: 36%; height: 36%;
    min-width: 16px; min-height: 16px;
    max-width: 44px; max-height: 44px;
    border-radius: 9999px;
    background: var(--bg-default);
    color: var(--brand-navy);
    border: 2px solid var(--bg-default);
    box-shadow: var(--shadow-1);
    display: inline-flex; align-items: center; justify-content: center;
    box-sizing: border-box;
    /* 重ねアバター（`.av-grp`）では次のアバターがこのバッジの上に来て隠してしまう。
       `.avatar` は z-index: auto なので stacking context を作らず、この正の z-index は
       後続のアバターより上に描かれる。バッジは何にも覆われてはいけない。 */
    z-index: 2;
  }
  .avatar .av-badge.br { right: 0; bottom: 0; transform: translate(15%, 15%); }
  .avatar .av-badge.tr { right: 0; top: 0;    transform: translate(15%, -15%); }
  .avatar .av-badge.brand  { background: var(--int-brand); color: var(--text-on-fill); }
  .avatar .av-badge.navy   { background: var(--brand-navy); color: var(--text-on-fill); }
  .avatar .av-badge.danger { background: var(--fill-danger);   color: var(--text-on-fill); }
  .avatar .av-badge.success{ background: var(--fill-success);  color: var(--text-on-fill); }
  /* ドットは中に文字を入れないので、数字用の最小サイズ（16px）に引きずらせない。
     16px のままだと 32px のアバターで顔の 1/2 を覆ってしまう。 */
  .avatar .av-badge.dot {
    width: 28%; height: 28%;
    min-width: 8px; min-height: 8px;
  }
  .avatar .av-badge.dot.online  { background: var(--teal-600); }
  .avatar .av-badge.dot.busy    { background: var(--red-500); }
  .avatar .av-badge.dot.away    { background: var(--amber-500); }
  .avatar .av-badge.dot.offline { background: var(--gray-300); }
  /* 未読あり。在席（busy）と同じ赤だが意味が別なので別クラスで持つ
     （在席の色を変えたときに未読まで変わってしまわないように）。 */
  .avatar .av-badge.dot.unread  { background: var(--red-500); }
  /* アイコン（絵文字など）を入れるバッジ。レターへのリアクションを「誰が」の顔に載せるための種別。
     一覧の下に集計して並べるのではなく本人のアバターに付けるのは、受け取った人が複数いるとき
     「誰がどう反応したか」が 1 目で分かるようにするため。 */
  .avatar .av-badge.is-icon { padding: 0; line-height: 1; overflow: hidden; }
  .avatar .av-badge.is-icon > span { display: block; }
  .avatar .av-badge.is-magenta { background: var(--fill-magenta); color: var(--text-on-fill); border-color: var(--bg-default); }
  /* 絵文字はバッジ幅に対して 55% 程度が収まりが良い（丸の中で切れない大きさ）。 */
  .avatar.s-24 .av-badge.is-icon { font-size: 7px; }
  .avatar.s-32 .av-badge.is-icon { font-size: 8px; }
  .avatar.s-40 .av-badge.is-icon { font-size: 9px; }
  .avatar.s-48 .av-badge.is-icon { font-size: 11px; }
  .avatar.s-56 .av-badge.is-icon { font-size: 12px; }
  .avatar.s-64 .av-badge.is-icon { font-size: 14px; }

  /* Per-size badge metrics */
  .avatar.s-24  .av-badge { width: 12px; height: 12px; min-width: 12px; min-height: 12px; border-width: 1.5px; }
  .avatar.s-32  .av-badge { width: 14px; height: 14px; border-width: 1.5px; }
  .avatar.s-40  .av-badge { width: 16px; height: 16px; border-width: 2px; }
  .avatar.s-48  .av-badge { width: 20px; height: 20px; border-width: 2px; }
  .avatar.s-56  .av-badge { width: 22px; height: 22px; border-width: 2px; }
  .avatar.s-64  .av-badge { width: 26px; height: 26px; border-width: 2px; }
  .avatar.s-96  .av-badge { width: 36px; height: 36px; border-width: 3px; }
  .avatar.s-150 .av-badge { width: 48px; height: 48px; border-width: 3px; }

  /* Input */
  /* min-width:0 so a long selected value (SelectBox trigger) can ellipsis-truncate instead of
     forcing the field wide — matters most inside a grid (FilterPanel's 2-column layout), where a
     flex column's default min-width:auto lets its widest child blow out the 1fr track. */
  .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .field label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
  .field .hint { font-size: 13px; color: var(--text-secondary); }
  .field .err { font-size: 12px; color: var(--text-danger); }
  /* Full-width field inside a multi-column form grid (long textareas: self-appeal, goals). */
  .field.is-wide { grid-column: 1 / -1; }
  /* 横ラベル（ラベル左 / 入力右）。ラベル列幅は --field-label-w（既定 120）。狭い幅では縦積みに戻す。 */
  .field.is-horizontal {
    display: grid;
    grid-template-columns: var(--field-label-w, 120px) minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 4px;
    align-items: start;
  }
  .field.is-horizontal > label { grid-column: 1; padding-top: 8px; }
  .field.is-horizontal > :not(label) { grid-column: 2; min-width: 0; }
  /* 右カラムが checkbox / radio **単体**のときは、ラベルの padding-top（40px の .input に対して
     中心を合わせるための 8px）だけがぶら下がり、20px の箱がラベルの文字より 7.8px 上に浮く。
     同じ 8px を箱側にも渡して先頭を揃える。**padding ではなく margin** ——`.check` は
     box-sizing: border-box の 20px 固定なので、padding を足すと箱そのものが潰れる。
     ラベル付き（`<label class="row">` に包まれる形）は行の高さが文字で決まるので対象外。 */
  .field.is-horizontal > .check,
  .field.is-horizontal > .radio { margin-top: 8px; }
  @media (max-width: 520px) {
    .field.is-horizontal { grid-template-columns: 1fr; row-gap: 6px; }
    .field.is-horizontal > label { padding-top: 0; }
    .field.is-horizontal > :not(label) { grid-column: 1; }
    /* 縦積みではラベルの padding-top が消えるので、こちらの相殺も外す（下にずれる）。 */
    .field.is-horizontal > .check,
    .field.is-horizontal > .radio { margin-top: 0; }
  }

  /* Required marker — フォームラベル横に付ける「※必須」赤字バッジ。
     <label>名前<span class="req">※必須</span></label> */
  .req {
    color: var(--red-500);
    font-size: 11px;
    font-weight: 500;
    margin-left: 4px;
  }
  .input, .textarea {
    appearance: none;
    font-family: inherit; font-size: 14px; color: var(--text-primary);
    background: var(--bg-default); border: 1px solid var(--border-control);
    border-radius: var(--r-4); padding: 0 12px; height: 40px;
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
    width: 100%;
  }
  .textarea { padding: 10px 12px; height: auto; min-height: 80px; line-height: 1.55; resize: none; }
  /* Compact size — for tables, dense forms */
  .input.sm { height: 32px; font-size: 13px; padding: 0 10px; }
  .textarea.sm { font-size: 13px; padding: 8px 10px; min-height: 64px; }

  /* Textarea wrapper with counter */
  .textarea-wrap {
    position: relative;
    background: var(--bg-default);
    border: 1px solid var(--border-control);
    border-radius: var(--r-4);
    transition: border-color .12s ease, box-shadow .12s ease;
    display: flex; flex-direction: column;
  }
  .textarea-wrap:hover { border-color: var(--border-strong); }
  .textarea-wrap:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0,25,81,.12);
  }
  .textarea-wrap.is-error { border-color: var(--border-danger); }
  .textarea-wrap.is-error:focus-within { box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
  .textarea-wrap textarea {
    width: 100%;
    border: 0; outline: none; background: transparent;
    font-family: inherit; font-size: 14px; color: var(--text-primary);
    line-height: 1.55;
    padding: 10px 12px;
    resize: none;
    /* height is applied inline per instance */
    overflow-y: auto;
  }
  .textarea-wrap textarea::placeholder { color: var(--text-placeholder); }
  .textarea-wrap .ta-counter {
    align-self: flex-end;
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 4px 12px 8px;
    pointer-events: none;
    user-select: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
  .textarea-wrap .ta-counter.is-warn { color: var(--text-warning); }
  .textarea-wrap .ta-counter.is-over { color: var(--text-danger); font-weight: 600; }

  /* Input wrapper with character counter (single-line text) */
  .input-wrap { display: flex; flex-direction: column; gap: 4px; width: 100%; }
  .input-wrap .in-counter {
    align-self: flex-end;
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 0 2px;
    pointer-events: none;
    user-select: none;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
  .input-wrap .in-counter.is-warn { color: var(--text-warning); }
  .input-wrap .in-counter.is-over { color: var(--text-danger); font-weight: 600; }

  /* ============================================================
     ChannelCard — toggle + preview + inline editor
     ============================================================
     用途：1 件の通知 / 配信物について「このチャネルで送るか + 何を送るか」
     をまとめて編集する複合カード。reminder / letter / thread の各設定で再利用。
     状態：is-off（OFF）/ is-expanded（編集展開）/ is-error（ON 必須未充足）
  */
  .channel-card {
    border: 1px solid var(--border-default);
    border-radius: var(--r-8);
    background: var(--bg-default);
    overflow: hidden;
    transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease;
  }
  .channel-card + .channel-card { margin-top: 10px; }
  .channel-card.is-off { background: var(--bg-subtle); }
  .channel-card.is-off .channel-card__body,
  .channel-card.is-off .channel-card__editor { display: none; }
  .channel-card.is-error { border-color: var(--border-danger); }

  .channel-card__head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
  }
  .channel-card__icon {
    width: 36px; height: 36px; border-radius: var(--r-4);
    background: var(--brand-navy-50);
    display: grid; place-items: center;
    color: var(--brand-navy);
    flex: none;
  }
  .channel-card__icon .ic { width: 18px; height: 18px; }
  .channel-card.is-off .channel-card__icon {
    background: var(--bg-default); color: var(--text-tertiary);
  }
  .channel-card__title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .channel-card__name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    margin: 0;
    display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  }
  .channel-card__sub  { font-size: 12px; color: var(--text-tertiary); margin: 0; }
  .channel-card__badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 500;
    padding: 1px 8px 1px 6px; border-radius: 999px;
    background: var(--teal-50); color: var(--teal-700);
    line-height: 1.6;
  }
  .channel-card__badge .ic { width: 12px; height: 12px; flex: none; }
  .channel-card.is-off .channel-card__badge {
    background: var(--bg-default); color: var(--text-tertiary);
  }

  .channel-card__body {
    padding: 0 16px 14px;
    display: flex; align-items: stretch; gap: 12px;
  }
  .channel-card__preview {
    flex: 1; min-width: 0;
    background: var(--bg-subtle);
    border-radius: var(--r-4);
    padding: 10px 12px;
    font-size: 12px;
    display: flex; flex-direction: column; gap: 4px;
  }
  .channel-card__preview-title {
    font-weight: 600; color: var(--text-primary);
    margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .channel-card__preview-body {
    color: var(--text-secondary); margin: 0; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .channel-card__preview.is-empty {
    background: var(--red-50);
    color: var(--text-danger);
    flex-direction: row; align-items: center; gap: 8px;
  }
  .channel-card__preview.is-empty .ic { width: 14px; height: 14px; flex: none; }

  .channel-card__edit {
    border: 1px solid var(--border-default);
    background: var(--bg-default);
    color: var(--text-primary);
    height: 36px; padding: 0 12px;
    border-radius: var(--r-4);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    flex: none; align-self: flex-start;
  }
  .channel-card__edit:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
  .channel-card__edit .ic { width: 14px; height: 14px; transition: transform .15s ease; }
  .channel-card.is-expanded .channel-card__edit .ic { transform: rotate(180deg); }

  .channel-card__editor {
    border-top: 1px solid var(--border-default);
    padding: 16px;
    background: var(--bg-subtle);
    display: flex; flex-direction: column; gap: 14px;
  }
  .channel-card:not(.is-expanded) .channel-card__editor { display: none; }
  .channel-card__editor .field label {
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
    margin-bottom: 4px; display: block;
  }
  .channel-card__editor-foot {
    display: flex; justify-content: flex-end; gap: 8px;
  }

  /* ============================================================
     IntegrationCard — 外部サービス連携 1 件分のカード
     ============================================================
     用途：Slack / Teams / LINE WORKS / Chatwork / SmartHR など、
     外部サービス連携の状態 + 操作 + 説明を 1 つのカードにまとめる。
     状態：is-connected（連携中）/ is-disconnected（未連携・既定）
  */
  .integration-card {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-8);
    padding: 18px 20px;
    display: flex; flex-direction: column; gap: 12px;
  }
  .integration-card + .integration-card { margin-top: 12px; }

  /* 細いスクロールバー。長い一覧（トーク 500 件・スレッド本文）で使う。
     既定のバーは幅 15px あり、280px まで縮められる列では中身の 5% を持っていく。
     つまみは transparent の border + background-clip で細く見せる——width を 4px に
     すると、つまみ自体が細くなって掴みにくい。当たり判定 8px / 見た目 4px にする。 */
  .scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
  .scroll-thin::-webkit-scrollbar-track { background: transparent; }
  .scroll-thin::-webkit-scrollbar-thumb {
    background: var(--border-default); border-radius: 999px;
    border: 2px solid transparent; background-clip: content-box;
  }
  .scroll-thin::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); background-clip: content-box; }
  .scroll-thin::-webkit-scrollbar-corner { background: transparent; }
  /* 標準プロパティは **Firefox だけ** に当てる。Chrome 121+ は scrollbar-width を実装して
     いて、指定すると上の ::-webkit-scrollbar を無視する（= 8px が効かず約 11px になる）。
     `not selector(::-webkit-scrollbar)` は Firefox で真、Chrome / Safari で偽。 */
  @supports not selector(::-webkit-scrollbar) {
    .scroll-thin { scrollbar-width: thin; scrollbar-color: var(--border-default) transparent; }
  }

  /* OAuth 一覧のスクロール領域：常時見えるスクロールバーでスクロール可能を明示 */
  .oa-scroll { scrollbar-width: thin; scrollbar-color: var(--text-tertiary) transparent; }
  .oa-scroll::-webkit-scrollbar { width: 12px; }
  .oa-scroll::-webkit-scrollbar-track { background: transparent; }
  .oa-scroll::-webkit-scrollbar-thumb {
    background: var(--text-tertiary); border-radius: 999px;
    border: 3px solid transparent; background-clip: content-box;
  }
  /* OAuth 一覧：1 つのコンテナにまとめ、中で各アプリを間隔をあけたカードにする */
  .oa-list-panel {
    position: relative;
    border: 1px solid var(--border-default);
    border-radius: var(--r-8);
    background: var(--bg-subtle);
    overflow: hidden;
  }
  /* 各アプリは白カード（枠なし）。gray パネル上で浮いて見えるので間隔で区切る */
  .oa-list-panel .integration-card.oa-row { border: 0; background: var(--bg-default); }
  .oa-list-panel .integration-card.oa-row + .integration-card.oa-row { margin-top: 12px; }

  .integration-card__head {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
  }
  .integration-card__icon {
    width: 40px; height: 40px;
    flex: none;
    display: grid; place-items: center;
    border-radius: var(--r-4);
    background: var(--bg-subtle);
  }
  .integration-card__icon img { width: 28px; height: 28px; object-fit: contain; }
  .integration-card__icon.is-letter {
    background: var(--teal-50);
    color: var(--teal-600);
    font-weight: 700; font-size: 18px;
    font-family: var(--ff-sans);
  }

  .integration-card__title {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
  }
  .integration-card__name {
    font-size: 15px; font-weight: 700; color: var(--text-primary);
    margin: 0;
  }

  .integration-card__actions {
    display: flex; align-items: center; gap: 8px;
    flex: none;
  }

  .integration-card__body {
    font-size: 13px; color: var(--text-secondary); line-height: 1.7;
  }
  .integration-card__body > p { margin: 0; }
  .integration-card__body > p + p { margin-top: 2px; }
  .integration-card__body ul { margin: 0; padding-left: 18px; }
  .integration-card__body ul li { margin: 0; }

  .integration-card__extra {
    margin-top: 4px;
    padding: 12px 14px;
    background: var(--bg-subtle);
    border-radius: var(--r-4);
    display: flex; flex-direction: column; gap: 10px;
    font-size: 13px; color: var(--text-secondary); line-height: 1.7;
  }
  .integration-card__extra > p { margin: 0; }
  .integration-card__password {
    font-family: var(--ff-mono);
    color: var(--text-danger);
    font-size: 13px;
    letter-spacing: 0.02em;
  }

  .input::placeholder, .textarea::placeholder { color: var(--text-placeholder); }
  .input:hover, .textarea:hover { border-color: var(--border-strong); }
  .input:focus, .textarea:focus {
    outline: none; border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0,25,81,.12);
  }
  .input.is-error, .textarea.is-error { border-color: var(--border-danger); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
  /* `.input-affix` は枠を持つのが外側の箱なので、中の `input` ではなく箱に付ける。
     中の input に `.is-error` を付けても、枠を持たない要素が赤くなるだけで見た目が変わらない。 */
  .input-affix.is-error { border-color: var(--border-danger); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
  .input[disabled] { background: var(--int-disabled); color: var(--text-disabled); cursor: not-allowed; }
  .input-affix {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-default); border: 1px solid var(--border-control);
    border-radius: var(--r-4); padding: 0 12px; height: 40px;
  }
  /* 道具を並べる帯に置くときの高さ。`SelectBox.sm` / `Segmented--sm` と同じ 32px にする。 */
  .input-affix.sm { height: 32px; padding: 0 10px; }
  .input-affix.sm input { font-size: 13px; }
  .input-affix.sm > .icon .ic,
  .input-affix.sm > .icon svg { width: 14px; height: 14px; }
  /* 文字色を明示する。`<input>` はブラウザ既定の色（黒）で、親の色を継がない。`.input` は
     `--text-primary` を指定しているがここには無く、ダークモードで入力中の文字が黒くなっていた。 */
  .input-affix input { border: 0; background: transparent; min-width: 0; min-width: 0; flex: 1; height: 100%; outline: none; font-family: inherit; font-size: 14px; color: var(--text-primary); }
  .input-affix input::placeholder { color: var(--text-placeholder); }
  /* 中の input の hover/focus を**打ち消す**。`.input-affix input`（0,1,1）は
     `.input:hover` / `.input:focus`（0,2,0）に負けるので、`.input-affix input` だけでは
     枠が消えない——実際、`<InputAffix><Input/></InputAffix>` はホバーすると箱の内側に
     2 本目の枠が出ていた（アイコンのすぐ右から始まる四角）。状態は箱側で見せる。 */
  .input-affix input:hover,
  .input-affix input:focus,
  .input-affix input:focus-visible { border: 0; box-shadow: none; outline: none; }
  /* 枠を持つのは箱なので、hover / focus も箱で出す（`.input` 単体と同じ見え方に揃える）。 */
  .input-affix:hover { border-color: var(--border-strong); }
  .input-affix:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(0,25,81,.12); }
  /* エラー中は hover でグレーに戻さない（.is-error は上で赤を当てている）。 */
  .input-affix.is-error:hover { border-color: var(--border-danger); }
  .input-affix .icon { color: var(--text-tertiary); display: inline-flex; align-items: center; }
  .input-affix .icon .ic,
  .input-affix .icon [data-lucide],
  .input-affix .icon > svg { width: 16px; height: 16px; }
  /* Right-side affix icons (clear, validation marks, etc.) also 16px */
  .input-affix > .ic,
  .input-affix > [data-lucide],
  .input-affix > svg,
  .input-affix > .iconbtn .ic,
  .input-affix > .iconbtn [data-lucide],
  .input-affix > .iconbtn > svg,
  .input-affix > button .ic,
  .input-affix > button [data-lucide],
  .input-affix > button > svg,
  .input-affix > span > .ic,
  .input-affix > span > [data-lucide],
  .input-affix > span > svg { width: 16px; height: 16px; }
  /* Compact clear/affix button inside input-affix — strips circle + border */
  .input-affix > .iconbtn {
    width: 24px; height: 24px;
    border: 0; background: transparent;
    color: var(--text-tertiary);
    flex: none;
  }
  .input-affix > .iconbtn:hover {
    background: var(--int-hover);
    color: var(--text-secondary);
  }

  /* Tag */
  .tag {
    display: inline-flex; align-items: center; gap: 6px;
    height: 24px; padding: 0 10px;
    border-radius: 9999px; border: 1px solid var(--border-default);
    background: var(--bg-default);
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
    white-space: nowrap;
  }
  /* 中身が自由入力（セクション名など）のタグ。`.tag` は nowrap なので、そのままだと長い文字列が
     置かれた行ごと横に伸びる。付けた要素だけ 1 行で省略する（opt-in。既存のタグは変わらない）。
     入れ物側に min-width:0 が要る点に注意（grid/flex 項目の既定 min-width:auto に勝てないため）。 */
  .tag.is-truncate { display: inline-block; min-width: 0; max-width: 100%; line-height: 22px; overflow: hidden; text-overflow: ellipsis; }
  .tag--brand    { background: var(--brand-navy-50);  border-color: var(--brand-navy-200); color: var(--brand-navy); }
  /* くすませたネイビー。**意味色ではない状態**に使う（「公開」のように、正常でも異常でもなく
     ただそうなっているだけの状態）。success の緑を当てると「良い状態」という意味が乗る。 */
  .tag--subtle   { background: var(--table-bar-track); border-color: var(--tag-subtle-border); color: var(--tag-subtle-text); }
  .tag--success  { background: var(--teal-50);        border-color: var(--teal-200); color: var(--teal-700); }
  .tag--danger   { background: var(--red-50);         border-color: var(--red-200); color: var(--red-600); }
  /* 文字色は `--text-warning`。生 hex `#A5690D` は amber-50 の上で 4.08 と基準を割っていた（DS-16）。 */
  .tag--warning  { background: var(--amber-50);       border-color: var(--amber-200); color: var(--text-warning); }
  .tag--magenta  { background: var(--magenta-50);     border-color: var(--magenta-200); color: var(--magenta-800); }
  .tag--purple   { background: var(--purple-50);      border-color: var(--purple-200); color: var(--purple-700); }
  /* 受賞歴の 3 位（銅）。金＝warning / 銀＝neutral と揃えて使う。 */
  .tag--bronze   { background: var(--bronze-50);      border-color: var(--bronze-500); color: var(--bronze-700); }
  .tag--avatar { padding-left: 2px; }
  .tag--avatar .av { width: 20px; height: 20px; border-radius: 50%; background: var(--avatar-bg) center/cover; }
  /* Tag close button — clickable wrapper centering an icon or unicode mark
     (use as: <span class="tag">label<span class="x" role="button"><i data-lucide="x" class="ic"></i></span></span>) */
  .tag .x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    margin-left: 2px; margin-right: -4px;
    cursor: pointer;
    color: var(--text-placeholder);
    border-radius: 999px;
    transition: color .12s ease, background .12s ease;
  }
  .tag .x:hover { color: var(--text-primary); background: rgba(0,0,0,.08); }
  /* Icons inside .tag: 14px default; the close-button icon is smaller (12px) */
  .tag .ic { width: 14px; height: 14px; flex: none; }
  .tag .x .ic { width: 12px; height: 12px; }

  /* ChipField — チップ (.tag) を並べる枠付きコンテナ。末尾にインラインの追加ボタンを置く。
     担当者・使用可能スレッドなど「複数のトークンを足し引きする」入力に使う。
     <div class="chip-field">
       <span class="tag">ラベル<span class="x" role="button"><i data-lucide="x" class="ic"></i></span></span>
       <button class="btn btn--ghost xs"><i data-lucide="plus" class="ic"></i>追加</button>
     </div> */
  .chip-field {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 6px 10px; min-height: 40px;
    border: 1px solid var(--border-control); border-radius: var(--r-4);
    background: var(--bg-default);
  }

  /* ============================================================
     MemberPicker — 検索 + 絞り込み(ファセット) + チェック複数選択 + 選択チップ
       + ページングを備えたスケール対応のメンバー/担当者選択モーダル中身。
     構成: .mp-toolbar(検索+ファセット) / .mp-meta(該当数+選択サマリ) /
           .mp-chips(畳める選択チップ) / .picker-list(候補) / .mp-pager
     動作は assets/js/memberpicker.js (window.setupMemberPicker)。
     ============================================================ */
  .mp-toolbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
  .mp-facets { display: flex; align-items: center; gap: 8px; }
  /* ファセットは横 1 列に収める。`.segmented` は幅が足りないと折り返す作りなので、
     縮ませない側に固定する（折り返すと「すべて / 季節」と「自社」が 2 段になる）。
     隣のドロップダウンは幅を取りすぎないよう上限を付けて、余りは空けておく。 */
  .mp-facets > .segmented { flex: none; }
  .mp-facets > .sb-trigger { flex: 0 1 240px; min-width: 0; }
  .mp-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
  .mp-meta .hint { display: inline-flex; align-items: center; gap: 4px; }
  .mp-selsum { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
  .mp-chips {
    padding: 8px 10px; margin-bottom: 10px;
    max-height: 104px; overflow-y: auto;
    background: var(--bg-subtle); border: 1px solid var(--border-default); border-radius: 8px;
  }
  .mp-chips[hidden] { display: none !important; }
  .mp-chips__list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .mp-chips__list:empty::before { content: '未選択'; font-size: 12px; color: var(--text-placeholder); }
  .mp-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 6px 3px 4px;
    background: var(--bg-default); border: 1px solid var(--border-default); border-radius: 999px;
    font-size: 12px; color: var(--text-primary); line-height: 1.4;
  }
  .mp-chip__x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border: 0; background: transparent;
    color: var(--text-tertiary); cursor: pointer; border-radius: 999px;
  }
  .mp-chip__x:hover { background: var(--int-hover); color: var(--text-primary); }
  .mp-chip__x svg { width: 12px; height: 12px; }
  .mp-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }

  /* Badge */
  /* ============================================================
     バッジ（件数）— **これ1つ**。以前は同じものが7つに分かれていた
     （`.badge` / `.count-badge` / `.sm-badge` / `.tln-badge` / `.tfs-unread` /
     `.badge--navy` / `.badge--magenta`）。違いは実質サイズだけで、規則を1か所に
     持てなかった——ナビの縁取りを直したとき、他の6つは白い輪のまま残った。

     **意味は2つだけ。**
       既定（赤）      … 放置すると**相手に**影響が出る数（未読・未公開の下書き）
       `--quiet`(navy) … ただの件数（絞り込みの条件数・選択数）。見落としても自分が困るだけ

     3つ目の色は作らない。**もっと静かにしたいときは丸を外す**（`.sm-count`＝素の数字）。
     レターの下書き・送信予約がこれで、誰も待っていないので丸そのものが要らない。

     赤を「ただの数」に使わない。`--fill-danger` は「危険・エラー」の色なので、
     絞り込みの件数に使うと狼少年になる。
     ============================================================ */
  .badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 9999px; background: var(--fill-danger); color: var(--text-on-fill);
    font-size: 11px; font-weight: 700; font-family: var(--ff-display);
    line-height: 1; white-space: nowrap;
    /* 数字を「字面」で中央に置く。Plus Jakarta Sans は ascent 11 / descent 2（11px 時）と上が
       広いので、行ボックスで中央寄せすると数字の字面が約 0.037em 下へずれる（Retina の丸めで
       目に見える 1px になる）。下に 0.075em 足すと中身が半分＝ずれの分だけ上がる。
       `text-box: trim-both cap alphabetic` は flex の中の文字には効かないので使わない。 */
    padding-bottom: 0.075em;
    /* 桁が変わっても幅が跳ねない（1 → 2 桁で行がずれるのを防ぐ）。 */
    font-variant-numeric: tabular-nums;
    /* **縁の輪は既定では持たない。** 輪は「バッジが何かに重なっているとき、下の絵から
       切り抜いて見せる」ための道具で、並べて置くだけの場所では役に立たない。それなのに
       既定にすると**面の色が違う場所すべてで打ち消しが要る**——実際 `.btn > .badge` は
       `box-shadow: none` で打ち消しており、打ち消し忘れた一覧の行（`--bg-unread`）と
       セクションの見出し（`--bg-subtle`）では白い輪が浮いていた。
       重なる場所（ナビ・ヘッダーのアイコンの右上）でだけ、その面の色で付ける。 */
  }
  .badge.sm { min-width: 18px; height: 18px; padding-inline: 5px; }
  .badge.xs { min-width: 16px; height: 16px; padding-inline: 4px; font-size: 10px; }
  /* ただの件数。 */
  .badge--quiet { background: var(--int-brand); }
  /* **塗りつぶしのボタンの中では反転する。** navy のボタンに navy のバッジを置くと消える
     （以前はここだけマゼンタにして逃げていた）。 */
  .btn--primary > .badge--quiet,
  .btn--ai > .badge--quiet,
  .btn--danger > .badge--quiet { background: var(--text-on-fill); color: var(--int-brand); }
  .badge--dot { width: 8px; height: 8px; min-width: 0; padding: 0; background: var(--fill-danger); border-radius: 50%; }
  /* 分かれ目は「見過ごしたときに実害があるか」。絞り込みの条件数は見落としても自分が困る
     だけなので `--quiet`、未読・未公開の下書きのように**放置すると相手に影響が出る**数は
     既定の red。`--magenta` / `--navy` は同じ意味を2つの名前で持っていたので `--quiet` に
     統合した（マゼンタは「navy のボタンの中で navy が消える」のを避けるためだけの色だった）。 */
  .btn > .badge { margin-left: 2px; }

  /* Checkbox / Radio / Switch */
  .check, .radio { position: relative; width: 20px; height: 20px; cursor: pointer; flex: none; }
  .check input, .radio input, .switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
  .check .box {
    width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid var(--border-control);
    background: var(--bg-default);
    display: grid; place-items: center; transition: background .12s, border-color .12s;
  }
  .check input:checked ~ .box { background: var(--brand-navy); border-color: var(--brand-navy); }
  .check input:checked ~ .box::after {
    content: ""; width: 10px; height: 6px; border-left: 2px solid var(--text-on-fill); border-bottom: 2px solid var(--text-on-fill);
    transform: rotate(-45deg) translate(1px,-1px);
  }
  .check input:focus-visible ~ .box { box-shadow: var(--shadow-focus); }
  /* テーブル内のチェック/ラジオは 16px（PC settings-team の org-check と同寸。フォーム等は 20px のまま） */
  .data-table .check, .data-table .radio { width: 16px; height: 16px; }
  .data-table .check .box, .data-table .radio .dot { width: 16px; height: 16px; }
  .data-table .check input:checked ~ .box::after { width: 9px; height: 5px; }
  .radio .dot {
    width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-control);
    background: var(--bg-default); display: grid; place-items: center; transition: border-color .12s;
  }
  .radio input:checked ~ .dot { border-color: var(--brand-navy); }
  .radio input:checked ~ .dot::after {
    content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-navy);
  }
  .switch { position: relative; width: 40px; height: 22px; display: inline-block; cursor: pointer; }
  /* OFF の面は薄いまま（濃くすると ON に見える）。**枠で「どこにある操作要素か」を示す**
     ——面 `--gray-200` は白の上で 1.24:1 しかなく、境界が見えなかった（WCAG 1.4.11・DS-14）。
     状態そのものはツマミの位置（左/右）が伝えるので、面の色は状態の手がかりではない。 */
  .switch .track {
    position: absolute; inset: 0; background: var(--gray-200); border-radius: 999px;
    border: 1px solid var(--border-control); box-sizing: border-box;
    transition: background .15s ease, border-color .15s ease;
  }
  .switch .thumb {
    position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; background: var(--bg-default); border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
    transition: transform .15s ease;
  }
  /* ON 時に thumb 内へ navy のチェックマーク (色のみ依存にしない CVD 対応) */
  .switch .thumb::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 8px; height: 5px;
    border-left: 2px solid var(--brand-navy);
    border-bottom: 2px solid var(--brand-navy);
    transform: translate(-50%, -65%) rotate(-45deg);
    opacity: 0;
    transition: opacity .12s ease;
  }
  .switch input:checked ~ .track { background: var(--brand-navy); border-color: var(--brand-navy); }
  .switch input:checked ~ .thumb { transform: translateX(18px); }
  .switch input:checked ~ .thumb::after { opacity: 1; }
  .switch input:disabled ~ .track { opacity: 0.45; }
  .switch:has(input:disabled) { cursor: not-allowed; }

  /* Tabs */
  .tabs {
    display: flex; border-bottom: 1px solid var(--border-default);
    gap: 4px;
  }
  .tabs .tab {
    padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--text-tertiary);
    cursor: pointer; border: 0; background: transparent;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap;
  }
  .tabs .tab .ic { width: 16px; height: 16px; flex: none; }
  /* Inline badge inside a tab — smaller than stand-alone .badge */
  .tabs .tab .tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px;
    background: var(--brand-navy-50); color: var(--brand-navy);
    font-size: 11px; font-weight: 700; line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  .tabs .tab.is-active .tab-badge {
    background: var(--brand-navy); color: var(--text-on-fill);
  }
  /* Red count badge (unread / alerts) */
  .tabs .tab .tab-badge.is-alert {
    background: var(--fill-danger); color: var(--text-on-fill);
  }
  .tabs .tab.is-active .tab-badge.is-alert {
    background: var(--fill-danger); color: var(--text-on-fill);
  }
  /* Dot indicator (state only, no count) */
  .tabs .tab .tab-dot {
    width: 8px; height: 8px; border-radius: 999px;
    background: var(--red-500); flex: none;
    display: inline-block;
  }
  .tabs .tab:hover { color: var(--text-primary); }
  .tabs .tab.is-active { color: var(--brand-navy); border-bottom-color: var(--brand-navy); }
  .tabs .tab:disabled { color: var(--text-disabled, var(--text-tertiary)); opacity: .5; cursor: not-allowed; }
  .tabs .tab:disabled:hover { color: var(--text-disabled, var(--text-tertiary)); }
  .tabs.pill { border-bottom: 0; gap: 4px; background: var(--bg-subtle); padding: 4px; border-radius: 8px; display: inline-flex; }
  .tabs.pill .tab { border: 0; border-radius: 6px; padding: 6px 12px; }
  .tabs.pill .tab.is-active { background: var(--bg-default); color: var(--text-primary); box-shadow: var(--shadow-1); }

  /* 全幅タブ帯（`.tabs.pill.is-block`）。Figma: design-system 1197:42542「BorderTabBer」。
     選択肢を等分して画面いっぱいに敷く。**画面の中身そのものを切り替える**タブ
     （プロフィール / レター / 投稿）に使う。狭い所の絞り込みは `.tabs.pill` 単体で。 */
  .tabs.pill.is-block { display: flex; width: 100%; gap: 0; }
  .tabs.pill.is-block .tab {
    flex: 1 0 0; min-width: 0; justify-content: center;
    padding: 8px 16px; border-radius: 8px;
    font-size: 14px; font-weight: 500; line-height: 20px; letter-spacing: 1.12px;
  }
  .tabs.pill.is-block .tab.is-active { color: var(--brand-navy); box-shadow: var(--shadow-2); }

  /* Tooltip
     - 単独の <span class="tt"> ... </span>  → プレビュー用、常時表示
     - <button class="iconbtn"> ... <span class="tt"> ... </span> </button>
       → ボタン上空に浮かせて hover で表示（正規のツールチップ挙動）
  */
  .tt {
    background: var(--brand-navy); color: var(--text-on-fill);
    font-size: 12px; font-weight: 500;
    padding: 6px 10px; border-radius: 6px;
    display: inline-block;
    position: relative;
    white-space: nowrap;
    line-height: 1.4;
  }
  .tt::after {
    content: ""; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%) rotate(45deg);
    width: 8px; height: 8px; background: var(--brand-navy);
  }
  .tt.light { background: var(--bg-default); color: var(--text-primary); border: 1px solid var(--border-default); box-shadow: var(--shadow-2); }
  .tt.light::after { background: var(--bg-default); border: 1px solid var(--border-default); border-top: 0; border-left: 0; }

  /* Tooltip on iconbtn — hover で出る正規挙動。
     **React の `IconButton` はこの形（中に .tt を置く方式）を使わない**：吹き出しのぶんだけ
     親が広くなり、スクロールする器（表・SidePanel）の中で「中身は収まっているのに横スクロールが
     出る」ことになるため、body へポータルする（`TipPortal` / `.tt.help-tt-pop`）。
     以下は素の HTML（PC/recog-design-system.html・snippets）用に残してある。 */
  .iconbtn { position: relative; }
  .iconbtn > .tt {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity .12s ease, transform .12s ease;
  }
  .iconbtn:hover > .tt,
  .iconbtn:focus-visible > .tt,
  .iconbtn.is-tt-show > .tt {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  /* 右端揃え: ボタンが画面/表の右端にあって tooltip が見切れる時に使う。
     吹き出しの右端をボタンの右端に合わせ、 矢印もボタン中央に再配置。 */
  .iconbtn.is-tt-right > .tt {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(4px);
  }
  .iconbtn.is-tt-right:hover > .tt,
  .iconbtn.is-tt-right:focus-visible > .tt,
  .iconbtn.is-tt-right.is-tt-show > .tt {
    transform: translateX(0) translateY(0);
  }
  .iconbtn.is-tt-right > .tt::after {
    left: auto;
    right: 10px;
    transform: rotate(45deg);
  }
  /* 表のアクション列：tooltip は下に出す。
     上向きだと先頭行でヘッダー帯にぶつかって見切れる（.dt-grid__body の overflow でクリップ）。 */
  .col-actions .iconbtn > .tt {
    bottom: auto;
    top: calc(100% + 8px);
    transform: translateX(-50%) translateY(-4px);
  }
  .col-actions .iconbtn:hover > .tt,
  .col-actions .iconbtn:focus-visible > .tt,
  .col-actions .iconbtn.is-tt-show > .tt {
    transform: translateX(-50%) translateY(0);
  }
  .col-actions .iconbtn > .tt::after {
    top: -4px;
    bottom: auto;
  }
  /* 最終ボタンは右端揃え（表の右端ではみ出すのを防ぐ） */
  .col-actions .iconbtn:last-child > .tt {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(-4px);
  }
  .col-actions .iconbtn:last-child:hover > .tt,
  .col-actions .iconbtn:last-child:focus-visible > .tt {
    transform: translateX(0) translateY(0);
  }
  .col-actions .iconbtn:last-child > .tt::after {
    left: auto;
    right: 10px;
    transform: rotate(45deg);
  }

  /* Tooltip host — 任意の要素に hover-tooltip を持たせる汎用ヘルパー。
     利用: <span class="dt-method-ic tt-host">…<span class="tt">ラベル</span></span>
     `.iconbtn` / `.avatar` 専用ルールと同じ挙動を、 ページ固有の要素にも与える。 */
  .tt-host { position: relative; }
  .tt-host > .tt {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity .12s ease, transform .12s ease;
  }
  .tt-host:hover > .tt,
  .tt-host:focus-visible > .tt {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  /* Tooltip on avatar — 名前など補助情報を hover で表示 (avatar-stack 内で特に有効) */
  .avatar > .tt {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity .12s ease, transform .12s ease;
  }
  .avatar:hover > .tt,
  .avatar:focus-visible > .tt {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  /* avatar-stack 内では hover した avatar を兄弟より前面に出す */
  .avatar-stack > .avatar:hover { z-index: 100; }

  /* Rich variant: 複数行の補足説明用（help-i クリック等で開くポップオーバー）
     - white-space: normal で折り返し可能に
     - max-width で適切な幅に制限
     - JS から position/top/left を直接設定するための土台 */
  .tt.is-rich {
    white-space: normal;
    max-width: 280px;
    padding: 10px 12px;
    line-height: 1.6;
    text-align: left;
    box-shadow: var(--shadow-8);
  }
  /* Arrow placement: tooltip が trigger の下にあるとき、矢印は上向き */
  .tt.is-below::after {
    bottom: auto;
    top: -4px;
  }
  /* light + below 組合せ：上側にだけ border を残す */
  .tt.light.is-below::after {
    border: 1px solid var(--border-default);
    border-right: 0; border-bottom: 0;
  }
  /* Standalone (JS-positioned): 単独で body に append して位置を JS 制御 */
  .tt.is-standalone {
    position: absolute;
    z-index: 1100;
    opacity: 0;
    transition: opacity .12s ease, transform .12s ease;
    pointer-events: auto;
  }
  .tt.is-standalone.is-open { opacity: 1; }
  .tt.is-standalone[hidden] { display: none; }

  /* Toast */
  .toast {
    display: inline-flex; align-items: center; gap: 12px;
    background: var(--fill-inverse); color: var(--text-on-fill);
    padding: 12px 16px; border-radius: 8px;
    min-width: 320px;
    box-shadow: var(--shadow-8);
    font-size: 13px;
  }
  .toast[hidden] { display: none; }
  .toast .ico { display: grid; place-items: center; width: 20px; height: 20px; }
  /* 3 トーンは**別の色**にする。同じ色だと「保存できた」と「保存できなかった」が
     同じ見た目になり、アイコンだけが違いになる（色は最初に目に入る手がかり）。 */
  .toast--success { background: var(--brand-navy); }   /* ブランド色（成功） */
  .toast--danger  { background: var(--fill-danger); }  /* 赤（失敗） */
  .toast--info    { background: var(--fill-inverse); } /* 素のグレー（お知らせ） */
  .toast button.t-btn {
    margin-left: auto; color: var(--text-on-fill); opacity: .86; background: transparent;
    border: 0; font-weight: 700; cursor: pointer; font-size: 13px;
  }
  .toast button.t-btn:hover { opacity: 1; }

  /* ============================================================
     NewArrivalPill
     フィードを下にスクロールしている最中に新着レターが
     届いたことを知らせるフローティングピル。
     クリックでモーダルを開き、スクロール位置を保ったまま
     新着分だけを閲覧できる。
     ============================================================ */
  .na-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    height: 40px;
    background: var(--bg-default);
    color: var(--text-primary);
    border: 1px solid var(--border-control);
    border-radius: 9999px;
    box-shadow: var(--shadow-4);
    font-family: var(--ff-sans);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: transform .18s ease-out, box-shadow .18s ease-out, background .12s ease-out;
    text-decoration: none;
  }
  .na-pill:hover { background: var(--bg-default); box-shadow: var(--shadow-8); transform: translateY(-1px); text-decoration: none; }
  .na-pill:active { transform: translateY(0); box-shadow: var(--shadow-2); }
  .na-pill:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
  .na-pill .na-arrow {
    width: 28px; height: 28px; border-radius: 9999px;
    background: var(--fill-magenta); color: var(--text-on-fill);
    display: grid; place-items: center; flex: none;
  }
  .na-pill .na-arrow .ic { width: 16px; height: 16px; stroke-width: 2.25; }
  .na-pill .na-count {
    font-family: var(--ff-mono);
    font-weight: 700;
    font-size: 13px;
    color: var(--magenta-500);
    padding: 0 2px;
  }
  .na-pill .na-label { color: var(--text-primary); }
  .na-pill .na-chev { width: 14px; height: 14px; color: var(--text-tertiary); stroke-width: 2; margin-left: 2px; }

  /* Avatar stack variant — アバターを重ねて「誰から」を示唆 */
  .na-pill.has-avatars { padding-left: 6px; }
  .na-pill .na-avstack { display: inline-flex; flex: none; }
  .na-pill .na-avstack .na-av {
    width: 28px; height: 28px; border-radius: 9999px;
    border: 2px solid var(--bg-default);
    background: var(--brand-navy-100) center/cover no-repeat;
    flex: none;
  }
  .na-pill .na-avstack .na-av + .na-av { margin-left: -10px; }

  /* Count-only compact variant */
  .na-pill.is-compact { padding: 6px 12px 6px 6px; height: 36px; }
  .na-pill.is-compact .na-arrow { width: 24px; height: 24px; }
  .na-pill.is-compact .na-arrow .ic { width: 14px; height: 14px; }

  /* Appear / disappear */
  @keyframes naFadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .na-pill.is-entering { animation: naFadeInDown .22s ease-out both; }
  .na-pill.is-hidden { display: none !important; }

  /* In-feed demo: sticky position inside a mock feed viewport */
  .na-feed-demo {
    position: relative;
    height: 440px;
    background: var(--bg-page);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    overflow: hidden;
  }
  .na-feed-scroll {
    position: absolute; inset: 0;
    overflow-y: auto;
    padding: 56px 20px 20px;
    scroll-behavior: smooth;
  }
  .na-feed-header {
    position: absolute; top: 0; left: 0; right: 0; height: 48px;
    background: var(--bg-default);
    border-bottom: 1px solid var(--border-default);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; z-index: 2;
  }
  .na-feed-header .na-feed-title {
    font-size: 13px; font-weight: 700; color: var(--text-primary);
    letter-spacing: -0.005em;
  }
  .na-feed-header .na-feed-dept {
    font-size: 11px; color: var(--text-tertiary); font-family: var(--ff-mono);
  }
  .na-feed-pill-slot {
    position: absolute; top: 60px; right: 20px; z-index: 3;
    pointer-events: none;
  }
  .na-feed-pill-slot .na-pill { pointer-events: auto; }
  .na-feed-item {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex; gap: 12px; align-items: flex-start;
  }
  .na-feed-item .na-fi-av {
    width: 40px; height: 40px; border-radius: 9999px; flex: none;
    background: var(--avatar-bg) center/cover no-repeat;
  }
  .na-feed-item .na-fi-body { flex: 1 1 auto; min-width: 0; }
  .na-feed-item .na-fi-head {
    display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
    margin-bottom: 4px;
  }
  .na-feed-item .na-fi-from { font-weight: 700; font-size: 13px; color: var(--text-primary); }
  .na-feed-item .na-fi-arrow { color: var(--text-tertiary); font-size: 11px; }
  .na-feed-item .na-fi-to { font-weight: 700; font-size: 13px; color: var(--text-primary); }
  .na-feed-item .na-fi-date { margin-left: auto; font-size: 11px; color: var(--text-tertiary); font-family: var(--ff-mono); }
  .na-feed-item .na-fi-text { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }

  /* ============================================================
     Section divider
     1px の罫線の上に「白背景の小ブロック」をオーバーレイして打ち抜く。
     親（.parts-card / .stage / 任意のリスト）の背景色を継承するので、
     subtle 背景でも自然に「打ち抜き」が成立する。
     ============================================================ */
  .sec-divider {
    position: relative;
    width: 100%;
    min-height: 20px;
    display: flex;
    align-items: center;
    /*
      罫線を打ち抜く色。**`background: inherit` をやめた**（2026-09-21、指摘「デザインが崩れてる」）。
      `inherit` が見るのは**すぐ上の親（この `.sec-divider` 自身）**で、ここに背景の指定が無い以上
      必ず `transparent` になる——カードが白でも関係なく、罫線が文字の上を素通りしていた
      （`/demo/layout` で 4 つとも `rgba(0,0,0,0)` と実測）。
      カスタムプロパティなら**祖先から素直に降りてくる**ので、面が白でない所（`--bg-subtle` の上、
      写真の上）は器の側で 1 行上書きすればよい。
    */
    --sd-punch: var(--bg-default);
  }
  .sec-divider::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto 0;
    height: 1px;
    background: var(--border-default);
    transform: translateY(-0.5px);
  }
  .sec-divider__bg {
    position: relative;
    z-index: 1;
    background: var(--sd-punch);   /* 打ち抜く色。既定は白。器が `--sd-punch` で変えられる */
    display: inline-flex;
    align-items: center;
  }
  /* Variant: label (14px regular secondary) */
  .sec-divider--label .sec-divider__bg {
    font-size: 14px;
    line-height: 20px;
    color: var(--text-secondary);
    padding: 0 8px;
  }
  /* Variant: title (18/28 600 display) */
  .sec-divider--title .sec-divider__bg {
    font-family: var(--ff-display);
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 12px;
  }
  /* Alignment */
  .sec-divider--center { justify-content: center; }
  .sec-divider--left   { justify-content: flex-start; }
  /* Left-aligned variants kill left padding so the text hugs the edge */
  .sec-divider--left.sec-divider--label .sec-divider__bg { padding-left: 0; padding-right: 8px; }
  .sec-divider--left.sec-divider--title .sec-divider__bg { padding-left: 0; padding-right: 12px; }
  /* ボタンも左寄せのときは左 padding を落とす（ラベル・タイトルと左端を揃えるため）。 */
  .sec-divider--left.sec-divider--button .sec-divider__bg--btn { padding-left: 0; }
  /* Variant: button (centered) — vertical rhythm needs ~34px so the button doesn't crop */
  .sec-divider--button { min-height: 34px; }
  .sec-divider__bg--btn { padding: 0 8px; }
  /* Variant: title + button (split ends) */
  .sec-divider--titlebtn { min-height: 34px; justify-content: space-between; }
  .sec-divider__bg--start {
    font-family: var(--ff-display);
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
    color: var(--text-primary);
    padding-right: 12px;
  }
  .sec-divider__bg--end { padding-left: 8px; }

  /*
    打ち抜きの見た目を調整する 2 つ（2026-09-21、指摘）。

    - `--bare` … **中身がそれ自体で不透明なとき**（ボタン）は打ち抜かない。ボタンが罫線を隠すので
      白は要らず、置くと**角丸のボタンの後ろに四角い白**が出る（`PC/sample/…17.43.27.png`）
    - `--round` … 面が白でない所（写真の上）に置くとき、打ち抜きを角丸にする。四角い白は
      「切り抜き」ではなく「貼った紙」に見えるので、隣に並ぶチップと同じ形にする
  */
  .sec-divider__bg--bare { background: transparent; padding: 0; }
  .sec-divider--round .sec-divider__bg:not(.sec-divider__bg--bare) {
    border-radius: var(--r-10);
    min-height: 32px;
    padding: 0 10px;
  }



  /* ============================================================
     Menu / Dropdown
     ケバブ・アバター・任意 button から出るポップオーバーメニュー。
     LongPressMenu と見た目を揃え、構造だけリッチにしたもの。
     ============================================================ */
  .menu {
    min-width: 200px;
    max-width: 320px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    box-shadow: var(--shadow-8);
    padding: 6px;
    font-family: var(--ff-sans);
    font-size: 13px;
    color: var(--text-primary);
  }
  .menu.is-wide { min-width: 260px; }
  /* Menu used as a small form surface (e.g. the filter-rule editor popover): a row
     of controls is wider than a text menu, so drop the reading-width cap. */
  .menu.is-form { max-width: none; }
  /* Dividers bleed by -6px in a normal menu; inside a form menu that pokes out of the
     padding box and forces a horizontal scrollbar, so keep them within the padding. */
  .menu.is-form > .mn-divider { margin-left: 0; margin-right: 0; }
  /* Long option menus (e.g. the filter property picker): scroll instead of running
     past the viewport, which silently hides the items at the bottom. */
  .menu.is-scroll { max-height: 320px; overflow-y: auto; }

  /* Vertical hairline for toolbars — separates groups of controls that look alike
     (e.g. sort chips vs filter chips) so they don't read as one list. */
  .bar-divider {
    width: 1px;
    align-self: stretch;
    min-height: 20px;
    flex: none;
    margin: 0 4px;
    background: var(--border-strong);
  }
  /* Popover positioning: anchor menu below a trigger button. The trigger's
     parent needs `position: relative`. Combine with .is-right / .is-left
     to align to the right/left edge of the host. */
  .menu.is-popover {
    position: absolute;
    top: calc(100% + 4px);
    z-index: 10;
  }
  .menu.is-popover.is-right { right: 0; }
  .menu.is-popover.is-left  { left: 0; }
  /* body へポータルした RowMenu/Dropdown（MenuButton）。位置はラッパ側が fixed で確定
     させるので、内側の .is-popover の absolute 配置は無効化して静的に流す。 */
  .menu-portal .menu.is-popover {
    position: static;
    top: auto; right: auto; left: auto;
  }

  /* search bar (optional) */
  .menu .mn-search {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; margin-bottom: 4px;
    border-bottom: 1px solid var(--border-default);
  }
  .menu .mn-search .ic { width: 16px; height: 16px; color: var(--text-tertiary); stroke-width: 2; flex: none; }
  .menu .mn-search input {
    flex: 1 1 auto; min-width: 0;
    border: 0; background: transparent; outline: none;
    font: inherit; color: var(--text-primary);
    padding: 4px 0;
  }
  .menu .mn-search input::placeholder { color: var(--text-placeholder); }

  /* section headers */
  .menu .mn-section {
    padding: 8px 10px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
  }
  .menu .mn-section:first-child { padding-top: 4px; }
  .menu .mn-divider {
    height: 1px;
    background: var(--border-default);
    margin: 6px -6px;
  }

  /* items */
  .menu .mn-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    line-height: 1.3;
    position: relative;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    font: inherit;
  }
  .menu .mn-item:hover,
  .menu .mn-item:focus-visible,
  .menu .mn-item.is-hover {
    background: var(--brand-navy-50);
    outline: none;
  }
  .menu .mn-item.is-active {
    background: var(--brand-navy-50);
    color: var(--brand-navy);
    box-shadow: inset 3px 0 0 0 var(--border-selected);   /* DS-19 */
  }
  /* `disabled` 属性も同じ見た目にする。**`MenuItem` は `<button>` なので `disabled` が
     素直な書き方**だが、以前は `[aria-disabled]` と `.is-disabled` だけを見ていて、
     押せないのに押せる見た目のまま出ていた（`.btn[disabled]` と同じ理由で不可）。 */
  .menu .mn-item[aria-disabled="true"],
  .menu .mn-item:disabled,
  .menu .mn-item.is-disabled {
    color: var(--text-disabled);
    cursor: not-allowed;
  }
  .menu .mn-item[aria-disabled="true"]:hover,
  .menu .mn-item:disabled:hover,
  .menu .mn-item.is-disabled:hover { background: transparent; }
  /* アイコンも一緒に落とす（文字だけ薄いと「アイコンは押せる」ように見える）。 */
  .menu .mn-item[aria-disabled="true"] .mn-ico,
  .menu .mn-item:disabled .mn-ico,
  .menu .mn-item.is-disabled .mn-ico { color: var(--text-disabled); }

  .menu .mn-item .mn-ico {
    flex: none;
    width: 16px; height: 16px;
    color: var(--text-secondary);
    display: grid; place-items: center;
  }
  .menu .mn-item .mn-ico .ic { width: 16px; height: 16px; stroke-width: 2; }
  .menu .mn-item .mn-label {
    flex: 1 1 auto; min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .menu .mn-item .mn-sub {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
    white-space: normal;
    line-height: 1.4;
  }
  .menu .mn-item .mn-kbd {
    flex: none;
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--text-tertiary);
    letter-spacing: .02em;
  }
  .menu .mn-item .mn-sub-chev {
    flex: none;
    width: 14px; height: 14px;
    color: var(--text-tertiary);
    stroke-width: 2;
    margin-right: -2px;
  }

  /* check / radio */
  .menu .mn-item .mn-check {
    flex: none;
    width: 16px; height: 16px;
    color: var(--brand-navy);
    opacity: 0;
  }
  .menu .mn-item.is-checked .mn-check { opacity: 1; }
  .menu .mn-item.is-checked .mn-label { font-weight: 600; }

  /* destructive */
  .menu .mn-item.is-danger { color: var(--red-500); }
  .menu .mn-item.is-danger .mn-ico { color: var(--red-500); }
  .menu .mn-item.is-danger:hover,
  .menu .mn-item.is-danger:focus-visible,
  .menu .mn-item.is-danger.is-hover { background: var(--red-50); }

  /* submenu preview wrapper (for docs only) */
  .menu-pair {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
  }
  .menu-pair::after {
    /* arrow line between parent and submenu — purely decorative in docs */
    content: "";
  }

  /* Kebab button (trigger) — reused in patterns */
  .kebab-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: 6px;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
  }
  .kebab-btn:hover { background: var(--int-hover); color: var(--text-primary); }
  .kebab-btn .ic { width: 18px; height: 18px; stroke-width: 2; }

  /* Avatar — legacy size aliases only (sm/md/lg/xl). Base styles live in the new .avatar definition above. */
  .avatar.sm, .avatar.md, .avatar.lg, .avatar.xl {
    background: var(--avatar-bg) center/cover no-repeat;
    color: var(--brand-navy); font-weight: 700;
  }
  .avatar.sm { width: 24px; height: 24px; font-size: 10px; }
  .avatar.md { width: 40px; height: 40px; }
  .avatar.lg { width: 56px; height: 56px; font-size: 18px; }
  .avatar.xl { width: 72px; height: 72px; font-size: 22px; }
  /* 押せるアバター（`Avatar onClick`）。要素が button に変わるだけなので、ボタン既定の
     枠・余白・背景・フォントを落として span のときと同じ見た目に戻す。
     `.av-grp .avatar { border: 2px solid var(--bg-default) }` の方が詳細度が高いので、グループ内の
     白い縁は残る（外した瞬間に重なりの見え方が変わるため、ここでは触らない）。 */
  button.avatar { border: 0; padding: 0; background: none; font: inherit; cursor: pointer; }
  button.avatar:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }

  .av-grp { display: inline-flex; }
  .av-grp .avatar { border: 2px solid var(--bg-default); }
  .av-grp .avatar + .avatar { margin-left: -8px; }
  /* 重なりで後ろの顔が前の顔の右側を覆うので、バッジを持つ顔だけ前面に出す
     （未読の赤ドットが隣のアバターに隠れると、誰宛かが分からなくなる）。 */
  .av-grp .avatar:has(> .av-badge) { z-index: 1; }
  /* `UserHoverCard` で包むと avatar 同士が兄弟でなくなり、上の `+` 規則が効かず
     重なりが消える。ホスト（`.uhc-host`）にも同じ重なりを効かせる。
     枠線は `.av-grp .avatar`（子孫セレクタ）なので包んでも効いたままになる。 */
  .av-grp .uhc-host + .uhc-host,
  .av-grp .avatar + .uhc-host,
  .av-grp .uhc-host + .avatar { margin-left: -8px; }
  /* Overflow chip closing the stack ("+49"). Sized from the group's size class
     so it always matches the avatars it follows. */
  .av-grp .av-more {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--av-more, 32px); height: var(--av-more, 32px);
    flex: none;
    margin-left: -8px;
    /* .avatar is positioned (for .av-badge), so a static chip would be painted
       under the avatar it overlaps and clip the "+". */
    position: relative; z-index: 1;
    border: 2px solid var(--bg-default);
    border-radius: 999px;
    background: var(--bg-canvas);
    color: var(--text-secondary);
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .av-grp.s-24 { --av-more: 24px; }
  .av-grp.s-32 { --av-more: 32px; }
  .av-grp.s-40 { --av-more: 40px; }
  .av-grp.s-48 { --av-more: 48px; }
  .av-grp.s-48 { --av-more: 48px; }
  .av-grp.s-24 .av-more { font-size: 10px; }

  /* Card */
  .card {
    background: var(--bg-default); border-radius: var(--r-4);
    border: 1px solid var(--border-strong);   /* 外枠＝strong（グレー地に対しくっきり。sr-list/表と統一） */
    padding: 20px;
  }
  .card.elev-4 { border: 0; box-shadow: var(--shadow-4); }
  .card.elev-8 { border: 0; box-shadow: var(--shadow-8); }

  /* Card header — used as a labeled top bar inside .card.
     When .card-h is present, it sits at the very top edge so the wrapper
     padding is reset by the inner content blocks. */
  .card:has(> .card-h) { padding: 0; }
  .card-h {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-default);
    background: var(--bg-subtle);
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    color: var(--text-primary);
  }
  .card-h strong { font-weight: 700; font-size: 13px; }

  /* ---------- SectionCard ----------
     見出し帯（タイトル＋説明）と本文が境界線で分かれる 2 段カード。
     Figma: design-system 1457:19106。

     `.card` + `BlockTitle` とは使い分ける：あちらは**カードの中に見出しを置く**（1 枚に 1 つの
     短いブロック）。こちらは**見出しが独立した帯**なので、長い本文・表・入れ子のカードを抱える
     「節」に使う。見出しの左右余白（32px）は本文（16px）より広い — 帯の中の文字を中に寄せて、
     本文のカード/表が端に揃うようにするため。 */
  .sec-card {
    display: flex; flex-direction: column;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-16);
    min-width: 0;
  }
  /* 横の余白は**本文（`.sec-card__body` の 16px）と同じ**にする。32px だったので、
     見出しだけが中身より 16px 内側にあり、題名と中身の左端が揃っていなかった。 */
  .sec-card__head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-default);
    word-break: break-word;
  }
  .sec-card__title {
    margin: 0;
    font-size: 16px; font-weight: 600; line-height: 16px;
    color: var(--text-tertiary);
  }
  .sec-card__desc {
    display: block; margin-top: 4px;
    font-size: 14px; line-height: 20px;
    color: var(--text-tertiary);
  }
  /* 見出し右の補足・凡例・操作。折り返さず右端に固定する。 */
  .sec-card__action { flex: none; }
  /* 本文は余りを埋める。2 カラムで並べたとき grid の stretch でカードが伸びるので、
     本文が伸びないと flush の表・リストの地がカード下端まで届かない。 */
  .sec-card__body { padding: 16px; min-width: 0; flex: 1; }
  /* 表・リストを端まで敷くとき（本文の内側余白を消す）。角丸からはみ出さないよう下端で切る。 */
  .sec-card__body.is-flush {
    padding: 0;
    overflow: hidden;
    border-radius: 0 0 var(--r-16) var(--r-16);
  }
  /* 端まで敷いた表・リストは自前の枠と角丸を外す。カードが既に枠を持っているので、
     そのままだと 1px ずれた枠が二重に重なって見える。 */
  .sec-card__body.is-flush > .dt-wrap,
  .sec-card__body.is-flush > .sr-list {
    border: 0;
    border-radius: 0;
  }

  /* Avatar fallback — colored gradient tile rendered in place of a portrait.
     The gradient and color come from inline style attributes per-instance. */
  .av-fallback {
    display: inline-grid; place-items: center;
    width: 100%; height: 100%;
    font-weight: 700;
    font-size: 0.5em;       /* relative to the avatar container */
    line-height: 1;
    letter-spacing: 0;
  }
  .avatar.s-24  .av-fallback { font-size: 11px; }
  .avatar.s-32  .av-fallback { font-size: 13px; }
  .avatar.s-40  .av-fallback { font-size: 15px; }
  .avatar.s-48  .av-fallback { font-size: 18px; }
  .avatar.s-56  .av-fallback { font-size: 20px; }
  .avatar.s-64  .av-fallback { font-size: 22px; }
  .avatar.s-96  .av-fallback { font-size: 34px; }
  .avatar.s-150 .av-fallback { font-size: 56px; }

  /* トーク背景に写真を敷いたときのベール。吹き出しが読めなくなるのを防ぐためのもので、
     明るいテーマでは白、暗いテーマでは黒を薄く重ねる（`talkBackgroundStyle()` が使う）。 */
  :root { --talk-bg-scrim: rgba(255, 255, 255, 0.62); }
  :root[data-theme="dark"] { --talk-bg-scrim: rgba(12, 15, 20, 0.62); }

  /* Icon */
  .ic { width: 20px; height: 20px; display: inline-block; flex: none; }
  .ic.ic-18 { width: 18px; height: 18px; }

  /* Small helpers */
  .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
  .stack { display: flex; flex-direction: column; gap: 12px; }
  .muted { color: var(--text-tertiary); }
  .spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .spec-table th, .spec-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-default); }
  .spec-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-tertiary); font-weight: 700; }
  .spec-table code { font-family: var(--ff-mono); font-size: 12px; color: var(--text-secondary); background: var(--bg-subtle); padding: 1px 6px; border-radius: 3px; }

  /* Hero visual */
  .hero {
    display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; margin-bottom: 48px;
  }
  .hero .meta {
    background: var(--bg-default); border: 1px solid var(--border-default); border-radius: 4px;
    padding: 24px;
  }
  .hero .meta h5 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-tertiary); }
  .hero .meta .v { font-family: var(--ff-display); font-size: 24px; font-weight: 700; margin-bottom: 14px; }
  .hero .palette {
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--fill-brand-strong) 100%);
    border-radius: 4px; color: var(--text-on-fill);
    padding: 40px; display: flex; flex-direction: column; justify-content: space-between;
    min-height: 260px; position: relative; overflow: hidden;
  }
  .hero .palette::after {
    content: ""; position: absolute; right: -60px; top: -60px;
    width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(99,102,241,.6), transparent 60%);
  }
  .hero .palette h2 { font-family: var(--ff-display); font-size: 48px; margin: 0 0 8px; letter-spacing: -0.02em; font-weight: 800; }
  .hero .palette p { margin: 0; max-width: 380px; opacity: .86; line-height: 1.5; font-size: 14px; }
  .hero .palette .dots { display: flex; gap: 8px; }
  .hero .palette .dots span { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.2); }

  /* Icons */
  .lucide {
    display: inline-flex; align-items: center; justify-content: center;
    flex: none; color: currentColor;
  }
  .lucide svg { display: block; }
  .icon-grid-row {
    display: grid; grid-template-columns: 180px repeat(3, 1fr);
    gap: 16px; align-items: stretch;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-default);
  }
  .icon-grid-label {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
  }
  .icon-grid-label .size {
    font-family: var(--ff-display);
    font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -0.01em;
    color: var(--text-primary);
  }
  .icon-grid-label .size span {
    font-family: var(--ff-mono);
    font-size: 13px; font-weight: 500; margin-left: 4px; color: var(--text-tertiary);
  }
  .icon-grid-cell {
    background: var(--bg-page);
    border: 1px solid var(--border-default);
    border-radius: var(--r-4);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    padding: 20px 12px;
    color: var(--text-primary);
    position: relative;
    min-height: 120px;
  }
  .icon-grid-cell.is-default {
    background: var(--brand-navy-50);
    border-color: var(--icon-cell-border);
  }
  .icon-grid-cell.is-default::after {
    content: "default";
    position: absolute; top: 8px; right: 8px;
    font-family: var(--ff-mono); font-size: 10px; font-weight: 600;
    background: var(--brand-navy); color: var(--text-on-fill);
    padding: 2px 6px; border-radius: 3px;
    letter-spacing: 0.04em;
  }
  .icon-grid-cell .meta {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
  }
  .icon-grid-cell .meta b {
    font-family: var(--ff-mono);
    font-size: 13px; font-weight: 600; color: var(--text-primary);
  }
  .icon-grid-cell .meta span {
    font-size: 11px; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.06em;
  }

  .icon-size-compare {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px;
    align-items: end; justify-items: center;
    padding: 16px 0;
  }
  .icon-size-compare > div { display: flex; flex-direction: column; align-items: center; }

  .icon-library {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px;
  }
  .icon-library .lib-cell {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 16px 8px;
    border: 1px solid var(--border-default);
    border-radius: var(--r-4);
    background: var(--bg-default);
    color: var(--text-primary);
    transition: background .12s ease, border-color .12s ease;
  }
  .icon-library .lib-cell:hover { background: var(--int-hover); border-color: var(--border-strong); }
  .icon-library .lib-cell .label {
    font-family: var(--ff-mono); font-size: 10px; color: var(--text-tertiary);
    text-align: center; line-height: 1.3;
    word-break: break-all;
  }

  /* ============ Parts (NEW) ============ */
  .parts-grid { display: grid; gap: 16px; }
  .parts-grid.cols2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .parts-card {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-4);
    padding: 20px 24px;
  }
  .parts-card .phead {
    display:flex; align-items:baseline; gap:10px; justify-content: space-between;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border-default);
  }
  .parts-card .phead .name { font-weight: 700; font-size: 14px; }
  .parts-card .phead .meta { font-family: var(--ff-mono); font-size: 11px; color: var(--text-tertiary); }
  .parts-card .stage { padding: 8px 0; }

  /* Timestamp list */
  .ts-list { display:flex; flex-direction:column; gap: 14px; }
  .ts-list .ts { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
  .ts-list .ts.lg { font-size: 14px; color: var(--text-primary); }

  /* Matrix table */
  .matrix { display: grid; gap: 0; font-size: 12px; }
  .matrix .mh { font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-tertiary); font-weight: 700; padding: 8px 12px; }
  .matrix .mcell {
    padding: 14px 12px; border-top: 1px dashed var(--border-default);
  }
  .matrix .mcell:first-of-type { border-top: 0; }

  /* UserName card */
  .un-name { font-family: var(--ff-sans); font-weight: 500; font-size: 16px;
    line-height: 24px; color: var(--text-primary); }
  .un-name.b { font-weight: 700; font-size: 14px; line-height: 20px; }
  .un-meta { font-size: 12px; color: var(--text-secondary); line-height: 16px; }
  .un-kana { font-size: 12px; color: var(--text-tertiary); line-height: 16px; }
  .un-muted { color: var(--text-disabled) !important; }

  /* ============================================================
     Banner / InlineMessage
     画面上部 / セクション頭 / インラインで「永続的な状態」を示す帯。
     Toast は消えるが Banner は状況が続く限り居続ける。
     ============================================================ */
  .banner {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    background: var(--bg-default);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.55;
    position: relative;
  }
  /* 説明の無い 1 行バナー（`Banner` が desc 無しのとき自動で付ける）。上揃えのままだと、
     20px の文字に対して 32px のボタンが並ぶので中心が 6px ずれる（実際にずれた）。
     タイトルの下マージンは説明との間隔なので、説明が無いときは残さない。 */
  .banner.is-oneline { align-items: center; }
  .banner.is-oneline .bn-ico { margin-top: 0; }
  .banner.is-oneline .bn-title { margin-bottom: 0; }
  .banner .bn-ico {
    flex: 0 0 20px;
    width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-top: 1px;
    color: var(--text-tertiary);
  }
  .banner .bn-ico .ic { width: 20px; height: 20px; stroke-width: 2; }
  .banner .bn-ico svg { width: 20px; height: 20px; }
  .banner .bn-body {
    flex: 1 1 auto; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
  }
  .banner .bn-title {
    display: block;
    font-size: 13px; font-weight: 700; color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 2px;
  }
  .banner .bn-desc {
    display: block;
    font-size: 13px; color: var(--text-secondary); line-height: 1.55;
  }
  .banner .bn-desc a {
    color: var(--brand-navy);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .banner .bn-actions {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 8px;
    margin-left: 12px;
  }
  .banner .bn-close {
    flex: 0 0 28px;
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: 6px;
    color: var(--text-tertiary); cursor: pointer;
    margin: -4px -4px 0 4px;
    transition: background .12s ease-out, color .12s ease-out;
  }
  .banner .bn-close:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }
  .banner .bn-close .ic { width: 16px; height: 16px; stroke-width: 2; }
  .banner .bn-close svg { width: 14px; height: 14px; }
  .banner .bn-link {
    color: var(--brand-navy);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    background: transparent;
    border: 0; padding: 0;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
  }
  .banner .bn-link:hover { text-decoration: none; }

  /* Type modifiers */
  .banner.is-info    { background: var(--brand-navy-50); border-color: var(--banner-info-border); }
  .banner.is-info    .bn-ico { color: var(--brand-navy); }
  .banner.is-info    .bn-title { color: var(--brand-navy); }

  .banner.is-success { background: var(--teal-50); border-color: var(--banner-success-border); }
  .banner.is-success .bn-ico { color: var(--teal-600); }
  .banner.is-success .bn-title { color: var(--teal-800); }

  .banner.is-warning { background: var(--banner-warning-bg); border-color: var(--banner-warning-border); }
  .banner.is-warning .bn-ico { color: var(--text-warning); }
  .banner.is-warning .bn-title { color: var(--amber-800); }

  .banner.is-danger  { background: var(--red-50); border-color: var(--banner-danger-border); }
  .banner.is-danger  .bn-ico { color: var(--red-500); }
  .banner.is-danger  .bn-title { color: var(--red-800); }

  .banner.is-magenta { background: var(--magenta-50); border-color: var(--banner-magenta-border); }
  .banner.is-magenta .bn-ico { color: var(--magenta-500); }
  .banner.is-magenta .bn-title { color: var(--magenta-700); }

  /* Shape modifiers */
  .banner.is-page {
    border-radius: 0;
    border-left: 0; border-right: 0; border-top: 0;
    padding: 12px 24px;
  }
  .banner.is-inline {
    padding: 10px 12px;
    gap: 10px;
    font-size: 12px;
    border-radius: 6px;
  }
  .banner.is-inline .bn-ico { width: 16px; height: 16px; flex-basis: 16px; margin-top: 0; }
  .banner.is-inline .bn-ico .ic { width: 16px; height: 16px; }
  .banner.is-inline .bn-ico svg { width: 16px; height: 16px; }
  .banner.is-inline .bn-title { font-size: 12px; font-weight: 600; }
  .banner.is-inline .bn-desc  { font-size: 12px; }

  /* ============================================================
     EmptyState
     データ無し / 検索結果無し / エラー / 権限なし / Inbox Zero 等。
     64px のアイコン（単色 navy）を軸に、見出し + 説明 + 任意の CTA。
     ============================================================ */
  .empty-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 56px 24px;
    color: var(--text-primary);
  }
  .empty-state[hidden] { display: none; }
  .empty-state .es-ico {
    width: 72px; height: 72px;
    border-radius: 9999px;
    display: grid; place-items: center;
    background: var(--brand-navy-50);
    color: var(--brand-navy);
    margin-bottom: 20px;
  }
  .empty-state .es-ico .ic { width: 36px; height: 36px; stroke-width: 1.5; }
  .empty-state .es-ico svg { width: 32px; height: 32px; }

  /* Tone */
  /* brand は素の `.es-ico`（navy-50 の円 + navy のアイコン）のまま。既定の muted が
     グレーに落とすので、ブランド色で見せたい空状態は明示的にこれを指定する。 */
  .empty-state.is-brand   .es-ico { background: var(--brand-navy-50); color: var(--brand-navy); }
  .empty-state.is-muted   .es-ico { background: var(--bg-subtle);  color: var(--text-tertiary); }
  .empty-state.is-success .es-ico { background: var(--teal-50);    color: var(--teal-600); }
  .empty-state.is-warning .es-ico { background: var(--banner-warning-bg);   color: var(--text-warning); }
  .empty-state.is-danger  .es-ico { background: var(--red-50);     color: var(--red-500); }

  .empty-state .es-title {
    font-family: var(--ff-display);
    font-size: 18px; font-weight: 700;
    letter-spacing: -0.005em;
    color: var(--text-primary);
    margin: 0 0 6px;
    line-height: 1.4;
    max-width: 360px;
  }
  .empty-state .es-desc {
    font-size: 13px; line-height: 1.65;
    color: var(--text-secondary);
    margin: 0 0 20px;
    max-width: 360px;
  }
  .empty-state .es-actions {
    display: inline-flex; gap: 8px; align-items: center; justify-content: center;
    flex-wrap: wrap;
  }

  /* Compact — カード内やインラインで使う小さめのエンプティ */
  .empty-state.is-compact { padding: 32px 16px; }
  .empty-state.is-compact .es-ico { width: 48px; height: 48px; margin-bottom: 14px; }
  .empty-state.is-compact .es-ico .ic { width: 24px; height: 24px; stroke-width: 1.75; }
  .empty-state.is-compact .es-ico svg { width: 22px; height: 22px; }
  .empty-state.is-compact .es-title { font-size: 15px; }
  .empty-state.is-compact .es-desc { font-size: 12px; margin-bottom: 14px; }

  /* 枠付き：空状態でもセクションのコンテンツ領域が分かるよう囲う（.sr-list と同じ枠） */
  .empty-state.is-framed {
    border: 1px solid var(--border-strong);
    border-radius: var(--r-8);
    background: var(--bg-default);
  }



  /* ---------- Speech Bubble (chat message) ---------- */
  /* 280px は**読む文章**の幅（和文で 1 行 20 字前後）。ファイルカードを抱えるときだけ
     広げる——カードは文章ではなく、**中身のほとんどがファイル名**なので、読む幅で切ると
     拡張子の手前で名前が省略されて「何のファイルか」が消える（実際に消えていた）。 */
  .bubble-msg:has(.msg-file) { max-width: 420px; }
  .bubble-msg {
    position: relative;
    display: inline-block;
    max-width: 280px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gray-50); /* Gray 100 — 相手メッセージ基準 */
    border-radius: 16px;
    word-wrap: break-word;
  }
  /* Tail uses PNG silhouette via mask, so the tail color always matches bubble background. */
  .bubble-msg.is-tail-tr::after,
  .bubble-msg.is-tail-tl::after {
    content: "";
    position: absolute;
    top: -2px;
    width: 21px;
    height: 17px;
    background-color: inherit;
    -webkit-mask-image: url("assets/bubble-tail-self.png");
            mask-image: url("assets/bubble-tail-self.png");
    -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
  }
  .bubble-msg.is-tail-tr::after {
    right: -12px;
    background-color: var(--gray-50);
  }
  .bubble-msg.is-tail-tl::after {
    left: -12px;
    background-color: var(--gray-50);
    transform: scaleX(-1);
  }
  /* Color variants */
  .bubble-msg.is-self  { background: var(--brand-navy-50); }

  /* Small variant — 上下 padding を詰めた一言メッセージ用。
     ステータスメッセージ（UserListItem の「ラーメン食べたい」など）や、
     狭い行に収める短い発言用。本文サイズも 1pt 小さくしている。 */
  .bubble-msg.is-sm {
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 14px;
  }
  /* tail anchor を小さい bubble に合わせて調整 */
  .bubble-msg.is-sm.is-tail-tr::after,
  .bubble-msg.is-sm.is-tail-tl::after {
    top: -1px;
    width: 17px;
    height: 14px;
  }
  .bubble-msg.is-sm.is-tail-tr::after { right: -10px; }
  .bubble-msg.is-sm.is-tail-tl::after { left: -10px; }

  /* Whisper variant — リスト内でステータス／近況メッセージ用の控えめな吹き出し。
     メインのチャット吹き出しと重みがぶつからないよう、背景を少し濃いめの Gray に、
     文字色を secondary に落として "心の声" のトーンにする。
     尻尾（::after）は mask image なので border を付けず、背景色だけで境界を表現する。
     font-size は 12px まで落としてリスト行を圧迫しないようにする。
     .is-sm と組み合わせて使う想定。 */
  .bubble-msg.is-whisper {
    background: var(--gray-50);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    padding: 4px 10px;
    border-radius: 12px;
  }
  .bubble-msg.is-whisper.is-tail-tr::after,
  .bubble-msg.is-whisper.is-tail-tl::after {
    background-color: var(--gray-50);
    top: 0;
    width: 15px;
    height: 12px;
  }
  .bubble-msg.is-whisper.is-tail-tr::after { right: -9px; }
  .bubble-msg.is-whisper.is-tail-tl::after { left: -9px; }
  .bubble-msg.is-self.is-tail-tr::after,
  .bubble-msg.is-self.is-tail-tl::after { background-color: var(--brand-navy-50); }

  .bubble-msg.is-magenta { background: var(--fill-magenta); color: var(--text-on-fill); }
  .bubble-msg.is-magenta.is-tail-tr::after,
  .bubble-msg.is-magenta.is-tail-tl::after { background-color: var(--fill-magenta); }

  /* Bubble + meta wrapper (read status + timestamp aligned to bubble bottom) */
  .bubble-row {
    display: inline-flex;
    align-items: flex-end;
    gap: 6px;
    max-width: 100%;
  }
  .bubble-meta {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    line-height: 1.35;
    /* 11px は白地でも tertiary だと 4.83:1 とぎりぎり。トークの背景を色や写真に変えられる以上、
       淡い面の上でも読める必要があるので secondary + 500 にする（太字だけでは
       コントラスト比は 1 も上がらない）。 */
    color: var(--text-secondary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-bottom: 2px;
  }
  /* Self (right-aligned chat): meta sits on the LEFT of bubble, right-aligned */
  .bubble-row.is-self {
    flex-direction: row;
    justify-content: flex-end;
  }
  .bubble-row.is-self .bubble-meta {
    align-items: flex-end;
    text-align: right;
  }
  /* When meta is placed on the LEFT of a self bubble (time・既読 left of navy bubble),
     align its text left so it doesn't feel visually detached. */
  .bubble-row.is-self .bubble-meta.is-left {
    align-items: flex-start;
    text-align: left;
  }
  /* Other (left-aligned chat): meta sits on the RIGHT of bubble, left-aligned */
  .bubble-row.is-other {
    flex-direction: row;
    justify-content: flex-start;
  }
  .bubble-row.is-other .bubble-meta {
    align-items: flex-start;
    text-align: left;
  }

  /* Read status with underline + count */
  .bubble-meta .read {
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  /* Clickable 既読 — opens the read-receipt list. Keeps the plain-text look; only
     the cursor and hover colour say it is pressable, so the meta strip stays quiet. */
  .bubble-meta button.read {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
  }
  .bubble-meta button.read:hover { color: var(--text-brand); }
  .bubble-meta button.read:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

  /* Bubble group: avatar + name + bubble-row (for "other" conversation units).
     Grid layout: avatar spans both rows, so name row can vertically-center against avatar. */
  .bubble-group {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 18px;
    row-gap: 16px;
    align-items: start;
  }
  .bubble-group .avatar {
    grid-row: 1 / span 2;
    align-self: start;
  }
  .bubble-group .bg-name {
    grid-column: 2;
    /* heading/sm — 16 / 24 · 700 */
    font-weight: 700;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    padding-left: 0;
    /* Optical alignment: nudge 2px left so the name's visual left edge
       lines up with the avatar circle's leftmost curve (not its bounding box).
       Revisit if the name font changes. */
    margin: 0 0 0 -2px;
    /* Visually shift the name down so its vertical middle aligns with the avatar's center,
       without affecting the bubble-row's position below (row 2 stays anchored).
       Fine-tuned so that the visual gap between name and bubble is 4px. */
    position: relative;
    top: 10px;
  }
  .bubble-group .bubble-row {
    grid-column: 2;
  }
  /* Reactions belong to the message above them, so they line up with the bubbles
     rather than starting under the avatar. */
  .bubble-group .rxn {
    grid-column: 2;
  }
  /* Compact group — 32px sender avatar. This is the default in talk threads: the
     message is the content, the avatar only identifies the sender, so it stays at
     list-row scale instead of the 48px portrait. */
  .bubble-group.is-compact { column-gap: 8px; }
  /* The 16px/700 name was scaled for the 48px portrait and overpowers a 32px
     avatar, so it steps down with it. `top` re-centres against the smaller avatar:
     it spans both rows from the top, so its centre is at 16px while the name's
     20px line box centres at 10px. */
  .bubble-group.is-compact .bg-name {
    font-size: 14px;
    line-height: 20px;
    top: 6px;
  }

  /* =====================================================
     Talk — thread dividers / reactions / quoted reply / thread header
     -----------------------------------------------------
     Source of truth: design-system Figma, page「　　Talk」.
     These sit alongside .bubble-* (message body) and .sig (image grid);
     together they make a talk thread buildable from DS parts only.
     ===================================================== */

  /* ---------- TalkDayDivider ----------
     Centered pill marking a date break in the thread ("Today" / 2025年3月14日（金）).
     Two tones because the pill lives on two very different surfaces:
     - default   … subtle light pill. For a white thread background (web /talks).
     - is-overlay… Figma's translucent dark pill + white text. Only for threads
                   that use a wallpaper image behind the messages, where a light
                   pill would disappear. Do NOT use it on white: the 30% fill
                   resolves to ~#B8BDC6 and white 10px text fails contrast. */
  .talk-day {
    display: flex; align-items: center; justify-content: center;
    margin: 16px 0 12px;
  }
  .talk-day > .talk-day-pill {
    display: inline-flex; align-items: center;
    height: 20px; padding: 0 9px;
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--text-tertiary);
    font-family: var(--ff-sans);
    font-size: 11px; line-height: 1; font-weight: 600;
    letter-spacing: -0.25px;
    white-space: nowrap;
  }
  .talk-day.is-overlay > .talk-day-pill {
    background: rgba(48, 62, 87, .3);
    color: var(--text-on-fill);
    font-size: 10px;
    font-weight: 400;
  }

  /* ---------- UnreadDivider ----------
     "ここから未読メッセージ" marker: everything below is unread.
     Figma fills #828282 at 70% opacity, which works over a wallpaper but drops
     white 12px text to ~2.2:1 on a white thread. Solidified to --text-tertiary
     (4.8:1) so the label stays readable on both surfaces. */
  .talk-unread {
    display: flex; align-items: center; justify-content: center;
    margin: 16px 0 12px;
  }
  .talk-unread > .talk-unread-pill {
    display: inline-flex; align-items: center; justify-content: center;
    width: 280px; max-width: 100%;
    padding: 4px 12px;
    border-radius: 36px;
    background: var(--fill-neutral);
    color: var(--text-on-fill);
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 20px;
    text-align: center;
  }

  /* ---------- ReactionList / ReactionChip ----------
     Emoji + count pills under a message. States mirror the Figma
     `reactionType` variants (isSelected = false / true / isDisabled):
     - default     … nobody-or-others reacted; I have not
     - .is-on      … I reacted (navy-tinted fill + brand border)
     - .is-disabled… reactions locked (read-only thread); still shows counts
     Height is pinned to 24px so the row keeps its rhythm when the border
     appears on .is-on (box-sizing: border-box). */
  .rxn {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  }

  /* ReactionPicker（`.rxn-pick`）。決まった数の気持ちから 1 つ返す縦型カード。
     `.rxn-chip`（絵文字 + 件数の集計チップ）とは役割が違う — あちらは「誰が何人押したか」を
     見せる表示、こちらは**まだ返していない人に返させる**ための操作。件数は出さない。

     縦型（絵文字の上下にラベル）にしているのは、絵文字がそのまま選択肢の中身だから。
     `.feel-chip`（横型ピル）を使い回すと絵文字が 15px まで小さくなり、顔の違いが読めない。 */
  /* 促しの見出し。送信者のアバター + 「〇〇さんからレターが届いています」+ 一言。
     カードの上部にも同じ顔と名前があるが、ここは**返す**ための呼びかけなので繰り返す
     （誰に返すのかを、選択肢のすぐ隣で確かめられる）。 */
  .rxn-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .rxn-head > .avatar { flex: none; }
  .rxn-head-main { display: flex; flex-direction: column; min-width: 0; }
  .rxn-title {
    margin: 0;
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 700;
    color: var(--amber-700);
  }
  .rxn-lead {
    margin: 0;
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 18px;
    color: var(--amber-700);   /* 白の上で amber-600 は 3.37。本文サイズは 4.5:1 が要る */
  }
  .rxn-picker { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
  .rxn-pick {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    /* 正方形。絵文字が主役なので縦横を揃えて「札」に見せる。 */
    width: 88px; height: 88px;
    padding: 4px;
    /* 未選択は枠なし。透明の 1px を残すのは、選択で枠が付いたときに中身が動かないため。 */
    border: 1px solid transparent;
    border-radius: var(--r-10);
    background: var(--bg-default);
    /* 枠が無いので、amber の面から白い札を浮かせるのは影が担う。 */
    box-shadow: var(--shadow-1);
    font: inherit;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease;
  }
  .rxn-pick > .rp-emoji { font-size: 26px; line-height: 1; }
  .rxn-pick > .rp-label {
    font-family: var(--ff-sans);
    font-size: 11px; line-height: 14px; font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
  }
  /* hover は magenta の枠 + 文字。返したら帯ごと消える運用なので「選択済み」の見た目と
     取り違える余地がなく、hover にブランド色を使える。 */
  .rxn-pick:hover {
    border-color: var(--magenta-500);
    box-shadow: var(--shadow-4);
  }
  .rxn-pick:hover > .rp-label { color: var(--magenta-500); }
  /* 選択済みの見た目。返した瞬間に帯を閉じる画面（レターフィード）では出ないが、
     選択を残したまま見せる使い方のために持たせている。 */
  .rxn-pick.is-on {
    border-color: var(--magenta-500);
    box-shadow: 0 0 0 1px var(--magenta-500);
  }
  .rxn-pick.is-on > .rp-label { color: var(--magenta-500); }
  .rxn-pick:disabled { opacity: .5; cursor: not-allowed; }
  .rxn-pick:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 1px; }
  .rxn-chip {
    display: inline-flex; align-items: center; gap: 4px;
    height: 24px; padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 20px;
    background: var(--bg-subtle);
    color: var(--text-brand);
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px; font-weight: 500;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease;
  }
  /* Emoji box is fixed so chips line up whether the glyph is a native emoji
     or an <img> (Apple/Twemoji sprite). */
  .rxn-chip > .rxn-emoji {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; flex: none;
    font-size: 14px; line-height: 1;
  }
  .rxn-chip > .rxn-emoji > img { width: 16px; height: 16px; object-fit: contain; }
  .rxn-chip > .rxn-num { font-variant-numeric: tabular-nums; }
  .rxn-chip:hover { background: var(--brand-navy-50); }
  .rxn-chip:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }
  /* Figma outlines the selected chip in a mid blue (#3D81C6); the DS has no
     mid-blue token, so the brand navy border is used for "selected" here as
     everywhere else in the system.
     オンは「無かった輪郭が現れる」ことで示す（素の状態は border: 1px solid transparent）。
     色は `--border-selected`：`--brand-navy` はダークの navy-100 の上で 2.67 と
     3:1 を割る（known-issues DS-19）。 */
  .rxn-chip.is-on {
    background: var(--brand-navy-100);
    border-color: var(--border-selected);
  }
  .rxn-chip.is-on:hover { background: var(--brand-navy-50); }
  .rxn-chip:disabled,
  .rxn-chip.is-disabled {
    background: var(--brand-navy-50);
    border-color: var(--gray-50);
    font-weight: 400;
    cursor: default;
  }
  .rxn-chip:disabled:hover,
  .rxn-chip.is-disabled:hover { background: var(--brand-navy-50); }
  /* Trailing "see everyone" button. Opt-in: the chip's own click toggles your
     reaction, so browsing the full list needs its own target. */
  .rxn-all {
    display: inline-flex; align-items: center; justify-content: center;
    height: 24px; width: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 20px;
    background: var(--bg-subtle);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
  }
  .rxn-all .ic { width: 14px; height: 14px; }
  .rxn-all:hover { background: var(--brand-navy-50); color: var(--text-brand); }
  .rxn-all:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }

  /* 絵文字を足す。押された結果（`.rxn-chip`）と並ぶが役割が逆なので、塗らずに破線の枠にする
     — 件数のあるチップと同じ面に見えると「0 件のリアクション」と読み違える。 */
  .rxn-add {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px;
    padding: 0;
    border: 1px dashed var(--border-strong);
    border-radius: 999px;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
  }
  .rxn-add .ic { width: 14px; height: 14px; }
  .rxn-add:hover { background: var(--brand-navy-50); border-color: var(--brand-navy); color: var(--text-brand); }
  .rxn-add:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }

  /* Reaction tooltip — a big emoji preview over the names.
     The preview exists because a 16px glyph in the chip is too small to identify,
     which is the whole reason the tooltip was added. */
  .rxn-tip {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
  }
  .rxn-tip > .rxn-tip-emoji {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    font-size: 34px; line-height: 1;
  }
  .rxn-tip > .rxn-tip-emoji > img { width: 40px; height: 40px; object-fit: contain; }
  /* Emoji centred, sentence left-aligned: centred Japanese over 3 ragged lines is
     harder to read than a flush-left block (Slack does the same). */
  .rxn-tip > .rxn-tip-text { align-self: stretch; text-align: left; }

  /* ---------- QuoteReply ----------
     Quoted message preview: avatar + author, then whatever the quoted message
     actually was — one truncated text line (message / URL / file name) or an image
     thumbnail. Never placed on its own; two wrappers use it and set the metrics,
     so callers never set sizes:
     - .qr-block … in the thread, above the reply bubble (12px, quiet)
     - .qr-target … the composer's reply-target row (14px, thumbnail on the right) */
  .quote-reply {
    display: flex; align-items: center; gap: 4px;
    min-width: 0;
  }
  .quote-reply > .avatar { flex: none; }
  .quote-reply > .qr-body {
    display: flex; flex-direction: column;
    flex: 1; min-width: 0;
  }
  .quote-reply .qr-name {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px; font-weight: 500;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .quote-reply .qr-text {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* The quoted message was an image: show it instead of a text line. */
  .quote-reply .qr-thumb {
    display: block;
    width: 40px; height: 40px;
    margin-top: 4px;
    border-radius: 8px;
    object-fit: cover;
  }
  /* A thumbnail makes the block two rows tall, so the avatar aligns with the
     author name instead of floating at the block's vertical middle. */
  .quote-reply:has(> .qr-body > .qr-thumb) { align-items: flex-start; }

  /* Reply-target row above the composer: the quote plus a dismiss button.
     Neutral face, no accent bar — the DS already spends --brand-navy-50 (#EEF0FB)
     on "my bubble" and "unread row", so a blue face here would read as one of
     those, and the row's own position (seated on the composer, with a ✕) already
     says "you are replying to this". */
  .qr-target {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 4px 8px 12px;
    /* Sits flush on top of the composer, so only the top corners round off. */
    border-radius: var(--r-8) var(--r-8) 0 0;
    background: var(--bg-subtle);
    overflow: hidden;
  }
  .qr-target > .quote-reply { flex: 1; min-width: 0; gap: 12px; }
  .qr-target .qr-body { gap: 4px; }
  /* Larger than the in-bubble quote: this row is a live control the sender is
     acting on, not a footnote inside someone else's message. */
  .qr-target .qr-name {
    font-size: 14px; line-height: 20px; font-weight: 600;
    letter-spacing: 0.24px;
  }
  .qr-target .qr-text {
    font-size: 14px; line-height: 20px;
    color: var(--text-tertiary);
    letter-spacing: 0.24px;
  }
  /* One line high, so the thumbnail sits beside the name instead of under it. */
  .qr-target > .qr-thumb {
    display: block; flex: none;
    width: 32px; height: 32px;
    border-radius: 5px;
    object-fit: cover;
  }

  /* Quoted message shown in the thread, ABOVE its own reply bubble.
     Deliberately quiet: the reply is the new information and the quote is only
     context, so the panel, the bar and the type all sit below the bubble in
     contrast. It also takes the same side and the same max-width as the bubble it
     belongs to, 4px above it, so the pair reads as one unit rather than as two
     unrelated messages. */
  .qr-block {
    position: relative;
    display: flex; align-items: center;
    width: fit-content; max-width: 280px;
    margin-bottom: 4px;
    padding: 8px 12px;
    border: 0;
    border-radius: 12px;
    background: var(--bg-subtle);
    font: inherit;
    text-align: left;
  }
  /* Flush with the panel and neutral gray — an accent colour here would pull the
     eye off the reply, which is what the quote is supporting. */
  .qr-block::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    border-radius: 12px 0 0 12px;
    background: var(--border-strong);
  }
  /* Own reply: mirror to the right so the quote hangs off the same edge as the
     bubble instead of looking like an incoming message. */
  .qr-block.is-self { margin-left: auto; }
  .qr-block.is-self::before {
    left: auto; right: 0;
    border-radius: 0 12px 12px 0;
  }
  .qr-block > .quote-reply { flex: 1; min-width: 0; }
  /* Lower contrast than the bubble below it: out here the quote competes with the
     reply directly, and the reply is the new information. */
  .qr-block .qr-name { color: var(--text-secondary); font-weight: 600; }
  .qr-block .qr-text { color: var(--text-tertiary); }
  /* Tapping the quote jumps to the original, so it only looks pressable when a
     jump handler is wired up. */
  button.qr-block { cursor: pointer; }
  button.qr-block:hover { background: var(--int-hover); }
  button.qr-block:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
  /* Order is: quote, THEN the avatar + message unit. So the quote goes *before*
     .bubble-group as a sibling, never inside it (inside, the group's name row would
     come first and the quote would read as part of the sender's own message).
     It is indented to the message column — 32px avatar + 8px gap — so it lines up
     with the bubbles rather than under the avatar. */
  .qr-block:has(+ .bubble-group) { margin-left: 40px; }

  /* メンバー一覧の器。読む幅は 1060px（`PC/recog-design-system.md` の 2 カラムの合計）。
     カードを 4 列並べる面なので、レターの 720px では狭すぎる。 */
  .mem-page {
    width: min(1060px, 100%);
    margin: 0 auto;
    /* 上は**帯の下に付かない**だけ空ける（2026-09-23、指摘「検索ボックスがヘッダーにくっついてる」）。
       20px だと道具の行がヘッダーの罫に触って、帯の一部に見えていた。 */
    padding: 28px 24px 60px;
    min-width: 0;
  }
  .mem-resbar {
    display: flex; align-items: center; gap: 12px;
    margin-top: 12px;
  }
  /* 件数の札は DS の `Tag`（`.tag.is-subtle`）を使う。**この画面だけの札は持たない**
     ——同じ意味のものがレターフィードにもあり、形が割れるため（2026-09-25）。 */
  .mem-resbar > .mem-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  /* リスト表示。行の枠は器が持つ（`UserListItem` は枠を持たない前提の行）。 */
  .mem-list {
    margin-top: 16px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-12);
    background: var(--bg-default);
    overflow: hidden;
  }
  /*
    **行のあいだに線を引く**（2026-09-23、指摘）。カードは余白で切れているが、行を隙間なく
    積む一覧では、どこまでが 1 人か分からない。最後の行には引かない（器の縁と二重になる）。
  */
  .mem-list > .uli-row { border-bottom: 1px solid var(--border-subtle); }
  .mem-list > .uli-row:last-child { border-bottom: 0; }
  /*
    行。**所属 → 名前**の順に読ませる 3 行組（2026-09-24、依頼）。
      第一 › 第二 › 第三
      第四 ｜ 役職
      名前 なまえ
    `UserListItem` は名前が先の組みなので使わず、DS のクラスで組む。
  */
  .mem-row {
    display: grid;
    /* 顔 ｜ 所属と名前 ｜ 入社日 ｜ 操作。入社日は**幅を固定**して縦に揃える
       （行ごとに位置が動くと、並び替えた結果を上から追えない）。 */
    grid-template-columns: 56px minmax(0, 1fr) 104px auto;
    /* **顔と名前のあいだだけ広げる**（2026-09-24、指摘「近すぎる」）。アバターを 56px に
       上げたぶん、12px では顔に文字が貼り付いて見えていた。右の 2 列は 12px のまま
       （入社日と操作を離すと、行の右側が散る）。 */
    column-gap: 12px; align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .mem-list > .mem-row:last-child { border-bottom: 0; }
  /* 行ごと hover で塗らない（2026-09-24、指摘）。**行そのものは押せない**——押せるのは
     名前・顔・右のボタンで、そこはそれぞれが hover を持っている。行を塗ると
     「どこでも押せる」と読めてしまう。 */
  .mem-row__av { display: inline-flex; border-radius: 50%; }
  .mem-row__av:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
  .mem-row__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-left: 8px; }
  /* 各行は 1 行で省略する（深い組織パス・長い役職名で折り返させない）。 */
  .mem-row__who > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 名前とよみがなは**同じ行**。よみがなは名前の添え字なので、行を分けない。 */
  .mem-row__name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .mem-row__name > .un-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .mem-row__name > .un-kana { flex: none; }
  /* 名前がリンクのとき。静止時から下線を出す（表の `a.dt-user` と同じ扱い）。 */
  .mem-row a.un-name.is-link { color: var(--text-brand); text-decoration: underline; }
  .mem-row a.un-name.is-link:hover { text-decoration-thickness: 2px; }
  .mem-row__joined {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-tertiary);
    white-space: nowrap;
  }
  /* 操作は**常に出す**（hover で出し入れしない。2026-09-24、依頼）。 */
  .mem-row__acts { display: flex; align-items: center; gap: 2px; flex: none; }
  /* 「フォロー」と「フォロー中」で文字数が違う。**幅を固定**しないと、右の 3 つが
     行ごとに横へずれて縦に揃わない。 */
  /* 幅は「フォローする」が**左右に余白を持って**収まる値（2026-09-24、指摘）。
     文言が変わっても右の 3 つがずれないよう、固定のままにする。 */
  .mem-row__acts > .mem-row__follow { flex: none; width: 124px; justify-content: center; }

  /* ============================================================
     Team — チーム一覧（会社組織 / プロジェクト）
     **メンバー一覧（`.mem-*`）と同じ形の行**。列が同じなら行も同じでいい——
     器の幅・件数のピル・行の罫は `.mem-page` / `.mem-count` / `.mem-list` に揃えてある。
     メンバーの一覧はここに作らず、`/members?org=<id>` に渡す。
     **接頭辞は `team-`。** `tm-` は `OrgMultiPicker` の行（6600 行あたりの TeamList）が
     既に使っていて、`.tm-row` の 4 列グリッドがこちらに当たって列が崩れた。
     ============================================================ */
  .team-page {
    width: min(1060px, 100%);
    margin: 0 auto;
    padding: 28px 24px 60px;
    min-width: 0;
  }
  /* タブの器。**不透明な面**に乗せる（`PC/CLAUDE.md`「季節背景の上に文字を置かない」）——
     `.tabs.pill` の地は灰色なので、そのまま置くと選ばれていない側が写真に透ける。 */
  /* **真ん中に置く**（2026-09-24、指摘）。左端だと検索欄と縦に並んで、道具の列の
     一部に見えていた。中身の切り替えは道具ではないので、列から外す。 */
  .team-switch { display: flex; justify-content: center; margin-bottom: 12px; }
  .team-resbar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
  .team-resbar > .team-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

  .team-list {
    margin-top: 16px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-12);
    background: var(--bg-default);
    overflow: hidden;
  }
  .team-row {
    display: grid;
    /* 絵柄 ｜ パスと名前 ｜ 人数 ｜ 操作。人数は**幅を固定**して縦に揃える
       （行ごとに位置が動くと、人数で並び替えた結果を上から追えない）。 */
    grid-template-columns: 40px minmax(0, 1fr) 112px auto;
    column-gap: 12px; align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
  }
  /*
    会社組織は**階層のまま**出す（2026-09-24、指摘）。キャレットの桁を 1 つ足し、
    字下げは `--depth`（DS の `OrgTree` と同じ作法。RECOG の組織は最大 4 階層）。
    **人数と操作の桁は動かさない**——字下げは左だけに効かせる。
  */
  .team-row.is-tree {
    grid-template-columns: 28px 40px minmax(0, 1fr) 112px auto;
    padding-left: calc(16px + 20px * var(--depth, 0));
  }
  /* 末端の組織はキャレットを持たない。桁だけ空けて、名前の頭を親子で揃える。 */
  .team-row__caret { display: inline-flex; justify-content: center; }
  .team-row__caret > .iconbtn { transition: transform .15s ease; }
  .team-row__caret > .iconbtn[aria-expanded="true"] { transform: rotate(90deg); }
  .team-list > .team-row:last-child { border-bottom: 0; }
  /* 行ごと hover で塗らない（メンバー一覧と同じ判断）。**行そのものは押せない**——
     押せるのは右の 2 つだけ。 */
  .team-row__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  /* 深い組織パス・長いチーム名で折り返させない。 */
  .team-row__who > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .team-row__name { font-family: var(--ff-sans); font-size: 14px; color: var(--text-primary); }
  .team-row__n { display: flex; flex-direction: column; gap: 2px; text-align: right; }
  .team-row__total { font-family: var(--ff-sans); font-size: 13px; color: var(--text-primary); white-space: nowrap; }
  /* 直属は**配下と違うときだけ**出す添え字。総数より弱く見せる。 */
  .team-row__direct { font-family: var(--ff-sans); font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
  .team-row__acts { display: flex; align-items: center; gap: 4px; flex: none; }
  /* 「メンバーを見る」は行ごとに文字数が変わらないが、右の 1 つが縦に揃うよう幅を固定する。 */
  .team-row__acts > .team-row__see { flex: none; width: 140px; justify-content: center; }
  /* モーダルの見出し。チーム名 → 人数 →（サンプルのとき）札 の順に読ませる。 */
  .team-modal-title { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; }
  .team-modal-n { font-size: 12px; font-weight: 400; color: var(--text-tertiary); }
  .team-empty { padding: 24px 16px; font-family: var(--ff-sans); font-size: 13px; color: var(--text-tertiary); text-align: center; }

  /* ============================================================
     NotifyItem / NotifyList — ヘッダーのベルから開く通知
     `PC/sample/…18.44.44.png`。**文で読ませる**ので列に分けない（`ActivityItem` との違いは
     部品の doc コメント）。
     ============================================================ */
  .nf-pop {
    display: flex; flex-direction: column;
    width: 420px; max-width: calc(100vw - 32px);
    max-height: min(560px, calc(100vh - 96px));
    border: 1px solid var(--border-default);
    border-radius: var(--r-12);
    background: var(--bg-default);
    box-shadow: var(--shadow-16);
    overflow: hidden;
  }
  /* 上の行＝絞り込みと一括操作。**一覧と同じ器に入れて 1 枚に見せる**（別の板にしない）。 */
  .nf-head {
    flex: none;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .nf-head > .nf-head-sp { margin-left: auto; }
  .nf-list { flex: 1; min-height: 0; overflow-y: auto; }

  .nf-item {
    position: relative;
    display: grid; grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 12px; align-items: start;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-default);
    text-align: left;
    cursor: pointer;
  }
  .nf-item:hover { background: var(--bg-subtle); }
  /* 未読はトーク一覧の行と同じ表現（navy の面 ＋ 左のバー）にそろえる。 */
  .nf-item.is-unread {
    background: var(--bg-unread);
    box-shadow: inset 3px 0 0 0 var(--brand-navy);
  }
  .nf-item.is-unread:hover { background: var(--brand-navy-100); }
  .nf-item > .nf-av { flex: none; }
  .nf-item > .nf-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .nf-item .nf-text {
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 19px;
    color: var(--text-primary);
    /* 2 行まで。誰が何をしたかは 2 行あれば収まり、3 行だと 1 件がカードに見え始める。 */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .nf-item .nf-actor { font-weight: 700; color: var(--text-brand); }
  /* 抜粋は 1 行。**何の件か**が分かれば足りるので、本文を読ませる場所ではない。 */
  .nf-item .nf-excerpt {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 18px;
    color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .nf-empty {
    margin: 0; padding: 32px 16px;
    font-family: var(--ff-sans); font-size: 13px;
    color: var(--text-tertiary); text-align: center;
  }
  .nf-item .nf-time {
    font-family: var(--ff-sans);
    font-size: 11px; line-height: 16px;
    color: var(--text-tertiary);
  }

  /* ---------- Activity オーバーレイ ----------
     Activity はカラムを持たない。Feed の上に重なり、開いてもレイアウトは変わらない
     （PC/recog-design-system.md 3-1）。**見に行って閉じるもの**で、開いたまま Feed を
     読み続ける使い方は想定しない。だから Feed に重なることを許容している。

     幅 400px は「種別アイコン ＋ アバター ＋ 実行者 → 対象 ＋ 相対時刻」を1行に収める
     のに要る幅（3-2）。狭めても Feed への重なりは消せない——1280px 固定・コンテンツ
     1060px では、真に空いているのは右ガター 220px だけで、重なりゼロに必要な 252px 以下は
     名前2つを1行に収める下限 360px を下回るため。幅は行の情報が収まるかだけで決める。 */
  .act-ov__scrim {
    position: fixed;
    inset: 0;
    z-index: 1000;
    /* .sidepanel-overlay と同値。右から出るパネルなので同じ層の部品と見た目を揃える。
       中途半端に透けて見える状態が一番悪いので、意図的に前面化していると分かる濃さにする。 */
    background: rgba(0, 25, 81, 0.32);
    border: 0;
    padding: 0;
    cursor: default;
  }
  .act-ov {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 1001;
    width: 400px;
    display: flex;
    flex-direction: column;
    /* 不透明。半透明にすると季節背景が透けてコントラストが変動する（SideNav と同じ理由）。 */
    background: var(--bg-default);
    border-left: 1px solid var(--border-default);
    box-shadow: var(--shadow-16);
  }
  /*
    **柱から横へ出す形**（2026-09-21、依頼。Slack のアクティビティと同じ）。
    右から出す既定のオーバーレイと違い、**ホバーで開いてホバーで閉じる**ので
    画面全体を覆わない：柱の右隣に浮く 1 枚の板にして、下の画面は見えたままにする。
    ヘッダーは覆わない（`--gs-bar-h` ぶん下げる）——覆うとロゴと題まで消えて、
    マウスを乗せただけで画面が別物に見える。
  */
  .act-ov.is-flyout {
    /*
      **左から右へ、ふわりと**（2026-09-21、依頼）。出る向きを柱と揃えると「柱から引き出した」
      と読める。120ms から **280ms** へ（「早い／フワっと」の指摘）——速い動きは
      「切り替わった」に見え、ゆっくりした動きは「浮かび上がった」に見える。

      効き目は長さより**緩め方**のほう。`cubic-bezier(.16, 1, .3, 1)` は序盤で大きく動いて
      終盤でほぼ止まるので、**着地が見えない**＝止まった瞬間が分からない。これが「フワ」の
      正体で、`ease-out` のまま延ばすと、ただ遅いだけになる。
      少しだけ縮めて始める（.98）のも同じ狙い——寄ってくる感じが出る。
    */
    animation: act-ov-in 280ms cubic-bezier(.16, 1, .3, 1);
    top: calc(var(--gs-bar-h, 64px) + 8px);
    right: auto;
    /*
      **中身の高さに合わせる**（2026-09-25）。下端まで伸ばすと、2 件しか無い板
      （下書き・送信予約）が 8 割方あいた白い柱になる。溢れるぶんは板の中で送る。
    */
    bottom: auto;
    max-height: calc(100vh - var(--gs-bar-h, 64px) - 16px);
    /* 既定は柱の右。**柱の右にもう 1 本レールがある画面**（トーク・スレッド）は、
       そのぶんずらした値を `--act-fly-left` で渡す。 */
    left: var(--act-fly-left, calc(var(--gs-rail-w, 80px) + 8px));
    border-left: 0;
    border: 1px solid var(--border-default);
    border-radius: var(--r-12);
    overflow: hidden;
  }

  .act-ov__head {
    flex: none;
    display: flex; align-items: center; gap: 8px;
    padding: 12px 12px 12px 16px;
    border-bottom: 1px solid var(--border-default);
  }
  .act-ov__title {
    font-size: 14px; font-weight: 700; color: var(--text-primary);
    margin: 0; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 「未読のみ」は**見出しの右端**（2026-09-24、依頼）。✕ があるときはその左に入る。 */
  .act-ov__unread {
    margin-left: auto; flex: none;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--ff-sans);
    font-size: 12px; color: var(--text-secondary);
    white-space: nowrap; cursor: pointer;
  }
  .act-ov__close { margin-left: auto; flex: none; }
  .act-ov__unread + .act-ov__close { margin-left: 0; }
  .act-ov__body { flex: 1; min-height: 0; overflow: auto; }

  /* ---------- ActivityItem ----------
     アクティビティの1行。**種別アイコン ＋ 実行者 → 対象 ＋ 相対時刻**を1行に収める
     （PC/recog-design-system.md 3-4）。以前は「◯◯さんが△△さんへレターを贈りました。」
     という全行に同じ文を並べて1件3行使っていたが、伝えている情報は名前2つだけだった。
     共通の文言は種別アイコンが担当し、空いたぶんを名前と時刻に回す。 */
  .act-item {
    position: relative;
    display: grid;
    /* 種別アイコン ｜ アバター ｜ 本文（実行者→対象＋時刻／任意で抜粋） */
    grid-template-columns: 24px 24px minmax(0, 1fr);
    align-items: start;
    column-gap: 8px;
    width: 100%;
    padding: 10px 16px;
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-default);
    text-align: left;
    cursor: pointer;
  }
  .act-item:hover { background: var(--bg-subtle); }
  /* 未読はトーク一覧の行と同じ表現（navy 面 + 左のバー）に揃える。 */
  .act-item.is-unread {
    background: var(--bg-unread);
    box-shadow: inset 3px 0 0 0 var(--brand-navy);
  }
  .act-item.is-unread:hover { background: var(--brand-navy-100); }
  /* 選択中。右ペインがどの行の会話を出しているかを示すので、塗りではなく枠で表す
     （未読の塗りと重なっても両方読めるようにするため）。 */
  .act-item.is-selected {
    box-shadow: inset 0 0 0 2px var(--brand-navy);
    background: var(--bg-default);
  }
  .act-item.is-selected.is-unread { background: var(--bg-unread); }
  /* アクティビティから飛んだ先のメッセージ。どれを見に来たのかを見失わないよう囲む。 */
  .bubble-row.is-target .bubble-msg {
    box-shadow: 0 0 0 2px var(--brand-navy);
  }
  /* 種別（メンション / 返信 / リアクション / レター）。行頭の独立した列に置く。
     以前はアバターの右下に 18px のバッジとして重ねていたが、種別は「何が起きたか」であって
     人に属する情報ではないので、行の先頭で読めるほうがよい。 */
  .act-item > .ai-kind {
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    flex: none;
  }
  .act-item > .ai-kind .ic,
  .act-item > .ai-kind svg { width: 20px; height: 20px; }
  /* アバターは 24px。40px は「誰か」を見せるためのサイズで、ここは「何が起きたか」を
     追う画面。人の識別は名前が担うので 24px で足りる。 */
  .act-item > .ai-av { flex: none; }
  .act-item > .ai-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .act-item .ai-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
  .act-item .ai-name {
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 20px; font-weight: 700;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 実行者 → 対象 の矢印。文字（「が」「へ」）ではなくアイコンで置く。 */
  .act-item .ai-arrow {
    flex: none; width: 12px; height: 12px;
    color: var(--text-tertiary);
    align-self: center;
  }
  .act-item .ai-time {
    margin-left: auto; flex: none;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-tertiary);
  }
  /* どこで起きたか。幅のある横断ビュー（/activity・下書き）でだけ出す。
     400px のオーバーレイでは渡さない（PC/recog-design-system.md 3-4）。 */
  .act-item .ai-where {
    display: flex; align-items: center; gap: 4px;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-tertiary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .act-item .ai-where .ai-place {
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 600;
  }
  .act-item .ai-text {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 18px;
    color: var(--text-secondary);
    /* 抜粋は1行。1件は1〜2行に収める（PC/recog-design-system.md 3-4）。 */
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 自分宛のメンションは本文中でも拾えるようにする。 */
  .act-item .ai-at {
    padding: 0 2px;
    border-radius: 3px;
    background: var(--brand-navy-50);
    color: var(--text-brand);
    font-weight: 600;
  }
  /*
    ゆったり組む（`.is-lg`。2026-09-21、指摘「数が多すぎます。もうちょっと一つ一つ大きく」）。
    既定は `/activity` のように**一度に何件も見せる一覧**向けで、密度を優先している。
    柱から出すパネルのように 400px の中で読ませる面では、同じ密度だと行が細かすぎて
    どこまでが 1 件か読み取れない。列の幅・余白・字の大きさを一段上げる。
  */
  @keyframes act-ov-in {
    from { opacity: 0; transform: translateX(-10px) scale(.98); }
    to   { opacity: 1; transform: none; }
  }
  /* 動きを減らす設定の人には出さない（前庭障害の誘発を避ける。WCAG 2.3.3）。 */
  @media (prefers-reduced-motion: reduce) {
    .act-ov.is-flyout { animation: none; }
  }

  .act-item.is-lg {
    grid-template-columns: 24px 32px minmax(0, 1fr);
    column-gap: 10px;
    padding: 14px 16px;
  }
  .act-item.is-lg .ai-name { font-size: 14px; line-height: 22px; }
  .act-item.is-lg .ai-time { font-size: 12px; line-height: 22px; }
  .act-item.is-lg > .ai-main { gap: 4px; }
  .act-item.is-lg .ai-text {
    font-size: 13px; line-height: 20px;
    /* 2 行まで。1 行だと抜粋がほとんど「…」で終わり、開く前の手がかりにならない。 */
    white-space: normal;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }

  /* hover アクションは汎用の `.tl-actions`（HoverActionMenu）を流用し、行の右端に浮かせる。
     トーク一覧の行と同じ配置・同じ見た目にする（横断ビューでも操作の位置を覚え直させない）。 */
  .act-item > .tl-actions {
    position: absolute;
    top: 50%; right: 16px;
    transform: translateY(-50%);
    z-index: 2;
  }
  .act-item:hover > .tl-actions.hover-reveal,
  .act-item:focus-within > .tl-actions.hover-reveal {
    opacity: 1;
    pointer-events: auto;
  }

  /* ---------- TalkFolders ----------
     トーク一覧の上に並ぶフォルダータブ（フィルタ型）。選んだフォルダーの中身だけに絞る。
     グルーピング（見出しで区切って全部出す）にしない理由は、フォルダーを第1ソートキーに
     固定してしまい「全体を受信時間順」「新着が一番上に来る」が作れなくなるため。 */
  .talk-folders {
    display: flex; align-items: center;
    border-bottom: 1px solid var(--border-default);
  }
  /* タブは増えると横に溢れるので横スクロール。バーは出さない（狭い列で邪魔なため）。
     **伸ばさない**（`flex: 0 1 auto`）——伸ばすと後ろに置いた並べ替えのボタンが右端まで
     飛んで、表示形式の切り替えと並んでしまう。あふれたら縮んでスクロールする。 */
  .talk-folders > .tabs {
    flex: 0 1 auto; min-width: 0;
    border-bottom: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .talk-folders > .tabs::-webkit-scrollbar { display: none; }
  .talk-folders .tab { padding: 10px 10px; font-size: 13px; }
  /* 並べ替え・削除は**タブのすぐ後ろ**（動かす対象の隣）。`.iconbtn` の `flat`
     （丸で囲わない）で、タブの並びと同じ軽さにする。
     表示形式の切り替えは**検索の行**へ移した（2026-09-02）——「一覧の見え方」を決める
     道具は検索・並び替えと同じ行にまとめ、この帯は「どのフォルダーか」に絞る。 */
  .talk-folders > .tf-editbtn { flex: none; margin: 0 4px; }
  /* 新しいフォルダーを作る ＋。チップの列の最後に置くが、**枠は実線**にする——
     点線は「並べ替え・削除の対象」なので、同じ形にすると ＋ も掴めそうに見える。
     丸で囲わないのは、右端の設定アイコン（`.iconbtn` ＝ 丸）と別のものだから。
     `AddButton`（破線）を使わないのもここ——押すとモーダルが開くので、規約どおり
     「その場で行が増える」見た目にはしない。 */
  .tf-add {
    flex: none;
    display: inline-grid; place-items: center;
    width: 28px; height: 28px;
    padding: 0;
    border: 1px solid var(--border-default);
    border-radius: var(--r-8);
    background: var(--bg-default);
    color: var(--text-secondary);
    cursor: pointer;
  }
  .tf-add:hover { background: var(--int-hover); color: var(--text-primary); border-color: var(--border-control); }
  .tf-add:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
  .tf-add .ic { width: 14px; height: 14px; }

  /* 設定モード。タブ行をチップ行に差し替える（LINE PC と同じ）。 */
  /* フォルダーの並び替え。上段＝チップの列（ドラッグで並び替え・✕ で削除・＋ で追加）、
     下段＝操作の説明。LINE と同じ 2 段構成にしている。 */
  .tf-edit {
    display: flex; flex-direction: column;
    background: var(--bg-default);
    border-bottom: 1px solid var(--border-default);
  }
  .tf-edit > .tf-edit-row {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 8px 8px 12px;
  }
  /* チップの列に余白を全部持たせて、編集を終える ✕ を右端へ押しやる。 */
  .tf-edit > .tf-edit-row > .tf-chips { flex: 1; min-width: 0; }
  /* 説明は自分の帯に置く。薄く塗って、上のチップ列と役割が違うことを面で示す。 */
  .tf-edit > .tf-edit-hint {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px 4px 12px;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-subtle);
  }
  .tf-edit > .tf-edit-hint > .tf-hint { flex: 1; min-width: 0; }
  .tf-chips { position: relative; display: flex; flex-wrap: wrap; gap: 6px; }
  /* 落ちる場所を示す縦棒（LINE と同じ）。**チップの隙間に立てる**ので、並びを動かさない
     ——隙間を広げて場所を作る方式だと、指を動かすたびにチップ全体が跳ねる。
     幅は隙間（6px）に収まる 3px。位置と高さは JS が実測して渡す（折り返す行があるため）。 */
  .tf-caret {
    position: absolute;
    width: 3px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--brand-navy);
    pointer-events: none;
  }
  /* **点線の角丸の四角。** 点線は「この列は並べ替え・削除の対象」の合図で、通常時の
     タブ（枠を持たない文字の並び）と別のモードに入ったことが形で分かる。
     ピルにしないのは、並べ替える対象が四角い並びだから。 */
  .tf-chip {
    /* 縮ませない・折らない。flex 項目なので、既定では中身より狭くなれる——実際、
       長い名前のチップが**1 文字ずつの縦書き**に潰れた（2026-09-23）。 */
    flex: none; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 2px;
    height: 28px; padding: 0 4px 0 10px;
    border: 1px dashed var(--border-control);
    border-radius: var(--r-8);
    background: var(--bg-default);
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px; font-weight: 600;
    color: var(--text-primary);
  }
  /* 既定フォルダー（1対1 / グループ）は消せないので ✕ を持たず、掴めもしない。 */
  .tf-chip.is-fixed { color: var(--text-tertiary); padding-right: 10px; }
  .tf-chip.is-movable { cursor: grab; }
  /* 点線が既定になったので、掴んでいる印は**透明度**（色ではない手がかり）と枠の色で示す。 */
  .tf-chip.is-dragging { opacity: .4; border-color: var(--brand-navy); }
  .tf-chip > .tfc-del {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
    padding: 0; border: 0;
    border-radius: 999px;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
  }
  .tf-chip > .tfc-del:hover { background: var(--int-hover); color: var(--text-primary); }
  .tf-chip > .tfc-del .ic { width: 12px; height: 12px; }
  .tf-hint {
    font-family: var(--ff-sans);
    font-size: 11px; line-height: 16px;
    color: var(--text-tertiary);
  }

  /* セクション表示（グルーピング）の見出し。押すと折りたためる。
     スクロールしても見出しが残るよう sticky。 */
  .tf-section {
    display: flex; align-items: center; gap: 6px;
    width: 100%;
    padding: 8px 16px;
    /* 行と同じ白地だと境目として認識されない。--bg-subtle(#F3F4F6) でも白との差が
       小さすぎたので、同じ濃さで**青寄り**の --bg-section で塗る（色温度の理由は
       トークンの定義側に書いた）。上下の罫線と合わせて帯にする。 */
    background: var(--bg-section);
    border: 0;
    border-top: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 20px; font-weight: 700;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    /* **潜ってくるものより必ず上に置く。** sticky の見出しは「下をくぐらせる蓋」なので、
       器の中で使われている z-index より大きくないと意味がない——行の hover で出る `⋯`
       （`.tl-row .tl-actions` は 2）が見出しの上に飛び出し、未読バッジまで覗いていた。
       行の中で z-index を足すときは、この値を超えないこと。 */
    position: sticky; top: 0; z-index: 3;
  }
  /* hover は帯を一段濃くする。`--gray-200` は中立グレーなので、帯と同じ青寄りの家系で
     一段濃い `--brand-navy-100` を使う——温度が変わると hover で素材が変わって見える。 */
  .tf-section:hover { background: var(--brand-navy-100); }
  /* 帯の右端に操作を置くとき。帯自体が畳むボタンなので**入れ子にせず横に並べる**
     （`button` の中に `button` は HTML として不正で hydration も落ちる）。 */
  .tf-section-row {
    position: sticky; top: 0; z-index: 3;
    display: flex; align-items: stretch;
    background: var(--bg-section);
  }
  .tf-section-row > .tf-section { position: static; flex: 1; min-width: 0; }
  .tf-section-tail {
    flex: none; display: flex; align-items: center; padding-right: 8px;
    border-top: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
  }
  /* 空のフォルダー。帯だけ残ると「作ったのに使えない」に見えるので、入れ方を書く。 */
  .tf-empty {
    margin: 0; padding: 12px 16px;
    font-family: var(--ff-sans); font-size: 12px; line-height: 18px;
    color: var(--text-tertiary);
  }
  /* フォルダー作成の選択行。 */
  .tf-pick {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; min-width: 0;
    font-family: var(--ff-sans); font-size: 13px; color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
  }
  .tf-pick:last-child { border-bottom: 0; }
  .tf-pick:hover { background: var(--int-hover); }
  .tf-pick > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tf-pick-note { margin-left: auto; flex: none; font-size: 11px; color: var(--text-tertiary); }
  .tf-section:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
  .tf-section > .tfs-chev {
    width: 16px; height: 16px; flex: none;
    color: var(--text-tertiary);
    transition: transform .12s ease;
  }
  .tf-section[aria-expanded="false"] > .tfs-chev { transform: rotate(-90deg); }
  .tf-section > .tfs-count {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
  }
  /* 折りたたんでも未読を見失わないよう、見出しに未読件数を出す。 */
  /* 大きさと色は `.badge.sm` が持つ。**ここは右端へ寄せるぶんだけ**（2026-09-02 に統合）。 */
  .tf-section > .badge { margin-left: auto; }
  /* セクション表示中はタブを出さないので、帯には現在のモードだけ置く。 */
  .talk-folders > .tf-mode-label {
    flex: none; min-width: 0;
    padding: 10px 16px;
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 20px; font-weight: 600;
    color: var(--text-secondary);
  }

  /* ---------- Note ----------
     トーク内のノート（掲示板）。トークの吹き出しと違い、流れずに残る「投稿」なので
     カード形式にして、投稿者・日時・操作・本文・リアクション・コメントを1枚に収める。 */
  .note-list {
    display: flex; flex-direction: column; gap: 16px;
  }
  .note-card {
    border: 1px solid var(--border-strong);
    border-radius: var(--r-8);
    background: var(--bg-default);
  }
  .note-card > .nc-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 12px 12px 16px;
  }
  .note-card .nc-who {
    display: flex; flex-direction: column;
    flex: 1; min-width: 0;
  }
  .note-card .nc-name {
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 600;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .note-card .nc-time {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-tertiary);
  }
  .note-card > .nc-body {
    display: flex; flex-direction: column; gap: 12px;
    padding: 0 16px 16px;
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 22px;
    color: var(--text-primary);
    /* 投稿本文は改行をそのまま活かす。 */
    white-space: pre-wrap;
    word-break: break-word;
  }
  .note-card > .nc-foot {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--border-subtle);
  }

  /* コメント。投稿の続きなので、カードの中に一段沈めて置く。 */
  .note-card > .nc-comments {
    display: flex; flex-direction: column; gap: 12px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    border-radius: 0 0 var(--r-8) var(--r-8);
  }

  /* ---------- PostCard ----------
     スレッドの投稿 1 件（Figma design-system 1105:65897 / 1105:66672）。
     ノート（`.note-card`）と同じ「流れずに残る投稿」だが、こちらはフィードで読ませる主役なので
     一回り大きい：アバター 48 / 本文 18px / 角丸 16 / 影あり。投稿者の右に**投稿先の部屋**、
     その下に**閲覧数**を出す（フィードは複数のスレッドが混ざるので、どこの投稿かが要る）。
     リアクションは本文の続きとして枠線なしで並べ、コメント数・共有数と主要アクションだけを
     区切り線の下のバーに置く（読む → 反応する → 動く、の順）。 */
  .post-card {
    display: flex; flex-direction: column; gap: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-16);
    background: var(--bg-default);
    box-shadow: 0 16px 40px rgba(0, 25, 81, .08);
    min-width: 0;
  }
  /* 固定された投稿。新着より上に居座る理由を枠の色で示す（amber = 注意ではなく「留めてある」）。 */
  .post-card.is-pinned { border-color: var(--amber-500); }

  .post-card > .pc-head {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px 0;
    min-width: 0;
  }
  .post-card .pc-head > .avatar { flex: none; }
  .post-card .pc-who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  /* 氏名 › 部屋名。部屋名が長いときは氏名より先に部屋名を詰める（誰が、が先に読めるように）。 */
  .post-card .pc-line { display: flex; align-items: center; gap: 2px; min-width: 0; }
  .post-card .pc-name {
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 600;
    color: var(--text-primary);
    flex: none;
    max-width: 60%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .post-card .pc-chev { flex: none; width: 14px; height: 14px; color: var(--text-tertiary); margin: 0 4px; }
  .post-card .pc-room {
    display: inline-flex; align-items: center; gap: 5px;
    min-width: 0;
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 500;
    color: var(--text-secondary);
  }
  .post-card .pc-room > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .post-card .pc-room .ic { width: 16px; height: 16px; flex: none; }
  .post-card .pc-sub {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-tertiary);
  }
  .post-card .pc-views { display: inline-flex; align-items: center; gap: 4px; }
  .post-card .pc-views .ic { width: 16px; height: 16px; flex: none; }
  .post-card .pc-menu { flex: none; margin-left: auto; align-self: flex-start; }
  /* 固定の印。枠の amber と対で、**色が何を意味するか**を言葉で言う。氏名の行の右端、⋯ の手前。 */
  /* タグは 24px、⋯ は 32px。両方 flex-start だと上端が揃って**文字の中心が 4px ずれる**
     ので、タグ側を半分ぶん下げて中心を合わせる。 */
  .post-card .pc-pinned { flex: none; margin-left: auto; align-self: flex-start; margin-top: 4px; }
  .post-card .pc-pinned ~ .pc-menu { margin-left: 4px; }

  /*
    見出し（任意・`FeedPost.title`）。**サイズは本文と同じで、太さだけ 600**
    （2026-09-29、指摘）。大きくすると 1 枚が縦に伸び、フィードに入る投稿が減る。
    間隔は `.pc-body` の `gap: 12px` がそのまま持つので、ここでは余白を足さない。
  */
  .post-card .pc-title {
    margin: 0;
    font-size: inherit; line-height: inherit; font-weight: 600;
    color: var(--text-primary);
  }
  .post-card > .pc-body {
    display: flex; flex-direction: column; gap: 12px;
    padding: 0 16px;
    font-family: var(--ff-sans);
    font-size: 18px; line-height: 28px;
    color: var(--text-primary);
    /* 投稿本文は改行をそのまま活かす。 */
    white-space: pre-wrap;
    word-break: break-word;
  }
  .post-card > .pc-rxn { padding: 0 16px; }
  .post-card > .pc-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
  }
  .post-card .pc-counters { display: flex; align-items: center; gap: 4px; }
  .post-card > .pc-comments {
    display: flex; flex-direction: column; gap: 12px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    border-radius: 0 0 var(--r-16) var(--r-16);
    margin-top: -12px;
  }

  /* ---------- HashtagList ----------
     フィードの上に並ぶハッシュタグの絞り込み（Figma design-system 625:13765）。
     数が増えると 2〜3 行に折り返す。

     **色は Figma のリンク系**（`Semantic/Text/Link` ＝ #3A6EE8 / hover #1A4FD8、
     選択中は `Primary/bgActive` ＝ #0A3A9E）。DS に同じ意味のトークンが無いので、
     **この部品の中だけの変数**として持つ（画面側に生 hex を散らさないため）。
     実測：#3A6EE8 on 白 4.59／#1A4FD8 on 白 6.66／白 on #0A3A9E 9.94。 */
  .htag-list { display: flex; flex-wrap: wrap; gap: 12px; min-width: 0; }
  /* 1 行に畳んだ版（`HashtagListFit`）。折り返さないので、入る数は JS が測って決める。 */
  .htag-list.is-fit { flex-wrap: nowrap; overflow: hidden; }
  /* 「タグ一覧 +N」。タグそのものではないので**縁取りだけ**にして、選べるチップと
     見分ける（塗りも `#` も持たない）。 */
  .htag--more { flex: none; border-style: dashed; }
  .htag {
    --htag-ink: #3A6EE8;
    --htag-ink-hover: #1A4FD8;
    --htag-on-fill: #0A3A9E;

    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 32px; padding: 0 12px;
    border: 1px solid transparent;
    /* **錠剤**（Figma の `full`）。角丸 10px だとタグではなくボタンに見える。 */
    border-radius: 999px;
    background: var(--bg-default);
    color: var(--htag-ink);
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 12px; font-weight: 500;
    white-space: nowrap; cursor: pointer;
    /* Figma `Shadow/LG`。白いチップが写真の地から浮く。 */
    box-shadow: 0 4px 24px rgba(0, 25, 81, .10);
    transition: background-color .12s ease, color .12s ease, border-color .12s ease;
  }
  /* hover は**塗らずに枠**（Figma の 2 番目の状態）。塗ると選択中と見分けが付かない。 */
  .htag:hover { border-color: var(--htag-ink); color: var(--htag-ink-hover); }
  .htag:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
  .htag.is-on {
    background: var(--htag-on-fill);
    border-color: var(--htag-on-fill);
    color: var(--text-on-fill);
  }
  .htag.is-on:hover { background: var(--htag-ink-hover); border-color: var(--htag-ink-hover); }

  /* ---------- ランキングの自動投稿（表彰台）----------
     `PC/sample/スクリーンショット 2026-09-25 15.30.07.png`。RECOG 自身が出す投稿なので、
     本文の下に**地を敷いた面**で置く（人が書いた文章と地続きに見せない）。

     金・銀・銅は**飾り**で、順位は王冠の中の数字が示す（色だけで意味を伝えない）。
     名前と順位の数字は読む文字なので、同じ色相の**濃いほう**を使う。
     実測（白の上）：#8A6A14 5.06／#5D6673 5.81／#8A5323 6.28。 */
  .rkp {
    display: grid; grid-template-columns: repeat(3, 1fr); align-items: end;
    gap: 8px; margin: 4px 0 0; padding: 20px 8px 18px;
    list-style: none;
    border-radius: var(--r-12);
    background: var(--bg-subtle);
  }
  .rkp__item { display: grid; justify-items: center; gap: 2px; min-width: 0; }
  /*
    金・銀・銅。**面は淡く、枠と文字がメダル色**（受賞回数の札 `MedalCards` と同じ family）。
    べた塗りにして白文字を乗せると金と銅で 4.5:1 を割る——実測：#C47C10 on #FEF3C7 は 3.02、
    いま使っている濃い側なら #8A6A14 on #FEF3C7 = 4.54 / #5D6673 on #F3F4F6 = 5.28 /
    #8A5323 on #FFE8D1 = 5.30 で通る。
  */
  .rkp__item.is-r1 {
    --rk-leaf: #E0B44A; --rk-ink: #8A6A14;
    --rk-fill: var(--amber-50); --rk-edge: var(--amber-500); --rk-pillar: 156px;
  }
  .rkp__item.is-r2 {
    --rk-leaf: #B9C0CA; --rk-ink: #5D6673;
    --rk-fill: var(--bg-subtle); --rk-edge: var(--border-strong); --rk-pillar: 106px;
  }
  .rkp__item.is-r3 {
    --rk-leaf: #D9A165; --rk-ink: #8A5323;
    --rk-fill: var(--bronze-50); --rk-edge: var(--bronze-500); --rk-pillar: 86px;
  }

  /* 月桂冠・アバター・王冠を重ねる器。大きさは `--rk-medal`（順位で変える）。 */
  .rkp__medal {
    position: relative; display: grid; place-items: center;
    width: var(--rk-medal); height: var(--rk-medal);
  }
  .rkp__wreath { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--rk-leaf); }
  .rkp__av { position: relative; }
  /* 王冠は冠の**口（上の開き）**に置く。葉より少し上に出して、枝と重ならないようにする。 */
  .rkp__no {
    position: absolute; top: calc(var(--rk-medal) * -.02); left: 50%; transform: translateX(-50%);
    color: var(--rk-ink);
  }
  .rkp__no > .rkp__crown { display: block; width: 30px; height: 30px; }

  /* 2 つ並べる面（チームプロフィール）は一段詰める。**行の作りは同じ**にして、
     大きさだけ変える——別の組みにすると、同じ順位表が画面ごとに違う顔になる。 */
  .rkp.is-sm { gap: 6px; padding: 12px 8px 10px; }
  .rkp.is-sm .rkp__name { margin: 10px 0 -12px; padding: 2px 8px; font-size: 12px; }
  .rkp.is-sm .rkp__pillar { padding: 16px 6px 12px; }
  .rkp.is-sm .rkp__val { font-size: 18px; }
  .rkp.is-sm .rkp__val small { font-size: 11px; }
  .rkp.is-sm .rkp__no > .rkp__crown { width: 24px; height: 24px; }
  .rkp.is-sm .rkp__item.is-r1 { --rk-pillar: 112px; }
  .rkp.is-sm .rkp__item.is-r2 { --rk-pillar: 78px; }
  .rkp.is-sm .rkp__item.is-r3 { --rk-pillar: 64px; }

  /* 名前は**台の上端に重ねる**（白い札なので淡い面の上でも読める）。 */
  .rkp__name {
    position: relative; z-index: 1;
    margin: 12px 0 -13px; max-width: 100%;
    padding: 3px 10px; border: 1px solid var(--rk-edge); border-radius: 999px;
    background: var(--bg-default);
    font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--rk-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .rkp__name small { margin-left: 2px; font-size: 11px; font-weight: 400; color: var(--text-tertiary); }

  /*
    台。**高さは順位で決め打ち**（値に比例させない。棒グラフとして読まれる）。
    1 位 ＞ 2 位 ＞ 3 位 の**3 段**にする（2026-09-28、指摘）——2 位と 3 位が同じ高さだと
    表彰台に見えず、順位が王冠の数字だけに戻る。**1 位の段差は大きく取る**（156 / 106 / 86。
    差は 50 と 20）——1 位だけは遠目でも分かるようにする、が表彰台を使う理由なので。
  */
  .rkp__pillar {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: var(--rk-pillar);
    padding: 20px 8px 14px;
    border: 1px solid var(--rk-edge); border-radius: var(--r-12);
    background: var(--rk-fill);
  }
  .rkp__val {
    font-size: 24px; font-weight: 700; line-height: 1.2;
    color: var(--rk-ink); font-variant-numeric: tabular-nums;
  }
  .rkp__val small { margin-left: 3px; font-size: 12px; font-weight: 500; }

  /* スレッドのファイルタブの器。**読む列（720px）で切らない**——4 列を見比べる面なので、
     幅を絞ると全部の列が省略だらけになる。 */
  .thr-files {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column; gap: 12px;
    padding: 14px 24px 20px;
    background: var(--bg-default);
  }
  .thr-files-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; }

  /* ============================================================
     FileList / FileGrid — スレッドに溜まったファイル
     `PC/sample/recog_files_tab_v1.html`。一覧（リスト）とタイル（グリッド）の 2 通り。

     **列の幅はここ 1 か所で決める**（`--fl-cols`）。見出しと行が同じ grid を読むので、
     列を足しても片方だけずれない。
     ============================================================ */
  .fl-list {
    /*
      列の幅。**名前がいちばん長く、いちばん見分けに効く**ので、固定幅は詰められるだけ詰める。
      操作は `IconButton.sm` が 3 つで 32×3 ＋ 隙間 ＝ 100px（92px だと隣へはみ出す）。
      トークのペインのように狭いところに置くと、ここが効いて名前の省略が早く始まる。
    */
    --fl-cols: 40px minmax(0, 1fr) 140px 84px 104px 100px;
    display: flex; flex-direction: column;
    flex: 1; min-height: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-12);
    background: var(--bg-default);
    overflow: hidden;
  }
  .fl-head {
    display: grid; grid-template-columns: var(--fl-cols); align-items: center; gap: 12px;
    flex: none; height: 34px; padding: 0 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    font-size: 11px; font-weight: 700; color: var(--text-secondary);
  }
  .fl-scroll { flex: 1; min-height: 0; overflow-y: auto; }

  /* 月のまとまりの見出し。スクロールしても残る（どの月を見ているか分からなくなるため）。 */
  .fl-group {
    position: sticky; top: 0; z-index: 1;
    background: var(--bg-default);
    padding: 8px 16px 6px;
  }

  .fl-row {
    display: grid; grid-template-columns: var(--fl-cols); align-items: center; gap: 12px;
    height: 54px; padding: 0 16px;
    border-top: 1px solid var(--border-subtle);
  }
  .fl-row:hover { background: var(--int-hover); }
  /* 拡張子を書いた四角。`MsgFile` の `.mf-icon` と同じ作り・同じ色の家系。 */
  .fl-type {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: none;
    border-radius: var(--r-10);
    background: var(--fill-neutral);
    font-family: var(--ff-display);
    font-size: 10px; font-weight: 700; letter-spacing: .04em;
    color: var(--text-on-fill);
  }
  .fl-type.is-pdf   { background: var(--fill-file-pdf); }
  .fl-type.is-sheet { background: var(--fill-file-sheet); }
  .fl-type.is-doc   { background: var(--fill-file-doc); }
  .fl-type.is-img   { background: var(--fill-file-img); }
  .fl-type.is-mov   { background: var(--fill-file-mov); }
  .fl-type.is-link  { background: var(--fill-file-link); }
  .fl-type--lg { width: 56px; height: 56px; font-size: 12px; }

  .fl-name {
    min-width: 0; font-size: 13px; font-weight: 700; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .fl-name-t {
    display: block; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 名前の下に畳む「どこで・いつ」。列を持てない狭い一覧で使う（`FileList narrow`）。 */
  .fl-sub {
    display: block; margin-top: 2px;
    font-size: 12px; font-weight: 400; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .fl-poster { display: flex; align-items: center; gap: 7px; min-width: 0; }
  .fl-poster-n {
    min-width: 0; font-size: 12px; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .fl-date { font-size: 12px; color: var(--text-secondary); }
  .fl-size {
    font-size: 12px; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 操作は hover でだけ出す。常時 3 つ並ぶと、名前より先にボタンが目に入る。 */
  .fl-acts { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
  .fl-row > .fl-acts.hover-reveal { opacity: 0; transition: opacity .12s ease; }
  .fl-row:hover > .fl-acts.hover-reveal,
  .fl-row:focus-within > .fl-acts.hover-reveal { opacity: 1; }

  /*
    **狭いところ用**（レールから出す板は 400px）。列を 2 つに絞り、行は 2 段になるので
    高さを内容に任せる。器の枠は外す——板そのものが枠を持っているので、二重になる。
  */
  .fl-list.is-narrow {
    --fl-cols: 40px minmax(0, 1fr);
    border: 0; border-radius: 0; background: transparent;
  }
  .fl-list.is-narrow .fl-row { height: auto; min-height: 56px; padding: 8px 16px; }
  .fl-list.is-narrow .fl-poster,
  .fl-list.is-narrow .fl-date,
  .fl-list.is-narrow .fl-size,
  .fl-list.is-narrow .fl-acts { display: none; }

  /* ---------- タイル ---------- */
  .fl-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px;
    padding: 0 16px 16px;
  }
  .fl-tile {
    display: flex; flex-direction: column; min-width: 0;
    border: 1px solid var(--border-default);
    border-radius: var(--r-10);
    background: var(--bg-default);
    overflow: hidden;
  }
  .fl-tile:hover { border-color: var(--border-strong); box-shadow: 0 2px 10px rgba(0, 25, 81, .08); }
  .fl-thumb {
    position: relative; display: flex; align-items: center; justify-content: center;
    height: 116px; background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
  }
  .fl-thumb > img { width: 100%; height: 100%; object-fit: cover; }
  .fl-dur {
    position: absolute; right: 8px; bottom: 8px;
    padding: 2px 6px; border-radius: var(--r-6);
    background: rgb(0 25 81 / 78%);
    color: var(--text-on-fill); font-size: 10px; font-weight: 700;
  }
  .fl-ov {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    background: rgb(0 25 81 / 55%);
  }
  .fl-tile > .fl-thumb > .fl-ov.hover-reveal { opacity: 0; transition: opacity .12s ease; }
  .fl-tile:hover > .fl-thumb > .fl-ov.hover-reveal,
  .fl-tile:focus-within > .fl-thumb > .fl-ov.hover-reveal { opacity: 1; }
  .fl-tile-meta { display: flex; flex-direction: column; gap: 6px; padding: 9px 11px 11px; min-width: 0; }
  .fl-tile-n {
    font-size: 12px; font-weight: 700; color: var(--text-primary); line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 32px;
  }
  .fl-tile-sub { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; color: var(--text-secondary); }
  .fl-tile-date { margin-left: auto; flex: none; }

  /* ---------- CommentList / CommentItem ----------
     レター・スレッド投稿・ノートに付くコメントの一覧。3 つの画面で同じ見た目にするため
     1 つの部品にまとめている（画面ごとに別のコメント行を作らない）。

     構成は Figma「Threads UI Screens」の media thread（2:701）に合わせている：
       [アバター列]  [本文列                              時刻 ⋯]
        アバター      名前
        ↕8           本文
        │縦ライン     添付（画像 / ファイル / URL）
        ↕8           アクション行（IconTextCounter）
        返信者アバター 「N件の返信・N件のリアクション」

     縦ラインは「この投稿には返信が続いている」ことを本文を読む前に示すためのもの。
     Figma の 18px / アバター 47px は 1.3 倍のスケールなので、DS の 13px / 40px に落としている。

     コメントの中身はメッセージの吹き出しと同じ 4 種（本文 / 画像 / ファイル / URL）を取るので、
     添付は `SentGallery` / `MsgFile` / `LinkPreview` をそのまま中に入れる。
     入力欄も専用のものを作らず `MessageComposer` を使う（画像・ファイルを付けられるため）。 */
  .cmt-list {
    display: flex; flex-direction: column;
    min-width: 0;
  }
  .cmt-item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 12px;
    padding: 16px 0;
    /* 区切りは gap ではなく境界線。返信が縦ラインで繋がるので、どこまでが 1 件かを
       線で閉じないと親子の境目が読めない。 */
    border-bottom: 1px solid var(--border-subtle);
    min-width: 0;
  }
  .cmt-list > .cmt-item:last-child { border-bottom: 0; }
  /* アバター列。アバター → 8px → 縦ライン（伸縮） → 8px → 返信者アバター。 */
  .cmt-item > .cmt-av {
    grid-row: 1 / -1;
    display: flex; flex-direction: column; align-items: center;
    min-height: 0;
  }
  /*
    アバターの縦位置は**大きさで作法が変わる**（2026-09-21、指摘）。

      - 40px（コメント本体）… 名前の行と**頭を揃える**。下に本文が続く塊の錨なので上に置く
      - 32px（返信）… 名前の行の**中心に合わせる**。返信の名前は line-height 16px しか
        無いので、頭で揃えるとアバターの中心が字より 8px 下にきて、名前が肩に乗って見える

    ずらす量は「名前の行 − アバター」の半分。行の高さ（32px）ではなく**字の行**に合わせる
    ——行が 32px あるのは ⋯（`IconButton`）の当たり判定のぶんで、目には見えない。

    前提として ⋯ は baseline の列から外してある（`.cmt-tail` の `align-self`）。外す前は
    名前の字が行の中で 9px 下へ押されていて、この計算自体が成り立たなかった。
  */
  .cmt-item.is-reply > .cmt-av > .avatar:first-child { margin-top: calc((16px - 32px) / 2); }
  .cmt-item .cmt-line {
    flex: 1;
    width: 1px;
    min-height: 8px;
    margin: 8px 0;
    background: var(--border-default);
  }
  .cmt-item > .cmt-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  /* 「名前・時刻・編集済み」を左に詰め、右端は ⋯ だけ。
     Figma（Threads）は時刻を右端に離しているが、日本語の氏名は 3〜8 文字で幅がばらつくので
     右揃えだと名前と時刻の隙間が毎行変わり、視線のリズムが作れない。Slack / GitHub /
     YouTube と同じく隣接させて行頭から一定の位置に並べる。
     ⋯ は hover ではなく常時出す（コメントは行数が多く、hover では操作の存在に気づけない）。 */
  .cmt-item .cmt-head { display: flex; align-items: baseline; min-width: 0; }
  .cmt-item .cmt-name {
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 20px; font-weight: 700;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 編集済みの印。本文を書き換えた事実が消えると齟齬の原因になるので必ず残す。 */
  .cmt-item .cmt-at,
  .cmt-item .cmt-edited {
    flex: none;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 20px;
    color: var(--text-tertiary);
  }
  /* 区切りは中黒。要素で持たず CSS で足す（片方が無いときに文字だけ余らない）。 */
  .cmt-item .cmt-at::before,
  .cmt-item .cmt-edited::before { content: "・"; }
  .cmt-item .cmt-tail {
    margin-left: auto;
    display: flex; align-items: center; gap: 6px;
    flex: none;
    padding-left: 8px;
    /*
      **baseline の列から外す**（2026-09-21）。`.cmt-head` は `align-items: baseline` で、
      ⋯（`IconButton` 32px）には字のベースラインが無いので**下端**が基準になる。すると
      名前の字が行の中で 9px ほど下へ押され、左のアバターと頭が揃わなくなる。
      中央に置けば、名前の字が行の頭に座る。
    */
    align-self: center;
  }
  .cmt-item .cmt-text {
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 20px;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
  }
  /* 添付（画像 / ファイル / URL）。吹き出しの中と同じ部品が入る。
     幅は吹き出しより狭くする — コメントは投稿本体の従属なので、画像が本体より
     目立つと主従が逆転する（420px では画像だけで 350px 超の高さになった）。 */
  .cmt-item .cmt-attach {
    display: flex; flex-direction: column; gap: 6px;
    min-width: 0;
    max-width: 280px;
  }
  /* アクション行（リアクション / 返信 / 後で など）。Figma の interactions 相当。
     gap は Figma の 18px を DS の `.icotxt` が持つ左右 padding 6px ぶん詰めて 8px。 */
  .cmt-item .cmt-actions {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin: 2px 0 0 -6px;
    min-width: 0;
  }
  /* リアクション（ReactionList）はアクション行とは別。押した中身を見せる帯。 */
  .cmt-item .cmt-rxn { min-width: 0; }
  /* 返信の開閉。件数だけの行（Threads の stats）は置かない — DS の `IconTextCounter` が
     アイコンと件数を一体で持つので、アクション行に同じ数字が既に出ている。ここには
     数字ではなく操作を置く。1 件の中なので `.cmt-more` より詰める。 */
  .cmt-item .cmt-more { padding: 2px 0 0; }
  /* 返信の入れ子（1 段だけ）。Slack のスレッドのように何段も掘れる形にはしない —
     掘れると読む順序が破綻し、「どれへの返信か」を追うコストが上がるため。 */
  .cmt-item > .cmt-replies {
    grid-column: 2;
    display: flex; flex-direction: column;
    margin-top: 4px;
  }
  .cmt-item.is-reply { grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; }
  /*
    返信の区切り（2026-09-21、指摘）。

    もとは「返信側に線を引かない」だった。理由は**最後の返信の下と親の境界線が重なって
    2 本並ぶ**から——しかしそれは最後の 1 件だけの話で、**返信どうしのあいだ**まで無くすと
    地続きになって、どこで 1 件が終わったのか読めない（実際に読めなかった）。
    間には引き、最後だけ引かない。

    スレッドの中に入力欄が出ているときは、それが最後の子になる。そのときは最後の返信にも
    線が付くが、**返信と入力欄の境目**になるので都合がよい。
  */
  .cmt-item > .cmt-replies > .cmt-item { border-bottom: 0; }
  .cmt-item > .cmt-replies > .cmt-item:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
  }
  .cmt-item.is-reply .cmt-name { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-secondary); }
  /* ノートのように密に見せたいところ用。境界線も落として行だけ積む。 */
  .cmt-item.is-compact {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 8px;
    padding: 6px 0;
    border-bottom: 0;
  }
  .cmt-item.is-compact .cmt-name { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--text-secondary); }

  /* 入力欄。アバターを左に置き、入力欄を `.cmt-item` の本文列にぴったり合わせる
     （列がずれると「自分が書き込む場所」が一覧と別の何かに見える）。
     `MessageComposer` のような複数行の入力は上端揃え、1 行の入力は中央揃えにする。 */
  .cmt-input {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    padding: 16px 0 0;
    min-width: 0;
  }
  .cmt-input.is-compact {
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 8px;
    align-items: center;
    padding: 8px 0 0;
  }
  .cmt-input > .cmt-in-body { display: flex; align-items: center; gap: 8px; min-width: 0; }
  /* 入力欄そのものは列いっぱいまで伸ばす。`.msg-comp` は幅を持たないので、伸ばさないと
     アバターを付けた瞬間に入力欄だけ縮んで一覧より狭くなる。末尾の送信ボタンは伸びない。 */
  .cmt-input > .cmt-in-body > :first-child { flex: 1 1 auto; min-width: 0; }
  /*
    コメント欄に置いた `MessageComposer` は**トークの足もとの帯ではない**。
    `.msg-comp` は帯として作ってあるので `border-top`（帯の上線）と外側の 16px を持つが、
    コメント欄では
      - 上線が宙に浮いた 1 本の線になる
      - アバターがその線に頭を揃えるので、**見えている入力の箱（`.mc-box`）より 17px 上**へずれる
    （2026-09-21、指摘。`PC/sample/…13.55.44.png`）。帯の装いだけ外す。
  */
  .cmt-input .msg-comp { border-top: 0; padding: 0; }

  /* 「他N件を表示」。件数が多いコメントは既定で畳み、押した分だけ伸ばす。 */
  .cmt-more {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 12px 0;
    border: 0; background: none;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px; font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
  }
  .cmt-more:hover { color: var(--text-brand); text-decoration: underline; }
  .cmt-more .ic { width: 14px; height: 14px; transition: transform .12s ease; }
  /* 開いているあいだは chevron を反転させ、同じボタンが「閉じる」に変わったことを示す。 */
  .cmt-more.is-open .ic { transform: rotate(180deg); }

  /* ノートに投稿したときにトークへ流れるカード。アルバムの .album-msg と同じ扱いで、
     吹き出しの中身の1種類。中身は本文の抜粋（最大3行）＋あれば画像。 */
  .note-msg {
    display: flex; flex-direction: column; gap: 8px;
    width: 100%;
    padding: 0; border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
  }
  .note-msg > .nm-label {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-tertiary);
  }
  .note-msg > .nm-label .ic { width: 14px; height: 14px; flex: none; }
  /* 本文は抜粋。トークを長い投稿で埋めないよう3行で打ち切る。 */
  .note-msg > .nm-excerpt {
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
    overflow: hidden;
  }
  .note-msg:hover .nm-excerpt { text-decoration: underline; text-underline-offset: 2px; }

  /* ---------- Album ----------
     トーク内のアルバム。一覧（.album-grid > .album-card）と
     詳細（.photo-grid > .photo-tile）の 2 画面で構成する。
     モバイルの長押し選択は PC では成立しないので、選択は明示的な
     「写真を選択」モード（.photo-grid.is-selecting）に入ってから行う。 */
  .album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
  .album-card {
    display: flex; flex-direction: column;
    position: relative;
    padding: 0; border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
  }
  .album-card > .ac-cover {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--r-8);
    overflow: hidden;
    background: var(--brand-navy-50);
  }
  .album-card > .ac-cover > img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .18s ease;
  }
  .album-card:hover > .ac-cover > img { transform: scale(1.03); }
  .album-card > .ac-name {
    margin-top: 8px;
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 18px; font-weight: 600;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .album-card > .ac-meta {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-tertiary);
  }
  /* 「…」はカードの上に浮かせる。hover / フォーカス時だけ出す。 */
  .album-card > .ac-menu {
    position: absolute;
    top: 6px; right: 6px;
    opacity: 0;
    transition: opacity .12s ease;
  }
  .album-card:hover > .ac-menu,
  .album-card:focus-within > .ac-menu { opacity: 1; }

  .photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  /* ---------- アルバムをモーダルで見る（AlbumModal） ----------
     トークのカードから開く「見るだけ」の面。器は `.modal.is-large`。 */
  /* 一覧は**選ぶ面より大きめのタイル**にする。ここは見るための面なので、
     1 行に詰める枚数より 1 枚の見え方を優先する（選択モードの 140px より広い）。 */
  .am-modal-body .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 12px;
  }
  .am-modal-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .am-modal-title > .amm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 枚数・位置は見出しの添え物。見出しと同じ太さにすると、どちらが名前か分からない。 */
  .am-modal-title > .amm-count {
    flex: none;
    font-size: 12px; font-weight: 400;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
  }
  /* 写真 1 枚を見る面。**地は暗くする**——白地だと明るい写真の縁が地と溶けて、
     写真がどこまでなのか分からない（`ImageLightbox` と同じ理由）。 */
  /* **高さは固定**（写真ごとに変えない）。写真の実寸に合わせると、前後に送るたびに
     モーダルの背が変わってボタンの位置が動く。中の写真は縦横比を保って面いっぱいに収める。 */
  .am-modal-stage {
    display: grid;
    /* **行を確定させる。** `height` があっても行が `auto` だと中の `height: 100%` が
       解決できず（不定高）、画像が幅なりの正方形に伸びて面から溢れた。 */
    grid-template-rows: minmax(0, 1fr);
    height: 56vh;
    padding: 8px;
    border-radius: var(--r-8);
    background: var(--fill-inverse);
  }
  /* 面いっぱいに収める（小さい画像は引き伸ばす）。実写真は必ず面より大きいので縮小方向に
     働き、拡大になるのは極端に小さい画像のときだけ。**縦横比は保つ**（`contain`）。 */
  .am-modal-stage > img {
    width: 100%; height: 100%; min-height: 0;
    object-fit: contain;
    border-radius: var(--r-4);
    display: block;
  }
  /* 前後の移動は左、ダウンロードは右。同じ側に並べると、移動のつもりで保存を押す。 */
  .modal.is-large > .modal__footer > .amm-nav {
    display: flex; align-items: center; gap: 4px;
    margin-right: auto;
  }
  /* 「自分の画像を選ぶ」タイル。テンプレートと**同じグリッドの中**に置く
     （タブで分けると、自分の画像を使う人にはテンプレートが一生見えず、
     テンプレートを使う人には毎回モード切り替えが要る）。破線は「ここに入る」の合図。 */
  .photo-tile.is-upload {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    border: 2px dashed var(--border-strong);
    background: var(--bg-default);
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px; font-weight: 700;
    color: var(--text-secondary);
  }
  .photo-tile.is-upload:hover { border-color: var(--brand-navy); color: var(--text-brand); }
  .photo-tile.is-upload > .ic { width: 24px; height: 24px; }
  /* 画像の下に出す名前とタグ。名前だけでは何の画像か辿れないのでタグも見せる。 */
  .photo-tile > .pt-cap {
    position: absolute; inset: auto 0 0 0;
    padding: 12px 8px 6px;
    background: linear-gradient(180deg, rgba(0, 25, 81, 0), rgba(0, 25, 81, .72));
    font-family: var(--ff-sans);
    font-size: 11px; line-height: 15px;
    color: var(--text-on-fill);
    text-align: left;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .photo-tile > .pt-cap > b { font-weight: 700; }
  .photo-tile > .pt-cap > span { opacity: .8; }
  .photo-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 0; border: 0;
    border-radius: var(--r-8);
    overflow: hidden;
    background: var(--brand-navy-50);
    cursor: pointer;
  }
  .photo-tile > img { width: 100%; height: 100%; object-fit: cover; display: block; }
  /* 選択モードのときだけチェックを出す。通常時は画像だけを見せる。 */
  .photo-tile > .pt-check {
    position: absolute;
    top: 6px; left: 6px;
    display: none;
  }
  .photo-grid.is-selecting .photo-tile > .pt-check { display: block; }
  .photo-grid.is-selecting .photo-tile.is-on::after {
    content: "";
    position: absolute; inset: 0;
    border: 2px solid var(--brand-navy);
    border-radius: var(--r-8);
    background: rgba(0, 25, 81, .12);
    pointer-events: none;
  }
  .photo-tile:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

  /* アルバムを作成／写真を追加したときにトークへ流れるカード。
     画像・ファイル・OG と同じく吹き出しの中身の 1 種類として扱う（アルバムだけ
     別の器にすると、同じトークの中に2系統の見た目が混ざるため）。 */
  .album-msg {
    display: flex; flex-direction: column; gap: 8px;
    width: 100%;
    padding: 0; border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
  }
  .album-msg > .am-label {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-tertiary);
  }
  .album-msg > .am-label .ic { width: 14px; height: 14px; flex: none; }
  .album-msg > .am-foot {
    display: flex; align-items: baseline; gap: 8px;
    min-width: 0;
  }
  .album-msg .am-name {
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 18px; font-weight: 600;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .album-msg .am-count {
    flex: none;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-tertiary);
  }
  .album-msg:hover .sig-cell > img { opacity: .92; }
  .album-msg:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; border-radius: var(--r-4); }

  /* 選択中に出る操作バー。件数と操作をまとめ、解除の導線を必ず添える。 */
  .sel-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px;
    border-radius: var(--r-8);
    background: var(--brand-navy-50);
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 20px;
    color: var(--text-brand);
  }
  .sel-bar > .sb-count { font-weight: 600; }
  .sel-bar > .sb-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

  /* ---------- ReplyPill ----------
     「返信3件 ›」。メッセージに付いた返信の入口で、吹き出しの直下に置く。
     返信が 0 件のときは出さない（空のピルは開く価値が無いのにノイズになる）。 */
  .reply-pill {
    display: inline-flex; align-items: center; gap: 8px;
    height: 32px;
    padding: 0 10px 0 4px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--text-brand);
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px; font-weight: 600;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease;
  }
  .reply-pill:hover {
    background: var(--brand-navy-50);
    border-color: var(--brand-navy-100);
  }
  .reply-pill:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }
  /* 「最終返信 2時間前」。開くかどうかの判断材料なので、件数より弱く。 */
  .reply-pill .rp-last {
    color: var(--text-tertiary);
    font-weight: 400;
  }
  .reply-pill > .ic {
    width: 14px; height: 14px;
    color: var(--text-tertiary);
  }
  /* 自分のメッセージに付くときは吹き出しと同じ右辺に寄せる。 */
  .reply-pill.is-self { margin-left: auto; }
  /* グループ内では吹き出しの列に揃える（アバター列から始めない）。 */
  .bubble-group .reply-pill { grid-column: 2; justify-self: start; }

  /* ---------- ReplyPanel ----------
     メッセージへの返信をまとめる右のドッキング列。DS の SidePanel とは別物：
     あちらはオーバーレイ（aria-modal・背面にスクリム）なので、本流を読みながら
     返信を追う、というこのパネルの目的には使えない。
     中身は本流と同じ .bubble-* をそのまま並べる（同じメッセージが場所によって
     別の見た目になるのを避けるため）。 */
  .reply-panel {
    position: relative;
    display: flex; flex-direction: column;
    width: 400px; flex: none;
    min-height: 0;
    background: var(--bg-default);
    border-left: 1px solid var(--border-subtle);
  }
  /* ---------- ResizeHandle ----------
     ドッキングした列の幅をドラッグで変える取っ手（トーク一覧の列・スレッドパネル共通）。
     幅を変えたい要素（position: relative）の直下に置く。1px の境界線の上に重なるが、
     境界線ぴったりだと掴めないので 7px 幅にし、ポインタが乗っている間だけ境界を navy に塗る。 */
  .rsz {
    position: absolute;
    top: 0; bottom: 0;
    width: 7px;
    padding: 0; border: 0; background: none;
    cursor: col-resize;
    touch-action: none;
    z-index: 3;
  }
  .rsz.is-left  { left: -3px; }
  .rsz.is-right { right: -3px; }
  .rsz::before {
    content: "";
    position: absolute;
    left: 3px; top: 0; bottom: 0;
    width: 1px;
    background: transparent;
    transition: background-color .12s ease;
  }
  .rsz:hover::before,
  .rsz:focus-visible::before,
  .rsz.is-resizing::before { background: var(--brand-navy); }
  /* フォーカスが見えるようにする（WCAG 2.4.7。以前は `outline: none` だけで
     代替が無く、キーボードで掴めるのに当たったことが分からなかった＝DS-18）。
     7px の細い帯なので outline では潰れる。掴む位置を面で示す。 */
  .rsz:focus-visible {
    outline: none;
    background: var(--border-focus);
    box-shadow: var(--shadow-focus);
  }

  .reply-panel > .rpn-head {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 12px 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .reply-panel .rpn-title {
    flex: 1; min-width: 0;
    font-family: var(--ff-sans);
    font-size: 16px; line-height: 24px; font-weight: 600;
    color: var(--text-primary);
  }
  .reply-panel > .rpn-body {
    flex: 1; min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex; flex-direction: column; gap: 8px;
  }
  /* 親メッセージと返信の境目。ここより下が返信、と一目で分かるようにする。 */
  .reply-panel .rpn-count {
    display: flex; align-items: center;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-tertiary);
  }

  /* ---------- MessageComposer ----------
     Figma: messageComposer (513:17966). Four independent props there —
     HasReply / hasImages / hasFiles / Type(default|Input) — which here are just
     "is the reply row rendered", "is the attachment tray rendered" and "is the
     textarea empty", so no variant classes are needed: the box grows by row. */
  .msg-comp {
    padding: 16px;
    background: var(--bg-default);
    border-top: 1px solid var(--border-subtle);
  }
  /* The bordered box that everything lives inside — the reply row, the textarea,
     the attachment tray and the action bar all stack in here. */
  .msg-comp > .mc-box {
    display: flex; flex-direction: column;
    border: 2px solid var(--gray-50);
    border-radius: var(--r-8);
    background: var(--bg-default);
    overflow: hidden;
  }
  /* .qr-target already rounds only its top corners, so it seats flush in the box. */
  .msg-comp .qr-target { border-radius: var(--r-8) var(--r-8) 0 0; }
  /* The message field is the DS Textarea in autoGrow mode — it grows with the
     message and scrolls once it hits maxHeight. Only the chrome is dropped: the
     .mc-box around it already provides the border, radius and focus surface, so a
     second border inside it would read as a nested field. Height / overflow-y are
     set inline by autoGrow, so they are not declared here. */
  .msg-comp .mc-input.textarea {
    padding: 12px 12px 20px;
    min-height: 0;
    border: 0;
    background: none;
    line-height: 20px;
  }
  .msg-comp .mc-input.textarea:hover,
  .msg-comp .mc-input.textarea:focus {
    border: 0;
    box-shadow: none;
  }
  .msg-comp .mc-input.textarea::placeholder { color: var(--text-tertiary); }
  /* Attachment tray — pending images and files, always ONE row.
     It never wraps (a second row pushes the composer up over the thread) and it
     never shows a scrollbar (the message field is the only scrollbar in the
     composer). Overflow is reached with the ◀ ▶ buttons instead, which only appear
     when there is something to reach in that direction.
     Top padding clears the ✕ badge that .attach-img / .attach-file bleed above
     their own box — overflow-x:auto makes overflow-y compute to auto, so a badge
     poking past the edge would be clipped. */
  .msg-comp .mc-tray-wrap { position: relative; }
  .msg-comp .mc-tray {
    display: flex; align-items: center; flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 12px 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    /* Scrollbar hidden, not disabled: trackpad and shift-wheel still work. */
    scrollbar-width: none;
  }
  .msg-comp .mc-tray::-webkit-scrollbar { display: none; }
  /* Pager buttons — float over the tray edges, like a carousel control. */
  .msg-comp .mc-tray-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    padding: 0;
    border: 1px solid var(--border-default);
    border-radius: 9999px;
    background: var(--bg-default);
    color: var(--text-secondary);
    box-shadow: var(--shadow-2);
    cursor: pointer;
    z-index: 2;
  }
  .msg-comp .mc-tray-nav:hover { background: var(--int-hover); color: var(--text-primary); }
  .msg-comp .mc-tray-nav:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
  .msg-comp .mc-tray-nav .ic { width: 16px; height: 16px; }
  .msg-comp .mc-tray-nav.is-prev { left: 4px; }
  .msg-comp .mc-tray-nav.is-next { right: 4px; }
  /* In the tray a file gets the same corner ✕ as an image: both are pending items
     to drop, so they should read as one row of removable chips. */
  .msg-comp .mc-tray .attach-file {
    overflow: visible;
    padding-right: 14px;
  }
  .msg-comp .mc-tray .attach-file > .af-close {
    top: 0; right: 0;
    transform: translate(35%, -35%);
    width: 20px; height: 20px;
    background: var(--brand-navy);
    color: var(--text-on-fill);
    border: 1.5px solid var(--bg-default);
    box-shadow: 0 1px 2px rgba(0, 25, 81, .16);
  }
  .msg-comp .mc-tray .attach-file > .af-close:hover { background: var(--fill-brand-strong); color: var(--text-on-fill); }
  .msg-comp .mc-tray .attach-file > .af-close:active { transform: translate(35%, -35%) scale(0.94); }
  .msg-comp .mc-tray .attach-file > .af-close .ic { width: 12px; height: 12px; }
  /* Action bar — insert actions on the left, send on the right. */
  .msg-comp .mc-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 0 4px 4px 8px;
  }
  .msg-comp .mc-tools { display: flex; align-items: center; gap: 0; }

  /* ---------- MsgFile ----------
     A file that arrived IN a message (Figma: Attachment container / Type=CloudFile,
     "Shown in a message. Not in your local gallery.").
     Deliberately NOT .attach-file: that one is the composer's pre-send attachment
     and its trailing action is "remove". This one is already sent, so its actions
     are "preview" and "download". */
  /* 送信済みメッセージの中のファイル。**中身の長さで幅が決まる**（下限 252px）——
     固定幅だと長いファイル名が必ず省略され、拡張子の手前で切れて何のファイルか読めない。
     枠を持つのは、吹き出しと同じ白地に載るので面だけでは境目が出ないから。 */
  .msg-file {
    display: flex; align-items: center; gap: 12px;
    width: fit-content; min-width: 252px; max-width: 100%;
    min-height: 64px;
    padding: 10px 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--r-12);
    background: var(--bg-default);
  }
  /* 拡張子を書いた四角いバッジ。**絵ではなく文字**にするのは、汎用の書類グリフだと
     開けるかどうかが分からないから。色は種類の識別で、既定（知らない拡張子）は素の灰色。 */
  .msg-file > .mf-icon {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: none;
    border-radius: var(--r-10);
    background: var(--fill-neutral);
    font-family: var(--ff-display);
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
    color: var(--text-on-fill);
  }
  .msg-file > .mf-icon.is-pdf   { background: var(--fill-file-pdf); }
  .msg-file > .mf-icon.is-sheet { background: var(--fill-file-sheet); }
  .msg-file > .mf-icon.is-doc   { background: var(--fill-file-doc); }
  .msg-file > .mf-icon .ic { width: 32px; height: 32px; }
  .msg-file > .mf-body {
    display: flex; flex-direction: column; gap: 2px;
    flex: 1; min-width: 0;
  }
  /* 名前と拡張子は**地続きの 1 語**なので隙間を空けない（点は `ext` 側が持つ）。 */
  .msg-file .mf-name {
    display: flex; min-width: 0;
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 700;
    color: var(--text-primary);
  }
  /* Long names truncate the base and keep the extension — same rule as .attach-file,
     because the extension is what tells you whether you can open it. */
  .msg-file .mf-name-base { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .msg-file .mf-name-ext { flex: none; }
  .msg-file .mf-meta {
    display: flex; align-items: baseline; gap: 8px;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 18px;
    color: var(--text-tertiary);
  }
  /* **押せる範囲は 24px 以上**（WCAG 2.2 SC 2.5.8・2026-09-29 実測で 60×16 と 20×20 だった）。
     行の高さは変えたくないので、`inline` のまま上下に padding を足して当たり判定だけ広げる
     ——`inline` 要素の縦 padding は行の高さに効かないが、押せる面には効く。 */
  .msg-file .mf-preview {
    flex: none;
    font-size: 12px; line-height: 16px;
    padding: 4px 2px; margin: -4px -2px;
    color: var(--text-brand);
    text-decoration: underline;
  }
  .msg-file > .mf-dl {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; flex: none;
    margin-left: 4px; padding: 0;
    border: 0; background: none;
    color: var(--text-secondary);
    cursor: pointer;
  }
  .msg-file > .mf-dl .ic { width: 20px; height: 20px; }
  .msg-file > .mf-dl:hover { color: var(--text-primary); }
  .msg-file > .mf-dl:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

  /* ---------- Play badge ----------
     Marks a media thumbnail as a video. Drop it inside any positioned media box
     (.sig-cell and .og-media both already establish one). */
  .media-play {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 999px;
    background: var(--bg-default);
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
    pointer-events: none;
  }
  .media-play .ic {
    width: 24px; height: 24px;
    fill: currentColor;
    /* Optical centering: a triangle's visual mass sits left of its bounding box. */
    margin-left: 2px;
  }

  /* ---------- LinkPreview ----------
     OG preview for a URL pasted into a message: the URL itself, the OG image
     (with a play badge when the target is a video), then site / title / description. */
  .og-card {
    display: flex; flex-direction: column; gap: 10px;
    max-width: 296px;
    font-family: var(--ff-sans);
  }
  .og-card > .og-url {
    font-size: 14px; line-height: 20px;
    color: var(--text-brand);
    /* Raw URLs have no spaces to wrap at, so they break anywhere. */
    word-break: break-all;
  }
  .og-card > .og-media {
    position: relative;
    display: block;
    height: 136px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--brand-navy-50);
  }
  .og-card > .og-media > img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
  }
  .og-card > .og-media,
  .og-card > .og-text { text-decoration: none; }
  .og-card > .og-text {
    display: flex; flex-direction: column; gap: 4px;
    min-width: 0;
  }
  /* Only the title underlines on hover — underlining all three lines at once
     turns the whole card into noise. */
  .og-card > .og-text:hover .og-title { text-decoration: underline; }
  .og-card .og-site {
    font-size: 12px; line-height: 16px; font-weight: 500;
    color: var(--text-brand);
  }
  /* Titles and descriptions come from the open web, so both clamp rather than
     letting one link stretch the bubble. */
  .og-card .og-title {
    font-size: 16px; line-height: 24px; font-weight: 500;
    color: var(--text-primary);
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1;
    overflow: hidden;
  }
  .og-card .og-desc {
    font-size: 14px; line-height: 20px;
    color: var(--text-tertiary);
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden;
  }

  /* ---------- TalkThreadHeader ----------
     Top bar of the thread column: avatar (single or group) + name +
     participant pill + subtitle + member stack + actions. */
  .th-head {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 16px;
    background: var(--bg-default);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-1);
  }
  .th-head > .avatar { flex: none; }
  .th-head > .th-main {
    display: flex; flex-direction: column; justify-content: center;
    flex: 1; min-width: 0;
  }
  .th-head .th-title {
    display: flex; align-items: center; gap: 12px;
    min-width: 0;
  }
  .th-head .th-name {
    font-family: var(--ff-sans);
    font-size: 16px; line-height: 24px; font-weight: 600;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* Participant count pill — users icon + 「13人が参加中」. */
  .th-head .th-count {
    display: inline-flex; align-items: center; gap: 8px;
    flex: none;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-subtle);
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
  }
  .th-head .th-count .ic { width: 16px; height: 16px; flex: none; }
  .th-head .th-sub {
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px;
    color: var(--text-tertiary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .th-head > .av-grp { flex: none; }
  .th-head > .th-actions {
    display: flex; align-items: center; gap: 4px;
    flex: none;
  }

  /* Dept path */
  .dept-crumb { font-size: 12px; color: var(--text-secondary); line-height: 16px; }
  .dept-name { font-weight: 700; font-size: 12px; color: var(--text-primary); }
  .dept-role { font-size: 12px; color: var(--text-secondary); margin-left: 8px; }
  /* DeptLine — 1 行内に「先祖（薄）› + 最終部署（濃）」を収める。
     リスト行の所属表記など、縦に増やしたくない場面用。
     先祖は .dept-seg で 1 セグメントずつ並べ、区切り「›」は CSS 生成（手打ち不要）。
     <span class="dept-line"><span class="dept-anc"><span class="dept-seg">東京支店</span><span class="dept-seg">渋谷支店</span></span><span class="dept-leaf">営業部</span></span> */
  .dept-line { font-size: 12px; line-height: 16px; color: var(--text-primary); }
  .dept-line .dept-anc { color: var(--text-tertiary); }
  /* 各先祖セグメントの末尾に区切り「›」を生成（最後の先祖の › が最終部署の前に入る）。
     サイズ・色・太さを本文と独立して制御し、薄く小さくなりすぎないようにする。 */
  .dept-line .dept-seg::after {
    content: "›"; margin: 0 7px;
    color: var(--text-tertiary); font-weight: 600; font-size: 14px;
  }
  .dept-line .dept-leaf { color: var(--text-primary); font-weight: 700; }
  /* 役職を付けたい場合は末尾に .dept-role を併置。組織パスと区別するため「｜」で区切る。 */
  .dept-line .dept-role { margin-left: 0; }
  .dept-line .dept-role::before { content: "｜"; margin: 0 6px; color: var(--text-disabled); font-weight: 400; }
  /* 1 行省略したい場合は .is-truncate を付ける。
     最終部署 (.dept-leaf) と役職 (.dept-role) は切らさず、先祖 (.dept-anc) だけを末尾省略する。 */
  .dept-line.is-truncate { display: flex; align-items: baseline; gap: 4px; }
  .dept-line.is-truncate .dept-anc {
    flex: 0 1 auto; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dept-line.is-truncate .dept-leaf { flex: none; white-space: nowrap; }
  .dept-line.is-truncate .dept-role { flex: none; margin-left: 0; white-space: nowrap; }

  /* Comment arrow */
  .cmt-row { display:flex; align-items:center; gap: 4px; font-weight: 700; font-size: 16px; line-height: 24px; }
  .cmt-from { color: var(--text-secondary); }
  .cmt-to   { color: var(--text-secondary); }
  .cmt-to.accent { color: var(--magenta-500); }
  .cmt-arrow, svg.lucide.cmt-arrow { width: 16px; height: 16px; color: var(--text-tertiary); flex: none; }
  /* Receiver = current user: magenta arrow, To-name, and avatar ring. */
  .cmt-row.is-to-me .cmt-arrow { color: var(--magenta-500); }
  .cmt-row.is-to-me .cmt-to    { color: var(--magenta-500); }
  .cmt-row.is-to-me .avatar.to-me .av-inner { box-shadow: 0 0 0 var(--av-ring, 2.5px) var(--magenta-500); }
  /* Standalone modifier on an avatar (outside cmt-row) when recipient is self. */
  .avatar.to-me .av-inner { box-shadow: 0 0 0 var(--av-ring, 2.5px) var(--magenta-500); }

  /* Icon+Text (thumbs-up) */
  .icontxt-row {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 9999px;
    font-size: 14px; font-weight: 500;
    color: var(--text-primary);
  }
  .icontxt-row .ic { width: 16px; height: 16px; }
  .icontxt-row.hover { background: var(--int-hover); }
  /* 生 hex の #D4476A だった（白の上で 4.28 と割れ、テーマにも反応しない）。
     文字なのでトーンの文字段階を使う。 */
  .icontxt-row.accent { color: var(--magenta-700); }
  .icontxt-row.accent .ic { color: var(--magenta-700); }
  /* accent の hover は灰色（`--int-hover`）ではなくトーンの面に寄せる。
     灰色の上だとダークで 4.48 と 4.5 をわずかに割るうえ、マゼンタのチップが
     灰色に変わるのは色の系統としても合わない。 */
  .icontxt-row.accent.hover { background: var(--magenta-50); }

  /* Letter draft / booking */
  .letter-row {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 8px; border: 1px solid var(--border-default); border-radius: 4px;
    background: var(--bg-default);
    transition: background-color .12s ease;
  }
  .letter-row.is-hover { background: var(--bg-unread); }
  .letter-avatar {
    width: 48px; height: 48px; border-radius: 9999px; overflow: hidden;
    background: var(--avatar-bg); flex: none;
  }
  .letter-avatar img { width:100%; height:100%; object-fit: cover; display:block; border-radius: inherit; }
  /* Hover action chips, floated on the right of .letter-row */
  .letter-row .tl-actions {
    position: absolute; top: 50%; right: 12px;
    transform: translateY(-50%); z-index: 2;
  }
  .letter-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .letter-to { font-size: 14px; font-weight: 500; line-height: 20px; letter-spacing: .08em; color: var(--text-primary); }
  .letter-body { font-size: 12px; line-height: 16px; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .letter-foot { display:flex; align-items:center; gap: 8px; margin-top: 2px; }
  .letter-date { font-size: 12px; color: var(--text-tertiary); line-height: 16px; }
  .pill-badge {
    display: inline-flex; align-items: center; padding: 4px 8px;
    border: 1px solid var(--border-strong); border-radius: 999px;
    background: var(--bg-page); color: var(--text-tertiary);
    font-size: 12px; font-weight: 500; line-height: 16px;
  }
  .pill-amber {
    display: inline-flex; align-items: center; padding: 2px 10px;
    background: var(--amber-50); color: var(--amber-800); border-radius: 999px;
    font-size: 12px; font-weight: 500; line-height: 16px;
  }
  .letter-booking-date {
    min-width: 100px; padding-right: 16px; border-right: 1px solid var(--border-default);
    display: flex; flex-direction: column; gap: 4px;
    text-align: center; align-items: center;
  }
  .letter-booking-date .d { font-size: 14px; font-weight: 600; color: var(--magenta-500); line-height: 20px; letter-spacing: .04em; }
  .letter-booking-date .t { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 20px; letter-spacing: .04em; }

  /* Section block (thread header) */
  .sec-thread-head { display:flex; flex-direction:column; gap: 4px; }
  .sec-thread-head .title-row {
    display:flex; align-items:center; gap: 12px;
    font-weight: 700; font-size: 16px; line-height: 24px; color: var(--text-primary);
  }
  .sec-thread-head .sub { font-size: 14px; color: var(--text-secondary); line-height: 20px; margin: 0; }
  .group-chip {
    display:inline-flex; align-items:center; gap: 4px;
    padding: 2px 10px; border-radius: 999px; background: var(--bg-subtle);
    font-size: 12px; font-weight: 500; color: var(--text-secondary);
  }
  .group-chip .ic { width: 14px; height: 14px; }
  .room-hd { display:flex; align-items:baseline; gap: 2px; }
  .room-hd .name { font-weight: 700; font-size: 16px; color: var(--text-primary); }
  .room-hd .count { font-weight: 500; font-size: 14px; letter-spacing: .08em; color: var(--text-tertiary); }

  /* =====================================================
     LISTS — row components for list containers
     ===================================================== */

  /* Generic list shell (full-bleed rows with dividers) */
  .list-shell {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-4);
    overflow: hidden;
  }
  .list-shell > * + * { border-top: 1px solid var(--border-default); }
  .list-shell.no-border { border: 0; border-radius: 0; }
  .list-shell.dashed > * + * { border-top: 1px dashed var(--border-default); }

  /* Overview matrix: when / which list */
  .pick-matrix {
    display: grid; grid-template-columns: 220px 1fr 1fr;
    gap: 0; font-size: 13px; line-height: 1.6;
  }
  .pick-matrix > div {
    padding: 14px 16px;
    border-top: 1px solid var(--border-default);
  }
  .pick-matrix > div:nth-child(-n+3) { border-top: 0; }
  .pick-matrix .h {
    font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--text-tertiary); font-weight: 700;
    padding-top: 8px; padding-bottom: 8px;
  }
  .pick-matrix .k { font-weight: 700; color: var(--text-primary); }

  /* ---------- NotificationItem ----------
     Layout: [48px avatar] [message (main / sub / time stacked)]
     States : default / hover / unread / unread+hover
  */
  .n-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
    padding: 14px 20px;
    background: var(--bg-default);
    position: relative;
    border-radius: 0;
  }
  .n-row + .n-row { border-top: 1px solid var(--border-default); }

  /* avatar slot (48px, supports .avatar subcomponent) */
  .n-row .n-av { width: 48px; height: 48px; flex: none; }

  .n-row .n-body { min-width: 0; display: flex; flex-direction: column; }

  /* Main line: subject(bold) + rest-of-sentence(regular) */
  .n-row .n-main {
    font-size: 16px; line-height: 1.5;
    color: var(--brand-navy);
    font-weight: 400;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .n-row .n-main .n-subject { font-weight: 700; }

  /* Sub line: ◆ context (ellipsis) */
  .n-row .n-sub {
    display: flex; align-items: baseline; gap: 2px;
    font-size: 14px; line-height: 1.5;
    color: var(--brand-navy);
    min-width: 0;
    margin-top: 0;
  }
  .n-row .n-sub .n-sub-ic {
    flex: none;
    font-size: 12px; line-height: 1;
    color: var(--brand-navy);
  }
  .n-row .n-sub .n-sub-text {
    min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* Meta line: timestamp */
  .n-row .n-time {
    font-size: 13px; color: var(--text-tertiary);
    line-height: 1.5; margin-top: 0;
    font-variant-numeric: tabular-nums;
  }

  /* States */
  .n-row.is-hover           { background: var(--gray-50); }
  .n-row.is-unread          { background: var(--bg-unread); box-shadow: inset 3px 0 0 0 var(--brand-navy); }
  .n-row.is-unread.is-hover { background: var(--brand-navy-100);          box-shadow: inset 3px 0 0 0 var(--brand-navy); }

  /* スレッドヘッダーの参加者アバター。押すと参加者一覧が開くので、押せることを面で示す
     ——左のトークアイコンと形が似ているため、ホバーで変化しないとどちらが押せるか分からない。 */
  .th-members {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px 4px 6px;
    border: 0; border-radius: 999px;
    background: transparent;
    cursor: pointer;
  }
  .th-members:hover { background: var(--int-hover); }
  .th-members:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 0; }
  .th-members > .thm-count {
    font-family: var(--ff-sans);
    font-size: 12px; font-weight: 700; line-height: 16px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
  }

  /* ---------- TalkList nav（横断ビューへの導線） ----------
     アクティビティ・後で・下書き・ファイルは「トークの一覧」ではなく**自分あての横断ビュー**。

     **独立した縦のレールにする**（2026-09-02）。以前は検索の直下に 4 等分で横並びにしていた
     ——「縦に 4 行積むとルーム行 4 件分の場所を取る」ためだったが、**別の列に出せば一覧の
     場所はそもそも取らない**ので、その心配は無くなる。メインナビと同じ 68px 幅・同じ組み方
     （アイコンの下にラベル）にして、2 本のレールが同じ規則で読めるようにする。

     面はメインナビ（濃紺）より一段だけ引いた `--bg-canvas`。ここは「トークの中の道具」で、
     製品ぜんぶの入口であるメインナビとは階層が違う。
     未読はアイコンの右上に載せる。 */
  /*
    **幅は 68px のまま**。1 行に収めるために 104px へ広げたことがあるが戻した
    （2026-09-30、依頼）。ラベルは 2 行に折り返す前提で、`.tln-label` が 2 行ぶんの
    高さを確保する。広げるなら 104px 要る（「アクティビティ」が 11px × 7 文字＝77px で、
    96px では 2px 足りずに折り返す・実測）。
  */
  .tl-nav {
    width: 68px;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: var(--bg-canvas);
    border-right: 1px solid var(--border-default);
  }
  /* レールの中で幅いっぱいに広げる（横並びのときは grid が幅を決めていた）。 */
  .tl-nav > .tl-navitem { width: 100%; }
  .tl-nav-divider {
    width: 32px; height: 1px; flex: none;
    margin: 4px 0;
    background: var(--border-default);
  }
  /* 組み方も当たり方も**メインナビ（`.gn-item`）と同じ規則**にする。2 本のレールが
     隣り合うので、片方だけ違う当たり方をすると別の仕組みに見える。
     （寸法だけ一段下げて階層を出す案を試したが戻した。2026-09-30、依頼） */
  .tl-navitem {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-width: 0; min-height: 72px;
    padding: 4px 2px;
    border: 0; border-radius: var(--r-8);
    background: transparent;
    font-family: var(--ff-sans);
    text-decoration: none;
    cursor: pointer;
  }
  /* **背景が付くのはアイコンのチップだけ**（メインナビと同じ）。項目全体を塗ると、
     文字数の違う項目で四角の大きさが揃わない。
     色は面に合わせる——ここは明るい面なので、メインナビの白 12% ではなく hover のトークン。 */
  .tl-navitem:hover { text-decoration: none; }
  .tl-navitem:hover:not(.is-active) > .tln-ic { background: var(--int-hover); }
  .tl-navitem:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
  /* 選択中は**チップを塗ってアイコンを反転**する。メインナビ（濃紺の面に白いチップ）の
     鏡像で、明るい面には濃紺のチップ。hover の淡いチップとは明度が大きく跳ぶので、色みの
     違いではなく明暗で読める（DS-19）。下線は置かない——チップの反転のほうが強い手がかりで、
     二重になる。 */
  .tl-navitem.is-active > .tln-ic { background: var(--brand-navy); color: var(--text-on-fill); }
  /* アイコンを載せる角丸のチップ。**素の状態では透明**で、hover と選択中にだけ色が付く。
     大きさは常に確保する（hover で初めて場所を取ると行の高さが動く）。
     数値はメインナビの `.gn-ic` と同じ（40×40 / `--r-12`）。 */
  .tl-navitem > .tln-ic {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--r-12);
    background: transparent;
    color: var(--text-secondary);
    transition: background .12s ease, color .12s ease;
  }
  /* **子孫で指定する**（`> svg` にしない）。アイコンは `display: contents` の span に
     包まれていて DOM 上は孫なので、直下の指定は当たらない——当たらないと `.lucide` の
     `width: 100%` に落ちて、入れ物の 40px いっぱいまで膨らむ（実際に膨らんだ）。
     メインナビの `.gn-item .gn-ic svg` と同じ書き方。 */
  .tl-navitem .tln-ic .lucide,
  .tl-navitem .tln-ic svg { width: 22px; height: 22px; }
  /* ラベルは 2 行ぶんの高さを常に確保する。「アクティビティ」だけが折り返して
     その列だけ背が高くなると、4 つの的の大きさが揃わない。 */
  .tl-navitem > .tln-label {
    width: 100%;
    font-size: 11px; font-weight: 600; line-height: 14px;
    min-height: 28px;
    color: var(--text-secondary);
    text-align: center;
    overflow-wrap: anywhere;
  }
  .tl-navitem.is-active > .tln-label { color: var(--brand-navy); }
  /* 未読件数。アイコンの右上。桁が増えても左へ伸ばす（右端で列からはみ出さない）。 */
  /* 大きさと色は `.badge.xs` が持つ。**ここは置き場所だけ**（2026-09-02 に統合）。 */
  .tl-navitem > .tln-ic > .badge {
    position: absolute; top: -6px; right: -8px;
    /* 縁の輪はレールの面の色で抜く（`.badge` 既定の `--bg-default` はここの地色ではない）。 */
    box-shadow: 0 0 0 2px var(--bg-canvas);
  }

  /* 一覧の下に固定する「新しいトークを始める」。一覧のどこまでスクロールしても押せる位置。 */
  .tl-newtalk {
    padding: 10px 12px;
    border-top: 1px solid var(--border-default);
    background: var(--bg-default);
  }
  .tl-newtalk > .btn { width: 100%; }

  /* ---------- TalkList row (avatar variant) ---------- */
  .tl-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-default);
    min-height: 72px;
    position: relative;
    border-bottom: 1px solid rgba(0,25,81,0.08);
  }
  .tl-row > .tl-av { grid-column: 1; align-self: center; }
  /* Right side is a flex column: head row + body row */
  .tl-row > .tl-right { grid-column: 2; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .tl-row .tl-head {
    display: flex; align-items: baseline; gap: 12px; min-width: 0;
    justify-content: space-between;
  }
  .tl-row .tl-head .tl-head-l { display:flex; align-items: baseline; gap: 4px; min-width: 0; }
  /* 抜粋が無い行では印が見出し行に入る。baseline 揃えだとバッジが文字の下線に乗るので中央で揃える。 */
  .tl-row .tl-head > .tl-mute { flex: 0 0 auto; align-self: center; }
  .tl-row .tl-body-row {
    display: flex; align-items: center; gap: 12px; min-width: 0;
  }
  .tl-row .tl-body-row .tl-body { flex: 1 1 auto; min-width: 0; }
  .tl-row .tl-body-row .tl-mute { flex: 0 0 auto; }
  .tl-row .tl-body-row .tl-actions { flex: 0 0 auto; }
  /* Legacy bg variants kept for existing usage (other States sections) */
  .tl-row.active  { background: var(--bg-unread); box-shadow: inset 3px 0 0 0 var(--border-selected); }
  .tl-row.hover   { background: var(--int-hover); }
  .tl-row.selected { background: var(--int-selected); box-shadow: inset 3px 0 0 0 var(--border-selected); }
  .tl-row.multi-pick { background: var(--amber-50); box-shadow: inset 3px 0 0 0 var(--border-selected); }

  /* Spec variants (match canonical TalkListItem state spec) */
  /*
    **未読に左の棒を使わない**（2026-09-29、指摘）。棒は同じ表の中で
    `.tl-row.active` / `.selected` / `.multi-pick`＝**選んでいる行**の印として使っていて、
    未読にも当てると 1 つの形が 2 つの意味を持つ。未読は淡い navy の地と件数バッジで示す
    ——地は選択中（濃紺のベタ＋白文字）とはっきり違うので、これだけで見分けが付く。

    地そのものは残す。長い一覧で未読を拾うのにいちばん安い手がかりで、
    バッジだけに頼ると行の端まで目を動かすことになる。
  */
  .tl-row.unread { background: var(--bg-unread); }
  .tl-row.unread-hover { background: var(--brand-navy-100); }
  .tl-row.is-active {
    background: var(--brand-navy);
  }
  .tl-row.is-active .tl-name,
  .tl-row.is-active .tl-count,
  .tl-row.is-active .tl-body,
  .tl-row.is-active .tl-time {
    color: var(--text-on-fill);
  }
  .tl-row.is-active .tl-count { color: rgba(255,255,255,0.72); }
  .tl-row.is-active .tl-body  { color: rgba(255,255,255,0.80); }
  .tl-row.is-active .tl-time  { color: rgba(255,255,255,0.72); }

  /* Right-side hover action chips — AttachmentUserMenu (Figma: atattchemnt/UserMenu).
     Floated over the row so the body text keeps its full width underneath.

     == HoverActionMenu ==
     汎用的な hover-reveal のアクションメニュー。元は timeline-row 専用だったが、
     Letter · Draft / Booking、Bubble（吹き出し）、各種 List item でも使用する。
     基本形は「白背景 / r-10 / subtle border / 2段 shadow / 32px icon-btn × n」。
     親行を hover したときのみ表示し、通常時は非表示にする(`.hover-reveal` で制御)。 */
  .tl-actions {
    display:flex; align-items:center; gap: 4px;
    background: var(--bg-default);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid rgba(0,25,81,0.08);
    box-shadow: 0 6px 16px rgba(0,25,81,0.12), 0 2px 4px rgba(0,25,81,0.08);
  }
  /* When inside a row, detach & float to the right edge, vertically centered. */
  /* 行 hover のときだけ出す。常時表示だと未読バッジ / ミュートを覆ってしまう。 */
  .tl-row:hover > .tl-actions.hover-reveal,
  .tl-row:focus-within > .tl-actions.hover-reveal {
    opacity: 1;
    pointer-events: auto;
  }
  .tl-row .tl-actions {
    position: absolute;
    top: 50%; right: 16px;
    transform: translateY(-50%);
    z-index: 2;
  }
  .tl-actions .iconbtn {
    position: relative;
    width: 32px; height: 32px;
    display:flex; align-items:center; justify-content:center;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border-default);
    cursor: pointer;
    color: var(--text-primary);
    transition: background-color .12s ease, border-color .12s ease;
  }
  .tl-actions .iconbtn:hover {
    background: var(--brand-navy-100);
    border-color: var(--brand-navy-100);
  }
  /* Destructive action: red icon, red-tinted hover background */
  .tl-actions .iconbtn.is-danger { color: var(--red-500); }
  .tl-actions .iconbtn.is-danger .ic { color: var(--red-500); }
  .tl-actions .iconbtn.is-danger:hover {
    background: var(--red-50);
    border-color: var(--red-50);
    color: var(--red-600);
  }
  .tl-actions .iconbtn.is-danger:hover .ic { color: var(--red-600); }
  .tl-actions .iconbtn .ic { width: 16px; height: 16px; color: var(--text-primary); }
  /* Host the shared .tt (Tooltip · Dark) inside the button,
     show only on hover / focus-visible. */
  .tl-actions .iconbtn > .tt {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%; transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity .12s ease .3s;
    z-index: 5;
  }
  .tl-actions .iconbtn:hover > .tt,
  .tl-actions .iconbtn:focus-visible > .tt { opacity: 1; }

  /* --- HoverActionMenu: bubble placement ---------------------------------
     吹き出しの左右にフロート配置するための helper。親要素を
     `.bubble-host`（position: relative; の吹き出しラッパ）にし、
     `.tl-actions.is-bubble-left` / `.is-bubble-right` でフロートさせる。
     `.hover-reveal` は親 hover 時だけ表示する制御クラス。
     
     hover が途切れないよう、吹き出しとメニューの間に隙間を作らず
     (left/right: 100%) に密着させ、視覚的な 8px の gap は
     メニュー側の padding / margin で作る。これにより hover が途中で
     外れてメニューが消える問題を防ぐ。 */
  .bubble-host { position: relative; display: inline-flex; max-width: 100%; }
  /* The host hugs the bubble only, so hovering the meta strip (which holds the
     clickable 既読) never opens the menu — and the menu, being flush against the
     bubble's edge, is still reachable without the pointer leaving a hover target. */
  .tl-actions.is-bubble-left {
    position: absolute;
    top: 50%; right: 100%;
    transform: translateY(-50%);
    padding-right: 8px;  /* 視覚 gap を padding で確保 → hover 途切れない */
    z-index: 2;
  }
  .tl-actions.is-bubble-right {
    position: absolute;
    top: 50%; left: 100%;
    transform: translateY(-50%);
    padding-left: 8px;
    z-index: 2;
  }
  /* 狭い面（簡易トークのパネル等）では吹き出しの横に出す余地がないので、右上に重ねる。
     `BubbleRow tight` が `.bubble-host.is-tight` を付ける。自分・相手のどちらでも右上に出す
     （左右で出し分けても、狭い面ではどちらかが必ず枠に当たる）。 */
  .bubble-host.is-tight > .tl-actions.is-bubble-left,
  .bubble-host.is-tight > .tl-actions.is-bubble-right {
    top: 0; left: auto; right: 8px;
    transform: translateY(-55%);
    /* 横に出すときの「hover が途切れないための余白」は要らないが、箱そのものの余白（4px）は
       残す。0 にすると枠とアイコンが接して、横に出したときと別物の見た目になる。 */
    padding: 4px;
  }

  .tl-actions.hover-reveal {
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
  }
  .bubble-host:hover > .tl-actions.hover-reveal,
  .bubble-host:focus-within > .tl-actions.hover-reveal,
  .tl-actions.hover-reveal:hover,
  .tl-actions.hover-reveal:focus-within {
    opacity: 1;
    pointer-events: auto;
  }

  /* Mute bell + count badge cluster (right side) */
  .tl-row .tl-mute {
    display:inline-flex; align-items:center; gap: 8px;
  }
  /* ピン留めの印。**アバターの左上**——右端はメッセージの状態（通知オフ・未読）の場所で、
     ピン留めは「自分がこの一覧をどう並べたか」という別の軸。丸の縁に半分かかる位置に置き、
     面の色で縁取って切り抜く（重なる印なので輪を持つ側）。 */
  .tl-row > .tl-pin-av {
    position: absolute;
    left: 15px; top: 12px;
    width: 18px; height: 18px;
    display: grid; place-items: center;
    border-radius: 9999px;
    background: var(--bg-default);
    color: var(--text-secondary);
    box-shadow: 0 0 0 1px var(--border-default);
    z-index: 1;
  }
  .tl-row > .tl-pin-av .lucide,
  .tl-row > .tl-pin-av svg { width: 11px; height: 11px; }
  /* 面が変わる行では、印の地色も面に合わせる（白い丸だけが浮かないように）。 */
  .tl-row.unread > .tl-pin-av { background: var(--bg-unread); }
  .tl-row.is-active > .tl-pin-av {
    background: var(--brand-navy);
    color: var(--text-on-fill);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.32);
  }
  /* Small bell-off icon shown when 通知OFF.
     Without an explicit size, svg.lucide inherits width/height: 100%
     from the global .lucide rule and balloons to fill .tl-mute. */
  /* The quiet row marks (pinned / muted). Unlike the unread badge these carry no
     colour of their own: if all three shouted, the right edge of the row would stop
     telling you where to look. */
  .tl-row .tl-mute .tl-bell-sm,
  .tl-bell-sm {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
    flex: none;
  }
  .tl-bell-sm svg,
  .tl-bell-sm.lucide { width: 14px; height: 14px; }
  /* The open row flips to a navy surface, so the marks have to flip with it —
     left at --text-tertiary they sink into the navy and the open row is the one
     row whose marks disappear. */
  .tl-row.is-active .tl-bell-sm { color: rgba(255, 255, 255, 0.72); }

/* Layout for the "State × item" matrix */
  .tl-state-matrix {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px 24px;
    align-items: center;
    padding: 20px;
  }
  .tl-state-matrix .tl-state-label {
    font-size: 13px; color: var(--text-secondary);
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .tl-state-matrix .tl-state-item {
    border-radius: 0;
    overflow: hidden;
    background: var(--bg-default);
    box-shadow: 0 0 0 1px var(--border-default);
  }
  /* Flat variant: no outer border, only a bottom divider on each row */
  .tl-state-matrix .tl-state-item.is-flat {
    box-shadow: none;
    border-bottom: 1px solid var(--border-default);
  }
  /* Stand-alone avatar (also usable outside .tl-row) */
  /* .tl-av is now just a grid-column hook (see .tl-row > .tl-av). Avatar styling
     lives on the shared .avatar component; pin uses .av-badge.br.navy. */
  .tl-row .tl-name {
    font-weight: 700; font-size: 14px; color: var(--text-primary);
    line-height: 20px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0; flex-shrink: 1;
  }
  .tl-row .tl-count {
    font-size: 12px; color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
  }
  .tl-row .tl-body {
    font-size: 12px; color: var(--text-secondary);
    line-height: 16px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
  }
  .tl-row .tl-time {
    font-size: 11px; color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  /* ---------- UserListItem (48px avatar · With dept/role · hover tooltip) ---------- */
  .uli-shell {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    overflow: hidden;
  }
  .uli-shell .uli-row + .uli-row { border-top: 1px solid var(--border-default); }

  .uli-row {
    position: relative;
    display: grid; grid-template-columns: 48px 1fr auto;
    gap: 12px; align-items: center;
    min-height: 88px; /* ステータス枠のある行に合わせて全行の高さを統一 */
    padding: 12px 16px;
    background: var(--bg-default);
    cursor: pointer;
    transition: background-color .12s ease;
  }
  .uli-row.hover,
  .uli-row:hover                { background: var(--brand-navy-50); }
  /* 面は 1.14 で素の面と区別できず、**hover と同じ色**なので、選択中は左バーで示す（DS-19）。 */
  .uli-row.active               { background: var(--brand-navy-50); box-shadow: inset 3px 0 0 0 var(--border-selected); }
  .uli-row.active.hover,
  .uli-row.active:hover         { background: var(--brand-navy-100); }

  .uli-row .uli-avatar {
    width: 48px; height: 48px; flex: none;
  }
  .uli-row .uli-text {
    min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
  }
  .uli-row .uli-name {
    font-family: var(--ff-sans);
    font-weight: 700; font-size: 16px; line-height: 24px;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .uli-row .uli-meta {
    font-size: 12px; line-height: 16px;
    color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* UserListItem のステータス吹き出し（.bubble-msg.is-sm.is-tail-tl と併用）
     尻尾は ::after で吹き出し外に飛び出すため overflow: visible が必須。
     文字列は bubble 自体の max-width で自然に省略される（長文は折返し or 2行許容）。 */
  .uli-row .uli-status {
    margin-top: 4px;
    align-self: flex-start;
    max-width: calc(100% - 12px); /* 尻尾分（左 10px + 余白）を確保 */
    margin-left: 12px;            /* 尻尾が親のボーダーを突き抜けないよう左にオフセット */
  }

  /* 密なバリアント。dropdown のように**多くの人をスクロールして探す**場所用。
     既定の 88px 統一は「ステータス枠のある行に合わせて全行を揃える」ためだが、
     60 人の一覧では 1 画面に 5 行しか入らない。
     詰める手は 2 つ: アバターを 40 に落とすことと、ステータスを部署・役職と同じ行に置くこと。
     ステータスを下に積むと、付いている人だけ行が伸びて一覧がガタつく。 */
  .uli-row.is-dense {
    grid-template-columns: 40px 1fr auto;
    /* 高さは固定して全行を揃える。ステータスの無い行は空の枠を残さず、
       `.uli-row` の align-items: center で中身を縦中央に置く
       （空枠を残すと上に詰まって下に余白だけが残り、行が傾いて見える）。 */
    min-height: 60px;
    padding: 8px 16px;
  }
  .uli-row.is-dense .uli-avatar { width: 40px; height: 40px; }
  .uli-row.is-dense .uli-name { font-size: 15px; line-height: 22px; }
  /* 氏名と部署・役職を 1 行にまとめ、ステータスの吹き出しを 2 行目に置く。
     ステータスを部署と同じ行に inline で置くと、しっぽが部署の文字を指してしまい
     「この人が言っている」意味が壊れる（吹き出しがただの pill に見える）。
     アバター 40px は 2 行ぶんをまたぐので、2 行目に置けばしっぽがアバターを指す。

     行の高さは metarow を 20px に固定して揃える。ステータスの有無で高さが変わると
     一覧がガタついてスクロールしながら読めなくなる。 */
  .uli-row.is-dense .uli-headline {
    display: flex; align-items: baseline; gap: 8px;
    min-width: 0;
  }
  .uli-row.is-dense .uli-headline > .uli-name { flex: 0 1 auto; min-width: 0; }
  /* 部署は縮んでよいが氏名は残す（誰か分からなくなるため）。 */
  .uli-row.is-dense .uli-headline > .uli-meta { flex: 0 1 auto; min-width: 0; }
  /* flex にするのは、中の吹き出しが inline-block で、行 box の descender ぶん
     4px 余計に高くなるため（ステータス付きの行だけ 64px になっていた）。 */
  .uli-row.is-dense .uli-metarow {
    display: flex; align-items: center;
    min-height: 20px; min-width: 0;
  }
  .uli-row.is-dense .uli-status { margin-top: 0; margin-left: 9px; }
  /* 吹き出しを 20px に収める（12/16 + 上下 2px）。
     **overflow は hidden にしない** — しっぽは ::after で吹き出しの外に出るので切られる
     （既存 `.uli-status` のコメントどおり）。省略は内側の要素でやる。 */
  .uli-row.is-dense .uli-status.bubble-msg {
    padding: 2px 10px;
    line-height: 16px;
    overflow: visible;
  }
  .uli-row .uli-status-text {
    display: block;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 組織パスのツールチップはアバターの右に出るので、40px 版では位置を詰める。 */
  .uli-row.is-dense .tt-pop { left: calc(16px + 40px + 12px); }

  /* Disabled variant */
  .uli-row.disabled,
  .uli-row.disabled:hover       { background: var(--bg-default); cursor: not-allowed; }
  .uli-row.disabled .uli-name,
  .uli-row.disabled .uli-meta   { color: var(--text-disabled); }
  .uli-row.disabled .uli-avatar .av-inner { opacity: .5; }
  .uli-row.disabled .uli-status { opacity: .5; }

  /* Hover dept-path tooltip — uses the shared Light Tooltip (.tt-pop) with left tail.
     Positioned just to the right of the avatar so the tail points back at the avatar
     and the popover overlays the name/meta stack. Visual tokens (radius, padding,
     shadow, tail) come from 02 — Components / Tooltips. */
  .uli-row .tt-pop {
    position: absolute;
    top: 50%;
    /* 16px row padding + 48px avatar + 12px gap from avatar */
    left: calc(16px + 48px + 12px);
    transform: translateY(-50%);
    z-index: 5;
    pointer-events: none;
    opacity: 0; transition: opacity .12s ease;
  }
  /* DeptPath gap inside the tooltip: 2px between crumb and name+role */
  .uli-row .tt-pop .tt-pop-body { gap: 2px; }

  /* Hover action chips on the right — gated by .has-menu */
  .uli-row .uli-actions {
    position: absolute; top: 50%; right: 12px;
    transform: translateY(-50%);
    z-index: 4;
    display: none;
  }
  .uli-row.has-menu.hover .uli-actions,
  .uli-row.has-menu:hover .uli-actions { display: inline-flex; }

  /* Show tooltip only for rows that actually have one, on hover */
  .uli-row.has-tt.hover .tt-pop,
  .uli-row.has-tt:hover .tt-pop { opacity: 1; }

  /* ---------- TeamList row ---------- */
  .tm-row {
    display: grid; grid-template-columns: 36px 1fr auto 20px;
    gap: 12px; align-items: center;
    padding: 14px 16px;
    background: var(--bg-default);
    cursor: default;
  }
  .tm-row.nested { padding-left: 40px; }
  .tm-row.nested.l2 { padding-left: 64px; }
  .tm-row.hover { background: var(--int-hover); }
  .tm-row.selected { background: var(--int-selected); box-shadow: inset 3px 0 0 0 var(--border-selected); }
  .tm-row .tm-ic {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--brand-navy-50); color: var(--brand-navy);
    display:flex; align-items:center; justify-content:center;
    flex-shrink: 0;
  }
  .tm-row .tm-ic svg { width: 16px; height: 16px; }
  .tm-row .tm-name {
    font-weight: 500; font-size: 14px; color: var(--text-primary);
    line-height: 20px;
  }
  .tm-row .tm-path { font-size: 11px; color: var(--text-tertiary); line-height: 14px; }
  .tm-row .tm-count {
    font-size: 12px; color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
  }
  .tm-row .tm-chev { color: var(--text-tertiary); width: 16px; height: 16px; }

  /* ---------- DropDown (inline select) ---------- */
  .dd-panel {
    display: inline-block;
    min-width: 220px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    padding: 6px 0;
  }
  .dd-item {
    display: grid; grid-template-columns: 20px 1fr 16px;
    gap: 8px; align-items: center;
    padding: 8px 12px;
    font-size: 13px; color: var(--text-primary);
    cursor: default;
  }
  .dd-item.hover { background: var(--brand-navy-50); }
  .dd-item.checked { color: var(--brand-navy); font-weight: 700; }
  .dd-item .dd-c { color: var(--brand-navy); width: 16px; height: 16px; display:inline-flex; }
  .dd-item .dd-tail { color: var(--text-tertiary); font-size: 11px; text-align: right; }

  /* ---------- 記事本文：デバイス別ブロック（RecogDevice） ---------- */
  /* 公開側ではタブに、**編集中は両方のペインを開いたまま**見せる。書いている最中は
     両方を見比べたいので、エディタで片方を隠すと邪魔になる。 */
  .recog-device {
    display: flex; flex-direction: column; gap: 12px;
    margin: 20px 0;
    padding: 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--r-6);
    background: var(--bg-subtle);
  }
  .recog-device-pane {
    position: relative;
    padding: 34px 14px 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--r-6);
    background: var(--bg-default);
  }
  /* 見出しは CSS で出す（モデルに置くと書き手が消せて、どちらのペインか分からない箱ができる）。 */
  .recog-device-pane::before {
    content: attr(data-label);
    position: absolute; top: 8px; left: 12px;
    font-size: 11px; font-weight: 700; letter-spacing: .04em;
    color: var(--brand-navy);
    background: var(--brand-navy-50);
    border-radius: 999px;
    padding: 2px 10px;
  }
  .recog-device-pane[data-device="app"]::before {
    color: var(--text-secondary);
    background: var(--gray-100);
  }

  /* ---------- 記事本文：ヒント / 注意の囲み（RecogCallout） ---------- */
  /* **読者側の `.hc-callout` と同じ意味・同じ色**にする（`help-brand.css`）。
     ヒント＝薄い黄、注意＝そのままだと失敗する警告なので赤（理由は `help-brand.css` 側）。
     地の濃さは 2 つとも同じ——片方だけ塗ると、並んだときに色のあるほうが先に読まれて
     読む順が中身と合わなくなる。 */
  .recog-callout {
    position: relative;
    margin: 20px 0;
    padding: 34px 16px 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--r-6);
    background: var(--bg-default);
  }
  /* 見出しは CSS で出す（モデルに置くと書き手が消せて、どちらの囲みか分からない箱ができる）。 */
  .recog-callout::before {
    content: attr(data-label);
    position: absolute; top: 8px; left: 14px;
    font-size: 11px; font-weight: 700; letter-spacing: .04em;
    border-radius: 999px;
    padding: 2px 10px;
  }
  .recog-callout[data-kind="hint"] {
    border-color: var(--banner-warning-border);
    background: var(--amber-25);
  }
  .recog-callout[data-kind="hint"]::before {
    color: var(--text-warning);
    background: var(--bg-default);
  }
  .recog-callout[data-kind="caution"] {
    border-color: var(--banner-danger-border);
    background: var(--hc-caution-bg);
  }
  .recog-callout[data-kind="caution"]::before {
    color: var(--text-danger);
    background: var(--bg-default);
  }
  /* **最後の行の下に余白を残さない**（囲みの padding が持つ）。 */
  .recog-callout__body > :last-child { margin-bottom: 0; }

  /* 期間プリセットの隣に出すカレンダー（DateRange inline）。ポップの中に入れるので、
     単体で出すときの影と余白を殺して 1 枚に見せる。 */
  .hp-period-cal { margin-right: 8px; }
  .hp-period-cal .cal-pop { position: static; }

  /* ---------- SelectBox ---------- */
  /* Trigger (閉じた状態の入力欄) */
  .sb-trigger {
    display: inline-flex; align-items: center; gap: 8px;
    width: 100%;
    font-family: inherit; font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-default);
    border: 1px solid var(--border-control);
    border-radius: var(--r-4);
    padding: 0 36px 0 12px;
    height: 40px;
    position: relative;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
    user-select: none;
  }
  /* 変更されたフィールドの淡い色付け（トグル/入力欄と同じ navy 系）。トリガー内側に着色。 */
  .sb-trigger.is-changed { background: var(--brand-navy-50); }
  /* エラー。**`.input.is-error` と同じ値**——同じフォームに並ぶので、欄の種類で赤の出方が
     変わると「こちらは別の意味の赤か」と読ませてしまう。 */
  .sb-trigger.is-error { border-color: var(--border-danger); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
  /* Compact SelectBox trigger — matches .input.sm */
  .sb-trigger.sm { height: 32px; font-size: 13px; padding: 0 30px 0 10px; }
  .sb-trigger.sm .sb-chev { right: 8px; }
  .sb-trigger .sb-ic {
    flex: 0 0 auto; width: 18px; height: 18px; color: var(--text-secondary);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .sb-trigger .sb-avatar { flex: 0 0 auto; }
  .sb-trigger .sb-value {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--text-primary);
    font-weight: 500;
  }
  /* アイコン+テキスト等のリッチな値（inline-flex）を縦中央に揃える（ellipsis は維持）。 */
  .sb-trigger .sb-value > * { vertical-align: middle; }
  .sb-trigger .sb-value.is-placeholder { color: var(--text-placeholder); font-weight: 400; }
  /* `countOnly`: the filter's name, then how many are picked. */
  .sb-trigger .sb-value .sb-count { margin-left: 6px; }
  .sb-trigger .sb-chev {
    position: absolute;
    right: 10px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--text-tertiary);
    pointer-events: none;
    transition: transform .12s ease, color .12s ease;
  }
  .sb-trigger:hover { border-color: var(--border-strong); }
  .sb-trigger:hover .sb-chev { color: var(--text-secondary); }
  .sb-trigger:focus,
  .sb-trigger.is-focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 25, 81, .12);
  }
  .sb-trigger.is-open {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 25, 81, .12);
  }
  .sb-trigger.is-open .sb-chev {
    transform: translateY(-50%) rotate(180deg);
    color: var(--brand-navy);
  }
  .sb-trigger.is-error {
    border-color: var(--border-danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
  }
  .sb-trigger.is-readonly {
    background: var(--bg-subtle);
    cursor: default;
    border-color: var(--border-default);
    box-shadow: none;
  }
  .sb-trigger.is-readonly .sb-chev { display: none; }
  .sb-trigger[disabled],
  .sb-trigger.is-disabled {
    background: var(--int-disabled);
    color: var(--text-disabled);
    border-color: var(--border-default);
    cursor: not-allowed;
    box-shadow: none;
  }
  .sb-trigger.is-disabled .sb-value,
  .sb-trigger.is-disabled .sb-ic,
  .sb-trigger.is-disabled .sb-chev { color: var(--text-disabled); }

  /* Size variants */
  .sb-trigger.s-compact { height: 32px; font-size: 13px; padding: 0 30px 0 10px; border-radius: 6px; }
  .sb-trigger.s-compact .sb-chev { right: 8px; width: 16px; height: 16px; }
  .sb-trigger.s-compact .sb-ic { width: 16px; height: 16px; }
  .sb-trigger.s-large { height: 48px; font-size: 15px; padding: 0 40px 0 14px; border-radius: 10px; }
  .sb-trigger.s-large .sb-chev { right: 12px; width: 20px; height: 20px; }
  .sb-trigger.s-large .sb-ic { width: 20px; height: 20px; }

  /* Multi-select chips */
  .sb-trigger.is-multi {
    height: auto;
    min-height: 40px;
    padding: 5px 36px 5px 6px;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
  }
  .sb-trigger.is-multi.s-compact { min-height: 32px; padding: 3px 30px 3px 4px; }
  .sb-trigger.is-multi.s-large { min-height: 48px; padding: 7px 40px 7px 8px; }
  .sb-trigger.is-multi .sb-value { display: none; }
  .sb-trigger.is-multi.is-empty .sb-value {
    display: block; flex: 1 1 auto;
    color: var(--text-placeholder); font-weight: 400;
    padding-left: 6px;
  }
  .sb-chip {
    display: inline-flex; align-items: center; gap: 4px;
    height: 24px; padding: 0 4px 0 8px;
    background: var(--brand-navy-50);
    color: var(--brand-navy);
    font-size: 12px; font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
  }
  .sb-chip .sb-chip-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    border-radius: 4px;
    color: var(--brand-navy);
    cursor: pointer;
  }
  .sb-chip .sb-chip-x:hover { background: rgba(0, 25, 81, .12); }
  .sb-chip .sb-chip-x .ic { width: 12px; height: 12px; }

  /* Popover panel (dropdown本体) */
  .sb-pop {
    background: var(--bg-default); /* トークンで塗る（#fff 直書きはダークで白いまま浮く） */
    border: 1px solid var(--border-default);
    border-radius: 10px;
    box-shadow: var(--shadow-8);
    padding: 0;
    min-width: 240px;
    max-width: 420px;
    max-height: min(320px, var(--pop-avail, 320px));
    display: flex; flex-direction: column;
    font-size: 14px;
    overflow: hidden;
  }
  .sb-pop[hidden] { display: none; }
  .sb-pop.is-anchored {
    /* Standalone presentation: 吹き出しの位置関係を説明 */
    margin-top: 6px;
  }
  /* 検索入力 */
  .sb-search {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px 8px;
    border-bottom: 1px solid var(--border-default);
  }
  .sb-search .ic { flex: 0 0 auto; width: 16px; height: 16px; color: var(--text-tertiary); }
  .sb-search input {
    flex: 1 1 auto;
    border: 0; outline: none; background: transparent;
    font-family: inherit; font-size: 13px;
    color: var(--text-primary);
    padding: 2px 0;
  }
  .sb-search input::placeholder { color: var(--text-placeholder); }

  /* List */
  .sb-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0;
  }
  /* カテゴリ区切り（Google フォームのタイプ選択風） */
  .sb-divider { height: 1px; background: var(--border-default); margin: 4px 0; }
  .sb-group-label {
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 10px 14px 6px;
  }
  .sb-group-label:first-child { padding-top: 8px; }
  .sb-opt {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    gap: 10px; align-items: center;
    padding: 8px 12px;
    color: var(--text-primary);
    cursor: default;
    position: relative;
  }
  .sb-opt:hover,
  .sb-opt.is-hover { background: var(--brand-navy-50); }
  .sb-opt.is-focus { background: var(--brand-navy-50); }
  /* いま指している候補（`aria-activedescendant`）。**フォーカスはトリガーに残る**ので、
     ここを塗らないと「いまどれを指しているか」が画面から分からない（known-issues DS-20）。 */
  .sb-opt.is-active { background: var(--brand-navy-50); }
  /* 左端の帯は**キーで動かしたときだけ**。ポインタで乗っているだけの候補に帯が出ると、
     hover が「選ばれている」に見える（`is-keyed` は SelectBox が付ける）。 */
  .sb-opt.is-active.is-keyed { box-shadow: inset 3px 0 0 var(--brand-navy); }
  .sb-opt.is-selected { color: var(--brand-navy); font-weight: 700; }
  .sb-opt .sb-check {
    width: 16px; height: 16px;
    color: var(--brand-navy);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .sb-opt .sb-check .ic { width: 16px; height: 16px; }
  .sb-opt:not(.is-selected) .sb-check { visibility: hidden; }
  .sb-opt .sb-opt-ic {
    width: 18px; height: 18px;
    color: var(--text-secondary);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .sb-opt.is-selected .sb-opt-ic { color: var(--brand-navy); }
  .sb-opt .sb-opt-label {
    min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sb-opt .sb-opt-sub {
    font-size: 12px; color: var(--text-tertiary);
    font-weight: 400;
    margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sb-opt.is-selected .sb-opt-sub { color: var(--brand-navy-600, var(--brand-navy)); opacity: .8; font-weight: 500; }
  .sb-opt .sb-opt-body { display: flex; flex-direction: column; min-width: 0; }
  /* 説明を縦積みする場合（label の下に sub）は折返して全文を見せる */
  .sb-opt .sb-opt-body .sb-opt-sub { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; }
  .sb-opt .sb-opt-tail {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: var(--ff-mono);
    letter-spacing: .02em;
  }
  .sb-opt.is-disabled { color: var(--text-disabled); cursor: not-allowed; }
  .sb-opt.is-disabled .sb-opt-ic { color: var(--text-disabled); }

  /* Server-searched list whose rows are a result for text that has since changed. Dimmed, not
     emptied: the rows are the only thing holding the popup's height, and a popup that collapses
     and grows again on every keystroke is harder to use than slightly stale rows.
     `pointer-events` stays on — picking a row that is still correct should not have to wait. */
  .sb-list.is-stale { opacity: .45; }
  @media (prefers-reduced-motion: no-preference) {
    .sb-list { transition: opacity .12s ease-out; }
  }

  /* A row that is not a choice (loading / nothing matched). Same left inset as `.sb-opt` but
     muted — at the weight of a selectable row it reads as something you can click. */
  .sb-msg {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-tertiary);
  }
  /* What the page left out ("ほか N 件") goes *below* the list, not in it: mixed into the rows it
     reads as the last choice. */
  .sb-note {
    /* `.sb-pop` is a flex column whose list takes the slack — hold this line at its own height
       instead of letting a long list squeeze it away. */
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-default);
  }

  /* Multi-select option: check列を checkbox に置き換え */
  .sb-opt.is-checkbox .sb-check {
    visibility: visible;
    width: 16px; height: 16px;
    border-radius: 3px;
    border: 1.5px solid var(--border-control);
    background: var(--bg-default);
    color: transparent;
  }
  .sb-opt.is-checkbox.is-selected .sb-check {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: var(--text-on-fill);
  }

  /* Avatar row (オプション内) */
  .sb-opt .avatar { flex: 0 0 auto; }

  /* States (empty, loading) */
  .sb-empty,
  .sb-loading {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px;
    padding: 28px 16px;
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
  }
  .sb-empty .ic,
  .sb-loading .ic { width: 20px; height: 20px; color: var(--text-tertiary); }
  .sb-loading .sb-spinner {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-default);
    border-top-color: var(--brand-navy);
    animation: sb-spin .8s linear infinite;
  }
  @keyframes sb-spin {
    to { transform: rotate(360deg); }
  }

  /* Inline static demonstration layout (SB stage) */
  .sb-stage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
  }
  .sb-stage-grid .field { margin: 0; }
  .sb-stage-open {
    display: flex; flex-direction: column; gap: 6px;
    align-items: flex-start;
  }

  /* ---------- Calendar ---------- */
  .cal-pop {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    box-shadow: var(--shadow-8);
    padding: 12px;
    width: 280px;
    display: flex; flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
  }
  .cal-pop[hidden] { display: none; }
  .cal-pop.s-compact { width: 248px; padding: 10px; gap: 6px; font-size: 12px; }

  /* Header */
  .cal-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    padding: 2px 4px;
  }
  .cal-head-label {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 14px; font-weight: 700;
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    border: 0;
  }
  .cal-head-label:hover { background: var(--brand-navy-50); color: var(--brand-navy); }
  .cal-head-label .chev { width: 14px; height: 14px; color: var(--text-tertiary); }
  .cal-head-nav { display: inline-flex; gap: 2px; }
  .cal-nav-btn {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 0; background: transparent;
    color: var(--text-secondary);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
  }
  .cal-nav-btn:hover { background: var(--brand-navy-50); color: var(--brand-navy); }
  .cal-nav-btn[disabled] { color: var(--text-disabled); cursor: not-allowed; }
  .cal-nav-btn[disabled]:hover { background: transparent; color: var(--text-disabled); }
  .cal-nav-btn .ic { width: 16px; height: 16px; }

  /* Weekday row */
  .cal-week {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 0;
    padding: 0 2px;
  }
  .cal-week > span {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    padding: 4px 0;
    letter-spacing: 0.02em;
  }
  .cal-week .cal-w-sun { color: var(--red-500); }
  .cal-week .cal-w-sat { color: var(--brand-navy-600, var(--brand-navy)); }

  /* Grid of days */
  .cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 0 2px;
  }
  .cal-day {
    position: relative;
    aspect-ratio: 1;
    min-height: 32px;
    border: 0; background: transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
    transition: background .1s ease, color .1s ease;
  }
  .cal-pop.s-compact .cal-day { font-size: 12px; min-height: 28px; }
  .cal-day:hover { background: var(--brand-navy-50); color: var(--brand-navy); }
  .cal-day.is-outside { color: var(--text-disabled); font-weight: 400; }
  .cal-day.is-outside:hover { background: var(--brand-navy-50); color: var(--brand-navy); }
  .cal-day.is-sun { color: var(--red-500); }
  .cal-day.is-sat { color: var(--brand-navy-600, var(--brand-navy)); }
  .cal-day.is-holiday { color: var(--red-500); }
  /* 範囲外（前後月）の日付は土日・祝日でも一律で薄くする（muting を優先） */
  .cal-day.is-outside.is-sun,
  .cal-day.is-outside.is-sat,
  .cal-day.is-outside.is-holiday { color: var(--text-disabled); }
  .cal-day.is-today {
    background: var(--brand-navy-50);
    color: var(--brand-navy);
    font-weight: 700;
  }
  .cal-day.is-today::after {
    content: "";
    position: absolute;
    left: 50%; bottom: 3px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--brand-navy);
    transform: translateX(-50%);
  }
  .cal-day.is-selected,
  .cal-day.is-selected:hover {
    background: var(--brand-navy);
    color: var(--text-on-fill);
    font-weight: 700;
  }
  .cal-day.is-selected::after { display: none; }
  .cal-day.is-disabled,
  .cal-day.is-disabled:hover {
    color: var(--text-disabled);
    background: transparent;
    cursor: not-allowed;
    text-decoration: line-through;
    text-decoration-color: var(--border-default);
  }
  .cal-day .cal-dot {
    position: absolute;
    left: 50%; bottom: 3px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--brand-navy);
    transform: translateX(-50%);
  }
  .cal-day.is-selected .cal-dot { background: var(--bg-default); }
  .cal-day .cal-badge {
    position: absolute;
    top: 2px; right: 2px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--magenta-500);
    box-shadow: 0 0 0 1.5px var(--bg-default);
  }
  .cal-day.is-selected .cal-badge { box-shadow: 0 0 0 1.5px var(--brand-navy); }

  /* Range selection */
  .cal-grid.is-range {
    gap: 0;
    padding: 0;
  }
  .cal-grid.is-range .cal-day { border-radius: 0; }
  .cal-grid.is-range .cal-day.is-in-range {
    background: var(--brand-navy-50);
    color: var(--brand-navy);
  }
  .cal-grid.is-range .cal-day.is-range-start,
  .cal-grid.is-range .cal-day.is-range-end {
    background: var(--brand-navy);
    color: var(--text-on-fill);
    font-weight: 700;
  }
  .cal-grid.is-range .cal-day.is-range-start { border-radius: 6px 0 0 6px; }
  .cal-grid.is-range .cal-day.is-range-end { border-radius: 0 6px 6px 0; }
  .cal-grid.is-range .cal-day.is-range-single { border-radius: 6px; background: var(--brand-navy); color: var(--text-on-fill); font-weight: 700; }

  /* Footer (action buttons) */
  .cal-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid var(--border-default);
  }
  .cal-foot .cal-today-btn {
    font-size: 12px; font-weight: 600;
    color: var(--brand-navy);
    background: transparent;
    border: 0;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
  }
  .cal-foot .cal-today-btn:hover { background: var(--brand-navy-50); }

  /* DatePicker input trigger */
  .dp-trigger {
    display: inline-flex; align-items: center; gap: 8px;
    width: 100%;
    font-family: inherit; font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-default);
    border: 1px solid var(--border-control);
    border-radius: var(--r-4);
    padding: 0 12px;
    height: 40px;
    cursor: pointer;
    text-align: left;
    transition: border-color .12s ease, box-shadow .12s ease;
  }
  /* Compact size — for inline toolbar use (matches .sb-trigger.sm at 32px) */
  .dp-trigger.sm { width: auto; height: 32px; font-size: 13px; padding: 0 10px; gap: 6px; }
  .dp-trigger.sm .dp-ic,
  .dp-trigger.sm .dp-chev { width: 14px; height: 14px; }
  .dp-trigger:hover { border-color: var(--border-strong); }
  .dp-trigger.is-focus,
  .dp-trigger:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 25, 81, .12);
  }
  .dp-trigger.is-open {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 25, 81, .12);
  }
  .dp-trigger .dp-ic {
    flex: 0 0 auto; width: 18px; height: 18px;
    color: var(--text-secondary);
  }
  .dp-trigger .dp-value { flex: 1 1 auto; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dp-trigger .dp-value.is-placeholder { color: var(--text-placeholder); font-weight: 400; }
  .dp-trigger .dp-chev {
    flex: 0 0 auto; width: 16px; height: 16px;
    color: var(--text-tertiary);
  }
  .dp-trigger.is-error { border-color: var(--border-danger); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
  .dp-trigger.is-disabled,
  .dp-trigger[disabled] {
    background: var(--int-disabled);
    color: var(--text-disabled);
    cursor: not-allowed;
  }
  .dp-trigger.is-disabled .dp-ic,
  .dp-trigger.is-disabled .dp-value,
  .dp-trigger.is-disabled .dp-chev { color: var(--text-disabled); }

  /* ---------- DateField ----------
     打てる日付入力。DatePicker（押すとカレンダーが出るボタン）と並ぶもので、
     こちらは入力欄そのもの＋右端のカレンダーボタン。枠・高さ・フォーカスの出方は
     .dp-trigger と同じ値にそろえる（同じフォームに並んだときに段差を作らない）。 */
  .df-field {
    display: inline-flex; align-items: center; gap: 4px;
    width: 100%;
    background: var(--bg-default);
    border: 1px solid var(--border-control);
    border-radius: var(--r-4);
    height: 40px;
    padding: 0 4px 0 12px;
    transition: border-color .12s ease, box-shadow .12s ease;
  }
  .df-field:hover { border-color: var(--border-strong); }
  .df-field.is-focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 25, 81, .12);
  }
  .df-field.is-error { border-color: var(--border-danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
  .df-field.is-disabled { background: var(--int-disabled); cursor: not-allowed; }
  /* 編集で値が変わった印。入力欄の「中」を塗る（.sb-trigger.is-changed と同じ扱い）。
     外から style で背景を当てても .df-field 自身の地色に隠れるので、クラスで受ける。 */
  .df-field.is-changed { background: var(--brand-navy-50); }
  .df-field .df-input {
    flex: 1 1 auto; min-width: 0;
    border: 0; background: transparent; outline: none;
    font-family: inherit; font-size: 14px; color: var(--text-primary);
    /* 桁を揃える——日付は縦に並べて読み比べるもの。 */
    font-variant-numeric: tabular-nums;
    padding: 0;
  }
  .df-field .df-input::placeholder { color: var(--text-placeholder); }
  .df-field.is-disabled .df-input { color: var(--text-disabled); cursor: not-allowed; }
  /*
   * カレンダーのボタンは**枠の中に浮かせる**（線でも地でも区切らない。2026-10-20、指示）。
   *
   * 一度「押せる感じがしない」という指摘を受けて、入力欄と線で分けて地を敷いた帯にしたが、
   * **その前の形に戻すことになった**（同じ日に指示）。押せることは hover の敷きで示す。
   */
  .df-field .df-btn {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border: 0; background: transparent; border-radius: var(--r-4);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .1s ease;
  }
  .df-field .df-btn:hover { background: var(--int-hover); }
  .df-field .df-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--border-focus); }
  .df-field .df-btn .ic { width: 18px; height: 18px; }
  .df-field.is-disabled .df-btn { color: var(--text-disabled); cursor: not-allowed; }
  /* 小（ツールバーに並べるとき。.dp-trigger.sm / .sb-trigger.sm と同じ 32px） */
  .df-field.sm { height: 32px; padding: 0 2px 0 10px; }
  .df-field.sm .df-input { font-size: 13px; }
  .df-field.sm .df-btn { width: 26px; height: 26px; }
  .df-field.sm .df-btn .ic { width: 14px; height: 14px; }

  /* ---------- CollapsibleCard ----------
     設定セクションを「見出し＋現在値サマリの1行」に畳むカード。編集時だけ body を展開。
     設定が多い編集画面で縦長を抑える。 */
  .collapse-card {
    background: var(--bg-default);
    border: 1px solid var(--border-strong);   /* グレー地のキャンバスに対し白カードをくっきり */
    border-radius: 12px;
    scroll-margin-top: 80px;
  }
  .collapse-card__head {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 16px 20px;
    background: none; border: 0; font: inherit; text-align: left;
    border-radius: 12px;
    cursor: pointer;
    transition: background .12s ease;
  }
  .collapse-card__head:hover { background: var(--int-hover); }
  .collapse-card.is-open .collapse-card__head { padding-bottom: 8px; cursor: pointer; }
  .collapse-card.is-open .collapse-card__head:hover { background: none; }
  .collapse-card.is-static .collapse-card__head { cursor: default; }
  /* svg.lucide (0,1,1) の width:100% に勝つため子孫セレクタ(0,2,0)で指定 */
  .collapse-card__head .collapse-card__chev {
    width: 18px; height: 18px; flex: none;
    color: var(--text-tertiary);
    transition: transform .15s ease;
  }
  .collapse-card.is-open .collapse-card__chev { transform: rotate(180deg); }
  .collapse-card__title { font-size: 14px; font-weight: 700; color: var(--text-primary); flex: none; }
  .collapse-card__summary {
    margin-left: auto; min-width: 0;
    font-size: 13px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .collapse-card__body { padding: 0 20px 20px; }

  /* DateRange button trigger */
  .dr-trigger {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 0 14px;
    height: 40px;
    border-radius: var(--r-4);
    background: var(--bg-default);
    border: 1px solid var(--border-control);
    font-family: inherit; font-size: 14px; font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
  }
  /* 日付は折り返さない。英語の "Jun 2, 2025" のように空白を含む表記だと、幅が足りないときに
     セグメントの途中で改行され、高さ 40px 固定の枠から文字がはみ出す（日本語の 2025/06/02 は
     空白が無いので起きず、英語・ベトナム語だけで出る崩れ方だった）。
     flex: none も併せて指定し、行が詰まったときは枠ごと折り返させる（中の文字を潰さない）。 */
  .dr-trigger { flex: none; white-space: nowrap; }
  .dr-trigger .dr-seg { white-space: nowrap; }
  .dr-trigger:hover { border-color: var(--text-tertiary); }
  .dr-trigger .dr-ic { width: 16px; height: 16px; color: var(--text-primary); }
  .dr-trigger .dr-sep { color: var(--text-tertiary); font-weight: 400; }
  /* 開始/終了セグメント：それぞれ独立に hover */
  .dr-trigger .dr-seg {
    border: 0; background: transparent; font: inherit; color: inherit;
    padding: 3px 8px; border-radius: 6px; cursor: pointer;
  }
  .dr-trigger .dr-seg:hover { background: var(--brand-navy-50); color: var(--brand-navy); }
  .dr-trigger .dr-chev { width: 16px; height: 16px; color: var(--text-primary); margin-left: 2px; }

  /* Double calendar (range) */
  .cal-pop.is-range {
    width: auto;
    padding: 14px;
    gap: 12px;
  }
  .cal-duo {
    display: flex; gap: 20px;
    align-items: flex-start;
  }
  .cal-duo > .cal-panel { width: 252px; display: flex; flex-direction: column; gap: 8px; }
  .cal-range-summary {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: var(--text-secondary);
    padding: 2px 4px 0;
  }
  .cal-range-summary .cal-range-val {
    font-size: 13px; font-weight: 700; color: var(--text-primary);
    font-family: var(--ff-mono);
    padding: 3px 8px;
    background: var(--brand-navy-50);
    color: var(--brand-navy);
    border-radius: 6px;
  }
  .cal-range-summary .cal-range-dash { color: var(--text-tertiary); }
  /* 編集中の境界（クリックで日付クリックの対象が start/end 切替） */
  .cal-range-summary .cal-range-val.is-active { box-shadow: 0 0 0 2px var(--brand-navy); }
  .cal-range-summary .cal-range-val:hover { background: var(--brand-navy-100); }

  /* Year/Month ピッカーのドロップダウン（カレンダー上に重ねる） */
  .cal-picker-overlay {
    position: absolute; inset: 0; z-index: 5;
    background: color-mix(in srgb, var(--bg-default) 55%, transparent);
    border-radius: 12px;
  }
  .cal-picker-pop {
    position: absolute; top: 0;
    width: 260px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    box-shadow: var(--shadow-8);
    padding: 12px;
    display: flex; flex-direction: column; gap: 8px;
  }

  /* Year/month picker overlay in header */
  .cal-picker {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 4px 0;
  }
  .cal-picker button {
    padding: 8px 0;
    border: 0; background: transparent;
    border-radius: 6px;
    font-family: inherit; font-size: 13px; font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
  }
  .cal-picker button:hover { background: var(--brand-navy-50); color: var(--brand-navy); }
  .cal-picker button.is-selected { background: var(--brand-navy); color: var(--text-on-fill); font-weight: 700; }
  .cal-picker button[disabled] { color: var(--text-disabled); cursor: not-allowed; }
  .cal-picker button[disabled]:hover { background: transparent; color: var(--text-disabled); }

  /* Inline mini calendar (TalkList横) */
  .cal-mini {
    display: flex; flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    width: 236px;
    font-size: 12px;
  }
  .cal-mini .cal-head { padding: 0 2px; }
  .cal-mini .cal-head-label { font-size: 13px; padding: 2px 6px; }
  .cal-mini .cal-nav-btn { width: 24px; height: 24px; }
  .cal-mini .cal-week > span { font-size: 10px; padding: 2px 0; }
  .cal-mini .cal-grid { gap: 1px; }
  .cal-mini .cal-day { font-size: 11px; min-height: 26px; border-radius: 4px; }

  /* MonthView (big event calendar) */
  .cal-month {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    overflow: hidden;
  }
  .cal-month-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-default);
    background: var(--bg-subtle);
  }
  .cal-month-head .cal-month-title {
    font-size: 18px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .cal-month-head .cal-month-title .chev { width: 16px; height: 16px; color: var(--text-tertiary); }
  .cal-month-week {
    display: grid; grid-template-columns: repeat(7, 1fr);
  }
  .cal-month-week > div {
    padding: 10px 12px;
    font-size: 12px; font-weight: 700;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-default);
    text-align: left;
  }
  .cal-month-week .cal-w-sun { color: var(--red-500); }
  .cal-month-week .cal-w-sat { color: var(--brand-navy-600, var(--brand-navy)); }
  .cal-month-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(108px, 1fr);
  }
  .cal-month-cell {
    border-right: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
    padding: 6px 8px;
    display: flex; flex-direction: column;
    gap: 4px;
    min-height: 108px;
    background: var(--bg-default);
    position: relative;
  }
  .cal-month-cell:nth-child(7n) { border-right: 0; }
  .cal-month-grid > .cal-month-cell:nth-last-child(-n+7) { border-bottom: 0; }
  .cal-month-cell.is-outside { background: var(--bg-subtle); }
  .cal-month-cell.is-outside .cal-month-num { color: var(--text-disabled); }
  .cal-month-num {
    font-size: 13px; font-weight: 600;
    color: var(--text-primary);
    padding: 2px 4px;
    align-self: flex-start;
  }
  .cal-month-cell.is-sun .cal-month-num { color: var(--red-500); }
  .cal-month-cell.is-sat .cal-month-num { color: var(--brand-navy-600, var(--brand-navy)); }
  .cal-month-cell.is-holiday .cal-month-num { color: var(--red-500); }
  .cal-month-cell.is-today .cal-month-num {
    background: var(--brand-navy);
    color: var(--text-on-fill);
    min-width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700;
    padding: 0 6px;
  }
  .cal-month-cell .cal-ev {
    display: flex; align-items: center; gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-on-fill);
    background: var(--brand-navy);
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .cal-month-cell .cal-ev.is-magenta { background: var(--fill-magenta); }
  .cal-month-cell .cal-ev.is-teal { background: var(--fill-success); }
  .cal-month-cell .cal-ev.is-amber { background: var(--fill-warning); color: var(--text-on-warning); }
  .cal-month-cell .cal-ev.is-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px dashed var(--border-strong);
  }
  .cal-month-cell .cal-ev-more {
    font-size: 11px; color: var(--text-tertiary);
    padding: 0 6px;
    cursor: pointer;
  }
  .cal-month-cell .cal-ev-more:hover { color: var(--brand-navy); }

  /* ---------- DateOfBirth field ----------
     Year: 4-digit <input>. Month / Day: SelectBox.
     Each control is followed by a 年/月/日 unit label.
     Horizontal row, no wrap. Error state applies to all 3 controls at once. */
  .dob-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .dob-year,
  .dob-sel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }
  .dob-year .input {
    width: 80px;
    text-align: center;
    font-family: var(--ff-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    padding: 0 10px;
  }
  .dob-sel .sb-trigger {
    width: 72px;
    padding: 0 28px 0 12px;
    text-align: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
  }
  .dob-sel .sb-trigger .sb-value {
    text-align: center;
    flex: 1 1 auto;
  }
  .dob-sel .sb-trigger.s-compact {
    width: 60px;
    padding: 0 24px 0 8px;
  }
  .dob-unit {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    flex: 0 0 auto;
  }
  .dob-row.s-compact .dob-unit {
    font-size: 12px;
  }

  /* ---------- SettingsMenu item ---------- */
  .sm-panel {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 6px;
    display: flex; flex-direction: column; gap: 2px;
  }
  .sm-item {
    display: grid; grid-template-columns: auto 1fr auto;
    gap: 12px; align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    background: transparent;
    cursor: default;
    color: var(--text-primary);
    /* <button class="sm-item"> でもネイティブ枠・中央寄せ・UAフォントが出ないようリセット */
    appearance: none; -webkit-appearance: none;
    border: 0; font: inherit; text-align: left;
  }
  /*
    **押せる行だけカーソルを変える**（2026-09-24、指摘）。`SmItem` は押せないときだけ
    `<div>` で描かれるので、`button` / `a` / `role="button"` を狙えば「押せる行」と一致する。
    既定の `cursor: default` は、読むだけの行（見出しや値だけの行）のために残す。
  */
  button.sm-item:not(:disabled),
  a.sm-item,
  .sm-item[role="button"] { cursor: pointer; }
  .sm-item:hover,
  .sm-item.hover    { background: var(--brand-navy-50); }
  .sm-item.active   { background: var(--brand-navy); color: var(--text-on-fill); }
  .sm-item.active .sm-ic,
  .sm-item.active .sm-tail,
  .sm-item.active .sm-tail .chev,
  .sm-item.active .sm-value,
  .sm-item.active .sm-desc { color: var(--text-on-fill); }
  .sm-item.disabled { color: var(--text-disabled); cursor: not-allowed; }
  .sm-item.disabled .sm-ic,
  .sm-item.disabled .sm-tail,
  .sm-item.disabled .sm-tail .chev { color: var(--text-disabled); }
  .sm-item.danger { color: var(--red-500); }
  .sm-item.danger .sm-ic { color: var(--red-500); }
  .sm-item .sm-ic {
    width: 20px; height: 20px; color: var(--text-secondary);
    display:inline-flex; align-items:center; justify-content:center;
  }
  .sm-item .sm-label { font-size: 14px; color: inherit; line-height: 20px; display: block; }
  .sm-item .sm-desc { font-size: 12px; color: var(--text-secondary); line-height: 16px; margin-top: 2px; display: block; }
  .sm-item .sm-tail {
    display:flex; align-items:center; gap: 8px;
    color: var(--text-tertiary); font-size: 12px;
  }
  .sm-item .sm-tail .chev { width: 16px; height: 16px; }
  /* `.sm-badge` は `.badge` に統合した（2026-09-02）。 */
  /*
    **丸を付けない件数**（2026-09-29、依頼）。バッジの意味は 2 つ（赤＝相手が待っている /
    navy＝ただの件数）だが、自分の下書き・送信予約は**誰も待っていない**ので、丸そのものを
    外す。丸が付いている行＝相手が待っている行、という見分けが残る。
    色と大きさは `.sm-tail`（`--text-tertiary` / 12px）のまま。桁が変わっても行が
    ずれないよう数字だけ揃える。**グレーの丸にはしない**——グレーの面はこの製品では
    「無効」の色（`--int-disabled`）なので、押せない行に見える。
  */
  .sm-item .sm-count { font-variant-numeric: tabular-nums; }
  .sm-item .sm-value {
    color: var(--text-primary); font-weight: 500;
  }

  /* Reward/Point highlight row */
  .sm-item.reward {
    background: linear-gradient(90deg, var(--amber-50) 0%, var(--bg-default) 60%);
  }
  .sm-item.reward .sm-ic {
    background: var(--fill-warning); color: var(--text-on-warning); border-radius: 8px; padding: 2px;
  }
  .sm-item.points .sm-ic {
    background: var(--brand-navy); color: var(--text-on-fill); border-radius: 8px; padding: 2px;
  }

  /* ---------- GroupTitle (.gt) — group header for menus ----------
     設定メニュー / SubPanel / SettingsMenu などで「会社設定」「個人設定」
     のように項目をグルーピングする見出し行。
     必要バリアント:
       (1) Title only        — 装飾なし、ラベルのみ
       (2) Title + collapse  — 折りたたみ chevron
       (3) Title + plus      — 追加ボタン
       (4) Title + search    — 虫眼鏡ボタン
       (5) Title + plus + search — 追加 + 検索を併置
     アクションボタンは複数並べられる。並び順は左→右で
     plus → search → collapse を推奨（操作頻度の低いものほど右）。
     サイズ: .is-s / .is-m
     --------------------------------------------------------------- */
  .gt {
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    color: var(--text-primary);
  }
  /* 畳める見出しは**行そのものがボタン**。素のボタンの見た目を落として `.gt` に揃える。 */
  .gt.is-toggle {
    width: 100%;
    border: 0; background: none;
    font: inherit; color: inherit; text-align: left;
  }
  .gt.is-toggle:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: -2px; }
  .gt.is-toggle .gt-label { cursor: pointer; }
  /* Sizes ------------------------------------------------- */
  .gt.is-s {
    padding: 6px 12px;
    font-family: var(--ff-display);
    font-size: 11px;
    line-height: 16px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
  }
  .gt.is-m {
    padding: 8px 12px;
    font-family: var(--ff-display);
    font-size: 14px;
    line-height: 20px;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: var(--text-primary);
  }
  /* Label — flex-grows so trailing icon button hugs the right */
  .gt-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
    /* **畳める見出しでは文字も押せる**（2026-09-24、指摘）。行ぜんぶがボタンなのに
       ラベルの上だけ矢印のカーソルだと、押せるのは矢印だけに見える。 */
  }
  /* Trailing icon button — shared chrome for collapse / plus / search.
     The icon swap is markup-driven; the button itself is identical. */
  .gt-action,
  .gt-collapse {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    color: var(--text-tertiary);
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    flex: none;
  }
  /* 矢印は**向きを示すだけ**になった（押せるのは行そのもの）ので、単体では反応させない。 */
  .gt.is-toggle:hover .gt-collapse { color: var(--text-secondary); }
  .gt-action:hover {
    background: rgba(0, 25, 81, 0.06);
    color: var(--text-secondary);
  }
  .gt-action:focus-visible {
    outline: 2px solid var(--brand-navy);
    outline-offset: 1px;
  }
  .gt-action .lucide,
  .gt-action svg,
  .gt-collapse .lucide,
  .gt-collapse svg { width: 16px; height: 16px; }
  /* Collapse chevron rotates on .gt.is-collapsed */
  .gt-collapse .lucide,
  .gt-collapse svg { transition: transform .18s ease; }
  .gt.is-collapsed .gt-collapse .lucide,
  .gt.is-collapsed .gt-collapse svg { transform: rotate(-90deg); }
  /* Collapsible body — the wrapping panel is responsible for
     hiding when .gt.is-collapsed sets max-height=0. */
  .gt + .gt-body {
    overflow: hidden;
    transition: max-height .25s ease, opacity .15s ease;
  }
  .gt.is-collapsed + .gt-body {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
  }

  /* ============================================================
     SettingsRow (.sr-list / .sr-row) — config screen row.
     Left: label + (optional) description. Right: control (switch / button / value+chev).
     Stacked rows in a single card with 1px dividers between.
     ============================================================ */
  .sr-list {
    background: var(--bg-default);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-8);
    /* overflow:hidden にすると行内アイコンの tooltip が見切れるため visible。
       角丸は first/last child を丸めて維持する。 */
  }
  .sr-list > :first-child { border-top-left-radius: var(--r-8); border-top-right-radius: var(--r-8); }
  .sr-list > :last-child  { border-bottom-left-radius: var(--r-8); border-bottom-right-radius: var(--r-8); }
  .sr-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-default);
    min-height: 64px;
  }
  .sr-row:first-child { border-top: 0; }
  /* 縦積み行（.stack）：ラベル＋説明の下に幅いっぱいの操作領域（textarea・メンバー一覧・同期ツリー等）。
     .sr-row の align-items:center だと中央寄せで崩れるため stretch にして左揃え＆全幅にする。 */
  .sr-row.stack { flex-direction: column; align-items: stretch; gap: 10px; }
  .sr-row.stack .sr-tail { width: 100%; }
  /* 横一列のまま操作領域を広げる行（.wide-tail）：ラベル列を固定幅にして、残り全部をコントロールに渡す。
     長い URL・PEM 証明書のように「1行で見せたいが幅が要る」入力用。既定の .sr-tail は flex:none なので
     ここで flex:1 にし、min-width:0 で長い値がはみ出さないようにする。 */
  .sr-row.wide-tail .sr-main { flex: none; width: 320px; max-width: 45%; }
  .sr-row.wide-tail .sr-tail { flex: 1; min-width: 0; }
  .sr-row.wide-tail .sr-tail > * { width: 100%; }
  /* 狭い幅ではラベル列を確保できないので stack と同じ縦積みに戻す。 */
  @media (max-width: 900px) {
    .sr-row.wide-tail { flex-direction: column; align-items: stretch; gap: 10px; }
    .sr-row.wide-tail .sr-main { width: auto; max-width: none; }
  }
  /* 親トグル ON 時のみ意味を持つ子行 — インデント + 薄背景 + navy 左アクセントで階層を明示 */
  .sr-row.is-child {
    padding-left: 48px;
    background: var(--bg-subtle);
    position: relative;
  }
  .sr-row.is-child::before {
    content: '';
    position: absolute;
    left: 20px; top: 14px; bottom: 14px;
    width: 2px;
    background: var(--brand-navy);
    border-radius: 1px;
  }
  .sr-row.is-child.is-disabled {
    opacity: 0.5;
    pointer-events: none;
  }
  .sr-row.is-child.is-disabled::before { background: var(--border-default); }
  .sr-main {
    flex: 1;
    min-width: 0;
  }
  .sr-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    line-height: 22px;
  }
  .sr-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 18px;
    margin: 2px 0 0;
  }
  .sr-tail {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .sr-value {
    font-size: 13px;
    color: var(--text-secondary);
  }
  .sr-tail .ic { width: 16px; height: 16px; color: var(--text-tertiary); flex: none; }
  /* Icon inside the label (device type, channel, …). Needs a descendant selector (0,2,0):
     the global `svg.lucide { width: 100% }` (0,1,1) beats a bare `.ic` (0,1,0), so an
     unsized icon here stretches to the full width of the row. */
  .sr-label .ic { width: 16px; height: 16px; flex: none; }
  a.sr-row { text-decoration: none; color: inherit; }
  a.sr-row:hover { background: var(--bg-subtle); }
  .sr-row.is-danger .sr-label { color: var(--red-500); }
  .sr-row.is-disabled { opacity: 0.5; pointer-events: none; }

  /* Settings group: section heading + sr-list. Multiple sections stack in a page. */
  .sr-section { margin-bottom: 32px; }   /* ブロック(section)間は 32px に統一 */
  .sr-section:last-child { margin-bottom: 0; }
  .sr-section__head {
    margin: 0 0 10px;
    padding: 0 4px;
  }
  .sr-section__label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
  }
  .sr-section__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 4px 0 0;
  }
  /* Section footer row: per-section save area (lives inside .sr-list,
     after all .sr-row entries). Use when a section has an explicit
     save action instead of a global SaveBar. */
  .sr-foot {
    display: flex; justify-content: flex-end; align-items: center; gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-default);
    background: var(--bg-subtle);
  }
  .sr-foot .sr-foot-hint {
    flex: 1;
    font-size: 12px; color: var(--text-tertiary);
  }

  /* Parse readout under a pasted blob (SAML certificate): what the value actually
     contains, so it can be checked before saving. .is-danger = unreadable or expired. */
  .sc-cert-info {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: var(--teal-50);
    border-radius: var(--r-4);
    font-size: 12px; color: var(--text-secondary);
    line-height: 1.6;
  }
  .sc-cert-info .ic { width: 14px; height: 14px; color: var(--teal-600); flex: none; }
  .sc-cert-info b { color: var(--text-primary); font-weight: 600; }
  .sc-cert-info.is-danger { background: var(--red-50); }
  .sc-cert-info.is-danger .ic { color: var(--text-danger); }

  /* Child row: indented under a parent toggle. Toggle parent off → child is-disabled */
  .sr-row.is-child {
    padding-left: 44px;
    position: relative;
  }
  .sr-row.is-child::before {
    content: "";
    position: absolute;
    left: 24px;
    top: 14px; bottom: 14px;
    width: 2px;
    background: var(--brand-navy-100);
    border-radius: 1px;
  }

  /* ============================================================
     Shell — fixed-width app layout for RECOG web.
     Min width 1280px (not responsive below this).

     Two patterns:
       A. Nav + SubPanel + Main   .shell
       B. No SubPanel             .shell.is-no-subpanel — Nav + Main (full width)
     Activity はカラムではなくオーバーレイ（PC/recog-design-system.md 3-1）。
     ============================================================ */
  .shell {
    display: grid;
    grid-template-rows: var(--gh-h) 1fr;
    height: 100vh;
    min-width: var(--app-min-w);
    background: var(--bg-default);
    overflow: hidden;
  }
  .shell__body {
    display: grid;
    grid-template-columns: 68px 260px 1fr;   /* 確定値 260px（PC/recog-design-system.md 1）。2026-09-01 に統一した。 */
    min-height: 0;
  }
  /* Allow grid items to shrink below content size so internal overflow:auto works */
  .shell__body > * { min-height: 0; }
  .shell__main {
    min-width: 0;
    overflow: auto;
    background: var(--bg-page);   /* キャンバス地：白いカード/表/パネルを浮かせる */
    /* 右下に浮く起動ボタン（Intercom）のぶんだけ、ページごと左に寄せる。表だけを詰めると
       上のツールバーと右端が揃わず、表が切られたように見える。浮くものが無いページでは 0
       （lib/intercom.ts が出しているあいだだけ入る）。縦は --dt-fit-max 側で詰める。
       The whole page gives way to the launcher floating in the bottom-right corner. Narrowing
       just the table leaves its right edge short of the toolbar above it, which reads as a table
       that got cut. Zero when nothing is floating; the vertical side is handled by --dt-fit-max. */
    padding-right: var(--app-right-inset, 0px);
  }
  /* ===== 2カラム（本文 + 右レール sticky TOC）。member-detail / アンケート編集など ===== */
  .md-page {
    padding: 0 24px 0 0;             /* Right inset = the standard page inset (PAGE_PAD_X in screens/_kit.tsx). Top/bottom/left live on .md-content */
    max-width: 1200px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 0 32px;
    align-items: start;
  }
  .md-content {
    min-width: 0; display: flex; flex-direction: column; gap: 16px;
    /* 編集キャンバスは薄グレー地。白いカードを浮かせて主役にする（線で主張させない） */
    background: var(--bg-page);
    padding: 24px 24px 64px;   /* Same inset as the standard page (PAGE_PADDING in screens/_kit.tsx). The sticky tab strip pins to the top edge */
  }
  /* 終了アンケートの編集：disabled fieldset 配下のカードを薄くして「変更不可」を視覚化
     （質問カードはインライン opacity で制御＝QuestionCardEditor の disabled） */
  .sv-edit-fields:disabled .collapse-card,
  .sv-edit-fields:disabled [id^="sv-sec-"] { opacity: 0.55; transition: opacity .12s ease; }
  /* 「ロックだが読める」：受付中×回答あり／終了で input/textarea を readOnly（closed は fieldset:disabled）にしても、
     文字色は通常のまま（薄さはカードの opacity .55 が担当）。編集不可なのでカーソルは not-allowed。 */
  .sv-edit-fields .input[readonly],
  .sv-edit-fields .textarea[readonly],
  .sv-edit-fields:disabled .input,
  .sv-edit-fields:disabled .textarea {
    -webkit-text-fill-color: var(--text-primary);
    color: var(--text-primary);
    cursor: not-allowed;
  }
  /* アンケート編集の質問／設定タブ帯。コンテンツ列幅でヘッダー直下に追従（TOC は右レールで横並び） */
  .sv-edit-tabbar {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    position: sticky; top: 0; z-index: 5;
    margin: 0 -40px; padding: 4px 40px 4px;   /* md-content の左右インセット(40px)ぶん外側へ抜いて列幅いっぱいに。下線はアクティブタブのみ */
    background: var(--bg-page);                 /* キャンバスと同じグレー（白だと浮く） */
  }
  /* 下線はタブ帯側で引くので、内側 Tabs の下線は消して二重線を防ぐ */
  .sv-edit-tabbar .tabs { border-bottom: 0; }
  /* 右端のプレビュー（SplitButton/MenuButton）は下線から少し浮かせる */
  .sv-edit-tabbar > .btn,
  .sv-edit-tabbar > span { flex: none; margin-bottom: 6px; }
  /* 右側グループ：回答進捗 + プレビュー（ボタンと文字を離す） */
  .sv-edit-tabbar__right { display: flex; align-items: center; gap: 20px; flex: none; margin-bottom: 6px; }
  .sv-resp-count { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 1; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .sv-resp-count svg { display: block; color: var(--text-tertiary); }
  .sv-resp-num { color: var(--brand-navy); font-weight: 700; }

  /* ===== 分析ダッシュボード: スクリーン表示（キオスク）のスライドショー ===== */
  /* Backdrop Ken Burns zoom. jubel drives this with an AnimationController
     (duration 40s, Tween 1 -> 1.8) that it resets on every frame, so the background is always
     drifting outward behind the image. Restart by remounting the element (change its React key). */
  @keyframes an-screen-zoom { from { transform: scale(1); } to { transform: scale(1.8); } }
  /* Frame crossfade. jubel wraps the media in AnimatedSwitcher(1600ms) and the caption in
     AnimatedSwitcher(1200ms), both with a FadeTransition. Both layers animate — up for the arriving
     frame, down for the leaving one, as AnimatedSwitcher does by reversing the transition for the
     outgoing child. Holding the leaving frame opaque instead leaves it as a hard-edged border around
     any photo of a different shape, then cuts it away in one frame. */
  @keyframes an-screen-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes an-screen-fade-out { from { opacity: 1; } to { opacity: 0; } }
  /* Title card (no photo on screen yet). Lines rise into place when the card appears; two pools of light drift slowly over the navy stage so a display left up for an hour
     never looks like a still image. */
  @keyframes an-screen-standby-rise {
    from { opacity: 0; transform: translateY(1.6vh); }
    to { opacity: 1; transform: none; }
  }
  @keyframes an-screen-standby-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(34vh, 16vh) scale(1.18); }
  }
  /* Directional pushes: the arriving frame enters from one edge while the leaving one exits the
     opposite edge, both clipped by the media box. */
  @keyframes an-screen-in-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
  @keyframes an-screen-out-left { from { transform: translateX(0); } to { transform: translateX(-100%); } }
  @keyframes an-screen-in-left { from { transform: translateX(-100%); } to { transform: translateX(0); } }
  @keyframes an-screen-out-right { from { transform: translateX(0); } to { transform: translateX(100%); } }
  /* Flip: the two frames turn around the box's vertical axis, edge-on at the halfway point. */
  @keyframes an-screen-flip-in {
    from { transform: perspective(1600px) rotateY(-90deg); opacity: 0; }
    to   { transform: perspective(1600px) rotateY(0deg); opacity: 1; }
  }
  @keyframes an-screen-flip-out {
    from { transform: perspective(1600px) rotateY(0deg); opacity: 1; }
    to   { transform: perspective(1600px) rotateY(90deg); opacity: 0; }
  }
  /* Cube: same rotation hinged on the touching edges (transform-origin is set per layer), so the two
     frames read as two faces of a box turning. */
  @keyframes an-screen-cube-in {
    from { transform: perspective(1600px) rotateY(90deg); }
    to   { transform: perspective(1600px) rotateY(0deg); }
  }
  @keyframes an-screen-cube-out {
    from { transform: perspective(1600px) rotateY(0deg); }
    to   { transform: perspective(1600px) rotateY(-90deg); }
  }

  /* 分析ダッシュボードのセクションタブ帯。スクロール中はシェルヘッダー(.gh)直下に追従（sv-edit-tabbar と同型）。
     スクロール領域は .shell__main（.gh はその上の固定 60px 兄弟）なので top:0 でヘッダー直下に貼り付く。
     不透明なキャンバス地を敷き、下をくぐる表・カードが透けない（ヘッダー文字との重なりを防ぐ）。 */
  .an-tabbar {
    position: sticky; top: 0; z-index: 6;
    margin: 0 -40px;                 /* SettingsMain の左右インセット(40px)ぶん外へ抜いて全幅に地を敷く */
    padding: 8px 40px 0;
    background: var(--bg-page);
  }
  /* 下線トラックはタブ側(.tabs)がそのまま出す。二重線にならないよう帯側には境界を足さない。 */

  /* ===== 利用状況の KPI タイル型タブ（jubel UsageTabBar の 1:1 移植）=====
     5枚のタイル（上角丸・灰枠・値/前月/±pt）がタブを兼ね、選択中のタイルは下のパネル
     (.an-usage-panel) と枠が繋がる（タイル下辺の枠なし＝パネルと一体）。非選択タイルは下辺の枠＋
     下 30% に淡青のグラデ。タイル間は 8px のコネクタ（下辺の枠のみ）が線を受け継ぐ。
     枠は他のカードと同じ --border-strong（タブだけ青枠だと、枠が意味を持っているように見える）。 */
  /* The tint variable (--an-usage-tint) is defined once at the end of this block for
     .an-usage-tabs / .an-usage-panel / .an-tabview. */
  .an-usage-tabs { display: flex; align-items: stretch; }
  /* タイル内は grid（label 全幅 / 左下=値・右上=前月±pt）。jubel は固定座標の Stack だが、
     固定座標は英語の長いラベルで値・前月と重なるため、同じ見た目を grid で組む。 */
  .an-usage-tab {
    /* jubel は 208px 固定。可変幅では「広い画面でタイルだけ間延び」しないよう幅を抑え、
       余りは右の埋め草（.an-usage-tabfill）が下線だけ引き継ぐ。 */
    position: relative; flex: 0 1 236px; min-width: 0; height: 120px;
    display: grid;
    grid-template: 'label label' auto 'value aside' minmax(0, 1fr) / minmax(0, 1fr) auto;
    column-gap: 8px;
    text-align: left; padding: 14px 16px; cursor: pointer;
    font: inherit; color: var(--text-primary);
    border: 1px solid var(--border-strong); border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: var(--bg-default);
  }
  .an-usage-tab:not(.is-active) {
    border-bottom: 1px solid var(--border-strong);
    background: linear-gradient(to bottom, var(--bg-default) 70%, var(--an-usage-tint) 100%);
  }
  .an-usage-tabsep { flex: none; width: 8px; border-bottom: 1px solid var(--border-strong); }
  /* タイルの右側に残る余白。パネル上辺の線だけを右端まで引き継ぐ */
  .an-usage-tabfill { flex: 1 1 0; border-bottom: 1px solid var(--border-strong); }
  .an-usage-tab__label { grid-area: label; font-size: 14px; font-weight: 700; line-height: 1.3; }
  .an-usage-tab__value {
    grid-area: value; align-self: end;
    font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .an-usage-tab__value small { font-size: 22px; font-weight: 400; margin-left: 4px; }
  .an-usage-tab__aside {
    grid-area: aside; align-self: start; justify-self: end; margin-top: 6px;
    display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
    font-size: 12px; color: var(--text-primary); white-space: nowrap;
  }
  /* 前期比・前月比の増減バッジ（▲▼＋値）。利用状況のタイルと人材データの率で共通に使う。
     画面ごとに組み直すと大きさと色がずれる（実際、人材データ側は 12px の文字だけで▲▼が無く、
     並べたときに同じ意味の値に見えなかった）。マークアップは AnalyticsDelta が持つ。 */
  .an-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
  /* ▲▼と数値にだけ色を付ける（design-rules で許容している唯一の用途）。
     jubel の Material 標準色（#4CAF50 / #F44336）を踏襲していたが、jubel と揃える理由が
     無くなった（2026-08-19）ので DS のトークンへ。緑ではなく teal なのは DS の成功色がこれのため。 */
  .an-delta.is-up { color: var(--teal-700); }   /* teal-500 は白の上 3.35 で本文サイズに足りない */
  .an-delta.is-down { color: var(--red-500); }
  .an-delta__tri { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
  .an-delta.is-up .an-delta__tri { border-bottom: 7px solid currentColor; }
  .an-delta.is-down .an-delta__tri { border-top: 7px solid currentColor; }
  /* 差の大きさで 3 段（`AnalyticsDelta scaled`）。指標を横並びで見せる場所だけで使う。
     全部 12px だと -18pt と -4pt が同じ見た目になる。三角も文字に追従させる（形＋大きさの
     二重符号化にして、色だけに意味を持たせない）。20px 段は large text 扱いなので、
     白地 3.35:1 の teal でもコントラスト基準を満たす。 */
  .an-delta--s0 { font-size: 12px; }
  .an-delta--s1 { font-size: 16px; }
  .an-delta--s2 { font-size: 20px; font-weight: 700; }
  .an-delta--s1 .an-delta__tri { border-left-width: 6px; border-right-width: 6px; }
  .an-delta--s1.is-up .an-delta__tri { border-bottom-width: 9px; }
  .an-delta--s1.is-down .an-delta__tri { border-top-width: 9px; }
  .an-delta--s2 .an-delta__tri { border-left-width: 8px; border-right-width: 8px; }
  .an-delta--s2.is-up .an-delta__tri { border-bottom-width: 11px; }
  .an-delta--s2.is-down .an-delta__tri { border-top-width: 11px; }

  /* 三角の向きは**事実（増えた/減った）**、色は**良し悪し**——2 つは別物なので別のクラスで持つ。
     解約率のように「増えると悪い」指標では色だけ反転させる（`AnalyticsDelta` の `invert`）。
     上の `.is-up` / `.is-down` は色を決め、向きはここで上書きする（同じ詳細度で後ろが勝つ）。 */
  .an-delta.is-arrow-up .an-delta__tri { border-top: 0; border-bottom: 7px solid currentColor; }
  .an-delta.is-arrow-down .an-delta__tri { border-bottom: 0; border-top: 7px solid currentColor; }
  .an-delta--s1.is-arrow-up .an-delta__tri { border-bottom-width: 9px; }
  .an-delta--s1.is-arrow-down .an-delta__tri { border-top-width: 9px; }
  .an-delta--s2.is-arrow-up .an-delta__tri { border-bottom-width: 11px; }
  .an-delta--s2.is-arrow-down .an-delta__tri { border-top-width: 11px; }
  /* チーム内訳の会社組織セレクタ（jubel MultiGroupPicker は全幅） */
  .an-usage-groupsel { width: 100%; }
  /* 概況より前に出す帯（未ログインユーザー）。区画の見出しの手前なので区画間と同じ 56px */
  .an-usage-alert { margin-bottom: 56px; }
  /* 区画（概況／会社組織別／個別）の間。カード間 16 → 区画間 56 の 2 段にして、
     「どこまでが 1 つのかたまりか」を余白で言う（`AREA_SEPARATION`：余白 → 面 → 線 の順）。
     32px だとカード間 16px との差が小さく、区画の切れ目に見えなかった。 */
  .an-usage-block { margin-bottom: 56px; }
  /* チャート上部の凡例（jubel FlLineChart/FlLineBarChart の凡例行）。
     Recharts の Legend は軸ぶんインデントされて浮くので自前で描く。数値は jubel と同一
     （文字14px・アイコンと文字の間8px・項目間16px・凡例→プロット16px）。 */
  .chart-toplegend {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
    font-size: 14px; color: var(--text-primary); margin-bottom: 16px;
  }
  .chart-toplegend__item { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
  .chart-toplegend__line { position: relative; flex: none; width: 18px; height: 2px; background: currentColor; border-radius: 1px; }
  .chart-toplegend__line::after {
    content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  }
  .chart-toplegend__sq { flex: none; width: 12px; height: 12px; border-radius: 3px; }
  /* 基準線（破線）の見本。図の中の線と同じ 4-3 の破線・同じ色にする——凡例と線が
     同じ形をしていないと、どの線の説明なのかを読み手が探すことになる。 */
  .chart-toplegend__dash {
    flex: none; width: 18px; height: 0; border-top: 1px dashed var(--text-tertiary);
  }
  /* 凡例が要らない図で、凡例 1 行ぶんの帯だけ空ける（`TrendChart` の `reserveLegendLane`）。
     隣に凡例つきの図が並ぶとき、これが無いと**片方の図だけ 1 行ぶん高い位置から始まり**、
     2 枚の軸が揃わない。1 系列しかない図に凡例を出すのは 5.4-D のノイズなので、帯だけ残す。 */
  .chart-toplegend.is-reserved { height: 21px; }

  /* 分析チャートのスケルトン（jubel SkeletonLineBarChart 相当）。
     棒＋折れ線＋軸目盛りの当たりを出しておき、実チャートと同じ高さで置き換わる。 */
  .an-skel-chart { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; gap: 10px 14px; }
  .an-skel-chart__axis { display: flex; flex-direction: column; justify-content: space-between; padding: 4px 0 12px; }
  .an-skel-chart__tick { width: 30px; height: 10px; border-radius: 999px; }
  .an-skel-chart__plot { position: relative; display: flex; align-items: flex-end; gap: 4.5%; padding: 4px 2px 0; min-width: 0; }
  .an-skel-chart__bar { flex: 1; min-width: 0; border-radius: 6px 6px 0 0; }
  .an-skel-chart__line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .an-skel-chart__line polyline { fill: none; stroke: var(--gray-200); stroke-width: 2; }
  .an-skel-chart__line circle { fill: var(--gray-200); }
  /* エリアチャートのスケルトン面。fill 指定が無いと SVG 既定の「黒」で塗られる */
  .an-skel-chart__area { fill: var(--bg-subtle); stroke: none; }
  /* min-width: 0 matters: the 8 fixed-width pills give this row a 408px min-content size, and the
     middle track is 1fr = minmax(auto, 1fr) — without it, a narrow grid column (threads' span-2
     trend card) is forced wider than its card and the skeleton bleeds past the border. */
  .an-skel-chart__xticks { grid-column: 2; display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
  .an-skel-chart__xticks .an-skel-chart__tick { width: 44px; }
  /* 相関図のスケルトン（jubel SkeletonNetworkGraph 相当）。ノードが位相をずらして脈動する */
  .an-skel-net { position: relative; overflow: hidden; }
  .an-skel-net__edges { position: absolute; inset: 0; }
  .an-skel-net__edges line { stroke: var(--border-default); stroke-width: 1.5; }
  .an-skel-net__node {
    position: absolute; transform: translate(-50%, -50%);
    border-radius: 50%; background: var(--gray-200);
    animation: an-skel-net-pulse 1.6s ease-in-out infinite;
  }
  @keyframes an-skel-net-pulse {
    0%, 100% { background: var(--gray-200); }
    50% { background: var(--bg-subtle); }
  }

  /* テーブルのスケルトン（jubel SkeletonDataTable 相当）。ヘッダー行＋縞背景のデータ行 */
  .an-skel-table { display: flex; flex-direction: column; }
  /* `is-framed` mirrors the real DataTable box (.dt-wrap frame, .dt-head band, th/td padding,
     separator rows — the real table has no zebra), so the placeholder occupies the same card the
     loaded table will. Frameless zebra pills on the page ground read as a different, oversized
     block that snaps into a framed card when the data lands. */
  .an-skel-table.is-framed { background: var(--bg-default); border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; }
  .an-skel-table__band { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border-default); }
  .an-skel-table__row { display: grid; gap: 24px; align-items: center; padding: 20px 16px; }
  .an-skel-table__row + .an-skel-table__row { border-top: 1px solid var(--border-default); }
  .an-skel-table__row.is-head { padding: 14px 16px; background: var(--gray-50); }
  .an-skel-table__row > span { height: 12px; }
  /* タイルと一体化する下のコンテンツパネル（jubel _UsagePage2 の枠） */
  .an-usage-panel {
    border: 1px solid var(--border-strong); border-top: none;
    border-radius: 0 0 8px 8px;
    background: var(--bg-default);
    /* jubel _UsagePage2: 上12・左右28・下4（＋最終セクションの後続32）＝下36 */
    padding: 12px 28px 36px;
  }
  /* ===== 利用状況（1ページ版）=====
     タブをやめて、概況（俯瞰）と分解（内訳）の 2 ブロックを 1 ページに置く。
     6 列グリッドに載せ、カードの幅はマスの整数倍にする（`dashboard-layout.ts` の LAYOUT_RULES
     「グリッドに載せて幅を揃え、主役だけ大きくする」）。**行の高さは中身で決める**——
     固定行にすると、凡例が 2 段になった図だけ枠から溢れる。
     狭い画面では 6 → 2 → 1 列に落として、同じ順番で縦に積む。 */
  .an-ovgrid {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px; align-items: stretch;
  }
  .an-ovgrid > * { min-width: 0; }
  .an-sp2 { grid-column: span 2; }
  .an-sp3 { grid-column: span 3; }
  .an-sp4 { grid-column: span 4; }
  .an-sp6 { grid-column: span 6; }
  @media (max-width: 1180px) {
    .an-ovgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .an-sp2, .an-sp3, .an-sp4 { grid-column: span 1; }
    .an-sp6 { grid-column: span 2; }
  }
  @media (max-width: 760px) {
    .an-ovgrid { grid-template-columns: minmax(0, 1fr); }
    .an-sp2, .an-sp3, .an-sp4, .an-sp6 { grid-column: span 1; }
  }
  /* マスに置いたカードはマスの高さいっぱいに伸ばす（隣り合うカードの下辺を揃える）。 */
  .an-ovgrid > * > .card { height: 100%; }

  /* 主役の数値。**濃紺の面**に置いて、周りの白いカードと格を分ける
     ——同じ形のカードが 20 枚並ぶと、どれを先に見ればよいかが決まらない。
     この面だけは**明暗どちらのテーマでも濃紺のまま**にする（テーマで反転させると、
     明るいテーマでは主役、暗いテーマでは背景に沈む、という別の扱いになってしまう）。
     そのため値はトークンではなくこのブロックの中で決める。全部 4.5:1 以上ある:
       白 17.7 / 副文 8.8 / ▼ 8.4 / ▲ 11.1 / 線 6.2（図形は 3:1 でよい）。 */
  .an-hero {
    --hero-fg: #FFFFFF;
    --hero-muted: #A9B7DC;
    --hero-line: #7096F8;
    --hero-neg: #FF9494;
    --hero-pos: #7BE0B5;
    /* hover の面。押せることが**触れる前に**分からないという指摘への対応（2026-08）。
       KPI タイルは白地なので枠色を navy に変えれば済むが、hero は既に濃紺の面なので
       枠の変化がほとんど見えない。**面を一段明るくする**のがこの地色では唯一効く手。 */
    --hero-hover: #16244F;
    height: 100%; box-sizing: border-box;
    background: #0B1638; border: 1px solid #0B1638;
    border-radius: 8px; padding: 18px 20px;
    display: flex; flex-direction: column; gap: 10px;
    color: var(--hero-fg);
    /* KPI タイルと同じ選択子（button）。ボタンの既定を打ち消して見た目は面のまま。 */
    width: 100%; text-align: left; font: inherit; cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
  }
  .an-hero:hover { background: var(--hero-hover); border-color: var(--hero-hover); }
  /* 選択中は白の細い枠。濃紺の面は既にいちばん強いので、面をこれ以上強くしない
     （`.an-kpi.is-active` の navy の帯と役割は同じで、地の色に合わせて色だけ変える）。 */
  .an-hero.is-active { border-color: var(--hero-line); box-shadow: inset 3px 0 0 var(--hero-line); }
  .an-hero:focus-visible { outline: 2px solid var(--hero-line); outline-offset: 2px; }
  .an-hero__label { font-size: 15px; font-weight: 700; color: var(--hero-fg); }
  .an-hero__sub { font-size: 11.5px; color: var(--hero-muted); margin-top: 2px; }
  /* 数字は見出しのすぐ下に置く。余りは下の図が吸う（下記）。 */
  .an-hero__num { display: flex; align-items: flex-end; gap: 6px; margin-top: 2px; }
  .an-hero__num b {
    font-size: 96px; line-height: .84; font-weight: 700;
    letter-spacing: -.035em; font-variant-numeric: tabular-nums;
  }
  .an-hero__num i { font-size: 28px; font-weight: 700; font-style: normal; padding-bottom: 9px; }
  .an-hero__cmp {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    font-size: 12.5px; color: var(--hero-muted);
  }
  /* 増減の色はこの面に合わせて置き換える（既定の red-500 / teal-500 は濃紺の上で沈む）。 */
  .an-hero .an-delta.is-down { color: var(--hero-neg); }
  .an-hero .an-delta.is-up { color: var(--hero-pos); }
  /* 推移線は**余った縦を全部吸って**下端まで伸びる。カードの高さは隣の KPI 群が決めるので、
     高さを決め打ちにすると数値と線のあいだに大きな空きが残る（実際に 147px 残った）。 */
  /* 図はカードの**左右いっぱい**まで伸ばす（左右の余白ぶんだけ外へ出す）。
     推移そのものは細かく読ませる図ではないので、幅を使い切ったほうが形が読みやすい。 */
  .an-hero > svg {
    flex: 1 1 auto; height: auto; min-height: 96px; max-height: 190px;
    width: calc(100% + 40px); margin: 6px -20px 0;
  }

  /* 概況の KPI。タブではなく**読むだけのタイル**（1 ページ化でタブが無くなった）。
     4 枚を 2×2 に敷き、hero と同じ高さに収める。 */
  .an-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; height: 100%; }
  /* レター受信率と送信率は**1 つの選択**なので、枠も 1 つにまとめる。タイルの中身は他の 2 枚と
     同じまま（`.an-kpi` をそのまま入れて枠だけ外す）——中を作り直すと、同じ形のはずのタイルが
     ここだけ別物になる。枠が 2 つあるのに常に同時に光ると、選択の単位が読めないのが元の問題。 */
  .an-kpi-group {
    grid-column: 1 / -1;
    display: grid; grid-template-columns: 1fr 1px 1fr;
    box-sizing: border-box;
    background: var(--bg-default); border: 1px solid var(--border-strong); border-radius: 8px;
    overflow: hidden;
    transition: background-color .15s ease, border-color .15s ease;
  }
  .an-kpi-group > .an-kpi { border: 0; border-radius: 0; background: none; }
  /* hover は**枠ごと**光らせる。どちらの半分を押しても結果は同じ（レターで 1 つの選択）なので、
     半分だけ塗ると**押し先が 2 つあるように見える**。hover の見た目はクリックの結果と一致させる。 */
  .an-kpi-group > .an-kpi:hover { border: 0; background: none; }
  .an-kpi-group:hover { background: var(--int-hover); border-color: var(--brand-navy); }
  .an-kpi-group > .an-kpi.is-active { box-shadow: none; }
  .an-kpi-group.is-active { border-color: var(--brand-navy); box-shadow: inset 3px 0 0 var(--brand-navy); }
  .an-kpi-group__rule { background: var(--border-default); }
  .an-kpi {
    box-sizing: border-box;
    background: var(--bg-default); border: 1px solid var(--border-strong);
    border-radius: 8px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 4px;
    /* 押すと下の「率の推移」「会社組織別」がこの指標に切り替わるので button 要素。
       ボタンの既定（中央揃え・継承しない文字色）を打ち消して、見た目は元のタイルのまま。 */
    width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  }
  /* 押せることを触れる前に伝える。面は DS 共通のホバー面（ボタン・アイコンボタンと同じ
     `--int-hover`）。hero は濃紺なので専用の `--hero-hover` を持つが、白地のタイルは
     共通トークンでそろえる。 */
  .an-kpi { transition: background-color .15s ease, border-color .15s ease; }
  .an-kpi:hover { border-color: var(--brand-navy); background: var(--int-hover); }
  /* 選択中は**左辺の帯**で示す（面を塗らない）。面は淡い色だと背景と 1.2:1 で見えず、濃く塗ると
     数値とスパークラインのコントラストを作り直すことになる。帯なら幅そのものが符号になり、
     ライト/ダークどちらでも同じ強さで出る。`BlockTitle` のアクセントバーと同じ手法。 */
  .an-kpi.is-active { border-color: var(--brand-navy); box-shadow: inset 3px 0 0 var(--brand-navy); }
  .an-kpi:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }
  .an-kpi__label { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
  .an-kpi__row { display: flex; align-items: flex-end; gap: 12px; margin-top: auto; }
  /* 推移線はタイルの**残り幅いっぱい**に伸ばす。幅を決め打ちにすると、タイルが広い画面ほど
     数値と図が離れて、別々のものが 2 つ置いてあるように見える。 */
  .an-kpi__row > svg { flex: 1 1 auto; min-width: 0; height: 40px; }
  .an-kpi__v {
    font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums; color: var(--text-primary);
  }
  .an-kpi__v small { font-size: 13px; font-weight: 700; margin-left: 1px; }
  .an-kpi__sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-tertiary); }

  /* ===== 分析のタブ付きパネル（jubel TabView の 1:1 移植 — ランキング・交流分析・成長ヒストリー）=====
     タブ 200×44（8px 間隔）。選択中＝白地・下枠なしでパネルと一体、ラベルは brand-navy 太字＋2px 下線。
     非選択＝全周枠＋下 30% に淡青グラデ。パネルは全周枠、左上だけ角丸なし（先頭タブが乗る）。 */
  .an-tabview__tabs {
    position: relative; z-index: 1;
    display: flex; gap: 8px;
    margin-bottom: -1px;             /* jubel: タブがパネル上辺の枠に 1px 重なる（選択中は開く） */
  }
  .an-tabview__tab {
    flex: 0 1 200px; min-width: 0; height: 44px;
    display: grid; place-items: center; padding: 0 12px; cursor: pointer;
    font: inherit; font-size: 14px; color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-radius: 8px 8px 0 0;
    background: linear-gradient(to bottom, var(--bg-default) 70%, var(--an-usage-tint) 100%);
  }
  .an-tabview__tab.is-active { border-bottom: none; background: var(--bg-default); }
  .an-tabview__label {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 2px 0; border-bottom: 2px solid transparent;
  }
  .an-tabview__tab.is-active .an-tabview__label {
    color: var(--brand-navy); font-weight: 700; border-bottom-color: var(--brand-navy);
  }
  .an-tabview__panel {
    border: 1px solid var(--border-strong);
    border-radius: 0 8px 8px 8px;
    background: var(--bg-default);
    padding: 20px 28px 28px;
  }
  .an-tabview__panel.is-solo { border-radius: 8px; }

  /* パネルを持たないフォルダタブ（一覧の絞り込みなど、下に枠を持たない切り替え）。
     タブの下に必要なのは「紙が続いている」という手がかりだけなので、面ではなく**線1本**で足りる。
     全幅に走る線の上にタブが乗り、選択中のタブだけが線を切って開く（＝紙の耳）。
     枠も左右パディングも無いので、**タブがあってもコンテンツの幅は1pxも変わらない**
     （枠付きパネルは左右で 58px、中にカードを重ねるとさらに 34px 食う）。
     線は**中身と同じ幅で止める**のが既定。ページ端まで伸ばすと線と中身の間に隙間ができ、
     結局「囲んでいる」のと同じ見え方になる。ページ全体を覆う見せ方が要る場面だけ
     `--ftab-bleed` にページの左右パディングを渡す。 */
  .an-tabview.is-bare > .an-tabview__tabs {
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-strong);
    margin-inline: calc(-1 * var(--ftab-bleed, 0px));
    /* 先頭タブの手前に線を少し覗かせる。ここが見えると「紙の上端にタブが乗っている」と読める
       （タブが線の端にぴったり付くと、タブ自体が角のように見えて紙の始まりが分からない）。 */
    padding-left: calc(var(--ftab-bleed, 0px) + 20px);
    padding-right: var(--ftab-bleed, 0px);
  }
  /* タブは線に 1px 重ねる。選択中は下枠が無く背景が不透明なので、その分だけ線が消えて開く。 */
  .an-tabview.is-bare > .an-tabview__tabs > .an-tabview__tab { margin-bottom: -1px; }
  .an-tabview.is-bare > .an-tabview__panel {
    border: none;
    border-radius: 0;
    padding: 20px 0 0;
  }

  /* Frames use --border-strong (the same gray as .card and table outer frames) and the
     selected label uses --brand-navy, both written inline above. Only the unselected-tab
     tint still needs a shared variable (a scale token, so no dark-mode override is needed). */
  .an-usage-tabs, .an-usage-panel, .an-tabview {
    --an-usage-tint: var(--blue-50);
  }

  /* ===== Analytics dashboard: restored 2026-08-16 (10cc4c31) look. Placed after the current block so same-name classes resolve to these rules. ===== */
  /* 分析ダッシュボードのセクションタブ帯。スクロール中はシェルヘッダー(.gh)直下に追従（sv-edit-tabbar と同型）。
     スクロール領域は .shell__main（.gh はその上の固定 60px 兄弟）なので top:0 でヘッダー直下に貼り付く。
     不透明なキャンバス地を敷き、下をくぐる表・カードが透けない（ヘッダー文字との重なりを防ぐ）。 */
  .an-tabbar {
    position: sticky; top: 0; z-index: 6;
    margin: 0 -40px;                 /* SettingsMain の左右インセット(40px)ぶん外へ抜いて全幅に地を敷く */
    padding: 8px 40px 0;
    background: var(--bg-page);
  }
  /* 下線トラックはタブ側(.tabs)がそのまま出す。二重線にならないよう帯側には境界を足さない。 */

  /* ===== 利用状況の KPI タイル型タブ（jubel UsageTabBar の 1:1 移植）=====
     5枚のタイル（上角丸・青枠・値/前月/±pt）がタブを兼ね、選択中のタイルは下のパネル
     (.an-usage-panel) と枠が繋がる（タイル下辺の枠なし＝パネルと一体）。非選択タイルは下辺の枠＋
     下 30% に淡青のグラデ。タイル間は 8px のコネクタ（下辺の枠のみ）が線を受け継ぐ。
     色は jubel の実行時テーマ値を固定 hex 化したもの（primary = fromSeed(#035aa6) の tonal-spot
     tone40 = #3C5F90、グラデ終端 = #E1EDFF、ゲージ残量 = #FF8F8E。chart-palette.ts と同期）。 */
  /* 色変数（--an-usage-primary / --an-usage-tint）はこのブロック末尾で
     .an-usage-tabs / .an-usage-panel / .an-tabview にまとめて定義。 */
  .an-usage-tabs { display: flex; align-items: stretch; }
  /* タイル内は grid（label 全幅 / 左下=値・右上=前月±pt）。jubel は固定座標の Stack だが、
     固定座標は英語の長いラベルで値・前月と重なるため、同じ見た目を grid で組む。 */
  .an-usage-tab {
    /* jubel は 208px 固定。可変幅では「広い画面でタイルだけ間延び」しないよう幅を抑え、
       余りは右の埋め草（.an-usage-tabfill）が下線だけ引き継ぐ。 */
    position: relative; flex: 0 1 236px; min-width: 0; height: 120px;
    display: grid;
    grid-template: 'label label' auto 'value aside' minmax(0, 1fr) / minmax(0, 1fr) auto;
    column-gap: 8px;
    text-align: left; padding: 14px 16px; cursor: pointer;
    font: inherit; color: var(--text-primary);
    border: 1px solid var(--an-usage-primary); border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: var(--bg-default);
  }
  .an-usage-tab:not(.is-active) {
    border-bottom: 1px solid var(--an-usage-primary);
    background: linear-gradient(to bottom, var(--bg-default) 70%, var(--an-usage-tint) 100%);
  }
  .an-usage-tabsep { flex: none; width: 8px; border-bottom: 1px solid var(--an-usage-primary); }
  /* タイルの右側に残る余白。パネル上辺の線だけを右端まで引き継ぐ */
  .an-usage-tabfill { flex: 1 1 0; border-bottom: 1px solid var(--an-usage-primary); }
  .an-usage-tab__label { grid-area: label; font-size: 14px; font-weight: 700; line-height: 1.3; }
  .an-usage-tab__value {
    grid-area: value; align-self: end;
    font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .an-usage-tab__value small { font-size: 22px; font-weight: 400; margin-left: 4px; }
  .an-usage-tab__aside {
    grid-area: aside; align-self: start; justify-self: end; margin-top: 6px;
    display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
    font-size: 12px; color: var(--text-primary); white-space: nowrap;
  }
  .an-usage-tab__diff { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
  /* 増減の緑/赤は jubel の Material 標準色を踏襲（▲▼のみに色を付ける。design-rules の許容用途） */
  .an-usage-tab__diff.is-up { color: #4CAF50; }
  .an-usage-tab__diff.is-down { color: #F44336; }
  .an-usage-tab__tri { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
  .an-usage-tab__diff.is-up .an-usage-tab__tri { border-bottom: 7px solid currentColor; }
  .an-usage-tab__diff.is-down .an-usage-tab__tri { border-top: 7px solid currentColor; }
  /* ログイン完了率タイルの縦ゲージ（jubel _LoginRateGauge: 28×80、青=達成・赤=未達・白の目盛） */
  .an-usage-gauge {
    position: absolute; top: 20px; right: 20px; width: 28px; height: 80px;
    border-radius: 4px; background: var(--an-usage-primary); overflow: hidden;
  }
  .an-usage-gauge__rest { position: absolute; top: 0; left: 0; right: 0; border-radius: 4px 4px 0 0; background: #FF8F8E; }
  .an-usage-gauge__tick { position: absolute; right: 0; width: 8px; border-bottom: 1px solid #fff; }
  .an-usage-gauge__tick.is-mid { width: 10px; border-bottom-width: 2px; }
  /* チーム内訳の会社組織セレクタ（jubel MultiGroupPicker は全幅） */
  .an-usage-groupsel { width: 100%; }
  /* チャート上部の凡例（jubel FlLineChart/FlLineBarChart の凡例行）。
     Recharts の Legend は軸ぶんインデントされて浮くので自前で描く。数値は jubel と同一
     （文字14px・アイコンと文字の間8px・項目間16px・凡例→プロット16px）。 */
  .chart-toplegend {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
    font-size: 14px; color: var(--text-primary); margin-bottom: 16px;
  }
  .chart-toplegend__item { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
  .chart-toplegend__line { position: relative; flex: none; width: 18px; height: 2px; background: currentColor; border-radius: 1px; }
  .chart-toplegend__line::after {
    content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  }
  .chart-toplegend__sq { flex: none; width: 12px; height: 12px; border-radius: 3px; }

  /* 分析チャートのスケルトン（jubel SkeletonLineBarChart 相当）。
     棒＋折れ線＋軸目盛りの当たりを出しておき、実チャートと同じ高さで置き換わる。 */
  .an-skel-chart { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; gap: 10px 14px; }
  .an-skel-chart__axis { display: flex; flex-direction: column; justify-content: space-between; padding: 4px 0 12px; }
  .an-skel-chart__tick { width: 30px; height: 10px; border-radius: 999px; }
  .an-skel-chart__plot { position: relative; display: flex; align-items: flex-end; gap: 4.5%; padding: 4px 2px 0; min-width: 0; }
  .an-skel-chart__bar { flex: 1; min-width: 0; border-radius: 6px 6px 0 0; }
  .an-skel-chart__line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .an-skel-chart__line polyline { fill: none; stroke: var(--gray-200); stroke-width: 2; }
  .an-skel-chart__line circle { fill: var(--gray-200); }
  /* エリアチャートのスケルトン面。fill 指定が無いと SVG 既定の「黒」で塗られる */
  .an-skel-chart__area { fill: var(--bg-subtle); stroke: none; }
  .an-skel-chart__xticks { grid-column: 2; display: flex; justify-content: space-between; gap: 8px; }
  .an-skel-chart__xticks .an-skel-chart__tick { width: 44px; }
  /* 相関図のスケルトン（jubel SkeletonNetworkGraph 相当）。ノードが位相をずらして脈動する */
  .an-skel-net { position: relative; overflow: hidden; }
  .an-skel-net__edges { position: absolute; inset: 0; }
  .an-skel-net__edges line { stroke: var(--border-default); stroke-width: 1.5; }
  .an-skel-net__node {
    position: absolute; transform: translate(-50%, -50%);
    border-radius: 50%; background: var(--gray-200);
    animation: an-skel-net-pulse 1.6s ease-in-out infinite;
  }
  @keyframes an-skel-net-pulse {
    0%, 100% { background: var(--gray-200); }
    50% { background: var(--bg-subtle); }
  }

  /* テーブルのスケルトン（jubel SkeletonDataTable 相当）。ヘッダー行＋縞背景のデータ行 */
  .an-skel-table { display: flex; flex-direction: column; }
  .an-skel-table__row { display: grid; gap: 24px; align-items: center; padding: 16px 12px; border-radius: 8px; }
  .an-skel-table__row:nth-child(even) { background: var(--bg-subtle); }
  .an-skel-table__row > span { height: 12px; }
  .an-skel-table__row.is-head > span { height: 14px; }
  /* タイルと一体化する下のコンテンツパネル（jubel _UsagePage2 の枠） */
  .an-usage-panel {
    border: 1px solid var(--an-usage-primary); border-top: none;
    border-radius: 0 0 8px 8px;
    background: var(--bg-default);
    /* jubel _UsagePage2: 上12・左右28・下4（＋最終セクションの後続32）＝下36 */
    padding: 12px 28px 36px;
  }
  /* ===== 分析のタブ付きパネル（jubel TabView の 1:1 移植 — ランキング・交流分析・成長ヒストリー）=====
     タブ 200×44（8px 間隔）。選択中＝白地・下枠なしでパネルと一体、ラベルは primary 太字＋2px 下線。
     非選択＝全周枠＋下 30% に淡青グラデ。パネルは全周枠、左上だけ角丸なし（先頭タブが乗る）。 */
  .an-tabview__tabs {
    position: relative; z-index: 1;
    display: flex; gap: 8px;
    margin-bottom: -1px;             /* jubel: タブがパネル上辺の枠に 1px 重なる（選択中は開く） */
  }
  .an-tabview__tab {
    flex: 0 1 200px; min-width: 0; height: 44px;
    display: grid; place-items: center; padding: 0 12px; cursor: pointer;
    font: inherit; font-size: 14px; color: var(--text-primary);
    border: 1px solid var(--an-usage-primary);
    border-radius: 8px 8px 0 0;
    background: linear-gradient(to bottom, var(--bg-default) 70%, var(--an-usage-tint) 100%);
  }
  .an-tabview__tab.is-active { border-bottom: none; background: var(--bg-default); }
  .an-tabview__label {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 2px 0; border-bottom: 2px solid transparent;
  }
  .an-tabview__tab.is-active .an-tabview__label {
    color: var(--an-usage-primary); font-weight: 700; border-bottom-color: var(--an-usage-primary);
  }
  .an-tabview__panel {
    border: 1px solid var(--an-usage-primary);
    border-radius: 0 8px 8px 8px;
    background: var(--bg-default);
    padding: 20px 28px 28px;
  }
  .an-tabview__panel.is-solo { border-radius: 8px; }
  /* fill (TabPanel `fill`): the panel keeps the window height on every tab, so a tab with little
     content (the value tabs' empty state) does not collapse the frame the table tab fills.
     --fill-offset = panel top + chrome below it, measured by useViewportFill (same arithmetic as
     DataTable fitBody); the default matches --dt-fit-offset until the first measurement. */
  .an-tabview__panel.is-fill,
  .an-fill {
    display: flex; flex-direction: column;
    min-height: calc(100dvh - var(--fill-offset, 324px) - var(--app-bottom-inset, 0px));
  }
  .an-tabview__panel.is-fill > .empty-state,
  .an-fill > .empty-state { flex: 1; }
  /* The table skeleton that stands in for a viewport-high table: exactly the window remainder
     (its own --fill-offset, like the panel) with the spare rows clipped, so loading and loaded
     are the same height (TableSkeleton `fill`). */
  .an-skel-table.is-fill {
    flex: none;
    height: calc(100dvh - var(--fill-offset, 324px) - var(--app-bottom-inset, 0px));
    overflow: hidden;
  }

  .an-usage-tabs, .an-usage-panel, .an-tabview, .an-uinfo, .an-piebox {
    --an-usage-primary: #3C5F90;
    --an-usage-tint: #E1EDFF;
  }
  :root[data-theme="dark"] .an-usage-tabs,
  :root[data-theme="dark"] .an-usage-panel,
  :root[data-theme="dark"] .an-tabview,
  :root[data-theme="dark"] .an-uinfo,
  :root[data-theme="dark"] .an-piebox {
    --an-usage-primary: #A6C8FF;   /* fromSeed(#035aa6) dark primary（tone80） */
    --an-usage-tint: var(--blue-100);
  }

  /* ユーザーレポートの送受信傾向パイ — jubel `_user_pie_charts.dart` の枠付きボックス
     （surface 面＋primary 枠、円グラフ｜凡例の2カラム）。 */
  .an-piebox {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center;
    border: 1px solid var(--an-usage-primary);
    border-radius: 8px;
    background: #F8F9FF;   /* jubel light surface（fromSeed #035aa6） */
    padding: 8px 16px;
  }
  :root[data-theme="dark"] .an-piebox { background: var(--bg-subtle); }

  /* ユーザーレポートのメンバー基本情報 — jubel `_user_basic_info.dart` の4列ボックス表。
     ラベル列＝薄い色面（jubel colorScheme.surface）、値列＝白、枠は primary、セル高65。 */
  .an-uinfo {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--an-usage-primary);
    border-radius: 8px; overflow: hidden;
    background: var(--bg-default);
  }
  .an-uinfo__cell {
    min-height: 65px; padding: 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; font-size: 14px; color: var(--text-primary);
    border-top: 1px solid var(--an-usage-primary);
    min-width: 0; overflow-wrap: anywhere;
  }
  .an-uinfo__cell:nth-child(-n+4) { border-top: none; }
  .an-uinfo__cell:not(:nth-child(4n+1)) { border-left: 1px solid var(--an-usage-primary); }
  .an-uinfo__cell.is-label { background: #F8F9FF; }   /* jubel light surface（fromSeed #035aa6） */
  :root[data-theme="dark"] .an-uinfo__cell.is-label { background: var(--bg-subtle); }
  .an-uinfo__sub { font-size: 12px; color: var(--text-secondary); }
  /* 分析レルムのテーブルは列間にも罫線（jubel の DataGrid は #E1E9F4 の縦線を全セルに引く） */
  .an-realm .data-table th + th,
  .an-realm .data-table td + td { border-left: 1px solid #E1E9F4; }
  :root[data-theme="dark"] .an-realm .data-table th + th,
  :root[data-theme="dark"] .an-realm .data-table td + td { border-left-color: var(--border-subtle); }

  /* ===== ChartKit — ダッシュボードの器と添え物（`components/ds/client/ChartKit.tsx`）=====
     色はすべて「分析画面のチャート・パレット」のトークン。生 hex を書かない。 */
  .ck-area {
    background: var(--bg-default); border: 1px solid var(--chart-line);
    border-radius: 8px; margin-bottom: 20px;
  }
  .ck-area__head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--chart-line); flex-wrap: wrap;
  }
  .ck-area__title { font-size: 19px; font-weight: bold; color: var(--brand-navy); }
  .ck-area__body { padding: 18px; }
  /* 破線の枠＝「常時ではない条件」。実線の枠は使わない（実線は面の区切りに取ってある）。 */
  .ck-area__label {
    display: inline-block; vertical-align: 2px; margin-left: 10px;
    padding: 2px 8px; border-radius: 3px; font-size: 14px; font-weight: normal;
    color: var(--chart-ink-70); background: var(--bg-default);
    border: 1px dashed var(--chart-line-soft);
  }
  .ck-area__label.is-warn { color: var(--chart-bad); border-color: var(--chart-bad); }

  .ck-card {
    border: 1px solid var(--chart-line); border-radius: 6px; padding: 14px 16px;
    background: var(--bg-default); min-width: 0; height: 100%;
  }


  .ck-heading {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 2px; min-height: 22px;
  }
  .ck-heading__text { font-size: 17px; font-weight: bold; color: var(--brand-navy); }
  .ck-heading__action { flex: 0 0 auto; min-width: 0; }

  .ck-switch {
    display: inline-flex; border: 1px solid var(--chart-line); border-radius: 4px; overflow: hidden;
  }
  .ck-switch__btn {
    border: 0; border-right: 1px solid var(--chart-line);
    background: var(--bg-default); color: var(--chart-ink-sub); font-weight: normal;
    padding: 7px 14px; font-size: 14px; cursor: pointer; font-family: inherit;
    /* Never wrap a choice onto two lines: a segmented control reads as one row of options, and a
       wrapped label ("アクセス / 率") breaks that at the first narrow container. */
    white-space: nowrap;
  }
  .ck-switch__btn:last-child { border-right: 0; }
  .ck-switch__btn.is-active { background: var(--brand-navy); color: var(--text-on-fill); font-weight: bold; }

  .ck-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 8px; }
  .ck-legend.is-bottom { margin: 8px 0 0; }
  .ck-legend__item {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--chart-ink-sub);
  }
  .ck-legend__swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

  .ck-netrow { display: flex; align-items: center; margin-bottom: 2px; }
  .ck-netrow__label { flex: 0 0 auto; font-size: 12.5px; color: var(--chart-ink-sub); }
  .ck-netrow__values { flex: 1; display: grid; min-width: 0; margin-right: 12px; }
  .ck-netrow__value {
    text-align: center; font-size: 12.5px; color: var(--chart-ink);
    font-variant-numeric: tabular-nums;
  }

  /* 2 段のとき（末端＋上位階層）と 1 段のときで**箱の高さを変えない**。表の行の高さが
     揃っていないと、棒の列が行ごとに上下して比較の土台が崩れる。 */
  .ck-orgcell { display: flex; flex-direction: column; justify-content: center; min-height: 42px; }
  .ck-orgcell__leaf { font-size: 15px; font-weight: 600; color: var(--text-primary); }
  .ck-orgcell__path { margin-top: 2px; font-size: 12px; color: var(--text-tertiary); }

  /* NoteLine — アイコン＋小さめテキストのロック理由/注意の一行注記 */
  .note-line { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; font-size: 12px; line-height: 1.5; }
  .note-line.is-muted { color: var(--text-tertiary); }
  .note-line.is-warning { color: var(--text-warning); }
  /* is-danger は「守らないと外に出てしまう」類の注意（安全上の規則）専用。
     amber の is-warning より 1 段強く、太字で本文から浮かせる。乱用すると
     赤が普通の色になって、本当に危ないときに効かなくなる。 */
  .note-line.is-danger { color: var(--text-danger); font-weight: 600; }
  .note-line.is-center { justify-content: center; text-align: center; }
  .note-line__ic { flex: none; display: inline-flex; margin-top: 1px; }
  .note-line__ic svg { width: 13px; height: 13px; }
  /* セクション内で下に余白が要る注記（対象者警告・質問ロック注記） */
  .sv-note-tight { margin-bottom: 12px; }

  /* アンケート回答者プレビュー（別タブ・全画面フォーム）。レスポンシブ */
  /* 帯の高さは**この行が持つ**。ロゴは幅で指定していて（`.gh-logo img` と同じ作法）、SVG は
     余白を切ってあるので `height: auto` の実高は 18.7px しかない。高さを持たないと帯が
     ロゴぶん＝20px に潰れて、ロゴが上端の罫線に貼り付く（実際にそうなっていた）。
     値はアプリの上部バーと同じ `--gh-h`——同じ役の帯なので、独自の数字を置かない。 */
  .svpv-header-inner { max-width: 880px; margin: 0 auto; padding: 0 24px; min-height: var(--gh-h); display: flex; align-items: center; }
  .svpv-logo { width: 167px; height: auto; }   /* 旧 height:75px 相当（文字幅 166px） */
  .svpv-body { max-width: 880px; margin: 0 auto; padding: 28px 24px 64px; display: flex; flex-direction: column; gap: 16px; }
  @media (max-width: 640px) {
    .svpv-header-inner { padding: 0 16px; }
    .svpv-logo { width: 107px; }   /* 旧 height:48px 相当（文字幅 106px） */
    .svpv-body { padding: 20px 16px 48px; }
  }
  /* デモ表示スイッチャー（プレビュー専用・右下固定）。参照モックの .demo-switcher 相当 */
  .svpv-demobar {
    position: fixed; bottom: 16px; right: 16px; z-index: 100;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: var(--r-8);
    background: var(--brand-navy); color: var(--text-on-fill);
    font-size: 12px; box-shadow: var(--shadow-3);
  }
  .svpv-demobar select {
    background: var(--bg-default); color: var(--text-primary);
    border: none; border-radius: var(--r-4);
    padding: 6px 10px; font-size: 12px; font-family: inherit; cursor: pointer;
  }
  /* タブ帯ぶんのオフセット（別タブからのジャンプで見出しが隠れないように） */
  .md-content [id^="sv-"] { scroll-margin-top: 64px; }
  /* member-detail のセクション（TOC ジャンプで追従タブ帯の下に隠れないように） */
  .md-content [id^="sec-"] { scroll-margin-top: 64px; }
  .md-toc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; }
  .md-toc__title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin: 0 0 8px; padding: 0 10px; }
  .md-toc__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
  /* グループ見出し（基本情報 / 各セクション）：● + 濃いボールド。クリック対象ではない */
  .md-toc__group {
    display: flex; align-items: center; gap: 8px;
    margin: 12px 0 4px; padding: 0 10px;
    font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .md-toc__group:first-child { margin-top: 0; }
  .md-toc__group::before {
    content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-secondary);
  }
  /* リンク（トップレベル＝設定タブ項目 / 子＝質問）：塗りなし、文字色だけで状態を出す */
  .md-toc__list a {
    display: block; padding: 5px 10px; font-size: 13px; color: var(--text-secondary);
    text-decoration: none; border-radius: var(--r-4); line-height: 1.4; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: color .12s ease, background .12s ease;
  }
  .md-toc__list a:hover { background: var(--bg-subtle); color: var(--text-primary); }
  /* 現在地＝navy ＋太字。塗りはなし。
     **マゼンタから変えた**（2026-09-11）——`PC/CLAUDE.md`「カラー運用ルール」でマゼンタは
     「予約送信日時など RECOG らしい未来事象の強調」用で、navy が「通常のハイライト」。
     目次の現在地はまさに通常のハイライトなので、本来の役に戻した。 */
  .md-toc__list a.is-active { color: var(--brand-navy); font-weight: 600; }
  /* トップレベルのリンク（設定タブ項目）：● + 濃いボールド（グループ見出しと同じ見た目で揃える）。
     display:flex にはしない — flex コンテナには text-overflow: ellipsis が効かず、長い項目
     （例「二要素認証（2FA）」）が列からはみ出して切れっぱなしになる。inline-block の ● を
     文字と同じ行に置けば、上の a と同じ省略記号がそのまま効く。 */
  /* **現在地でない項目は控える**（2026-09-11）。以前は全項目が `--text-primary` の太字で、
     現在地との違いが**色だけ**だった。濃さも落とせば、色を見分けなくても現在地が立つ。 */
  .md-toc__list a.is-top { font-weight: 700; color: var(--text-secondary); }
  .md-toc__list a.is-top::before {
    content: ""; display: inline-block; vertical-align: middle; margin-right: 8px;
    width: 6px; height: 6px; border-radius: 50%;
    /* 現在地は塗りつぶし、それ以外は中抜き。**色だけで現在地を示さない**（41法則 #01）——
       マゼンタとグレーの差しか無いと、色覚特性のある利用者とモノクロ印刷で現在地が分からない。
       枠線は box-sizing で内側に描くので、切り替わっても行がずれない。 */
    box-sizing: border-box;
    background: transparent;
    /* 中抜きの丸は**まだ通っていない**印。枠は 3:1 を満たす `--border-strong`
       （`StepBar` の未到達の丸と同じ考え方）。 */
    border: 1.5px solid var(--border-strong);
  }
  .md-toc__list a.is-top.is-active { color: var(--brand-navy); }
  .md-toc__list a.is-top.is-active::before {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
  }
  /* 子項目（質問）：インデントして淡いグレー */
  .md-toc__list a.is-sub { padding-left: 22px; color: var(--text-tertiary); }
  .md-toc__list a.is-sub:hover { color: var(--text-primary); }
  .md-toc__list a.is-sub.is-active { color: var(--brand-navy); }
  /* 1280px 未満：シェルの最小幅を外してウィンドウ幅にフィット（横スクロール回避）。
     2カラム本文（md-page）は右TOCを畳んで本文を右端まで広げる。 */
  @media (max-width: 1279px) {
    .shell { min-width: 0; }
    .md-page { grid-template-columns: 1fr; }
    .md-toc { display: none; }
  }

  /* ===== 設定ページの2カラム（本文 + 右レール TOC）。SettingsMain の中で使う =====
     .stk-body と違い追従タブ帯を持たないページ用なので、レールの上端は 24px（.md-toc と同じ）。
     縦の間隔は本文側（.sr-section の margin-bottom / section の marginBottom）が既に持っているので、
     .set-content には gap を足さない（足すと 32px が二重になる）。 */
  .set-body {
    display: grid; grid-template-columns: minmax(0, 1fr) 220px;
    gap: 0 32px; align-items: start;
  }
  /* **ページ内ナビを置かないページは 1 カラム**（2026-10-13、依頼）。右の 220px を
     空けたままにすると、本文だけが狭いのに右に誰も使わない帯が残る。 */
  .set-body.is-single { grid-template-columns: minmax(0, 1fr); }
  .set-content { min-width: 0; }
  /* TOC ジャンプでセクション見出しが上端に貼り付かないだけの余白 */
  .set-content [id^="sec-"] { scroll-margin-top: 24px; }
  .set-toc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; }
  @media (max-width: 1279px) {
    .set-body { grid-template-columns: 1fr; }
    .set-toc { display: none; }
  }

  /* ===== 追従タブバー v2（フルブリード・stuck 時のみ白）。member-detail で試行 =====
     構造：.stk（全幅・縦積み）> [本文幅インセットの head] / sentinel / フルブリード tabbar / 本文幅 body(grid)。
     普段はタブバー透明＝ページに溶け込み、ヘッダー直下に貼り付いた瞬間（.is-stuck）だけ白＋境界線＋影。
     貼り付き判定は sentinel + IntersectionObserver（root=.shell__main）で JS が is-stuck を付け外し。 */
  .stk { display: flex; flex-direction: column; background: var(--bg-page); min-height: 100%; }
  /* 本文幅インセット（左右40px）。head / tabbar の内側 / body で共有してタブと本文の左端を揃える。
     幅の上限は付けない — 他の設定ページ（SettingsMain）が画面幅いっぱいを使うので、
     ここだけ 1200px で止めると同じ設定画面なのに入力欄が狭く、右端に死んだ余白ができて
     TOC が画面の途中に浮いて見える（settings-reward はそれを個別に打ち消していた）。 */
  .stk__inset { width: 100%; padding-left: 24px; padding-right: 24px; }   /* Same sides as SettingsMain (PAGE_PAD_X in screens/_kit.tsx) */
  .stk__head { padding-top: 24px; padding-bottom: 56px; }   /* Top = SettingsMain (PAGE_PAD_TOP). 下はタイトル→追従タブの ~60px */
  /*
   * `is-headband`：**白いヘッダー帯＋その下にくっついたタブ帯**（member-detail）。
   *
   * 既定の `.stk__head` は「戻る導線 → 見出し → 説明」を縦に積み、下に 56px 空けて
   * 追従タブへ渡す形。戻る導線と見出しを 1 行にまとめた画面ではその余白が間延びするので、
   * 詰めたうえで**面を白にして 1 つのヘッダーとして見せる**。
   *
   * タブ帯も白にするのは、**ヘッダーの続きに見せるため**——既定は透明で、貼り付いたときだけ
   * 白くなる。ヘッダーが白いのにタブだけ地色だと、くっついて見えない。
   * 貼り付き時の境界線と影（`.is-stuck`）はそのまま効くので、**ヘッダーは流れて、タブだけ残る**
   * という動きは変わらない。
   */
  .stk.is-headband .stk__head {
    background: var(--bg-default);
    padding-top: 20px; padding-bottom: 12px;
  }
  .stk.is-headband .stk-tabbar { background: var(--bg-default); }
  /*
   * 白い帯だけ**右端まで伸ばす**。シェル（`.shell__main`）は右下に浮く起動ボタン（Intercom）の
   * ぶんを `--app-right-inset` として全ページから引いているが、**起動ボタンは右下の角にしか
   * 浮かない**ので、画面上端にいるヘッダーとタブが 44px 手前で止まる理由が無い。帯が端に
   * 届かず地色が残ると、ページが切れているように見える。
   *
   * シェルの padding は外さない（外すと 2 カラムを持たないページ＝設定画面の大半が、
   * 右下の表のページャごと起動ボタンの下に潜る。入れ忘れた 1 ページは、Intercom が出ている
   * 環境で開くまで誰も気づけない）。**帯だけ負のマージンで外へ出し、中身は今までどおりの位置で
   * 止める**。起動ボタンが無い環境では変数が 0 なので、この指定は何もしない。
   */
  .stk.is-headband .stk__head,
  .stk.is-headband .stk-tabbar {
    /* `width: auto` が要る。`.stk__inset` / `.stk-tabbar` は `width: 100%` を持っていて、
       幅が確定している箱は負のマージンでは広がらない（右端は動かず、後続が重なるだけ）。
       auto に戻して初めて、margin-right のぶんだけ箱が右へ伸びる。 */
    width: auto;
    margin-right: calc(-1 * var(--app-right-inset, 0px));
  }
  .stk.is-headband .stk__head { padding-right: calc(24px + var(--app-right-inset, 0px)); }
  .stk.is-headband .stk-tabbar__inner { padding-right: calc(24px + 220px + 32px + var(--app-right-inset, 0px)); }
  /* TOC を持たない単カラム（`is-single`）は右を詰めない。**クラスを 1 つ多く重ねて勝たせる**
     ——`.stk.is-single .stk-tabbar__inner`（24px 固定）は後ろに書いてあり、同じ詳細度だと
     そちらが勝って、帯を外へ出したぶんの余白が戻らない。 */
  .stk.is-headband.is-single .stk-tabbar__inner { padding-right: calc(24px + var(--app-right-inset, 0px)); }
  @media (max-width: 1279px) {
    .stk.is-headband .stk-tabbar__inner { padding-right: calc(24px + var(--app-right-inset, 0px)); }
  }
  .stk__sentinel { height: 1px; }
  .stk-tabbar {
    position: sticky; top: 0; z-index: 20; width: 100%;
    background: transparent;
    border-bottom: 1px solid transparent;
    /* 透明→白をふわっと（背景・境界はやや速く、影は少し遅れて柔らかく出す） */
    transition: background .22s ease, border-color .22s ease, box-shadow .28s ease;
  }
  @media (prefers-reduced-motion: reduce) { .stk-tabbar { transition: none; } }
  .stk-tabbar.is-stuck {
    background: var(--bg-default);
    border-bottom-color: var(--border-default);
    box-shadow: 0 6px 14px -8px rgba(20, 28, 55, 0.22);
  }
  /* タブ帯の下線は stuck の border で出すので、内側 Tabs のトラック線は消す（アクティブ下線だけ残す） */
  .stk-tabbar .tabs { border-bottom: 0; }
  /* 左にタブ／StepBar、右にツールバー（プレビュー・回答数等）。単一子なら左寄せ。
     白帯はフルブリードだが、中身（特に右ツールバー）は本文列の右端で止める＝TOC列(220)+gap(32)ぶん右を詰める */
  .stk-tabbar__inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 4px; padding-bottom: 0; padding-right: calc(24px + 220px + 32px); }
  .stk-tabbar__inner .tabs { border-bottom: 0; }
  /* **StepBar** を載せる追従バー（新規ウィザードと下書きの編集）だけ上下を広げる。
     タブは自分の中に余白と下線を持っていて（`.tabs` の実測 46px）帯の底に接するのが正しいが、
     `.stepbar.is-bare` は丸とラベルだけの 26px なので、既定の 4px / 0 だと帯の下端に詰まって
     見える。下を 20px にするのは `.stk.is-headband .stk__head` の padding-top と同じ値で
     白い帯の上端と下端を受けるため。 */
  .stk-tabbar.is-steps .stk-tabbar__inner { padding-top: 8px; padding-bottom: 20px; }
  @media (max-width: 1279px) { .stk-tabbar__inner { padding-right: 24px; } }   /* TOC 非表示時は本文が全幅なので右詰め解除 */
  .stk-body {
    display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 0 32px;
    align-items: start; padding-top: 24px; padding-bottom: 64px;   /* Bottom = SettingsMain (PAGE_PAD_BOTTOM) */
  }
  .stk-content { min-width: 0; display: flex; flex-direction: column; gap: 32px; }
  /* TOC ジャンプ時に貼り付きタブ帯の下に隠れないオフセット（member-detail=sec- / survey-edit=sv-） */
  .stk-content [id^="sec-"], .stk-content [id^="sv-"] { scroll-margin-top: 72px; }
  /* TOC はタブバー（z 20）より低く、貼り付きタブ帯の下に来るよう top を下げる */
  .stk-toc { position: sticky; top: 64px; z-index: 10; align-self: start; max-height: calc(100vh - 84px); overflow-y: auto; }
  @media (max-width: 1279px) {
    .stk-body { grid-template-columns: 1fr; }
    .stk-toc { display: none; }
  }
  /* タブを持たないページ（settings-thread-edit 等）：.stk__head の下余白は「見出し→追従タブ」の
     ~60px を確保するためのものなので、タブが無いなら詰める（本文までが遠くなりすぎる）。 */
  .stk.is-notabs .stk__head { padding-bottom: 8px; }
  /* TOC を持たない単カラムの設定ページ（settings-billing / settings-reward 等） */
  .stk.is-single .stk-body { grid-template-columns: 1fr; }
  .stk.is-single .stk-tabbar__inner { padding-right: 24px; }   /* TOC が無いので右詰め不要 */

  /* Activity はカラムを持たない。Feed の上に重なるオーバーレイで、開いてもレイアウトは
     変わらない（PC/recog-design-system.md 3-1）。2026-09-01 に `.shell__feed` /
     `.is-3col` / 1400px ブレークポイントを撤去した。 */

  /* Variant without SubPanel (e.g., simple full-width pages) */
  .shell.is-no-subpanel .shell__body {
    grid-template-columns: 68px 1fr;
  }
  /* Admin variant: hide the leftmost GlobalNav rail (settings / admin pages
     don't need to jump back to product surfaces from here). SubPanel becomes
     the leftmost column. */
  .shell.is-admin .gn { display: none; }
  .shell.is-admin .shell__body { grid-template-columns: 260px 1fr; }
  .shell.is-admin.is-no-subpanel .shell__body { grid-template-columns: 1fr; }


  /* ============================================================
     GlobalHeader (.gh) — top app bar, --gh-h tall (see PC/recog-design-system.md), full width.
     Layout: Logo + PageTitle  ·  Stats (flex)  ·  Search/Bell · Divider · Org/User
     Anchored at the top of every authenticated screen.
     ============================================================ */
  .gh {
    height: var(--gh-h);
    width: 100%;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-default);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    font-family: var(--ff-sans);
    color: var(--text-primary);
  }
  /* Left cluster: logo + page title */
  .gh-brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    flex: none;
  }
  .gh-logo {
    display: inline-flex;
    align-items: center;
  }
  .gh-logo img,
  .gh-logo svg {
    /* ロゴは幅で指定する。SVG は余白を切ってある（viewBox="6.5 21.5 125 13.5"）ので、
       箱＝文字とみなしてよい。143px は元の見た目（文字幅 141.7px）と同じ大きさで、
       箱の高さは 15.4px。52px のヘッダーに余裕で収まる。 */
    width: 143px;
    height: auto;
    display: block;
  }
  .gh-page {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-left: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }

  /* Center cluster: stats / metrics */
  .gh-stats {
    display: inline-flex;
    align-items: center;
    gap: 32px;
    justify-self: start;
    margin-left: 24px;
    min-width: 0;
  }
  .gh-stat {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background .12s ease;
  }
  .gh-stat:hover { background: var(--int-hover); }
  .gh-stat .gh-stat-ic {
    width: 28px; height: 28px;
    display: inline-grid; place-items: center;
    color: var(--brand-navy);
    flex: none;
  }
  .gh-stat .gh-stat-ic .lucide,
  .gh-stat .gh-stat-ic svg { width: 22px; height: 22px; }
  .gh-stat .gh-stat-text { display: inline-flex; flex-direction: column; gap: 0; line-height: 1.15; }
  .gh-stat .gh-stat-label { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
  .gh-stat .gh-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.005em;
  }
  .gh-stat .gh-stat-value .gh-stat-unit {
    font-size: 12px; font-weight: 600;
    color: var(--text-tertiary);
    margin-left: 2px;
  }
  .gh-stat .gh-stat-value .gh-stat-sep { color: var(--text-tertiary); font-weight: 600; margin: 0 1px; }

  /* Right cluster: actions + identity */
  .gh-right {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    justify-self: end;
    flex: none;
  }
  .gh-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .gh-icon-btn {
    position: relative;
    width: 40px; height: 40px;
    border: 0;
    background: transparent;
    border-radius: 9999px;
    color: var(--brand-navy);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background .12s ease;
  }
  .gh-icon-btn:hover { background: var(--int-hover); }
  .gh-icon-btn:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }
  .gh-icon-btn .lucide,
  .gh-icon-btn svg { width: 22px; height: 22px; }
  /* Notification badge — smaller variant of .badge, anchored to icon's top-right
     corner so the icon remains clearly visible. */
  /* 大きさは `.badge.xs` が持つ。**ここは置き場所だけ**（2026-09-02 に統合）。 */
  .gh-icon-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    /* アイコンに重なるので、ヘッダーの面の色で抜く。 */
    box-shadow: 0 0 0 2px var(--bg-default);
  }
  .gh-icon-btn .badge.badge--dot {
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    min-width: 0;
    padding: 0;
  }
  /* Mini divider between actions and identity */
  .gh-sep {
    width: 1px; height: 24px;
    background: var(--border-default);
    margin: 0 4px;
  }
  /* Identity buttons (org / user) — chip with avatar + chevron */
  /* Identity chip — split into TWO interactive targets:
       (1) avatar button → links to profile / org page
       (2) chevron button → opens menu/tooltip
     The .gh-identity wrapper itself is non-interactive (a <span>) and
     just groups the two buttons with a unified pill background on hover
     of either child. Each child has its own hover surface for clarity. */
  .gh-identity {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    border-radius: 9999px;
    border: 0;
    background: transparent;
    transition: background .12s ease;
  }
  /* Subtle unified hover when either child is hovered */
  .gh-identity:hover { background: rgba(0, 25, 81, 0.03); }

  /* Avatar slot — clickable target to profile page */
  .gh-id-av-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 0;
    background: transparent;
    border-radius: 9999px;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s ease;
  }
  .gh-id-av-btn:hover { background: var(--brand-navy-50); }
  .gh-id-av-btn:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }

  .gh-identity .gh-id-av {
    width: 36px; height: 36px;
    border-radius: 9999px;
    background: var(--bg-default) center/cover no-repeat;
    border: 1px solid var(--border-default);
    flex: none;
    display: block;
  }
  .gh-identity .gh-id-av.is-org {
    display: grid; place-items: center;
    background: var(--bg-default);
    overflow: hidden;
  }
  .gh-identity .gh-id-av.is-org img {
    width: 30px; height: 30px;
    object-fit: contain;
    display: block;
  }

  /* Chevron slot — clickable target to open menu/tooltip */
  .gh-id-chev-btn {
    width: 24px; height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: 9999px;
    cursor: pointer;
    margin-left: 2px;
    margin-right: 2px;
    transition: background .12s ease, color .12s ease;
  }
  .gh-id-chev-btn:hover { background: var(--brand-navy-50); color: var(--text-secondary); }
  .gh-id-chev-btn:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 1px; }
  .gh-id-chev-btn .lucide,
  .gh-id-chev-btn svg { width: 16px; height: 16px; }

  /* Legacy chev class kept for backward compat (renders inside chev-btn) */
  .gh-identity .gh-id-chev {
    width: 16px; height: 16px;
    color: inherit;
  }

  /* Search variant — inline search field instead of icon button */
  .gh-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border-radius: 9999px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    min-width: 240px;
    cursor: text;
  }
  .gh-search .lucide,
  .gh-search svg { width: 16px; height: 16px; color: var(--text-tertiary); }
  .gh-search input {
    border: 0; outline: none; background: transparent;
    font-family: inherit; font-size: 13px; color: var(--text-primary);
    width: 100%;
  }
  .gh-search input::placeholder { color: var(--text-tertiary); }

  /* Mobile variant — collapses center stats, shrinks gaps */
  .gh.is-mobile {
    height: 56px;
    padding: 0 12px;
    gap: 8px;
    grid-template-columns: auto 1fr auto;
  }
  .gh.is-mobile .gh-stats { display: none; }
  .gh.is-mobile .gh-page { display: none; }
  .gh.is-mobile .gh-right { gap: 4px; }
  .gh.is-mobile .gh-icon-btn { width: 36px; height: 36px; }
  .gh.is-mobile .gh-icon-btn .lucide,
  .gh.is-mobile .gh-icon-btn svg { width: 20px; height: 20px; }
  .gh.is-mobile .gh-sep { display: none; }
  .gh.is-mobile .gh-identity .gh-id-av { width: 32px; height: 32px; }
  .gh.is-mobile .gh-identity .gh-id-chev-btn { display: none; }
  .gh.is-mobile .gh-identity:not(.is-user) { display: none; }

  /* ============================================================
     GlobalNav (.gn) — left rail, 72px wide, full height.
     Stack: brand send-letter button → divider → nav items (icon + label)
     Each item is 56×56 with optional active pill, badge, disabled state.
     ============================================================ */
  .gn {
    width: 68px;   /* 確定値 68px（PC/recog-design-system.md 1）。2026-09-01 に 72px から変更。 */
    /* 不透明。半透明にしない——常時表示のナビに、季節背景でコントラストが変動する要素を
       置かないため（PC/recog-design-system.md 2-2）。背景が不透明なので backdrop-filter は
       効かない。2026-09-01 に blur(30px) を削除した。 */
    /* ブランドカラーの面（2026-09-02）。**枠線は置かない**——色が変わることで隣の
       カラムとの境目は既に読める。線を足すと二重の区切りになる。 */
    background: var(--gn-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    font-family: var(--ff-sans);
  }
  /* Brand action — the prominent "send letter" circle at the top */
  .gn-brand {
    width: 56px; height: 56px;
    border-radius: 9999px;
    background: var(--bg-default);
    border: 1.5px solid var(--brand-navy);
    color: var(--brand-navy);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .12s ease;
    box-shadow: 0 4px 16px rgba(0,25,81,0.08);
    flex: none;
  }
  .gn-brand .lucide,
  .gn-brand svg { width: 24px; height: 24px; transition: transform .15s ease; }
  /* 紙飛行機は用意された 2 色版を使う。**CSS からは相対 URL で指す**——`basePath` は
     文字列リテラルに自動で付かないが、この CSS 自身が basePath の下から配られるので
     相対なら解決する（ロゴの `content: url("assets/brand/...")` と同じ書き方）。
     letter01 は濃紺（明るい面用）、letter02 は白（暗い面用）。 */
  .gn-brand__ic {
    width: 25px; height: 18px;
    background: url("assets/letter01.svg") center/contain no-repeat;
    transition: transform .15s ease;
  }
  /* **濃紺の面の上では、濃紺に塗ると消える。** 白いまま少し明るくして、押せることは
     アイコンの動き（translate）で示す。 */
  /* hover は濃紺に塗って白い紙飛行機へ。**面と同じ濃紺になるので、白い輪郭で縁を残す**
     ——これが無いとナビの面に溶けて、丸がどこにあるか分からなくなる。 */
  .gn-brand:hover {
    background: var(--gn-bg);
    border-color: var(--gn-fg);
  }
  .gn-brand:hover .gn-brand__ic {
    background-image: url("assets/letter02.svg");
  }
  .gn-brand:hover svg,
  .gn-brand:hover .gn-brand__ic,
  .gn-brand:hover .lucide { transform: translate(1px, -1px); }
  .gn-brand:focus-visible { outline: 2px solid var(--gn-fg); outline-offset: 3px; }
  /* 面を明るくしたので、アイコンは濃紺のまま（白だと 1.04 で消える）。 */
  .gn-brand.is-active {
    background: var(--gn-bg);
    border-color: var(--gn-fg);
  }
  .gn-brand.is-active .gn-brand__ic { background-image: url("assets/letter02.svg"); }
  /* Section divider between brand and nav items */
  .gn-divider {
    width: 32px;
    height: 1px;
    background: var(--gn-divider);
    margin: 4px 0;
    flex: none;
  }
  /* Nav stack */
  /* **入りきらない項目は `⋯` のメニューへ畳む**（数は `useNavFit` が高さから決める）。
     スクロールにしないのは、68px のレールでは「下に続きがある」ことが読み取れないため。
     `overflow-y: auto` は**保険**——測り違えたときに項目が外へ流れて見切れるより、
     ここで止まるほうがよい。通常は畳まれるので働かない。 */
  .gn-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .gn-list::-webkit-scrollbar { display: none; }

  /* ---------- プライベートチームの切り替え ----------
     Slack でいうワークスペースの列。**1 人がいくつでも入れる**ので、固定の個数を前提にしない。
     入る数だけ出して、残りは「＋N」でメニューへ送る（数は React 側が高さから決める）。

     **一番下に固定する。** 項目側（レター〜タイムライン）はスクロールするので、画面が短くても
     切り替えには必ず届く——「今どのチームにいるか」は、スクロールしないと分からない情報に
     してはいけない。 */
  .gn-teams {
    flex: none;
    width: 100%;
    display: flex; flex-direction: column; align-items: center;
    /* 6px だと隣のチームと地続きに見えて、いくつ並んでいるか数えにくい。
       アイコンが 36px なので、その 1/3 ぶん空けて 1 つずつ独立して読めるようにする。 */
    gap: 12px;
    padding-top: 10px;
  }
  .gn-team {
    position: relative;
    width: 36px; height: 36px; flex: none;
    padding: 0; border: 0;
    border-radius: var(--r-12);
    background: var(--gn-fg);
    color: var(--gn-bg);
    display: grid; place-items: center;
    overflow: visible;
    cursor: pointer;
    font-family: var(--ff-display); font-size: 15px; font-weight: 700; line-height: 1;
    transition: box-shadow .12s ease;
  }
  .gn-team > img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    border-radius: inherit;
  }
  /* **絵に依存しない境界。** チームのアイコンは何色でもあり得るので、ナビの面と同じ濃紺の
     絵が来ると四角の輪郭が消えて「いくつ並んでいるか」が読めなくなる（実際に組織の PNG が
     `#162A4E` で、面の `#001951` とほぼ同じだった）。
     `::after` に置くのは、要素側の `box-shadow` を選択中の輪に空けておくため。 */
  .gn-team::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
    pointer-events: none;
  }
  /* 選択中は**外側に輪**を出す。塗りを変える手は使えない——中身が会社のロゴなので、
     背景を変えてもロゴの色は変わらず、選択中かどうかが読めない。 */
  .gn-team.is-active { box-shadow: 0 0 0 2px var(--gn-bg), 0 0 0 4px var(--gn-fg); }
  .gn-team:focus-visible { outline: 2px solid var(--gn-fg); outline-offset: 3px; }
  /* 未読は**件数ではなく有無だけ**。切り替えの列に数字を並べると、どれがどのチームの数か
     読めなくなる（数はチームに入ってから見る）。 */
  .gn-team > .gn-team-dot {
    position: absolute; top: -2px; right: -2px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--fill-danger);
    box-shadow: 0 0 0 2px var(--gn-bg);
  }
  /* 入りきらないぶん（＋N）。枠だけの控えめな見た目にして、チームのアイコンと同じ強さで
     並ばないようにする。**参加（＋）はここに置かない**——切り替えの列に「増やす」操作を
     混ぜると、押し間違いがそのまま別のチームへの移動になる。 */
  .gn-team-more {
    width: 36px; height: 36px; flex: none;
    padding: 0;
    border: 1px dashed rgba(255, 255, 255, 0.35);
    border-radius: var(--r-12);
    background: transparent;
    color: var(--gn-fg);
    display: grid; place-items: center;
    cursor: pointer;
    font-family: var(--ff-display); font-size: 12px; font-weight: 700;
  }
  .gn-team-more:hover { background: var(--gn-chip); border-style: solid; }
  .gn-team-more:focus-visible { outline: 2px solid var(--gn-fg); outline-offset: 2px; }
  /* Single nav item */
  /* Activity オーバーレイを開いているあいだ、SideNav をスクリムより上に置く。
     起点のアイコンで開閉をトグルできるようにするため（PC/recog-design-system.md 3-3）。
     スクリム（inset: 0）に覆われたままだと、開いた本人がもう一度押して閉じられない
     （実装後の実機確認で発覚。known-issues DS-08）。
     覆わないのは起点だけで、Feed はスクリムの下のまま——操作対象でないことは変わらない。 */
  .gn.is-above-overlay { position: relative; z-index: 1002; }

  /* 製品側のコンテンツ行。**幅を止めない。**
     ここに max-width を掛けると Feed のカラムごと切れて、**季節背景が全幅に伸びなくなる**
     （確定値「季節背景の全幅表示」を壊す）。2026-09-01 に一度その実装をして差し戻した
     （known-issues DS-10）。
     幅を止めるのは**カラムではなく、その中の読むカラム**（--read-max）。 */

  /* 項目は**アイコンのチップ＋その下にラベル**（PC/sample の見本）。
     面がブランドカラーなので、文字・アイコンは白。
     **背景が付くのは項目全体ではなくアイコンのチップだけ**——ラベルまで囲うと、
     文字数の違う項目（「トーク」と「アクティビティ」）で四角の大きさが揃わない。 */
  .gn-item {
    position: relative;
    width: 100%;
    min-height: 72px;
    border: 0;
    background: transparent;
    color: var(--gn-fg);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 2px;
    cursor: pointer;
    flex: none;
  }
  /* アイコンを載せる角丸のチップ。**素の状態では透明**で、hover と選択中にだけ色が付く。
     大きさは常に確保しておく（hover で初めて場所を取ると、行の高さが動く）。 */
  .gn-item .gn-ic {
    position: relative;
    width: 40px; height: 40px;
    display: inline-grid; place-items: center;
    border-radius: var(--r-12);
    background: transparent;
    color: var(--gn-fg);
    overflow: visible;
    transition: background .12s ease, color .12s ease;
  }
  .gn-item .gn-ic .lucide,
  .gn-item .gn-ic svg { width: 22px; height: 22px; }
  .gn-item .gn-label {
    font-family: var(--ff-sans);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.25;
    color: var(--gn-fg);
    letter-spacing: 0.02em;
    text-align: center;
    /* **折り返す。** `nowrap` だと「アクティビティ」が 68px の幅に収まらず溢れる。
       見本も 2 行で組んである。 */
    white-space: normal;
    overflow-wrap: anywhere;
    width: 100%;
  }
  /* No underline on hover for any state (default, active, disabled) */
  .gn-item:hover,
  .gn-item:hover .gn-label { text-decoration: none; }
  /* Hover (when not active) — inset border (doesn't push layout outward) */
  .gn-item:hover:not(.is-active):not(.is-disabled) .gn-ic {
    background: var(--gn-chip);
  }
  /* **濃紺の上で `--brand-navy` の輪郭は見えない。** 面と同じ色になる。 */
  .gn-item:focus-visible {
    outline: 2px solid var(--gn-fg);
    outline-offset: -2px;
    border-radius: var(--r-8);
  }
  /* Active state — soft white card + left rail accent */
  /* 選択中は**チップを白く塗ってアイコンを濃紺に反転**する。hover の淡いチップとは
     明度が 16.69 跳ぶので、色みの違いではなく明暗で読める（DS-19）。
     以前の左の縦棒は外した——チップの反転のほうが強い手がかりで、棒と二重になる。 */
  .gn-item.is-active .gn-ic {
    background: var(--gn-fg);
    color: var(--gn-bg);
  }
  /* Disabled */
  .gn-item.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
  }
  /* Unread / count badge — Slack-style: anchored to the icon's top-right corner.
     Lives INSIDE .gn-ic so it follows the icon (not the item). */
  /* アイコンのチップの右上に少しはみ出して載せる。
     **右端を基準にする。** 左端を基準にすると桁が増えたぶん右へ伸びて、68px のナビから
     はみ出し、隣のカラムに覆われて数字が切れる（2 桁で既に 1px 出ていた）。
     右端基準なら内側へ伸びるので、3 桁でも収まる。 */
  .gn-item .gn-ic .badge {
    position: absolute;
    top: -6px;
    right: -8px;
    left: auto;
    margin-left: 0;
  }
  .gn-item .gn-ic .badge.badge--dot {
    top: -2px;
    right: -4px;
  }
  /* 縁取りは**周りの面と同じ色**にする（`.badge` の既定は `--bg-default`＝白）。
     ナビの面は濃紺なので、白のままだとバッジの周りに白い輪が浮いて、下の白いアイコンと
     競う。面の色で縁取れば、アイコンとの間に隙間ができて切り抜きに見える。 */
  .gn-item .gn-ic .badge { box-shadow: 0 0 0 2px var(--gn-bg); }



  /* ============================================================
     SubPanel (.subpanel) — secondary navigation panel attached to
     the right edge of the GlobalNav rail. Holds grouped lists like
     Letter feed filters, hashtag list, my-letters, view scope.
     300px wide × full height. Uses GroupTitle (.gt.is-m) for each
     group title and .sm-item rows for entries. Groups are separated
     by a 1px border-default divider.
     ============================================================ */
  .subpanel {
    width: 260px;   /* 確定値 260px（PC/recog-design-system.md 1）。2026-09-01 に統一した。 */
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-right: 1px solid var(--border-default);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 8px 9px 24px 0 rgba(0,0,0,0.08), inset 0 0 0 2px rgba(255,255,255,0.3);
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    font-family: var(--ff-sans);
    overflow-y: auto;
  }
  /* ===== サブナビの折りたたみ =====
     グローバルナビ（.dn-nav）の縮小とは独立。`.sm-item` / `.sm-label` は共用クラスなので、
     必ず `.subpanel.is-collapsed` の配下に閉じ込める（レイアウト全体から狙うと、同じ
     クラスを使う別画面のナビまで巻き込む）。 */
  .subpanel.is-collapsed { width: 64px; }
  .subpanel.is-collapsed .sm-label,
  .subpanel.is-collapsed .sm-tail,
  .subpanel.is-collapsed .subpanel-title { display: none; }
  .subpanel.is-collapsed .sm-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 12px 0;
  }

  /* ハンドルを付けるパネル。`.subpanel` は既定で `overflow-y: auto` なので、そのままだと
     外へ出したハンドルが切り取られる。スクロールは中の `.dn-acc-scroll` に任せて、
     外枠は溢れを見せる側にする。 */
  .subpanel.has-handle { overflow: visible; position: relative; }

  /* 縁につまむタブ（開閉ハンドル）。ヘッダーに置く余白が無いパネル用に、右端の境界へ
     半分乗せて出す。上寄せなのは、この手のトグルは一覧の先頭付近にあるのが一般的なため
     （中央だと本文を読んでいる時に視界へ入らない）。 */
  .panel-handle {
    position: absolute;
    top: 14px;
    right: -11px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 22px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    background: var(--bg-default);
    box-shadow: var(--shadow-2);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
  }
  .panel-handle:hover {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: var(--bg-default);
  }
  .panel-handle svg { width: 14px; height: 14px; }

  /* When mounted directly next to GlobalNav, the rail's 1px border-right
     and the subpanel's left edge meet flush — kill the doubled border. */
  .gn + .subpanel {
    border-left: 0;
  }
  /* Group container — header + body, separated from neighbour by 1px line */
  .subpanel-group {
    padding: 8px 8px;
  }
  .subpanel-group + .subpanel-group {
    border-top: 1px solid var(--border-default);
  }
  /* Tweak group title padding inside subpanel (slightly tighter)
     and use secondary text color for the section labels. The new .gt
     already renders chevron on the right by default, so no flip needed. */
  .subpanel .gt.is-m {
    padding: 8px 12px;
    color: var(--text-secondary);
  }
  /* グループ見出しは行全体がクリック可能 (subpanel.js が開閉)。クリック手応えを出す */
  /*
    **押せるのは畳める見出しだけ**（2026-09-24、指摘）。以前は `.gt` すべてに
    `cursor: pointer` と hover の塗りが付いていて、畳めない見出し（おすすめの送信先など）も
    押せるように見えていた。畳める見出しは行そのものがボタン（`.gt.is-toggle`）。
  */
  .subpanel .gt.is-toggle { cursor: pointer; border-radius: var(--r-6); }
  .subpanel .gt.is-toggle:hover { background: var(--int-hover); }
  /* 開閉しないグループ見出し（項目が少なく折りたたむ意味が無いメニュー）。
     subpanel の既定は「見出し行ごと押すと開閉する」前提で cursor と hover が付くので、
     押しても何も起きない見出しではそれを外す。 */
  .subpanel .gt.is-static { cursor: default; }
  .subpanel .gt.is-static:hover { background: transparent; }
  /* Group body — vertical stack of menu rows, no extra padding */
  .subpanel-body {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  /* Collapsed group — chev rotates (DS .gt.is-collapsed) + body hidden */
  .subpanel-group .gt.is-collapsed + .subpanel-body { display: none; }
  /* SubPanel 検索 (subpanel.js が注入)。検索中は折りたたみを無視してヒット項目を表示 */
  .subpanel-search { padding: 4px 8px 8px; }
  .subpanel.is-searching .subpanel-group .gt.is-collapsed + .subpanel-body { display: flex; }
  /* Override sm-item inside subpanel: rounded hover island, no row borders.
     Also kill the default <a> underline since rows are anchors. */
  .subpanel .sm-item {
    padding: 10px 12px;
    border-radius: 8px;
    border: 0;
    margin: 0 0 2px 0;
    text-decoration: none;
    color: inherit;
  }
  .subpanel .sm-item + .sm-item { border-top: 0; }
  .subpanel .sm-item:hover { background: var(--brand-navy-50); }
  /* Active = navy filled (uses .active per existing .sm-item convention) */
  .subpanel .sm-item.active {
    background: var(--brand-navy);
    color: var(--text-on-fill);
  }
  .subpanel .sm-item.active .sm-ic,
  .subpanel .sm-item.active .sm-label,
  .subpanel .sm-item.active .sm-tail { color: var(--text-on-fill); }
  /* 2 行目に現在値を出すメニュー（ユーザー設定）。値が長くても 1 行に収める —
     折り返すと行の高さが項目ごとに変わり、一覧としての走査が効かなくなる。 */
  .subpanel .sm-item .sm-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* 「ただの件数」の色は `.badge--quiet` が持つ（2026-09-02 に統合）。
     ここに同じ指定を2重に置く必要はなくなった。 */
  /* ハッシュタグの行。押せる語であることを色で示す（アイコンが無いぶん、色が行の
     種類を示す唯一の手がかりになる）。`--text-brand` は navy そのもので地の文と
     区別が付かないので、`--indigo-500`（リンク・AI 操作に使っている青）を使う。 */
  .subpanel .sm-item.is-tag,
  .subpanel .sm-item.is-tag .sm-value { color: var(--indigo-500); }
  /* アイコンが無い行なので 2 列にする。`.sm-item` の 3 列（auto 1fr auto）のままだと
     ラベルが 1 列目（auto）・件数が 2 列目（1fr）に入り、件数が右端まで行かない。 */
  .subpanel .sm-item.is-tag { grid-template-columns: 1fr auto; }
  /* 選択中は navy-50 で塗るだけ（`.sm-item.active` の navy 塗り＋白文字は、
     タグの一覧では 1 行だけ黒帯になって並びが読めなくなる）。 */
  .subpanel .sm-item.is-tag.active {
    background: var(--brand-navy-50);
    color: var(--indigo-600);
    /* navy 塗りを外した代わりに、選択中は左バーで示す（面だけでは 1.14／DS-19）。 */
    box-shadow: inset 3px 0 0 0 var(--border-selected);
  }
  .subpanel .sm-item.is-tag.active .sm-value { color: var(--indigo-600); }
  /* "Load more" inside a group — uses existing .pg-loadmore;
     just nudge it to fit the panel rhythm (full-width, smaller tap area). */
  /* 副パネルの「もっと見る」は枠なしのテキストにする。ここは絞り込みの一覧なので、
     ピル型のボタンにすると項目より目立ってしまい、押す先が「もっと見る」に見える。 */
  .subpanel .pg-loadmore {
    width: 100%;
    justify-content: center;
    height: 32px;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    font-size: 12px; font-weight: 500;
    color: var(--text-secondary);
  }
  .subpanel .pg-loadmore:hover { background: var(--int-hover); color: var(--text-primary); }
  .subpanel .pg-loadmore .ic { width: 14px; height: 14px; }

  /* ---------- Long-press popover ---------- */
  .lp-panel {
    display: inline-block;
    min-width: 240px;
    background: var(--bg-default);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
    padding: 12px;
  }
  .lp-item {
    display: grid; grid-template-columns: 20px 1fr;
    gap: 12px; align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px; color: var(--text-primary); font-weight: 500;
    cursor: default;
  }
  .lp-item + .lp-item { margin-top: 4px; }
  /* Divider appears ONLY between safe and destructive groups —
     i.e. on the FIRST .danger / .lp-divide that follows a non-danger item.
     Subsequent danger items sit flush with just the 4px gap. */
  .lp-item:not(.danger):not(.lp-divide) + .lp-item.danger,
  .lp-item:not(.danger):not(.lp-divide) + .lp-item.lp-divide {
    margin-top: 12px;
    position: relative;
  }
  .lp-item:not(.danger):not(.lp-divide) + .lp-item.danger::before,
  .lp-item:not(.danger):not(.lp-divide) + .lp-item.lp-divide::before {
    content: ""; position: absolute;
    left: -12px; right: -12px; top: -6px; height: 1px;
    background: var(--border-default);
  }
  /* Dividers only separate destructive / "warning" actions from safe ones.
     Regular consecutive items sit flush with no line between. */
  .lp-item.no-ic { grid-template-columns: 1fr; text-align: center; color: var(--brand-navy); font-weight: 700; }
  .lp-item.hover { background: var(--brand-navy-50); }
  .lp-item.danger { color: var(--red-500); }
  .lp-item.danger .lp-ic { color: var(--red-500); }
  /* Destructive / warning items use the danger surface on hover */
  .lp-item.danger.hover,
  .lp-item.lp-divide.hover { background: var(--bg-danger); }
  /* Rounded hover island when used inside tt-pop */
  .tt-pop .lp-item {
    border-radius: 12px;
    padding: 14px 16px;
    /* Upgrade to 3-col when sm-ic/sm-label/sm-tail spans are present */
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }
  .tt-pop .lp-item .sm-ic {
    width: 20px; height: 20px; color: var(--text-secondary);
    display:inline-flex; align-items:center; justify-content:center;
  }
  .tt-pop .lp-item .sm-label { font-size: 14px; font-weight: 500; color: inherit; line-height: 20px; }
  .tt-pop .lp-item .sm-desc  { font-size: 12px; color: var(--text-secondary); line-height: 16px; margin-top: 2px; }
  .tt-pop .lp-item .sm-tail  { display:flex; align-items:center; gap: 8px; color: var(--text-tertiary); font-size: 12px; }
  .tt-pop .lp-item .sm-tail .chev { width: 16px; height: 16px; }
  .tt-pop .lp-item.danger .sm-label { color: var(--red-500); }
  .lp-item .lp-ic {
    width: 18px; height: 18px; color: var(--text-secondary);
    display:inline-flex; align-items:center; justify-content:center;
  }

  /* Tooltip popover (light, menu container) — Figma spec:
     border 1px #D1D5DB · radius 8 · shadow 0 4 24 0 #001951 */
  .tt-pop {
    position: relative;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: 0 4px 24px 0 rgba(0,25,81,.15);
    min-width: 240px;
    display: inline-block;
  }
  .tt-pop .tt-pop-body {
    padding: 16px;
    display: flex; flex-direction: column; gap: 8px;
  }
  /* Info variant — tighter padding for text-only hover previews
     (user info, dept path, link preview). Same border/radius/shadow
     as the default (menu) variant; only the inner spacing changes. */
  .tt-pop.is-info .tt-pop-body {
    padding: 8px 12px;
    gap: 4px;
  }
  /* ---------- UserHoverCard（`.uhc-*`）。アバター hover で出る人物カード ----------
     器は `.tt-pop.is-info`。上段の組織パスは `UserListItem` の deptPath と同じ
     `.dept-crumb` / `.dept-row` を使う（一覧の hover と見え方を揃える）。 */
  .uhc-host { display: inline-flex; }
  /* リアクション列（右）と氏名列が同居するので、280px だと氏名列が 90px まで潰れて
     一言の吹き出しが「資格勉強…」で切れる。氏名・かな・一言が入る幅を確保する。 */
  .uhc-pop { min-width: 380px; max-width: 440px; }
  /* 吹き出しはカードの左上に来るので、`is-info` の詰めた余白（8px 12px）だと
     縁や角丸に食い込む。カード側の余白で逃がす。
     `.tt-pop.is-info .tt-pop-body` はクラス 3 つなので、こちらも 3 つにして勝たせる。 */
  .tt-pop.uhc-pop .tt-pop-body { padding: 30px 32px; }
  .uhc-pop .tt-pop-body { padding: 12px; gap: 10px; }
  /* 氏名の行。アバターは 96px（カードでは顔を主役にする）。 */
  .uhc-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
  /* 1 段目：組織。DS の `.dept-crumb` / `.dept-row` をそのまま使う（一覧の hover と同じ形）。
     氏名の列に入るので、長い組織名がカードを押し広げないよう末尾省略だけ足す。 */
  .uhc-org { min-width: 0; margin-bottom: 2px; }
  .uhc-org > .dept-crumb,
  .uhc-org > .dept-row > .dept-name {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .uhc-org > .dept-row > .dept-role { white-space: nowrap; }
  .uhc-main > .avatar { flex: none; }
  .uhc-id { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
  .uhc-name {
    font-family: var(--ff-sans);
    font-size: 16px; line-height: 22px; font-weight: 700;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .uhc-kana {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 返したリアクション。氏名の**右**に、絵文字を大きく + 下に名前。
     アバターのバッジ（絵文字だけ）の意味を確定させるのが役目なので、絵文字を主役にする。 */
  .uhc-rxn {
    flex: none;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    align-self: center;
    min-width: 64px;
    padding-left: 4px;
  }
  .uhc-rxn > .uhc-rxn-emoji { font-size: 36px; line-height: 1; }
  .uhc-rxn > .uhc-rxn-label {
    font-family: var(--ff-sans);
    font-size: 11px; line-height: 15px; font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
  }

  /* ノート（Instagram の Notes と同じ形）。アバターの**上**に置き、下に降りる丸 2 つで
     顔を指す。トークの尻尾は横に突き出して隙間を指すだけで顔を指せないので使わない。
     `.bubble-msg` は使わない — 色も形も違うので、借りて上書きするとトークの吹き出しの
     見た目を書き換えることになる。

     面は白＋大きめの角丸で、文字は primary。カードも白なので、面の色ではなく
     2 段の影（近い影で縁、遠い影で浮き）だけで浮かせる。 */
  .note-bubble {
    position: relative;
    /* `<span>` なので単品では inline になり、padding と max-width が効かない
       （flex/grid の中ではアイテムとしてブロック化されるので気付けない）。 */
    display: inline-block;
    max-width: 100%;
    z-index: 1;
    padding: 8px 14px;
    border-radius: 12px;
    background: var(--bg-default);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 10px rgba(0, 0, 0, .06);
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 18px;
    color: var(--text-primary);
  }
  /* `UserHoverCard` の中での重ね方。顔に対して左上へ 20px ずらし、下辺を顔に少しかぶせる
     （`.avatar` は DOM で後に来るので、z-index が無いと顔が吹き出しを覆う）。
     20px を吸える余白はカード側が持っているので、縁には触らない。 */
  .tt-pop-body > .note-bubble {
    top: -20px; left: -20px;
    align-self: flex-start;
    margin-bottom: -12px;
  }
  /* 丸は面と同じ色・同じ影。大きい方がノート寄り、小さい方が顔寄りで、
     右下へ斜めに下がる（Notes と同じ「思考の雲」の形）。 */
  .note-bubble > .note-bubble__dots > i {
    position: absolute;
    display: block;
    border-radius: 50%;
    background: var(--bg-default);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 10px rgba(0, 0, 0, .06);
  }
  .note-bubble > .note-bubble__dots > i:first-child {
    left: 20px; bottom: -9px;
    width: 20px; height: 20px;
  }
  .note-bubble > .note-bubble__dots > i:last-child {
    left: 40px; bottom: -20px;
    width: 6px; height: 6px;
  }
  /* 面を #fff で固定しているので、ダークだけ暗い面に差し替える。 */
  :root[data-theme="dark"] .note-bubble,
  :root[data-theme="dark"] .note-bubble > .note-bubble__dots > i {
    background: var(--bg-default);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 10px rgba(0, 0, 0, .35);
  }
  /* 60 文字まで入るので折り返す。上限があるので伸び続けることはない。 */
  .note-bubble__text {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4;
    overflow: hidden;
    word-break: break-word;
  }

  /* 操作。氏名との間を罫線で切る（見る情報と押す物を分ける）。
     96px の円と罫線が `.tt-pop-body` の gap（4px）だけで隣り合うと接触して見えるので、
     罫線の側で離す（body の gap は触らない — ノートの丸が顔へ降りる量が変わる）。 */
  .uhc-acts {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-default);
  }
  /* navy の塗りの角丸スクエア。`.iconbtn` は枠だけのゴースト型なので別に持つ。 */
  .uhc-act {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    padding: 0;
    border: 0;
    border-radius: var(--r-8);
    background: var(--brand-navy);
    color: var(--text-on-fill);
    cursor: pointer;
    transition: background .12s ease;
  }
  .uhc-act > .ic { width: 18px; height: 18px; }
  .uhc-act:hover { background: var(--fill-brand-strong); }
  .uhc-act:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }
  /* フォロー中は「押すと解除」なので、塗りを落として現在の状態を示す。 */
  .uhc-act.is-on { background: var(--brand-navy-50); color: var(--brand-navy); }
  .uhc-act.is-on:hover { background: var(--brand-navy-100); }

  /* Tail = 12px square rotated 45°, with 2 adjacent borders.
     The body's 1px border + square's 1px border meet at the tail base and
     read as a single continuous outline. */
  .tt-pop::before {
    content: "";
    position: absolute;
    width: 12px; height: 12px;
    background: var(--bg-default);
  }
  /* Tip is rounded per direction — pick the pre-rotation corner that ends up
     at the tail tip after the rotation, then round only that corner. */

  /* tail pointing UP (popover below anchor) — show top + left borders.
     Rotated +45°: pre-rotation top-left corner ends up at the top (=tip). */
  .tt-pop[data-tail^="top"]::before {
    top: -7px;
    border-top: 1px solid var(--border-default);
    border-left: 1px solid var(--border-default);
    border-radius: 3px 0 0 0;
    transform: rotate(45deg);
  }
  .tt-pop[data-tail="top"]::before       { left: 50%; margin-left: -6px; }
  .tt-pop[data-tail="top-left"]::before  { left: 20px; }
  .tt-pop[data-tail="top-right"]::before { right: 20px; }

  /* tail pointing DOWN (popover above anchor) — bottom + right borders.
     Rotated +45°: pre-rotation bottom-right corner ends up at the bottom tip. */
  .tt-pop[data-tail^="bottom"]::before {
    bottom: -7px;
    border-bottom: 1px solid var(--border-default);
    border-right: 1px solid var(--border-default);
    border-radius: 0 0 3px 0;
    transform: rotate(45deg);
  }
  .tt-pop[data-tail="bottom"]::before       { left: 50%; margin-left: -6px; }
  .tt-pop[data-tail="bottom-left"]::before  { left: 20px; }
  .tt-pop[data-tail="bottom-right"]::before { right: 20px; }

  /* tail pointing LEFT (popover right of anchor) — top + left borders.
     Rotated -45°: pre-rotation top-left corner ends up at the left tip. */
  .tt-pop[data-tail^="left"]::before {
    left: -7px;
    border-top: 1px solid var(--border-default);
    border-left: 1px solid var(--border-default);
    border-radius: 3px 0 0 0;
    transform: rotate(-45deg);
  }
  .tt-pop[data-tail="left"]::before        { top: 50%; margin-top: -6px; }
  .tt-pop[data-tail="left-top"]::before    { top: 20px; }
  .tt-pop[data-tail="left-bottom"]::before { bottom: 20px; }

  /* tail pointing RIGHT (popover left of anchor) — top + right borders.
     Rotated +45°: pre-rotation top-right corner ends up at the right tip. */
  .tt-pop[data-tail^="right"]::before {
    right: -7px;
    border-top: 1px solid var(--border-default);
    border-right: 1px solid var(--border-default);
    border-radius: 0 3px 0 0;
    transform: rotate(45deg);
  }
  .tt-pop[data-tail="right"]::before        { top: 50%; margin-top: -6px; }
  .tt-pop[data-tail="right-top"]::before    { top: 20px; }
  .tt-pop[data-tail="right-bottom"]::before { bottom: 20px; }

  /* Menu item inside popover — rounded-only hover with Navy 50 */
  .tt-pop .sm-item {
    border-radius: 10px;
    padding: 10px 12px;
  }
  .tt-pop .sm-item + .sm-item { border-top: 0; }
  .tt-pop .sm-item.hover,
  .tt-pop .sm-item.active { background: var(--brand-navy-50); box-shadow: inset 3px 0 0 0 var(--border-selected); }

  /* Small anchor dot & label for the tail-matrix demo */
  .tail-trigger {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--brand-navy-100);
    border: 1.5px dashed var(--brand-navy);
  }
  .tail-label {
    font-family: var(--ff-mono);
    font-size: 10px;
    color: var(--text-tertiary);
    letter-spacing: .04em;
  }

  /* Responsive-ish */
  @media (max-width: 1100px) {
    .app { grid-template-columns: 200px 1fr; }
    .main { padding: 40px 32px; }
    .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .g6 { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .g8 { grid-template-columns: repeat(4, minmax(0,1fr)); }
  }

  /* ---------- Lucide icon globals ---------- */
  /* By default, lucide SVGs inherit their parent icon slot's size.
     Parents (like .btn-ic, .sm-ic, .lp-ic, etc.) already set width/height
     and color, so the SVG just needs to fill 100%. */
  [data-lucide] { display: inline-flex; align-items: center; justify-content: center; }
  svg.lucide { width: 100%; height: 100%; stroke: currentColor; fill: none; }

  /* ---------------------------------------------------------------------
     AttachImage — トーク／投稿の入力前プレビュー用サムネイル。
     Figma 仕様: Width 56, rounded corners, navy close-button overlay.
     --------------------------------------------------------------------- */
  .attach-img {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 56px;
    flex: none;
    overflow: visible; /* close button bleeds out */
  }
  .attach-img > .ai-thumb {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: var(--brand-navy-50);
    box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.08);
    display: block;
  }
  .attach-img > .ai-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
  }
  /* Close button (✕) — top-right, overflows bubble slightly */
  .attach-img > .ai-close {
    position: absolute;
    top: 0; right: 0;
    transform: translate(35%, -35%);
    width: 20px; height: 20px;
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9999px;
    background: var(--brand-navy);
    color: var(--text-on-fill);
    border: 1.5px solid var(--bg-default);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 25, 81, 0.16);
    transition: background .12s ease, transform .08s ease;
    z-index: 2;
  }
  .attach-img > .ai-close:hover {
    background: var(--fill-brand-strong);
  }
  .attach-img > .ai-close:active {
    transform: translate(35%, -35%) scale(0.94);
  }
  .attach-img > .ai-close .ic {
    width: 10px; height: 10px;
    stroke-width: 3;
  }

  /* Size variants (optional) — 40 / 56 / 72 / 96 */
  .attach-img.s-40 { width: 40px; height: 40px; }
  .attach-img.s-40 > .ai-thumb { border-radius: 8px; }
  .attach-img.s-40 > .ai-close { width: 16px; height: 16px; border-width: 1.5px; }
  .attach-img.s-40 > .ai-close .ic { width: 8px; height: 8px; }
  .attach-img.s-72 { width: 72px; height: 72px; }
  .attach-img.s-72 > .ai-thumb { border-radius: 12px; }
  .attach-img.s-72 > .ai-close { width: 22px; height: 22px; }
  .attach-img.s-72 > .ai-close .ic { width: 12px; height: 12px; }
  .attach-img.s-96 { width: 96px; height: 96px; }
  .attach-img.s-96 > .ai-thumb { border-radius: 14px; }
  .attach-img.s-96 > .ai-close { width: 24px; height: 24px; }
  .attach-img.s-96 > .ai-close .ic { width: 13px; height: 13px; }

  /* Loading / uploading state — progress ring overlay */
  .attach-img.is-loading > .ai-thumb::after {
    content: "";
    position: absolute; inset: 0;
    background: rgba(0, 25, 81, 0.40);
    border-radius: inherit;
  }
  .attach-img .ai-spinner {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-on-fill);
    pointer-events: none;
  }
  .attach-img:not(.is-loading) .ai-spinner { display: none; }

  /* ---------------------------------------
     AttachFile — 添付ファイル（非画像）チップ
     Figma: attachment/File
     ---------------------------------------
     ファイルアイコン + ファイル名 + サイズ + 右上 ✕。
     画像添付（.attach-img）との並び使用を想定し、
     高さは 56px に揃え、横幅は中身に応じて伸縮する（max-width でクランプ）。 */
  .attach-file {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: none;
    height: 56px;
    /* 右側は ✕ ボタンを内側に収めるぶんの padding を確保（28px ボタン + 8px マージン） */
    padding: 0 44px 0 14px;
    background: var(--gray-50);
    border-radius: 12px;
    max-width: 320px;
    overflow: hidden; /* チップ内に収まるよう clip */
    text-decoration: none;
    color: inherit;
  }
  .attach-file > .af-icon {
    flex: none;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
  }
  .attach-file > .af-icon .ic {
    width: 24px;
    height: 24px;
    stroke-width: 1.75;
  }
  .attach-file > .af-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 2px;
  }
  .attach-file .af-name {
    display: flex;
    align-items: baseline;
    min-width: 0;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: var(--text-primary);
  }
  /* 長いファイル名は「ファイル名….拡張子」で省略。
     base 側を ellipsis、ext 側を固定で右に残す。
     省略記号 … と拡張子 .xxx が合わさって「….pdf」のように見える。 */
  .attach-file .af-name-base {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .attach-file .af-name-ext {
    flex: none;
    white-space: nowrap;
  }
  .attach-file .af-size {
    font-size: 12px;
    line-height: 16px;
    color: var(--text-tertiary);
    white-space: nowrap;
  }
  /* Close button — ボックス内に収めるパターン。
     AttachImage（突き出し型）と違い、整然と並べたい添付チップでは
     ✕ をチップ内に収めるのが現代的（iOS Files / Notion / Linear / Figma）。
     強調は控えめに、secondary 文字色 + hover で濃くする。 */
  .attach-file > .af-close {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 28px; height: 28px;
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9999px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
    z-index: 2;
  }
  .attach-file > .af-close:hover {
    background: var(--gray-100);
    color: var(--text-primary);
  }
  .attach-file > .af-close:active { transform: translateY(-50%) scale(0.94); }
  .attach-file > .af-close .ic { width: 16px; height: 16px; stroke-width: 2; }

  /* Loading / uploading state */
  .attach-file.is-loading { opacity: 0.72; }
  .attach-file.is-loading .af-name { color: var(--text-secondary); }

  /* Non-interactive variant — for placements where the href is a dummy "#" (no real link to
     follow), so hover doesn't imply clickability. Re-enables pointer-events on af-close so the
     remove button (if any) stays clickable — but :hover still bubbles up to the <a> from that
     re-enabled descendant regardless of the anchor's own pointer-events:none, so the global
     `a:hover { text-decoration: underline }` (line 227) still matched; override it back off here
     (higher specificity than the plain `a:hover`, no !important needed). */
  .attach-file.is-static { pointer-events: none; }
  .attach-file.is-static > .af-close { pointer-events: auto; }
  .attach-file.is-static:hover { text-decoration: none; }

  /* Corner-bleed close button — opt-in alternative to the boxed-in .af-close above, for screens
     that want the same close affordance as AttachImage's .ai-close (a navy circle straddling the
     top-right corner) instead of the "modern app" boxed-in default. Base .attach-file clips its
     own overflow (so long names don't spill out) — that would also clip the bled-out badge, so
     this variant opts back out of clipping, same as .attach-img's own "overflow: visible". */
  .attach-file.is-corner-close { overflow: visible; }
  .attach-file.is-corner-close > .af-close {
    top: 0; right: 0;
    transform: translate(35%, -35%);
    width: 22px; height: 22px;
    background: var(--brand-navy);
    color: var(--text-on-fill);
    border: 1.5px solid var(--bg-default);
    box-shadow: 0 1px 2px rgba(0, 25, 81, .16);
  }
  .attach-file.is-corner-close > .af-close:hover { background: var(--fill-brand-strong); color: var(--text-on-fill); }
  .attach-file.is-corner-close > .af-close:active { transform: translate(35%, -35%) scale(0.94); }
  .attach-file.is-corner-close > .af-close .ic { width: 12px; height: 12px; }

  /* Compact variant (height 40) — チャット送信済みメッセージ内など、
     控えめに見せたい場面で使う */
  .attach-file.s-40 {
    height: 40px;
    padding: 0 36px 0 10px;
    gap: 8px;
    border-radius: 10px;
    max-width: 260px;
  }
  .attach-file.s-40 > .af-icon { width: 20px; height: 20px; }
  .attach-file.s-40 > .af-icon .ic { width: 18px; height: 18px; }
  .attach-file.s-40 .af-name { font-size: 13px; line-height: 18px; }
  .attach-file.s-40 .af-size { font-size: 11px; line-height: 14px; }
  .attach-file.s-40 > .af-close { width: 22px; height: 22px; right: 6px; }
  .attach-file.s-40 > .af-close .ic { width: 14px; height: 14px; }

  /* ---------------------------------------
     SentImageGallery — 送信済みメッセージ内の添付画像ギャラリー
     Figma: attachment/Gallery
     ---------------------------------------
     1〜6+枚の画像を固定アスペクト比で組む。Messenger / LINE と同じ "左大 + 右段積み" の定番構成。
     - .sig は外枠（max-width 360px, radius 14, overflow hidden, gap 2px）
     - アイテム数に応じて .n-1 〜 .n-6 のクラスを付与（6+ は .n-6 + 最後に .sig-more オーバーレイ）
     - 各セルは <div class="sig-cell"><img></div>（object-fit: cover） */
  .sig {
    display: grid;
    gap: 2px;
    width: 100%;
    /* 既定は吹き出しの中の大きさ。**投稿カードでは `is-wide` で外す**（2026-09-25、依頼）。 */
    max-width: 360px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--border-default); /* gap 間の線色 */
  }
  .sig.is-wide { max-width: none; }
  .sig .sig-cell {
    position: relative;
    overflow: hidden;
    background: var(--brand-navy-50);
  }
  .sig .sig-cell > img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
  }

  /* 1枚 — 4:3 単枚 */
  .sig.n-1 { grid-template-columns: 1fr; aspect-ratio: 4 / 3; }

  /* 2枚 — 左右 1:1 */
  .sig.n-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1; }

  /* 3枚 — 左大(2行ぶち抜き) + 右縦2 */
  .sig.n-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 1 / 1;
  }
  .sig.n-3 > .sig-cell:nth-child(1) { grid-row: 1 / span 2; }

  /* 4枚 — 2x2 */
  .sig.n-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 1 / 1;
  }

  /* 5枚 — 左縦2 + 右縦3 */
  .sig.n-5 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(6, 1fr);
    aspect-ratio: 1 / 1.1;
  }
  .sig.n-5 > .sig-cell:nth-child(1) { grid-column: 1; grid-row: 1 / span 3; }
  .sig.n-5 > .sig-cell:nth-child(2) { grid-column: 1; grid-row: 4 / span 3; }
  .sig.n-5 > .sig-cell:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
  .sig.n-5 > .sig-cell:nth-child(4) { grid-column: 2; grid-row: 3 / span 2; }
  .sig.n-5 > .sig-cell:nth-child(5) { grid-column: 2; grid-row: 5 / span 2; }

  /* 6枚以上 — 左大(3行ぶち抜き) + 右縦3、最後のセルに +N オーバーレイ */
  .sig.n-6 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    aspect-ratio: 1 / 1.1;
  }
  .sig.n-6 > .sig-cell:nth-child(1) { grid-row: 1 / span 3; }

  /* +N オーバーレイ（6枚以上の最後のセル）*/
  .sig .sig-cell .sig-more {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: var(--text-on-fill);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
    pointer-events: none;
  }

  /* ---------------------------------------
     IconTextCounter (拍手・スター等の反応カウンター)
     ---------------------------------------
     アイコン + 数字のミニ button。HoverActionMenu / 投稿足元 / コメント脇など
     "反応 = アイコン + 件数" を見せる場面で使う最小単位。
     - 既定: tertiary 文字 + アイコン、hover で navy-50 背景
     - .is-on: 自分が反応済み = magenta 文字 + magenta-50 背景
     - .is-disabled / [disabled]: 反応不可（自分自身の投稿等）
     - 数字は必ず tabular-nums で桁揺れを防ぐ */
  .icotxt {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 6px;
    border-radius: 6px;
    background: transparent;
    border: 0;
    color: var(--text-tertiary);
    font-family: var(--ff-sans);
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
  }
  .icotxt:hover { background: var(--brand-navy-50); color: var(--text-secondary); }
  .icotxt:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 1px; }
  .icotxt .ic,
  .icotxt svg.lucide { width: 14px; height: 14px; flex: none; }
  .icotxt .icotxt-num {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
  }
  /* Reacted state — magenta */
  /* トーンの面に載る文字は**塗りの段階(500)ではなく文字の段階(700)**を使う（DS-22）。
     500 だとダークで 4.23 と割れる（面も文字も明るい側へ寄るため）。 */
  .icotxt.is-on { color: var(--magenta-700); background: var(--magenta-50); }
  .icotxt.is-on:hover { background: var(--magenta-100); }
  .icotxt.is-on .ic { fill: currentColor; stroke-width: 1.5; }
  /* Disabled */
  .icotxt:disabled,
  .icotxt.is-disabled {
    color: var(--text-disabled); cursor: not-allowed;
    background: transparent;
  }

  /* ---------------------------------------
     HoverActionMenu — メッセージ右上に浮かぶアクション群
     ---------------------------------------
     コメント / レター本文 / トークメッセージにマウスを乗せたとき、
     右上に浮かぶ白カード。.iconbtn を 3〜6 個並べる。
     破壊的アクション（削除等）は右端に分離し、間に .hover-menu-div を挟む。
     置き場所は親側 position: relative + .hover-menu に position: absolute で。 */
  .hover-menu {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: var(--shadow-2, 0 2px 8px rgba(17, 24, 39, 0.08));
    z-index: 5;
  }
  .hover-menu .iconbtn { width: 28px; height: 28px; }
  .hover-menu .iconbtn .ic,
  .hover-menu .iconbtn svg.lucide { width: 16px; height: 16px; }
  /* 破壊的アクションの分離線 */
  .hover-menu-div {
    width: 1px;
    height: 16px;
    background: var(--border-default);
    margin: 0 2px;
    flex: none;
  }

  /* ---------------------------------------
     NewArrivalPill — フィード新着告知
     ---------------------------------------
     フィード上部に浮かぶ "新着 N 件" の丸 pill。クリックで先頭にスクロール。
     親側で position: sticky; top: 16px; を付けて使う。
     - 既定: navy 塗り（コメント / 通常更新）
     - .is-magenta: 未読系（レター / 重要なお知らせ） */
  .new-arrival {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px 0 12px;
    border: 0;
    border-radius: 999px;
    background: var(--brand-navy);
    color: var(--text-on-fill);
    font-family: var(--ff-sans);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-2, 0 2px 8px rgba(17, 24, 39, 0.16));
    transition: background-color .12s ease, transform .12s ease;
  }
  .new-arrival:hover { background: var(--fill-brand-strong); }
  .new-arrival:active { transform: translateY(1px); }
  .new-arrival:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }
  .new-arrival .ic,
  .new-arrival svg.lucide { width: 14px; height: 14px; flex: none; }
  .new-arrival.is-magenta { background: var(--fill-magenta); }
  .new-arrival.is-magenta:hover { background: var(--fill-magenta); }

  /* Row: multiple attachments */
  .attach-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
  }

  /* ==========================================================
     Pagination (Figma: pagination)
     —————————————————————————————————————————————————————————————
     ・管理画面・検索結果・メンバー一覧など件数の多いリストで使う
     ・プロダクト中心は「ロードモア」だが、ページ番号が必要な画面も
       少数存在するため両方をシステム化する
     ・数字は必ず tabular-nums で桁揺れを防ぐ
     ========================================================== */

  /* 1. Full — 番号リスト型 */
  .pagination {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums;
    /* 親に align を委ねる — align-self/margin で配置 */
  }
  .pagination .pg-item {
    flex: none;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-control);
    background: var(--bg-default);
    color: var(--text-secondary);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
    user-select: none;
    text-decoration: none;
  }
  .pagination .pg-item:hover:not(.is-active):not(.is-disabled):not(.pg-ellipsis) {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--text-primary);
  }
  .pagination .pg-item:focus-visible {
    outline: none;
    border-color: var(--brand-navy);
    box-shadow: 0 0 0 3px var(--brand-navy-50);
  }
  .pagination .pg-item.is-active {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: var(--text-on-fill);
    cursor: default;
  }
  .pagination .pg-item.is-disabled {
    color: var(--text-placeholder);
    background: var(--bg-default);
    border-color: var(--gray-200);
    cursor: not-allowed;
    opacity: 0.55;
  }
  .pagination .pg-item.pg-nav {
    /* prev/next 矢印のみのボタン */
    padding: 0;
    width: 36px;
  }
  .pagination .pg-item.pg-nav .ic {
    width: 16px;
    height: 16px;
  }
  .pagination .pg-item.pg-ellipsis {
    border-color: transparent;
    background: transparent;
    color: var(--text-placeholder);
    cursor: default;
    padding: 0 6px;
    min-width: 28px;
    letter-spacing: 2px;
  }

  /* Size — small / default / large */
  .pagination.s-sm .pg-item { min-width: 28px; height: 28px; padding: 0 8px; font-size: 12px; border-radius: 8px; }
  .pagination.s-sm .pg-item.pg-nav { width: 28px; padding: 0; }
  .pagination.s-sm .pg-item.pg-nav .ic { width: 14px; height: 14px; }

  .pagination.s-lg .pg-item { min-width: 44px; height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
  .pagination.s-lg .pg-item.pg-nav { width: 44px; padding: 0; }
  .pagination.s-lg .pg-item.pg-nav .ic { width: 18px; height: 18px; }

  /* 2. Compact — "3 / 10" 型。狭い場所向け */
  .pg-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
  }
  .pg-compact .pg-nav {
    flex: none;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--gray-200);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  }
  .pg-compact .pg-nav:hover:not(.is-disabled) {
    background: var(--gray-50);
    color: var(--text-primary);
  }
  .pg-compact .pg-nav.is-disabled {
    color: var(--text-placeholder);
    cursor: not-allowed;
    opacity: 0.55;
  }
  .pg-compact .pg-nav .ic { width: 14px; height: 14px; }
  .pg-compact .pg-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 8px;
    min-width: 60px;
    text-align: center;
  }
  .pg-compact .pg-label .pg-total { color: var(--text-tertiary); font-weight: 500; }

  /* 3. Load more — プロダクト既定 */
  .pg-loadmore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid var(--gray-200);
    background: var(--bg-default);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  }
  .pg-loadmore:hover:not(.is-disabled):not(.is-loading) {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--text-primary);
  }
  .pg-loadmore .ic { width: 14px; height: 14px; }
  .pg-loadmore.is-loading { color: var(--text-tertiary); cursor: default; }
  .pg-loadmore.is-loading .pg-spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--gray-200);
    border-top-color: var(--brand-navy);
    animation: pg-spin 0.7s linear infinite;
  }
  @keyframes pg-spin { to { transform: rotate(360deg); } }
  .pg-loadmore.is-disabled { color: var(--text-placeholder); cursor: not-allowed; opacity: 0.55; }
  /* hint beneath loadmore — "12 / 245件表示中" */
  .pg-loadmore-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    text-align: center;
  }

  /* ===== Stepper (Panels with border) ===========================
     フォームウィザード用の横並びステッパー。
     3 状態: .is-complete / .is-current / .is-incomplete
     RECOG 調整: indigo → navy-500、complete の丸 → teal-500
  ================================================================ */
  .stepper {
    display: flex;
    width: 100%;
    border: 1px solid var(--border-default);
    border-radius: 0;
    background: var(--bg-default);
    overflow: hidden;
  }
  .step {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    padding: 20px 24px 20px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-default);
    text-decoration: none;
    color: inherit;
  }
  .step + .step { padding-left: 48px; } /* chevron 分の逃げ */
  /* chevron separator: 直前の step の右端から次の step に食い込む三角 */
  .step + .step::before,
  .step + .step::after {
    content: "";
    position: absolute;
    left: 0;
    width: 24px;
    background: var(--bg-default);
  }
  .step + .step::before {
    top: 0;
    bottom: 50%;
    transform: translateX(-12px) skewX(22deg);
    border-right: 1px solid var(--border-default);
  }
  .step + .step::after {
    top: 50%;
    bottom: 0;
    transform: translateX(-12px) skewX(-22deg);
    border-right: 1px solid var(--border-default);
  }
  .step__marker {
    width: 40px; height: 40px;
    flex: none;
    border-radius: 9999px;
    display: inline-grid; place-items: center;
    font-family: var(--ff-mono);
    font-weight: 600;
    font-size: 14px;
    border: 2px solid var(--border-default);
    color: var(--text-tertiary);
    background: var(--bg-default);
  }
  .step__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .step__title {
    font-family: var(--ff-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    line-height: 18px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .step__desc {
    font-size: 13px;
    line-height: 18px;
    color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  /* Current */
  .step.is-current .step__marker {
    border-color: var(--brand-navy);
    color: var(--brand-navy);
  }
  .step.is-current .step__title { color: var(--brand-navy); }
  .step.is-current::after-bar {}
  .step.is-current {
    box-shadow: inset 0 -3px 0 0 var(--brand-navy);
  }

  /* Complete */
  .step.is-complete .step__marker {
    background: var(--fill-success);
    border-color: var(--fill-success);
    color: var(--text-on-fill);
  }
  .step.is-complete .step__title { color: var(--text-primary); }

  /* Incomplete — デフォルトのまま（tertiary 系） */

  /* =========================================================
     StepDots — コンパクトなステップ進行表示
     狭い幅（SidePanel / Modal / モバイル）向け。Stepper が
     横に詰まって読めなくなる場面で使う。ドット＋コネクタの帯と
     「現在地ラベル（2 / 4 ステップ名）」の 2 段構成。
     **色と形は StepBar と同じ**（2026-09-13 に揃えた）：未到達＝灰の輪郭 / 現在地＝navy の
     ベタ塗り / 済み＝navy の輪郭とチェック、通り過ぎた区間の線だけ navy。
     以前は完了が teal のベタ塗りで、現在地が navy の輪郭——**同じ画面の中で StepBar と
     塗りと輪郭が逆**になっていて、どちらが現在地か読み直すことになっていた。
     ========================================================= */
  .stepdots { display: flex; flex-direction: column; gap: 10px; }
  .stepdots__track { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; }
  .stepdots__node { display: flex; align-items: center; flex: 1 1 0; min-width: 0; }
  .stepdots__node:last-child { flex: 0 0 auto; }
  .stepdots__dot {
    width: 28px; height: 28px; flex: none;
    border-radius: 9999px;
    display: inline-grid; place-items: center;
    font-family: var(--ff-mono); font-weight: 700; font-size: 13px;
    border: 2px solid var(--border-strong);
    color: var(--text-tertiary);
    background: var(--bg-default);
  }
  .stepdots__dot .ic, .stepdots__dot svg { width: 15px; height: 15px; }
  .stepdots__node::after {
    content: ""; flex: 1 1 auto; height: 2px;
    background: var(--border-default); margin: 0 8px; border-radius: 2px;
  }
  .stepdots__node:last-child::after { display: none; }
  /* 済んだ段＝白地に navy の輪郭とチェック。**塗らない**——塗ると現在地と同じ重さになる
     （`.stepbar__step.is-complete` と同じ扱い）。 */
  .stepdots__node.is-complete .stepdots__dot { background: var(--bg-default); border-color: var(--brand-navy); color: var(--brand-navy); }
  /* 通り過ぎた区間の線だけ navy。どこまで来たかを線が持つ（StepBar の `is-done` と同じ）。 */
  .stepdots__node.is-complete::after { background: var(--brand-navy); }
  /* 現在地＝navy のベタ塗り。輪郭 → 塗り → チェック、と**形が変わる**ので、
     色が見えない条件でも「これから／いま／済んだ」が読める（WCAG 1.4.1）。 */
  .stepdots__node.is-current .stepdots__dot { background: var(--brand-navy); border-color: var(--brand-navy); color: var(--text-on-fill); }
  /* Label */
  .stepdots__label { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
  .stepdots__count { font-weight: 700; color: var(--text-primary); margin-right: 8px; font-variant-numeric: tabular-nums; }

  /* =========================================================
     StepBar — 番号付き横ステップインジケーター
     ウィザード型フォーム（複数ステップの申請・アンケート）向け。
     小さめの番号丸＋ラベル併記＋細い区切り線を、白いバーに収める。
     未到達＝灰の輪郭 / 現在＝navy のベタ塗り / 完了＝navy の輪郭とチェック。
     （見出しが「完了＝teal / 現在＝navy 塗り＋リング」のまま下の指定と食い違っていたので直した。
     実際の値は下の各指定とそこのコメントが正本。）
     ========================================================= */
  .stepbar {
    display: flex; align-items: center; gap: 8px; width: 100%;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 16px 24px;
    box-shadow: var(--shadow-1);
  }
  .stepbar__step {
    display: flex; align-items: center; gap: 8px;
    flex: 1 1 0; min-width: 0;
    text-decoration: none; color: inherit; background: none; border: 0;
    font: inherit; cursor: default; padding: 0;
  }
  /* 押せる段（`onClick` を渡した段だけ）。**下線と色の両方**を動かす——下線だけだと
     弱くて押せると気づかれず、色だけだと色の見えない条件で伝わらない（WCAG 1.4.1）。 */
  .stepbar__step.is-clickable { cursor: pointer; }
  .stepbar__step.is-clickable:hover .stepbar__label {
    color: var(--brand-navy); font-weight: 700; text-decoration: underline;
  }
  .stepbar__step.is-clickable:hover .stepbar__num {
    border-color: var(--brand-navy); color: var(--brand-navy); background: var(--brand-navy-50);
  }
  .stepbar__step.is-clickable:focus-visible {
    outline: 2px solid var(--brand-navy); outline-offset: 3px; border-radius: 6px;
  }
  /*
   * 丸は**塗らずに輪郭で置く**（2026-09-11）。以前は未到達も灰色のベタ塗りで、現在地（navy の
   * ベタ塗り）との違いが**色だけ**だった。輪郭 → 塗り → チェック、と形が変わるほうが、
   * 白黒でも「これから／いま／済んだ」が読める（WCAG 1.4.1）。
   */
  .stepbar__num {
    width: 26px; height: 26px; flex: none;
    border-radius: 9999px;
    display: inline-grid; place-items: center;
    font-family: var(--ff-mono); font-weight: 600; font-size: 12px;
    background: var(--bg-default); color: var(--text-tertiary);
    /* 丸は数字を載せる器＝意味のある部品なので、枠は 3:1 を満たす `--border-strong`
       （`--border-default` は 1.24 で、装飾の区切り用）。 */
    border: 1.5px solid var(--border-strong);
    transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
  }
  .stepbar__num .ic, .stepbar__num svg { width: 14px; height: 14px; }
  .stepbar__label {
    font-size: 12px; color: var(--text-tertiary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: color .2s;
  }
  /*
   * 繋ぎの線。**通り過ぎた区間だけ navy で太くする**（`StepBar` が `is-done` を付ける）
   * ——線が「どこまで来たか」を持つと、丸を 3 つ見比べなくても進み具合が分かる。
   */
  .stepbar__line { flex: 0 0 56px; height: 1px; background: var(--border-default); }
  .stepbar__line.is-done { height: 2px; background: var(--brand-navy); }
  /* 現在地＝navy のベタ塗り。**光の輪は出さない**——輪は「フォーカスが当たっている」の記号で、
     この DS では `:focus-visible` が同じ形を使う。現在地は塗りと字の太さで足りる。 */
  .stepbar__step.is-current .stepbar__num {
    background: var(--brand-navy); color: var(--text-on-fill); border-color: var(--brand-navy);
  }
  /* いま居る段だけ**本文の色**で太く。navy にすると、済んだ段の navy の丸と同じ色が
     2 か所に出て、どちらが現在地か読み直すことになる。 */
  .stepbar__step.is-current .stepbar__label { color: var(--text-primary); font-weight: 700; }
  /* 済んだ段＝白地に navy の輪郭とチェック。**塗らない**——塗ると現在地と同じ重さになる。 */
  .stepbar__step.is-complete .stepbar__num {
    background: var(--bg-default); color: var(--brand-navy); border-color: var(--brand-navy);
  }
  .stepbar__step.is-complete .stepbar__label { color: var(--text-secondary); font-weight: 500; }
  /* bare：ツールバーに埋め込むためパネル装飾を外し、ステップを自然幅で左詰めに */
  .stepbar.is-bare {
    background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; width: auto;
  }
  .stepbar.is-bare .stepbar__step { flex: 0 0 auto; }
  @media (max-width: 640px) {
    .stepbar { padding: 12px; }
    .stepbar__label { display: none; }
    .stepbar__line { flex: 1; }
  }
  /* 新規ウィザードの上部ツールバー：1枚の白パネルに StepBar＋カウンター＋プレビュー */
  /* StepBar を載せた追従バーの右側（カウンター・プレビュー等）。アンケートの新規ウィザードと
     みつもりんの依頼作成が共有する。`sv-` 接頭辞だった名前を、画面に依らない名前へ直した
     （2026-09-14）——同じ形を 2 画面で使うのに、片方の画面名が付いていると読めない。 */
  .stk-tabbar__right { display: flex; align-items: center; gap: 16px; flex: none; }
  .stk-tabbar__count { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }

  /* =========================================================
     FormCard — 回答者フォームのセクションカード
     navy-50 のヘッダーバー（タイトル）＋本文。ウィザード型フォーム
     （アンケート回答者ビュー・申請フォーム）の 1 セクションを表す。
     ヘッダー無し（.fcard__body だけ）でも使える。
     ========================================================= */
  .fcard {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-1);
  }
  .fcard__head {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-default);
    background: var(--brand-navy-50);
  }
  .fcard__title { font-size: 14px; font-weight: 700; color: var(--brand-navy); margin: 0; }
  .fcard__desc { font-size: 12px; color: var(--text-secondary); margin: 6px 0 0; }
  .fcard__body { padding: 22px 24px; display: flex; flex-direction: column; gap: 22px; }

  /* =========================================================
     OptCard — 選択肢カード（回答者フォーム）
     枠付きの選択肢行。チェック/ラジオ＋ラベル（＋補足）。
     hover で navy-50、選択中（.is-selected）で navy 枠＋navy-50 背景。
     ========================================================= */
  .optcard {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    background: var(--bg-default);
    cursor: pointer;
    transition: border-color .15s, background .15s;
  }
  .optcard:hover { border-color: var(--brand-navy-100); background: var(--brand-navy-50); }
  .optcard.is-selected { border-color: var(--brand-navy); background: var(--brand-navy-50); }
  .optcard input[type="checkbox"], .optcard input[type="radio"] {
    width: 16px; height: 16px; flex: none; margin-top: 2px;
    accent-color: var(--brand-navy); cursor: pointer;
  }
  .optcard__text { flex: 1; min-width: 0; font-size: 13px; }
  /* 主ラベルと補足は 2 行にする。`<span>` のままだと inline で横に繋がり、
     `.optcard__sub` の `margin-top` も効かない（補足付きで使うと 1 行に潰れる）。 */
  .optcard__main { display: block; font-weight: 500; color: var(--text-primary); }
  .optcard__sub { display: block; margin-top: 3px; font-size: 11px; color: var(--text-secondary); }
  .optcard.is-disabled { opacity: .6; cursor: default; }
  .optcard-list { display: flex; flex-direction: column; gap: 8px; }

  /* =========================================================
     StatCard — ダッシュボードの KPI 数値カード
     ========================================================= */
  .statcard {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 16px 18px;
  }
  .statcard__icon {
    width: 36px; height: 36px; flex: none;
    border-radius: 8px;
    display: inline-grid; place-items: center;
    background: var(--brand-navy-50); color: var(--brand-navy);
  }
  .statcard__icon .ic, .statcard__icon svg { width: 18px; height: 18px; }
  .statcard__body { min-width: 0; }
  .statcard__label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; }
  .statcard__value { font-size: 24px; font-weight: 700; color: var(--text-primary); line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
  .statcard__unit { font-size: 13px; font-weight: 600; color: var(--text-tertiary); margin-left: 4px; }
  .statcard__sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

  /* =========================================================
     ChartCard — グラフを載せるカード（タイトル＋本文）
     ========================================================= */
  .chartcard {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: 18px 20px;
  }
  .chartcard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .chartcard__title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 0; display: flex; align-items: center; gap: 8px; }
  .chartcard__meta { font-size: 12px; color: var(--text-tertiary); flex: none; }
  /* Recharts のフォーカス枠を消す */
  .chartcard .recharts-wrapper:focus,
  .chartcard .recharts-surface:focus { outline: none; }

  /* =========================================================
     AISummary — AI による自動要約カード
     ========================================================= */
  .aisummary {
    border: 1px solid var(--border-default);
    border-radius: 12px;
    background: var(--bg-default);
    overflow: hidden;
  }
  .aisummary__head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(90deg, var(--brand-navy-50), color-mix(in srgb, var(--magenta-500) 8%, var(--bg-default)));
    border-bottom: 1px solid var(--border-default);
  }
  .aisummary__icon {
    width: 30px; height: 30px; flex: none;
    border-radius: 8px; display: inline-grid; place-items: center;
    background: var(--brand-navy); color: var(--text-on-fill);
  }
  .aisummary__icon .ic, .aisummary__icon svg { width: 17px; height: 17px; }
  .aisummary__title { font-size: 14px; font-weight: 700; color: var(--brand-navy); margin: 0; }
  .aisummary__body { padding: 18px; }
  .aisummary__lead { font-size: 13px; color: var(--text-secondary); line-height: 1.75; margin: 0; }
  .aisummary__sec { margin-top: 18px; }
  .aisummary__sec-title { font-size: 12px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
  .aisummary__sec-title .ic, .aisummary__sec-title svg { width: 15px; height: 15px; flex: none; }
  .aisummary__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
  .aisummary__list li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
  .aisummary__list li .ic, .aisummary__list li svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
  .aisummary__note { margin: 18px 0 0; font-size: 11px; color: var(--text-tertiary); display: flex; align-items: center; gap: 6px; }
  .aisummary__note .ic, .aisummary__note svg { width: 13px; height: 13px; flex: none; }

  /* Toast 容れ物（**画面の中央**・固定）。下中央 → 右上 → 中央と動かした（2026-09-18）。
     下中央は SaveBar（`.savebar`）と同じ場所で保存バーに重なり、右下は Intercom の起動ボタン
     （`--app-right-inset`）が居る。中央は結果がいちばん目に入る場所。
     **`pointer-events: none` を容れ物に置く。** 中央は本文の真上なので、これが無いと通知が
     消えるまでの数秒、画面の真ん中がクリックできない（`.toast` 側だけ auto に戻して
     「取り消す」を押せるようにする）。 */
  .toast-host {
    position: fixed; top: 50%; left: 50%; z-index: 1200;
    pointer-events: none;
    animation: toast-in .24s cubic-bezier(.22, 1, .36, 1);
    /* `transform` は @keyframes 側にも書く。**アニメーションの間は宣言側の transform が
       上書きされる**ので、キーフレームに中央寄せを含めないと最初の 0.24 秒だけ左上へずれる。 */
    transform: translate(-50%, -50%);
  }
  .toast-host .toast { pointer-events: auto; max-width: calc(100vw - 24px); }
  @keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }
  /* モーション過敏設定のユーザーには拡大を出さず、フェードのみにする（SaveBar と同じ作法） */
  @media (prefers-reduced-motion: reduce) {
    .toast-host { animation: toast-fade .18s ease-out; }
    @keyframes toast-fade {
      from { opacity: 0; transform: translate(-50%, -50%); }
      to   { opacity: 1; transform: translate(-50%, -50%); }
    }
  }
  /* 狭い画面では画面幅に合わせる（Toast の min-width: 320px が横からはみ出さないように） */
  @media (max-width: 480px) {
    .toast-host .toast { min-width: 0; width: calc(100vw - 24px); box-sizing: border-box; }
  }

  /* DescriptionList — 「ラベル / 値」確認リスト（任意のグループ見出し付き） */
  .dl-group + .dl-group { margin-top: 20px; }
  .dl-heading {
    padding: 8px 12px; background: var(--brand-navy-50);
    border-left: 3px solid var(--brand-navy); border-radius: 0 4px 4px 0;
    font-size: 13px; font-weight: 700; color: var(--brand-navy); margin-bottom: 4px;
  }
  .dl-row {
    display: grid; grid-template-columns: var(--dl-label-w, 180px) 1fr; gap: 16px;
    padding: 12px 0; border-bottom: 1px dashed var(--border-default); font-size: 13px;
  }
  .dl-row:last-child { border-bottom: 0; }
  .dl-label { color: var(--text-secondary); font-weight: 500; }
  .dl-value { color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
  .dl-empty { font-size: 13px; color: var(--text-tertiary); margin: 10px 0 0; }
  @media (max-width: 640px) { .dl-row { grid-template-columns: 1fr; gap: 4px; } }

  /* スケルトン（ローディング） */
  .skeleton {
    border-radius: 6px;
    background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border-default) 37%, var(--bg-subtle) 63%);
    background-size: 400% 100%;
    animation: sk-shimmer 1.3s ease-in-out infinite;
  }
  @keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

  /* Block: info-row — "全 245 件中 21–40" + pagination を左右に並べる管理画面用 */
  .pg-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
  }
  .pg-toolbar .pg-range {
    font-size: 13px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
  }
  .pg-toolbar .pg-range b {
    color: var(--text-primary);
    font-weight: 600;
  }

  /* Per-page select — pagination とセットで使う */
  .pg-perpage {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-tertiary);
  }
  .pg-perpage select {
    height: 32px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--bg-default) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 8px center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
  }
  .pg-perpage select:focus-visible {
    outline: none;
    border-color: var(--brand-navy);
    box-shadow: 0 0 0 3px var(--brand-navy-50);
  }

  /* ==========================================================
     Data Table (Figma: data-table)
     —————————————————————————————————————————————————————————————
     ・管理画面・メンバー一覧・ログ・レポートなど大量データの一覧に使う
     ・プロダクト用の表。ドキュメント用の .spec-table とは別系統
     ・列ごとにソート可能（asc / desc / none の 3 状態トグル）
     ・数値は右寄せ + tabular-nums
     ・行 hover で navy-50 ハイライト
     ・密度：default (row 52px) / compact (row 40px)
     ========================================================== */
  .dt-wrap {
    /* 行が 0 件のときの箱の高さを決めるトークン。--dt-page-size は DataTable.tsx が
       いまの表示件数から各テーブルに書き込む。行・ヘッダーの高さは下の padding 定義と対応。
       Height tokens for the zero-row states. DataTable.tsx writes `--dt-page-size` per table
       from the live page size, so the loading box reserves the page it is about to render. */
    --dt-row-h: 50px;    /* 実測: td padding 14+14 + line-height 22（1 行のセル）。fitBody は実測値で上書きする */
    --dt-head-h: 42px;   /* 実測: th padding 12+12 + line-height 18 */
    --dt-page-size: 10;
    /* fitHeight / fitBody の本体の高さ。ビューポートの余りが少ない画面でも
       --dt-min-rows 行までは縮めない（足りなければ表ではなくページ側をスクロールさせる）。
       Body height for the fit modes: the viewport remainder, but never squeezed below
       --dt-min-rows rows — a short window scrolls the page instead of the table. `max-height`
       only caps, so a table with fewer rows than that still sizes to its content (no blank box). */
    /* 表の高さの下限（行数）。ビューポートの余りがこれより少ない画面では、表を縮める代わりに
       ページ側をスクロールさせる。10 行はノート PC（〜800px）でページ全体がスクロールするので
       やめ、どの画面でも同じ 6 行にした（画面ごとに行数が変わると読み手が数え直すことになる）。
       Floor for the table body, in rows: below this the page scrolls instead of the table getting
       squeezed. 10 made an ~800px laptop scroll the whole page, so this is a flat 6 on every
       screen — a row count that changes with the window is one more thing to re-read. */
    --dt-min-rows: 6;
    /* --app-bottom-inset は画面下に浮くもの（Intercom の起動ボタン）が隠す高さ。表の右下は
       ページャの定位置なので、そのぶん短くして起動ボタンの上で終わらせる。浮くものが無い
       ページでは 0（lib/intercom.ts が出しているあいだだけ入る）。
       --app-bottom-inset is how much of the viewport bottom a floating widget covers (the
       Intercom launcher). The pager lives in the table's bottom-right corner — exactly where it
       floats — so the body ends above it. Zero when nothing is floating. */
    /* The capped box holds the header row too (single table, sticky thead), so the floor adds
       one header height — otherwise "6 rows" came out as 5 rows and the header. */
    --dt-fit-max: max(
      calc(var(--dt-row-h) * var(--dt-min-rows) + var(--dt-head-h)),
      calc(100dvh - var(--dt-fit-offset, 324px) - var(--app-bottom-inset, 0px))
    );
    background: var(--bg-default);
    border: 1px solid var(--border-strong);   /* 外枠＝strong（カード/sr-list と統一。内側の行区切りは薄いまま） */
    border-radius: 12px;
    overflow: hidden;
  }
  /* fitHeight: keep a SINGLE <table> and pin the header with position: sticky, so the body
     scrolls under a fixed header. The `.dt-scroll` box owns BOTH scroll axes — this is what
     keeps a stickyFirst column aligned between header and body. (The old approach split the
     table into a block thead + a block tbody; because tbody's overflow-y:auto also forces
     overflow-x:auto, the body became its own horizontal scroll context that drifted away from
     the header, and per-column widths from resizing made the drift visible.)
     控除量 --dt-fit-offset（既定 324px）＝ 上のシェル/ツールバー＋ページ下余白 64px の目安。 */
  /* fitBody（`.dt-fitbody`）も fitHeight と同じ仕組みに乗せる。header を
     スクロール外に出して tbody だけ縦スクロールさせると、tbody が独自の横スクロール
     文脈になり（overflow-y:auto は overflow-x も auto にする）、
       - ヘッダーと本文が横方向にずれる
       - 縦スクロールバーが「本文の右端」＝表の途中に出る
     という 2 つが起きる。単一テーブル + sticky ヘッダーなら、スクロール箱が 1 つなので
     バーは常に表の右端に出て、ヘッダーもずれない。 */
  .dt-wrap.is-fit .dt-scroll,
  .dt-wrap.dt-fitbody .dt-scroll {
    max-height: var(--dt-fit-max);
    overflow: auto;   /* vertical scroll here too, not on a separate tbody box */
  }
  /* maxRows（`.dt-capped`）: 本体を「見出し行 + N 行」の**静的な高さ**で止め、残りは本体の
     中で縦に送る（見出し行は上の fit と同じ sticky）。ページの途中に置く表のため——fitBody は
     表の上端から画面下までで測るので、折り返しより下の表は床（--dt-min-rows）に落ちる。
     `max-height` なので N 行に満たない表は中身の高さのまま。--dt-max-rows は DataTable.tsx が
     prop から書き、--dt-row-h は 1 行目の実測で上書きされる。
     maxRows (`.dt-capped`): cap the body at "header + N rows" — a static height — and scroll
     the rest inside, header pinned like the fit modes. For a table in the middle of a page:
     fitBody measures from the table's top to the viewport bottom, so a table below the fold
     just floors at --dt-min-rows. `max-height` only caps: fewer rows keep their own height.
     DataTable.tsx writes --dt-max-rows from the prop and --dt-row-h from the first row. */
  .dt-wrap.dt-capped {
    --dt-body-max: calc(var(--dt-head-h) + var(--dt-row-h) * var(--dt-max-rows, 10));
  }
  .dt-wrap.dt-capped .dt-scroll {
    max-height: var(--dt-body-max);
    overflow: auto;
  }
  /* `.dt-scroll` を挟んで詳細度を上げる。後方の
     `.data-table thead th:not(.col-sticky) { position: relative; z-index: 0 }` と
     競合するので、確実に勝てる形にしておく。 */
  .dt-wrap.is-fit .dt-scroll .data-table thead th,
  .dt-wrap.dt-fitbody .dt-scroll .data-table thead th,
  .dt-wrap.dt-capped .dt-scroll .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;   /* header stays above body cells while the body scrolls up under it */
    /* border-collapse detaches the border from a sticky cell, so redraw the divider as an
       inset shadow that travels with the header. */
    box-shadow: inset 0 -1px 0 var(--border-default);
  }
  /* Top-left corner cell is sticky on BOTH axes (sticky header + sticky first column) — it
     must sit above the header row and the sticky column. */
  .dt-wrap.is-fit .dt-scroll .data-table thead th.col-sticky,
  .dt-wrap.dt-fitbody .dt-scroll .data-table thead th.col-sticky,
  .dt-wrap.dt-capped .dt-scroll .data-table thead th.col-sticky { z-index: 4; }
  /* 右上の角も同じ（`.col-sticky-end` ＝ 右端に固定した操作列）。上の `thead th` の指定が
     `z-index: 2` を**この詳細度で**当てるので、固定列側で 3 を書いても負ける（実際に負けて、
     横に送ると本文の行が見出しの上に出た）。ここで一緒に 4 へ上げる。 */
  .dt-wrap.is-fit .dt-scroll .data-table thead th.col-sticky-end,
  .dt-wrap.dt-fitbody .dt-scroll .data-table thead th.col-sticky-end,
  .dt-wrap.dt-capped .dt-scroll .data-table thead th.col-sticky-end { z-index: 4; }
  .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: var(--text-primary);
    table-layout: auto;
  }
  .data-table thead th {
    position: relative;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
    user-select: none;
    vertical-align: middle;
  }
  .data-table thead th.is-sortable {
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
  }
  .data-table thead th.is-sortable:hover {
    background: var(--gray-100);
    color: var(--text-primary);
  }
  .data-table thead th.is-sorted {
    color: var(--brand-navy);
  }
  .data-table thead th .th-inner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }
  /* 数値列はヘッダーも右寄せ（セルの右寄せと揃える）。.th-inner の有無どちらでも効く。 */
  .data-table thead th.is-num { text-align: right; }
  .data-table thead th.is-num .th-inner {
    justify-content: flex-end;
    width: 100%;
  }
  /* Sort indicator — 3 state: none (↑↓ dim) / asc (↑) / desc (↓)
     アイコンは lucide（ArrowUpDown / ArrowUp / ArrowDown）。効いている向きを 1 本の矢印で
     言い切る（上下 2 本を薄く並べる形は、どちらが効いているのか一目で分からなかった）。 */
  .data-table .sort-ic {
    width: 14px; height: 14px;
    flex: none;
    color: var(--text-placeholder);
    opacity: 0.7;
  }
  /* 分析レルムのテーブルに**列間の縦罫は引かない**（2026-08-29）。
     jubel の DataGrid が #E1E9F4 の縦線を全セルに引いていた名残で移植時に持ち込んだが、
     行を区切る横線と両方あると格子になって、罫線そのものが情報を持っているように見える。
     区切りは**行の横線だけ**にして、列の区切りは見出しと余白が担う。
     唯一の例外は固定列の右端（`.col-sticky-last`）で、あれは列の区切りではなく
     「ここまでが固定」の境界。 */

  /* 1 列目の右だけは縦罫を引く（2026-08-30）。**列の区切りではなく、行の名前と値の境目**。
     この realm の表は「数表を棒グラフとして読ませる表」（図5.4.8）で、1 列目＝何を比べて
     いるかの名前、2 列目以降＝比べる値、という役割の違いがある。境目が引かれていないと、
     上から下へ棒をなぞるときに視線の起点が定まらない。
     固定列を持つ表では `.col-sticky-last::after` が同じ位置に線を引くので、二重にしない。 */
  .an-realm .data-table thead th:first-child:not(.col-sticky-last),
  .an-realm .data-table tbody td:first-child:not(.col-sticky-last) {
    border-right: 1px solid var(--border-default);
  }

  /* 列リサイズのつまみ。ホバーで縦バーが浮かび「ここを掴んで動かせる」と分かる。
     つまみは列境界をまたいで置かれ（right: -4px, inline）、バーはその中央＝境界線の真上に引く。
     ツールチップの矢印もつまみ中央を指すので、矢印・バー・境界線が同一線上に揃う。 */
  .dt-resizer {
    position: absolute; top: 0; right: -4px; width: 8px; height: 100%;
    cursor: col-resize; touch-action: none; z-index: 1;
  }
  .dt-resizer::after {
    content: ''; position: absolute; top: 18%; bottom: 18%; left: 50%; width: 2px;
    transform: translateX(-50%);
    border-radius: 1px; background: transparent; transition: background .12s ease;
  }
  .dt-resizer:hover::after { background: var(--brand-navy); }
  /* 並び替えが効いている列は navy でくっきり出す（薄いままだと「押したのに変わらない」に見える）。 */
  .data-table th.is-sorted .sort-ic {
    opacity: 1;
    color: var(--brand-navy);
  }
  .data-table thead th.is-sortable:hover .sort-ic { opacity: 1; color: var(--text-secondary); }
  .data-table thead th.is-sorted.is-sortable:hover .sort-ic { color: var(--brand-navy); }

  /* Rows */
  .data-table tbody tr {
    transition: background 100ms ease;
  }
  .data-table tbody tr + tr td {
    border-top: 1px solid var(--border-default);
  }
  .data-table tbody tr:hover td {
    background: var(--brand-navy-50);
  }
  /* 数表を棒グラフとして読ませる表（`/design-rules/chart-data-types` 図5.4.8）。
     **罫線は「行を区切る横線だけ」**（2026-08-29 のモックに合わせて変更）。以前は逆で、
     横線を外して列の縦罫だけを残していた（棒を縦に連ねて 1 本のグラフに見せる形）。
     会社組織名を 2 段（末端名＋上位階層）にしたことで 1 行の高さが変わり、縦罫だけでは
     行の切れ目が読めなくなったため、行を区切る側に戻した。縦罫は分析レルム全体で
     引かなくなったので、ここで打ち消す必要はない。 */
  .data-table.is-barchart tbody td { padding-top: 6px; padding-bottom: 6px; }
  /* 人材データの「新規雇用総数比率」の横棒。隣のドーナツ（Recharts）は既定でアニメーションするので、
     横棒だけ静止していると同じカード行で片方だけ止まって見える。Recharts の Pie の既定値
     （開始 400ms・長さ 1500ms・ease）に合わせて、2 つが一緒に立ち上がるようにする。
     幅を伸ばすのは `transform: scaleX()` ではなく `width`。scaleX だと角丸が横に潰れて、
     伸びきるまで別の形に見えるため。伸ばし先は `--w`（呼び出し側が実測値を入れる）。 */
  .an-ratiobar__fill { animation: an-ratiobar-grow 1500ms ease 400ms both; }
  @keyframes an-ratiobar-grow { from { width: 0; } to { width: var(--w); } }
  /* 動きを減らす設定の人には出さない（値そのものは最初から見えている）。 */
  @media (prefers-reduced-motion: reduce) {
    .an-ratiobar__fill { animation: none; width: var(--w); }
  }

  /* 棒の列は**見出しも左寄せ**。棒が左起点で「上から下へなぞる」列なので、見出しが右端に
     張り付いていると、見出しと中身が別々の方向を向く。数値だけはセル内で右揃えのまま
     （桁を揃えて読むため）。`.is-num` の右寄せを上書きするので詳細度を上げている。 */
  .data-table thead th.is-num.dt-bar { text-align: left; }
  .data-table thead th.is-num.dt-bar .th-inner { justify-content: flex-start; }

  /* 棒の左端は**列見出しの文字の左端に揃える**（セルの padding をそのまま使う）。
     以前は `padding-left: 0` で縦罫に付けていたが、縦罫を外したので付ける相手が無くなった。
     見出しと棒が同じ位置から始まるほうが、どの列の棒かが迷わず読める。 */
  .data-table tbody tr.is-selected td {
    background: var(--brand-navy-50);
  }
  .data-table tbody tr.is-selected:hover td {
    background: var(--brand-navy-100);
  }
  /* Rows that are still listed but not in effect — 退職したメンバー / 無効な品目 /
     非表示のバッジ。Dim the cell CONTENT only (not the td itself) so td backgrounds stay solid:
     this prevents hover-color bleed and stacking-context issues with sticky columns.
     All cellOf cases return an element child (span/Tag/…) so td > * covers everything.
     `is-departed` is the older member-specific name; `is-muted` is what the admin tables
     already pass (mitsumorin, badges). Same meaning, so one rule — writing a second rule
     would let the two drift. */
  .data-table tbody tr.is-departed td:not(.col-actions) > *,
  .data-table tbody tr.is-muted td:not(.col-actions) > * {
    opacity: 0.45;
  }
  /* 操作列は薄くしない。非表示に戻す・直すために押すのは**まさにこの行**なので、押せない
     ように見せてはいけない。`rowMenu` の列は `.col-actions` が付くが、画面が自前で組んだ
     操作列にはこのクラスを付ける（opacity は入れ子で掛け算になるので、内側のボタンに 1 を
     当てても戻らない——直下の要素で止める）。 */
  .data-table tbody tr.is-departed td > .dt-actions,
  .data-table tbody tr.is-muted td > .dt-actions {
    opacity: 1;
  }
  .data-table td {
    padding: 14px 16px;
    vertical-align: middle;
    color: var(--text-primary);
    background: var(--bg-default);
    transition: background 100ms ease;
  }
  .data-table td.is-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
  }
  .data-table td.is-muted {
    color: var(--text-tertiary);
  }
  .data-table td.is-dense { padding-top: 10px; padding-bottom: 10px; }

  /* Compact density */
  .data-table.s-compact thead th { padding: 8px 14px; font-size: 11px; }
  .data-table.s-compact td { padding: 10px 14px; font-size: 13px; }

  /* Checkbox column */
  .data-table .col-check { width: 44px; min-width: 44px; padding-right: 0; }
  /* チェックボックス列の th は並び替え対象外 — cursor / hover を明示的に無効化 */
  .data-table thead th.col-check { cursor: default; }
  .data-table thead th.col-check:hover {
    background: var(--gray-50);
  }
  .data-table .dt-check {
    width: 16px; height: 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: 4px;
    background: var(--bg-default);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
    color: transparent;
  }
  .data-table .dt-check.is-on,
  .data-table .dt-check.is-mixed {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: var(--text-on-fill);
  }
  .data-table .dt-check svg { width: 12px; height: 12px; }

  /* Action column — right-aligned icon buttons */
  .data-table .col-actions { width: 80px; text-align: right; }
  .data-table .dt-rowmenu {
    width: 28px; height: 28px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
  }
  .data-table .dt-rowmenu:hover {
    background: var(--gray-100);
    color: var(--text-primary);
  }
  .data-table .dt-rowmenu .ic { width: 16px; height: 16px; }

  /* Header of the wrap — title + filters */
  .dt-wrap .dt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-default);
    flex-wrap: wrap;
  }
  /* タイトル直下の補足メモ（DataTable note）。ヘッダー区切り線の下・テーブルの上。 */
  .dt-wrap .dt-note { padding: 8px 18px; border-bottom: 1px solid var(--border-default); }
  /* 0 件のときの空状態（DataTable empty）。列ヘッダーの代わりに中央寄せで表示。
     React 版 DataTable は td ではなく素の div で描くので、td 版（.data-table .dt-empty td）と
     同じ見た目をこちらにも当てる（左端に張り付いた小さな文字にしない）。 */
  .dt-wrap .dt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 文言は箱の中央ではなく上に置く。取得中の箱（下）は 1 ページぶんの高さを取るので画面より
       高くなることがあり、中央寄せだと理由の一文が画面の外に出てしまう（実際に出た）。
       Anchor the text to the TOP, not the middle: the loading box below reserves a whole page,
       which can run past the fold — centred, the line explaining the state ends up off-screen. */
    justify-content: flex-start;
    /* 0 件は「無い」と伝われば十分なので控えめに（見出し行 + 4 行ぶん）。1 ページぶんを確保
       すると、検索が空振りしただけで画面いっぱいの白い箱になる。取得中とは別扱い（下）。
       A 0-row table stays modest — a header row plus four rows. Reserving a whole page here
       turns "your search matched nothing" into a screenful of white. Loading is handled below. */
    min-height: calc(var(--dt-head-h) + var(--dt-row-h) * 4);
    /* 上は「見出し行 1 行ぶん + ひと呼吸」。行があるときの 1 行目とだいたい同じ高さに文言が来る。 */
    padding: 72px 16px 48px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
  }
  /* 取得中だけは、これから描く 1 ページぶん（見出し行 + 表示件数ぶんの行）を先に確保する。
     行が届いた瞬間にページが伸びて下の内容がずれるのを防ぐため。画面より下は見えないので、
     確保するのは「1 ページぶん」と「本体が取り得る高さ」の小さい方（--dt-fit-max は
     行が埋まったときの本体と同じ式）。
     Loading — and only loading — reserves the page it is about to render, so arriving rows do
     not shove the page down. Capped by what the body can actually take: anything below the fold
     cannot be seen shifting anyway, and --dt-fit-max is the same expression that sizes the
     loaded body. */
  .dt-wrap .dt-empty.is-loading {
    min-height: min(
      calc(var(--dt-head-h) + var(--dt-row-h) * var(--dt-page-size)),
      var(--dt-fit-max)
    );
  }
  /* maxRows の表は本体がその高さを超えないので、確保もそこまで。
     A capped table's body never exceeds its cap, so the reservation stops there too. */
  .dt-wrap.dt-capped .dt-empty.is-loading {
    min-height: min(
      calc(var(--dt-head-h) + var(--dt-row-h) * var(--dt-page-size)),
      var(--dt-body-max)
    );
  }
  .dt-wrap .dt-title {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 14px; color: var(--text-primary);
  }
  .dt-wrap .dt-title .ic { width: 16px; height: 16px; color: var(--text-tertiary); flex: none; }
  .dt-wrap .dt-title .dt-count {
    font-size: 12px; color: var(--text-tertiary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  /* Selection bar — shown on the LEFT of dt-head when rows are selected (replaces title). */
  .dt-wrap .dt-head-sel {
    display: flex; align-items: center; gap: 10px;
  }
  /* Sort status badge — shown on the RIGHT of dt-head when a column is sorted.
     Clicking it clears the sort and returns to the default order. */
  .dt-wrap .dt-sort-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    background: var(--bg-default);
    font-size: 12px; color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s;
    line-height: 1.4;
  }
  /* 既定の並び順の表示。押して外せるものではないので、ボタンらしさを消す。 */
  .dt-wrap .dt-sort-badge.is-default {
    cursor: default;
    background: transparent;
    border-style: dashed;
    color: var(--text-tertiary);
  }
  .dt-wrap .dt-sort-badge.is-default:hover {
    background: transparent;
    border-color: var(--border-default);
  }
  .dt-wrap .dt-sort-badge:hover {
    background: var(--gray-50);
    border-color: var(--border-strong);
  }
  .dt-wrap .dt-sort-badge .dt-sort-badge-ic {
    width: 12px; height: 12px;
    color: var(--text-placeholder);
    flex: none;
  }
  .dt-wrap .dt-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-default);
    background: var(--gray-50);
  }
  /* Page-size selector — used in .dt-head right side */
  .dt-pagesize {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-secondary);
  }
  .dt-pagesize select {
    height: 28px;
    padding: 0 24px 0 8px;
    border: 1px solid var(--border-default);
    border-radius: var(--r-4);
    background: var(--bg-default);
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 12px 12px;
  }

  /* Cell combos */
  .dt-user {
    display: inline-flex; align-items: center; gap: 10px;
    min-width: 0;
  }
  .dt-user .dt-user-text { min-width: 0; }
  .dt-user .dt-user-name { font-weight: 600; font-size: 13px; color: var(--text-primary); line-height: 18px; }
  .dt-user .dt-user-mail { font-size: 12px; color: var(--text-tertiary); line-height: 16px; }
  /* `.dt-user` がリンクのとき（`<a class="dt-user">`）。**名前を `.cell-link` と同じ扱いにする。**
     以前は静止時に本文色のままで、hover しないとリンクだと分からなかった——同じ表の中に
     `<div class="dt-user">`（リンクでない行）が混ざるので、見分ける手がかりが無い。
     理由と実測は `.cell-link` のコメントに書いてある。 */
  a.dt-user { text-decoration: none; color: inherit; }
  a.dt-user .dt-user-name {
    color: var(--text-brand);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
    transition: text-decoration-color 120ms ease;
  }
  a.dt-user:hover .dt-user-name,
  a.dt-user:focus-visible .dt-user-name {
    text-decoration-color: currentColor;
    text-decoration-thickness: 2px;
  }

  /* Empty state */
  .data-table .dt-empty td {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
  }
  .data-table .dt-empty .ic-lg { width: 28px; height: 28px; color: var(--text-placeholder); display: inline-block; margin-bottom: 8px; }

  /* ==========================================================
     Sticky columns — 左端数列を固定して残りを横スクロール
     ・親を .dt-scroll（overflow-x: auto）にする
     ・固定したい th/td に .col-sticky を付ける
     ・2 列目以降の固定列には style="--sticky-left: 44px" のように
       左からの累積オフセットを個別指定（列幅が固定できない動的表では
       JS で計算するか、col 幅を固定する）
     ・最終固定列に .col-sticky-last を付けると、スクロール中のみ
       右端に subtle shadow が出て "ここまで固定" の境界を示す
     ========================================================== */
  .dt-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    /* スクロールバーをテーブル下端に収めるため、wrap 内で独立の viewport とする */
    -webkit-overflow-scrolling: touch;
  }
  /* スクロールバー装飾 — 控えめに。**縦も横と同じ 10px**（2026-10-13、指摘）。
     `height` だけ指定していたので、縦に送る表（`is-fit` / `dt-fitbody` で
     `overflow: auto` になる箱）の縦棒だけブラウザ既定（約 15px）のまま太かった。 */
  .dt-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
  .dt-scroll::-webkit-scrollbar-track { background: transparent; }
  .dt-scroll::-webkit-scrollbar-thumb {
    background: var(--gray-200);
    border-radius: 999px;
    border: 2px solid var(--bg-default);
  }
  .dt-scroll::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }
  /* 縦と横が交わる角。塗らないと既定の灰色の四角が残る。 */
  .dt-scroll::-webkit-scrollbar-corner { background: transparent; }
  /* 標準プロパティは **Firefox だけ**に当てる（Chrome 121+ は `scrollbar-width` を実装して
     いて、指定すると上の `::-webkit-scrollbar` を無視する＝10px が効かない）。
     `.scroll-thin` と同じ書き方。 */
  @supports not selector(::-webkit-scrollbar) {
    .dt-scroll { scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent; }
  }

  /* 固定列 */
  .data-table .col-sticky {
    position: sticky;
    left: var(--sticky-left, 0);
    z-index: 2;
    background: var(--bg-default); /* 背景を必ず塗る（下のセルが透けないように） */
  }
  /* 通常セル（非 sticky）は scrollable 領域の文字が sticky 列に
     重なって見えないよう、明示的に sticky より下の層に置く */
  .data-table tbody td:not(.col-sticky),
  .data-table thead th:not(.col-sticky) {
    position: relative;
    z-index: 0;
  }
  /* tt-host / avatar / iconbtn を hover した時、 ツールチップが
     sticky 列 (z-index 2-3) や上の行に隠れないよう親 td/th を一時的に持ち上げる */
  .data-table tbody td:has(.tt-host:hover),
  .data-table tbody td:has(.avatar:hover),
  .data-table tbody td:has(.iconbtn:hover),
  .data-table thead th:has(.tt-host:hover),
  .data-table thead th:has(.iconbtn:hover) {
    z-index: 50;
  }

  /* Seam fix — sticky 列同士の間 / sticky 列と通常列の間の 1px 隙間を
     ::before で sticky セルの背景を左右 1px 広げて完全に塞ぐ。
     box-shadow は非 seam-fix 用途に予約する。 */
  .data-table .col-sticky {
    /* 子要素が seam fix の ::before を突き抜けないよう、
       position: sticky は既に stacking context を生成する */
  }
  .data-table .col-sticky::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -1px;
    right: -1px;
    background: inherit;
    z-index: -1;
    pointer-events: none;
  }
  /* sticky セル直下の子要素は ::before より上に置くため、z-index を指定 */
  .data-table .col-sticky > * {
    position: relative;
    z-index: 1;
  }
  /* thead 内の固定列は row background を優先、hover/sorted の色も維持 */
  .data-table thead th.col-sticky {
    z-index: 3; /* thead は tbody より手前 */
    background: var(--gray-50);
  }
  /* row hover 時、固定セルも一緒に色を変える */
  .data-table tbody tr:hover td.col-sticky {
    background: var(--brand-navy-50);
  }
  .data-table tbody tr.is-selected td.col-sticky {
    background: var(--brand-navy-50);
  }
  .data-table tbody tr.is-selected:hover td.col-sticky {
    background: var(--brand-navy-100);
  }

  /* 固定列の一番右 — 常時右端に 1px 線、スクロール中はシャドウを追加
     border-collapse 下でも確実に線が出るよう ::after で絶対配置する */
  .data-table .col-sticky-last::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-right: 1px solid var(--border-default);
  }
  .dt-scroll.is-scrolled .data-table .col-sticky-last,
  .dt-grid__head.is-scrolled .data-table .col-sticky-last,
  .dt-grid__body.is-scrolled .data-table .col-sticky-last {
    box-shadow: 8px 0 12px -8px rgba(0, 25, 81, 0.18);
    clip-path: inset(0 -20px 0 0);
  }
  /* ==========================================================
     右端の固定列（`.col-sticky-end`） — 2026-10-13、依頼
     「メンバー名は固定したまま、最後の列（⋯）も右側に固定し続けたい」。

     操作の列は**どの行でも同じ場所にある**ことに意味がある（狙って押すもの）。
     左の `.col-sticky` と同じ作りで、向きだけ逆にする:
       ・`right: 0` に貼る（左は `left: var(--sticky-left)`）
       ・`::before` で左右 1px はみ出させて継ぎ目を塞ぐ
       ・`::after` で**左**に 1px の線＝「ここから先は固定」の境界

     **`position` は `:not(.col-sticky)` の指定（0,2,1）より重く書く**——あちらが
     非固定セルを `position: relative` に落としているので、素の `.data-table
     .col-sticky-end`（0,2,0）では貼り付かない（実際に貼り付かなかった）。
     ========================================================== */
  .data-table thead th.col-sticky-end,
  .data-table tbody td.col-sticky-end {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--bg-default);
  }
  .data-table thead th.col-sticky-end { z-index: 3; background: var(--gray-50); }
  .data-table tbody tr:hover td.col-sticky-end { background: var(--brand-navy-50); }
  .data-table tbody tr.is-selected td.col-sticky-end { background: var(--brand-navy-50); }
  .data-table tbody tr.is-selected:hover td.col-sticky-end { background: var(--brand-navy-100); }
  .data-table .col-sticky-end::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -1px;
    right: -1px;
    background: inherit;
    z-index: -1;
    pointer-events: none;
  }
  .data-table .col-sticky-end > * { position: relative; z-index: 1; }
  .data-table .col-sticky-end::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-left: 1px solid var(--border-default);
  }

  /* 棒グラフ表の縦線は**固定列の右の 1 本だけ**。列間の罫線は外してあるので、この線は
     「列の区切り」ではなく**「ここまでが固定（横スクロールしても残る）」の境界**として働く。
     `.col-sticky-last::after`（常時 1px ＋ スクロール中はシャドウ）をそのまま使う。 */

  /* ---------- DataTable — 縦フィット/ヘッダー固定グリッド ----------
     .dt-wrap 内で .dt-scroll の代わりに .dt-grid__head + .dt-grid__body を使う。
     ・縦スクロールバーはボディ(.dt-grid__body)だけに出て、ヘッダー行はバーに掛からない
     ・横スクロールは assets/js/dt-grid.js が同期（ボディ→ヘッダーの scrollLeft）
     ・列幅は両ペイン同一の <colgroup> ＋ table-layout: fixed で一致
     ・両ペインの scrollbar-gutter: stable で右ガターを同量確保 → 列ズレ無し
     ・ボディ高さ＝「ブラウザ下端まで」を dt-grid.js が算出（data-dt-gap で下余白px）
     構造:
       <div class="dt-wrap">
         <div class="dt-head">…タイトル/件数…</div>
         <div class="dt-grid__head"><table class="data-table" style="width:100%;min-width:NNNpx;table-layout:fixed"><colgroup>…</colgroup><thead>…</thead></table></div>
         <div class="dt-grid__body"><table class="data-table" style="width:100%;min-width:NNNpx;table-layout:fixed"><colgroup>…</colgroup><tbody>…</tbody></table></div>
         <div class="dt-footer">…ページング…</div>
       </div>                                                              */
  .dt-grid__head {
    overflow: hidden;                 /* バーは出さない（横位置は dt-grid.js で同期） */
    scrollbar-gutter: auto;            /* 既定はガター無し。縦スクロール時のみ .is-yscroll で確保 */
    background: var(--gray-50);        /* ガターまでヘッダー色を連続させる（途切れ防止） */
    border-bottom: 1px solid var(--border-default);
  }
  .dt-grid__head .data-table thead th { border-bottom: 0; }   /* 下線はペイン側で引く */
  .dt-grid__body {
    overflow: auto;                    /* 縦＋横スクロール（縦バーはここだけ） */
    scrollbar-gutter: auto;
    background: var(--bg-default);
  }
  /* 縦スクロールが発生する時だけ両ペインで右ガターを確保（列ズレ防止）。
     短い表ではガターを出さず、ヘッダー帯と行をカード端まで揃える。JS が is-yscroll を付与。 */
  .dt-grid__head.is-yscroll,
  .dt-grid__body.is-yscroll { scrollbar-gutter: stable; }
  .dt-grid__body::-webkit-scrollbar { width: 14px; height: 10px; }
  .dt-grid__body::-webkit-scrollbar-thumb {
    background: var(--gray-300); border-radius: 999px;
    border: 4px solid var(--bg-default); background-clip: content-box;
  }
  .dt-grid__body::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); border: 4px solid var(--bg-default); background-clip: content-box; }
  .dt-grid__body::-webkit-scrollbar-corner { background: var(--bg-default); }

  /* ---------- ProgressBar ----------
     Determinate な横棒 + Circular の 2 形。
     Linear: md=8px / lg=12px, 角丸 4px, track=bg-subtle, fill=navy/teal/magenta。
     Circular: sm=32 / md=48 / lg=64, stroke は size に比例。
     Indeterminate / segmented は扱わない（決定的進捗のみ）。
     アニメーションは width transition のみ。 */
  .pbar {
    --pbar-track: var(--bg-subtle);
    --pbar-fill: var(--brand-navy);
    --pbar-h: 8px;
    position: relative;
    width: 100%;
    height: var(--pbar-h);
    background: var(--pbar-track);
    border-radius: var(--r-2);
    overflow: hidden;
  }
  .pbar.s-md { --pbar-h: 8px; }
  .pbar.s-lg { --pbar-h: 12px; }
  .pbar.is-navy    { --pbar-fill: var(--brand-navy); }
  .pbar.is-teal    { --pbar-fill: var(--teal-500); }
  .pbar.is-magenta { --pbar-fill: var(--magenta-500); }
  .pbar-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--pbar-fill);
    border-radius: inherit;
    transition: width .24s ease;
  }

  /* Label row: title 左 + value 右 */
  .pbar-row {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; margin-bottom: 6px;
  }
  .pbar-title {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    line-height: 1.4;
  }
  .pbar-value {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  }
  .pbar-value.is-muted { color: var(--text-secondary); font-weight: 500; }
  .pbar-hint {
    display: block; margin-top: 6px;
    font-size: 12px; color: var(--text-secondary);
  }

  /* Circular */
  .pcircle {
    --pc-size: 48px;
    --pc-stroke: 5px;
    --pc-track: var(--bg-subtle);
    --pc-fill: var(--brand-navy);
    position: relative;
    width: var(--pc-size);
    height: var(--pc-size);
    flex: none;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .pcircle.s-sm { --pc-size: 32px; --pc-stroke: 4px; }
  .pcircle.s-md { --pc-size: 48px; --pc-stroke: 5px; }
  .pcircle.s-lg { --pc-size: 64px; --pc-stroke: 6px; }
  .pcircle.is-navy    { --pc-fill: var(--brand-navy); }
  .pcircle.is-teal    { --pc-fill: var(--teal-500); }
  .pcircle.is-magenta { --pc-fill: var(--magenta-500); }
  .pcircle svg {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
    display: block;
  }
  .pcircle circle {
    fill: none;
    stroke-width: var(--pc-stroke);
    stroke-linecap: round;
  }
  .pcircle .pc-track { stroke: var(--pc-track); }
  .pcircle .pc-fill {
    stroke: var(--pc-fill);
    transition: stroke-dashoffset .24s ease;
  }
  .pcircle .pc-label {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
  }
  .pcircle.s-lg .pc-label { font-size: 13px; }
  .pcircle.s-sm .pc-label { font-size: 0; } /* sm はラベルなし運用 */

  /* ---------- Segmented ProgressBar ----------
     等間隔の矩形ブロックで進捗を段階的に示す。ゲーム的な達成感や、
     「段階で埋まることに意味がある」指標に向く（例：オンボーディング、誕生日スタンプ）。
     2 状態のみ filled / inactive。gradient や立体ハイライトは当てない (フラット)。 */
  .pseg {
    --pseg-h: 16px;
    --pseg-gap: 3px;
    --pseg-r: 3px;
    --pseg-track: var(--bg-subtle);
    --pseg-fill: var(--brand-navy);
    --pseg-inactive: var(--brand-navy-200);
    display: flex;
    align-items: center;
    gap: var(--pseg-gap);
    padding: 3px;
    background: var(--pseg-track);
    border: 1px solid var(--border-default);
    border-radius: var(--r-4);
    box-sizing: border-box;
  }
  .pseg.s-md { --pseg-h: 14px; --pseg-gap: 3px; }
  .pseg.s-lg { --pseg-h: 20px; --pseg-gap: 4px; }
  .pseg.is-navy    { --pseg-fill: var(--brand-navy); }
  .pseg.is-teal    { --pseg-fill: var(--teal-500); }
  .pseg.is-magenta { --pseg-fill: var(--magenta-500); }
  .pseg-cell {
    flex: 1 1 0;
    min-width: 0;
    height: var(--pseg-h);
    background: var(--pseg-inactive);
    border-radius: var(--pseg-r);
    transition: background .2s ease;
  }
  .pseg-cell.is-on { background: var(--pseg-fill); }

  /* ---------- Radio Group ----------
     Card 型（ラジオボタンを表示せず、カード選択状態で表す）と
     List item 型（ラジオボタン表示 + 複数行の説明つき）の 2 型。
     どちらも選択色は brand-navy、選択時の淡色背景は brand-navy-50。 */

  /* Common wrapper — 同じ grid / 同じ stack を提供 */
  .rg-group { display: flex; flex-direction: column; gap: 0; }
  .rg-group.is-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  /* プラン選択など、広い画面では4列・狭い画面（〜1280px）では2列に折り返す */
  .rg-group.is-grid.plan-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  @media (max-width: 1280px) {
    .rg-group.is-grid.plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  /* 3 択（アカウント種別など）。管理画面のシェルは min-width: 1280px なので折り返さず 3 列で固定する
     （`plan-grid` の 4 列と違い、3 列なら 1280px でも説明文が読める幅が残る）。 */
  .rg-group.is-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* 1 列。**カードを縦に積むときは `is-grid` と一緒に使う**——素の `.rg-group` は gap 0 の
     リスト型（`rg-item` が枠の中で隙間なく並ぶ形）なので、カードを入れると辺が接して
     1 枚の箱に見える。見出しが長くて 2 列だと折り返す選択肢（不具合の影響範囲）で使う。 */
  .rg-group.is-grid.is-1 { grid-template-columns: 1fr; }
  /* スマホ幅では 2 列だと 1 枚 150px 前後になり、タイトル＋説明が読めなくなるので 1 列に落とす。
     （SidePanel は max-width:100vw で全幅になるため、パネル内のカードも同じ影響を受ける） */
  @media (max-width: 480px) {
    .rg-group.is-grid { grid-template-columns: 1fr; }
  }

  /* ----- Card variant ----- */
  .rg-card {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-4);
    box-shadow: var(--shadow-1);
    cursor: pointer;
    transition: border-color .12s, box-shadow .12s, background .12s;
  }
  .rg-card > input[type="radio"] {
    position: absolute; inset: 0;
    opacity: 0; margin: 0;
    cursor: pointer;
    z-index: 1;
  }
  .rg-card .rg-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .rg-card .rg-title {
    font-size: 14px; font-weight: 600; line-height: 1.5;
    color: var(--text-primary);
  }
  .rg-card .rg-detail {
    font-size: 13px; line-height: 1.5;
    color: var(--text-secondary);
  }
  .rg-card .rg-trail {
    flex: none; text-align: right;
    display: flex; flex-direction: column; align-items: flex-end;
    line-height: 1.4;
  }
  .rg-card .rg-trail .rg-price {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    font-variant-numeric: tabular-nums;
  }
  .rg-card .rg-trail .rg-unit {
    font-size: 13px; color: var(--text-secondary);
  }
  .rg-card:hover { border-color: var(--brand-navy-100); }
  .rg-card.is-focus, .rg-card:has(input:focus-visible) {
    border-color: var(--brand-navy);
    box-shadow: 0 0 0 3px rgba(0, 25, 81, .12);
  }
  .rg-card.is-selected, .rg-card:has(input:checked) {
    border-color: var(--brand-navy);
    border-width: 2px;
    padding: 13px 17px; /* 1px 内側に寄せて width を維持 */
  }
  .rg-card.is-selected.is-focus,
  .rg-card:has(input:checked:focus-visible) {
    box-shadow: 0 0 0 3px rgba(0, 25, 81, .18);
  }
  .rg-card.is-disabled,
  .rg-card:has(input:disabled) {
    opacity: .5; cursor: not-allowed; background: var(--bg-subtle);
  }
  .rg-card.is-inline {
    /* list item 風に横一列（title · detail · trailing 右寄せ） */
    align-items: center; gap: 16px;
  }
  .rg-card.is-inline .rg-body { flex-direction: row; align-items: baseline; gap: 8px; }
  .rg-card.is-inline .rg-title { white-space: nowrap; }
  .rg-card.is-inline .rg-detail { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* ----- List item variant (w/ radio dot) ----- */
  .rg-item {
    position: relative;
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background .12s;
  }
  .rg-item > input[type="radio"] {
    position: absolute; inset: 0;
    opacity: 0; margin: 0;
    cursor: pointer;
    z-index: 1;
  }
  .rg-item .rg-dot {
    flex: none;
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: var(--bg-default);
    display: grid; place-items: center;
    transition: border-color .12s, background .12s;
    margin-top: 2px;
  }
  .rg-item .rg-dot::after {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: transparent;
    transition: background .12s;
  }
  .rg-item .rg-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .rg-item .rg-title {
    font-size: 14px; font-weight: 600; line-height: 1.5;
    color: var(--text-primary);
  }
  .rg-item .rg-detail {
    font-size: 13px; line-height: 1.5;
    color: var(--text-secondary);
  }
  .rg-item:hover:not(.is-selected):not(:has(input:checked)) { background: var(--bg-subtle); }
  .rg-item.is-selected,
  .rg-item:has(input:checked) {
    background: var(--brand-navy-50);
  }
  .rg-item.is-selected .rg-title,
  .rg-item:has(input:checked) .rg-title { color: var(--brand-navy); }
  .rg-item.is-selected .rg-detail,
  .rg-item:has(input:checked) .rg-detail { color: var(--brand-navy-600); }
  .rg-item.is-selected .rg-dot,
  .rg-item:has(input:checked) .rg-dot {
    border-color: var(--brand-navy);
    background: var(--brand-navy);
  }
  .rg-item.is-selected .rg-dot::after,
  .rg-item:has(input:checked) .rg-dot::after {
    background: var(--bg-default);
  }
  .rg-item.is-focus,
  .rg-item:has(input:focus-visible) {
    box-shadow: inset 0 0 0 2px var(--brand-navy);
    border-radius: var(--r-2);
  }
  .rg-item.is-disabled,
  .rg-item:has(input:disabled) {
    opacity: .5; cursor: not-allowed;
  }

  /* ---------- SaveBar ----------
     編集中の画面に常駐する「未保存の変更あり → 保存 / キャンセル」バー。
     position: fixed 想定。デモ用に is-demo で相対配置にするバリアントも用意。 */
  .savebar {
    position: fixed;
    right: 24px; bottom: 24px;
    display: inline-flex; align-items: center; gap: 16px;
    padding: 10px 10px 10px 20px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    box-shadow: var(--shadow-3);
    z-index: 80;
    transform-origin: center;
    /* 1) せり上がって軽く行き過ぎて戻る登場（back-out イージング）
       2) 登場直後に 2 回だけ「ポンッ」と弾んで気づかせる（回数限定で常時アニメにしない） */
    animation:
      savebar-in   .34s cubic-bezier(.34, 1.56, .64, 1),
      savebar-pulse .9s ease-out .42s 2;
  }
  @keyframes savebar-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes savebar-pulse {
    0%   { transform: scale(1);     box-shadow: var(--shadow-3); }
    32%  { transform: scale(1.018); box-shadow: var(--shadow-3), 0 0 0 4px var(--magenta-glow); }
    100% { transform: scale(1);     box-shadow: var(--shadow-3); }
  }
  /* モーション過敏設定のユーザーには弾み・移動を出さず、フェードのみにする */
  @media (prefers-reduced-motion: reduce) {
    .savebar {
      animation: savebar-fade .18s ease-out;
    }
    @keyframes savebar-fade {
      from { opacity: 0; }
      to   { opacity: 1; }
    }
  }
  .savebar.is-hidden { display: none; }

  /* Left label */
  .savebar .sb-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 500; color: var(--text-primary);
    line-height: 1;
    white-space: nowrap;
  }
  .savebar .sb-label .sb-ic {
    flex: none;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--fill-magenta);
    color: var(--text-on-fill);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    line-height: 1;
  }
  .savebar .sb-label .sb-ic i,
  .savebar .sb-label .sb-ic svg { width: 12px; height: 12px; stroke-width: 2.5; }

  /* Right actions */
  .savebar .sb-actions {
    display: inline-flex; align-items: center; gap: 8px;
  }

  /* Demo wrapper — プレビュー用に position: fixed を打ち消す */
  .savebar-demo {
    position: relative;
    min-height: 120px;
    background: var(--bg-subtle);
    border-radius: var(--r-4);
    overflow: hidden;
  }
  .savebar-demo .savebar {
    position: absolute;
    right: 16px; bottom: 16px;
    /* デモでも登場演出を見せる（is-hidden を外すたびに再生される） */
  }
  /* ---------- Spec / KV helpers (used in component "Specs" cards) ----------
     Spec cards typically use a 2-column grid: <div class="k">label</div>
     followed by a value cell. We give the wrapper minimal layout when no
     explicit grid template is supplied via inline style. */
  .spec, .spec-grid, .kv {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 2fr;
    font-size: 13px;
    color: var(--text-primary);
  }
  .spec > .k, .spec-grid > .k, .kv > .k {
    font-weight: 700;
    background: var(--bg-subtle);
  }

  /* Wrapper around a spec table — gives it a card-like outer frame.
     The table itself is .spec-table (already defined). */
  .spec-table-wrap {
    border: 1px solid var(--border-default);
    border-radius: 8px;
    overflow: hidden;
  }

  /* Tooltip / popover row that pairs a department name with a role label. */
  .dept-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: 1.4;
  }
  .dept-row .dept-name {
    font-weight: 600;
    color: var(--text-primary);
  }
  .dept-row .dept-role {
    font-size: 11px;
    color: var(--text-tertiary);
  }

  /* ============================================================
     Crumb — page-level breadcrumb
     画面ヘッダー直下に置く階層ナビ。dept-crumb（部署専用 12px 灰）
     とは別物で、こちらは 14px / clickable / chevron-right 区切り。
     ============================================================ */
  .crumb {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-secondary);
  }
  .crumb a,
  .crumb .crumb-item {
    color: inherit;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
  }
  .crumb a:hover {
    color: var(--brand-navy);
    background: var(--brand-navy-50);
  }
  .crumb .crumb-sep {
    color: var(--text-tertiary);
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
  }
  .crumb .crumb-sep svg {
    width: 12px;
    height: 12px;
  }
  .crumb .crumb-current {
    color: var(--text-primary);
    font-weight: 600;
    padding: 2px 6px;
  }

  /* ============================================================
     OrgTree — collapsible organisation tree
     左ペインのナビゲーション、または OrgPicker モーダル内で使う。
     ノード = 1 行。children は <ul role="group"> で再帰的にネスト。
     ============================================================ */
  .org-tree {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
    color: var(--text-primary);
    user-select: none;
  }
  .org-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .org-tree-node {
    position: relative;
  }
  /* `role="treeitem"` は `<li>` なので、フォーカスもそこに来る（WAI-ARIA の tree の作法）。
     **輪郭は `<li>` ではなく行に描く**——`<li>` は入れ子の `<ul role="group">` を含むので、
     そこに outline を置くと展開中の枝が丸ごと囲まれる。 */
  .org-tree-node:focus { outline: none; }
  .org-tree-node:focus-visible > .org-tree-row {
    outline: 2px solid var(--border-focus);
    outline-offset: -2px;
  }
  /* Row — the clickable line itself */
  .org-tree-row {
    position: relative;
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 10px 0 calc(10px + 20px * var(--depth, 0));
    border-radius: 8px;
    cursor: pointer;
    color: inherit;
    background: transparent;
    border: 0;
    text-align: left;
    width: 100%;
    font: inherit;
  }
  .org-tree-row:hover {
    background: var(--gray-50);
  }
  /* Caret — rotates when expanded */
  .org-tree-caret {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    flex: none;
    transition: transform 0.15s ease;
  }
  .org-tree-caret svg {
    width: 14px;
    height: 14px;
  }
  .org-tree-node.is-expanded > .org-tree-row .org-tree-caret {
    transform: rotate(90deg);
  }
  /* Leaf (no children) — caret area is blank */
  .org-tree-node.is-leaf > .org-tree-row .org-tree-caret {
    visibility: hidden;
  }
  /* Label — name + count */
  .org-tree-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
  }
  .org-tree-icon {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .org-tree-icon svg {
    width: 14px;
    height: 14px;
  }
  .org-tree-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .org-tree-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
  }
  .org-tree-count {
    color: var(--text-tertiary);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    flex: none;
    min-width: 36px;
    text-align: right;
  }
  /* Hover actions — appear on row hover */
  .org-tree-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.1s ease;
  }
  .org-tree-row:hover .org-tree-actions,
  .org-tree-row:focus-within .org-tree-actions {
    opacity: 1;
  }
  .org-tree-actions .org-tree-act {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: transparent;
    border: 0;
    color: var(--text-tertiary);
    cursor: pointer;
  }
  .org-tree-actions .org-tree-act:hover {
    background: var(--gray-100);
    color: var(--text-primary);
  }
  .org-tree-actions .org-tree-act svg,
  .org-tree-actions .org-tree-act .ic {
    width: 14px;
    height: 14px;
  }
  /* Selected node — left accent bar + brand-navy bg/text */
  .org-tree-node.is-selected > .org-tree-row {
    background: var(--brand-navy-50);
    color: var(--brand-navy);
    font-weight: 600;
  }
  .org-tree-node.is-selected > .org-tree-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 3px;
    background: var(--brand-navy);
  }
  .org-tree-node.is-selected > .org-tree-row .org-tree-icon,
  .org-tree-node.is-selected > .org-tree-row .org-tree-count {
    color: var(--brand-navy);
  }
  /* 選択マーク=チェック（is-checkmark）：左バーは出さず、右にチェックアイコン */
  .org-tree.is-checkmark .org-tree-node.is-selected > .org-tree-row::before { content: none; }
  .org-tree-check { width: 16px; height: 16px; flex: none; color: var(--brand-navy); }
  /* Disabled — out of admin scope, view-only */
  .org-tree-node.is-disabled > .org-tree-row {
    color: var(--text-tertiary);
    cursor: default;
  }
  .org-tree-node.is-disabled > .org-tree-row:hover {
    background: transparent;
  }
  /* Children — only visible when parent is expanded */
  .org-tree-children {
    display: none;
  }
  .org-tree-node.is-expanded > .org-tree-children {
    display: block;
  }

  /* Checkable variant — row が <label>、 caret スロットに checkbox を入れる
     用途: メンバーフィルタなどマルチセレクト向け。 caret は出さない。 */
  .org-tree.is-checkable .org-tree-row {
    cursor: pointer;
  }
  .org-tree.is-checkable .org-tree-row > input[type="checkbox"] {
    width: 16px; height: 16px;
    margin: 0;
    accent-color: var(--brand-navy);
    justify-self: center;
    cursor: pointer;
  }
  .org-tree.is-checkable .org-tree-row:has(input:checked) {
    background: var(--brand-navy-50);
  }
  .org-tree.is-checkable .org-tree-row:has(input:checked) .org-tree-name {
    color: var(--brand-navy);
    font-weight: 600;
  }

  /* OrgPicker — modal body that pairs a search bar with an org-tree.
     Use inside .modal__body. */
  .org-picker {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 360px;
  }
  .org-picker .sb-search {
    flex: none;
  }
  .org-picker .org-picker-tree {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px;
    max-height: 420px;
  }
  /* OrgTreeMultiPickerModal と同様、検索のすぐ下にツールバーを置き、全幅の区切り線で本文と分ける。 */
  .org-picker .mtree-wrap { gap: 0; }
  .org-picker .mtree-toolbar {
    padding: 8px 6px;
    margin: -6px -6px 8px;
    border-bottom: 1px solid var(--border-default);
  }
  .org-picker .org-picker-selected {
    flex: none;
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--brand-navy-50);
    border-radius: 6px;
    font-size: 13px;
    color: var(--brand-navy);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .org-picker .org-picker-selected .crumb {
    font-size: 13px;
    color: inherit;
  }
  .org-picker .org-picker-selected .ic { width: 16px; height: 16px; flex: none; color: var(--brand-navy); }

  /* ============================================================
     OrgMultiPicker — 会社組織 / プロジェクトを複数選ぶタブ付きピッカー
     ----------------------------------------------------------------
     用途: スレッド同期対象・配信対象など「複数の組織/プロジェクトを
           まとめて選ぶ」場面で再利用する。
     構成:
       .mpicker              — 縦積みレイアウト (タブ / 検索 / パネル / 選択中)
       .mpicker__tabs        — 会社組織 / プロジェクト 切替 (既存 .tabs を内包)
       .mpicker__panel       — タブごとのスクロール領域 (中に .mtree)
       .mpicker__selected    — 選択中チップ (roll-up 表示)
       .mtree                — 複数選択ツリー (チェックボックス + 階層)
     チェック連動: 親 ON → 子孫全 ON / 子を 1 つでも外す → 親は部分選択
                   (indeterminate)。動作は assets/js/checktree.js。
     ============================================================ */
  .mpicker { display: flex; flex-direction: column; gap: 12px; }
  /* モーダル full-bleed：検索/選択中バーは左右24pxインセット、ツリーパネルは横幅いっぱい（member モーダルと体裁を揃える） */
  .mpicker.is-flush > .mpicker__search,
  .mpicker.is-flush > .mpicker__selected { margin-left: 24px; margin-right: 24px; }
  .mpicker.is-flush > .mpicker__panel { border-left: 0; border-right: 0; border-radius: 0; padding: 6px 0; }
  .mpicker.is-flush > .mpicker__panel .mtree-row { padding-left: calc(24px + 18px * var(--depth, 0)); padding-right: 24px; border-radius: 0; }
  .mpicker__tabs { flex: none; }
  .mpicker__search { flex: none; }
  .mpicker__panel {
    flex: 1 1 auto;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: 6px;
    background: var(--gray-0);
  }
  .mpicker__panel[hidden] { display: none !important; }
  /* 選択中: 検索の下に置く。既定は 1 行サマリ、[表示] で高さ固定スクロールのチップ欄が開く
     (数千チーム選択でも縦に伸びない) */
  .mpicker__selected { flex: none; display: flex; flex-direction: column; gap: 8px; }
  .mpicker__selbar { display: flex; align-items: center; gap: 8px; }
  .mpicker__selected-label { margin-right: auto; font-size: 13px; color: var(--text-secondary); }
  .mpicker__chips {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    max-height: 104px; overflow-y: auto;
    padding: 8px 10px;
    background: var(--brand-navy-50); border-radius: 6px;
  }
  .mpicker__chips[hidden] { display: none !important; }
  .mpicker__chips:empty::before { content: '未選択'; font-size: 12px; color: var(--text-placeholder); }
  .mpicker__more { align-self: center; font-size: 12px; color: var(--text-secondary); }

  /* 複数選択ツリー */
  .mtree, .mtree ul { list-style: none; margin: 0; padding: 0; }
  .mtree { font-size: 14px; color: var(--text-primary); user-select: none; }
  .mtree-node { position: relative; }
  /* 上部ツールバー（すべて展開 / 折りたたむ / クリア） */
  .mtree-wrap { display: flex; flex-direction: column; gap: 8px; }
  .mtree-toolbar { display: flex; align-items: center; gap: 2px; }
  /* ツールバーのボタンは詰めて配置（4つ並べても切れないように） */
  .mtree-toolbar .btn { padding-left: 6px; padding-right: 6px; gap: 4px; }
  /* 展開系（グレー）と選択系（すべて選択/クリア）を区切る縦線。選択系を右に寄せる */
  .mtree-toolbar .mtree-tb-sep { flex: 1 1 auto; min-width: 4px; }
  .mtree-toolbar .mtree-tb-clear { color: var(--text-secondary); }

  /* OrgTreeMultiSelect — 会社組織の複数選択ドロップダウン（.sb-pop 内に 検索 + CheckTree + 選択中チップ + フッター） */
  .orgms-pop { max-height: min(72vh, 540px, var(--pop-avail, 72vh)); }
  .orgms-pop .sb-search { flex: none; }
  /* ツールバーは固定、ツリー（部署リスト）だけスクロール。
     本文は縦 flex（スクロールしない）→ ツールバー flex:none ＋ ツリー(ul)に overflow を持たせる。 */
  .orgms-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0 10px; }
  .orgms-body .mtree-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0; }
  .orgms-body .mtree-toolbar {
    flex: none; background: var(--bg-default);
    padding: 8px 10px; margin: 0 -10px;
    border-bottom: 1px solid var(--border-default);   /* コンテナ端まで全幅の区切り線 */
  }
  .orgms-body .mtree { flex: 1; min-height: 0; overflow: auto; padding: 6px 0 10px; }
  /* モーダル版：本文を flex 縦＋高さ上限にして、ツリーだけスクロール */
  .orgms-modal { display: flex; flex-direction: column; max-height: 60vh; }
  /* MultiSelect（フラット複数選択）：リストだけスクロール */
  .ms-list { list-style: none; margin: 0; padding: 0; }
  .orgms-body .ms-list { flex: 1; min-height: 0; overflow: auto; padding: 6px 0 10px; }
  .ms-opt {
    display: flex; align-items: center; gap: 10px;
    height: 36px; padding: 0 8px; border-radius: 8px; cursor: pointer;
  }
  .ms-opt:hover { background: var(--gray-50); }
  .ms-opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  /* チェックは少し小さめ（16px・CheckTree と統一） */
  .ms-opt .check, .ms-opt .check .box { width: 16px; height: 16px; }
  .ms-opt .check input:checked ~ .box::after { width: 9px; height: 5px; }
  /* 選択中（開閉トグル＋3行でスクロール） */
  .orgms-sel { flex: none; border-top: 1px solid var(--border-subtle); background: var(--bg-subtle); }
  .orgms-sel__head {
    width: 100%; display: flex; align-items: center; gap: 6px;
    padding: 8px 12px; background: transparent; border: 0; cursor: pointer;
    font-size: 12px; color: var(--text-secondary); text-align: left;
  }
  .orgms-sel__head svg { width: 14px; height: 14px; flex: none; transition: transform 0.15s ease; }
  .orgms-sel__head[aria-expanded="true"] svg { transform: rotate(180deg); }
  .orgms-chips {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 0 12px 10px; max-height: 96px; overflow: auto;   /* 約3行で打ち切りスクロール */
  }
  .orgms-foot {
    flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border-top: 1px solid var(--border-default); background: var(--bg-default);
  }
  .orgms-sum { font-size: 12px; color: var(--text-secondary); }

  /* TeamFilterSelect — one team picker for every screen of the legacy team modal:
     すべての〜 / 全体 rows, then collapsible sections (参加しているチーム / 会社組織 / プロジェクト). */
  .tfs .tfs-body { flex: 1; min-height: 0; overflow: auto; }
  .tfs .check, .tfs .check .box { width: 16px; height: 16px; }
  .tfs .check input:checked ~ .box::after { width: 9px; height: 5px; }
  .tfs .check input:indeterminate ~ .box::after { width: 8px; }
  /* Every rule is prefixed with `.tfs`: `.mtree-row` / `.mtree` (later in this file) and
     `svg.lucide` would otherwise win over a bare class. */
  .tfs .tfs-ic { width: 16px; height: 16px; flex: none; }
  .tfs .tfs-top-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid var(--border-subtle);
    font-size: 13px; font-weight: 700; color: var(--text-primary); cursor: pointer;
  }
  .tfs .tfs-sec { border-bottom: 1px solid var(--border-subtle); }
  /* Sticky so the section you are scrolling through stays named. */
  .tfs .tfs-sec-head {
    position: sticky; top: 0; z-index: 1;
    display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    background: var(--bg-subtle); cursor: pointer;
    font-size: 13px; font-weight: 700; color: var(--text-primary);
  }
  .tfs .tfs-caret { transition: transform 0.15s ease; }
  .tfs .tfs-sec-head.is-open .tfs-caret { transform: rotate(90deg); }
  .tfs .tfs-sec-note { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--text-secondary); }
  .tfs .tfs-list { padding: 4px 10px; }
  .tfs .tfs-flat-row { height: auto; min-height: 44px; padding: 4px 10px; grid-template-columns: 16px 1fr auto; }
  .tfs .tfs-flat-name { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; cursor: pointer; text-align: left; }
  .tfs .tfs-path { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-tertiary); }
  .tfs .tfs-path svg { width: 12px; height: 12px; flex: none; }
  .tfs .tfs-search-head { padding: 10px 12px; font-size: 12px; color: var(--text-secondary); background: var(--bg-subtle); }
  .tfs .tfs-empty { padding: 24px; text-align: center; font-size: 13px; color: var(--text-tertiary); }
  .tfs .tfs-err { color: var(--text-danger); }
  .mtree-row {
    display: grid;
    grid-template-columns: 18px 16px 1fr auto;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 10px 0 calc(10px + 20px * var(--depth, 0));
    border-radius: 8px;
  }
  /* CheckTree のチェックは少し小さめ（16px）。box とチェック/横棒も縮小 */
  .mtree .check, .mtree .check .box { width: 16px; height: 16px; }
  .mtree .check input:checked ~ .box::after { width: 9px; height: 5px; }
  .mtree .check input:indeterminate ~ .box::after { width: 8px; }
  .mtree-row:hover { background: var(--gray-50); }
  .mtree-caret {
    width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 0; background: transparent;
    color: var(--text-tertiary); flex: none; cursor: pointer;
    transition: transform 0.15s ease;
  }
  .mtree-caret svg { width: 14px; height: 14px; }
  .mtree-node.is-expanded > .mtree-row .mtree-caret { transform: rotate(90deg); }
  .mtree-node.is-leaf > .mtree-row .mtree-caret { visibility: hidden; }
  .mtree-node:not(.is-expanded) > .mtree-children { display: none; }
  .mtree-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; cursor: pointer; }
  .mtree-icon {
    width: 16px; height: 16px; flex: none; color: var(--text-tertiary);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .mtree-icon svg { width: 14px; height: 14px; }
  .mtree-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* 右側メタ：種別バッジ＋件数 */
  .mtree-meta { display: inline-flex; align-items: center; gap: 8px; flex: none; }
  .mtree-kind {
    font-size: 11px; font-weight: 500; color: var(--text-secondary);
    background: var(--bg-subtle); border-radius: 4px; padding: 1px 6px; line-height: 1.6; white-space: nowrap;
  }
  .mtree-count { flex: none; font-size: 12px; color: var(--text-tertiary); min-width: 36px; text-align: right; }
  .mtree-node[hidden] { display: none !important; }
  /* 0 件（組織なし / 検索ヒットなし）の空状態 */
  .mtree-empty { padding: 28px 12px; text-align: center; color: var(--text-tertiary); font-size: 13px; }

  /* Checkbox: indeterminate（部分選択）状態 — 親が一部のみ選択中 */
  .check input:indeterminate ~ .box { background: var(--brand-navy); border-color: var(--brand-navy); }
  .check input:indeterminate ~ .box::after {
    content: ""; width: 10px; height: 2px; background: var(--bg-default); border-radius: 1px;
  }

  /* ============================================================
     ContactApps — 連絡先アプリ（SNS）アイコン + 編集行
     ----------------------------------------------------------------
     用途: ユーザープロフィールに紐づく外部アプリ（Slack, Line など）
           の登録を扱う (編集モード)。
     構成:
       .contact-app-logo       — 単体ロゴアイコン (24/32/40/48/56px)
       .contact-apps-edit      — 編集モード (1行=ロゴ+入力+削除)
       (select box は既存 .sb-trigger、メニューは既存 .menu を再利用)
     ロゴ実装: 公式ロゴ PNG をそのまま <img> で配置（背景タイル・色加工なし）。
              PNG は assets/contact-apps/*.png。
     ============================================================ */

  /* ---------- 単体ロゴアイコン ---------- */
  .contact-app-logo {
    --app-size: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--app-size);
    height: var(--app-size);
    flex: none;
  }
  .contact-app-logo > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
  /* サイズバリアント */
  .contact-app-logo.s-24 { --app-size: 24px; }
  .contact-app-logo.s-32 { --app-size: 32px; }
  .contact-app-logo.s-40 { --app-size: 40px; }
  .contact-app-logo.s-48 { --app-size: 48px; }
  .contact-app-logo.s-56 { --app-size: 56px; }

  /* ---------- 編集モード ----------
     構造: .contact-apps-edit__row 内に 既存の .sb-trigger (select box) と .input と .iconbtn を並べる。
           独自の trigger / menu スタイルは持たず、設計システム既存コンポーネントを再利用する。
     ============================================================ */
  .contact-apps-edit {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .contact-apps-edit__row {
    display: grid;
    grid-template-columns: 168px 1fr 32px;
    align-items: center;
    gap: 12px;
    position: relative;
  }
  /* sb-trigger を行の高さ (36px) に合わせる + 行内のロゴサイズ */
  .contact-apps-edit__row .sb-trigger {
    height: 36px;
    font-size: 13px;
  }
  .contact-apps-edit__row .sb-trigger .contact-app-logo {
    --app-size: 20px;
    flex: none;
  }
  .contact-apps-edit__row .input {
    height: 36px;
  }
  /* 削除ボタンは IconButton (.iconbtn) を再利用 */
  .contact-apps-edit__row .iconbtn {
    color: var(--text-tertiary);
  }
  .contact-apps-edit__row .iconbtn:hover {
    color: var(--red-500);
    background: var(--red-50);
  }
  /* 行直下に展開する .menu の位置決め (sb-trigger の真下) */
  .contact-apps-edit__row > .menu {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    z-index: 200;
    width: auto;
    min-width: 220px;
  }
  /* .menu 内でも contact-app-logo を mn-ico の代替として正しく揃える */
  .contact-apps-edit__row > .menu .mn-item .contact-app-logo {
    --app-size: 20px;
    flex: none;
  }
  /* 「+ 連絡先を追加」インライン行 */
  /* AddButton（破線 + ラベル）。フォーム内の編集可能な行リストに末尾へ行を追加する用途。
     既定は内容幅・左寄せ。is-block で全幅・中央。旧 .contact-*-edit__add を統合。 */
  .add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px dashed var(--border-control);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
  }
  .add-btn.is-block { width: 100%; justify-content: center; align-self: stretch; }
  .add-btn:hover {
    border-color: var(--brand-navy);
    color: var(--brand-navy);
    background: var(--brand-navy-50);
  }
  .add-btn .ic {
    width: 16px;
    height: 16px;
    flex: none;
  }


  /* ============================================================
     ContactInfo — 連絡先 (電話番号・携帯電話・メール・住所)
     構成:
       .contact-info-edit       — 編集モード (1行=種類アイコン+select+値+削除)
     アイコン: 絵文字を直接表示 (📞 📱 ✉️ 📍)
     select / メニューは ContactApps と同様 既存 .sb-trigger / .menu を再利用。
     ============================================================ */
  .contact-info-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 24px;
    height: 24px;
    font-size: 18px;
    line-height: 1;
    /* 絵文字の見た目をシステム側に揃える */
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  }
  .contact-info-ic.s-20 { width: 20px; height: 20px; font-size: 16px; }
  .contact-info-ic.s-32 { width: 32px; height: 32px; font-size: 22px; }

  /* ---------- 編集モード ----------
     構造: .contact-info-edit__row 内に 既存 .sb-trigger + .input + .iconbtn を並べる。
           sb-trigger 内に絵文字アイコン (.contact-info-ic) を入れる。
           独自の trigger / menu スタイルは持たず、設計システム既存コンポーネントを再利用する。
     ============================================================ */
  .contact-info-edit {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .contact-info-edit__row {
    display: grid;
    grid-template-columns: 168px 1fr 32px;
    align-items: center;
    gap: 12px;
    position: relative;
  }
  .contact-info-edit__row .sb-trigger {
    height: 36px;
    font-size: 13px;
  }
  .contact-info-edit__row .sb-trigger .contact-info-ic {
    width: 20px;
    height: 20px;
    font-size: 16px;
  }
  .contact-info-edit__row .input {
    height: 36px;
  }
  .contact-info-edit__row .iconbtn {
    color: var(--text-tertiary);
  }
  .contact-info-edit__row .iconbtn:hover {
    color: var(--red-500);
    background: var(--red-50);
  }
  /* 行直下に展開する .menu の位置決め */
  .contact-info-edit__row > .menu {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    z-index: 200;
    width: auto;
    min-width: 220px;
  }
  .contact-info-edit__row > .menu .mn-item .contact-info-ic {
    width: 20px;
    height: 20px;
    font-size: 16px;
  }
  /* 「+ 連絡先を追加」 — ContactApps と共通 */
  /* ============================================================
     Timeline (.htl)
     ============================================================
     用途: メンバープロフィールの職歴・学歴・受賞歴など
           「マーカー + 縦線 + カード」が縦に並ぶリスト。
           ※ TalkList の .tl-* と衝突しないよう .htl- prefix を採用
             （history timeline の略）。
     構成:
       .htl              — ラッパ <ul>
       .htl-row          — 1 行 <li>（左: マーカー / 右: カード）
       .htl-rail         — 左列（縦線 + マーカー）
       .htl-mark         — 円形マーカー（12px）
         .is-current     — 塗り（ブランド色）= 現職・在籍中
         (デフォルト)     — 外枠のみ = 過去
       .htl-body         — 右側カード
         .is-current     — 薄ナビー背景（現職強調）
       .htl-title        — 1 行目（役職など、太字、.tag 併置可）
       .htl-sub          — 2 行目（会社・部署など）
       .htl-meta         — 3 行目（期間など、薄字）
     ============================================================ */
  .htl {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
  }
  .htl-row {
    display: grid;
    grid-template-columns: 16px 1fr;
    column-gap: 12px;
    padding-bottom: 16px;
    position: relative;
  }
  .htl-row:last-child {
    padding-bottom: 0;
  }
  /* マーカー列 (左): 縦線 + 円マーカー */
  .htl-rail {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 6px;
  }
  .htl-rail::before {
    content: "";
    position: absolute;
    top: 18px;
    bottom: -16px;
    left: 50%;
    width: 1px;
    background: var(--border-default);
    transform: translateX(-50%);
  }
  .htl-row:last-child .htl-rail::before {
    display: none;
  }
  .htl-mark {
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-default);
    border: 1.5px solid var(--border-default);
    flex: none;
  }
  .htl-mark.is-current {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
  }
  /* 中身カード */
  .htl-body {
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .htl-body.is-current {
    background: var(--brand-navy-50);
    border-color: var(--brand-navy-200);
  }
  .htl-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    color: var(--text-primary);
  }
  .htl-sub {
    font-size: 13px;
    line-height: 18px;
    color: var(--text-primary);
  }
  .htl-meta {
    font-size: 12px;
    line-height: 16px;
    color: var(--text-tertiary);
  }

  /* ============================================================
     FactList (.fact-list)
     ============================================================
     用途: 「タイトル(+任意のバッジ) + 補足メタ」のシンプルな
           縦リスト。資格・受賞歴・所持スキルなど。
     構成:
       .fact-list              — ラッパ <ul>
       .fact-list__item        — 1 行 <li>（区切り線つき）
       .fact-list__title       — タイトル行（太字 + 任意の .tag）
       .fact-list__meta        — メタ行（取得日など、薄字）
     ============================================================ */
  .fact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
  }
  .fact-list__item {
    padding: 12px 0;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .fact-list__item:first-child {
    border-top: none;
    padding-top: 0;
  }
  .fact-list__item:last-child {
    padding-bottom: 0;
  }
  .fact-list__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    color: var(--text-primary);
  }
  .fact-list__meta {
    font-size: 12px;
    line-height: 16px;
    color: var(--text-tertiary);
  }

  /* ==== Cropper ============================================================
     Photo crop UI. Stage shows the source image with a dimmed mask outside
     a centered crop frame (4 corner handles + rule-of-thirds grid). Toolbar
     below has ratio segmented buttons, zoom slider, rotate, reset.

     Markup:
       .cropper                — outer container (stage + toolbar)
       .cropper__stage         — dark canvas holding image + frame
       .cropper__img           — source image (background-image, contain)
       .cropper__frame         — centered crop rectangle (visible, dragable)
       .cropper__handle        — 4 corner resize handles (--tl/--tr/--bl/--br)
       .cropper__grid          — rule-of-thirds grid lines inside frame
       .cropper__toolbar       — control bar (ratio + zoom + rotate + reset)
       .cropper__ratios        — segmented ratio buttons wrapper
       .cropper__ratio-btn     — single ratio button (.is-active for selected)
       .cropper__zoom          — zoom in / range slider / zoom out
       .cropper__sep           — vertical divider in toolbar

     Aspect modifiers (apply on .cropper):
       .ar-1-1 (default) / .ar-4-3 / .ar-16-9 / .ar-16-10 / .ar-9-16
       .is-round           — circular frame (avatar cropping)

     Note: visual component only. JS for drag / resize / actual crop is
     consumer's responsibility (e.g. Cropper.js).
     ============================================================ */
  .cropper {
    display: flex; flex-direction: column;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-8);
    overflow: hidden;
  }
  /* 画像を切り抜くための台。**両テーマで暗いまま**にする——明るい台だと写真の明るい部分と
     境目が分からず、どこを切っているのか読めない。テーマに追従させないので生の値で持つ。 */
  .cropper__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #111;
    overflow: hidden;
    user-select: none;
  }
  .cropper__img {
    position: absolute; inset: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
  }
  .cropper__frame {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 56%;
    aspect-ratio: 1 / 1;
    border: 1.5px solid var(--bg-default);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    cursor: move;
  }
  .cropper.ar-1-1 .cropper__frame  { aspect-ratio: 1 / 1;  width: 56%; }
  .cropper.ar-4-3 .cropper__frame  { aspect-ratio: 4 / 3;  width: 64%; }
  .cropper.ar-16-9 .cropper__frame { aspect-ratio: 16 / 9; width: 72%; }
  .cropper.ar-16-10 .cropper__frame{ aspect-ratio: 16 / 10; width: 70%; }
  .cropper.ar-9-16 .cropper__frame { aspect-ratio: 9 / 16; width: 32%; }
  .cropper.is-round .cropper__frame { border-radius: 50%; }
  .cropper.is-round .cropper__grid { display: none; }

  .cropper__handle {
    position: absolute;
    width: 12px; height: 12px;
    background: var(--bg-default);
    border: 1.5px solid var(--brand-navy);
    border-radius: 2px;
  }
  .cropper__handle--tl { top: -6px;    left: -6px;    cursor: nwse-resize; }
  .cropper__handle--tr { top: -6px;    right: -6px;   cursor: nesw-resize; }
  .cropper__handle--bl { bottom: -6px; left: -6px;    cursor: nesw-resize; }
  .cropper__handle--br { bottom: -6px; right: -6px;   cursor: nwse-resize; }

  /* Rule-of-thirds grid: 2 vertical + 2 horizontal lines (1/3 + 2/3) */
  .cropper__grid {
    position: absolute; inset: 0;
    pointer-events: none;
    background-image:
      linear-gradient(to right, transparent calc(33.33% - 0.5px), rgba(255,255,255,0.4) calc(33.33% - 0.5px), rgba(255,255,255,0.4) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px)),
      linear-gradient(to right, transparent calc(66.66% - 0.5px), rgba(255,255,255,0.4) calc(66.66% - 0.5px), rgba(255,255,255,0.4) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)),
      linear-gradient(to bottom, transparent calc(33.33% - 0.5px), rgba(255,255,255,0.4) calc(33.33% - 0.5px), rgba(255,255,255,0.4) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px)),
      linear-gradient(to bottom, transparent calc(66.66% - 0.5px), rgba(255,255,255,0.4) calc(66.66% - 0.5px), rgba(255,255,255,0.4) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px));
  }

  .cropper__toolbar {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: var(--bg-default);
    border-top: 1px solid var(--border-default);
    flex-wrap: wrap;
  }
  .cropper__ratios {
    display: inline-flex;
    background: var(--bg-subtle);
    border-radius: var(--r-4);
    padding: 2px;
    gap: 2px;
  }
  .cropper__ratio-btn {
    border: none;
    background: transparent;
    font: inherit;
    font-size: 12px; font-weight: 500;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: var(--r-4);
    cursor: pointer;
    font-variant-numeric: tabular-nums;
  }
  .cropper__ratio-btn:hover { color: var(--text-primary); }
  .cropper__ratio-btn.is-active {
    background: var(--bg-default);
    color: var(--text-primary);
    box-shadow: var(--shadow-1);
  }
  .cropper__zoom {
    display: inline-flex; align-items: center; gap: 8px;
    flex: 1; min-width: 180px;
  }
  .cropper__zoom input[type="range"] {
    flex: 1;
    height: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-subtle);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
  }
  .cropper__zoom input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    background: var(--brand-navy);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-default);
    box-shadow: var(--shadow-1);
  }
  .cropper__zoom input[type="range"]::-moz-range-thumb {
    width: 14px; height: 14px;
    background: var(--brand-navy);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-default);
  }
  .cropper__sep {
    width: 1px; height: 20px;
    background: var(--border-default);
    flex: none;
  }

  /* ==== OrgChart =======================================================
     Hierarchical org tree (department / member visualization) with
     pan / zoom / collapse-expand interactions.

     Markup:
       .oc                  — outer container (grid: toolbar + viewport)
       .oc__toolbar         — left vertical toolbar (zoom / fit / etc.)
       .oc__viewport        — pan/zoom viewport (overflow:hidden, grab)
       .oc__canvas          — chart surface (transformed for pan/zoom)
       .oc__lines           — SVG layer for connector paths (inside canvas)
       .oc-node             — org node (white card with title + meta + chev)
       .oc-node__main       — title + meta wrapper
       .oc-node__title      — department name
       .oc-node__meta       — secondary stats (直属/配下 など)
       .oc-node__chev       — expand/collapse circular button (navy)
       .oc-node.is-root     — root variant (navy ring)
       .oc-node.is-collapsed — chevron rotated, subtree hidden
       .oc-member           — leaf member pill (amber bg + avatar + 氏名)

     Interactions handled by assets/js/org-chart.js:
       - mousedown + drag on .oc__viewport     → pan
       - wheel on .oc__viewport                → zoom (toward cursor)
       - click .oc-node__chev                  → toggle subtree visibility
       - toolbar buttons [data-oc-action]      → zoom-in / zoom-out / fit

     Data attributes for tree relationships:
       - data-oc-id              on .oc-node    (unique id)
       - data-oc-parent          on .oc-node / .oc-member (parent id)
       - data-oc-line-from       on SVG <path>  (parent id for line)
       - data-oc-hidden="true"   set by JS to hide collapsed subtree
     ===================================================================== */
  .oc {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr;
    height: 600px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-8);
    overflow: hidden;
  }
  /* 全画面表示（OrgChart のツールバー「全画面」）：ビューポート全体に広げる */
  .oc:fullscreen, .oc:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; }

  /* ===== NetworkGraph（つながり分析）: 浮遊ツールバー＋全画面（OrgChart のコントロールと同型） ===== */
  .network-graph-wrap { position: relative; width: 100%; }
  /* 全画面時はビューポート全体に。地色を敷かないと透明→黒背景になる */
  .network-graph-wrap:fullscreen, .network-graph-wrap:-webkit-full-screen {
    width: 100vw; height: 100vh; background: var(--bg-default); border-radius: 0;
  }
  /* 左上に縦積みのズーム／全画面ボタン（.oc__toolbar と同じ見た目・小さなカード） */
  .ng__toolbar {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    display: flex; flex-direction: column; gap: 4px; padding: 4px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-8);
    box-shadow: var(--shadow-1);
  }
  /* The toolbar hugs the top-left corner, where the default tooltip (above the button, centered) is
     unreadable: the first button's floats off the top edge, and a wide label such as「全画面を終了」
     overflows the left edge — in fullscreen it is clipped by the viewport itself. Put the bubble to
     the right of the button, vertically centered, with the arrow moved to its left edge. */
  .ng__toolbar .iconbtn > .tt {
    bottom: auto;
    top: 50%;
    left: calc(100% + 8px);
    transform: translate(-4px, -50%);
  }
  .ng__toolbar .iconbtn:hover > .tt,
  .ng__toolbar .iconbtn:focus-visible > .tt,
  .ng__toolbar .iconbtn.is-tt-show > .tt {
    transform: translate(0, -50%);
  }
  .ng__toolbar .iconbtn > .tt::after {
    bottom: auto;
    top: 50%;
    left: -4px;
    transform: translateY(-50%) rotate(45deg);
  }
  .oc__toolbar {
    display: flex; flex-direction: column;
    gap: 4px; padding: 6px;
    background: var(--bg-default);
    border-right: 1px solid var(--border-default);
    z-index: 2;
  }
  .oc__viewport {
    position: relative;
    overflow: hidden;
    cursor: grab;
    background-color: var(--bg-page);
    background-image: radial-gradient(circle, var(--border-subtle) 1px, transparent 1px);
    background-size: 16px 16px;
  }
  .oc__viewport.is-panning { cursor: grabbing; }
  .oc__canvas {
    position: absolute; top: 0; left: 0;
    width: 1400px; height: 800px;
    transform-origin: 0 0;
  }
  .oc__lines {
    position: absolute; inset: 0;
    pointer-events: none;
    width: 100%; height: 100%;
  }
  .oc__lines path {
    fill: none;
    stroke: var(--amber-500);
    stroke-width: 1.5;
  }

  .oc-node {
    position: absolute;
    display: inline-flex; align-items: center;
    gap: 10px;
    padding: 10px 8px 10px 14px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-6);
    box-shadow: var(--shadow-1);
    width: 220px;
    user-select: none;
    box-sizing: border-box;
  }
  .oc-node.is-root {
    border-color: var(--brand-navy);
    box-shadow: 0 0 0 3px var(--brand-navy-50);
  }
  /* 並べ替え可能なツリー（OrgChart reorderable）。掴めることは掴む前に分かる必要があるので
     カーソルで示す——盤面のパンと同じ grab では区別が付かないため move にする。 */
  .oc-node.is-draggable { cursor: move; }
  .oc-node.is-dragging { opacity: .4; }
  .oc-node.is-drop-target {
    border-color: var(--brand-navy);
    border-style: dashed;
    background: var(--brand-navy-50);
  }
  .oc-node__main { flex: 1; min-width: 0; }
  .oc-node__title {
    font-size: 13px; font-weight: 700; color: var(--text-primary);
    margin: 0 0 2px;
    line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .oc-node__meta {
    font-size: 11px; color: var(--text-tertiary);
    line-height: 1.5; margin: 0;
  }
  /* 件数が「記事を入れる」入口。**button で描く**——`<span onClick>` では
     キーボードから押せない（DS-21）。button の既定の見た目は呼び出し側で打ち消す。 */
  .oc-node__meta-link {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .oc-node__meta-link:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: 2px;
  }
  .oc-node__meta-link:hover { color: var(--text-secondary); }
  .oc-node__chev {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--brand-navy);
    color: var(--text-on-fill);
    border: none;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex: none;
    transition: transform .15s ease, background .12s ease;
  }
  .oc-node__chev:hover { background: var(--fill-brand-strong); }
  .oc-node__chev .ic { width: 14px; height: 14px; color: var(--text-on-fill); }
  .oc-node.is-collapsed .oc-node__chev { transform: rotate(-90deg); }

  .oc-member {
    position: absolute;
    display: inline-flex; align-items: center;
    gap: 8px;
    padding: 4px 14px 4px 4px;
    background: var(--amber-50);
    border: 1px solid var(--amber-200);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    box-sizing: border-box;
    width: 180px;
    /* 幅は固定なので、はみ出す分は隠して `…` にする（下の __label）。
       これが無いと長いタイトルがピルの外へ流れ出て、線や隣のノードに重なる。 */
    overflow: hidden;
  }
  .oc-member .avatar { flex: none; }
  /* 並べ替え可能なピル（OrgChart membersReorderable）。ノードと同じ見え方に揃える。 */
  .oc-member.is-draggable { cursor: move; }
  .oc-member.is-dragging { opacity: .4; }
  .oc-member.is-drop-target {
    border-color: var(--brand-navy);
    border-style: dashed;
    background: var(--brand-navy-50);
  }
  /* ピルの中の文字。切り詰めは必ずこの要素に付ける（親は flex なので min-width:0 が要る）。 */
  .oc-member__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Hidden via JS toggle */
  .oc [data-oc-hidden="true"] { display: none; }
  /* Filtered out via root-search (focused subtree view) */
  .oc [data-oc-filtered="true"] { display: none; }
  /* Locked pan/zoom state */
  .oc .oc__viewport.is-locked { cursor: not-allowed; }
  /* 縦ツールバーは左端 + overflow:hidden のため、tooltip を上ではなく右側に出す。 */
  .oc__toolbar .iconbtn > .tt {
    left: calc(100% + 10px); right: auto; top: 50%; bottom: auto;
    transform: translate(-4px, -50%);
  }
  .oc__toolbar .iconbtn:hover > .tt,
  .oc__toolbar .iconbtn:focus-visible > .tt,
  .oc__toolbar .iconbtn.is-tt-show > .tt {
    transform: translate(0, -50%);
  }
  .oc__toolbar .iconbtn > .tt::after {
    left: -4px; right: auto; top: 50%; bottom: auto;
    transform: translateY(-50%) rotate(45deg);
  }

  /* OrgChart — edit mode (add/remove buttons attached to nodes)
     Enable by adding .is-editing to the .oc container.

     Markup additions (inside .oc-node and .oc-member):
       <button class="oc-node__add">    — green + button (左、子を追加)
       <button class="oc-node__remove"> — red - button  (右、削除)
       <button class="oc-member__add">  — green + button on a member pill
  */
  .oc-node__add,
  .oc-node__remove,
  .oc-member__add {
    position: absolute;
    width: 22px;
    height: 22px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-default);
    border-radius: var(--r-4);
    cursor: pointer;
    padding: 0;
    z-index: 1;
  }
  .oc-node__add,
  .oc-member__add {
    border: 1.5px solid var(--teal-600);
    color: var(--teal-600);
  }
  .oc-node__remove {
    border: 1.5px solid var(--red-500);
    color: var(--red-500);
  }
  .oc-node__add:hover,
  .oc-member__add:hover { background: var(--teal-50); }
  .oc-node__remove:hover { background: var(--red-50); }
  .oc-node__add svg,
  .oc-node__remove svg,
  .oc-member__add svg { width: 14px; height: 14px; }

  /* ＋ 子組織を追加 = 右（子が伸びる方向）。− 削除 = 左（＋と分離し誤爆を防ぐ）。メンバー＋は左のまま。 */
  .oc-node__add {
    right: -11px;
    top: 50%;
    transform: translateY(-50%);
  }
  .oc-member__add {
    left: -11px;
    top: 50%;
    transform: translateY(-50%);
  }
  .oc-node__remove {
    left: -11px;
    top: 50%;
    transform: translateY(-50%);
  }

  .oc.is-editing .oc-node__add,
  .oc.is-editing .oc-node__remove,
  .oc.is-editing .oc-member__add {
    display: inline-flex;
  }

  /* OrgChart — hide members + their connectors (toggleable view) */
  .oc.no-members .oc-member,
  .oc.no-members .oc__lines path[data-line-to="member"] {
    display: none;
  }

  /* OrgTable — 階層リスト表示 (会社組織の管理ビュー)
     .data-table を継承し、 階層インデント + 折りたたみだけ追加する。
     インデントは <tr style="--depth: N"> で制御 (0-3, 最大 4 階層)。
     構造:
       <div class="dt-scroll js-sticky-scroll">
         <table class="data-table org-table">
           <thead><tr>…</tr></thead>
           <tbody>
             <tr class="org-row" data-id="…" data-parent="…" data-depth="N" style="--depth: N">…</tr>
           </tbody>
         </table>
       </div>
  */
  .org-table .org-row__name {
    display: flex; align-items: center; gap: 6px;
    padding-left: calc(var(--depth, 0) * 24px);
    font-weight: 500;
    color: var(--text-primary);
    min-width: 0;
  }
  .org-table .org-row__chev {
    width: 20px; height: 20px;
    flex: none;
    display: inline-grid; place-items: center;
    border: 0; background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--r-4);
    transition: transform .15s ease, background .12s ease;
  }
  .org-table .org-row__chev:hover { background: var(--int-hover); color: var(--text-secondary); }
  .org-table .org-row__chev .ic { width: 14px; height: 14px; }
  .org-table .org-row.is-collapsed .org-row__chev:not(.is-leaf) { transform: rotate(-90deg); }
  /* Leaf rows: invisible chevron for alignment */
  .org-table .org-row__chev.is-leaf { visibility: hidden; cursor: default; }
  /* 組織名ラベル：クリックで編集（hover で navy 下線） */
  /* 見た目は `.cell-link` が持つ（画面側で併せて付ける）。ここで hover の色と下線を
     持っていたころは、静止時は本文色のままで**リンクだと分からず**、しかも表の中で
     セルリンクの見え方が 1 つ増えていた。specificity がこちら（2 クラス）のほうが高く、
     `text-decoration` の一括指定が `.cell-link:hover` の 2px を打ち消すので、規則ごと外す。 */
  /* 行末アクション (data-table の col-actions セル内のラッパー) — グローバル。
     `inline-flex` だと箱が中身ぶんに縮んで `justify-content` が効かず、`+` を持たない行
     （深さ 3 / 非公開チーム）の `…` だけ左へずれて、行ごとに位置が変わっていた。
     セル幅いっぱいの `flex` にして右端で揃える。列幅は DataTable の `rowMenuWidth`。 */
  .org-row__actions {
    display: flex; gap: 4px;
    justify-content: flex-end;
    white-space: nowrap;
  }
  /* Collapse hidden + search-miss + facet miss */
  .org-table .org-row[data-hidden="true"],
  .org-table .org-row[data-search-match="false"],
  .org-table .org-row[data-facet-match="false"] { display: none; }
  /* Compact rows for org table */
  .org-table tbody td { padding: 10px 16px; }
  /* Numeric columns — slightly muted */
  .org-table .org-row__direct,
  .org-table .org-row__total,
  .org-table .org-row__teams {
    color: var(--text-secondary);
    font-size: 13px;
  }
  /* Clickable numeric cells (人数押下でユーザー一覧表示) */
  .org-row__direct.is-clickable,
  .org-row__total.is-clickable,
  .proj-row__count.is-clickable,
  .role-row__count.is-clickable,
  .thread-row__owners.is-clickable,
  .thread-row__members.is-clickable {
    color: var(--brand-navy);
    cursor: pointer;
    font-weight: 600;
    /* 静止状態から下線を出す。**表では隣に非リンクのセルが同じ位置・同じ形で並ぶ**ので、
       色だけでは押せるか判別できない——navy `#001951` と `--text-primary` の差は 1.14:1、
       `--text-secondary` とは 2.21:1 で、WCAG 1.4.1 が色のみを許す 3:1 に届かない。
       単独で置く操作リンク（`.btn--link`）は位置と形で区別できるので下線が要らないが、
       表のセルはその理由が成立しない（known-issues DEC-01）。 */
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
  }
  .org-row__direct.is-clickable:hover,
  .org-row__total.is-clickable:hover,
  .proj-row__count.is-clickable:hover,
  .role-row__count.is-clickable:hover,
  .thread-row__owners.is-clickable:hover,
  .thread-row__members.is-clickable:hover {
    text-decoration-thickness: 2px;
  }

  /* Checkbox (org-list 用、 ブランドカラーに合わせる) */
  .org-check {
    width: 16px; height: 16px;
    accent-color: var(--brand-navy);
    cursor: pointer;
    margin: 0;
  }

  /* Toolbar: search + facets + primary CTA */
  .org-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }

  /* Bulk action bar — appears when rows selected */
  .bulk-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: var(--brand-navy-50);
    border: 1px solid var(--brand-navy-100);
    border-radius: var(--r-8);
  }
  .bulk-bar[hidden] { display: none; }
  .bulk-bar__count {
    font-size: 13px;
    color: var(--brand-navy);
    margin-right: 8px;
  }
  .bulk-bar__count strong {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }


  /* LogoUpload — チーム / 組織のロゴアップロード UI
     <div class="logo-upload">
       <span class="logo-upload__preview">…icon or img…</span>
       <div class="logo-upload__main">
         <button class="btn btn--secondary sm">ファイルを選択</button>
         <p class="logo-upload__hint">JPG / PNG…</p>
       </div>
     </div>
  */
  .logo-upload {
    display: flex; align-items: center; gap: 16px;
  }
  .logo-upload__preview {
    width: 64px; height: 64px;
    border-radius: var(--r-8);
    background: var(--bg-subtle);
    border: 1px dashed var(--border-default);
    display: grid; place-items: center;
    color: var(--text-tertiary);
    flex: none;
    overflow: hidden;
  }
  .logo-upload__preview .ic { width: 20px; height: 20px; }
  .logo-upload__preview img {
    width: 100%; height: 100%; object-fit: cover;
  }
  .logo-upload__main { flex: 1; min-width: 0; }
  .logo-upload__hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 6px 0 0;
  }
  /* Large variant — used for product images, banners, etc. */
  .logo-upload.is-lg .logo-upload__preview { width: 160px; height: 160px; }
  .logo-upload.is-lg .logo-upload__preview .ic { width: 32px; height: 32px; }
  /* Circular variant — used for badge / avatar style image uploads */
  .logo-upload.is-circle .logo-upload__preview { border-radius: 50%; }

  /* ============================================================
     CoverHead — カバー画像 + 重ね丸アバターの編集ヘッダー
     プロフィール / エール先などの「カバー + アイコン」編集に使う。
       <div class="cover-head">
         <div class="cover-head__cover" style="background-image: url(...)">
           <button class="btn btn--secondary sm cover-head__cover-btn">
             <i data-lucide="image" class="ic"></i>カバー画像を変更
           </button>
         </div>
         <div class="cover-head__avatar">
           <span class="avatar s-96"><span class="av-inner"><img src="..." alt=""></span></span>
           <button class="cover-head__avatar-btn" type="button" aria-label="アイコンを変更">
             <i data-lucide="camera" class="ic"></i>
           </button>
         </div>
       </div>
     重なり分の余白として margin-bottom を確保している。
     ============================================================ */
  .cover-head { position: relative; margin-bottom: 52px; }
  .cover-head__cover {
    position: relative;
    height: 140px;
    border-radius: var(--r-8);
    background: var(--bg-subtle) center / cover no-repeat;
    border: 1px solid var(--border-default);
  }
  .cover-head__cover-btn {
    position: absolute; top: 12px; right: 12px;
  }
  .cover-head__avatar {
    position: absolute; left: 20px; bottom: -36px;
  }
  .cover-head__avatar .avatar {
    border: 3px solid var(--bg-default);
    box-shadow: var(--shadow-2);
  }
  .cover-head__avatar-btn {
    position: absolute; right: -2px; bottom: -2px;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    box-shadow: var(--shadow-1);
    cursor: pointer;
    transition: background .12s ease;
  }
  .cover-head__avatar-btn:hover { background: var(--int-hover); }
  .cover-head__avatar-btn .ic { width: 15px; height: 15px; }

  /* ---------- MemberCombobox ----------
     宛先を選ぶドロップダウン。Figma design-system 644:24616。
     モーダルではなく入力欄に紐づいた dropdown にしているのは、**打ちながら絞れる**ようにするため。
     チップの並びがそのまま入力欄になり、打った文字で下のリストが絞られる。
     上下キーで移動して Enter で追加できるので、マウスに持ち替えずに複数人を選べる。 */
  .mcb-pop {
    display: flex; flex-direction: column;
    width: max-content; min-width: 420px; max-width: 560px;
    max-height: min(420px, var(--pop-avail, 420px));
    border: 1px solid var(--border-default);
    border-radius: var(--r-10, 10px);
    background: var(--bg-default);
    box-shadow: 0 4px 24px rgba(0, 25, 81, .10);
    overflow: hidden;
  }
  /* 並び替えと「すべて選択」。並び替えは「誰に贈るか」を思い出す手がかりなので上に出す。 */
  .mcb-pop > .mcb-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-default);
    flex: none;
  }
  /* 行は既存の UserListItem（`.uli-row`）を使う。枠と角丸はポップ側が持つので
     `.uli-shell` は使わず、行間の境界だけ引く。 */
  .mcb-pop > .mcb-list { flex: 1; min-height: 0; overflow-y: auto; }
  .mcb-pop > .mcb-list > .uli-row + .uli-row { border-top: 1px solid var(--border-subtle); }
  /* 上下キーで指している行。hover と区別できるよう左に navy のバーを出す。 */
  .mcb-pop .uli-row.is-active { background: var(--brand-navy-50); box-shadow: inset 3px 0 0 0 var(--brand-navy); }
  .mcb-pop .uli-row > .uli-check { flex: none; color: var(--brand-navy); display: inline-flex; }
  .mcb-pop .uli-row > .uli-check .ic { width: 18px; height: 18px; }
  .mcb-pop > .mcb-empty {
    padding: 28px 16px;
    text-align: center;
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 20px;
    color: var(--text-tertiary);
  }
  /* 打ち込む入力欄。チップの並びに溶け込ませる（枠を持たせない）。 */
  .mcb-input {
    flex: 1; min-width: 120px;
    padding: 0; border: 0;
    background: none;
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px;
    color: var(--text-primary);
  }
  .mcb-input:focus { outline: none; }
  .mcb-input::placeholder { color: var(--text-tertiary); }

  /* ---------- PointPicker ----------
     贈るポイントを選ぶポップオーバー。Figma design-system 644:26968
     （「Tooltip with border + shadow」＝ hover で出す白いタイプ・内容が複雑な場合用）。

     ただの選択肢一覧ではなく「**人数 × 単価 = 合計**」を常に見せるのが要点。
     複数人に贈ると合計が人数倍になるので、1 回の上限や自分の残高に当たるかが
     選ぶ前に分からないと、押してから断られることになる。
     上限・残高を超える選択肢はその場で disabled にする。 */
  .pt-pop {
    width: max-content;
    padding: 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-8);
    background: var(--bg-default);
    box-shadow: 0 4px 24px rgba(0, 25, 81, .10);
  }
  /* 上向きの矢印。トリガーの位置に合わせて JS が --pt-arrow を入れる。 */
  .pt-pop::before {
    content: "";
    position: absolute;
    top: -6px; left: var(--pt-arrow, 40px);
    width: 11px; height: 11px;
    transform: rotate(-45deg);
    border-top: 1px solid var(--border-strong);
    border-right: 1px solid var(--border-strong);
    border-radius: 0 2px 0 0;
    background: var(--bg-default);
  }
  .pt-pop.is-below::before { top: auto; bottom: -6px; transform: rotate(135deg); }
  .pt-pop > .ptp-head { display: flex; flex-direction: column; gap: 12px; text-align: center; }
  .pt-pop .ptp-title {
    margin: 0;
    font-family: var(--ff-sans);
    font-size: 20px; line-height: 28px; font-weight: 600;
    color: var(--text-primary);
  }
  .pt-pop .ptp-balance {
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px;
    color: var(--text-secondary);
  }
  /* 上限は「押せない理由」なので danger。色だけに頼らず文章で書く。 */
  .pt-pop .ptp-limit {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--red-500);
  }
  /* 人数 × 単価 = 合計。ここが実際に引かれる数字なので帯で強調する。 */
  .pt-pop > .ptp-total {
    display: flex; align-items: center; justify-content: center;
    height: 36px;
    margin: 24px 0;
    padding: 10px;
    border-radius: var(--r-10, 10px);
    background: var(--brand-navy-50);
    font-family: var(--ff-sans);
    font-size: 16px; line-height: 16px; font-weight: 600;
    color: var(--int-brand-h);
    white-space: nowrap;
  }
  /* 上限・残高を超えた合計は赤で示す（選べない状態のまま気づかせない） */
  .pt-pop > .ptp-total.is-over { background: var(--red-50); color: var(--red-600); }
  .pt-pop > .ptp-grid { display: grid; grid-template-columns: repeat(3, 74px); gap: 12px; }
  .ptp-opt {
    height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--brand-navy-100);
    border-radius: var(--r-10, 10px);
    background: var(--bg-default);
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 14px; font-weight: 500;
    color: var(--text-brand);
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease;
  }
  .ptp-opt:hover:not(:disabled) { background: var(--brand-navy-50); }
  /* 枠は素の状態にもあるので、色だけ変えても「色だけ」になる（DS-19）。内側に 1px 足して
     輪郭の太さを変える。`border-width` を 2px にすると box-sizing で中身が 1px 縮み、
     押した瞬間に文字がずれる。 */
  .ptp-opt.is-on { background: var(--brand-navy-100); border-color: var(--border-selected); color: var(--int-brand-h); box-shadow: inset 0 0 0 1px var(--border-selected); }
  .ptp-opt:disabled {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
    color: var(--text-disabled);
    cursor: not-allowed;
  }
  .ptp-opt:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 1px; }

  /* ---------- BadgeSelect ----------
     バッジ選択モーダルの中身。`PC/sample/recog_badge_modal_v5.html` の設計をそのまま採る。

     ツールチップ方式をやめて**左に固定のプレビューパネル**にしている理由は 3 つ：
       ① ツールチップだと上段のバッジが自分の説明で隠れる
       ② 説明が 5 段落あるバッジもあり、ツールチップでは最後まで読めない
          （パネルなら、バッジからパネルへマウスを移してスクロールできる）
       ③ ホバーでプレビュー → クリックで即確定なので、確定ボタンを押させずに済む

     パネルの中身は「新しいバッジをホバーしたときだけ」更新し、ホバーが外れても戻さない
     （sticky preview）。戻すと、パネルへマウスを移した瞬間に説明が消えて読めなくなる。 */
  .badge-sel { display: flex; height: 560px; min-height: 0; }
  /* 左：固定パネル。 */
  .badge-sel > .bsel-panel {
    width: 400px; flex: none;
    display: flex; flex-direction: column;
    min-height: 0;
    background: var(--bg-subtle);
    border-right: 1px solid var(--border-default);
  }
  /* 「プレビュー中 / 選択中」の状態行は置かない。ホバーで切り替わるたびに行が出入りして
     絵柄の位置がずれるのと、選択中はグリッドの ✓ で分かるため。
     選択中の合図は名前の隣にインラインで置く（縦位置を動かさない）。 */
  /* 固定しておくのは絵柄と名前だけ。ここが「いまどのバッジを読んでいるか」の目印。 */
  .bsel-head { padding: 20px 28px 12px; flex: none; }
  .bsel-icon { width: 96px; height: 96px; margin: 0 auto 10px; display: block; }
  .bsel-name-row {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
  }
  /* 名前はグリッドで既に見えているので、カテゴリより小さく抑える（新しい情報はカテゴリ側）。 */
  .bsel-name {
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--brand-navy);
    text-align: center;
    margin: 0;
  }
  .bsel-on {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--brand-navy-50);
    font-family: var(--ff-sans);
    font-size: 11px; line-height: 16px; font-weight: 600;
    color: var(--text-brand);
  }
  .bsel-on .ic { width: 12px; height: 12px; }
  /* カテゴリ。会社によっては一言ではなく数行の文章を入れるので、ピルにしない。
     中央寄せ・太字で「このバッジは何のためか」を最初に読ませ、下に区切り線を挟んで
     箇条書き・説明へ渡す。

     3 行で切って独立したスクロールにはしない — 縦に 2 つのスクロール領域が並ぶと
     ホイールがどちらに効くか予測できず、しかも一番大事な枠組みの文を隠すことになる。
     区切り線ごとスクロール領域に入れて、パネルは 1 本のスクロールで上から読ませる。 */
  .bsel-scroll > .bsel-cat {
    margin: 0;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--border-default);
    font-family: var(--ff-sans);
    font-size: 15px; line-height: 26px; font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .bsel-scroll > .bsel-cat + * { margin-top: 14px; }
  /* 説明。ここだけスクロールする（パネル全体ではなく本文だけ動かす）。 */
  /* 説明。カテゴリ・箇条書き・段落をまとめて 1 本でスクロールする。 */
  .bsel-scroll {
    flex: 1; min-height: 0;
    overflow-y: auto;
    padding: 0 28px 20px;
  }
  .bsel-scroll > ul { margin: 0 0 14px; padding-left: 18px; }
  .bsel-scroll li {
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 22px;
    color: var(--text-secondary);
    margin-bottom: 4px;
  }
  .bsel-scroll > p {
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 24px;
    color: var(--text-secondary);
    margin: 0 0 12px;
  }
  .bsel-scroll > p:last-child { margin-bottom: 0; }
  /* 多言語の一言。バッジの由来なので本文と区別して引用として置く。 */
  .bsel-quote {
    margin: 0 0 14px;
    padding: 10px 14px;
    border-left: 3px solid var(--brand-navy);
    border-radius: 0 var(--r-8) var(--r-8) 0;
    background: var(--bg-default);
  }
  .bsel-quote > p {
    margin: 0 0 4px;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 21px;
    color: var(--text-tertiary);
    font-style: italic;
  }
  .bsel-quote > p:last-child { margin-bottom: 0; color: var(--text-secondary); font-style: normal; font-weight: 600; }
  .bsel-foot { flex: none; padding: 16px 28px 22px; border-top: 1px solid var(--border-default); }
  /* 右：バッジのグリッド。 */
  .badge-sel > .bsel-grid { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; }
  .badge-sel .badge-pick { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  /* このモーダル内だけタイルを大きくする（絵柄で選ぶので小さいと判別できない）。 */
  .badge-sel .badge-opt { padding: 14px 6px 12px; border-radius: 14px; border-width: 2px; }
  .badge-sel .badge-opt > img { width: 58px; height: 58px; }
  /* 名前は 2 行まで折り返す。1 行省略だと「Congratulations」のような長い単語が
     「Congratulatio…」になってどのバッジか読めない。 */
  .badge-sel .badge-opt > .bo-name {
    font-size: 12px; line-height: 16px; font-weight: 600;
    color: var(--text-primary);
    white-space: normal;
    overflow: visible; text-overflow: clip;
    overflow-wrap: anywhere;
  }
  .badge-sel .badge-opt:hover { transform: translateY(-2px); }
  /* プレビュー中（ホバー）と選択中（付いている）を区別する。 */
  .badge-opt.is-preview { border-color: var(--brand-navy-100); background: var(--brand-navy-50); }
  .badge-opt.is-on::after {
    content: "";
    position: absolute;
    top: -4px; right: 14px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--brand-navy) center / 10px no-repeat;
    /* check（lucide と同じ形）を mask ではなく背景 SVG で置く。 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    box-shadow: 0 1px 3px rgba(0, 25, 81, .25);
  }
  .badge-opt { position: relative; }

  /* ヒント + キャンセルの帯（モーダル下端）。操作の作法（ホバーで説明・クリックで確定）を
     その場で伝えるための行なので、フッターのボタンだけにしない。 */
  .modal-foot-hint {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 26px;
    border-top: 1px solid var(--border-default);
  }
  .modal-foot-hint > span {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 18px;
    color: var(--text-tertiary);
  }

  /* ---------- LetterComposer ----------
     レターを書く枠。Figma design-system 644:24058（SendLetter）。
     モーダルではなく**フィードの上に置くインラインの枠**で、「レターを編集 / 下書き / 送信予約」の
     3 タブを同じ枠の中に持つ。書きかけと予約が同じ場所にあるので、下書きを別画面に探しに行かずに済む。

     編集タブの中身は 宛先行 → 入力 + バッジ + ポイント → footer → 添付 の順。 */
  .let-comp {
    display: flex; flex-direction: column; gap: 12px;
    padding: 12px 0;
    border: 1px solid rgba(0, 25, 81, 0.18);
    border-radius: var(--r-10, 10px);
    background: var(--bg-default);
    min-width: 0;
  }
  /*
   * 作成枠の外側のガラス（`.let-comp-glass`）。Figma のドロップシャドウ
   * （X0 / Y4 / ぼかし12 / 広がり0 / #000000 5%）＋背景のぼかし 30 をそのまま写している。
   * 開いた枠・閉じた枠のどちらも同じ額縁に入れる（開いた瞬間に枠の性格が変わらないように）。
   */
  .let-comp-glass {
    padding: 8px;
    /* 内側（`--r-10`）＋ padding 8px。外側と内側の角を同心にすると、角の帯の太さが
       一周ずっと 8px で揃う。外だけ大きいと角で額縁が太って見える。 */
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    min-width: 0;
  }

  /*
   * 閉じた状態（`LetterComposerClosed`）。Figma design-system 642:10766。
   * フィードの上に常設するが、開いたままだと縦 400px 以上を占めてフィードが押し下がる。
   * 押すと `.let-comp` に開く。
   */
  .let-comp-closed {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 25, 81, 0.18);
    /* 開いた枠（`.let-comp`）と同じ `--r-10`。開閉で角丸が変わると別の部品に見える。 */
    border-radius: var(--r-10);
    background: var(--bg-default);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease;
  }
  .let-comp-closed > .avatar { flex: none; }
  .let-comp-closed > .lcc-ic { flex: none; width: 24px; height: 24px; color: var(--brand-navy); }
  /*
    中央は 2 段（2026-09-29、依頼）。上に**何をする枠かの名前**、下に促し文。
    促し文だけだと「入力欄に見えるが打てない」で止まるので、枠の役目を名指しする。
  */
  .let-comp-closed > .lcc-main {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
    text-align: left;
  }
  .let-comp-closed .lcc-lb {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px; font-weight: 700;
    color: var(--text-primary);
  }
  /* 促し文。入力欄そのものではないので placeholder と同じ tertiary にする
     （実際に入力できる欄と見分けが付かないと、押しても書けないと誤解される）。 */
  .let-comp-closed .lcc-ph {
    min-width: 0;
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px;
    color: var(--text-tertiary);
  }
  /* 主操作であることを見せる箱。**押し先は枠と同じ**なので、単独では反応しない
     （`pointer-events: none`）——枠の上を通れば枠の hover が効く。 */
  .let-comp-closed > .lcc-go { flex: none; pointer-events: none; }
  .let-comp-closed:hover > .lcc-go {
    background: var(--fill-brand-strong); border-color: var(--fill-brand-strong);
  }
  .let-comp-closed:hover { border-color: var(--brand-navy); }
  .let-comp-closed:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 1px; }

  /* 等幅の下線タブ。3 つを均等に割るので、どのタブも同じ重みで見える。 */
  .let-comp > .lcp-tabs { display: flex; min-width: 0; }
  .let-comp .lcp-tab {
    flex: 1; min-width: 0;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 8px 12px;
    border: 0; border-bottom: 1px solid var(--border-strong);
    background: none;
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
  }
  .let-comp .lcp-tab .ic { width: 16px; height: 16px; flex: none; }
  /* 件数は丸を付けない（2026-09-29）。丸が付くのは「相手が待っているもの」だけ。
     選択中のタブでは navy を継ぐ（`.is-on` の色をそのまま使う）。 */
  .let-comp .lcp-tab__n { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
  .let-comp .lcp-tab.is-on .lcp-tab__n { color: inherit; }
  .let-comp .lcp-tab:hover { color: var(--text-primary); }
  .let-comp .lcp-tab.is-on {
    border-bottom: 2px solid var(--brand-navy);
    color: var(--brand-navy);
  }
  /*
    投稿の見出し（任意）。**枠を持たない 1 行**——箱にすると、任意のはずの欄が
    「埋めるもの」に見える（2026-09-29）。太さは出来上がり（`.pc-title` の 600）に
    合わせて、書いている時点で見出しだと分かるようにする。
  */
  .let-comp .lcp-title {
    display: block; width: 100%;
    /* 左右は**本文のエディタと同じ 28px**。揃えないと、見出しだけ 1 段外へ出て見える。 */
    padding: 4px 28px 8px; border: 0; background: none;
    font-family: var(--ff-sans);
    font-size: 16px; line-height: 24px; font-weight: 600;
    color: var(--text-primary);
  }
  .let-comp .lcp-title::placeholder { font-weight: 400; color: var(--text-tertiary); }
  .let-comp .lcp-title:focus { outline: none; }
  .let-comp .lcp-title:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; border-radius: 4px; }
  .let-comp > .lcp-body {
    display: flex; flex-direction: column; gap: 12px;
    padding: 0 12px;
    min-width: 0;
  }

  /* 宛先行。左に自分のアバターと ✈、右に選んだ人のチップ。 */
  .let-comp .lcp-to {
    display: flex; align-items: flex-start; gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-default);
    min-width: 0;
  }
  .let-comp .lcp-to > .avatar { flex: none; }
  .let-comp .lcp-to-ic { flex: none; color: var(--brand-navy); width: 24px; height: 24px; margin-top: 4px; }
  /* チップの並び。**button にしない** — 中に「×」の button が入るので入れ子になる。
     追加の当たりは末尾の「＋」（チップがあるとき）か、空のときのプレースホルダ自体。 */
  .let-comp .lcp-chips {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    flex: 1; min-width: 0;
    min-height: 32px;
    /*
      **3 段までで、その先はスクロール**（2026-09-25、依頼）。宛先が 10 人を超えると
      チップが 4 段・5 段と伸びて、書く枠が下へ押し出されていた（本文が画面から消える）。
      32px（チップ）× 3 ＋ 8px（間）× 2 ＝ 112px。
    */
    max-height: 112px;
    overflow-y: auto;
    /* 切れた段があることが分かるよう、上下の切り口に余白を持たせる。 */
    scrollbar-gutter: stable;
  }
  /* 空のときは「誰に贈るか」を促す一文。これ自体が当たりになる。 */
  .let-comp .lcp-ph {
    padding: 0; border: 0; background: none;
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
  }
  .let-comp .lcp-ph:hover { color: var(--text-brand); text-decoration: underline; }

  /* 選んだ人のチップ（アバター + 氏名 + ×）。`Tag` は 20px アバターなので別部品。 */
  .sel-user {
    display: inline-flex; align-items: center; gap: 8px;
    padding-right: 8px;
    border-radius: 999px;
    background: var(--brand-navy-50);
    min-width: 0;
  }
  .sel-user > .avatar { flex: none; border: 2px solid var(--bg-default); }
  .sel-user > .su-name {
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    max-width: 120px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .sel-user > .su-x {
    flex: none;
    width: 16px; height: 16px;
    display: grid; place-items: center;
    padding: 0; border: 0; border-radius: 999px;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
  }
  .sel-user > .su-x:hover { background: var(--brand-navy-100); color: var(--text-brand); }
  .sel-user > .su-x .ic { width: 10px; height: 10px; }

  /* 入力 + バッジ + ポイント。 */
  .let-comp .lcp-main { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
  /* 文字数カウンタを枠の中（右下）に入れるため、枠を自分で持って textarea の枠は消す。 */
  .let-comp .lcp-box {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 8px;
    min-height: 124px;
    padding: 12px 12px 8px;
    border: 1px solid rgba(0, 25, 81, 0.08);
    border-radius: var(--r-10, 10px);
    background: var(--bg-default);
    transition: border-color .12s ease, box-shadow .12s ease;
  }
  .let-comp .lcp-box:focus-within { border-color: var(--brand-navy); box-shadow: var(--shadow-focus); }
  .let-comp .lcp-box > textarea {
    /*
      **基準は中身の高さ**（`flex-basis: auto`。2026-09-25）。`flex: 1`（basis 0）だと、
      高さを入れても flex が枠いっぱいに伸ばしてしまい、**書いても伸びない**（実測で
      20 行入れても 62px のままだった）。auto にすると、画面側が入れた高さから始まり、
      枠の最低の高さ（124px）までは伸びて埋める。
    */
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    padding: 0; border: 0;
    background: none;
    resize: none;
    font-family: var(--ff-sans);
    font-size: 16px; line-height: 24px;
    color: var(--text-primary);
  }
  .let-comp .lcp-box > textarea:focus { outline: none; }
  .let-comp .lcp-box > textarea::placeholder { color: var(--text-placeholder, var(--text-tertiary)); }
  /* 入力欄の下の行（文に手を入れる道具 ＋ 字数）。字数は右端に寄せる。 */
  .let-comp .lcp-boxfoot { display: flex; align-items: center; gap: 8px; }
  .let-comp .lcp-boxfoot > .lcp-count { margin-left: auto; }
  .let-comp .lcp-count {
    align-self: flex-end;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
  }
  .let-comp .lcp-side { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: none; }

  /* バッジ枠。未選択は破線の円で「ここに何か入る」ことを示す。 */
  .badge-slot {
    width: 80px; height: 80px;
    border-radius: 999px;
    display: grid; place-items: center;
    padding: 0; border: 0;
    background: none;
    cursor: pointer;
    overflow: hidden;
  }
  .badge-slot.is-empty {
    border: 2px dashed var(--border-strong);
    font-family: var(--ff-sans);
    font-size: 11px; line-height: 15px; font-weight: 700;
    color: var(--text-tertiary);
    text-align: center;
    /* 文言（`ds.badgeSelect`）が「バッジを\n選択する」と改行位置を持っているので、
       それを活かす。潰すと 80px の円の中で語の途中で折り返る。 */
    white-space: pre-line;
  }
  .badge-slot.is-empty:hover { border-color: var(--brand-navy); color: var(--text-brand); }
  .badge-slot > img { width: 100%; height: 100%; object-fit: contain; display: block; }
  .badge-slot:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }

  /* 気持ちチップ。入力欄の直下に置き、押すと AI が本文とバッジを一度に決める。
     白紙から書き始めるのが一番のハードルなので、「何を伝えたいか」だけ選ばせて
     文章とバッジの選定を肩代わりする。選んだチップは押したあとも残す（どの気持ちで
     生成したかが分かるように・押し直せば別の気持ちで作り直せる）。 */
  .feel-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
  .feel-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    background: var(--bg-default);
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease;
  }
  .feel-chip > .fc-emoji { font-size: 15px; line-height: 1; }
  .feel-chip:hover { background: var(--brand-navy-50); border-color: var(--brand-navy-100); }
  .feel-chip.is-on { background: var(--brand-navy-50); border-color: var(--border-selected); color: var(--text-brand); box-shadow: inset 0 0 0 1px var(--border-selected); }   /* DS-19 */
  .feel-chip:disabled { opacity: .5; cursor: not-allowed; }
  .feel-chip:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 1px; }

  /* footer（AI / 添付 / 匿名 と 保存・予約・贈る）。 */
  .let-comp .lcp-foot {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-default);
    min-width: 0;
    /*
      **長い本文でも操作を見失わせない**（2026-09-25）。入力欄は中身に合わせて伸びるので、
      枠が画面より高くなると「投稿する」が画面の外へ出る。足もとを枠の下端に貼り付けて、
      書きながらいつでも出せるようにする。地を敷くのは、下の本文が透けないようにするため。
    */
    position: sticky; bottom: 0;
    background: var(--bg-default);
  }
  .let-comp .lcp-foot-l { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; min-width: 0; }
  .let-comp .lcp-foot-r { display: flex; align-items: center; gap: 4px; flex: none; }
  .let-comp .lcp-tray { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

  /* 下書き / 送信予約タブの 1 行。 */
  .let-comp .lcp-list { display: flex; flex-direction: column; }
  .lcp-item {
    display: flex; align-items: flex-start; gap: 12px;
    width: 100%;
    padding: 12px 0;
    border: 0; border-bottom: 1px solid var(--border-subtle);
    background: none;
    text-align: left;
    cursor: pointer;
    min-width: 0;
  }
  .lcp-item:last-child { border-bottom: 0; }
  /*
    レールから出す板（`.act-ov`）に置いた下書き・送信予約の一覧。**行の左右の余白は
    置かれた側が持つ**——作成枠では `.lcp-body` の padding が受け持っていて、行自身は
    上下しか持っていない。板では敷きが無いので、行が端に貼り付いていた（2026-09-26、指摘）。
    左右はアクティビティの行（`.act-item` の 16px）と揃える。
  */
  .act-ov .lcp-list { display: flex; flex-direction: column; }
  .act-ov .lcp-item { padding-inline: 16px; }
  .lcp-item:hover { background: var(--bg-subtle); }
  /* 送信予約の日時。未来の事象なので magenta（DS のカラー運用）。 */
  .lcp-item > .lcp-when {
    flex: none;
    width: 104px;
    display: flex; flex-direction: column; align-items: center;
    padding-right: 12px;
    border-right: 1px solid var(--border-default);
    font-family: var(--ff-sans);
  }
  .lcp-item .lcp-when-d { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--magenta-500); letter-spacing: .04em; }
  .lcp-item .lcp-when-t { font-size: 15px; line-height: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: .04em; }
  .lcp-item > .lcp-item-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
  /* 宛先の行（名前 ＋ 名前の右に置くもの）。名前だけが縮んで、札は縮まない。 */
  .lcp-item .lcp-item-torow { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .lcp-item .lcp-item-torow > .tag { flex: none; }
  .lcp-item .lcp-item-to { font-family: var(--ff-sans); font-size: 14px; line-height: 20px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lcp-item .lcp-item-body { font-family: var(--ff-sans); font-size: 13px; line-height: 20px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lcp-item .lcp-item-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
  .lcp-item .lcp-item-at { font-family: var(--ff-sans); font-size: 12px; line-height: 16px; color: var(--text-tertiary); }

  /* ---------- BadgePicker ----------
     レターに添えるバッジ（絵柄 + 名前）を 1 つ選ぶ。**単一選択**なので `PhotoGrid` の
     チェックボックス（複数選択）は使わず、選択はリングで示す。
     絵柄が主役なので名前は下に小さく添えるだけにする。 */
  .badge-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px;
  }
  .badge-opt {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 4px;
    border: 1px solid transparent;
    border-radius: var(--r-8);
    background: none;
    cursor: pointer;
    min-width: 0;
    transition: background-color .12s ease, border-color .12s ease;
  }
  .badge-opt:hover { background: var(--bg-subtle); }
  .badge-opt > img { width: 56px; height: 56px; object-fit: contain; display: block; }
  .badge-opt > .bo-name {
    max-width: 100%;
    font-family: var(--ff-sans);
    font-size: 11px; line-height: 16px;
    color: var(--text-tertiary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .badge-opt.is-on {
    background: var(--brand-navy-50);
    border-color: var(--brand-navy);
  }
  .badge-opt.is-on > .bo-name { color: var(--text-brand); font-weight: 600; }
  .badge-opt:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 1px; }

  /* ---------- LetterCard ----------
     レターフィードの 1 枚。Figma design-system 1392:68972（LetterCard2）。

     上から 送信者 → 宛先 → バリューバッジ / PICK → 本文 + 添付 → 拍手した人 + 反応 →
     拍手ボタン。「誰が誰に・どのバリューで・何ポイント」が本文を読む前に分かる順序にしている。

     下書き / 予約一覧の `.letter-row` とは別物（あちらは本文 1 行の一覧行）。流用しない。 */
  .letter-card {
    display: flex; flex-direction: column;
    padding-bottom: 12px;
    border-radius: var(--r-16);
    background: var(--bg-default);
    box-shadow: 0 16px 40px rgba(0, 25, 81, .13);
    min-width: 0;
  }
  /* PICK されたレター（模範的な行動として選出）。フィードで埋もれないよう囲む。 */
  .letter-card.is-pick { box-shadow: 0 0 0 2px var(--magenta-500), 0 16px 40px rgba(0, 25, 81, .13); }

  .letter-card > .lc-head { display: flex; flex-direction: column; gap: 12px; padding: 8px; min-width: 0; }

  /* 送信者 ▶ 受信者 を 1 段に置く。上下 2 段に積むとヘッダーだけで 168px（本文より大きい）
     使うため。送信者・受信者ともに 2 行にして横へ並べる。 */
  .letter-card .lc-line { display: flex; align-items: center; gap: 12px; min-width: 0; }
  /* 方向を示す矢印。同じ 48px の顔が左右に並ぶので、どちらが送り主かは
     矢印とラベル（「から」「へ」）で担保する（縦線だった頃は上下の位置が担っていた）。 */
  .letter-card .lc-arrow { flex: none; width: 20px; height: 20px; color: var(--text-tertiary); }
  .letter-card.is-to-me .lc-arrow { color: var(--magenta-500); }

  /* 送信者。「〇〇さん から」＋「部署・時刻」の 2 行。 */
  /* 縮ませない（flex-shrink: 0）。宛先が伸びると送信者名が「佐藤 大…」まで潰されるが、
     送り主が誰かはレターの主役なので省略させない。代わりに幅の上限で暴走を止める。 */
  .letter-card .lc-sender {
    display: flex; align-items: center; gap: 8px;
    flex: 0 0 auto; max-width: 38%;
    min-height: 48px; min-width: 0;
  }
  .letter-card .lc-sender > .avatar { flex: none; }
  /* 「⋯」は宛先が伸び縮みしても右端に留める。 */
  .letter-card .lc-menu { flex: none; margin-left: auto; }
  .letter-card .lc-sender-main { display: flex; flex-direction: column; justify-content: center; flex: 0 1 auto; min-width: 0; }
  .letter-card .lc-sender-line {
    display: flex; align-items: center; gap: 2px;
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px;
    color: var(--text-primary);
    min-width: 0;
  }
  /* 氏名だけ medium。「から」「・」「時刻」は地の文なので regular / tertiary。 */
  .letter-card .lc-sender-name { font-weight: 500; letter-spacing: 0.08em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .letter-card .lc-sender-from { color: var(--text-primary); flex: none; }
  .letter-card .lc-sender-sep { color: var(--text-tertiary); flex: none; }
  /* 2 行目は「部署・時刻」。1 段にすると時刻を送信者名の隣に置く余地が無いので、
     同じ「送り主のメタ情報」としてここにまとめる。 */
  .letter-card .lc-sender-sub {
    display: flex; align-items: center; gap: 2px;
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-secondary);
    min-width: 0;
  }
  .letter-card .lc-sender-dept { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .letter-card .lc-sender-sub .ts { flex: none; color: inherit; }

  /* 宛先。顔（48px 固定）＋氏名の列挙。氏名は 2 行に折り返す — 1 行に収めようとすると
     3 名で 311px 必要になり、送信者と同じ段に入らない。 */
  .letter-card .lc-to { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
  /* 自分宛のレター。`.cmt-row.is-to-me` と同じ作法で「矢印・宛先名・アバターのリング」を
     magenta に切り替える。フィードを流し見ていても自分宛だけは拾えるようにする。 */
  /* 色を付けるのは氏名の部分だけ。助詞（「へ」）まで染めると、宛先の中で
     「誰か」と「地の文」の切れ目が読めなくなる（`.cmt-to.accent` と同じ扱い）。 */
  .letter-card.is-to-me .lc-to-em { color: var(--magenta-500); }
  /* 名前とポイントは隣に並べる。ポイントを 3 段目（バッジの行）へ移すと、バリューバッジの
     隣に並んで「このバッジが 25pt」と読めてしまう。ポイントは**人**に贈られるもの。 */
  .letter-card .lc-to-names {
    flex: 0 1 auto; min-width: 0;
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    /* 「他3名へ」を落とさないため clamp しない（人数は宛先の中で最も落とせない情報）。
       氏名は呼び出し側で 3 名までに絞ってあるので 2 行で収まる。 */
  }
  /* 折り返しは氏名の**あいだ**だけで起こす。既定の CJK 折り返しに任せると
     「松本 健太さ / ん」のように氏名の途中で切れて、別人の名前に見える。 */
  .letter-card .lc-to-name { white-space: nowrap; }
  /* 贈られたポイント。実際に動く数字なので navy の塗りで最も強く出す。 */
  .letter-card .lc-points {
    flex: none;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--brand-navy);
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px; font-weight: 500;
    color: var(--text-on-fill);
    white-space: nowrap;
  }

  /* バリューバッジ（絵柄 + そのバッジの文言）と PICK。 */
  .letter-card .lc-value-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 0 8px; min-width: 0; }
  .letter-card .lc-value {
    display: inline-flex; align-items: center; gap: 8px;
    max-width: 100%;
    padding: 4px;
    border-radius: 999px;
    background: var(--brand-navy-50);
    min-width: 0;
  }
  .letter-card .lc-value > .avatar { flex: none; box-shadow: 0 2px 8px rgba(0, 25, 81, .08); }
  .letter-card .lc-value-text {
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px; font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    padding-right: 8px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* PICK。Figma の rose は DS のトークンに無いので magenta（ブランドアクセント）に寄せる。 */
  .letter-card .lc-pick {
    flex: none;
    display: inline-flex; align-items: center;
    height: 32px;
    padding: 0 28px;
    border: 1px solid var(--magenta-500);
    border-radius: 999px;
    background: var(--magenta-50);
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px; font-weight: 500;
    color: var(--magenta-500);
    white-space: nowrap;
  }

  /* 本文。行間 1.75 の日本語本文。上下を境界線で閉じて「これがレターの中身」と分ける。 */
  .letter-card > .lc-body {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
    min-width: 0;
  }
  .letter-card .lc-text {
    width: 100%;
    font-family: var(--ff-sans);
    font-size: 16px; line-height: 1.75;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
  }
  .letter-card .lc-media { width: 100%; max-height: 450px; overflow: hidden; border-radius: var(--r-8); }

  /* 受け取った本人に「返す」ことを促す帯（`ReactionPicker`）。自分宛のレターにだけ出す。
     Figma 1020:80046 の amber（`--amber-500` の上罫 + `--amber-50` へのグラデ）。
     なお この DS の amber は他では「注意」に使っている
     （`.iconbox.is-warning` / `.tag--warning` / `.modal__illust.is-warning`）。 */
  .letter-card > .lc-react {
    display: flex; flex-direction: column; gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--amber-500);
    /* Figma の指定どおり縦（上→下）。stop は #FFFBEB → #FFF3CD で、
       後者は `--amber-50`（#FEF3C7）と実質同色なのでトークンを流用する。 */
    background: linear-gradient(180deg, var(--amber-25), var(--amber-50));
    min-width: 0;
  }

  /* 拍手した人と反応の数。 */
  .letter-card > .lc-claps {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 16px;
    min-width: 0;
  }
  .letter-card .lc-clappers { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .letter-card .lc-clappers-text {
    font-family: var(--ff-sans);
    font-size: 12px; line-height: 16px;
    color: var(--text-secondary);
  }
  .letter-card .lc-clappers-text > b { font-weight: 500; color: var(--text-brand); }
  .letter-card .lc-counters { display: flex; align-items: center; gap: 4px; flex: none; }

  /* 拍手ボタン。カード幅いっぱいの 1 つの操作にして、迷わせない。 */
  .letter-card > .lc-clap {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    padding: 8px 16px 0;
    border: 0; border-top: 1px solid var(--border-default);
    background: none;
    color: var(--text-brand);
    cursor: pointer;
  }
  /* あいのりレターを贈る。本文の末尾（`.lc-body` の中）に置く。
     `.lc-body` は align-items: center なので、`align-self` で左端に寄せる
     — 本文の読み終わりから素直に目が落ちる位置にする。 */
  .letter-card .lc-quote {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    background: var(--bg-default);
    font-family: var(--ff-sans);
    font-size: 13px; line-height: 18px; font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color .12s ease, color .12s ease;
  }
  .letter-card .lc-quote:hover { border-color: var(--brand-navy); color: var(--text-brand); }
  .letter-card .lc-quote:disabled { opacity: .45; cursor: not-allowed; }
  .letter-card .lc-quote:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 1px; }
  .letter-card .lc-quote > .ic { width: 16px; height: 16px; }

  /* 引用元の参照（`QuoteReplyBlock`）。本文の上に置き、誰のレターに乗ったのかを示す。 */
  .letter-card .lc-quoted { width: 100%; }
  .letter-card .lc-quoted > .qr-block { max-width: 100%; }
  .letter-card > .lc-clap:hover { background: var(--brand-navy-50); }
  .letter-card > .lc-clap:disabled { color: var(--text-disabled); cursor: not-allowed; background: none; }
  .letter-card .lc-clap-label {
    font-family: var(--ff-sans);
    /* 16px/600。20px/600 だと 文字サイズ×太さ = 12000 で**画面でいちばん強いインク**になり、
       ページ名（`.gh-page` 14px/700 = 9800）を上回っていた（41法則 #22。known-issues IMPL-13）。
       ボタンの目立ちは**カード幅いっぱいの面と 20px のアイコン**が担っているので、
       文字を落としても主要アクションであることは伝わる。 */
    font-size: 16px; line-height: 24px; font-weight: 600;
  }
  .letter-card .lc-clap-pt {
    font-family: var(--ff-sans);
    font-size: 16px; line-height: 24px; font-weight: 400;
  }
  .letter-card > .lc-clap .ic { width: 20px; height: 20px; }

  /* コメントは投稿の続きなので一段沈める（NoteCard と同じ扱い）。 */
  .letter-card > .lc-comments {
    margin-top: 12px;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    border-radius: 0 0 var(--r-16) var(--r-16);
  }

  /* ---------- ProfileHead ----------
     プロフィール（マイページ / 他人のプロフィール）のファーストビュー。
     カバー画像に「アバター + 所属 + 氏名 + バッジ + アクション」の行を重ねる。
     Figma: design-system 1197:42552。

     `CoverHead` とは別物。あちらは**編集フォーム冒頭**の 140px カバー + 96 アバターで、
     こちらは**閲覧のファーストビュー**（251px カバー + 150 アバター）。流用しない。 */
  .prof-head {
    background: var(--bg-default);
    border-radius: var(--r-16);
    padding-bottom: 24px;
    min-width: 0;
  }
  .prof-head > .ph-cover {
    height: 251px;
    border-radius: var(--r-16) var(--r-16) 0 0;
    background: var(--brand-navy-50) center / cover no-repeat;
  }
  /* 3 列（アバター / 本文 / アクション）を下端で揃える。アバターだけ負の margin で
     カバーに食い込ませるので、行の高さはアバターの「はみ出した分」だけになる。 */
  .prof-head > .ph-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 24px;
    align-items: end;
    padding: 0 24px;
    min-width: 0;
  }
  /* アバターだけ上端基準にする。行の高さ（＝本文の高さ）に引きずられず、
     カバーへの食い込みを必ず 43px に固定するため。本文・アクションは下端揃えのまま。 */
  /* アバターは**2 行に跨がる**（2 行目に自己紹介を落としたので、1 行目だけだと
     はみ出した 107px が 1 行目の高さになり、氏名と所属が 33px 下がる）。
     `1 / -1` は使わない——`grid-template-rows` を書いていないので **`-1` は明示グリッドの端**を
     指し、暗黙の 2 行目まで届かない（実測で跨げていなかった）。 */
  .prof-head .ph-av { position: relative; align-self: start; margin-top: -43px; grid-row: 1 / span 2; }
  /* 吹き出しはアバターの上・左にフロートさせる。流れに置くとアバターを押し下げて
     カバーへの食い込みが崩れるので、必ず絶対配置にする。
     `.note-bubble`（丸 2 つが下の顔を指すノート）も同じ場所に置けるようにしておく
     — レターのアバター hover で出るカードと同じ吹き出しをここでも使うため。 */
  .prof-head .ph-av > .thought,
  .prof-head .ph-av > .note-bubble {
    position: absolute;
    left: -12px;
    bottom: calc(100% - 14px);
    z-index: 2;
  }
  .prof-head .ph-av > .avatar { border: 6px solid var(--bg-default); }
  /* アイコンの変更。アバターの右下に重ねる（本人のときだけ出す）。 */
  .prof-head .ph-av-btn {
    position: absolute; right: 2px; bottom: 8px;
    width: 42px; height: 42px;
    border-radius: 999px;
    display: grid; place-items: center;
    background: var(--bg-subtle);
    border: 3px solid var(--bg-default);
    box-shadow: var(--shadow-1);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .12s ease;
  }
  .prof-head .ph-av-btn:hover { background: var(--brand-navy-100); }
  .prof-head .ph-av-btn .ic { width: 20px; height: 20px; }
  /* 本文はカバーの下端から少し離す。所属（1 行目）がカバーの境界に貼り付くと、
     カバーの一部なのか本文なのか読み取れなくなる。 */
  .prof-head .ph-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 14px; }
  /* 氏名は画面で一番大きい文字。ここが主役なので h1 相当のサイズを持たせる。
     所属との間は空けない（所属＋氏名で 1 つのかたまりに見せる。空けると所属が宙に浮く）。 */
  .prof-head .ph-name {
    font-family: var(--ff-sans);
    font-size: 32px; line-height: 40px; font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* フリガナは氏名と同じ行（`.ph-name` の中）。読み方の補助なので氏名に従属させる。 */
  .prof-head .ph-kana {
    font-family: var(--ff-sans);
    font-size: 16px; line-height: 24px; font-weight: 400;
    color: var(--text-secondary);
    margin-left: 12px;
  }
  /* 自己紹介。**本人の発言**なので吹き出し（`.bubble-msg`）で出す。
     必ず 2 行で打ち切る — ヘッダーが縦に伸びると右のアクション（レターを贈る等）が潰れるため。
     全文は本文側（プロフィール項目）に置く前提。 */
  /* 左端は所属・氏名・バッジと揃える。アバター側へ寄せると 1 行だけ縦のラインが折れるうえ、
     アバターは円なので吹き出しの高さでは輪郭が逃げていて、寄せても接続しては見えない。 */
  .prof-head .ph-intro { margin-top: 10px; }
  /* 幅は**面の右端まで**（2026-09-16、依頼）。62ch で止めていたぶんと、右のアクションの列の
     ぶんだけ手前で折り返していた。行長は 2 行の打ち切りが決める。 */
  .prof-head .ph-intro .bubble-msg { max-width: none; }
  /* 自己紹介とバッジの段。2 列目から最後まで跨いで、アクションの下も使う。 */
  .prof-head .ph-tail { grid-column: 2 / -1; min-width: 0; }
  /* 行数制限は吹き出しの中身に掛ける（吹き出しを overflow:hidden にするとしっぽが切れる）。 */
  .prof-head .ph-intro__text {
    display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; line-clamp: 2;
    overflow: hidden;
  }
  /* 称賛の要約バッジ（強み / 件数 / 前月比）。折り返して積む。 */
  .prof-head .ph-badges {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    margin-top: 10px;
  }
  /* アクションは行の上端に置く（本文は下端揃えのまま）。氏名・所属と同じ高さに並ぶので、
     本文がどれだけ伸びても位置が変わらず、目線が「誰か」を読んだ流れのまま届く。 */
  .prof-head .ph-actions {
    display: flex; align-items: center; gap: 12px;
    flex: none;
    align-self: start;
    padding-top: 14px;
  }
  /* カバーの幅が足りないと 3 列は成立しないので、アクションを下段へ落とす。 */
  @media (max-width: 900px) {
    .prof-head > .ph-row { grid-template-columns: auto minmax(0, 1fr); }
    .prof-head .ph-actions { grid-column: 1 / -1; padding: 16px 0 0; gap: 12px; }
    /* アクションが下段に落ちる幅では、アバターも 1 行目だけに戻す（跨ぐと下段まで伸びる）。 */
    .prof-head .ph-av { grid-row: auto; }
  }

  /* ---------- ThoughtBubble ----------
     「感じたことをシェア」のような、まだ言葉になっていない促し。しっぽ + 小さくなる丸 2 つで
     「心の中で思っている」ことを表す（`.tt` のツールチップとは別物 — あちらは hover の説明）。 */
  .thought { display: inline-flex; flex-direction: column; align-items: flex-start; }
  .thought > .th-box {
    padding: 8px;
    border-radius: var(--r-8);
    background: var(--bg-default);
    box-shadow: var(--shadow-1);
    font-family: var(--ff-sans);
    font-size: 14px; line-height: 20px;
    color: var(--text-tertiary);
    white-space: nowrap;
  }
  .thought > .th-tail {
    width: 14px; height: 14px;
    margin: -4px 0 0 20px;
    border-radius: 4px;
    background: var(--bg-default);
    transform: rotate(45deg);
  }
  .thought > .th-dot {
    border-radius: 999px;
    background: var(--bg-default);
    box-shadow: var(--shadow-1);
  }
  .thought > .th-dot.is-lg { width: 10px; height: 10px; margin: 4px 0 0 28px; }
  .thought > .th-dot.is-sm { width: 5px;  height: 5px;  margin: 3px 0 0 41px; }

  /* ============================================================
     MethodCard — アイコン付きの選択肢カード（縦積みリスト）
     「選んで次へ進む」分岐に使う（エクスポート方法 / 追加方法 / 種別選択など）。
       <div class="method-list">
         <button class="method-card">
           <span class="method-card__icon"><i data-lucide="users" class="ic"></i></span>
           <span class="method-card__main">
             <p class="method-card__title">タイトル</p>
             <p class="method-card__desc">説明文</p>
           </span>
           <span class="method-card__chev"><i data-lucide="chevron-right" class="ic"></i></span>
         </button>
       </div>
     ============================================================ */
  .method-list { display: flex; flex-direction: column; gap: 8px; }
  .method-card {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border-control);
    border-radius: var(--r-8);
    cursor: pointer;
    text-align: left;
    width: 100%;
    background: var(--bg-default);
    font: inherit;
    transition: border-color .12s ease, background .12s ease;
  }
  .method-card:hover {
    border-color: var(--brand-navy);
    background: var(--brand-navy-50);
  }
  .method-card__icon {
    width: 40px; height: 40px;
    border-radius: var(--r-8);
    background: var(--brand-navy-50);
    color: var(--brand-navy);
    display: grid; place-items: center;
    flex: none;
  }
  .method-card__icon .ic { width: 20px; height: 20px; }
  .method-card__main { flex: 1; min-width: 0; }
  .method-card__title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; }
  .method-card__desc { font-size: 12px; color: var(--text-secondary); margin: 0; line-height: 1.6; }
  .method-card__chev { color: var(--text-tertiary); flex: none; }
  .method-card__chev .ic { width: 16px; height: 16px; }

  /* ============================================================
     BannerThumb — rectangular banner preview chip with aspect-ratio variants.
     Designed to be embedded inside a SettingsRow (.sr-row) so the surrounding
     label / description / action buttons follow the standard pattern.
       <span class="banner-thumb is-pc">                  (or .is-sp)
         <img src="..." alt="">  (or <i data-lucide="image" class="ic">)
       </span>
     ============================================================ */
  .banner-thumb {
    width: 200px;
    background: var(--bg-subtle);
    border: 1px dashed var(--border-default);
    border-radius: var(--r-4);
    display: grid; place-items: center;
    color: var(--text-tertiary);
    flex: none;
    overflow: hidden;
  }
  .banner-thumb .ic { width: 24px; height: 24px; }
  .banner-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .banner-thumb.is-pc { aspect-ratio: 2560 / 840; }
  .banner-thumb.is-sp { aspect-ratio: 1440 / 720; width: 140px; }
  .banner-thumb.is-filled { border-style: solid; }

  /* ============================================================
     ColorPicker — swatch + hex display wrapping a native input
       <label class="color-picker">
         <span class="color-picker__swatch" style="background: #001951;"></span>
         <span class="color-picker__hex">#001951</span>
         <input type="color" value="#001951" class="color-picker__input">
       </label>
     ============================================================ */
  .color-picker {
    position: relative;
    display: inline-flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 10px 0 6px;
    background: var(--bg-default);
    border: 1px solid var(--border-default);
    border-radius: var(--r-4);
    cursor: pointer;
    user-select: none;
  }
  .color-picker:hover { border-color: var(--border-strong); }
  .color-picker__swatch {
    width: 24px; height: 24px;
    border-radius: var(--r-4);
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex: none;
  }
  .color-picker__hex {
    font-family: var(--ff-mono);
    font-size: 13px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  .color-picker__input {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
  }

  /* UsersList — モーダル内のユーザー一覧
     <ul class="users-list">
       <li>
         <span class="avatar s-32">…</span>
         <div class="users-list__main">
           <div class="users-list__name">氏名</div>
           <div class="users-list__dept">部署パス</div>
         </div>
         <span class="users-list__tail">補助情報 / 追加ボタン</span>
       </li>
     </ul>
  */
  .users-list {
    list-style: none; margin: 0; padding: 0;
    max-height: 480px;
    overflow-y: auto;
  }
  .users-list li {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-default);
  }
  .users-list li:last-child { border-bottom: 0; }
  .users-list li:hover { background: var(--int-hover); }
  .users-list__main { flex: 1; min-width: 0; }
  .users-list__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
  }
  .users-list__dept {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* PickerList — チェックボックス付きの選択リスト (モーダル内のメンバー選択など)
     <ul class="picker-list">
       <li class="is-selected">  ← .is-selected で背景色が変わる
         <label class="check"><input type="checkbox" checked><span class="box"></span></label>
         <span class="avatar s-40">…</span>
         <div class="picker-list__main">
           <div class="picker-list__name">氏名</div>
           <div class="picker-list__sub">部署 ＞ 子部署 ＞ 孫部署</div>
         </div>
       </li>
     </ul>

     - `<li>` 全体がクリック可能。 行クリック / チェックボックスクリックの両方で
       選択トグルさせる場合は JS で `.is-selected` と `input.checked` を同期する。
     - 行は丸角・ボーダーレス。 連続して並べた時は CSS gap で間隔を空ける運用。
     - テキスト順序は users-list 等と統一: 氏名 (上, 太字) → 補助情報 (下, tertiary)。
  */
  .picker-list {
    list-style: none;
    margin: 0; padding: 0;
    max-height: 480px;
    overflow-y: auto;
    border-top: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
  }
  .picker-list li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-default);
    cursor: pointer;
    transition: background 120ms ease;
  }
  .picker-list li:last-child { border-bottom: 0; }
  .picker-list li:hover { background: var(--int-hover); }
  .picker-list li.is-readonly:hover { background: transparent; }
  .picker-list li.is-selected { background: var(--brand-navy-50); }
  .picker-list li.is-selected:hover { background: var(--brand-navy-100); }
  .picker-list li > .check,
  .picker-list li > .radio,
  .picker-list li > .avatar { flex: none; }
  /* Single-select variant: swap .check → .radio (share input name="…"). Highlight/JS sync identical. */
  .picker-list__main { flex: 1; min-width: 0; }
  .picker-list__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
  }
  .picker-list__sub {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.4;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* =====================================================
     MemberPicker — モーダル内で大量メンバー (数百人) から選ぶ
     検索ファースト + スクロールリスト + 選択中サマリ + フッター確定。
     器は .modal.is-large（max-width 520 に絞る）。行は .picker-list を流用
     （複数=.check / 単一=.radio）。検索は .input-affix、選択チップは .tag .x。
     構造:
       <div class="modal__body memberpicker">
         <div class="input-affix memberpicker__search"> … 検索 … </div>
         <div class="memberpicker__bar"> 選択中 N件 + すべて解除 </div>   ← 複数選択のみ
         <div class="memberpicker__chips"> .tag .x を roll-up </div>      ← 複数選択のみ
         <ul class="picker-list"> … 行 … </ul>
       </div>
     ===================================================== */
  .memberpicker { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
  /* モーダル full-bleed：検索/ファセット/メタは左右 24px インセット、リスト(.picker-list)は横幅いっぱい。
     検索ボックスは枠線付きなので padding ではなく margin で外側に余白を取る。 */
  .memberpicker.is-flush { padding-top: 16px; }
  .memberpicker.is-flush > :not(.picker-list) { margin-left: 24px; margin-right: 24px; }
  .memberpicker__search { flex: none; }
  /* 絞り込みファセット（組織・役職など）。大規模で母集団を狭めるための任意行。 */
  .memberpicker__facets { flex: none; display: flex; gap: 8px; }
  .memberpicker__facets .sb-trigger { flex: 1; min-width: 0; }
  /* OrgTreeSelect: SelectBox ポップ内に組織ツリーを入れる単一選択ファセット */
  .sb-pop .org-tree { max-height: 280px; overflow-y: auto; padding: 4px; }
  .otsel-row { padding: 8px 10px; font-size: 13px; color: var(--text-secondary); cursor: pointer; border-radius: 6px; }
  .otsel-row:hover { background: var(--int-hover); }
  .otsel-all { border-bottom: 1px solid var(--border-subtle); border-radius: 0; margin-bottom: 4px; color: var(--text-primary); }
  /* メタ行（常に 1 行）: 左＝該当件数＋全員追加 / 右＝選択中サマリ＋表示/解除 */
  .memberpicker__meta { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .memberpicker__match { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-secondary); }
  .memberpicker__match strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
  .memberpicker__sel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
  .memberpicker__sel .memberpicker__label strong { color: var(--brand-navy); font-variant-numeric: tabular-nums; }
  /* 選択チップ。100 人選んでもモーダルを占拠しないよう、約 2 行で打ち切ってスクロール。
     これより多い選択でもリスト本体は常に見える状態を保つ（大規模前提）。 */
  .memberpicker__chips {
    flex: none; display: flex; flex-wrap: wrap; gap: 6px;
    max-height: 72px; overflow-y: auto; padding-right: 4px;
  }
  .memberpicker__chips:empty::before { content: '未選択'; font-size: 12px; color: var(--text-placeholder); }
  /* display:flex が [hidden] の UA 規則を上書きしてしまうので明示的に隠す（表示/非表示トグル用） */
  .memberpicker__chips[hidden] { display: none; }
  /* モーダル内ではリストだけをスクロールさせる（検索・サマリは固定） */
  .memberpicker .picker-list { flex: 1 1 auto; max-height: 360px; margin: 0; }
  /* ---------- 対象者の絞り込み行（TargetAudience の FacetRow） ----------
     「役職 ｜ チップ＋選択ボタン」の 1 行。ラベル列は固定幅で、AND ディバイダ（.tgt-and）が
     その幅に揃う。スマホ幅ではラベルを上に落として、チップ側に横幅を全部渡す。 */
  .tgt-facet { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; }
  .tgt-facet__label {
    flex: none; width: 100px; padding-top: 10px;
    font-size: 13px; white-space: nowrap; color: var(--text-secondary);
  }
  .tgt-facet.is-exclude {
    padding: 8px 10px; margin: 4px -10px 0;
    background: var(--bg-danger); border-radius: var(--r-4);
  }
  .tgt-facet.is-exclude .tgt-facet__label { font-weight: 600; color: var(--text-danger); }
  /* ラベル列（100px）＋ gap（12px）に揃える AND ディバイダ */
  .tgt-and { display: flex; align-items: center; gap: 8px; margin-left: 112px; padding: 2px 0; }
  @media (max-width: 560px) {
    .tgt-facet { flex-direction: column; gap: 4px; }
    .tgt-facet__label { width: auto; padding-top: 0; white-space: normal; }
    .tgt-and { margin-left: 0; }
  }

  /* 検索ヒット 0 件 */
  .memberpicker__empty { padding: 36px 16px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
  .memberpicker__empty .ic { width: 24px; height: 24px; color: var(--text-placeholder); display: inline-block; margin-bottom: 8px; }

  /* ProjectTable — フラットなプロジェクトチーム (野球部・写真部 等)
     .data-table を継承。 ProjectName セルは <a> リンクとして扱う。
  */
  .proj-table .proj-row__name {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-primary);
    font-weight: 500;
    text-decoration: none;
  }
  .proj-table .proj-row__name:hover {
    color: var(--brand-navy);
  }
  .proj-table .proj-row__name:hover .proj-row__name-label { text-decoration: underline; }
  .proj-table .proj-row[data-hidden="true"] { display: none; }

  /* RoleTable — カスタム役職一覧 (権限・役職ページ)
     .data-table を継承。 シンプルなフラット表 (アイコン/説明なし)。
  */
  .role-table .role-row__name-label {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .role-table .role-row[data-hidden="true"] { display: none; }

  /* ThreadTable — スレッド管理一覧 (スレッドページ)
     名前セルに avatar.s-40 chip (非公開時は av-badge.br に lock アイコン) + ラベル
  */
  .thread-table .thread-row__name {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--text-primary);
    font-weight: 600;
    min-width: 0;
  }
  .thread-table .thread-row__name-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* スレッド名がリンクの場合: 既定は親色を継承して下線なし、 hover で navy + 下線 */
  .thread-table a.thread-row__name-label {
    color: inherit;
    text-decoration: none;
  }
  .thread-table a.thread-row__name-label:hover {
    color: var(--brand-navy);
    text-decoration: underline;
  }
  .thread-table .thread-row[data-hidden="true"],
  .thread-table .thread-row[data-type-match="false"] { display: none; }

  /* 非公開バッジ (鍵) — 既存 av-badge をスレッド向けに調整 */
  .avatar .av-badge.is-lock {
    background: var(--fill-neutral);
    color: var(--text-on-fill);
  }
  .avatar .av-badge.is-lock .ic { width: 60%; height: 60%; }

  /* User-list 内の退出ボタン (スレッドメンバー用) */
  .users-list__leave {
    flex: none;
    margin-left: auto;
  }


/* =====================================================================
   Drill-in 管理シェル（dn-*）— 旧 assets/js/drillnav.js が runtime 注入していた
   CSS を DS に正本化。Next の (drill) レイアウトが参照。
   ===================================================================== */
.dn-layout  {
  display: flex;
  height: 100vh;
  min-width: var(--app-min-w);
  background: var(--bg-default);
}
.dn-right  {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dn-right > .gh  {
  flex: none;
  min-height: var(--gh-h);
  box-sizing: border-box;
}
.dn-right > .shell__main  {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--bg-page);   /* キャンバス地（drill シェル側も合わせる） */
  padding-right: var(--app-right-inset, 0px);   /* 起動ボタンのぶん（.shell__main と同じ） */
}
/* embed (chrome-less) shell — app/embed/layout.tsx. Same corner reservation as .shell__main: the
   whole page gives way to the Intercom launcher floating bottom-right (0 when nothing floats). */
.embed-main {
  padding-right: var(--app-right-inset, 0px);
}
.dn-nav  {
  width: 260px;   /* 確定値 260px（PC/recog-design-system.md 1）。2026-09-01 に統一した。 */
  flex: none;
  background: var(--bg-default);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  transition: width .22s cubic-bezier(.16,1,.3,1);
}
.dn-nav a  {
  text-decoration: none;
}
.dn-stage  {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
/* ===== アコーディオン版ナビ（既定）：セクションを下に展開・単一開 ===== */
.dn-acc-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}
.dn-acc .chev { transition: transform .18s ease; }
.dn-acc.is-open .chev { transform: rotate(90deg); }     /* ▶ → ▼ */
.dn-acc.is-open > .sm-item { color: var(--brand-navy); font-weight: 600; }
.dn-acc__body { display: flex; flex-direction: column; padding: 2px 0 8px 12px; }
.dn-view  {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: transform .24s cubic-bezier(.16,1,.3,1), translate .24s cubic-bezier(.16,1,.3,1), opacity .24s ease-out, filter .24s ease-out;
  opacity: 0;
  translate: 18px 0;
  filter: blur(2px);
  pointer-events: none;
}
.dn-nav .sm-item  {
  cursor: pointer;
}
.dn-view__scroll  {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}
.dn-view__scroll::-webkit-scrollbar  {
  width: 4px;
}
.dn-view__scroll::-webkit-scrollbar-track  {
  background: transparent;
}
.dn-view__scroll::-webkit-scrollbar-thumb  {
  background: var(--border-default);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: content-box;
}
.dn-view__scroll::-webkit-scrollbar-thumb:hover  {
  background: var(--gray-300);
  border: 1px solid transparent;
  background-clip: content-box;
}
.dn-view.is-active  {
  opacity: 1;
  translate: 0 0;
  filter: blur(0);
  pointer-events: auto;
}
.dn-view.is-left  {
  opacity: 0;
  translate: -18px 0;
  filter: blur(2px);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce)  {
  .dn-view  {
  transition: opacity .12s linear;
  translate: 0 0 !important;
  filter: none !important;
}
}
.dn-head  {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 0 14px;
  min-height: 60px;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background .15s ease;
}
.dn-head:hover  {
  background: none;
  text-decoration: none;   /* ロゴ帯は RECOG へのリンク（<a>）。管理タグに下線を出さない */
}
.dn-head__tail  {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  /* 縮めない。ここが縮むとタグの文字が切れる（実際に「管理」が途中で切れていた）。 */
  flex: none;
}
.dn-brand  {
  display: flex;
  align-items: center;
  /* 縮められるようにする。ナビ 240px に対し「ロゴ ＋ 管理タグ」が入りきらない言語があるため
     （タグ幅: 管理 46px / Admin 59.6px / Quản trị 68.1px）。タグ側は flex:none なので、
     あふれるぶんはロゴが受ける。 */
  min-width: 0;
}
.dn-brand__img  {
  /* ナビ 240px −（左右 padding 28 ＋ gap 10 ＋ タグ）が使える幅。日本語なら 156px 入るが、
     余裕を持たせて 150px。英語・ベトナム語はタグが長いぶん max-width で自動的に縮む。 */
  width: 150px;
  max-width: 100%;
  height: auto;
  display: block;
}
.dn-back  {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-default);
  border: 0;
  border-radius: var(--r-8);
  cursor: pointer;
  transition: background .15s ease;
}
.dn-back:hover  {
  background: var(--int-hover);
}
.dn-back__chev  {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}
.dn-back__label  {
  text-align: center;
}
.dn-search  {
  padding: 0 12px 6px;
}
.dn-sep  {
  height: 1px;
  background: var(--border-subtle);
  margin: 8px 10px;
}
.dn-cmd  {
  position: relative;
  transition: width .2s cubic-bezier(.16,1,.3,1), height .2s cubic-bezier(.16,1,.3,1), left .2s cubic-bezier(.16,1,.3,1), box-shadow .2s cubic-bezier(.16,1,.3,1), border-radius .2s cubic-bezier(.16,1,.3,1);
  transform-origin: top left;
}
.dn-cmd.is-open  {
  position: fixed;
  z-index: 1001;
  background: var(--bg-default);
  border: 0;
  outline: 1px solid var(--border-default);
  outline-offset: -1px;
  border-radius: 12px;
  box-shadow: var(--shadow-8);
  overflow: hidden;
}
.dn-cmd__field  {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-8);
  background: var(--bg-default);
  cursor: text;
  transition: height .2s cubic-bezier(.16,1,.3,1), box-shadow .15s;
}
.dn-cmd__field:focus-within  {
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px var(--brand-navy-50);
}
.dn-cmd.is-open .dn-cmd__field  {
  height: 46px;
  border: 1px solid var(--border-default);
  border-top-color: transparent;
  border-right-color: transparent;
  border-left-color: transparent;
  border-radius: 0;
  box-shadow: none !important;
}
.dn-cmd__scrim  {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}
.dn-cmd__scrim[hidden]  {
  display: none;
}
.dn-cmd__icon  {
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  flex: none;
}
.dn-cmd__icon svg  {
  width: 16px;
  height: 16px;
}
.dn-cmd__input  {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
}
.dn-cmd__input::placeholder  {
  color: var(--text-tertiary);
}
.dn-cmd__pop  {
  padding: 6px;
}
.dn-cmd__pop[hidden]  {
  display: none;
}
.dn-cmd__item  {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--r-8);
  cursor: pointer;
}
.dn-cmd__item.is-active { box-shadow: inset 3px 0 0 0 var(--border-selected); }   /* DS-19: hover と同じ面だったので、選択位置は印で分ける */
.dn-cmd__item:hover, .dn-cmd__item.is-active  {
  background: var(--int-hover);
}
.dn-cmd__item-ic  {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--r-6);
  background: var(--bg-subtle);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
}
.dn-cmd__item-ic svg  {
  width: 16px;
  height: 16px;
}
.dn-cmd__item-main  {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.dn-cmd__item-title  {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dn-cmd__item-sub  {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dn-cmd__empty  {
  padding: 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
}
.dn-layout.is-nav-collapsed .dn-nav  {
  width: 64px;
}
/* ドラッグで幅を変えている最中はアニメーションを切る。`.dn-nav` は開閉のために
   `transition: width .22s` を持っているので、そのままだと 1px 動かすたびに補間が入って
   ポインタに追従しない（開閉のアニメーションは残す）。 */
.dn-nav:has(> .rsz.is-resizing)  {
  transition: none;
}
/* 縮小時に隠すのは**グローバルナビの中だけ**。`.sm-item` / `.sm-label` は会社詳細や
   ユーザー詳細のサブナビ（.subpanel）でも使う共用クラスなので、`.dn-nav` で囲わないと
   グローバルメニューを畳んだだけで無関係なサブナビまでアイコンだけになってしまう。 */
.is-nav-collapsed .dn-nav .dn-search,
.is-nav-collapsed .dn-nav .dn-head__tail,
.is-nav-collapsed .dn-nav .dn-brand__img,
.is-nav-collapsed .dn-nav .gt,
.is-nav-collapsed .dn-nav .sm-label,
.is-nav-collapsed .dn-nav .sm-tail,
.is-nav-collapsed .dn-nav .dn-back__label  {
  display: none;
}
.is-nav-collapsed .dn-head  {
  justify-content: center;
  padding: 0;
}
/* 既定（展開時）はマークを隠し、ロングロゴのみ。縮小時はマークだけ中央に表示。 */
.dn-brand__mark  {
  display: none;
}
.is-nav-collapsed .dn-brand__mark  {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.is-nav-collapsed .dn-nav .sm-item  {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 12px 0;
}
.is-nav-collapsed .dn-back  {
  grid-template-columns: 1fr;
  justify-items: center;
}
.dn-right .gh-stats  {
  margin-left: 0;
}
.dn-right > .gh  {
  position: relative;
}
.dn-right .gh .crumb  {
  justify-self: start;
  min-width: 0;
  max-width: 100%;
}
.dn-navtoggle  {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--r-8);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s ease;
}
.dn-navtoggle:hover  {
  background: var(--int-hover);
  color: var(--text-primary);
}
.dn-navtoggle svg  {
  width: 20px;
  height: 20px;
}
.dn-tip  {
  position: fixed;
  z-index: 2000;
  background: var(--brand-navy);
  color: var(--bg-default);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  line-height: 1.4;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  box-shadow: var(--shadow-3);
}
.dn-tip.is-show  {
  opacity: 1;
}
.dn-tip::before  {
  content: '';
  position: absolute;
  left: -3px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--brand-navy);
  transform: translateY(-50%) rotate(45deg);
  border-radius: 1px;
}
.dn-backrecog  {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 8px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.dn-backrecog:hover  {
  background: var(--int-hover);
  color: var(--text-primary);
}
.dn-backrecog__ic  {
  display: grid;
  place-items: center;
  flex: none;
  transition: transform .15s cubic-bezier(.16,1,.3,1);
}
.dn-backrecog__ic svg  {
  width: 16px;
  height: 16px;
}
.dn-backrecog:hover .dn-backrecog__ic  {
  transform: translateX(-3px);
}
.is-nav-collapsed .dn-backrecog  {
  justify-content: center;
  padding: 11px 0;
}
.is-nav-collapsed .dn-backrecog__label  {
  display: none;
}
.dn-foot  {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
}
.dn-foot__logo  {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--bg-default);
  border: 1px solid var(--border-subtle);
}
.dn-foot__logo img  {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dn-foot__name  {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dn-foot__menu  {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--r-8);
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.dn-foot__menu:hover  {
  background: var(--int-hover);
  color: var(--text-primary);
}
.dn-foot__menu svg  {
  width: 18px;
  height: 18px;
}
.dn-foot .dn-foot__pop  {
  position: absolute;
  top: auto;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 4px);
  transform-origin: bottom left;
  opacity: 0;
  transform: translateY(6px) scale(.97);
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, transform .18s cubic-bezier(.16,1,.3,1), visibility 0s linear .18s;
}
.dn-foot .dn-foot__pop.is-open  {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .16s ease, transform .18s cubic-bezier(.16,1,.3,1);
}
.is-nav-collapsed .dn-foot__name, .is-nav-collapsed .dn-foot__menu  {
  display: none;
}
.is-nav-collapsed .dn-foot  {
  justify-content: center;
  padding: 12px 0;
}
/* 折りたたみ時：レール幅 64px の nav は overflow:hidden なので、絶対配置だとワークスペースメニュー（240px）が右側で見切れる。
   viewport 基準の fixed にして overflow クリップから逃がす（左下から上方向に展開）。 */
.is-nav-collapsed .dn-foot .dn-foot__pop  {
  position: fixed;
  left: 12px;
  right: auto;
  bottom: 64px;
}
.dn-ws-user  {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 8px;
}
.dn-ws-user__main  {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dn-ws-user__name  {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dn-ws-user__sub  {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dn-theme  {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}
.dn-theme .mn-ico  {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
}
.dn-theme .mn-ico svg  {
  width: 16px;
  height: 16px;
}
.dn-theme__label  {
  font-size: 13px;
  color: var(--text-primary);
}
.dn-theme__seg  {
  margin-left: auto;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: 999px;
}
.dn-theme__btn  {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.dn-theme__btn svg  {
  width: 15px;
  height: 15px;
}
.dn-theme__btn:hover  {
  color: var(--text-secondary);
}
.dn-theme__btn.is-active  {
  background: var(--bg-default);
  color: var(--text-primary);
  box-shadow: var(--shadow-1);
}
.mn-value  {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-tertiary);
}
.dn-msub-back  {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  margin: 0 0 2px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--r-8);
}
.dn-msub-back:hover  {
  background: var(--int-hover);
}
.dn-msub-back .ic  {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}


/* =========================================================
   印刷（PDF出力）— ブラウザの「PDFとして保存」向け。
   シェルのナビ/ヘッダーを隠し、本文だけを白背景でフル幅表示。
   .no-print を付けた要素（操作ボタン等）は印刷しない。
   ========================================================= */
@media print {
  .dn-nav, .gh, .sidepanel-overlay, .savebar, .no-print { display: none !important; }
  /* Release all height/overflow constraints so the full page content prints, not just the visible scroll area */
  html, body { height: auto !important; overflow: visible !important; }
  .shell { height: auto !important; overflow: visible !important; min-width: 0 !important; }
  .shell__body { display: block !important; }
  .shell__main, .dn-right > .shell__main { overflow: visible !important; height: auto !important; padding: 0 !important; }
  body { background: var(--bg-default) !important; }
  /* Keep cards/charts intact — no mid-card page breaks */
  .chartcard, .statcard, .aisummary, .fcard { break-inside: avoid; }
  /* Preserve background colours and chart colours in print */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

  /* ---------- CountBadge ----------
     件数を表す小さな navy ピル（フィルタ件数・選択数・未読数など）。 */
  /* `.count-badge` は `.badge.sm.badge--quiet` に統合した（2026-09-02）。
     `CountBadge` の呼び出し 26 箇所は触らず、部品の中で出すクラスだけ変えている。 */

  /* ---------- Segmented ----------
     少数の選択肢を横並びピルで切り替える単一選択（タブより軽い。絞り込み軸の選択などに）。 */
  /* 目には出さず読み上げにだけ残すテキスト。アイコンだけのボタン・選択肢に名前を付ける。
     `display:none` にすると読み上げからも消えるので、1px に潰して切り抜く。 */
  .sr-only {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden; white-space: nowrap;
    clip-path: inset(50%);
  }

  .segmented {
    display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px;
    background: var(--bg-subtle); border-radius: 8px; max-width: 100%;
  }
  .segmented__item {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border: 0; background: none; border-radius: 6px;
    font: inherit; font-size: 13px; color: var(--text-secondary); cursor: pointer;
    transition: background .12s ease, color .12s ease;
  }
  .segmented__item:hover { color: var(--text-primary); }
  .segmented__item.is-active {
    background: var(--bg-default); color: var(--text-primary);
    font-weight: 600; box-shadow: var(--shadow-1);
  }
  .segmented--sm .segmented__item { padding: 4px 10px; font-size: 12px; }
  /*
    **枠と中身の高さを合わせる**（`.segmented--tight`。2026-09-21、指摘）。

    既定は 3px の内側余白があるので、選択中の白いピルは器より 6px 低い（32px の器に 26px）。
    文字が並ぶ帯ではそれで読めるが、**アイコン 2 つだけの切り替え**を入力欄や SelectBox の
    隣に置くと、目が見比べるのは白い面どうし——ピルだけ低く見える（実測 26 / 32）。
    余白を落として、器の高さいっぱいにピルを敷く。角丸も器と揃える。
  */
  .segmented--tight { padding: 0; gap: 0; height: 40px; flex-wrap: nowrap; }
  .segmented--sm.segmented--tight { height: 32px; }
  .segmented--tight .segmented__item { border-radius: 8px; align-self: stretch; padding-block: 0; }
  /* 選択肢にアイコンを置けるようにする。DS の `svg.lucide` は幅も高さも 100% なので、
     サイズを当てないと帯の高さまで膨らむ（実際に 40px になった）。 */
  .segmented__item .ic { width: 16px; height: 16px; flex: none; }
  /* ラベルの器は inline-flex にする。素の inline のままだと中の svg が**文字のベースラインに
     乗り**、下に descender ぶんの隙間ができて帯だけ 3px 高くなる（実測 35px / 他は 32px）。 */
  /* `min-height` は**文字 1 行ぶん**。アイコンだけの選択肢（16px）が文字の選択肢より低くなり、
     帯ごと 2px 縮んで隣の道具と揃わなくなるのを防ぐ。 */
  .segmented__item > span:not(.segmented__count) {
    display: inline-flex; align-items: center; gap: 6px; min-height: 18px;
  }
  /* 選択中をブランド色で塗る帯（`.segmented--brand`）。
     既定は**白地＋影**で、地の `--bg-subtle` との差が小さい——並んだ選択肢の中で
     「いまどれか」を離れた場所から拾えない。書き始める前に必ず決めさせたい設定
     （ヘルプ記事の対象読者）のように、**素通りされると困る帯**にだけ使う。
     **既定にはしていない**——`Segmented` は21箇所にあり、絞り込みのファセットや
     図の表示切り替えのように「目に入りすぎないほうがいい」使い方も多い。
     全部を塗るなら `.segmented__item.is-active` そのものを差し替えればよい。 */
  .segmented--brand .segmented__item.is-active {
    background: var(--int-brand); color: var(--text-on-fill); box-shadow: none;
  }
  .segmented--brand .segmented__item.is-active .segmented__count { color: inherit; }
  .segmented__count { font-size: 11px; color: var(--text-tertiary); }

  /* テーブルセル内のリンク風ボタン（クリックでモーダル）。hover でのみ下線。 */
  /* 表のセル内リンク。<button> と <a> のどちらでも同じ見た目にする。
     **静止状態から下線を出し、hover とキーボードフォーカスで濃く太くする。**

     ## hover のときだけ下線、にはできない（2026-09-10 に測り直した）

     GitHub / Linear / Stripe の表は静止時に下線を出さない。あれが成立するのは
     **リンク色が本文と 3:1 以上ある**からで（GitHub `#0969da` vs `#1f2328` は 3.04）、
     RECOG の navy は `--text-primary` と **1.14:1** しかない。下線を外すと、静止状態で
     リンクだと分かる手がかりが `font-weight: 600` だけになる（known-issues DEC-01）。

     色を明るくして両立させることもできない。本文と 3:1 にするには相対輝度 0.165 以上が要るが、
     **行 hover の面（`--brand-navy-50` `#EEF0FB`）の上で 4.5:1 を保てるのは 0.157 まで**で、
     窓が閉じている。だから「下線を敷いたうえで密度を下げる」形にした——GOV.UK / USWDS が
     取っているのと同じ側の解。

     ## 色は `--text-brand`（`--brand-navy` ではない）

     ダークテーマの `--brand-navy` は `#4F6BE0` で、行 hover の面の上で **2.67:1** しか無く
     割れていた。`--text-brand` は文字用に調整してあるトークンで、同じ面で 5.15:1。
     ライトはどちらも `#001951` なので見た目は変わらない。 */
  .cell-link {
    background: none; border: 0; padding: 0; font: inherit;
    color: var(--text-brand); font-weight: 600; cursor: pointer; text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    /* 静止時は薄く敷く。表は 1 画面に何十行も並ぶので、実線で引くと縞に見える。 */
    text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
    transition: text-decoration-color 120ms ease;
  }
  /* `:focus-visible` も同じ扱いにする。キーボードで辿っている人に hover は起きない。 */
  .cell-link:hover,
  .cell-link:focus-visible {
    text-decoration-color: currentColor;
    text-decoration-thickness: 2px;
  }
  /* アイコンを伴うセルリンク（外部リンクの ↗ など）。**下線を出さない。**
     形の手がかりがアイコンで足りている（DEC-01 の選択肢3）ので、静止下線の理由が成立しない。
     inline-flex なので下線を引くとアイコンの下にも伸びる、という実務上の理由もある。
     **画面側で `style={{ textDecoration: 'none' }}` と書かない**——同じことを 9 箇所で
     書いていて、表によってリンクの見た目が違っていた。 */
  .cell-link--icon,
  .cell-link--icon:hover,
  .cell-link--icon:focus-visible { text-decoration: none; }

  /* 統合グレード権限マトリクス（settings-roles）：役職/権限 × 機能。段階＝非表示/閲覧のみ/作成・編集可 */
  .perm-mx { border: 1px solid var(--border-default); border-radius: 12px; overflow: hidden; background: var(--bg-default); }
  .perm-mx__scroll { overflow-x: auto; }
  .perm-mx table { border-collapse: separate; border-spacing: 0; width: 100%; }
  .perm-mx th, .perm-mx td { padding: 10px 14px; vertical-align: middle; }
  .perm-mx thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--bg-subtle); font-size: 12px; font-weight: 700; color: var(--text-secondary);
    border-bottom: 1px solid var(--border-default); white-space: nowrap; text-align: center;
  }
  .perm-mx__col.is-role { color: var(--text-tertiary); font-weight: 600; }
  .perm-mx__lock { display: block; margin-top: 2px; font-size: 10px; font-weight: 600; color: var(--text-tertiary); }
  /* 機能名列：左寄せ＋横スクロール時に固定 */
  .perm-mx__menu {
    position: sticky; left: 0; z-index: 2; text-align: left; white-space: nowrap;
    background: var(--bg-default); font-size: 14px; color: var(--text-primary);
    box-shadow: 1px 0 0 var(--border-subtle);
  }
  .perm-mx thead th.perm-mx__menu { z-index: 3; background: var(--bg-subtle); }
  .perm-mx__cell { text-align: center; }
  .perm-mx__grp td {
    position: sticky; left: 0;
    background: var(--bg-subtle); font-size: 11px; font-weight: 700; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.04em; padding: 7px 14px;
  }
  .perm-mx__item td { border-top: 1px solid var(--border-subtle); }
  .perm-mx__item:hover .perm-mx__menu { background: var(--bg-subtle); }
  .perm-mx__note {
    display: flex; align-items: flex-start; gap: 6px; margin: 10px 2px 0;
    font-size: 12px; color: var(--text-tertiary); line-height: 1.5;
  }
  .perm-mx__note .ic { flex: none; margin-top: 2px; }

  /* 段階バッジ */
  .stg {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
  }
  .stg .ic { flex: none; }
  .stg--hidden { color: var(--text-tertiary); background: var(--bg-subtle); }
  .stg--view { color: var(--brand-navy); background: var(--brand-navy-50); }
  .stg--edit { color: var(--teal-600); background: var(--teal-50); }
  .stg.is-ghost { opacity: 0.55; }
  .stg.is-locked { opacity: 0.85; }

  /* 凡例 */
  .perm-mx__legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 2px 12px; }
  .perm-mx__legend .stg { cursor: default; }

  /* 編集モードのセル（SelectBox＋継承タグ/戻す） */
  .perm-mx__editcell { display: inline-flex; align-items: center; gap: 6px; min-width: 132px; }
  .perm-mx__editcell .sb-trigger { min-width: 108px; }
  .perm-mx__editcell .sb-trigger.is-inherited { color: var(--text-tertiary); font-style: italic; }
  .perm-mx__inh { font-size: 11px; font-weight: 600; color: var(--text-tertiary); }

  /* 機能アクセス一覧（機能 × 段階、セル＝誰が）：settings-feature-access */
  .fa-table { min-width: 720px; }
  .fa-table th, .fa-table td { padding: 12px 14px; vertical-align: middle; }
  .fa-table thead th { text-align: left; }
  .fa-actors { display: flex; flex-wrap: wrap; gap: 6px; }
  .fa-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px;
    background: var(--bg-subtle); font-size: 12px; color: var(--text-secondary); white-space: nowrap;
  }
  .fa-chip.is-member { background: var(--brand-navy-50); color: var(--brand-navy); }
  .fa-chip.is-member .ic { flex: none; }
  .fa-chip.fa-more { color: var(--text-tertiary); }
  .fa-empty { color: var(--text-tertiary); }
  .fa-featlink {
    background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
    color: var(--text-primary); cursor: pointer; text-align: left;
  }
  .fa-featlink:hover { color: var(--brand-navy); text-decoration: underline; text-underline-offset: 2px; }

  /* バッジテンプレート選択（settings-value）：均等セル＋hover */
  .badge-tpl-btn {
    border: 1px solid transparent; background: transparent; cursor: pointer;
    padding: 10px; border-radius: 10px;
    display: grid; place-items: center;
    transition: background .12s ease, border-color .12s ease, transform .12s ease;
  }
  .badge-tpl-btn:hover { background: var(--bg-subtle); border-color: var(--border-default); }
  .badge-tpl-btn:hover .avatar { transform: scale(1.06); }
  .badge-tpl-btn:active { transform: scale(0.97); }
  .badge-tpl-btn:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }

  /* 変更された設定行の淡いハイライト（会社プロフィール等の変更追跡） */
  .sr-row.is-changed { background: var(--brand-navy-50); }

/* =============================================================================
   GlassShell（`.gs`）— 製品側のシェル

   `/settings/letters2` で試していた帯なしのシェル（`.fs2-*`）を、確定として DS へ移した
   （2026-09-21）。**ヘッダーの帯を置かず、季節背景を画面の上端まで出す**。

   これに伴い `PC/recog-design-system.md` の確定値を 2 つ書き換えている。
     - ヘッダー 52px → **76px**（`--gs-bar-h`）
     - SideNav 68px・不透明 → **80px・88% のガラス**（`--gs-rail-w`）

   §2-2 は「常時表示のナビに、季節背景でコントラストが変動する要素を置かない」を理由に
   不透明を定めていた。**88% では変動が小さく、実測で全域が基準を満たす**：背後が真っ黒
   （最悪）でも実効の面は #E0E0E0 で、ラベルの青 5.07 / 本文 11.12。真っ白なら 6.69 / 14.68。
   変動幅 5.07〜6.69 はすべて 4.5:1 以上なので、この理由は 88% には当たらない。
   ============================================================================= */

/* =============================================================================
   帯なしのシェル（`/settings/letters2`）の皮

   `PC/sample/exec-0e73bda7-…png` の移植。**ヘッダーの帯を置かず、季節背景を画面の上端まで
   出す**。帯が持っていたものは 3 か所へ散らす。

   | もとの場所 | 移した先 |
   |---|---|
   | ロゴ | ヘッダーの帯の左端（`ロゴ ｜ ページ名`） |
   | 検索・通知 | ヘッダーの帯の右端（`.gs-bar`。`.gh-*` の見た目をそのまま使う） |
   | 会社・自分 | **細レールの下端**（`.gs-railid`） |
   | 贈れる / もらった / 給食支援（pt） | ヘッダーの帯の中央（`.gh-stats`） |

   **背景の上に置くものはすべて白い面に乗せる。** 季節背景は会社が任意の PNG に差し替えられる
   ので、素のアイコンを置くと 4.5:1 を保証できない（`PC/recog-design-system.md` 4。
   `.gn` の blur を外したのと同じ理由）。
   ============================================================================= */

.gs {
  /* 鳥の層（`.gs-sky`）を `z-index: -1` で地と中身のあいだに挟むため、ここで重なりの文脈を
     作る。作らないと -1 が `.gs` の地より後ろへ回り、鳥が写真に隠れる。 */
  isolation: isolate;
  /* 幅も kit に合わせる（`base.css` の `--rail-width` / `--pane-width`）。
     **確定値（SideNav 68 / SubPanel 260）とは違う**ので、この面の中だけで動かす。 */
  --gs-rail-w: 80px;
  /* メニューは **letters と同じ 260px**（2026-09-19、依頼）。kit の 232px だと
     「所属チームのレター」が 2 行に折れる。幅も中の作法も `(front)` に合わせる。 */
  --gs-pane-w: 240px;
  --gs-left: 340px;   /* 80 + 260 */
  /*
    操作の帯の高さ。kit の 76px から **64px** へ（2026-09-21、実測して決めた）。

    中でいちばん高いのは検索・通知の**当たり判定 40px**（これは縮められない）。次が pt の
    一群 37px、ロゴ 26px、ページ名 22px。64px なら 40px の上下に 12px ずつ残る。
      76px … 上下 18px（余りすぎ。フィードの縦を 12px 損する）
      64px … 上下 12px ← ここ
      56px … 上下  8px（pt の下が 9px しか残らず窮屈）
    旧確定値の 52px も 40＋6＋6 で数字上は入るが、pt が 37px あるので詰まる。
  */
  --gs-bar-h: 64px;
  /* ガラス（`PC/sample/recog-glass-ui/base.css` の 3 つ）。大きいほど白く・読みやすい。 */
  --glass-fill: rgb(255 255 255 / 82%);
  /*
    **細レールとメニューは同じ濃さ**（2026-09-19、実測して統一）。隣り合う 2 枚で 2% 違うと、
    区別ではなく継ぎ目に見える。分けていたのは細レールの 11px のラベルを心配したためだが、
    88% でラベルは 5.65（hover の青）／ 14.10（通常の濃紺）で通る。

    濃さの実測（地がいちばん濃く出る箇所）：
      80% … 見出し 5.72 / 本文 11.12 / ハッシュタグの青 3.66
      88% … 見出し 6.38 / 本文 12.40 / ハッシュタグの青 4.08
      92% … 見出し 6.78 / 本文 13.17 / ハッシュタグの青 4.33
    **ハッシュタグの青（`rgb(93,95,239)`）はどの濃さでも 4.5:1 に届かない**（純白の上でも
    4.83 でぎりぎり）。面の濃さでは解決しないので、色そのものを直すか不透明に戻すかの判断が要る。
    ここは見出し・本文が余裕を持って通る 88% に置く。ハッシュタグの青は下で色を直す。
  */
  --glass-fill-pane: rgb(255 255 255 / 88%);
  --glass-blur: 20px;
  --glass-line: rgb(0 25 81 / 14%);
  /*
    **地は「全体」に敷く。** ガラスは背後にあるものをぼかす仕組みなので、地をフィードだけに
    置くと、その外にある柱・パネル・帯の背後には何も無く、透けない
    （`recog-glass-ui/README.md`「背景をメイン領域だけに置くと、ナビ背後には画像がなく
    透けて見えません」）。`--gs-bg` の URL はシェルが JS で作る（CSS では basePath を
    解決できない）。
  */
  background: #cfe3f2 var(--gs-bg) center / cover fixed;

  /*
    **1280px より下げない**（2026-09-25、依頼）。PC 版 Web は 1280px 固定という確定値
    （`PC/recog-design-system.md`）なので、窓が狭いときは**縮めずに横へスクロール**させる。
    縮めると読む列（720px）まで一緒に痩せて、1 行の文字数が窓の幅で変わってしまう。
  */
  min-width: var(--gs-min-w);
  /* 帯と細レールの基準（下）。`fixed` を外すために要る。 */
  position: relative;
}
/*
  帯と細レールは**窓ではなく面に貼る**。`position: fixed` のままだと、横へスクロールした
  ときに帯と柱だけがその場に残り、流れてきた中身の上に被る。

  縦は `.front-body` が窓の高さいっぱいで**ページ自体が縦に送られない**ので、`absolute` にしても
  見え方は変わらない（貼り付く相手が窓から面に変わるだけ）。
*/
.gs > .gs-bar { position: absolute; }
.gs .front-body > .gn { position: absolute; height: 100%; }
/*
  高さは **`vh` ではなく `%`** で配る。`100vh` は横スクロールバーのぶんを数えないので、
  バーが出た瞬間に「縦にも 15px 送れる」ページになり、帯と柱がそのぶん上へずれる。
  フロントの面だけに効かせる（他のシェルは今までどおり）。
*/
html:has(> body > .gs), body:has(> .gs) { height: 100%; }
.gs { height: 100%; }
.gs .front-body { height: 100%; }
/*
  ダークでは**地の写真も夜のものに差し替える**（2026-09-21、依頼）。昼の写真のままだと、
  ガラスが暗い面になったのに背後だけ明るく残って、板が浮かずに穴のように見える。

  `ThemeProvider` は「システム」を自分で解決して `<html data-theme="dark">` を立てる（ライトの
  ときは属性ごと外す）ので、**この 1 本で足りる**——`prefers-color-scheme` を併記すると、
  OS が暗いのに手で「ライト」を選んだ人に夜の写真が出る。
*/
:root[data-theme="dark"] .gs {
  background-color: #10151f;
  background-image: var(--gs-bg-dark);

  /*
    **ガラスも一緒に暗くする。** ここを白のままにすると、柱・ロゴの板・帯だけが白く残り、
    すぐ下のパネル（DS のトークンで暗くなる）と食い違って、板が穴のように見えた。
    濃さは明るいときと同じ 82% / 88%（読みやすさの根拠は上の実測）。
    地の色は DS の `--gray-0`（#181B20）に合わせて、パネルの本体と継ぎ目が出ないようにする。
  */
  --glass-fill: rgb(24 27 32 / 82%);
  --glass-fill-pane: rgb(24 27 32 / 88%);
  /* 罫は**明るい側**へ。暗い面に暗い線を引いても見えない。 */
  --glass-line: rgb(255 255 255 / 12%);
}
/* `backdrop-filter` が無いときの代え（明るいときの #f5f8f6 と同じ役目）。 */
:root[data-theme="dark"] .gs .glass { background-color: #171b21; }

/* 帯が無いぶん、柱もパネルも画面の上端から始まる。 */
/*
  **中身の器そのものを、帯の下・細レールの右から始める**（2026-09-21、指摘）。

  以前は子ひとつずつに `padding-top` を掛け、メニューだけ `margin-top` で逃がしていた。
  描画は重ならないが、**箱としてはメニューが帯まで届いていた**（マージンぶん）。器の側で
  場所を決めれば、中の要素は何ひとつ帯の帯域に入らない。

  細レールだけは器の外へ出す（`position: fixed`）——帯の**左隣**で上端から通すものなので、
  帯の下に下げてはいけない。空けた列ぶんは器の `padding-left` で確保する。
*/
.gs .front-body {
  padding-top: var(--gs-bar-h);
  padding-left: var(--gs-rail-w);
}
.gs .front-body > .gn {
  top: 0; left: 0; z-index: 30;
}
/*
  **フィードだけは帯の下を通す**（2026-09-21）。器で 76px 下げたら、中身が帯の背後を通らなく
  なり、ガラスがぼかすものを失って**ただの薄い帯**になっていた（スクロールしてもヘッダーの
  画素が 4.63/255 しか動かない＝ほぼ静止した空だけ）。

  ガラスは「背後を通るものをぼかす」仕組みなので、**通るものが要る**。箱を帯の上端まで戻し、
  中身は padding で下げる。メニューは対象外——列として横に並ぶだけで、帯の下をくぐらない。
*/
.gs .front-body > :not(.gn):not(.subpanel) {
  margin-top: calc(-1 * var(--gs-bar-h));
  padding-top: var(--gs-bar-h);
}

/*
  **メニューの列に影は落とさない**（2026-09-21、相談の結果）。

  もとは「列が帯に被っている感じ」を出すための影だった。**いまは重なりが無い**——細レールの
  右にヘッダー、その下にメニューと中身が並ぶだけなので、落ち影は嘘になる。加えて
   - 実測で濃さは最大 **8.6/255**、12px 先で 0。2026-09-19 に「7.7/255 は見えない」と判断して
     濃くした経緯があるので、ほぼその水準まで戻っていた
   - メニューには **1px の罫**（`border-right: var(--glass-line)`）が既にある。線と影で同じ
     境目を 2 回引いていた
  境目は罫 1 本に任せる。
*/

/* ----------------------------------------------------------------- ガラス */
/*
  **不透明を先に置き、対応しているブラウザでだけ半透明にする**（`base.css` と同じ）。
  パネル全体に `opacity` は掛けない——文字まで薄くなる。
*/
.gs .glass { background-color: #f5f8f6; }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gs .glass {
    background-color: var(--glass-fill);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(110%);
    backdrop-filter: blur(var(--glass-blur)) saturate(110%);
  }
}
/* 柱とパネルもガラスにする。**この面の中だけ**——`.gn` を不透明にしたのは季節背景の上で
   コントラストが振れるためで、その判断は `(front)` 側では生きている（2026-09-01）。

   **`.gs-pane` と `.tl-nav` も同じ扱いにする**（2026-09-21、依頼）。トークとスレッドの
   一覧の列・横断ビューのレールは、レターの `.subpanel` と**同じ役どころ**（本文の左に立つ
   ナビ）なのに、白い不透明のままで 1 画面に 2 種類の素材が並んでいた。 */
.gs .gn,
.gs .subpanel,
.gs .tl-nav,
.gs .gs-pane {
  background: #f5f8f6;
  border-right: 1px solid var(--glass-line);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gs .gn,
  .gs .subpanel,
  .gs .tl-nav,
  .gs .gs-pane {
    background-color: var(--glass-fill-pane);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(110%);
    backdrop-filter: blur(var(--glass-blur)) saturate(110%);
  }
}
/*
  フォルダーの帯にも地を敷く（2026-09-23、指摘「背景白引いて」）。DS の `.talk-folders` は
  地を持たず、**白い画面の上に置く前提**だった。写真の上に出すと**タブの文字が空に直接乗る**
  ——`PC/CLAUDE.md`「季節背景の上に文字を置かない」に触れる。罫も下 1 本だけガラスに揃える。
*/
.gs .talk-folders { background: #f5f8f6; border-bottom-color: var(--glass-line); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gs .talk-folders {
    background-color: var(--glass-fill-pane);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(110%);
    backdrop-filter: blur(var(--glass-blur)) saturate(110%);
  }
}
/*
  **中身の面も抜く。** ガラスの器に不透明な行を敷き詰めると、結局その行の白しか見えない。
  行そのものは地を持たせず、**意味のある塗りだけ残す**——未読（navy 寄りの面）・選択中・hover。

  **`.tf-section` は抜かない**（2026-09-21 に抜いて戻した）。あれは**スクロールに残る見出し**
  なので、透けると下を流れていく行が帯の中に見えて重なる（`PC/sample/…17.49.56.png`）。
  地を持つこと自体が仕事。ただし**不透明のままにもしない**——行が透明・帯だけ不透明だと
  段差ができて、行の余白（72px の行に 48px のアバターなので下に 12px 余る）が
  **穴に見える**（`PC/sample/…17.52.29.png`「ラベルの上に空白が空いてます」）。
  帯もガラスの家系に入れて、**下を流せる濃さ（88%）は保つ**。
*/
/*
  行は**うっすら白を敷く**（2026-09-21、指摘「ラベルの上に空白が空いてます」→ 案 2 を選択）。

  完全に透かすと、73px の行に 48px のアバターなので**上下に 13px ずつ余る**ところだけ
  ガラス越しの草の緑が出て（実測 226,235,232）、隣の帯（青寄りのグレー 233,236,243）との
  あいだに色温度の違う筋ができる。45% 敷けば一覧が 1 枚の面としてつながり、
  それでも地の色は透ける（完全な白には戻さない）。
*/
.gs .gs-pane .tl-row:not(.is-active):not(.unread):not(.active):not(.selected):not(.multi-pick):not(.hover) {
  background: rgb(255 255 255 / 45%);
}
.gs .gs-pane .tl-row { border-bottom-color: var(--glass-line); }
/* hover はガラスの上でも読める濃さが要る（`--int-hover` は白い面の上を前提にした薄さ）。 */
.gs .gs-pane .tl-row:not(.is-active):hover { background: rgb(0 25 81 / 5%); }
/*
  帯は `--bg-section` のまま（DS の既定）。ガラスに寄せる 2 通りを試して**どちらも悪化した**：

   - 帯に `backdrop-filter` を足す → パネルのガラスの上でもう一度ぼかすので**白へ寄り**、
     実測 254,255,255。今度は帯のほうが「白い空白」に見える
   - 帯を透かす → スクロールで下を流れる行が帯の中に読めてしまう（1 つ前の指摘）

  **行を透かした以上、帯とのあいだに段差は必ず出る**（帯は下を隠すのが仕事なので不透明が要る）。
  段差を消したいなら行側に薄い白を敷く（＝ガラスをやめる）ことになるので、ここでは選ばない。
*/
.gs .gs-pane .tf-section { border-color: var(--glass-line); }
.gs .gs-pane .tf-section-tail { border-color: var(--glass-line); }

/*
  検索欄はガラスの上では**白＋枠**にする（2026-09-21、指摘）。DS の `.gh-search` は
  `--bg-subtle` のグレー 1 色で、**白い面の上でだけ**「へこんだ入力欄」に見える作り。
  ガラスの上だと地との差が小さく、枠も無いので入力欄だと読めない。
*/
.gs .gs-pane .gh-search {
  background: var(--bg-default);
  border: 1px solid var(--border-control);
}

/* -------------------------------------------------------------- ロゴ */
/*
  **並びは `細レール | ヘッダー`**（2026-09-21、依頼で確定）。

   - 細レールは**画面の上端から**通す（帯の左にあるので、帯に隠されない）
   - 帯は細レールのすぐ右（`--gs-rail-w`）から右端まで。中は `ロゴ | ページ名`
   - メニューも中身も**帯の下から**出る（重ならない）

  260px の板をメニューの上に重ねる形はやめた。板の幅と各画面の左の列が揃うのは
  `/settings/letters` と `/settings/mypage2-1` だけで、他では何も区切らない継ぎ目になる。
  全幅の帯（細レールの上も通す形）も試したが、**細レールが上端から通らなくなる**ので却下。
*/
.gs-logo { display: inline-flex; align-items: center; flex: none; }
/*
  **幅で指定する。高さで指定しない**（`PC/recog-design-system.md` 1-3）。SVG は余白を切って
  縦横比 9.3:1 にしてあるので**箱＝文字**とみなせる。`height: 24px` だと幅 232px に伸びていた。
  143px なら文字幅 141.7px・箱の高さ 16px で、76px の帯に上下 30px の余白を残して収まる。
*/
.gs-logo img { width: 143px; height: auto; }
/* ロゴとページ名のあいだの区切り（`.gh-sep` と同じ 1px）。並べただけだと、ページ名が
   ロゴの一部（製品名の続き）に読める。 */
.gs-bar .gs-sep { flex: none; width: 1px; height: 24px; background: var(--border-default); }

/* **`.gs` を前に付ける。** DS の `svg.lucide { width:100%; height:100% }` は詳細度 (0,1,1) で、
   クラス 1 つ (0,1,0) では負ける——負けるとアイコンが行の幅いっぱいに広がり、隣の名前が
   幅 0 に潰れる（実際に潰れた）。以下、この面の SVG はすべて同じ理由で前置きする。 */

/* --------------------------------------------------------- 操作の帯（ガラス） */
/* `recog-glass-ui/header.css` と同じ組み——中身の列（柱＋パネルの右）に貼り付く 1 枚の板で、
   検索と操作はその上に乗る。板がガラスなので、素のアイコンでも背景に直に置くことにならない。 */
.gs-bar {
  /*
    **ペインの列より下に敷く**（2026-09-19、指摘）。同じ z-index だと DOM で後のこちらが
    上に来て、ペインの影が帯に隠れる＝列が帯に被っているように見えない。
  */
  position: fixed; top: 0; left: var(--gs-rail-w); right: 0; height: var(--gs-bar-h);
  z-index: 20; display: flex; align-items: center; gap: 16px; padding: 0 24px;
  border-bottom: 1px solid var(--glass-line);
}
/* ページ名。板の上なので面は持たせない。検索欄を外したので、伸びるものは無い
   （題は左、右の一群は `margin-left: auto` で右端へ）。 */
.gs .gs-title {
  flex: none; margin: 0;
  font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--brand-navy);
  white-space: nowrap;
}
.gs-bar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
/*
  pt の 3 つは**右端の一群**にする（2026-09-28、依頼）。

  もとは読むカラムの中心に絶対配置していたが、**「真ん中」が画面ごとに違う**——
  メニュー（260px）がある画面と無い画面、読むカラムが 720px の画面と 880px の画面で
  中心がずれるので、どこに合わせても他の画面でずれる。左（ロゴ・題）と右（検索・通知）の
  重さも違うので、流れの中で中央に置いても中心には来ない。

  **右へ寄せれば画面をまたいでも位置が変わらない。**検索・通知の左隣、同じ一群として置く。
  自然幅のまま置く——縮めると数字が折れて読めなくなる。
*/
.gs .gs-bar .gh-stats {
  /* 空きを全部ここで吸って、右の一群（pt → 検索 → 通知）を右端へ送る。 */
  margin: 0 0 0 auto;
  flex: none;
}
/*
  空きは `.gh-stats` が吸うので、こちらの `margin-left: auto` は外す（2 か所で吸うと
  pt と検索のあいだに隙間ができる）。

  **境目は中より広く取る**（実測：pt どうしの間が 32px、pt と検索のあいだが 16px だと、
  中の間隔のほうが広くて 3 つの pt と 2 つのアイコンが 1 つの群に見える）。
*/
.gs .gs-bar > .gs-bar__right { margin-left: 24px; }
/*
  pt の 3 つは**押すものではない**（2026-09-21、指摘）。DS は `.gh-stat:hover` に面を付けるが、
  行き先が無いのでこの面では消す。押せないものに hover が付くと、押せるように見えて
  何も起きない。マークアップ側も `<a href="#">` から `<span>` にしてある。
*/
.gs .gs-bar .gh-stat { cursor: default; }
.gs .gs-bar .gh-stat:hover { background: transparent; }

/* 帯のぶんだけ中身を下げる。 */
/*
  帯のぶんだけ中身を下げる。**柱以外のすべての子**に掛ける（2026-09-21）——`<section>` だけに
  していたが、threads と talks は `<div>` で包んでいて効かず、中身が帯の下へ潜っていた。
  柱は帯の左（`--gs-rail-w` の内側）にあるので下げない。
*/
.gs .front-body > section {
  /* 地は `.gs` が敷くので、フィードは**透かす**。画面側（`Letters`）がインライン style で
     置いているため `!important` が要る。`feedBackgroundStyle()` 自体は触らない——
     あれは `/settings/letters` とプロフィールが共有していて、直すと 3 つまとめて変わる。 */
  background: transparent !important;
}

/* ==========================================================================
   細レール・メニュー・ヘッダーの**形**を kit に合わせる（2026-09-19、依頼）。
   出典は `PC/sample/recog-glass-ui` の `rail.css` / `pane.css` / `header.css`。

   DS の `.gn` / `.subpanel` を**この面の中だけ**上書きする。`(front)` 側は確定値のまま。
   ========================================================================== */

/* ---- 細レール（`rail.css`）------------------------------------------------ */
.gs .gn {
  /* **トークンごと差し替える。** `--gn-fg` は既定で白（濃紺の面に白文字）なので、
     ガラスにした時点でラベルが読めなくなる。個々のセレクタと詳細度を competing させず、
     色の出どころを 1 か所で置き換える。 */
  --gn-bg: transparent;
  --gn-fg: var(--brand-navy);
  --gn-chip: rgb(0 25 81 / 8%);
  --gn-divider: var(--glass-line);

  width: var(--gs-rail-w);
  padding: 16px 8px; gap: 20px;
  border-right: 1px solid var(--glass-line);
}
/* 柱のいちばん上。kit の `.rail-logo` と同じ枠（高さ 44・中央）。 */
.gs .gs-raillogo { display: grid; place-items: center; min-height: 44px; flex: none; }
.gs .gs-raillogo img { width: 32px; height: 32px; object-fit: contain; }
/* その下が「レターを書く」の紙飛行機。ロゴとは役割が違うので両方置く。 */
.gs .gn-brand { min-height: 44px; }

/*
  会社と自分の入口（2026-09-21。ヘッダー → 柱の下端 → ヘッダー → 柱の下端）。
  **全体で 1 つのボタン**にする——2 ターゲット（アイコン＝プロフィール／矢印＝メニュー）に
  割ると、どちらを押すとどうなるかを覚える必要が出る。
*/
/*
  会社と自分は**柱の下端**（2026-09-21、依頼）。`margin-top: auto` で足もとへ落とす。

  一度は 28px で組んで「小さくて目立たない」と言われた。**40px** にして、間も 16px 取る——
  柱の項目（アイコン 24px ＋ ラベル）の並びの中に置くので、同じ寸法だと「もう 1 つの項目」に
  見えてしまう。**種類が違うものは寸法で分ける。**
*/
.gs .gs-railid {
  margin-top: auto;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 16px 0 18px;
}
.gs .gs-railid__btn {
  display: grid; place-items: center;
  width: 52px; height: 52px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
/* 押せることは**面**で示す（柱の他の行と同じ作法）。下矢印は出さない。 */
.gs .gs-railid__btn:hover { background: rgb(0 25 81 / 8%); }
.gs .gs-railid__av {
  width: 40px; height: 40px; border-radius: 50%;
  background-size: cover; background-position: center;
  border: 1px solid var(--border-default);
}
/* 会社は**角丸の四角**、自分は丸。形で種類を分ける（メニューの中の 44px と同じ作り分け）。 */
.gs .gs-railid__av.is-org {
  border-radius: 10px; background: #fff;
  display: grid; place-items: center; overflow: hidden;
}
.gs .gs-railid__av.is-org img { width: 72%; height: 72%; object-fit: contain; }

/*
  ヘッダーから開くメニュー（2026-09-21）。ポップは body へポータルされるので、`.gs` の
  中では当たらない——**素のクラスで書く**。
*/
/*
  柱から開くメニュー。ポップは body へポータルされるので、`.gs` の中では当たらない
  ——**素のクラスで書く**。

  `.menu` にも min-width があり、**DS の CSS が後に読まれるので同じ強さでは負ける**
  （248 と書いたまま 200 のまま出ていた）。`.menu` を重ねて強さを上げる。

  矢印（吹き出しの尻尾）は**付けない**（2026-09-21、相談の結果）。柱の足もとに入口は 2 つ
  しかなく、メニューの 1 行目が自分で名乗っているので、指す相手は矢印が無くても分かる。
  RECOG の他のメニューに尻尾は無いので、ここだけ形が違うと別種のものに見える。
*/
.menu.gs-menu { min-width: 248px; }
/*
  ストアへの 1 行（残高 ＋ 交換）。`.mn-item` の行をそのまま使い、**中を 2 行に積む**だけ。
  アイコンは置かない——見本のとおりで、残高の字がアイコン列のぶん右へ寄ると、2 行の頭が
  揃わなくなる。
*/
.gs-menu .gs-store { align-items: center; padding-top: 8px; padding-bottom: 8px; }
.gs-menu .gs-store__body { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
.gs-menu .gs-store__body small { font-size: 12px; line-height: 1.4; color: var(--text-tertiary); }
/* メニューの 1 行目。**押す面積を広く取る**ことで、2 クリック目の負担を下げる。 */
.gs-idcard {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; color: inherit; text-decoration: none;
}
/* hover は**面だけ**。下線は引かない（2026-09-21、指摘。`PC/sample/…14.13.52.png`）——
   これは本文に埋まったリンクではなく、メニューの 1 行。他の行（`.mn-item`）と同じ作法にする。 */
.gs-idcard.is-link:hover { background: var(--bg-subtle); text-decoration: none; }
.gs-idcard__av {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  background-size: cover; background-position: center;
  border: 1px solid var(--border-default);
}
/* 会社は**角丸の四角**、自分は丸。形で種類を分ける（Slack・Discord と同じ理由）。 */
.gs-idcard__av.is-org {
  border-radius: 10px; background: var(--bg-default);
  display: grid; place-items: center; overflow: hidden;
}
.gs-idcard__av.is-org img { width: 72%; height: 72%; object-fit: contain; }
.gs-idcard__body { min-width: 0; display: grid; gap: 2px; }
.gs-idcard__body b {
  font-size: 14px; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gs-idcard__body small {
  font-size: 12px; color: var(--text-tertiary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gs .gn-list { display: flex; flex-direction: column; gap: 10px; }
/*
  行は**縦組み**（アイコンの下にラベル）。

  **面は行ではなくアイコンのチップに付く**（2026-09-19、指摘）。DS の既定がその作りで、
  行ごと塗ると選択中の行が 80px の柱いっぱいの色板になって重い。kit の `rail.link` は
  行を塗る形だが、こちらはアイコンのチップを持っているのでそちらを活かす。
*/
.gs .gn-item {
  min-height: 68px; height: auto; width: 100%;
  padding: 10px 2px; gap: 7px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 650; color: var(--brand-navy);
  background: transparent; border-radius: 0; box-shadow: none;
}
.gs .gn-item:hover,
.gs .gn-item.is-active { background: transparent; box-shadow: none; }
/*
  チップの色は**メインカラー**（2026-09-19、依頼）。
   - 選択中 … ベタ塗り＋白のアイコン。**メニューの選択中の行（濃紺＋白文字）と同じ強さ**に
     なるので、隣り合う 2 列で「選ばれている」の見え方が揃う
   - hover  … 同じ色の **8% の淡い面**（`--gn-chip`）。カーソルが横切るたびに濃紺が点くのは
     うるさいので、hover は色の系統だけ合わせて濃さは落とす

  DS は選択中に `background: var(--gn-fg); color: var(--gn-bg)` を当てる。この面では
  トークンを差し替えている（`--gn-bg: transparent`）ので、両方をここで明示する。
*/
.gs .gn-item.is-active .gn-ic { background: var(--brand-navy); color: #fff; }
.gs .gn-item .gn-ic svg { width: 24px; height: 24px; stroke-width: 1.8; }
.gs .gn-item .gn-label {
  font-size: 11px; font-weight: 650; line-height: 1.25;
  width: 100%; text-align: center; white-space: normal;
}
/* ラベルの青は**選択中と hover の両方**（2026-09-19、依頼）。
   チップだけが変わると「押せるのか」が読みにくいので、字も一緒に動かす。 */
.gs .gn-item.is-active .gn-label,
.gs .gn-item:hover .gn-label { color: #1959b5; }

/* kit は区切り線を引かない。 */
.gs .gn-divider { display: none; }

/*
  ハッシュタグの青を**一段濃く**する（2026-09-19、依頼）。DS の `--indigo-500`（#5D5FEF）は
  純白の上で 4.83 とほぼ限界の色で、ガラスに少しでも柄が乗ると割れる（88% で 4.08）。
  `--indigo-600`（#4B4DDB）なら 5.24 で通り、**この DS が選択中のタグに既に使っている色**
  なので、新しい色を足さずに済む。トークンごと差し替えないのは、`--indigo-500` を他でも
  使っているため（この行だけを狙う）。
*/
.gs .subpanel .sm-item.is-tag,
.gs .subpanel .sm-item.is-tag .sm-value { color: var(--indigo-600); }

/* ---- メニュー -------------------------------------------------------------
   **中身は letters のまま**（2026-09-19、依頼）。幅・余白・行の高さ・hover と選択中の色は
   DS の `.subpanel` / `.sm-item` に任せる——kit の 232px・16px・`#dbeaff` ＋左の縦棒に
   寄せていたが、文言が 2 行に折れるうえ、`(front)` と見た目が割れる。
   この面が変えるのは**ガラスと、上下の帯のぶんの余白**だけ。 */
.gs .subpanel {
  /*
    **幅はこの面のトークンで持つ**（2026-09-21、依頼で 260 → 240px を試す）。DS の
    `.subpanel` の 260px は確定値で、会社設定のシェルも使っている——そちらは動かさない。
  */
  width: var(--gs-pane-w);
  /* 境目は**罫 1 本だけ**。影は落とさない（理由は上の「メニューの列に影は落とさない」）。 */
  border: 0; border-right: 1px solid var(--glass-line);
  box-shadow: none;
}

/* ---- パネルの上下（`pane.css` の `.wordmark` / `.company` / `.profile`）---- */
/* ロゴの枠は**ヘッダーの帯と同じ高さ**にして中央に置く（隣の検索欄と目線を揃える）。 */
.gs-logo {
  max-width: 100%; min-height: var(--gs-bar-h);
  display: flex; align-items: center;
}
.gs-logo img { height: 26px; max-width: 100%; object-fit: contain; }

/* ---- ヘッダー（`header.css`）--------------------------------------------- */
/* 右の一群は `.gh-*` の見た目をそのまま使う。板の上なので面は持たせない。 */
.gs-bar { padding: 12px 24px; gap: 16px; }
.gs .gs-bar .gh-icon-btn { color: var(--brand-navy); }



/* ---- ダーク（柱と帯の中身）---------------------------------------------- */
/*
  地とガラスを暗くしたぶん、**その上に載る「淡い面」と「青い字」も反転させる**。
  濃紺の 8% を暗い面に敷いても見えず、`#1959b5` は暗い面の上で沈む。
*/
:root[data-theme="dark"] .gs .gn {
  --gn-chip: rgb(255 255 255 / 10%);
  /*
    アイコンは `--brand-navy`（ダークでは `#4F6BE0`）のままだと、背後が明るい画像のとき
    **2.60** で非テキストの 3:1 も割る（実効の面 rgb(52,54,59)）。`--text-brand`（`#8AA2FF`）
    なら 5.00 で通る。`PC/recog-design-system.md` 2-2 の表と同じ測り方。
  */
  --gn-fg: var(--text-brand);
}
:root[data-theme="dark"] .gs .gn-item.is-active .gn-label,
:root[data-theme="dark"] .gs .gn-item:hover .gn-label { color: var(--text-brand); }
:root[data-theme="dark"] .gs .gs-railid__btn:hover { background: rgb(255 255 255 / 10%); }
/* 会社のマークは白地の上に描かれた絵なので、器の白は残す（暗くすると絵が沈む）。 */
.gs .gs-logo__d { display: none; }
:root[data-theme="dark"] .gs .gs-logo__l { display: none; }
:root[data-theme="dark"] .gs .gs-logo__d { display: block; }

/*
  言語のサブビューは**本体と同じ左端**に揃える（2026-09-21、指摘）。戻る行の `‹` は 16px で
  `.mn-ico`（20px）より細く、そのままだと見出しの字だけ 4px 左にずれる。行き来のたびに
  字が横へ跳ぶのを止める。
*/
.gs-menu .dn-msub-back { gap: 10px; padding-left: 10px; }

/* ----------------------------------------------------------------- 空の鳥 */
/*
  地の上を鳥が横切る（2026-09-21、依頼。`PC/sample/birds-scene.html` の移植）。**CSS だけ**で
  動く——JS も動画も使わない。

  **いちばん後ろに敷く。** `.gs` に `isolation: isolate` で重なりの文脈を作り、鳥の層を
  `z-index: -1` に置くと、`.gs` の地（写真）より前・中身より後ろに入る。ガラスの板
  （柱・メニュー・帯）は `backdrop-filter` で**背後をぼかす**ので、鳥が板の裏へ回ると
  自然にぼけて通り抜ける。

  `--gs-ink` 系は**風景イラストに合わせた絵の色**で、UI のトークンとは別物。地の写真を
  差し替えるならここも合わせる。
*/
.gs-sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  --gs-ink: #1d4b60;
  --gs-ink-far: #4d7f95;
}
:root[data-theme="dark"] .gs-sky {
  /* 夜の写真の上では影絵になる。明るいままだと空に白い点が散る。 */
  --gs-ink: #0d1a22;
  --gs-ink-far: #162a35;
}
.gs-sky .gs-lane { position: absolute; left: 0; width: 100%; height: 0; top: var(--y); }
.gs-sky .gs-mover {
  position: absolute; left: 0; top: 0; width: 100%; height: 0;
  animation: gs-cross var(--d, 40s) linear var(--delay, 0s) infinite;
}
.gs-sky .gs-lane.is-rtl .gs-mover { animation-direction: reverse; }
.gs-sky .gs-bob {
  position: absolute; left: 0; top: 0;
  animation: gs-bob var(--bd, 5s) ease-in-out var(--delay, 0s) infinite alternate;
}
.gs-sky .gs-bird {
  display: block;
  width: calc(var(--s, 1) * 46px); height: auto;
  color: var(--c, var(--gs-ink));
  transform-origin: center;
}
.gs-sky .gs-lane.is-rtl .gs-bird { transform: scaleX(-1); }
.gs-sky .gs-bird path { fill: currentColor; }
/* 羽。`transform-box: view-box` が無いと、回転の原点が SVG の箱ではなく描画の箱になる。 */
.gs-sky .gs-w {
  transform-box: view-box; transform-origin: 20px 12px;
  animation: gs-flap var(--f, .5s) ease-in-out infinite;
}
.gs-sky .gs-w.is-r { animation-name: gs-flap-r; }
@keyframes gs-cross { from { transform: translateX(-14%); } to { transform: translateX(114%); } }
@keyframes gs-bob { from { transform: translateY(0); } to { transform: translateY(calc(var(--s, 1) * -18px)); } }
@keyframes gs-flap { 0%, 100% { transform: rotate(-26deg); } 50% { transform: rotate(28deg); } }
@keyframes gs-flap-r { 0%, 100% { transform: rotate(26deg); } 50% { transform: rotate(-28deg); } }
/* 動きを減らす設定の人には**止めて見せる**（消さない。空が急に空っぽになるより自然）。 */
@media (prefers-reduced-motion: reduce) {
  .gs-sky .gs-mover, .gs-sky .gs-bob, .gs-sky .gs-w { animation-play-state: paused; }
}

/* ------------------------------------------------------------------- うさぎ */
/*
  地を横切るうさぎ（2026-09-21、依頼。`PC/sample/birds-scene (1).html`）。鳥と違って
  **JS の状態機械**で動くので、CSS が持つのは器と姿勢の切り替えだけ。位置・つぶれ・耳の角度は
  毎フレーム JS が `style` に書く（state に載せると 60 回/秒 の再描画になる）。

  5 枚の SVG を差し替えて向きを作る。`display: none` で切るのは、**同時に 1 枚しか出さない**のが
  いちばん素直だから（重ねて透明度で切ると、輪郭が重なって濁る）。
*/
.gs-sky .gs-critter { position: absolute; left: 0; top: 0; width: 78px; will-change: transform; }
/* 影。跳ぶ高さに応じて JS が横幅と濃さを変える。無いと上下しているのか近づいているのか読めない。 */
.gs-sky .gs-bun-shade {
  position: absolute; left: 12%; bottom: 2px; width: 76%; height: 8px;
  border-radius: 50%; background: #1d4a14; opacity: .24;
}
/* つぶれ・回転の基点は**足もと**。中心にすると、跳ぶたびに地面へめり込む。 */
.gs-sky .gs-bun-hop, .gs-sky .gs-bun-turn { transform-origin: 50% 100%; }
.gs-sky .gs-bun { display: block; width: 100%; height: auto; }
.gs-sky .gs-bun.is-off { display: none; }
/* 見本は右向きに描いてあるので、左へ進むぶんを反転する。 */
.gs-sky .gs-bun.is-flip { transform: scaleX(-1); }
.gs-sky .gs-bun-ear { transform-box: view-box; }
.gs-sky .gs-bun-ear.is-side { transform-origin: 44px 21px; }
.gs-sky .gs-bun-ear.is-front { transform-origin: 32px 24px; }
.gs-sky .gs-bun-eyes {
  transform-box: fill-box; transform-origin: center;
  transition: transform .07s ease;
}
.gs-sky .gs-bun-eyes.is-blink { transform: scaleY(.12); }
/*
  夜は落とす。うさぎは生成りの白（#F9F5EA）で、暗い写真の上だと**そこだけ紙を貼ったように
  浮く**。塗りを 1 つずつ差し替えると絵が壊れるので、丸ごと暗くする。
*/
:root[data-theme="dark"] .gs-sky .gs-critter { filter: brightness(.55) saturate(.8); }

/* ------------------------------------------------------------- Walkthrough */
/*
  手順を 1 つずつ光らせて進むガイド（`Walkthrough`）。

  **穴は `box-shadow` で開ける。** 覆いに `clip-path` で穴を開けると縁が階段状になるうえ
  ブラウザ差が出る。対象と同じ大きさの箱に外向きの巨大な影を落とすほうが素直で、
  `pointer-events: none` にしておけば**対象はそのまま押せる**——押させて覚えてもらう仕掛けなので、
  ここが通らないと成立しない。
*/
/*
  **覆いは重なりの下、吹き出しは上。** 同じ層に置くと、案内の途中で開いたもの（バッジ選択の
  モーダル・ポイントの吹き出し・宛先の候補）が覆いに沈んで、暗いまま操作させることになる
  （2026-09-21、指摘）。DS の `.modal-overlay` は 1000。
    覆い  900 … モーダル（1000）やポップより**下**。開いたものは覆われず、そのまま明るい
    吹き出し 1300 … 何より**上**。モーダルが開いても案内の文が読めなくならない
*/
.wt-ring {
  position: fixed; z-index: 900; pointer-events: none;
  border-radius: var(--r-12, 12px);
  box-shadow: 0 0 0 9999px rgb(0 25 81 / 55%), 0 0 0 2px var(--brand-navy);
  transition: top .18s ease, left .18s ease, width .18s ease, height .18s ease;
}
.wt-pop {
  position: fixed; z-index: 1300; width: 340px;
  background: var(--bg-default); color: var(--text-primary);
  border-radius: var(--r-12, 12px);
  box-shadow: var(--shadow-8);
  padding: 16px;
  font-family: var(--ff-sans);
}
.wt-pop__count { margin: 0 0 6px; font-size: 11px; font-weight: 700; color: var(--text-tertiary); }
.wt-pop__title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.5; }
.wt-pop__body { margin: 6px 0 0; font-size: 13px; line-height: 1.7; color: var(--text-secondary); }
.wt-pop__foot { margin-top: 14px; display: flex; align-items: center; gap: 8px; }
.wt-pop__acts { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
/* 「やめる」は目立たせない——本筋は進むこと。 */
.wt-quit {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-family: var(--ff-sans); font-size: 12px; color: var(--text-tertiary);
}
.wt-quit:hover { color: var(--text-secondary); text-decoration: underline; }
/* 動きを減らす設定では、位置の移動を止める（暗転と吹き出しは残す）。 */
@media (prefers-reduced-motion: reduce) {
  .wt-ring { transition: none; }
}
