/* =========================================================
   クリエイティブつくる君 — Shared Styles
   明朝ベース・UPGRADE準拠の青と紙
   ========================================================= */

/* Tailwind互換ユーティリティ */
.hidden { display: none !important; }

:root {
  --paper:        #FBFAF5;
  --paper-2:      #F4F1E8;
  --paper-3:      #EBE7D8;
  --surface:      #FFFFFF;
  --sumi:         #1A1A1A;
  --sumi-2:       #3D3A33;
  --sumi-3:       #6B6760;
  --sumi-4:       #A09B91;
  --muted:        #BDB8AC;
  --line:         #E2DCC8;
  --line-strong:  #C8C1A8;
  --blue:         #1f6feb;
  --blue-deep:    #1a5fd0;
  --blue-soft:    #e8f0fd;
  --blue-faint:   #f0f5ff;
  --blue-grad:    linear-gradient(180deg, #e8f0fd 0%, transparent 100%);
  --success:      #4A7C3F;
  --warning:      #B26A00;
  --danger:       #B33D33;
  --mincho:  'Shippori Mincho B1', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --sans:    'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;
  --sidenav-w: 120px;
  --sidebar-w: 260px;
}

* { box-sizing: border-box; }

/* フォーム部品はブラウザ既定でフォントを継承しないため、ここで一括継承させる
   （個別の font-family:inherit 書き忘れでシステムフォントが漏れるのを防ぐ） */
button, input, textarea, select { font-family: inherit; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--sumi);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
  min-height: 100vh;
}
body {
  position: relative;
  display: flex;
  flex-direction: column;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(26,61,245,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,61,245,.035) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

.mincho { font-family: var(--mincho); font-feature-settings: "palt"; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--sumi-4); }

/* APP SHELL */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 100vh;
}
.app-body { display: grid; grid-template-columns: 1fr; flex: 1; min-width: 0; min-height: 0; }
.app-body.has-sidebar { grid-template-columns: var(--sidebar-w, 260px) 1fr; }
.mobile-nav-toggle,
.mobile-nav-backdrop { display: none; }

/* LEFT SIDE NAV */
.app-sidenav {
  width: var(--sidenav-w, 120px);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1e2a3d;
  border-right: 1px solid rgba(0,0,0,.18);

  padding: 0 0 10px;
  z-index: 30;
  overflow-y: auto;
}

/* ロゴ / ホーム */
.sidenav-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 96px;
  padding: 8px 4px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: #aab6c8;
  margin-top: 14px;
  margin-bottom: 6px;
  transition: background .12s, color .12s;
  cursor: pointer;
}
.sidenav-home:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidenav-home.active { background: rgba(255,255,255,.12); color: #fff; }
.sidenav-logo-circle {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  flex-shrink: 0;
}

/* セクションラベル */
.sidenav-section-label {
  align-self: flex-start;
  font-size: 10.5px;
  letter-spacing: 1.5px;
  /* 🔴 `#7f8da6` はレール地 `#1e2a3d` の上で **4.31**（要 4.5・10.5px なので大文字扱いにはならない）。
     **23 画面すべてに出る**ので、1 値で全画面のコントラスト不適合が 2 件ずつ減る（2026-08-02）。
     `#8b98ad` は 4.95。項目文字 `#aab6c8`（7.04）より暗いままなので、
     「ラベルは項目より控えめ」という階段は保たれる。 */
  color: #8b98ad;
  font-weight: 700;
  margin: 8px 0 3px 20px;
  font-family: var(--sans);
  line-height: 1;
}

/* 新しい制作ボタン */
.sidenav-new-btn {
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 4px 8px;
  border-radius: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  transition: background .12s;
}
.sidenav-new-btn:hover { background: rgba(255,255,255,.08); }
.sidenav-new-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: #1f6feb;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(31,111,235,.35);
  flex-shrink: 0;
}
.sidenav-new-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #cfe0ff;
  line-height: 1;
  white-space: nowrap;
}

/* ナビアイテム共通 */
.sidenav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 96px;
  padding: 9px 4px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: #aab6c8;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.sidenav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidenav-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 700; }
.sidenav-item .ico { width: 24px; height: 24px; flex-shrink: 0; }
.sidenav-item-label { font-size: 12.5px; font-weight: 600; line-height: 1; }

