/* ============================================================
   Nova Design System — Dr.Piper
   ============================================================ */

/* ======== 変数 ========
   ベースはモノクロ。色は「意味」のためだけに使う（成功=緑 / 警告=橙 / 危険=赤 / 情報=青）。
   テーマは body[data-theme=...] で背景と無彩色トーンのみ切り替える。 */
:root {
  /* Primary = 無彩色のインク。rgb 値を別途持ち、focus ring などの半透明に再利用する */
  --primary-rgb:    24,24,27;
  --primary:        rgb(var(--primary-rgb));
  --primary-dark:   #000000;
  --primary-light:  #F4F4F5;

  /* Semantic（意味色・テーマ非依存） */
  --success:        #16A34A;
  --warning:        #D97706;
  --danger:         #DC2626;
  --info:           #2563EB;

  /* Surfaces */
  --bg:             #FAFAFA;
  --surface:        #FFFFFF;
  --surface-soft:   #F6F6F7;
  --surface-hover:  #F4F4F5;
  --border:         #E8E8EA;
  --border-strong:  #D4D4D8;

  /* Text */
  --text:           #18181B;
  --text-muted:     #71717A;

  /* Sidebar（mono = 白地・黒文字。他テーマは各 data-theme で暗色に上書き） */
  --sidebar-bg:        #FFFFFF;
  --sidebar-text:      rgba(24,24,27,0.58);
  --sidebar-hover:     rgba(24,24,27,0.05);
  --sidebar-active:    rgba(24,24,27,0.07);
  --sidebar-accent:    #18181B;
  --sidebar-border:    #E8E8EA;
  --sidebar-footer-bg: #FAFAFA;
  --sidebar-name:      #18181B;
  --sidebar-muted:     rgba(24,24,27,0.42);
  --sidebar-w:         228px;

  /* Topbar */
  --topbar-bg:      rgba(255,255,255,0.92);

  /* Login（モノクロのチャコール〜黒） */
  --login-bg-top:   #18181B;
  --login-bg-mid:   #0C0C0E;
  --login-bg-bot:   #000000;

  /* Shadows */
  --shadow-sm:   0 1px 2px rgba(24,24,27,0.05);
  --shadow-md:   0 4px 12px rgba(24,24,27,0.07);
  --shadow-lg:   0 8px 24px rgba(24,24,27,0.10);
  --card-shadow: rgba(24,24,27,0.06);

  /* Scrollbar */
  --scrollbar-thumb:       #D4D4D8;
  --scrollbar-thumb-hover: #A1A1AA;

  /* AI panel（無彩色トーン） */
  --ai-panel-start:  #F6F6F7;
  --ai-panel-end:    #FFFFFF;
  --ai-panel-border: #E8E8EA;
  --ai-result-bg:    #FFFFFF;

  /* Misc */
  --overlay: rgba(0,0,0,0.45);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Typography */
  --font-body:    'Inter', 'Noto Sans JP', 'Hiragino Sans', sans-serif;
  --font-display: 'Inter', 'Noto Sans JP', sans-serif;
  --font-brand:   'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --leading-tight: 1.2;
  --leading-copy:  1.7;
  --tracking-label: 0.06em;
  --tracking-display: -0.03em;
}

/* ======== テーマ切替（背景と無彩色トーンのみ。意味色は共通） ========
   app.js が body[data-theme] / [data-theme-variant] を付与する。
   既定は mono（= :root と同値）。 */

/* モノクロ（既定）— :root と一致させ、明示指定でも崩れないように */
body[data-theme="mono"] {
  --primary-rgb: 24,24,27;
  --primary: rgb(var(--primary-rgb));
  --primary-dark: #000000;
  --primary-light: #F4F4F5;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-soft: #F6F6F7;
  --surface-hover: #F4F4F5;
  --border: #E8E8EA;
  --border-strong: #D4D4D8;
  --text: #18181B;
  --text-muted: #71717A;
  --sidebar-bg: #FFFFFF;
  --sidebar-text: rgba(24,24,27,0.58);
  --sidebar-hover: rgba(24,24,27,0.05);
  --sidebar-active: rgba(24,24,27,0.07);
  --sidebar-accent: #18181B;
  --sidebar-border: #E8E8EA;
  --sidebar-footer-bg: #FAFAFA;
  --sidebar-name: #18181B;
  --sidebar-muted: rgba(24,24,27,0.42);
  --login-bg-top: #18181B;
  --login-bg-mid: #0C0C0E;
  --login-bg-bot: #000000;
}

/* アイボリー — 暖色のニュートラル */
body[data-theme="ivory"] {
  --primary-rgb: 41,35,30;
  --primary: rgb(var(--primary-rgb));
  --primary-dark: #1A1612;
  --primary-light: #F3ECE3;
  --bg: #FBF8F3;
  --surface: #FFFFFF;
  --surface-soft: #FAF5EE;
  --surface-hover: #F4ECE1;
  --border: #ECE3D6;
  --border-strong: #D9CCBA;
  --text: #2A231E;
  --text-muted: #8A7F71;
  --sidebar-bg: #F6EFE5;
  --sidebar-text: rgba(42,35,30,0.58);
  --sidebar-hover: rgba(42,35,30,0.05);
  --sidebar-active: rgba(42,35,30,0.08);
  --sidebar-accent: #2A231E;
  --sidebar-border: #E6DAC9;
  --sidebar-footer-bg: #F0E7DA;
  --sidebar-name: #2A231E;
  --sidebar-muted: rgba(42,35,30,0.42);
  --scrollbar-thumb: #D9CCBA;
  --scrollbar-thumb-hover: #B7A88F;
  --login-bg-top: #2A231E;
  --login-bg-mid: #181310;
  --login-bg-bot: #000000;
}

/* ライトグレー — 寒色のニュートラル */
body[data-theme="mist"] {
  --primary-rgb: 31,41,51;
  --primary: rgb(var(--primary-rgb));
  --primary-dark: #11181F;
  --primary-light: #EAEEF2;
  --bg: #F1F3F5;
  --surface: #FFFFFF;
  --surface-soft: #F3F5F7;
  --surface-hover: #E9EDF1;
  --border: #DEE3E8;
  --border-strong: #C5CDD5;
  --text: #1F2933;
  --text-muted: #6B7682;
  --sidebar-bg: #E8ECF0;
  --sidebar-text: rgba(31,41,51,0.58);
  --sidebar-hover: rgba(31,41,51,0.05);
  --sidebar-active: rgba(31,41,51,0.08);
  --sidebar-accent: #1F2933;
  --sidebar-border: #D7DDE3;
  --sidebar-footer-bg: #E1E6EB;
  --sidebar-name: #1F2933;
  --sidebar-muted: rgba(31,41,51,0.42);
  --scrollbar-thumb: #C5CDD5;
  --scrollbar-thumb-hover: #9AA5B0;
  --login-bg-top: #2B333B;
  --login-bg-mid: #161B20;
  --login-bg-bot: #000000;
}

