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

    /* Neutrals (from Tailwind slate-like tokens used in file) */
    --gray-0:   #FFFFFF;
    --gray-50:  #F3F4F6;
    --gray-100: #E5E7EB;
    --gray-200: #D1D5DB;
    --gray-300: #9CA3AF;
    --gray-900: #1F2937;

    /* Semantic colors */
    --red-500:    #DC2626;
    --red-50:     #FEE2E2;
    --amber-500:  #F59E0B;
    --amber-50:   #FEF3C7;
    --teal-500:   #0E9E8A;
    --teal-600:   #1D9E75;
    --teal-50:    #E6F7F3;
    --magenta-500:#C42D58;
    --magenta-50: #FCE7EF;
    --magenta-glow: rgba(196,45,88,.18); /* SaveBar 等の attention pulse 用の半透明アクセント */
    --purple-500: #9747FF;
    --purple-50:  #F1E8FF;

    /* Background tokens */
    --bg-page:        #FAFAFA;
    --bg-default:     #FFFFFF;
    --bg-canvas:      #F5F6F8;
    --bg-subtle:      #F3F4F6;
    --bg-danger:      #FEE2E2;
    --bg-unread:      #EEF0FB;

    /* 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;
    --text-tertiary:    #6B7280;
    --text-placeholder: #9CA3AF;
    --text-disabled:    #D1D5DB;
    --text-brand:       #001951;
    --text-danger:      #DC2626;
    --text-success:     #1D9E75;
    --text-warning:     #B45309;

    /* Border */
    --border-default:  #D1D5DB;  /* WCAG: 1.5:1 (内側 divider 用) */
    --border-subtle:   #E5E7EB;  /* default より薄い区切り（modal header/footer 等） */
    --border-strong:   #9CA3AF;  /* WCAG: 3.0:1 達成 (外枠・hover state 用) */
    --border-focus:    #001951;
    --border-brand:    #001951;
    --border-danger:   #DC2626;
    --border-disabled: #E5E7EB;

    /* 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;
    --r-8:    8px;

    /* 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;
  }

  /* =====================================================
     Dark mode — カラートークンだけを上書き（全コンポーネントは
     トークン参照なので、ここを差し替えるだけで暗転する）。
     有効化: <html data-theme="dark">
     ===================================================== */
  :root[data-theme="dark"] {
    /* 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-900: #E6E9EE;

    /* Semantic（-50 背景は暗いトーンへ、-500 は暗背景向けに少し明るく） */
    --red-500:    #F26D6D;
    --red-50:     #3A1F1F;
    --amber-500:  #F0B23E;
    --amber-50:   #382D12;
    --teal-500:   #2BB7A2;
    --teal-600:   #2BB7A2;
    --teal-50:    #123029;
    --magenta-500:#E0598A;
    --magenta-50: #3A1F2B;
    --magenta-glow: rgba(224,89,138,.22);
    --purple-500: #B07DFF;
    --purple-50:  #281E3A;

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

    /* 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:    #8A93A0;
    --text-placeholder: #6B7280;
    --text-disabled:    #4B515C;
    --text-brand:       #8AA2FF;
    --text-danger:      #F26D6D;
    --text-success:     #2BB7A2;
    --text-warning:     #F0B23E;

    /* Border */
    --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); }
  /* ハードコードの白ガラス面はトークンに乗らないので 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"] .gh { background: rgba(20,23,28,0.92); }
  /* ダークモード：ワードマークを明色インク版へ差し替え（HTML はそのまま、content で置換） */
  :root[data-theme="dark"] .gh-logo img,
  :root[data-theme="dark"] .dn-brand__img { content: url("/assets/brand/logo-long-dark.svg"); }

  * { 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; }

  /* ============ 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: #fff; border-color: var(--int-brand);
    box-shadow: var(--shadow-1);
  }
  .btn--primary:hover { background: var(--int-brand-h); border-color: var(--int-brand-h); }
  .btn--primary:active { background: #0a1f5e; }
  .btn--secondary {
    background: var(--bg-default); color: var(--text-primary); border-color: var(--border-strong);
  }
  .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(--red-500); color: #fff; border-color: var(--red-500);
  }
  .btn--danger:hover { filter: brightness(.92); }
  .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 */
  .btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
  }
  .btn.is-loading .ic { visibility: hidden; }
  .btn.is-loading::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    width: 14px; height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    color: #fff;
    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; }
  /* 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);
  }
  /* 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-default);
    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); }
  /* フラット：枠・背景なし（丸で囲わない）。ホバー時だけ角丸の背景。ツールチップは併用可。 */
  .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: #fff; }
  .iconbtn.brand:hover { background: var(--int-brand-h); border-color: var(--int-brand-h); }
  /* 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: #FDC7C7;
    color: var(--red-600, #B42121);
  }
  .iconbtn.is-danger:hover .ic { color: var(--red-600, #B42121); }

  /* ==== 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;
    color: var(--text-tertiary);
    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; }
  .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: normal;
    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);
  }

  /* ==== 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, #F3F4F6, #F3F4F6 8px, #FAFAFA 8px, #FAFAFA 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(--navy-50); color: var(--navy-500); }
  .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; }
  .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;
  }
  .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 { color: var(--text-primary); background: var(--int-hover); }
  .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); }

  /* ---- 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;
  }
  .modal__footer {
    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 で幅を変更
           <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; }

  .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) #fff,
      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: #fff; /* 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;
  }
  .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: #fff; }
  .avatar .av-badge.navy   { background: var(--brand-navy); color: #fff; }
  .avatar .av-badge.danger { background: var(--red-500);   color: #fff; }
  .avatar .av-badge.success{ background: var(--teal-600);  color: #fff; }
  .avatar .av-badge.dot    { /* solid status dot */ }
  .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); }
  /* 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 */
  .field { display: flex; flex-direction: column; gap: 6px; }
  .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); }
  /* 横ラベル（ラベル左 / 入力右）。ラベル列幅は --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; }
  @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; }
  }

  /* 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-default);
    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-default);
    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-600);
    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; }

  /* 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[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-default);
    border-radius: var(--r-4); padding: 0 12px; height: 40px;
  }
  .input-affix input { border: 0; background: transparent; flex: 1; height: 100%; outline: none; font-family: inherit; font-size: 14px; }
  .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--brand    { background: var(--brand-navy-50);  border-color: #D5DCEF; color: var(--brand-navy); }
  .tag--success  { background: var(--teal-50);        border-color: #BDE5D9; color: #0B7B65; }
  .tag--danger   { background: var(--red-50);         border-color: #FDC7C7; color: #B42121; }
  .tag--warning  { background: var(--amber-50);       border-color: #FCE0A3; color: #A5690D; }
  .tag--magenta  { background: var(--magenta-50);     border-color: #F5C1D2; color: #92254A; }
  .tag--purple   { background: var(--purple-50);      border-color: #DCC5F5; color: #6E2BC5; }
  .tag--avatar { padding-left: 2px; }
  .tag--avatar .av { width: 20px; height: 20px; border-radius: 50%; background: #C8D0E4 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-default); 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; gap: 8px; }
  .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 */
  .badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 9999px; background: var(--red-500); color: #fff;
    font-size: 11px; font-weight: 700; font-family: var(--ff-display);
    box-shadow: 0 0 0 2px #fff;
  }
  .badge--dot { width: 8px; height: 8px; min-width: 0; padding: 0; background: var(--red-500); border-radius: 50%; }

  /* 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-strong);
    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 #fff; border-bottom: 2px solid #fff;
    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-strong);
    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; }
  .switch .track {
    position: absolute; inset: 0; background: var(--gray-200); border-radius: 999px;
    transition: background .15s ease;
  }
  .switch .thumb {
    position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; background: #fff; 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); }
  .switch input:checked ~ .thumb { transform: translateX(18px); }
  .switch input:checked ~ .thumb::after { opacity: 1; }

  /* 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: #fff;
  }
  /* Red count badge (unread / alerts) */
  .tabs .tab .tab-badge.is-alert {
    background: var(--red-500); color: #fff;
  }
  .tabs .tab.is-active .tab-badge.is-alert {
    background: var(--red-500); color: #fff;
  }
  /* 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.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); }

  /* Tooltip
     - 単独の <span class="tt"> ... </span>  → プレビュー用、常時表示
     - <button class="iconbtn"> ... <span class="tt"> ... </span> </button>
       → ボタン上空に浮かせて hover で表示（正規のツールチップ挙動）
  */
  .tt {
    background: var(--brand-navy); color: #fff;
    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: #fff; color: var(--text-primary); border: 1px solid var(--border-default); box-shadow: var(--shadow-2); }
  .tt.light::after { background: #fff; border: 1px solid var(--border-default); border-top: 0; border-left: 0; }

  /* Tooltip on iconbtn — hover で出る正規挙動 */
  .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(--gray-900); color: #fff;
    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; }
  .toast--success { background: linear-gradient(90deg, #0D93E0, #00C4C4); }
  .toast--danger  { background: var(--red-500); }
  .toast--info { background: var(--brand-navy); }
  .toast button.t-btn {
    margin-left: auto; color: #fff; 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-default);
    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(--magenta-500); color: #fff;
    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: #D9D9D9 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;
  }
  .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: inherit;       /* 親の背景色を継承して罫線を打ち抜く */
    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; }
  /* 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; }



  /* ============================================================
     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; }
  /* 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);
  }
  .menu .mn-item[aria-disabled="true"],
  .menu .mn-item.is-disabled {
    color: var(--text-disabled);
    cursor: not-allowed;
  }
  .menu .mn-item[aria-disabled="true"]:hover,
  .menu .mn-item.is-disabled:hover { background: transparent; }

  .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: #C8D0E4 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; }
  .av-grp { display: inline-flex; }
  .av-grp .avatar { border: 2px solid #fff; }
  .av-grp .avatar + .avatar { margin-left: -8px; }

  /* 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; }

  /* 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; }

  /* 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%, #0B2C7A 100%);
    border-radius: 4px; color: #fff;
    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: #CDD4EC;
  }
  .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: #fff;
    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;
  }
  .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: #C7D0EC; }
  .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: #B8E8DB; }
  .banner.is-success .bn-ico { color: var(--teal-600); }
  .banner.is-success .bn-title { color: #0E7A65; }

  .banner.is-warning { background: #FFF9E6; border-color: #F5DC8E; }
  .banner.is-warning .bn-ico { color: #B45309; }
  .banner.is-warning .bn-title { color: #92400E; }

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

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

  /* 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 */
  .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: #FFF9E6;           color: #B45309; }
  .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) ---------- */
  .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: #F3F4F6; /* 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: #F3F4F6;
  }
  .bubble-msg.is-tail-tl::after {
    left: -12px;
    background-color: #F3F4F6;
    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, #F3F4F6);
    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, #F3F4F6);
    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(--magenta-500, #D12F7A); color: #fff; }
  .bubble-msg.is-magenta.is-tail-tr::after,
  .bubble-msg.is-magenta.is-tail-tl::after { background-color: var(--magenta-500, #D12F7A); }

  /* 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;
    color: var(--text-tertiary);
    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;
  }

  /* 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;
  }

  /* 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); }
  .icontxt-row.accent { color: #D4476A; }
  .icontxt-row.accent .ic { color: #D4476A; }

  /* 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: #D9D9D9; 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: #F9FAFB; 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: #FEF3C7; color: #92400E; 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: #141B27;
  }
  .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: #F3F4F6; }
  .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: #E0E4F5;          box-shadow: inset 3px 0 0 0 var(--brand-navy); }

  /* ---------- 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; }
  .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); }
  .tl-row.hover   { background: var(--int-hover); }
  .tl-row.selected { background: var(--int-selected); }
  .tl-row.multi-pick { background: #FEF3C7; }

  /* Spec variants (match canonical TalkListItem state spec) */
  .tl-row.unread {
    background: var(--bg-unread);
    box-shadow: inset 3px 0 0 0 var(--brand-navy);
  }
  .tl-row.unread-hover {
    background: #E0E4F5;
    box-shadow: inset 3px 0 0 0 var(--brand-navy);
  }
  .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: #fff;
  }
  .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: #fff;
    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. */
  .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, #FEE2E2);
    border-color: var(--red-100, #FECACA);
    color: var(--red-600, #DC2626);
  }
  .tl-actions .iconbtn.is-danger:hover .ic { color: var(--red-600, #DC2626); }
  .tl-actions .iconbtn .ic { width: 16px; height: 16px; color: #1F2937; }
  /* 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; }
  .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;
  }
  .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;
  }
  /* 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. */
  .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; }

/* 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); }
  .uli-row.active               { background: var(--brand-navy-50); }
  .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;            /* 尻尾が親のボーダーを突き抜けないよう左にオフセット */
  }

  /* 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); }
  .tm-row .tm-ic {
    width: 28px; height: 28px; border-radius: 8px;
    background: #EEF0FB; 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: #fff;
    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; }

  /* ---------- 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-default);
    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); }
  /* 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; }
  .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: #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); }
  .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); }

  /* 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-strong);
    background: #fff;
    color: transparent;
  }
  .sb-opt.is-checkbox.is-selected .sb-check {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: #fff;
  }

  /* 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: #fff;
    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: #fff;
    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: #fff; }
  .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 #fff;
  }
  .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: #fff;
    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; }

  /* 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-default);
    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); }

  /* ---------- 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; }
  /* 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-strong);
    font-family: inherit; font-size: 14px; font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
  }
  .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: #fff; 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: #fff;
    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: #fff;
    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: #fff;
    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: #fff;
    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: #fff;
    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(--magenta-500); }
  .cal-month-cell .cal-ev.is-teal { background: var(--teal-500); }
  .cal-month-cell .cal-ev.is-amber { background: #D97706; }
  .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: #fff;
    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;
  }
  .sm-item:hover,
  .sm-item.hover    { background: var(--brand-navy-50); }
  .sm-item.active   { background: var(--brand-navy); color: #fff; }
  .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: #fff; }
  .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; font-weight: 500; 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-item .sm-badge {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    background: var(--red-500); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
  }
  .sm-item .sm-value {
    color: var(--text-primary); font-weight: 500;
  }

  /* Reward/Point highlight row */
  .sm-item.reward {
    background: linear-gradient(90deg, #FEF3C7 0%, #FFFFFF 60%);
  }
  .sm-item.reward .sm-ic {
    background: var(--amber-500); color: #fff; border-radius: 8px; padding: 2px;
  }
  .sm-item.points .sm-ic {
    background: var(--brand-navy); color: #fff; 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);
  }
  /* 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;
  }
  /* 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-action:hover,
  .gt-collapse:hover {
    background: rgba(0, 25, 81, 0.06);
    color: var(--text-secondary);
  }
  .gt-action:focus-visible,
  .gt-collapse: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%; }
  /* 親トグル 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; }
  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);
  }

  /* 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).

     Three patterns:
       A. Always 2-col       .shell              — Nav + SubPanel + Main (no feed)
       B. 3-col w/ fallback  .shell.is-3col      — adds Activity feed at ≥1400px;
                                                   feed auto-hides below
       C. No SubPanel        .shell.is-no-subpanel — Nav + Main (full width)
     ============================================================ */
  .shell {
    display: grid;
    grid-template-rows: 60px 1fr;
    height: 100vh;
    min-width: 1280px;
    background: var(--bg-default);
    overflow: hidden;
  }
  .shell__body {
    display: grid;
    grid-template-columns: 72px 300px 1fr;
    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);   /* キャンバス地：白いカード/表/パネルを浮かせる */
  }
  /* ===== 2カラム（本文 + 右レール sticky TOC）。member-detail / アンケート編集など ===== */
  .md-page {
    padding: 0 40px 0 0;             /* 右端のインセットは標準ページ（SettingsMain）と同じ40px。上下/左は 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: 32px 40px 64px;   /* 標準ページ（SettingsMain）と同じインセットに統一。追従タブ帯は sticky で上端へ吸着 */
  }
  /* 終了アンケートの編集：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; }
  /* アンケート編集の質問／設定タブ帯。コンテンツ列幅でヘッダー直下に追従（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; }

  /* 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); }
  .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; }

  /* アンケート回答者プレビュー（別タブ・全画面フォーム）。レスポンシブ */
  .svpv-header-inner { max-width: 880px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; }
  .svpv-logo { height: 75px; width: auto; }
  .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 { height: 48px; }
    .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: #fff;
    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); }
  /* アクティブ：マゼンタ（ブランドアクセント）＋太字。塗りはなし */
  .md-toc__list a.is-active { color: var(--magenta-500); font-weight: 600; }
  /* トップレベルのリンク（設定タブ項目）：● + 濃いボールド（グループ見出しと同じ見た目で揃える） */
  .md-toc__list a.is-top { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-primary); }
  .md-toc__list a.is-top::before {
    content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-secondary);
  }
  .md-toc__list a.is-top.is-active { color: var(--magenta-500); }
  .md-toc__list a.is-top.is-active::before { background: var(--magenta-500); }
  /* 子項目（質問）：インデントして淡いグレー */
  .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(--magenta-500); }
  /* 1280px 未満：シェルの最小幅を外してウィンドウ幅にフィット（横スクロール回避）。
     2カラム本文（md-page）は右TOCを畳んで本文を右端まで広げる。 */
  @media (max-width: 1279px) {
    .shell { min-width: 0; }
    .md-page { grid-template-columns: 1fr; }
    .md-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 で共有してタブと本文の左端を揃える */
  .stk__inset { width: 100%; max-width: 1200px; padding-left: 40px; padding-right: 40px; }
  .stk__head { padding-top: 32px; padding-bottom: 56px; }   /* タイトル部分→追従タブの間を ~60px 開ける */
  .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(40px + 220px + 32px); }
  .stk-tabbar__inner .tabs { border-bottom: 0; }
  @media (max-width: 1279px) { .stk-tabbar__inner { padding-right: 40px; } }   /* TOC 非表示時は本文が全幅なので右詰め解除 */
  .stk-body {
    display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 0 32px;
    align-items: start; padding-top: 24px; padding-bottom: 64px;
  }
  .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; }
  }
  /* TOC を持たない単カラムの設定ページ（settings-billing / settings-reward 等） */
  .stk.is-single .stk-body { grid-template-columns: 1fr; }
  .stk.is-single .stk-tabbar__inner { padding-right: 40px; }   /* TOC が無いので右詰め不要 */

  .shell__feed {
    display: none;
    border-left: 1px solid var(--border-default);
    background: var(--bg-default);
    overflow: auto;
  }
  /* 3-col variant: show activity feed when viewport has room */
  @media (min-width: 1400px) {
    .shell.is-3col .shell__body {
      grid-template-columns: 72px 300px 1fr 320px;
    }
    .shell.is-3col .shell__feed { display: block; }
  }
  /* Variant without SubPanel (e.g., simple full-width pages) */
  .shell.is-no-subpanel .shell__body {
    grid-template-columns: 72px 1fr;
  }
  @media (min-width: 1400px) {
    .shell.is-no-subpanel.is-3col .shell__body {
      grid-template-columns: 72px 1fr 320px;
    }
  }
  /* 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: 300px 1fr; }
  .shell.is-admin.is-no-subpanel .shell__body { grid-template-columns: 1fr; }
  @media (min-width: 1400px) {
    .shell.is-admin.is-3col .shell__body { grid-template-columns: 300px 1fr 320px; }
    .shell.is-admin.is-no-subpanel.is-3col .shell__body { grid-template-columns: 1fr 320px; }
  }


  /* ============================================================
     GlobalHeader (.gh) — top app bar, 60px tall, full width.
     Layout: Logo + PageTitle  ·  Stats (flex)  ·  Search/Bell · Divider · Org/User
     Anchored at the top of every authenticated screen.
     ============================================================ */
  .gh {
    height: 60px;
    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 {
    width: 160px;
    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. */
  .gh-icon-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 1;
  }
  .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: #fff 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: #fff;
    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: 72px;
    background: #fff;
    border-right: 1px solid var(--border-default);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    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: #fff;
    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; }
  .gn-brand:hover {
    background: var(--brand-navy);
    color: #fff;
  }
  .gn-brand:hover svg,
  .gn-brand:hover .lucide { transform: translate(1px, -1px); }
  .gn-brand:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 3px; }
  .gn-brand.is-active {
    background: var(--brand-navy);
    color: #fff;
  }
  /* Section divider between brand and nav items */
  .gn-divider {
    width: 32px;
    height: 1px;
    background: var(--border-default);
    margin: 4px 0;
    flex: none;
  }
  /* Nav stack */
  .gn-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  /* Single nav item */
  .gn-item {
    position: relative;
    width: 56px; height: 56px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    color: var(--brand-navy);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    transition: background .12s ease, box-shadow .12s ease, border-color .12s ease;
    flex: none;
    border: 1px solid transparent;
  }
  .gn-item .gn-ic {
    position: relative;
    width: 24px; height: 24px;
    display: inline-grid; place-items: center;
    color: var(--brand-navy);
    overflow: visible;
  }
  .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(--brand-navy);
    letter-spacing: 0.02em;
    text-align: center;
    white-space: nowrap;
  }
  /* 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) {
    background: rgba(0, 25, 81, 0.04);
    box-shadow: inset 0 0 0 1px var(--border-default);
  }
  .gn-item:focus-visible {
    outline: 2px solid var(--brand-navy);
    outline-offset: 2px;
  }
  /* Active state — soft white card + left rail accent */
  .gn-item.is-active {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 25, 81, 0.08);
    box-shadow: 0 2px 8px rgba(0, 25, 81, 0.08);
  }
  .gn-item.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 4px;
    background: var(--brand-navy);
    border-radius: 0 999px 999px 0;
  }
  /* 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). */
  .gn-item .gn-ic .badge {
    position: absolute;
    top: -6px;
    left: 100%;
    margin-left: -8px;
    right: auto;
    /* Negative offsets pull the badge so its center sits on the icon's top-right corner */
  }
  .gn-item .gn-ic .badge.badge--dot {
    top: -2px;
    margin-left: -4px;
  }



  /* ============================================================
     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: 300px;
    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;
  }
  /* 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 が開閉)。クリック手応えを出す */
  .subpanel .gt { cursor: pointer; border-radius: var(--r-6); }
  .subpanel .gt:hover { background: var(--int-hover); }
  /* 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: #fff;
  }
  .subpanel .sm-item.active .sm-ic,
  .subpanel .sm-item.active .sm-label,
  .subpanel .sm-item.active .sm-tail { color: #fff; }
  /* Pink count badge variant for unread items in My Letter group */
  .subpanel .sm-item .sm-tail .sm-badge.is-magenta {
    background: var(--magenta-500);
    color: #fff;
  }
  /* "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;
  }

  /* ---------- Long-press popover ---------- */
  .lp-panel {
    display: inline-block;
    min-width: 240px;
    background: #fff;
    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: #fff;
    border: 1px solid #D1D5DB;
    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;
  }
  /* 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: #fff;
  }
  /* 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 #D1D5DB;
    border-left: 1px solid #D1D5DB;
    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 #D1D5DB;
    border-right: 1px solid #D1D5DB;
    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 #D1D5DB;
    border-left: 1px solid #D1D5DB;
    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 #D1D5DB;
    border-right: 1px solid #D1D5DB;
    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); }

  /* 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, #EEF1F7);
    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, #001951);
    color: #fff;
    border: 1.5px solid #fff;
    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(--brand-navy-800, #000F33);
  }
  .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 */
  .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; }

  /* 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: #fff;
    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, #F3F4F6);
    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, #E5E7EB);
    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); }

  /* 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%;
    max-width: 360px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--border-default, #E5E7EB); /* gap 間の線色 */
  }
  .sig .sig-cell {
    position: relative;
    overflow: hidden;
    background: var(--brand-navy-50, #EEF1F7);
  }
  .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: #fff;
    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 */
  .icotxt.is-on { color: var(--magenta-500); background: var(--magenta-50, #FCEEF3); }
  .icotxt.is-on:hover { background: #F9DDE7; }
  .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: #fff;
    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: #fff;
    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(--brand-navy-700, #001541); }
  .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(--magenta-500); }
  .new-arrival.is-magenta:hover { background: var(--magenta-600, #A8294F); }

  /* 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(--gray-200, #E5E7EB);
    background: #fff;
    color: var(--text-secondary, #4B5563);
    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, #F3F4F6);
    border-color: var(--gray-300, #D1D5DB);
    color: var(--text-primary, #111827);
  }
  .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: #fff;
    cursor: default;
  }
  .pagination .pg-item.is-disabled {
    color: var(--text-muted, #9CA3AF);
    background: #fff;
    border-color: var(--gray-200, #E5E7EB);
    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-muted, #9CA3AF);
    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, #E5E7EB);
    color: var(--text-secondary, #4B5563);
    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, #F3F4F6);
    color: var(--text-primary, #111827);
  }
  .pg-compact .pg-nav.is-disabled {
    color: var(--text-muted, #9CA3AF);
    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, #111827);
    padding: 0 8px;
    min-width: 60px;
    text-align: center;
  }
  .pg-compact .pg-label .pg-total { color: var(--text-tertiary, #6B7280); 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, #E5E7EB);
    background: #fff;
    color: var(--text-secondary, #4B5563);
    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, #F3F4F6);
    border-color: var(--gray-300, #D1D5DB);
    color: var(--text-primary, #111827);
  }
  .pg-loadmore .ic { width: 14px; height: 14px; }
  .pg-loadmore.is-loading { color: var(--text-tertiary, #6B7280); cursor: default; }
  .pg-loadmore.is-loading .pg-spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--gray-200, #E5E7EB);
    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-muted, #9CA3AF); cursor: not-allowed; opacity: 0.55; }
  /* hint beneath loadmore — "12 / 245件表示中" */
  .pg-loadmore-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary, #6B7280);
    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(--navy-500);
    color: var(--navy-500);
  }
  .step.is-current .step__title { color: var(--navy-500); }
  .step.is-current::after-bar {}
  .step.is-current {
    box-shadow: inset 0 -3px 0 0 var(--navy-500);
  }

  /* Complete */
  .step.is-complete .step__marker {
    background: var(--teal-500);
    border-color: var(--teal-500);
    color: #fff;
  }
  .step.is-complete .step__title { color: var(--text-primary); }

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

  /* =========================================================
     StepDots — コンパクトなステップ進行表示
     狭い幅（SidePanel / Modal / モバイル）向け。Stepper が
     横に詰まって読めなくなる場面で使う。ドット＋コネクタの帯と
     「現在地ラベル（2 / 4 ステップ名）」の 2 段構成。
     色は Stepper と同じ：navy = 進行中 / teal = 完了。
     ========================================================= */
  .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; }
  /* Complete */
  .stepdots__node.is-complete .stepdots__dot { background: var(--teal-500); border-color: var(--teal-500); color: #fff; }
  .stepdots__node.is-complete::after { background: var(--teal-500); }
  /* Current */
  .stepdots__node.is-current .stepdots__dot { border-color: var(--brand-navy); color: var(--brand-navy); }
  /* 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 — 番号付き横ステップインジケーター
     ウィザード型フォーム（複数ステップの申請・アンケート）向け。
     小さめの番号丸＋ラベル併記＋細い区切り線を、白いバーに収める。
     完了＝teal チェック / 現在＝navy 塗り＋リング / 未到達＝gray。
     ========================================================= */
  .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;
  }
  .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-subtle); color: var(--text-tertiary);
    border: 1.5px solid var(--bg-subtle);
    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;
  }
  .stepbar__line { flex: 0 0 24px; height: 1px; background: var(--border-default); }
  .stepbar__step.is-current .stepbar__num {
    background: var(--brand-navy); color: #fff; border-color: var(--brand-navy);
    box-shadow: 0 0 0 4px var(--brand-navy-50);
  }
  .stepbar__step.is-current .stepbar__label { color: var(--brand-navy); font-weight: 700; }
  .stepbar__step.is-complete .stepbar__num {
    background: var(--teal-50); color: var(--teal-600); border-color: var(--teal-500);
  }
  .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; }
  /* magenta：完了ステップをブランドアクセント（マゼンタ）で塗る派生 */
  .stepbar.is-magenta .stepbar__step.is-complete .stepbar__num {
    background: var(--magenta-500); color: #fff; border-color: var(--magenta-500);
  }
  @media (max-width: 640px) {
    .stepbar { padding: 12px; }
    .stepbar__label { display: none; }
    .stepbar__line { flex: 1; }
  }
  /* 新規ウィザードの上部ツールバー：1枚の白パネルに StepBar＋カウンター＋プレビュー */
  .sv-wizard-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: var(--bg-default); border: 1px solid var(--border-strong);
    border-radius: 8px; padding: 12px 20px; box-shadow: var(--shadow-1);
  }
  .sv-wizard-bar__right { display: flex; align-items: center; gap: 16px; flex: none; }
  .sv-wizard-bar__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; }
  .optcard__main { font-weight: 500; color: var(--text-primary); }
  .optcard__sub { 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: #fff;
  }
  .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 容れ物（画面下中央・固定） */
  .toast-host { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1200; }

  /* 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, #6B7280);
    font-variant-numeric: tabular-nums;
  }
  .pg-toolbar .pg-range b {
    color: var(--text-primary, #111827);
    font-weight: 600;
  }

  /* Per-page select — pagination とセットで使う */
  .pg-perpage {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-tertiary, #6B7280);
  }
  .pg-perpage select {
    height: 32px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--gray-200, #E5E7EB);
    border-radius: 8px;
    background: #fff 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, #111827);
    -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 {
    background: var(--bg-default);
    border: 1px solid var(--border-strong, #9CA3AF);   /* 外枠＝strong（カード/sr-list と統一。内側の行区切りは薄いまま） */
    border-radius: 12px;
    overflow: hidden;
  }
  .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: var(--text-primary, #111827);
    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, #6B7280);
    letter-spacing: 0.04em;
    background: var(--gray-50, #F3F4F6);
    border-bottom: 1px solid var(--border-default, #E5E7EB);
    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, #E5E7EB);
    color: var(--text-primary, #111827);
  }
  .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 */
  .data-table .sort-ic {
    width: 14px; height: 14px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #9CA3AF);
    flex: none;
  }
  .data-table .sort-ic svg {
    width: 10px; height: 10px;
    display: block;
    line-height: 1;
  }
  .data-table .sort-ic .up,
  .data-table .sort-ic .dn {
    opacity: 0.45;
  }
  .data-table .sort-ic .up { margin-bottom: 1px; }
  .data-table .sort-ic .dn { margin-top: 1px; }
  .data-table th.is-sorted.is-asc .sort-ic .up,
  .data-table th.is-sorted.is-desc .sort-ic .dn {
    opacity: 1;
    color: var(--brand-navy);
  }
  .data-table thead th.is-sortable:hover .sort-ic { color: var(--text-secondary, #4B5563); }
  .data-table thead th.is-sortable:hover .sort-ic .up,
  .data-table thead th.is-sortable:hover .sort-ic .dn { opacity: 0.7; }

  /* Rows */
  .data-table tbody tr {
    transition: background 100ms ease;
  }
  .data-table tbody tr + tr td {
    border-top: 1px solid var(--border-default, #E5E7EB);
  }
  .data-table tbody tr:hover td {
    background: var(--brand-navy-50);
  }
  .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, #DCE1F1);
  }
  .data-table td {
    padding: 14px 16px;
    vertical-align: middle;
    color: var(--text-primary, #111827);
    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, #6B7280);
  }
  .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, #F3F4F6);
  }
  .data-table .dt-check {
    width: 16px; height: 16px;
    border: 1.5px solid var(--gray-300, #D1D5DB);
    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: #fff;
  }
  .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, #6B7280);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
  }
  .data-table .dt-rowmenu:hover {
    background: var(--gray-100, #F3F4F6);
    color: var(--text-primary, #111827);
  }
  .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, #E5E7EB);
    flex-wrap: wrap;
  }
  /* タイトル直下の補足メモ（DataTable note）。ヘッダー区切り線の下・テーブルの上。 */
  .dt-wrap .dt-note { padding: 8px 18px; border-bottom: 1px solid var(--border-default, #E5E7EB); }
  /* 0 件のときの空状態（DataTable empty）。列ヘッダーの代わりに中央寄せで表示。 */
  .dt-wrap .dt-empty { padding: 8px 0; }
  .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;
  }
  .dt-wrap .dt-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-default, #E5E7EB);
    background: var(--gray-50, #F9FAFB);
  }
  /* 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; }
  /* When .dt-user is used as a link (<a class="dt-user" href="...">) — hover affordance */
  a.dt-user { text-decoration: none; color: inherit; }
  a.dt-user:hover .dt-user-name { color: var(--brand-navy); text-decoration: underline; }

  /* Empty state */
  .data-table .dt-empty td {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-tertiary, #6B7280);
    font-size: 13px;
  }
  .data-table .dt-empty .ic-lg { width: 28px; height: 28px; color: var(--text-muted); 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;
  }
  /* 横スクロール中のスクロールバー装飾 — 控えめに */
  .dt-scroll::-webkit-scrollbar { height: 10px; }
  .dt-scroll::-webkit-scrollbar-thumb {
    background: var(--gray-200, #E5E7EB);
    border-radius: 999px;
    border: 2px solid #fff;
  }
  .dt-scroll::-webkit-scrollbar-thumb:hover { background: var(--gray-300, #D1D5DB); }

  /* 固定列 */
  .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, #F3F4F6);
  }
  /* 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, #DCE1F1);
  }

  /* 固定列の一番右 — 常時右端に 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, #E5E7EB);
  }
  .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);
  }

  /* ---------- 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(--brand-teal, #0F8B8D); }
  .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(--brand-teal, #0F8B8D); }
  .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: #D6DCE4;
    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(--brand-teal, #0F8B8D); }
  .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; }

  /* ----- 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, #9CA3AF);
    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: #fff;
  }
  .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(--magenta-500, #D12F7A);
    color: #fff;
    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;
  }
  /* 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); }
  .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: #fff; 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-default);
    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: #D5DCEF;
  }
  .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 #fff;
    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: #fff;
    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 #fff;
    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 #fff;
  }
  .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; }
  .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: #FBFBFD;
    background-image: radial-gradient(circle, #DDE2EA 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);
  }
  .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;
  }
  .oc-node__chev {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--brand-navy);
    color: #fff;
    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(--brand-navy-600); }
  .oc-node__chev .ic { width: 14px; height: 14px; color: #fff; }
  .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 #FCE0A3;
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    box-sizing: border-box;
    width: 180px;
  }
  .oc-member .avatar { flex: none; }

  /* 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; }
  /* Active state for toolbar iconbtn (e.g. lock) */
  .oc .oc__toolbar .iconbtn.is-active {
    background: var(--brand-navy-50);
    color: var(--brand-navy);
  }
  /* 縦ツールバーは左端 + 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 下線） */
  .org-table .org-row__label { cursor: pointer; }
  .org-table .org-row__label:hover { color: var(--brand-navy); text-decoration: underline; }
  /* 行末アクション (data-table の col-actions セル内のラッパー) — グローバル */
  .org-row__actions {
    display: inline-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;
  }
  .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: underline;
  }

  /* 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, #C7D0E5);
    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; }

  /* ============================================================
     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-default);
    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; }
  /* 検索ヒット 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-muted); 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(--text-secondary);
    color: #fff;
  }
  .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: 1280px;
  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: 60px;
  box-sizing: border-box;
}
.dn-right > .shell__main  {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--bg-page);   /* キャンバス地（drill シェル側も合わせる） */
}
.dn-nav  {
  width: 300px;
  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;
}
.dn-head__tail  {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dn-brand  {
  display: flex;
  align-items: center;
}
.dn-brand__img  {
  width: 150px;
  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: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;
}
.is-nav-collapsed .dn-search, .is-nav-collapsed .dn-head__tail, .is-nav-collapsed .dn-brand__img, .is-nav-collapsed .gt, .is-nav-collapsed .sm-label, .is-nav-collapsed .sm-tail, .is-nav-collapsed .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 .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; }
  .shell__main { padding: 0 !important; }
  body { background: #fff !important; }
  /* カード・グラフがページ途中で割れないように */
  .chartcard, .statcard, .aisummary, .fcard { break-inside: avoid; }
  /* 背景色・チャート色を印刷に反映 */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

  /* ---------- CountBadge ----------
     件数を表す小さな navy ピル（フィルタ件数・選択数・未読数など）。 */
  .count-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 6px;
    border-radius: 999px;
    background: var(--brand-navy); color: var(--text-on-brand, var(--bg-default));
    font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
  }

  /* ---------- Segmented ----------
     少数の選択肢を横並びピルで切り替える単一選択（タブより軽い。絞り込み軸の選択などに）。 */
  .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__count { font-size: 11px; color: var(--text-tertiary); }

  /* テーブルセル内のリンク風ボタン（クリックでモーダル）。hover でのみ下線。 */
  .cell-link {
    background: none; border: 0; padding: 0; font: inherit;
    color: var(--brand-navy); font-weight: 600; cursor: pointer; text-align: left;
  }
  .cell-link:hover { text-decoration: underline; text-underline-offset: 2px; }

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