/* ドロワーを閉じる「«」（760px 以下だけで出す）。
   PC 幅ではサイドナビは常時表示で閉じる概念が無いため、既定は非表示。
   🔴 これは**新規要素**で、PC 幅では描画されない（＝PC の見た目は 1px も変わらない）。
      760px 以下での配置・寸法は下の `@media (max-width: 760px)` にだけ書く。 */
.sidenav-close { display: none; }

/* 区切り線 */
.sidenav-divider { width: 64px; height: 1px; background: rgba(255,255,255,.12); margin: 10px auto 4px; }

/* スペーサー */
.sidenav-spacer { flex: 1; }

/* ストレージ使用量 */
.sidenav-storage {
  width: 96px;
  margin: 6px 0 8px;
  padding: 9px 8px;
  border-radius: 10px;
  color: #aab6c8;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.sidenav-storage:hover,
.sidenav-storage.active { background: rgba(255,255,255,.08); color: #fff; }
.sidenav-storage-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.sidenav-storage-title svg { width: 15px; height: 15px; flex-shrink: 0; }
.sidenav-storage-bar {
  display: block;
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
}
.sidenav-storage-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #6ea8ff;
}
.sidenav-storage.warning .sidenav-storage-title,
.sidenav-storage.warning .sidenav-storage-value { color: #fbbf24; }
.sidenav-storage.warning .sidenav-storage-bar i { background: #f59e0b; }
.sidenav-storage-value {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #8f9db2;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidenav-storage:hover .sidenav-storage-value,
.sidenav-storage.active .sidenav-storage-value { color: #c8d4e5; }

/* ストレージ容量の全画面共通通知 */
/* 🔴 通知は全画面で右下に揃える（2026-08-06 の方針）。以前はここだけ右上だった。 */
.storage-toast {
  position: fixed;
  z-index: 1200;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 32px));
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff;
  color: #7f1d1d;
  box-shadow: 0 12px 36px rgba(15,23,42,.18);
}
.storage-toast[hidden] { display: none; }
.storage-toast.warning { border-color: #fde68a; color: #78350f; }
.storage-toast-icon {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.storage-toast.warning .storage-toast-icon { background: #f59e0b; }
.storage-toast-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.storage-toast-copy strong { font-size: 13px; line-height: 1.5; }
.storage-toast-copy span { color: #6b7280; font-size: 12px; line-height: 1.6; }
.storage-toast > button {
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
@media (max-width: 640px) {
  /* 🔴 右下に揃える（2026-08-06）。ここが top のままだとスマホ幅だけ右上に残る。 */
  .storage-toast { right: 16px; bottom: 16px; }
}

/* ユーザーエリア */
.sidenav-user-area { padding: 0 4px; }
.sidenav-user-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: transparent;
  transition: background .12s;
  font-family: var(--sans);
}
.sidenav-user-btn:hover,
.sidenav-user-btn.open { background: rgba(255,255,255,.1); }
.sidenav-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #1f6feb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidenav-username {
  font-size: 11.5px;
  color: #aab6c8;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
  line-height: 1;
}

/* ユーザーポップアップ */
@keyframes popIn {
  from { transform: scale(.94) translateY(6px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.user-popup {
  position: fixed;
  left: 8px;
  bottom: 80px;
  width: 278px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(20,30,50,.22);
  padding: 12px 10px 8px;
  z-index: 1000;
  animation: popIn .14s ease both;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}
.user-popup-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 12px;
}
.user-popup-av {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #1f6feb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-popup-info { min-width: 0; }
.user-popup-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-popup-email { font-size: 12.5px; color: #9aa1ac; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.user-popup-hr { height: 1px; background: #edeff2; margin: 4px 6px; }
.up-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: #2c333e;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: var(--sans);
  transition: background .1s;
}
.up-item svg { width: 19px; height: 19px; flex-shrink: 0; stroke: #5d6675; }
.up-item:hover { background: #f3f5f8; }
.up-item.active { background: rgba(31,111,235,.1); color: #174ea6; font-weight: 700; }
.up-item.active svg { stroke: #1f6feb; }
.up-item:focus-visible { outline: 2px solid #1f6feb; outline-offset: -2px; }
.up-item--hi { background: rgba(31,111,235,.08); }
.up-item--hi:hover { background: rgba(31,111,235,.13); }
.up-item--danger { color: #d24b3e; }
.up-item--danger svg { stroke: #d24b3e; }
.up-item--danger:hover { background: #fff5f5; }

/* 管理者機能ブロック（#1656・見せ方は #1666 で確定）
   アカウントメニューの中で「自分の設定」と「テナント全体を動かす操作」が
   同じ見た目で並んでいたため、後者を左罫線 1 本で 1 かたまりに括る。

   🔴 装置は「左罫線」だけにする（#1666）。初版は 区切り線 + 地色 + 左罫線 の 3 つで
   同じ境界を 3 回主張していて、しかも
     - 地色は左右 0（`.user-popup` の padding まで）／区切り線は左右 6px インセット
       → 地色の右端が区切り線より外に出る
     - 左罫線も 0 なので区切り線の左端と始点が合わない
   の 2 点で「意図した枠」ではなく「はみ出した面」に見えていた。
   🔴 **合わせる相手は「区切り線の端」ではなく「項目のアイコン列」**（#1697）。
   #1666 では罫線の左端を `.user-popup-hr`（内側から 6px）に合わせたが、そのぶん
   ブロックの中身が右へ 6px 字下げされ、**ブロックの上下でアイコンの列が縦に揃わなくなった**。
   メニューの中でいちばん強い縦のラインはアイコン列で、区切り線の端（ヘアラインの切れ目）より
   ずれが目に付く。そこで罫線を項目の左端（`.user-popup` の内側 = 0）に置き、
   その 2px ぶんを `padding-left` から引いて**アイコンを外の項目と同じ x に戻した**。

   ```
   ┌ .user-popup の内側（ここが 0）
   │├ 罫線 2px
   ││        アイコン ← 外の項目（padding-left 12px）と同じ x に揃える
   │  ├──── 区切り線（内側から 6px。罫線とは揃わないが、これは許容する）
   ```
   ⚠️ 数字を動かすときは **`.up-item` の padding-left 12px + 罫線 2px = 合計 12px** を保つこと
   （`.up-admin` の margin-left を n にしたら `.up-admin .up-item` の padding-left は `10 - n`）。

   ⚠️ 地色を敷かないので、中の hover / active は `.up-item` の既定がそのまま正しく効く。
   ここに上書きを足さないこと（初版は地色に沈むぶんを濃い青で補っていたが、もう不要）。 */
.up-admin {
  border-left: 2px solid #c9dcfa;
  margin: 6px 0 4px;
  padding: 2px 0;
}
/* 罫線 2px ぶんを引いて、アイコンを外の項目（padding-left 12px）と同じ x に揃える */
.up-admin .up-item { padding-left: 10px; }
.up-admin-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 5px 10px;
  font-size: 10.5px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #6b7891;
  line-height: 1;
}
.up-admin-lock { width: 12px; height: 12px; flex-shrink: 0; stroke: #6b7891; }

@media (max-width: 760px) {
  body.mobile-nav-open { overflow: hidden; }
  .app-body,
  .app-body.has-sidebar { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .main { min-height: 100vh; }
  body.has-app-sidenav .main { padding-top: 52px; }
  .mobile-nav-toggle {
    position: fixed;
    z-index: 52;
    top: 22px;
    left: 14px;
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid #d9dee7;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15,23,42,.12);
    cursor: pointer;
  }
  .mobile-nav-toggle span { width: 19px; height: 2px; border-radius: 2px; background: #263447; }
  /* 🔴 開いている間はハンバーガーを消す（以前はここで ✕ に変形させていた）。
     閉じる操作は面の中の «（`.sidenav-close`）1 つに寄せる:
       ① 閉じる操作が「閉じる対象」の中にある（つくる君AI 面と同じ）
       ② ✕ は「重なっているものを消す」＝モーダルの意味に取っておく
       ③ ハンバーガーの上に面が重なって「同じ位置に開くボタンと閉じるボタン」があった状態も解消する
     背景タップと Esc でも閉じられる（どちらも従来どおり）。 */
  body.mobile-nav-open .mobile-nav-toggle { display: none; }
  .sidenav-close {
    position: absolute;
    z-index: 1;
    top: 14px;
    right: 12px;
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,.10);
    color: #fff;
    cursor: pointer;
  }
  .sidenav-close:hover { background: rgba(255,255,255,.18); }
  .mobile-nav-backdrop {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: block;
    width: 100%;
    border: 0;
    background: rgba(15,23,42,.48);
  }
  .mobile-nav-backdrop[hidden] { display: none; }
  .app-sidenav {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    width: min(286px, calc(100vw - 52px));
    height: 100vh;
    align-items: stretch;
    padding: 58px 14px 16px;
    transform: translateX(-102%);
    transition: transform .18s ease;
    box-shadow: 8px 0 28px rgba(15,23,42,.28);
  }
  body.mobile-nav-open .app-sidenav { transform: translateX(0); }
  .sidenav-home,
  .sidenav-new-btn,
  .sidenav-item {
    width: 100%;
    min-height: 46px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 13px;
    padding: 8px 12px;
    margin: 0;
    line-height: 1.4;
  }
  .sidenav-logo-circle,
  .sidenav-new-icon { width: 32px; height: 32px; border-radius: 9px; }
  .sidenav-logo-circle svg { width: 23px; height: 23px; }
  .sidenav-new-icon svg { width: 18px; height: 18px; }
  .sidenav-section-label { margin: 15px 0 5px 12px; }
  .sidenav-divider { width: 100%; margin: 12px 0 1px; }
  .sidenav-spacer { min-height: 12px; }
  .sidenav-storage { width: 100%; margin: 4px 0 8px; padding: 10px 12px; }
  .sidenav-storage-value { font-size: 11px; }
  .sidenav-user-area { padding: 0; }
  .sidenav-user-btn { width: 100%; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 8px 12px; }
  .sidenav-av { width: 34px; height: 34px; }
  .sidenav-username { max-width: none; font-size: 13px; }
  .user-popup { left: 12px; right: 12px; bottom: 12px; width: auto; max-height: calc(100vh - 36px); }
  .new-menu-panel { left: 12px; right: 12px; width: auto; max-height: calc(100vh - 32px); }
  .storage-toast { z-index: 1200; }
}

/* 後方互換: 旧ポップアップで使われていたクラス */
.um-item { transition: background 100ms; }
.um-item:hover { background: var(--surface) !important; }

/* 新しい制作パネル */
@keyframes slideIn {
  from { transform: translateY(-8px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.new-menu-panel {
  position: fixed;
  left: 130px;
  top: 60px;
  width: 320px;
  max-height: calc(100vh - 80px);
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(20,30,50,.16);
  z-index: 61;
  display: flex;
  flex-direction: column;
  animation: slideIn .14s ease both;
  overflow: hidden;
}
.new-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 8px;
  flex-shrink: 0;
}
.new-menu-title { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.new-menu-close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #9aa1ac;
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
  transition: color .1s;
  font-family: var(--sans);
}
.new-menu-close:hover { color: #3c4350; }
.new-menu-body { flex: 1; overflow-y: auto; padding: 10px 24px 24px; }
.new-menu-sec-label {
  font-size: 12px;
  font-weight: 700;
  color: #8b93a1;
  letter-spacing: .08em;
  margin: 16px 0 12px;
}
.new-menu-sec-label:first-child { margin-top: 0; }
.new-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.new-menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 13px 4px;
  border-radius: 12px;
  border: 1px solid #edeff3;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  color: #3c4350;
  text-align: center;
  transition: border-color .12s, background .12s;
  position: relative;
}
.new-menu-card:hover { border-color: #93b4f5; background: #eef2ff; }
.new-menu-card--dev { cursor: default; opacity: .7; }
.new-menu-card--dev:hover { border-color: #edeff3; background: #fff; }
.new-menu-card-icon {
  width: 21px; height: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5d6675;
}
.new-menu-card-icon svg { width: 21px; height: 21px; }
.new-menu-card-text { display: contents; }
.new-menu-card-name { font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.new-menu-card-desc { display: none; }
.new-menu-dev-badge {
  position: absolute;
  top: 6px; right: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #9aa1ac;
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.type-btn:hover { border-color: var(--blue) !important; background: var(--blue-soft) !important; }
.new-card:hover { border-color: var(--blue) !important; background: var(--paper-3, #f4f3ee) !important; }
.sidebar-hover-item { transition: background 120ms; }
.sidebar-hover-item:hover { background: var(--paper-3, #f4f3ee) !important; }

/* SIDEBAR (contextual) */
.sidebar {
  background: var(--paper-2);
  padding: 0 0 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--blue-grad);
  position: relative;
}
.sidebar-head::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--blue);
}
.sidebar-head .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--sumi-4);
  margin-bottom: 6px;
}
.sidebar-head .title {
  font-family: var(--mincho);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.side-section-label {
  font-family: var(--mincho);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--sumi-4);
  padding: 22px 24px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.side-section-label::before {
  content: '';
  display: inline-block;
  width: 16px; height: 1px;
  background: var(--blue);
}
.side-section-label .add-btn {
  margin-left: auto;
  color: var(--sumi-3);
  cursor: pointer;
  font-size: 14px;
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: transparent;
  border: 0;
  font-family: inherit;
}
.side-section-label .add-btn:hover { background: rgba(0,0,0,.05); color: var(--sumi); }

.folder-tree { padding: 0 12px; }
.folder-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--sumi-2);
  cursor: pointer;
  border-radius: 4px;
  position: relative;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: padding-left 120ms;
}
.folder-row:hover { background: rgba(0,0,0,.03); }
.folder-row.active {
  background: var(--surface);
  color: var(--sumi);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line);
}
.folder-row.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--blue);
}
.folder-row .caret { width: 10px; font-size: 9px; color: var(--sumi-4); text-align: center; }
.folder-row .label { flex: 1; }
.folder-row .num { font-family: var(--mono); font-size: 10px; color: var(--sumi-4); margin-left: auto; }

/* MAIN */
.main {
  background: #fff;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mincho);
  font-size: 15px;
  color: var(--sumi-3);
}
.crumbs .sep { font-size: 11px; color: var(--sumi-4); }
.crumbs .current { color: var(--sumi); font-weight: 600; }
.crumbs .clk { cursor: pointer; }
.crumbs .clk:hover { color: var(--sumi); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--sumi);
  cursor: pointer;
  letter-spacing: 0.04em;
  height: 36px;
  transition: border 120ms, background 120ms, transform 60ms;
  text-decoration: none;
}
.btn:hover { border-color: var(--sumi-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--sumi); color: var(--paper); border-color: var(--sumi); }
.btn-primary:hover { background: #000; border-color: #000; }
.btn-blue { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 1px 6px rgba(31,111,235,.2); }
.btn-blue:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--sumi-2); }
.btn-ghost:hover { background: rgba(0,0,0,.04); color: var(--sumi); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-dark { background: var(--sumi); color: #fff; border-color: var(--sumi); }
.btn-dark:hover { background: var(--sumi-2); border-color: var(--sumi-2); }
.btn-lg { height: 44px; padding: 11px 20px; font-size: 14px; border-radius: 10px; }
.btn-sm { height: 32px; padding: 7px 14px; font-size: 12.5px; }

/* INPUTS */
.field-label {
  display: block;
  font-family: var(--mincho);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--sumi-3);
  margin-bottom: 8px;
}
.input {
  width: 100%;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  color: var(--sumi);
  font-family: var(--sans);
  transition: border 120ms;
}
.input::placeholder { color: var(--sumi-4); }
.input:hover { border-color: var(--sumi-3); }
.input:focus { outline: none; border-color: var(--sumi); box-shadow: 0 0 0 3px var(--blue-soft); }
.input.area { height: auto; min-height: 88px; padding: 12px 14px; line-height: 1.7; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6760' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }

/* PASSWORD SHOW/HIDE TOGGLE */
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 44px; }
.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  color: var(--sumi-3);
  cursor: pointer;
  transition: color 120ms;
}
.password-toggle:hover { color: var(--sumi); }
.password-toggle:focus-visible { outline: none; color: var(--sumi); box-shadow: 0 0 0 3px var(--blue-soft); border-radius: 3px; }

/* CHIPS / PILLS */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sumi-2);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  font-family: inherit;
}
.chip:hover { border-color: var(--sumi-3); color: var(--sumi); }
.chip.active { background: var(--sumi); color: var(--paper); border-color: var(--sumi); }
.chip.dash { border-style: dashed; color: var(--sumi-4); }

.pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  background: #f1f3f6;
  color: #3c4350;
  border-radius: 2px;
  font-size: 10px;
  letter-spacing: 0.04em;
  font-family: var(--mono);
}
.pill.blue { background: var(--blue-soft); color: var(--blue-deep); }
.pill.green { background: #DCEAD6; color: var(--success); }
.pill.amber { background: #F5E5C8; color: var(--warning); }

/* PAGE TITLE */
.page-title {
  font-family: var(--mincho);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.12em;
  margin: 0;
  line-height: 1;
  position: relative;
  padding: 6px 14px;
  display: inline-block;
}
.page-title::before, .page-title::after {
  content: '';
  position: absolute;
  width: 14px; height: 20px;
  border: 1.5px solid var(--sumi);
}
.page-title::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.page-title::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.page-counter { font-family: var(--mono); font-size: 13px; color: var(--sumi-3); letter-spacing: 0.08em; }

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border 150ms, box-shadow 150ms, transform 150ms;
  font-family: inherit;
  text-align: left;
  padding: 0;
  width: 100%;
}
.card:hover {
  border-color: var(--sumi-3);
  box-shadow: 0 8px 24px rgba(26,26,26,.06);
  transform: translateY(-1px);
}
.card.selected { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }

.thumb {
  position: relative;
  aspect-ratio: 16/9;
  background:
    linear-gradient(135deg, rgba(26,61,245,.05), transparent 60%),
    repeating-linear-gradient(45deg, var(--paper-2) 0 10px, var(--paper-3) 10px 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb .ph {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--sumi-3);
  background: rgba(255,255,255,.7);
  padding: 4px 10px;
  border-radius: 2px;
  letter-spacing: 0.1em;
  backdrop-filter: blur(2px);
}
.thumb .fmt-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--paper);
  background: rgba(26,26,26,.85);
  padding: 3px 7px;
  border-radius: 2px;
  letter-spacing: 0.06em;
}
.thumb .content-type-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}
.thumb .slide-tag {
  background: rgba(59,130,246,.9);
  color: #fff;
}
.thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.0) 60%, rgba(0,0,0,.45));
  opacity: 0;
  transition: opacity 150ms;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.card:hover .thumb-overlay { opacity: 1; pointer-events: auto; }
#banner-grid[data-selmode="true"] .thumb-overlay { opacity: 1 !important; pointer-events: auto !important; }
.thumb-overlay:has(.check.checked) { opacity: 1 !important; pointer-events: auto !important; }
.banner-check { pointer-events: auto; }

.check {
  width: 20px; height: 20px;
  background: var(--surface);
  border: 1px solid var(--sumi);
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.check.checked { background: var(--blue); border-color: var(--blue); }
.check.checked::after {
  content: '';
  width: 9px; height: 5px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.thumb-actions { display: flex; gap: 4px; }
.thumb-action {
  width: 28px; height: 28px;
  background: rgba(255,255,255,.95);
  border: 0;
  border-radius: 2px;
  font-size: 13px;
  cursor: pointer;
  color: var(--sumi);
}
.thumb-action:hover { background: #fff; }

.card-body { padding: 14px; }
.card-title {
  font-family: var(--mincho);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.35;
  margin: 0 0 8px 0;
  letter-spacing: 0.02em;
}
.card-meta-row { display: flex; align-items: center; gap: 6px; }

.dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.dot.g { background: var(--success); }
.dot.a { background: var(--warning); }
.dot.m { background: var(--sumi-4); }
.dot.b { background: var(--blue); }

.status-text {
  font-size: 11px;
  color: var(--sumi-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.04em;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,.4);
  backdrop-filter: blur(2px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 180ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--paper);
  border: 1px solid var(--sumi);
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,.18);
  max-width: 92vw;
  max-height: 92vh;
  overflow: auto;
}
.modal-head {
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.modal-head .title {
  font-family: var(--mincho);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0;
}
.modal-head .sub { font-size: 12px; color: var(--sumi-3); }
.modal-head .close {
  margin-left: auto;
  font-size: 20px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--sumi-3);
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}
.modal-head .close:hover { background: rgba(0,0,0,.05); color: var(--sumi); }
.modal-body { padding: 28px; }
.modal-foot { padding: 18px 28px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }

/* SELECT BAR */
.select-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--sumi);
  color: var(--paper);
  border-radius: 4px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  letter-spacing: 0.04em;
  box-shadow: 0 20px 50px rgba(26,26,26,.2);
  z-index: 90;
  animation: rise 160ms ease;
}
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.select-bar .ct { font-family: var(--mincho); font-size: 18px; font-weight: 600; }
.select-bar .ct .of { color: rgba(255,255,255,.5); font-size: 13px; }

/* GRID */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1280px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); } }

/* UTILS */
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.section-title .num {
  font-family: var(--mincho);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--blue);
}
.section-title h3 {
  font-family: var(--mincho);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0;
}

/* DIVIDER */
.divider { display: flex; align-items: center; gap: 14px; margin: 8px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.divider .label {
  font-family: var(--mincho);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--sumi-4);
}

/* LINK */
.link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--blue);
  padding-bottom: 1px;
}
.link:hover { color: var(--blue-deep); border-bottom-color: var(--blue-deep); }

/* LOGIN — centered form */
.login-centered {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #fff;
}
.login-centered::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 320px;
  background: linear-gradient(180deg, rgba(232,236,255,.85) 0%, rgba(251,250,245,0) 100%);
  pointer-events: none;
  z-index: 0;
}
.login-centered::after {
  content: none;
}
.login-header {
  position: relative;
  z-index: 2;
  padding: 18px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e6e8ec;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(4px);
}
.login-header .logo { height: 40px; }
.login-card-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 48px;
}
.login-card {
  background: var(--surface);
  border: 1px solid #e6e8ec;
  border-radius: 4px;
  padding: 48px 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 30px 80px rgba(26,26,26,.06), 0 4px 16px rgba(26,26,26,.04);
  position: relative;
}
.login-card::before, .login-card::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border: 1.5px solid var(--blue);
}
.login-card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.login-card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.eyebrow-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.eyebrow-row .line { display: inline-block; width: 28px; height: 1px; background: var(--blue); }
.eyebrow-row .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--blue);
}
.login-title {
  font-family: var(--sans);
  font-size: 42px;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin: 0 0 14px;
  line-height: 1;
}
.login-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.8;
  margin: 0 0 28px;
}
.login-aside-text { display: none; }
@media (min-width: 1100px) {
  .login-aside-text { display: flex; align-items: center; height: 400px; }
  .login-aside-text .vertical-jp {
    writing-mode: vertical-rl;
    font-family: var(--sans);
    font-size: 22px;
    letter-spacing: 0.7em;
    color: #6b7280;
    padding: 0 0 40px 0;
    border-left: 1px solid #d6dae1;
    height: 100%;
  }
}
.login-footer {
  position: relative;
  z-index: 2;
  padding: 22px 40px;
  display: flex;
  justify-content: space-between;
  /*
    #1393: 項目を 4 つに増やした（/security への導線を追加）ことで、狭い幅では
    4 列が横に潰し合い**各項目が 2〜4 行に折り返して単語が途中で割れる**（実測: 768px で
    全項目が 1 行 → 2 行に劣化）。折返しを許可して、潰すのではなく**項目単位で改行**させる。
    ⚠️ この class を使うのは未ログインの 3 画面（login / forgot-password / reset-password）だけ。
  */
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #9aa1ac;
  border-top: 1px solid #e6e8ec;
  background: rgba(255,255,255,.6);
}