/* チョコミント — ミントの空気感にダークブラウンのインク */
body[data-theme="mono"][data-theme-variant="chocomint"] {
  --primary-rgb: 122,74,52;        /* ミルクチョコ：はっきり茶色に見える */
  --primary: rgb(var(--primary-rgb));
  --primary-dark: #5C3826;
  --primary-light: #C9EDE1;
  --bg: #CDEFE3;                   /* はっきりしたミント */
  --surface: #ECFAF4;
  --surface-soft: #DBF4EA;
  --surface-hover: #C8EDDF;
  --border: #A6DECC;
  --border-strong: #7CCFB7;
  --text: #41271A;                 /* 温かいダークチョコ（黒に見えない） */
  --text-muted: #7A5A48;
  --sidebar-bg: #ABE6D2;           /* 濃いめミント */
  --sidebar-text: rgba(65,39,26,0.64);
  --sidebar-hover: rgba(65,39,26,0.07);
  --sidebar-active: rgba(65,39,26,0.13);
  --sidebar-accent: #5C3826;       /* チョコ */
  --sidebar-border: #88D6C0;
  --sidebar-footer-bg: #9CE0CB;
  --sidebar-name: #41271A;
  --sidebar-muted: rgba(65,39,26,0.52);
  --scrollbar-thumb: #7CCFB7;
  --scrollbar-thumb-hover: #4FBC9F;
  --login-bg-top: #41271A;
  --login-bg-mid: #241510;
  --login-bg-bot: #000000;
}

/* Dr.Pepper — 深いマルーン×クリームのクリーンな配色 */
body[data-theme="pepper"] {
  --primary-rgb: 139,30,45;        /* マルーン */
  --primary: rgb(var(--primary-rgb));
  --primary-dark: #6E1423;
  --primary-light: #F7E2E1;
  --bg: #FBF4F2;                   /* 温かいクリーム */
  --surface: #FFFFFF;
  --surface-soft: #FAEEEB;
  --surface-hover: #F5E4E1;
  --border: #EED9D5;
  --border-strong: #DDBFBA;
  --text: #2C1417;                 /* 赤みのあるダーク */
  --text-muted: #8A666A;
  --sidebar-bg: #F3E2E0;           /* 淡いブラッシュ */
  --sidebar-text: rgba(44,20,23,0.6);
  --sidebar-hover: rgba(139,30,45,0.07);
  --sidebar-active: rgba(139,30,45,0.13);
  --sidebar-accent: #8B1E2D;       /* マルーン：ロゴ・アクティブ */
  --sidebar-border: #E5CBC8;
  --sidebar-footer-bg: #EDD6D3;
  --sidebar-name: #2C1417;
  --sidebar-muted: rgba(44,20,23,0.46);
  --scrollbar-thumb: #DDBFBA;
  --scrollbar-thumb-hover: #C49A95;
  --login-bg-top: #6E1423;
  --login-bg-mid: #450C16;
  --login-bg-bot: #000000;
}

/* ======== リセット ======== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: var(--leading-copy);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
}

p, li, td { line-height: 1.65; }

/* iOS セーフエリア */
@supports (padding: env(safe-area-inset-bottom)) {
  .sidebar { padding-bottom: env(safe-area-inset-bottom); }
  .content { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .login-wrapper { padding-bottom: env(safe-area-inset-bottom); }
}

/* ======== スクロールバー ======== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* ======== ログイン ======== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 72% 0%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 15% 100%, rgba(255,255,255,0.05) 0%, transparent 46%),
    linear-gradient(160deg, var(--login-bg-top) 0%, var(--login-bg-mid) 55%, var(--login-bg-bot) 100%);
}

.login-card {
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 40px;
  width: min(380px, calc(100vw - 32px));
  box-shadow: 0 24px 64px rgba(0,0,0,0.40);
}

.brand-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

/* Dr.Piper ロゴ — Dr.Pepper 風のイタリック・セリフ・ロックアップ（無彩色） */
.brand-lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  color: var(--text);
}

.brand-prefix {
  font-family: var(--font-brand);
  font-size: 0.62em;
  font-style: italic;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: inherit;
  transform: translateY(-0.18em);
}

.brand-wordmark {
  font-family: var(--font-brand);
  font-style: italic;
  font-weight: 700;
  font-size: 1em;
  letter-spacing: -0.03em;
  color: inherit;
}

/* ログイン：大きく、テキスト色のインク */
.brand-lockup-login { font-size: 52px; color: var(--text); }

/* サイドバー：明色のインクで反転 */
.brand-lockup-sidebar {
  font-size: 40px;
  color: var(--sidebar-accent);
}
.brand-lockup-sidebar .brand-wordmark { color: var(--sidebar-accent); }
.brand-lockup-sidebar .brand-prefix { color: var(--sidebar-muted); }

.brand-panel .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-align: center;
}

.brand-panel-login .subtitle {
  margin-top: 6px;
}

.login-card .form-group {
  margin-bottom: 16px;
}

/* ======== レイアウト ======== */
.app {
  display: flex;
  min-height: 100vh;
}

/* サイドバー */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-logo p {
  font-size: 10px;
  font-weight: 600;
  color: var(--sidebar-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 4px;
}

.sidebar nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 9px 12px;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  user-select: none;
  -webkit-user-select: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-accent);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-accent);
  font-weight: 700;
}

.nav-item .icon,
.nav-item .nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar-footer-bg);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-copy { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--sidebar-name);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-status {
  font-size: 10px;
  color: var(--sidebar-muted);
  margin-top: 1px;
}
.sidebar-user-logout {
  color: var(--sidebar-muted) !important;
  padding: 4px !important;
}

/* メインエリア */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.topbar-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: var(--tracking-display);
}

.topbar-title-stack {
  display: grid;
  gap: 1px;
}

.topbar-subtitle {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content {
  padding: 28px;
  flex: 1;
  min-width: 0;
}

.mobile-nav-toggle { display: none; padding: 6px 10px; font-size: 18px; line-height: 1; }
.mobile-sidebar-backdrop { display: none; }

/* ======== フォーム ======== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.14s, box-shadow 0.14s;
  font-family: inherit;
  min-height: 40px;
}
input::placeholder { color: var(--text-muted); opacity: 0.6; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.12);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }

.input-search {
  padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 13px center;
}

.form-check-row { margin-bottom: 12px; }
.form-check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.form-check-label input[type="checkbox"] { width: 15px; height: 15px; margin: 0; }

.static-field {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

/* ======== ボタン ======== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.14s;
  font-family: inherit;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: color-mix(in srgb, var(--primary) 76%, #ffffff);
  color: white;
  border-color: transparent;
  box-shadow: none;
}
.btn-primary:hover {
  background: var(--primary);
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #DC2626; }

.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* ======== カード ======== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
}

.card-header {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  color: var(--text);
}

.card-header-titles { display: grid; gap: 2px; }
.card-body { padding: 18px; }

.section-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ======== テーブル ======== */
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

table { width: 100%; border-collapse: collapse; }
th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  background: var(--surface-soft);
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
}
tr:last-child td { border-bottom: none; }
tr { transition: background 0.1s; }
tr:hover td { background: var(--surface-hover); }
.clickable-row { cursor: pointer; }

/* ======== バッジ ======== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-purple { background: #EDE9FE; color: #5B21B6; }
.badge-gray   { background: #F1F5F9; color: #475569; }
.badge-orange { background: #FFEDD5; color: #9A3412; }
.badge-gold   { background: #FEF9C3; color: #854D0E; }

/* フェーズバッジ */
.phase-0 { background: #F1F5F9; color: #475569; }
.phase-1 { background: #FFEDD5; color: #9A3412; }
.phase-2 { background: #FEF3C7; color: #92400E; }
.phase-3 { background: #FEF3C7; color: #92400E; }
.phase-4 { background: #EDE9FE; color: #5B21B6; }
.phase-5 { background: #D1FAE5; color: #065F46; }
.phase-6 { background: #DBEAFE; color: #1D4ED8; }
.phase-7 { background: #FEE2E2; color: #991B1B; }
.phase-8 { background: #D1FAE5; color: #065F46; }

/* ======== タブ ======== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.14s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

.inline-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.inline-tab {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.12s;
}
.inline-tab:hover { color: var(--text); border-color: var(--border-strong); }
.inline-tab.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(var(--primary-rgb),0.3);
}
.inline-tab .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}
.inline-tab.active .tab-count {
  background: rgba(var(--primary-rgb),0.2);
  color: var(--primary);
}
.inline-tab .tab-count--urgent {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
}

/* ======== KPI / 統計カード ======== */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  min-width: 0;
}
.stat-card .label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.stat-card .value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.04em;
}
.stat-card .sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.stat-card.accent   { border-left: 3px solid var(--primary); }
.stat-card.success  { border-left: 3px solid var(--success); }
.stat-card.danger   { border-left: 3px solid var(--danger);  }
.stat-card.warning  { border-left: 3px solid var(--warning); }
.stat-card.highlight{ border-left: 3px solid var(--primary); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* アラート系 */
.stat-card--alert-high { border-top: 3px solid var(--danger); }
.stat-card--alert-high .value { color: var(--danger); }
.stat-card--alert-mid  { border-top: 3px solid var(--warning); }
.stat-card--alert-mid .value  { color: var(--warning); }
.stat-card--alert-safe { border-top: 3px solid var(--success); }
.stat-card--alert-safe .value { color: var(--success); }
.stat-card--alert-safe .label { color: var(--success); }

/* ======== ダッシュボード ======== */
.dashboard-shell { display: grid; gap: 16px; }

.dashboard-hero {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 24px 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #FFFFFF 60%);
  overflow: hidden;
}
.dashboard-hero::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb),0.08) 0%, transparent 70%);
  pointer-events: none;
}
.dashboard-hero-copy { position: relative; z-index: 1; }
.dashboard-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid rgba(var(--primary-rgb),0.2);
  background: rgba(var(--primary-rgb),0.08);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.dashboard-hero h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: var(--tracking-display);
  color: var(--text);
  line-height: 1.15;
}
.dashboard-hero p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 480px;
}

.dashboard-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.dashboard-kpi-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-kpi-row--hero {
  margin-bottom: 0;
}

.dashboard-main-split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.dashboard-insight-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.dashboard-bottom-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.dashboard-feed-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.dashboard-triple-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.dashboard-overview-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.dashboard-overview-stack { display: grid; gap: 16px; min-width: 0; }
.dashboard-reason-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pipeline-closed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dashboard-overview-grid > *, .dashboard-triple-grid > *, .dashboard-feed-grid > *, .pipeline-closed-grid > * { min-width: 0; }

.dashboard-feed-body { padding: 12px; max-height: 760px; overflow: auto; }
.dashboard-feed-body--tall  { max-height: 520px; }
.dashboard-feed-body--short { max-height: 360px; }
.dashboard-important-body { padding: 12px; max-height: 360px; overflow: auto; }
.dashboard-table-wrap { max-height: 360px; overflow: auto; }
.dashboard-reason-body { padding: 12px 16px; }

/* アラートrow */
.dashboard-alert-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.dashboard-alert-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: box-shadow 0.14s, transform 0.1s;
}
.dashboard-alert-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.dashboard-alert-icon { font-size: 26px; flex-shrink: 0; }
.dashboard-alert-body { min-width: 0; }
.dashboard-alert-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.dashboard-alert-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 2px;
}
.dashboard-alert-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.alert-high .dashboard-alert-value { color: var(--danger); }
.alert-high { border-top: 3px solid var(--danger); }
.alert-mid .dashboard-alert-value { color: var(--warning); }
.alert-mid { border-top: 3px solid var(--warning); }
.alert-safe .dashboard-alert-value { color: var(--success); }
.alert-safe { border-top: 3px solid var(--success); }

/* reason */
.reason-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.reason-row:last-child { border-bottom: none; }
.reason-row-button {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
  padding: 6px 8px;
  border-radius: 6px;
}
.reason-row-button:hover { background: var(--surface-soft); }
.reason-label { color: var(--text); }
.reason-count { color: var(--text-muted); font-weight: 700; white-space: nowrap; }

/* シグナルセクション */
.dashboard-signal-section {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.dashboard-signal-section .card-header {
  border-bottom: 1px solid var(--border);
}
.dashboard-signal-section .card-header h3 { color: var(--text); }
.dashboard-signal-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

/* 最近の活動グリッド */
.dashboard-recent-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 8px;
  max-height: 480px;
  overflow: auto;
}