.form-fields { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }

/* PAGE BODY */
.page-body {
  flex: 1;
  padding: 32px 40px 60px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.page-head { display: flex; align-items: flex-end; gap: 18px; padding-bottom: 4px; }
.page-head .sort { margin-left: auto; font-size: 13px; color: var(--sumi-3); cursor: pointer; }

/* =========================================================
   モダンパネル — キャンバス一覧ページ準拠（設定系ページ共通）
   クールグレー基調・白カード・ソフトシャドウ・ゴシック
   ========================================================= */
/* これらのクラスを使うページは page-body に .page-modern を付与し、
   ベージュ地（--paper）ではなく白地に切り替える */
.page-modern { background: #fff; }

/* セクションパネル（旧 var(--paper-2) 塗りパネルの置き換え） */
.m-panel {
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(20,30,50,.04);
}
/* パネル内セクション見出し（旧 明朝ラベルの置き換え） */
.m-panel-hd {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: #8b93a1;
  letter-spacing: .06em;
  margin: 0;
}
/* 数値サマリーなどの小カード */
.m-stat {
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: 0 1px 3px rgba(20,30,50,.04);
}
/* パネル内の各行ラベル/値の補助色 */
.m-label { color: #8b93a1; }
.m-value { color: #1d2530; }

/* STEPPER */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.5;
  font-family: var(--mincho);
  font-size: 13px;
  letter-spacing: 0.1em;
}
.step.done { opacity: 1; color: var(--sumi-3); }
.step.active { opacity: 1; color: var(--sumi); font-weight: 600; }
.step .num {
  width: 28px; height: 28px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mincho);
  font-size: 12px;
  font-weight: 600;
}
.step.active .num { background: var(--blue); color: #fff; border-color: var(--blue); }
.step.done .num { background: var(--sumi); color: var(--paper); border-color: var(--sumi); }
.step-bar {
  flex: 1;
  height: 1px;
  background: var(--line);
  margin: 0 14px;
}
.step-bar.done { background: var(--sumi); }

/* CHAT */
.chat-shell { display: flex; flex-direction: column; height: 100%; }
.chat-list {
  flex: 1;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.bubble-row { display: flex; gap: 10px; align-items: flex-start; }
.bubble-row.me { flex-direction: row-reverse; }
.bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 4px;
  background: var(--paper-2);
  font-size: 14px;
  line-height: 1.7;
}
.bubble-row.me .bubble { background: var(--blue); color: #fff; }
.bubble.thinking { color: var(--sumi-3); font-style: italic; }
.bubble-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 1px solid var(--line);
  font-family: var(--mincho);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bubble-avatar.me { background: var(--sumi); color: var(--paper); border-color: var(--sumi); }
.chat-input {
  border-top: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  gap: 10px;
  background: var(--paper);
  align-items: flex-end;
}
.chat-input .input { flex: 1; }

/* TABS */
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs .tab {
  padding: 12px 18px;
  font-family: var(--mincho);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--sumi-3);
  cursor: pointer;
  border: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs .tab:hover { color: var(--sumi); }
.tabs .tab.active { color: var(--sumi); font-weight: 600; border-bottom-color: var(--blue); }

/* TABLE */
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
}
.tbl th {
  text-align: left;
  font-family: var(--mincho);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--sumi-4);
  padding: 12px 16px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.tbl td { padding: 14px 16px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover { background: rgba(26,61,245,.02); }

/* ROLE BADGE */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 2px;
  font-family: var(--mincho);
  letter-spacing: 0.04em;
}
.role-badge.operator { background: #eceef2; color: #3c4350; border: 1px solid #e1e4ea; }
.role-badge.manager { background: var(--blue-soft); color: var(--blue-deep); border: 1px solid var(--blue-soft); }

/* folder hierarchy lines (visual nesting) - 縦線なし・インデントのみ */
.folder-row.l1 { padding-left: 28px; }
.folder-row.l2 { padding-left: 44px; }
.folder-row.l3 { padding-left: 60px; }

.folder-menu-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--sumi-3);
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.folder-menu-btn:hover { background: rgba(0,0,0,.06); color: var(--sumi); }

.folder-menu-pop {
  position: absolute;
  top: 100%;
  right: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,.14);
  min-width: 180px;
  z-index: 50;
  padding: 4px;
  margin-top: 2px;
}
.project-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 16/10;
  border-bottom: 1px solid var(--line);
}
.project-preview > .thumb {
  border-bottom: 0;
  border-right: 1px solid var(--line);
  aspect-ratio: auto;
}
.project-preview > .thumb:nth-child(2),
.project-preview > .thumb:nth-child(4) { border-right: 0; }
.project-preview > .thumb:nth-child(1),
.project-preview > .thumb:nth-child(2) { border-bottom: 1px solid var(--line); }

/* Card menu */
.card-menu-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  font-size: 16px;
  line-height: 0;
  cursor: pointer;
  z-index: 5;
  color: var(--sumi-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 120ms;
}
.card:hover .card-menu-btn { opacity: 1; }
.card-menu-btn:hover { background: #fff; color: var(--sumi); border-color: var(--sumi-3); }

.card-menu-pop {
  position: absolute;
  top: 42px;
  right: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  min-width: 180px;
  z-index: 20;
  padding: 4px;
}
.card-menu-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
}
.card-menu-item:hover { background: var(--paper-2); }
.card-menu-item.danger { color: var(--danger); }
.card-menu-item.danger:hover { background: rgba(179,61,51,.08); }
.card-menu-divider { height: 1px; background: var(--line); margin: 4px 0; }

/* Confirm modal */
.confirm-modal { padding: 24px 28px; }
.confirm-modal .ic {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(179,61,51,.1);
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-family: var(--mincho);
  font-weight: 600;
  margin-bottom: 18px;
}
.confirm-modal h3 {
  font-family: var(--mincho);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}
.confirm-modal p {
  font-size: 13px;
  color: var(--sumi-2);
  line-height: 1.8;
  margin: 0 0 20px;
  white-space: pre-wrap;
}

/* page transitions */
.page-fade { animation: pageFade 200ms ease; }
@keyframes pageFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* type selection modal cards */
.type-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  color: var(--sumi);
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  background: var(--paper);
}
.type-card:hover {
  border-color: var(--blue);
  background: var(--surface);
}
.type-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.type-info {
  flex: 1;
}
.type-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}
.type-desc {
  font-size: 12px;
  color: var(--sumi-3);
  line-height: 1.5;
}