/* ======== タイムライン ======== */
.timeline { position: relative; }
.timeline-date-group { margin-bottom: 20px; }
.timeline-date-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.timeline-date-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: box-shadow 0.14s;
}
.timeline-item:hover { box-shadow: var(--shadow-md); }
.timeline-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.type-teleapo     .timeline-icon { background: #FFEDD5; color: #C2410C; }
.type-deal_created .timeline-icon { background: #D1FAE5; color: #065F46; }
.type-phase_change .timeline-icon { background: #D1FAE5; color: #065F46; }
.type-signal      .timeline-icon { background: #FEF3C7; color: #92400E; }
.type-meeting     .timeline-icon { background: #EDE9FE; color: #5B21B6; }
.type-email       .timeline-icon { background: #DBEAFE; color: #1D4ED8; }
.type-note        .timeline-icon { background: #F1F5F9; color: #475569; }

.timeline-body { flex: 1; min-width: 0; }
.timeline-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; line-height: 1.4; color: var(--text); }
.timeline-content { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.timeline-meta { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); margin-top: 4px; flex-wrap: wrap; }
.timeline-company {
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}
.timeline-company:hover { text-decoration: underline; }

.timeline-row-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.timeline-row-main { display: grid; gap: 4px; min-width: 0; }
.timeline-row-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.timeline-delete-btn {
  padding: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 5px;
  transition: background 0.12s, color 0.12s;
}
.timeline-delete-btn:hover { background: #FEE2E2; color: var(--danger); }

/* シグナルタイムライン */
.timeline-item--signal {
  flex-direction: column;
  border-left: 3px solid var(--primary);
}
.timeline-item--signal-new { border-left-color: var(--danger); }
.timeline-signal-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.timeline-signal-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.timeline-signal-company { font-size: 12px; font-weight: 600; color: var(--primary); }
.timeline-signal-body { padding-bottom: 4px; }
.timeline-signal-title { font-size: 15px; font-weight: 700; line-height: 1.35; letter-spacing: -0.02em; color: var(--text); }
.timeline-signal-content { margin-top: 6px; font-size: 13px; line-height: 1.65; color: var(--text-muted); max-height: 3.9em; overflow: hidden; }
.timeline-signal-action { display: flex; gap: 8px; margin-top: 10px; }

/* ======== シグナル ======== */
.signal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.signal-card-spotlight {
  border-color: var(--border);
  border-left: 3px solid var(--text);
  background: var(--surface);
}
.signal-card-spotlight .timeline-company { font-size: 16px; }

.signal-hot-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.signal-hot-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}
.signal-hot-badge--new  { background: #FEE2E2; color: #991B1B; border: 1px solid rgba(239,68,68,0.2); }
.signal-hot-badge--deal { background: #D1FAE5; color: #065F46; border: 1px solid rgba(16,185,129,0.2); }

.signal-approach-box {
  background: var(--surface-soft);
  border-left: 2px solid var(--border-strong);
  border-radius: 0 6px 6px 0;
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
}
.signal-approach-box-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

/* シグナルページリスト */
.signal-list--panel { display: grid; gap: 0; }
.signal-list--table { display: block; }
.signal-list-header {
  display: grid;
  grid-template-columns: 100px minmax(180px, 1.2fr) minmax(280px, 2fr) 100px 80px 130px;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-soft);
}
.signal-row {
  display: grid;
  grid-template-columns: 100px minmax(180px, 1.2fr) minmax(280px, 2fr) 100px 80px 130px;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.signal-row:hover { background: var(--surface-hover); }
.signal-row-type, .signal-row-date { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.signal-row-company {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  line-height: 1.3;
}
.signal-row-company:hover { text-decoration: underline; }
.signal-row-company--static { font-size: 14px; font-weight: 700; color: var(--text); }
.signal-row-title { font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--text); }
.signal-row-status { display: flex; align-items: center; }
.signal-row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.signal-date-group { margin-bottom: 0; }
.signal-date-header {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

/* シグナルステータスバッジ */
.signal-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  background: #F1F5F9;
  color: var(--text-muted);
}
.signal-status-badge--new { background: #FEE2E2; color: #991B1B; }
.signal-status-badge--responded { background: #D1FAE5; color: #065F46; }
.signal-status-badge--skipped  { background: #F1F5F9; color: #94A3B8; }
.signal-respond-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.12s;
}
.signal-respond-btn:hover { border-color: var(--primary); color: var(--primary); }

/* シグナルページカード（sigpage） */
.sigpage-card {
  display: flex;
  gap: 14px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.sigpage-card:hover { background: var(--surface-hover); }
.sigpage-card--new { border-left: 3px solid var(--danger); }
.sigpage-card-left { display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.sigpage-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.sigpage-card-body { flex: 1; min-width: 0; }
.sigpage-card-meta-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.sigpage-card-type {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: #F1F5F9;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}
.sigpage-card-company { font-size: 12px; font-weight: 600; color: var(--primary); }
.sigpage-card-date    { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.sigpage-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
}
.sigpage-card-summary { font-size: 13px; color: var(--text-muted); margin-top: 4px; line-height: 1.6; }
.sigpage-card-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ======== パイプライン ======== */
.pipeline-view-switch { display: flex; gap: 6px; margin-bottom: 12px; align-items: center; }
.pipeline-kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(236px, 1fr));
  gap: 12px;
  padding: 0;
  overflow-x: auto;
  align-items: start;
}
.pipeline-column {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  display: grid;
  gap: 0;
  align-content: start;
  min-width: 0;
  overflow: hidden;
}
.pipeline-column[data-phase="0"] { border-top: 3px solid #94A3B8; }
.pipeline-column[data-phase="1"] { border-top: 3px solid #F97316; }
.pipeline-column[data-phase="2"] { border-top: 3px solid #EAB308; }
.pipeline-column[data-phase="3"] { border-top: 3px solid #F59E0B; }
.pipeline-column[data-phase="4"] { border-top: 3px solid #A855F7; }
.pipeline-column[data-phase="5"] { border-top: 3px solid #10B981; }
.pipeline-column[data-phase="6"] { border-top: 3px solid #3B82F6; }
.pipeline-column[data-phase="7"] { border-top: 3px solid #EF4444; }
.pipeline-column[data-phase="8"] { border-top: 3px solid #059669; }

.pipeline-column-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
  position: sticky;
  top: 0;
  z-index: 1;
}
.pipeline-column[data-phase="0"] .pipeline-column-header { background: #F8FAFC; }
.pipeline-column[data-phase="1"] .pipeline-column-header { background: #FFF7ED; }
.pipeline-column[data-phase="2"] .pipeline-column-header { background: #FEFCE8; }
.pipeline-column[data-phase="3"] .pipeline-column-header { background: #FFFBEB; }
.pipeline-column[data-phase="4"] .pipeline-column-header { background: #FAF5FF; }
.pipeline-column[data-phase="5"] .pipeline-column-header { background: #F0FDF4; }
.pipeline-column[data-phase="6"] .pipeline-column-header { background: #EFF6FF; }
.pipeline-column[data-phase="7"] .pipeline-column-header { background: #FFF5F5; }
.pipeline-column[data-phase="8"] .pipeline-column-header { background: #F0FDF4; }

.pipeline-column-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pipeline-column-count {
  min-width: 24px;
  height: 22px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 6px;
}
.pipeline-column-body {
  display: grid;
  gap: 0;
  align-content: start;
  min-width: 0;
  padding: 6px;
}
.pipeline-column-empty {
  padding: 20px 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
.pipeline-kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
  cursor: grab;
  margin: 3px 0;
  transition: box-shadow 0.14s, transform 0.1s;
}
.pipeline-kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pipeline-kanban-card.dragging { opacity: 0.4; cursor: grabbing; box-shadow: none; }
.pipeline-column-body.drag-over {
  background: rgba(var(--primary-rgb),0.06);
  outline: 2px dashed rgba(var(--primary-rgb),0.3);
  outline-offset: -3px;
  border-radius: 8px;
}
.pipeline-kanban-card[data-health="good"] { border-left: 3px solid var(--success); }
.pipeline-kanban-card[data-health="watch"] { border-left: 3px solid var(--warning); }
.pipeline-kanban-card[data-health="risk"]  { border-left: 3px solid var(--danger); }
.pipeline-kanban-card--risk {
  border-color: var(--border) !important;
  border-left: 3px solid var(--danger) !important;
}
.pipeline-kanban-card--risk .pipeline-kanban-company { color: var(--danger); }

.pipeline-kanban-head { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.pipeline-kanban-company {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  min-width: 0;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pipeline-kanban-company:hover { text-decoration: underline; }
.pipeline-kanban-deal { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.4; overflow-wrap: anywhere; }
.pipeline-kanban-meta, .pipeline-kanban-dates { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--text-muted); align-items: center; }
.pipeline-kanban-step { font-size: 12px; color: var(--text); line-height: 1.5; padding: 8px 10px; background: var(--surface-soft); border-radius: 6px; overflow-wrap: anywhere; }
.pipeline-kanban-actions { display: flex; justify-content: flex-end; }

.pipeline-dates { display: grid; gap: 4px; }
.pipeline-date-row { display: grid; grid-template-columns: 52px 1fr; gap: 6px; align-items: center; font-size: 12px; }
.pipeline-date-label { color: var(--text-muted); font-size: 11px; }
.pipeline-date-row.is-today   { color: var(--warning); font-weight: 700; }
.pipeline-date-row.is-overdue { color: var(--danger);  font-weight: 700; }

.meeting-today    td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.meeting-overdue  td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.pipeline-risk-row td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

/* ======== テレアポ ======== */
.teleapo-list-header {
  display: grid;
  grid-template-columns: 80px minmax(200px, 1.6fr) 90px 80px 100px 110px minmax(160px, 1fr) 50px;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--surface-soft);
}
.teleapo-list { display: block; }
.teleapo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.teleapo-row:hover { background: var(--surface-hover); }
.teleapo-row-main { display: grid; gap: 5px; min-width: 0; }
.teleapo-row-main--inline {
  grid-template-columns: 80px minmax(200px, 1.6fr) 90px 80px 100px 110px minmax(160px, 1fr);
  align-items: center;
  gap: 10px;
}
.teleapo-row-company {
  min-width: 0;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teleapo-row-company:hover { color: var(--primary); text-decoration: underline; }
.teleapo-row-status, .teleapo-row-assignee, .teleapo-row-date, .teleapo-row-progress {
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.teleapo-row-progress--inline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teleapo-row-side { display: flex; justify-content: flex-end; }
.teleapo-row-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.teleapo-row-status, .teleapo-row-assignee { font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* ======== 企業マスター ======== */
.company-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.company-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  flex-shrink: 0;
}
.company-info h2 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 6px;
}
.company-meta { display: flex; gap: 14px; flex-wrap: wrap; }
.company-meta-item { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }

/* ディレクトリリスト */
.company-directory-head {
  display: grid;
  grid-template-columns: 90px minmax(180px, 1.4fr) 140px 210px minmax(200px, 1fr) 58px;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--surface-soft);
}
.company-directory-list { display: block; }
.company-directory-row {
  display: grid;
  grid-template-columns: 90px minmax(180px, 1.4fr) 140px 210px minmax(200px, 1fr) 58px;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.company-directory-row:hover { background: var(--surface-hover); }
.company-directory-name {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.company-directory-phone,
.company-directory-email,
.company-directory-address {
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.company-directory-email a { color: inherit; }
.company-directory-actions { display: flex; justify-content: flex-end; }

/* ======== マイページ ======== */
.mypage-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.mypage-column-card { min-width: 0; }
.mypage-column-body {
  max-height: 760px;
  overflow: auto;
  padding: 12px;
}
.mypage-column-body .inline-tabs {
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  padding-bottom: 8px;
}
.mypage-stack { display: grid; gap: 10px; }

.mypage-mobile-tabs { display: none; }
.mypage-column-card { display: block; }

/* ======== 設定 ======== */
.settings-shell { max-width: 1200px; }
.settings-tabs { margin-bottom: 16px; }
.settings-grid { display: grid; gap: 20px; }
.settings-grid-personal { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.settings-grid-stack { grid-template-columns: minmax(0, 1fr); }
.settings-grid .card { min-width: 0; }
.settings-grid table { min-width: 720px; }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.theme-option {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.14s;
}
.theme-option:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.theme-option.active { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.15); }
.theme-option strong { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; }
.theme-option span { display: block; font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.theme-swatches { display: flex; gap: 5px; margin-bottom: 10px; }
.theme-swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.4); box-shadow: 0 0 0 1px rgba(0,0,0,0.08); }

.template-editor-stack { display: grid; gap: 14px; }
.template-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
}
.template-section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.template-list { display: grid; gap: 10px; }
.template-item { border: 1px solid var(--border); border-radius: 8px; padding: 13px; background: var(--surface); }
.template-item-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.template-item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.template-content-textarea { min-height: 110px; resize: vertical; }

.table-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ======== AI ======== */
.ai-panel {
  background: linear-gradient(135deg, var(--ai-panel-start), var(--ai-panel-end));
  border: 1px solid var(--ai-panel-border);
  border-radius: 10px;
  padding: 16px;
}
.ai-panel h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.ai-result {
  background: var(--ai-result-bg);
  border-radius: 6px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  border: 1px solid var(--border);
  max-height: 400px;
  overflow-y: auto;
}
.ai-result h2, .ai-result h3, .ai-result h4 { color: var(--primary); margin-top: 10px; margin-bottom: 4px; }
.ai-result strong { color: var(--text); }
.ai-result-shell { display: grid; gap: 12px; }
.ai-result-topline { display: flex; justify-content: flex-start; }
.ai-result-block { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.ai-result-label { font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.04em; margin-bottom: 6px; text-transform: uppercase; }
.ai-result-copy { font-size: 14px; line-height: 1.7; color: var(--text); }
.ai-action-list { display: grid; gap: 8px; }
.ai-action-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--surface); }
.ai-action-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 6px; }
.ai-action-title { font-weight: 700; color: var(--primary); }
.ai-result-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text); }
.ai-raw-details summary { cursor: pointer; color: var(--primary); font-size: 12px; font-weight: 700; }
.ai-draft-line { display: grid; gap: 6px; }
.ai-draft-label { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.ai-draft-value { font-size: 14px; font-weight: 600; color: var(--text); }
.ai-draft-textarea-wrap { display: grid; gap: 6px; }
.ai-draft-textarea { width: 100%; min-height: 160px; resize: vertical; border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--surface); font: inherit; color: var(--text); line-height: 1.7; }

/* ======== ヘルス ======== */
.badge-health-good  { background: #D1FAE5; color: #065F46; }
.badge-health-watch { background: #FEF3C7; color: #92400E; }
.badge-health-risk  { background: #FEE2E2; color: #991B1B; }
.health-row { display: flex; align-items: baseline; gap: 8px; }
.health-score { font-size: 20px; font-weight: 800; line-height: 1; }
.health-good  { color: #065F46; }
.health-watch { color: #92400E; }
.health-risk  { color: #991B1B; }
.health-label { font-size: 13px; font-weight: 700; color: var(--text); }
.health-reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.health-reason-chip { padding: 3px 8px; border-radius: 5px; background: var(--surface-soft); border: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }
.health-badge-button { border: none; cursor: pointer; }
.health-detail-link { margin-left: auto; background: transparent; border: none; color: var(--primary); font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; }
.pipeline-health-cell { display: grid; gap: 3px; justify-items: start; min-width: 80px; }
.pipeline-health-summary { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.health-breakdown-list { display: grid; gap: 6px; }
.health-breakdown-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); }
.health-breakdown-row:last-child { border-bottom: none; }
.health-breakdown-label { font-size: 13px; color: var(--text); }
.health-breakdown-delta { font-size: 13px; font-weight: 800; }
.health-breakdown-delta.is-plus  { color: #065F46; }
.health-breakdown-delta.is-minus { color: #991B1B; }
.card-subsection-health { background: var(--surface-soft); }

/* ======== ステータスバー ======== */
.stat-bar-container { display: grid; gap: 6px; margin-top: 8px; }
.stat-bar-row {
  display: grid;
  grid-template-columns: 52px 1fr 28px;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}
.stat-bar-label { color: var(--text-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-bar-track { height: 5px; border-radius: 999px; background: var(--border); overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.stat-bar-fill--good  { background: var(--success); }
.stat-bar-fill--watch { background: var(--warning); }
.stat-bar-fill--risk  { background: var(--danger); }
.stat-bar-fill--phase { background: var(--primary); }
.stat-bar-count { font-size: 11px; font-weight: 700; color: var(--text); text-align: right; }

.stat-bar-fill--phase-0 { background: #94A3B8; }
.stat-bar-fill--phase-1 { background: #F97316; }
.stat-bar-fill--phase-2 { background: #EAB308; }
.stat-bar-fill--phase-3 { background: #F59E0B; }
.stat-bar-fill--phase-4 { background: #A855F7; }
.stat-bar-fill--phase-5 { background: #10B981; }
.stat-bar-fill--phase-6 { background: #3B82F6; }
.stat-bar-fill--phase-7 { background: #EF4444; }
.stat-bar-fill--phase-8 { background: #059669; }

/* ======== カードバリアント ======== */
.card--urgent  { border-left: 3px solid var(--danger);  background: var(--surface); }
.card--warning { border-left: 3px solid var(--warning); background: var(--surface); }
.card--priority{ border-left: 3px solid var(--primary); }
.card--signal  { border-left: 3px solid var(--info); background: var(--surface); }
.card--safe    { border-left: 3px solid var(--success); background: var(--surface); }

/* 緊急ラベル：塗りつぶしをやめ、小さな色付きテキスト＋ドットだけで示す */
.card-urgency-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.card-urgency-banner::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.card-urgency-banner--urgent  { color: var(--danger); }
.card-urgency-banner--warning { color: var(--warning); }
.card-urgency-banner--ok      { color: var(--success); }

.priority-card { box-shadow: none; }
.todo-card-done { opacity: 0.85; }

/* ======== info-chip ======== */
.info-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  min-height: 26px;
}
.info-chip-label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.info-chip-value { font-size: 12px; color: var(--text); font-weight: 700; }

/* ======== card-action-row ======== */
.card-action-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.card-subsection { display: grid; gap: 4px; }
.card-subsection-title {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card-subsection-body { font-size: 13px; color: var(--text); line-height: 1.65; }
.card-subsection-signal { padding: 6px 10px; border-radius: 6px; background: var(--surface-soft); }
.priority-suggestion {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface-soft);
  border-radius: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
}

/* ======== ヘルスバッジドット ======== */
.badge-health-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}
.badge-health-dot--good  { background: var(--success); }
.badge-health-dot--watch { background: var(--warning); }
.badge-health-dot--risk  {
  background: var(--danger);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ======== 検索・フィルター ======== */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input { max-width: 280px; }
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}
.filter-panel-search { flex: 1; max-width: 440px; position: relative; }
.filter-panel-search input {
  padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  min-height: 38px;
}
.filter-panel-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.filter-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}
.filter-panel-body {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: grid;
  gap: 10px;
  background: var(--surface-soft);
}
.filter-row { display: flex; align-items: flex-start; gap: 10px; }
.filter-row-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  padding-top: 5px;
  min-width: 48px;
}
.filter-chip-group { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.filter-chip.active { background: var(--primary-light); border-color: rgba(var(--primary-rgb),0.4); color: var(--primary); }
.filter-chip.active-good  { background: #F0FDF4; border-color: rgba(16,185,129,0.4); color: #065F46; }
.filter-chip.active-watch { background: #FFFBEB; border-color: rgba(245,158,11,0.4); color: #92400E; }
.filter-chip.active-risk  { background: #FFF5F5; border-color: rgba(239,68,68,0.4); color: #991B1B; }

/* クイック日付 */
.quick-date-group { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.quick-date-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.1s;
}
.quick-date-btn:hover { border-color: var(--primary); color: var(--primary); }
.quick-date-btn.active { background: var(--primary-light); border-color: rgba(var(--primary-rgb),0.4); color: var(--primary); }
.date-range-inputs { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.date-range-inputs input { min-height: 30px; padding: 3px 8px; font-size: 12px; }
.date-range-sep { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.filter-sub-inputs { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-sub-inputs input { flex: 1; min-width: 130px; min-height: 32px; padding: 4px 10px; font-size: 12px; }

/* ======== アクション ======== */
.stale-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}
.stale-label--fresh { color: var(--success); }
.stale-label--mild  { color: var(--warning); }
.stale-label--warn  { color: #EA580C; background: #FFF7ED; }
.stale-label--risk  { color: var(--danger); background: #FFF5F5; }

.cta-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border: 1.5px dashed var(--border);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  cursor: pointer;
  transition: all 0.1s;
}
.cta-inline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-quick-activity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-soft);
  cursor: pointer;
  transition: all 0.1s;
}
.btn-quick-activity:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ======== ナビバッジ ======== */
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  min-width: 18px;
  text-align: center;
}
.nav-badge--warning { background: var(--warning); }
.nav-badge--zero { background: var(--sidebar-hover); color: var(--sidebar-muted); }

/* ======== モーダル ======== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  border: 1px solid var(--border);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 15px; font-weight: 700; letter-spacing: var(--tracking-display); }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface-soft);
}
.draft-textarea { min-height: 240px; line-height: 1.7; }

.deal-editor-modal { max-width: 1060px; }
.deal-editor-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr); gap: 18px; align-items: start; }
.deal-editor-form { min-width: 0; }
.deal-editor-context { position: sticky; top: 0; align-self: start; }
.deal-editor-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}
.deal-editor-summary-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.deal-next-step-input { min-height: 70px; line-height: 1.6; }
.deal-context-panel { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); overflow: hidden; }
.deal-context-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.deal-context-header h4 { margin: 0; font-size: 14px; font-weight: 700; }
.deal-context-eyebrow { color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 2px; }
.deal-context-section { padding: 13px 16px; border-bottom: 1px solid var(--border); }
.deal-context-section:last-child { border-bottom: none; }
.deal-context-section-title { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.deal-context-item { padding: 9px 0; border-top: 1px dashed var(--border); }
.deal-context-item:first-of-type { border-top: none; padding-top: 0; }
.deal-context-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; }
.deal-context-title { font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--text); }
.deal-context-text { margin-top: 4px; font-size: 12px; line-height: 1.6; color: var(--text-muted); white-space: pre-wrap; }
.deal-context-item--signal { background: var(--surface-soft); border-radius: 8px; padding: 10px; margin-top: 6px; border: 1px solid var(--border); }
.weekly-actions-shell { display: grid; gap: 16px; }
.weekly-actions-hero { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; padding: 0 0 4px; }
.weekly-actions-hero h2 { margin: 0 0 4px; font-size: 18px; font-weight: 500; color: var(--text); }
.weekly-actions-hero p { margin: 0; color: var(--text-muted); line-height: 1.6; max-width: 720px; font-size: 13px; }
.weekly-actions-dates { display: grid; gap: 4px; text-align: right; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.weekly-actions-dates strong { color: var(--text); font-size: 13px; font-weight: 500; }
.weekly-actions-filter { margin: 0; }
.weekly-actions-board { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.weekly-actions-head { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(360px, 1.2fr) minmax(300px, .9fr); gap: 0; padding: 10px 16px; background: var(--surface-soft); border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.weekly-actions-rows { display: grid; }
.weekly-action-row { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(360px, 1.2fr) minmax(300px, .9fr); border-bottom: 1px solid var(--border); }
.weekly-action-row:last-child { border-bottom: none; }
.weekly-action-account, .weekly-action-context, .weekly-action-input { padding: 16px; min-width: 0; }
.weekly-action-account, .weekly-action-context { border-right: 1px solid var(--border); }
.weekly-action-company { font-size: 14px; font-weight: 500; cursor: pointer; color: var(--text); }
.weekly-action-company:hover { color: var(--info); }
.weekly-action-deal { margin-top: 4px; color: var(--text-muted); font-size: 13px; }
.weekly-action-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.weekly-progress { margin-top: 10px; padding: 10px; border-radius: 8px; background: var(--surface-soft); color: var(--text-muted); font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.weekly-context-group + .weekly-context-group { margin-top: 14px; }
.weekly-context-group-title { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.weekly-context-line { padding: 8px 0; border-bottom: 1px solid var(--border); }
.weekly-context-line:last-child { border-bottom: none; }
.weekly-context-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: 12px; margin-bottom: 3px; }
.weekly-context-title { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.45; }
.weekly-context-text { margin-top: 4px; color: var(--text-muted); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.weekly-action-input label { display: block; margin-bottom: 8px; font-size: 12px; color: var(--text-muted); }
.weekly-next-input { min-height: 138px; line-height: 1.6; resize: vertical; }
.weekly-action-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ======== グリッドレイアウト ======== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ======== ユーティリティ ======== */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 36px; margin-bottom: 10px; }
.error-msg   { color: var(--danger); font-size: 12px; margin-top: 4px; }
.success-msg { color: var(--success); font-size: 12px; }
.empty-state--mono { padding: 32px 0; text-align: center; color: var(--text-muted); }

/* ======== ローディング ======== */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248,250,252,0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ======== トースト ======== */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
  min-width: 220px;
}
.toast-success { background: #065F46; color: white; }
.toast-error   { background: #991B1B; color: white; }
.toast-info    { background: var(--primary); color: white; }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ======== 診察室 ======== */
.clinic-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.clinic-header-title { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: var(--tracking-display); }
.clinic-header-meta { display: flex; align-items: center; gap: 8px; }
.clinic-total-badge { background: var(--primary); color: white; border-radius: 6px; padding: 2px 10px; font-size: 12px; font-weight: 700; }

.clinic-layout { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: start; }
.clinic-group-list { display: flex; flex-direction: column; gap: 6px; }
.clinic-group-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s;
}
.clinic-group-card:hover { border-color: var(--primary); }
.clinic-group-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-sm);
}
.clinic-group-icon { font-size: 18px; flex-shrink: 0; }
.clinic-group-body { flex: 1; min-width: 0; }
.clinic-group-title { font-size: 13px; font-weight: 700; }
.clinic-group-sub   { margin-top: 1px; }
.clinic-group-count {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.clinic-group-card.active .clinic-group-count { background: var(--primary); border-color: var(--primary); color: white; }
.clinic-detail-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.clinic-detail-placeholder { padding: 48px; text-align: center; color: var(--text-muted); }
.clinic-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }

/* ======== モバイルカードリスト ======== */
.dash-meeting-mobile-list { display: none; flex-direction: column; gap: 6px; padding: 12px; }
.dmm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dmm-card--today { border-left: 3px solid var(--warning); }
.dmm-date   { font-size: 11px; font-weight: 700; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.dmm-company{ font-size: 13px; font-weight: 700; color: var(--primary); cursor: pointer; }
.dmm-deal   { font-size: 12px; color: var(--text-muted); }
.dmm-meta   { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.company-mobile-list { display: none; flex-direction: column; gap: 6px; padding: 12px; }
.cm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: background 0.1s;
}
.cm-card:active { background: var(--surface-hover); }
.cm-head  { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cm-name  { font-size: 14px; font-weight: 700; color: var(--primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-meta  { display: flex; flex-wrap: wrap; gap: 5px; }
.cm-meta-item { font-size: 12px; color: var(--text-muted); }

.user-mobile-list { display: none; flex-direction: column; gap: 6px; padding: 12px; }
.um-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.um-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.um-display-name { font-size: 14px; font-weight: 700; }
.um-username { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.um-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.um-actions { display: flex; gap: 5px; flex-wrap: wrap; }

.pipeline-mobile-list { display: none; flex-direction: column; gap: 8px; padding: 12px; }
.pl-mc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.pl-mc--risk { border-left: 3px solid var(--danger); }
.pl-mc-head    { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pl-mc-badges  { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pl-mc-company { font-size: 14px; font-weight: 700; color: var(--primary); cursor: pointer; line-height: 1.3; }
.pl-mc-deal    { font-size: 12px; color: var(--text-muted); margin-top: -3px; }
.pl-mc-meta    { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.pl-mc-meta-item { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 2px; }
.pl-mc-meta-item--overdue { color: var(--danger); font-weight: 600; }
.pl-mc-meta-item--today   { color: var(--warning); font-weight: 600; }
.pl-mc-step { background: var(--surface-soft); border-radius: 6px; padding: 7px 10px; display: flex; flex-direction: column; gap: 3px; }
.pl-mc-step-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.tp-mobile-list { display: none; flex-direction: column; gap: 8px; padding: 12px; }
.tp-mc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tp-mc-head     { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tp-mc-company  { font-size: 13px; font-weight: 700; color: var(--primary); cursor: pointer; flex: 1; line-height: 1.3; }
.tp-mc-meta     { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tp-mc-meta-item{ font-size: 12px; color: var(--text-muted); }
.tp-mc-progress { font-size: 12px; color: var(--text); background: var(--surface-soft); border-radius: 6px; padding: 6px 10px; line-height: 1.5; }

/* ======== アコーディオン ======== */
.accordion-trigger { display: none; }
@media (max-width: 768px) {
  .accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
  }
  .accordion-trigger-title { font-size: 13px; font-weight: 700; color: var(--text); }
  .accordion-trigger-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .accordion-chevron { font-size: 11px; color: var(--text-muted); transition: transform 0.22s; }
  .accordion-section.collapsed .accordion-chevron { transform: rotate(-90deg); }
  .accordion-section.collapsed .accordion-trigger { margin-bottom: 0; }
  .accordion-body { overflow: hidden; transition: max-height 0.32s ease; max-height: 5000px; }
  .accordion-section.collapsed .accordion-body { max-height: 0; }
}

/* ======== モバイル ======== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    z-index: 200;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 190;
    backdrop-filter: blur(2px);
  }
  .mobile-sidebar-backdrop.visible { display: block; }
  .mobile-nav-toggle { display: flex; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; height: 52px; }
  .topbar h1 { font-size: 15px; }
  .content { padding: 14px; }
  .dashboard-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dashboard-main-split,
  .dashboard-insight-row,
  .dashboard-bottom-row,
  .dashboard-feed-grid,
  .dashboard-triple-grid { grid-template-columns: 1fr; }
  .dashboard-overview-grid { grid-template-columns: 1fr; }
  .dashboard-alert-row { grid-template-columns: 1fr; }
  .mypage-columns { grid-template-columns: 1fr; }
  .deal-editor-layout { grid-template-columns: 1fr; }
  .weekly-actions-hero { flex-direction: column; align-items: flex-start; }
  .weekly-actions-dates { text-align: left; }
  .weekly-actions-head { display: none; }
  .weekly-action-row { grid-template-columns: 1fr; }
  .weekly-action-account, .weekly-action-context { border-right: none; border-bottom: 1px solid var(--border); }
  .pipeline-kanban { grid-template-columns: repeat(6, minmax(220px, 1fr)); }
  .pipeline-column-header { top: 52px; }
  .pipeline-table-col-assignee, .pipeline-table-col-step { display: none; }
  .company-mobile-list,
  .user-mobile-list,
  .pipeline-mobile-list,
  .dash-meeting-mobile-list,
  .tp-mobile-list { display: flex; }
  .mypage-mobile-tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; }
  .mypage-column-card { display: none; }
  .mypage-column-card.col-active { display: block; }
  .mypage-mobile-tab {
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s;
    flex-shrink: 0;
  }
  .mypage-mobile-tab.active {
    background: var(--primary-light);
    border-color: rgba(var(--primary-rgb),0.3);
    color: var(--primary);
  }
  .mypage-mobile-tab .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    padding: 0 4px;
    background: var(--border);
    color: var(--text-muted);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
  }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .template-item-grid { grid-template-columns: 1fr; }
  .settings-grid-personal { grid-template-columns: 1fr; }
  .clinic-layout { grid-template-columns: 1fr; }
  .signal-list-header { display: none; }
  .signal-row { grid-template-columns: 1fr; gap: 6px; }
  .signal-row-actions { justify-content: flex-start; }
  .teleapo-list-header { display: none; }
  .teleapo-row-main--inline { display: grid; gap: 6px; grid-template-columns: 1fr; }
  .company-directory-head { display: none; }
  .company-directory-row { grid-template-columns: 1fr; gap: 6px; }
  .pipeline-closed-grid { grid-template-columns: 1fr; }
  .dashboard-reason-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .mypage-columns { grid-template-columns: repeat(2, 1fr); }
  .dashboard-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

/* ======== mono系 レイアウトクラス（他テーマ互換） ======== */
/* monoテーマのページ固有レイアウトは通常の表示に fallback */
.mono-page-shell { display: block; }
.mono-page-intro, .mono-page-panel { display: block; }
.pipeline-mono-shell, .mypage-mono-shell,
.signals-mono-shell, .timeline-mono-shell,
.teleapo-mono-shell, .companies-mono-shell { display: block; }
.dashboard-hero-copy { position: relative; z-index: 1; }
.dashboard-feature-section, .dashboard-feature-copy,
.dashboard-feature-panel { display: block; }
.pipeline-mono-hero, .pipeline-mono-panel { display: block; }
