:root { --primary-color: #4f46e5; --primary-hover: #4338ca; --bg-color: #f3f4f6; --sidebar-bg: #1f2937; --sidebar-text: #d1d5db; --white: #ffffff; --text-main: #111827; --text-muted: #6b7280; --border-color: #e5e7eb; --status-new: #ef4444; --status-pending: #f59e0b; --status-resolved: #10b981; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', 'Noto Sans JP', sans-serif; background-color: var(--bg-color); color: var(--text-main); height: 100vh; overflow: hidden; font-size: 0.875rem; }
#app { display: flex; height: 100%; }

/* ========== Sidebar (モダン) ========== */
.sidebar { width: 200px; min-width: 200px; background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; height: 100%; border-right: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-header { flex-shrink: 0; padding: 20px 16px 16px; }
.sidebar-header .logo { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 600; color: var(--white); letter-spacing: -0.02em; }
.sidebar-header .logo i { font-size: 1.35rem; opacity: 0.95; }
/* メインナビ */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; }
.sidebar-divider { height: 1px; background: rgba(255, 255, 255, 0.1); margin: 8px 4px; flex-shrink: 0; }
.sidebar-spacer { flex: 1; min-height: 20px; }
.custom-folder-list-container { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
.custom-folder-list-container::-webkit-scrollbar { width: 4px; }
.custom-folder-list-container::-webkit-scrollbar-track { background: transparent; }
.custom-folder-list-container::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }
.custom-folder-list-container::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
.sidebar-add-folder { display: flex; justify-content: flex-end; padding: 4px 12px; align-items: center; }
#delete-folder-btn { margin-right: auto; }
.add-folder-btn { background: transparent; border: none; color: rgba(255, 255, 255, 0.5); cursor: pointer; font-size: 1rem; transition: color 0.15s ease; display: flex; justify-content: center; align-items: center; padding: 4px 8px; width: auto; }
.add-folder-btn:hover { color: var(--white); background: rgba(255, 255, 255, 0.05); border-radius: 4px; }
.sidebar-nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: rgba(255, 255, 255, 0.8); text-decoration: none; border-radius: 8px; margin-bottom: 2px; font-size: 0.8125rem; font-weight: 500; transition: all 0.2s ease; flex-shrink: 0; line-height: 1.2; }
.sidebar-nav-item:hover { background: rgba(255, 255, 255, 0.08); color: var(--white); transform: translateX(2px); }
.sidebar-nav-item.active { background: rgba(255, 255, 255, 0.12); color: var(--white); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.sidebar-nav-item i { width: 24px; min-width: 24px; text-align: center; font-size: 0.95rem; opacity: 0.9; display: flex; align-items: center; justify-content: center; }
.sidebar-nav-item span:not(.nav-count) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { 
    margin-left: auto; font-size: 0.65rem; font-weight: 700; padding: 2px 6px; background: rgba(255, 255, 255, 0.1); 
    color: rgba(255, 255, 255, 0.9); border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; 
    min-width: 20px; height: 18px; line-height: 1; transition: all 0.2s ease;
}
.sidebar-nav-item:hover .nav-count { background: rgba(255, 255, 255, 0.2); color: #fff; }
.sidebar-nav-item.active .nav-count { background: var(--primary-color); color: white; box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); }
/* フッター（ユーザー + 設定） */
.sidebar-footer { flex-shrink: 0; margin-top: auto; padding: 12px 10px 16px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.sidebar-footer-user { position: relative; }
.sidebar-footer-user .user-profile-trigger { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: none; background: transparent; color: inherit; cursor: pointer; text-align: left; border-radius: 8px; font-family: inherit; transition: all 0.2s ease; }
.sidebar-footer-user .user-profile-trigger:hover { background: rgba(255, 255, 255, 0.08); }
.sidebar-footer-user .avatar { width: 24px; height: 24px; min-width: 24px; flex-shrink: 0; background: var(--primary-color); color: var(--white); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 600; }
.user-profile-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.user-profile-name { color: var(--white); font-weight: 500; font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-profile-role { font-size: 0.7rem; color: rgba(255, 255, 255, 0.5); }
/* ユーザードロップダウン（ログアウト） */
.user-menu-dropdown { display: none; position: absolute; bottom: 100%; left: 0; width: 100%; margin-bottom: 6px; background: rgba(31, 41, 55, 0.98); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); padding: 4px; z-index: 100; backdrop-filter: blur(8px); box-sizing: border-box; }
.user-profile-wrap.is-open .user-menu-dropdown { display: block; }
/* 設定ブロック */
.sidebar-footer-settings { position: relative; }
.sidebar-settings-trigger { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: none; background: transparent; color: rgba(255, 255, 255, 0.8); font-size: 0.8125rem; font-weight: 500; cursor: pointer; text-align: left; border-radius: 8px; font-family: inherit; transition: background 0.15s ease, color 0.15s ease; }
.sidebar-settings-trigger:hover, .nav-settings-wrap.is-open .sidebar-settings-trigger { background: rgba(255, 255, 255, 0.08); color: var(--white); }
.sidebar-settings-trigger i { width: 32px; text-align: center; font-size: 1rem; opacity: 0.8; }
.settings-menu-dropdown { display: none; position: absolute; bottom: 100%; left: 0; width: 100%; margin-bottom: 6px; background: rgba(31, 41, 55, 0.98); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); padding: 4px; z-index: 100; backdrop-filter: blur(8px); box-sizing: border-box; }
.nav-settings-wrap.is-open .settings-menu-dropdown { display: block; }
/* ドロップダウン共通アイテム */
.dropdown-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: none; background: transparent; color: rgba(255, 255, 255, 0.9); font-size: 0.8125rem; cursor: pointer; text-align: left; text-decoration: none; border-radius: 8px; font-family: inherit; transition: background 0.15s ease, color 0.15s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-item:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.dropdown-item i { width: 18px; min-width: 18px; text-align: center; opacity: 0.9; flex-shrink: 0; }
.dropdown-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-item-logout:hover { background: rgba(220, 38, 38, 0.2); color: #fca5a5; }
/* 全画面モーダル（ユーザー一覧） */
.modal-fullscreen { display: none; position: fixed; inset: 0; z-index: 9999; background: var(--bg-color); overflow: auto; }
.modal-fullscreen.is-open { display: block; }
.modal-fullscreen-inner { min-height: 100%; display: flex; flex-direction: column; }
.modal-fullscreen-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; background: var(--white); border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.modal-fullscreen-title { font-size: 1.5rem; font-weight: 600; color: var(--text-main); margin: 0; }
.modal-fullscreen-close { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 8px; font-size: 1.25rem; transition: background 0.2s, color 0.2s; }
.modal-fullscreen-close:hover { background: var(--border-color); color: var(--text-main); }
.modal-fullscreen-body { flex: 1; padding: 24px; overflow: auto; }
/* 添付要約ポップアップ（オーバーレイ） */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 9998; background: rgba(0, 0, 0, 0.4); align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.is-open { display: flex; }
.modal-overlay-inner { background: var(--white); border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2); max-width: 480px; width: 100%; max-height: 80vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-overlay-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.modal-overlay-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 12px; }
.modal-overlay-close { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 8px; font-size: 1.1rem; }
.modal-overlay-close:hover { background: var(--border-color); color: var(--text-main); }
.modal-overlay-body { padding: 20px; overflow: auto; }
.attachment-summary-text { margin: 0; white-space: pre-wrap; word-break: break-word; line-height: 1.6; color: var(--text-main); }
/* 一覧の添付アイコン用カスタムツールチップ（ネイティブ title の代わり） */
.attachment-tooltip { display: none; position: fixed; z-index: 9999; padding: 8px 12px; background: #1f2937; color: #fff; font-size: 0.8125rem; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); max-width: 320px; white-space: normal; word-break: break-all; pointer-events: none; }
.attachment-tooltip.is-visible { display: block; }
.attachment-icon-wrap { cursor: default; }
.btn-summary { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; min-width: 24px; border: none; background: #e0e7ff; color: #3730a3; border-radius: 50%; cursor: pointer; font-size: 0.85rem; font-weight: 600; margin-left: 8px; flex-shrink: 0; }
.btn-summary:hover { background: #c7d2fe; }
.btn-summary i { font-size: 0.75rem; }
.btn-summary-empty { background: #e5e7eb; color: #6b7280; cursor: pointer; }
.btn-summary-empty:hover { background: #d1d5db; color: #4b5563; }
.btn-summary-fetch { width: auto; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; gap: 4px; }
.btn-summary-fetch:disabled { opacity: 0.7; cursor: not-allowed; }
.user-list-content { background: var(--white); border-radius: 8px; border: 1px solid var(--border-color); overflow: hidden; }
/* 署名編集モーダル */
.signature-edit-content { max-width: 640px; margin: 0 auto; }
.signature-edit-description { margin: 0 0 12px; font-size: 0.9rem; color: var(--text-muted); }
.signature-textarea { width: 100%; padding: 14px 16px; border: 1px solid var(--border-color); border-radius: 8px; font-family: inherit; font-size: 0.9375rem; line-height: 1.6; resize: vertical; min-height: 200px; }
.signature-textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2); }
.signature-edit-actions { margin-top: 20px; }
.user-list-table { width: 100%; border-collapse: collapse; }
.user-list-table th, .user-list-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
.user-list-table th { background: #f9fafb; font-weight: 600; color: var(--text-main); font-size: 0.9rem; }
.user-list-table tr:last-child td { border-bottom: none; }
.user-list-table tr:hover td { background: #f9fafb; }
.user-list-badge-admin { display: inline-block; padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 500; background: var(--primary-color); color: var(--white); }
.user-list-kintone-json { font-size: 0.8rem; color: var(--text-muted); background: #f9fafb; padding: 8px 12px; border-radius: 6px; margin-top: 8px; overflow-x: auto; max-height: 120px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; }
/* 読み込み表示（共通） */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 48px 24px; color: var(--text-muted); font-size: 0.9375rem; min-height: 120px; }
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--border-color); border-top-color: var(--primary-color); border-radius: 50%; animation: loading-spin 0.75s linear infinite; flex-shrink: 0; }
.loading-text { font-weight: 500; letter-spacing: 0.02em; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
/* Main Content */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.view-panel { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-color); display: flex; flex-direction: column; min-height: 0; overflow: hidden; transition: opacity 0.2s; }
.hidden { display: none; opacity: 0; pointer-events: none; }
.views-wrapper { flex: 1; position: relative; display: flex; flex-direction: column; overflow: hidden; }

/* ========== Split View ========== */
.views-wrapper.is-split-view { flex-direction: row; }
.views-wrapper.is-split-view #email-list-view, .views-wrapper.is-split-view #email-detail-view, .views-wrapper.is-split-view #compose-view, .views-wrapper.is-split-view #reply-view { position: relative; width: auto; opacity: 1; pointer-events: auto; }
.views-wrapper.is-split-view #email-list-view { width: 400px; flex-shrink: 0; border-right: 1px solid var(--border-color); display: flex !important; height: 100%; }
.views-wrapper.is-split-view #email-detail-view, .views-wrapper.is-split-view #compose-view, .views-wrapper.is-split-view #reply-view { flex: 1; display: flex !important; background: var(--white); height: 100%; }
.views-wrapper.is-split-view #email-detail-view.hidden, .views-wrapper.is-split-view #compose-view.hidden, .views-wrapper.is-split-view #reply-view.hidden { display: none !important; }
#email-detail-view:not(.has-email) .detail-header, #email-detail-view:not(.has-email) .email-content-wrapper { display: none; }
.detail-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); background: var(--bg-color); }
#email-detail-view.has-email .detail-placeholder { display: none; }
.placeholder-content { text-align: center; }
.placeholder-content i { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }
.placeholder-content p { font-size: 1rem; font-weight: 500; }
.views-wrapper.is-split-view #email-detail-view .detail-header .btn-icon:first-child { display: inline-flex; } /* メールの詳細表示中も「戻る」ボタンを表示してトップバーを戻せるようにする */
#split-view-toggle.active { background-color: var(--primary-color); color: var(--white); border-color: var(--primary-color); }

/* ========== Split View (Compact List) ========== */
/* 既存の「一覧（左パネル）」だけ列ヘッダを非表示にする。
   返信/新規側に同じ見た目のUIを置いても消えないようにするため、対象を #email-list-view に限定。 */
.views-wrapper.is-split-view #email-list-view .email-list-header { display: none; }
.views-wrapper.is-split-view .email-item { display: flex; flex-direction: column; padding: 4px 16px 4px 20px; gap: 2px; border-bottom: 1px solid var(--border-color); align-items: stretch; position: relative; }
.views-wrapper.is-split-view .email-item .col-reply, .views-wrapper.is-split-view .email-item .col-status, .views-wrapper.is-split-view .email-item .col-assignee, .views-wrapper.is-split-view .email-item .col-trash { display: none; }
.views-wrapper.is-split-view .email-item::before { content: attr(data-meta-info); font-size: 0.675rem; color: var(--primary-color); font-weight: 600; margin-bottom: 2px; display: block; box-sizing: border-box; padding-right: calc(110px + 0.725rem); white-space: nowrap; overflow: hidden; text-overflow: clip; letter-spacing: -0.02em; }
.views-wrapper.is-split-view .email-item .col-sender { order: 1; font-weight: 600; font-size: 0.9rem; padding: 0; }
.views-wrapper.is-split-view .email-item .col-sender .sender-input-group:nth-child(2) { display: none; }
.views-wrapper.is-split-view .email-item .col-date { position: absolute; top: 4px; right: 10px; order: 0; font-size: 0.725rem; }
.views-wrapper.is-split-view .email-item .col-subject { order: 2; padding: 0; }
.views-wrapper.is-split-view .email-item .email-subject-text { font-weight: 500; color: var(--text-main); font-size: 0.875rem; }
.views-wrapper.is-split-view .email-item .col-attachment { display: none !important; }
.info-icon-split-only { display: none !important; }
.views-wrapper.is-split-view .info-icon-split-only { display: inline-flex !important; align-items: center; justify-content: center; margin-left: auto; font-size: 0.95rem; color: #3b82f6; cursor: pointer; flex-shrink: 0; padding-left: 10px; }
.views-wrapper.is-split-view .sender-input-group .col-sender-text { display: flex; align-items: center; min-width: 0; overflow: visible; flex: 1; }
.views-wrapper.is-split-view .sender-clickable { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.views-wrapper.is-split-view .email-item.is-selected { background-color: #eff6ff !important; border-left: 4px solid #6366f1; padding-left: 16px; box-shadow: inset 1px 0 0 rgba(0,0,0,0.02); }
/* スプリットビュー時も緊急度カラーを優先表示 */
.views-wrapper.is-split-view .email-item.row-urgency-urgent { background-color: #fffbeb !important; }
.views-wrapper.is-split-view .email-item.row-urgency-critical { background-color: #fef2f2 !important; }
.email-subject-line { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.email-subject-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.email-subject-addons { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.split-attachment-icon { display: none; }
.views-wrapper.is-split-view .email-subject-line { justify-content: space-between; gap: 8px; }
.views-wrapper.is-split-view .email-subject-text { flex: 1; }
.views-wrapper.is-split-view .split-attachment-icon { display: flex; }
/* 新規／返信：送信元と署名を別チップで表示。長文は折り返し（省略しない）。見出し行はボタンと縦中央揃え */
.detail-header.detail-header-title-row { flex-wrap: wrap; align-items: center; row-gap: 10px; column-gap: 12px; }
.detail-header.detail-header-title-row > h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; flex: 1 1 220px; margin: 0; min-width: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.detail-header.detail-header-title-row > h3 #reply-type-label,
.detail-header.detail-header-title-row > h3 .header-title-text { flex-shrink: 0; display: inline-flex; align-items: center; line-height: 1.3; }
.header-from-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; flex: 1 1 160px; min-width: 0; max-width: 100%; }
.header-from-chip { display: block; box-sizing: border-box; flex: 1 1 140px; min-width: 0; max-width: 100%; padding: 4px 10px; font-size: 0.8125rem; font-weight: 500; line-height: 1.45; color: #64748b; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; white-space: normal; word-break: break-word; overflow-wrap: anywhere; transition: all 0.2s; }
select.header-from-chip { cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 10px 10px; padding-right: 24px; }
select.header-from-chip:hover { border-color: var(--primary-color); background-color: #fff; color: var(--primary-color); }
select.header-from-chip:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.detail-header.detail-header-title-row > .meta-controls { flex-shrink: 0; margin-left: auto; }

/* Sender Options Menu */
.sender-options-wrap { position: relative; }
.sender-options-menu { position: absolute; top: 100%; right: 0; z-index: 100; width: 280px; padding: 12px; background: white; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); margin-top: 5px; }
.sender-options-item { margin-bottom: 10px; }
.sender-options-item:last-child { margin-bottom: 0; }
.sender-options-item label { display: block; font-size: 0.75rem; font-weight: 600; color: #64748b; margin-bottom: 4px; }
.sender-options-item select { width: 100%; }
.views-wrapper.is-split-view .email-content-wrapper { padding: 8px 16px; }
.views-wrapper.is-split-view .email-header-info { margin-bottom: 6px; padding-bottom: 6px; }
.views-wrapper.is-split-view .thread-message { padding: 8px 12px 10px; margin-bottom: 8px; }
.views-wrapper.is-split-view .thread-message-header { margin-bottom: 6px; padding-bottom: 6px; gap: 6px; }
.btn-close-edit { display: none; }
.views-wrapper.is-split-view .btn-back { display: inline-flex !important; }
.views-wrapper.is-split-view .btn-close-edit { display: inline-flex !important; }
/* Top Bar */
.top-bar { background: var(--white); padding: 6px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-color); }
.top-bar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-filters-group { display: flex; align-items: center; gap: 12px; }
.search-box { position: relative; width: calc(220px + 5em); }
.search-box i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.8rem; }
.search-box input { width: 100%; padding: 6px 10px 6px 30px; border: 1px solid var(--border-color); border-radius: 6px; outline: none; font-size: 0.825rem; }
.status-filter { flex-shrink: 0; }
.status-filter-select { padding: 4px 26px 4px 8px; border: 1px solid var(--border-color); border-radius: 6px; outline: none; font-size: 0.825rem; background: var(--white); color: var(--text-main); cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 10px 10px; }
.status-filter-select:hover { border-color: var(--primary-color); }
.status-filter-select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
/* トップバー：新規・更新と同じくアイコン＋ラベルの間隔 */
.actions .btn { gap: 6px; }
/* 返信／新規：送信＝下書きで同じ幅。親は伸ばさず、ボタンだけ同寸（固定 rem） */
.detail-header.detail-header-title-row > .meta-controls.meta-controls-send-draft { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; max-width: 100%; }
.detail-header.detail-header-title-row > .meta-controls.meta-controls-send-draft .btn { flex: 0 0 auto; box-sizing: border-box; width: 7rem; min-width: 7rem; max-width: 7rem; padding-left: 0.1em; padding-right: 0.1rem; justify-content: center; gap: 0.25rem; white-space: nowrap; }
.detail-header.detail-header-title-row > .meta-controls.meta-controls-send-draft .btn i { font-size: 0.75rem; flex-shrink: 0; }
.pagination-wrap { display: flex; align-items: center; gap: 0.5em; margin-right: 12px; }
.pagination-info { font-size: 0.775rem; color: var(--text-muted); white-space: nowrap; margin-right: 0.4em; }
.btn-pagination { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--border-color); background: var(--white); color: var(--text-main); border-radius: 4px; cursor: pointer; font-size: 0.8rem; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.btn-pagination:hover:not(:disabled) { background: #f3f4f6; border-color: var(--text-muted); color: var(--primary-color); }
.btn-pagination:disabled { opacity: 0.45; cursor: not-allowed; color: var(--text-muted); }
/* 枠線の有無で高さがずれないよう、すべて 1px border（primary は同色で見えない） */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 14px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 0.825rem; font-weight: 500; transition: background 0.2s, border-color 0.2s; }
.btn-primary { background-color: var(--primary-color); color: var(--white); border-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline { background: transparent; border-color: var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: #f9fafb; border-color: var(--text-muted); }
.btn.btn-icon { min-height: unset; padding: 6px; border: none; font-size: 0.95rem; color: var(--text-muted); background: transparent; }
.btn.btn-icon:hover { background: var(--border-color); }

/* ========== Back Button (calm, clear, non-arrow) ========== */
.btn-back {
    display: inline-flex !important; align-items: center !important; justify-content: center !important; width: auto !important; height: 32px !important;
    min-width: 72px !important; padding: 0 10px 0 8px !important; gap: 6px !important; border-radius: 8px !important;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease !important;
    color: #475569 !important; background: #f8fafc !important; border: 1px solid #dbe3ef !important; margin-right: 12px !important;
    cursor: pointer;
}
.btn-back:hover { background-color: #eef4ff !important; border-color: #bfd0f3 !important; color: #334155 !important; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important; }
.btn-back:active { transform: scale(0.97) !important; background-color: #e5edf9 !important; }
.btn-back .back-list-icon { width: 18px; height: 18px; pointer-events: none; flex-shrink: 0; }
.btn-back .back-btn-label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.01em; line-height: 1; color: inherit; }
.btn-back .back-list-icon rect { fill: #ffffff; stroke: #2563eb; stroke-width: 1.5; }
.btn-back .back-list-icon circle { fill: #38bdf8; }
.btn-back .back-list-icon path { stroke: #2563eb; stroke-width: 1.6; stroke-linecap: round; }
/* テンプレート画面上の新規グループ・新規テンプレートを同じサイズに */
#templates-view .top-bar-actions .btn { padding: 8px 16px; font-size: 0.85rem; font-weight: 500; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; }
/* Email List */
.email-list-container { flex: 1; overflow-y: auto; padding: 0; min-width: 0; background: var(--white); }
.email-list-header { display: grid; grid-template-columns: 18px minmax(102px, 117px) minmax(118px, 133px) minmax(76px, 180px) 26px minmax(112px, 1fr) minmax(calc(48px + 0.8rem), calc(85px + 0.8rem)) 80px; gap: 8px 10px; padding: 8px 4px 8px 16px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border-color); background: var(--white); position: sticky; top: 0; z-index: 10; font-size: 0.8125rem; }
.email-list-header>div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-list-header .col-reply { display: flex; align-items: center; justify-content: center; }
.email-list-header .col-attachment { display: flex; align-items: center; justify-content: center; }
.email-list { background: var(--white); padding-bottom: 10px; }
/* テンプレート一覧（名前・件名を横並び） */
#templates-list { background: var(--white); }
.template-group-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 600; color: #334155; font-size: 0.9375rem; border-bottom: 1px solid #edf2f7; background: #f8fafc; cursor: pointer; transition: background 0.2s; position: sticky; top: 0; z-index: 5; }
.template-group-header:hover { background: #f1f5f9; }
.template-group-header i.fa-chevron-right, .template-group-header i.fa-chevron-down { color: #94a3b8; font-size: 0.75rem; width: 14px; transition: transform 0.2s; }
.template-group-header i.fa-folder, .template-group-header i.fa-folder-open { color: #3b82f6; font-size: 1.1rem; width: 22px; }
.template-group-name { flex: 1; }
.template-group-count { font-weight: 400; font-size: 0.8rem; color: #94a3b8; margin-left: 6px; }
.template-group-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s; }
.template-group-header:hover .template-group-actions { opacity: 1; }
.template-group-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: none; background: transparent; color: #64748b; border-radius: 6px; cursor: pointer; font-size: 0.8rem; transition: background 0.2s, color 0.2s; }
.template-group-btn:hover { background: #e2e8f0; color: var(--primary-color); }
.template-group-btn-del:hover { background: #fee2e2; color: #ef4444; }
.template-items-container { border-left: 2px solid #f1f5f9; margin-left: 24px; }
.template-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background 0.2s; position: relative; background: var(--white); }
.template-item:hover { background: #f8fafc; }
.template-item:last-child { border-bottom: none; }
.template-item-icon { color: #94a3b8; font-size: 0.95rem; width: 20px; display: flex; align-items: center; justify-content: center; }
.template-item-name { flex: 0 0 200px; font-weight: 500; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9375rem; }
.template-item-subject { flex: 1; color: #64748b; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-item-delete { opacity: 1; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: none; background: transparent; color: #94a3b8; border-radius: 6px; cursor: pointer; font-size: 0.8rem; transition: all 0.2s; }
.template-item-delete:hover { color: #ef4444; background: #fee2e2; }
.template-manager-layout { display: flex; height: calc(100vh - 120px); background: #f8fafc; border-top: 1px solid #e2e8f0; overflow: hidden; }
.template-groups-pane { width: 240px; background: #f8fafc; border-right: 1px solid #e2e8f0; overflow-y: auto; padding: 12px 0; }
.template-items-pane { flex: 1; background: #fff; overflow-y: auto; }
.template-group-item { display: flex; align-items: center; padding: 10px 16px; cursor: pointer; color: #475569; gap: 8px; font-size: 0.9375rem; transition: all 0.2s; position: relative; }
.template-group-item:hover { background: #f1f5f9; color: var(--primary-color); }
.template-group-item.active { background: #fff; color: #2563eb; font-weight: 600; border-right: 1px solid #fff; margin-right: -1px; z-index: 10; }
.template-group-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; background: #3b82f6; border-radius: 0 4px 4px 0; }
.template-group-item i { font-size: 1rem; width: 20px; text-align: center; color: #94a3b8; }
.template-group-item.active i { color: #3b82f6; }
.template-group-item .template-group-count { font-size: 0.75rem; color: #94a3b8; font-weight: 400; margin-left: auto; }
.template-group-item .template-group-actions { margin-left: 8px; display: flex; transform: scale(0.9); }
.template-group-empty { padding: 40px; text-align: center; color: #94a3b8; font-size: 0.9rem; }
.email-item { display: grid; grid-template-columns: 18px minmax(102px, 117px) minmax(118px, 133px) minmax(76px, 180px) 26px minmax(112px, 1fr) minmax(calc(48px + 0.8rem), calc(85px + 0.8rem)) 80px; gap: 8px 10px; padding: 2px 4px 2px 16px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background 0.1s; align-items: center; }
.email-item .col-reply { display: flex; align-items: center; justify-content: center; min-width: 0; }
.email-item .reply-mark { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; font-size: 0.7rem; }
.email-item .reply-mark.reply-done { color: #059669; background: #d1fae5; }
.email-item .reply-mark.reply-pending { color: #dc2626; background: #fee2e2; }
.email-item .reply-mark.reply-none { visibility: hidden; }
.email-item .col-status, .email-item .col-sender, .email-item .col-date, .email-item .col-trash { display: flex; align-items: center; min-height: 28px; }
.email-item .col-status { flex-direction: column; justify-content: center; gap: 2px; }
.email-item .col-assignee { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding-top: 2px; padding-bottom: 2px; gap: 4px; }
.assign-input-group { display: flex; align-items: center; width: 100%; }
.assign-label { flex-shrink: 0; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; border-radius: 4px; margin-right: 4px; color: #fff; line-height: 1; }
.assign-label.assignee { background-color: #6366f1; }
.assign-label.reviewer { background-color: #10b981; }
.email-item .col-trash { justify-content: flex-end; padding-right: 13px; gap: 10px; }
.email-item .btn-trash, .email-item .btn-restore { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 6px; font-size: 0.85rem; transition: background 0.2s, color 0.2s; }
.email-item .btn-trash:hover { background: #fef2f2; color: #dc2626; }
.email-item .btn-restore { font-size: 1rem; }
.email-item .btn-restore:hover { background: #ecfdf5; color: #059669; }
.email-item .col-status { padding-right: 4px; min-width: 0; }
.email-item .col-assignee { padding-right: 4px; min-width: 0; }
.email-item .col-sender { padding-right: 8px; padding-top: 2px; padding-bottom: 2px; min-width: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; }
.sender-input-group { display: flex; align-items: center; width: 100%; min-width: 0; }
.sender-label { flex-shrink: 0; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; border-radius: 4px; margin-right: 4px; color: #fff; line-height: 1; }
.sender-label.others { background-color: #6366f1; }
.sender-label.me { background-color: #10b981; }
.email-item .col-sender .col-sender-text { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender-clickable { cursor: pointer; transition: all 0.15s; border-radius: 4px; padding: 1px 4px; margin-left: -4px; display: inline-block; max-width: 100%; vertical-align: bottom; }
.sender-clickable:hover { background-color: #e0e7ff; color: var(--primary-color) !important; }
.search-icon-sub { font-size: 0.65rem; margin-left: 5px; opacity: 0; transition: opacity 0.2s; vertical-align: middle; }
.sender-clickable:hover .search-icon-sub { opacity: 0.8; }
.email-item .col-subject { display: flex; flex-direction: column; gap: 4px; min-height: 36px; justify-content: center; min-width: 0; overflow: hidden; }
.email-item .col-date { min-width: 0; overflow: hidden; font-size: 0.8rem; color: #9ca3af; }
.email-item .col-date .col-date-text { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-item .col-status .list-select, .email-item .col-assignee .list-select { flex: 1; width: 100%; max-width: 100%; padding: 4px 8px; padding-right: 20px; font-size: 0.775rem; border-radius: 6px; cursor: pointer; min-width: 0; font-weight: 500; -webkit-appearance: none; -moz-appearance: none; appearance: none; }
.email-item .col-assignee .list-select { border: 1px solid var(--border-color); background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 6px center; background-size: 12px 12px; color: var(--text-main); }
.email-item .col-status .list-select { border: 1px solid transparent; color: #fff !important; font-size: 0.6875rem; padding: 3px 20px 3px 6px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 5px center; background-size: 11px 11px; }
.email-item .col-status .list-select option { background: #fff; color: #333; }
.email-item .col-status .list-select:focus, .email-item .col-assignee .list-select:focus { outline: none; box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2); }
.email-item .col-status .list-select:focus { border-color: inherit; }
.email-subject-line { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.email-subject-line .email-subject-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.thread-count-badge { display: inline-flex; align-items: center; flex-shrink: 0; font-size: 0.725rem; padding: 2px 8px; background: #ffffff; color: #4f46e5; border: 1px solid #c7d2fe; border-radius: 999px; font-weight: 700; line-height: 1; box-shadow: 0 2px 4px rgba(79, 70, 229, 0.12), 0 1px 2px rgba(0, 0, 0, 0.05); margin-left: 2px; }
.email-attachments { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-item:nth-child(even) { background-color: #f9fafb; }
.email-item:nth-child(odd) { background-color: #ffffff; }
.email-item:hover { background-color: #f3f4f6 !important; }
.email-item.unread { background-color: #eff6ff !important; font-weight: 600; }
.status-badge { display: inline-block; padding: 4px 8px; border-radius: 12px; font-size: 0.75rem; color: white; }
.status-new { background-color: var(--status-new); }
.status-pending { background-color: var(--status-pending); }
.status-resolved { background-color: var(--status-resolved); }

/* ========== 緊急度表示 ========== */
.email-item .col-status .list-select.urgency-select { margin-top: 2px; border: 1px solid #e5e7eb !important; background-color: var(--white) !important; color: var(--text-main) !important; font-size: 0.6875rem !important; padding: 3px 18px 3px 6px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important; background-position: right 5px center !important; background-size: 10px 10px !important; }
.email-item .col-status .list-select.urgency-select.urgency-normal { background-color: #fff !important; color: #6b7280 !important; border-color: #e5e7eb !important; }
.email-item .col-status .list-select.urgency-select.urgency-urgent { background-color: #fffbeb !important; color: #92400e !important; border-color: #fde68a !important; }
.email-item .col-status .list-select.urgency-select.urgency-critical { background-color: #fef2f2 !important; color: #b91c1c !important; border-color: #fecaca !important; }
.email-item.row-urgency-urgent { background-color: #fffbeb !important; }
.email-item.row-urgency-urgent:hover { background-color: #fef3c7 !important; }
.email-item.row-urgency-critical { background-color: #fef2f2 !important; }
.email-item.row-urgency-critical:hover { background-color: #fee2e2 !important; }
#detail-status { border: 1px solid transparent; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
#reply-detail-status { border: 1px solid transparent; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
#compose-detail-status { border: 1px solid transparent; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
#detail-urgency { border: 1px solid var(--border-color) !important; color: var(--text-main) !important; font-size: 0.8rem; }
#detail-urgency.urgency-normal { background-color: #fff !important; color: var(--text-main) !important; border-color: var(--border-color) !important; }
#detail-urgency.urgency-urgent { background-color: #fffbeb !important; color: #92400e !important; border-color: #fde68a !important; }
#detail-urgency.urgency-critical { background-color: #fef2f2 !important; color: #b91c1c !important; border-color: #fecaca !important; }
/* Reply / Compose context（返信/新規上部バーの緊急度） */
#reply-detail-urgency { border: 1px solid var(--border-color) !important; color: var(--text-main) !important; font-size: 0.8rem; }
#reply-detail-urgency.urgency-normal { background-color: #fff !important; color: var(--text-main) !important; border-color: var(--border-color) !important; }
#reply-detail-urgency.urgency-urgent { background-color: #fffbeb !important; color: #92400e !important; border-color: #fde68a !important; }
#reply-detail-urgency.urgency-critical { background-color: #fef2f2 !important; color: #b91c1c !important; border-color: #fecaca !important; }
#compose-detail-urgency { border: 1px solid var(--border-color) !important; color: var(--text-main) !important; font-size: 0.8rem; }
#compose-detail-urgency.urgency-normal { background-color: #fff !important; color: var(--text-main) !important; border-color: var(--border-color) !important; }
#compose-detail-urgency.urgency-urgent { background-color: #fffbeb !important; color: #92400e !important; border-color: #fde68a !important; }
#compose-detail-urgency.urgency-critical { background-color: #fef2f2 !important; color: #b91c1c !important; border-color: #fecaca !important; }
/* Detail View */
.detail-header, .header-content { background: var(--white); padding: 4px 16px; min-height: 40px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); }
.meta-label { font-size: 0.775rem; font-weight: 600; color: var(--text-muted); margin-left: 10px; flex-shrink: 0; }
.meta-controls select { padding: 4px 24px 4px 8px; border-radius: 6px; font-weight: 500; font-size: 0.8rem; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-color: var(--white); border: 1px solid var(--border-color); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 10px 10px; }
.meta-controls #detail-assignee, .meta-controls #detail-reviewer, .meta-controls #reply-detail-assignee, .meta-controls #reply-detail-reviewer, .meta-controls #compose-detail-assignee, .meta-controls #compose-detail-reviewer { background-color: var(--white); color: var(--text-main); }
.meta-controls #detail-status, .meta-controls #reply-detail-status, .meta-controls #compose-detail-status { font-size: 0.75rem; }
/* Meta Menu for Split View */
.meta-menu-wrap { display: none; align-items: center; gap: 8px; margin-left: 10px; flex: 1; min-width: 0; }
.views-wrapper.is-split-view .meta-menu-wrap { display: flex; }
.views-wrapper.is-split-view .meta-controls { display: none !important; }
.meta-summary-display { font-size: 0.725rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.meta-dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; width: 240px; padding: 12px; background: white; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); margin-top: 5px; display: flex; flex-direction: column; gap: 10px; }
.meta-dropdown-menu.hidden { display: none; }
.meta-dropdown-item { display: flex; flex-direction: column; gap: 4px; }
.meta-dropdown-item label { font-size: 0.7rem; font-weight: 600; color: #64748b; margin: 0; }
.meta-dropdown-item select { width: 100% !important; max-width: none !important; font-size: 0.75rem !important; }
.meta-move-wrap .meta-label, .meta-move-wrap select { font-size: 0.75rem !important; }

.email-content-wrapper { flex: 1; overflow-y: auto; padding: 12px 20px; background: var(--white); }
.email-header-info { margin-bottom: 12px; border-bottom: 1px solid var(--border-color); padding-bottom: 12px; }
.email-header-info h2 { margin-bottom: 8px; font-size: 1.25rem; }
.sender-info, .recipient-info { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 5px; }
.sender-info .label, .recipient-info .label { font-weight: 600; color: var(--text-main); }
.email-body { line-height: 1.6; margin-bottom: 30px; }
/* スレッド統合表示 */
#thread-messages { margin-top: 16px; }
.thread-message { background: #f9fafb; border: 1px solid var(--border-color); border-radius: 8px; padding: 16px 20px 20px; margin-bottom: 16px; }
.thread-message-opened { border-color: var(--primary-color); background: #f5f3ff; box-shadow: 0 0 0 1px var(--primary-color); }
.thread-message-header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }
.thread-message-badge { font-size: 0.75rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
.thread-message-badge-inbox { background: #dbeafe; color: #1d4ed8; }
.thread-message-badge-sent { background: #d1fae5; color: #047857; }
.thread-message-badge-draft { background: #fef3c7; color: #92400e; }
.thread-message-fromto { flex: 1; font-weight: 500; color: var(--text-main); word-break: break-all; }
.thread-message-date { font-size: 0.9rem; color: var(--text-muted); }
.thread-message-body-wrap { position: relative; margin-bottom: 0; }
.thread-message-body-wrap .thread-message-body { padding-right: 90px; padding-top: 28px; padding-bottom: 0px; }
.thread-message-body-summary-actions { position: absolute; top: 4px; right: 4px; z-index: 1; }
.thread-message-body { line-height: 1.6; color: var(--text-main); }
/* Apple Mail風の入れ子引用（青・緑系統で10階層まで色分け：淡いトーン） */
.thread-message-body blockquote { border-left: 3px solid #3b82f6 !important; margin: 10px 0 10px 0px; padding-left: 8px; color: #4b5563; }
.thread-message-body blockquote blockquote { border-left-color: #34d399 !important; } /* 薄い緑 */
.thread-message-body blockquote blockquote blockquote { border-left-color: #60a5fa !important; } /* 薄い青 */
.thread-message-body blockquote blockquote blockquote blockquote { border-left-color: #6ee7b7 !important; } /* さらに薄い緑 */
.thread-message-body blockquote blockquote blockquote blockquote blockquote { border-left-color: #93c5fd !important; } /* さらに薄い青 */
.thread-message-body blockquote blockquote blockquote blockquote blockquote blockquote { border-left-color: #a7f3d0 !important; } /* 淡い緑 */
.thread-message-body blockquote blockquote blockquote blockquote blockquote blockquote blockquote { border-left-color: #bae6fd !important; } /* 淡い青 */
.thread-message-body blockquote blockquote blockquote blockquote blockquote blockquote blockquote blockquote { border-left-color: #d1fae5 !important; }
.thread-message-body blockquote blockquote blockquote blockquote blockquote blockquote blockquote blockquote blockquote { border-left-color: #e0f2fe !important; }
.thread-message-body blockquote blockquote blockquote blockquote blockquote blockquote blockquote blockquote blockquote blockquote { border-left-color: #ecfdf5 !important; }
.thread-message-body pre { margin: 0; white-space: pre-wrap; font-family: inherit; }
.thread-message-attachments { margin-top: 8px; margin-bottom: 0; padding-top: 8px; border-top: 1px solid rgba(0, 0, 0, 0.05); }
/* Attachments */
.attachments { margin-bottom: 30px; padding: 20px; background: #f9fafb; border-radius: 8px; border: 1px solid var(--border-color); }
.attachments:empty { display: none; }
.attachments-header { font-weight: 600; color: var(--text-main); margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
.attachments-header i { color: var(--text-muted); }
.attachments-list { display: flex; flex-direction: column; gap: 10px; }
.attachment-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--white); border-radius: 6px; border: 1px solid var(--border-color); transition: box-shadow 0.2s; }
.attachment-item:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.attachment-item i.fa-file { color: var(--primary-color); font-size: 1.2rem; }
.attachment-name { flex: 1; color: var(--text-main); font-weight: 500; word-break: break-all; }
.attachment-size { color: var(--text-muted); font-size: 0.9rem; }
.attachment-download { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--primary-color); color: var(--white); text-decoration: none; border-radius: 6px; font-size: 0.9rem; transition: background 0.2s; }
.attachment-download:hover { background: var(--primary-hover); }
.attachment-download i { font-size: 0.85rem; }
/* Sent Emails Section */
#sent-emails-section { margin-top: 30px; margin-bottom: 30px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.sent-emails-header { font-weight: 600; color: var(--text-main); margin-bottom: 15px; display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.sent-emails-header i { color: var(--primary-color); }
.sent-email-item { background: #f9fafb; border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; margin-bottom: 15px; }
.sent-email-header { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }
.sent-email-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.sent-email-to { font-weight: 500; color: var(--text-main); }
.sent-email-date { font-size: 0.9rem; color: var(--text-muted); }
.sent-email-body { line-height: 1.6; color: var(--text-main); margin-bottom: 10px; }
.sent-email-attachments { font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-color); }
.sent-email-attachments i { margin-right: 6px; color: var(--primary-color); }
.reply-area { margin-top: 30px; border-top: 1px solid var(--border-color); padding-top: 20px; }
.reply-area textarea { width: 100%; height: 150px; padding: 15px; border: 1px solid var(--border-color); border-radius: 8px; resize: vertical; margin-bottom: 10px; font-family: inherit; }

/* AI要約（グローバル） */
.detail-global-summary-container { margin: 12px 0; padding: 16px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; display: none; }
.detail-global-summary-container.is-visible { display: block; }
.global-summary-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--primary-color); font-weight: 600; font-size: 0.8rem; }
.global-summary-text { font-size: 0.875rem; line-height: 1.6; color: var(--text-main); white-space: pre-wrap; }
.btn-summary-fetch-global { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; padding: 6px 14px; color: var(--primary-color); background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 20px; cursor: pointer; transition: all 0.2s; }
.btn-summary-fetch-global:hover { background: #e0f2fe; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.btn-summary-fetch-global i { font-size: 0.85rem; }

/* ========== Compose Form ========== */
.compose-form { padding: 15px 14px 10px; background: var(--white); flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.compose-label { font-weight: 500; color: var(--text-main); font-size: 0.9rem; margin-bottom: -4px; }
.compose-select { padding: 8px 30px 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 1rem; background: var(--white); max-width: 280px; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px; }
.compose-form input, .compose-form textarea { padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.875rem; font-family: inherit; }
.compose-form textarea { flex: 1; resize: none; min-height: 200px; }
/* テンプレート編集のみ：グループ＋テンプレート名を1行（他の compose フォームには影響しない） */
#template-editor-view .template-editor-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-bottom: 2px; }
#template-editor-view .template-editor-meta-row .compose-label { margin-bottom: 0; }
#template-editor-view .template-editor-meta-row .compose-select { max-width: none; width: auto; min-width: 160px; }
#template-editor-view .template-editor-meta-row input#tpl-name { flex: 1 1 200px; min-width: 140px; max-width: 100%; box-sizing: border-box; }
/* Login page */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--sidebar-bg) 0%, #111827 100%); }
.login-wrapper { width: 100%; max-width: 400px; padding: 20px; }
.login-card { background: var(--white); border-radius: 12px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); padding: 40px; }
.login-logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.75rem; font-weight: 600; color: var(--primary-color); margin-bottom: 24px; }
.login-logo i { font-size: 2rem; }
.login-title { font-size: 1.5rem; font-weight: 600; color: var(--text-main); margin-bottom: 24px; text-align: center; }
.login-error { background: #fef2f2; color: #b91c1c; padding: 12px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; }
.login-form { display: flex; flex-direction: column; gap: 20px; }
.login-field label { display: block; font-weight: 500; color: var(--text-main); margin-bottom: 6px; font-size: 0.9rem; }
.login-field input { width: 100%; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem; box-sizing: border-box; }
.login-field input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
.btn-login { width: 100%; padding: 14px; font-size: 1rem; margin-top: 8px; }
.nav-item-logout { margin-top: auto; color: rgba(255, 255, 255, 0.7); }
.nav-item-logout:hover { background-color: rgba(220, 38, 38, 0.2); color: #fca5a5; }

/* ========== 付箋（メモ）機能 ========== */
.email-item .col-memo { position: relative; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; margin-left: auto; }
.col-memo-line { display: flex; align-items: center; margin-top: 2px; min-width: 0; overflow: hidden; gap: 6px; }
.sticky-note-btn { background: transparent; border: none; padding: 0; cursor: pointer; color: #e2e8f0; font-size: 1.1rem; transition: transform 0.2s, color 0.2s; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; }
.col-memo .sticky-note-btn { width: 100%; height: 100%; font-size: 1.1rem; }
.col-memo-line .sticky-note-btn { width: 18px; height: 18px; font-size: 0.9rem; }
.sticky-note-btn:hover { background: rgba(0, 0, 0, 0.05); transform: scale(1.1); }
.sticky-note-btn.has-note { color: #f59e0b; }
/* モーダル内のメモ編集 */
.modal-memo { max-width: 520px; width: 90%; }
.memo-textarea { width: 100%; padding: 14px 16px; border: 1px solid var(--border-color); border-radius: 8px; font-family: inherit; font-size: 0.95rem; line-height: 1.5; resize: vertical; margin-bottom: 20px; min-height: 160px; }
.memo-textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1); }
.memo-color-picker { display: flex; gap: 12px; margin-bottom: 24px; justify-content: center; }
.color-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.color-btn:hover { transform: scale(1.1); }
.color-btn.active { border-color: var(--primary-color); transform: scale(1.2); }
.color-yellow { background-color: #fde68a; }
.color-blue { background-color: #bae6fd; }
.color-green { background-color: #bbf7d0; }
.color-pink { background-color: #fbcfe8; }
.color-purple { background-color: #ddd6fe; }
.memo-actions { display: flex; justify-content: flex-end; }
/* 詳細画面の件名横付箋（付箋は右端） */
.detail-subject-wrapper { display: flex; align-items: center; gap: 12px; width: 100%; }
.detail-subject-wrapper h2 { margin-bottom: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.25rem; font-weight: 600; }
.detail-subject-wrapper .sticky-note-btn { width: 36px; height: 36px; font-size: 1.4rem; flex-shrink: 0; }
.btn-sm { padding: 0 10px; font-size: 0.8rem; min-height: 28px; }
/* 宛先・CCタグ */
.recipient-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 32px; padding: 4px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--white); }
.recipient-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: #e0e7ff; color: #3730a3; border-radius: 4px; font-size: 0.875rem; font-weight: 500; }
.recipient-tag-remove { background: transparent; border: none; color: #3730a3; cursor: pointer; font-size: 1rem; padding: 0; margin-left: 4px; line-height: 1; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; transition: background 0.2s; }
.recipient-tag-remove:hover { background: rgba(55, 48, 163, 0.2); }
.reply-recipients, .compose-recipients { margin-bottom: 6px; display: flex; align-items: center; gap: 12px; }
.compose-recipients-row { display: flex; gap: 20px; margin-bottom: 6px; }
.compose-recipients-row .compose-recipients { flex: 1; margin-bottom: 0; }
.reply-recipients label, .compose-recipients label { font-size: 0.9rem; color: var(--text-main); }
.reply-input-group { display: flex; align-items: center; gap: 12px; }
.reply-input-group label { width: 50px; flex-shrink: 0; font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }
.reply-field { width: 100%; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.875rem; font-family: inherit; }
.reply-field:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1); }
.attachment-field-card { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 6px; background: #fff; cursor: pointer; margin-bottom: 15px; width: 100%; }
.attachment-field-card:hover { border-color: var(--primary-color); background: #f8fafc; }
.attachment-field-card .field-label { flex-shrink: 0; font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.attachment-field-card .file-list { flex: 1; font-size: 0.875rem; color: #2563eb; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.attachment-field-card .file-list:empty::before { content: "クリックして添付ファイルを追加"; color: #94a3b8; font-weight: 400; font-style: italic; font-size: 0.85rem; }
.attachment-field-card input[type="file"] { display: none !important; }
.reply-start-buttons { display: flex; gap: 10px; margin-top: 10px; }
.reply-start-buttons .btn { padding: 0 12px; min-height: 32px; font-size: 0.825rem; display: inline-flex; align-items: center; gap: 6px; }
/* Suggest.js support */
.suggest-area { position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); z-index: 10000; max-height: 200px; overflow-y: auto; width: 100%; margin-top: 4px; }
.suggest-area div { padding: 10px 14px; cursor: pointer; font-size: 0.9375rem; transition: background 0.1s; }
.suggest-area div.over { background: #f3f4f6; }
.suggest-area div.select { background: var(--primary-color) !important; color: #fff !important; }
/* Toast Notification */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 99999; display: flex; flex-direction: column-reverse; gap: 10px; }
.toast { background: #ffffff; color: #1f2937; padding: 12px 20px; border-radius: 12px; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); display: flex; align-items: center; gap: 14px; min-width: 320px; transform: translateX(120%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); cursor: pointer; border: 1px solid #e5e7eb; }
.toast.show { transform: translateX(0); }
.toast-icon { width: 44px; height: 44px; background: var(--primary-color); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; color: #fff; }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; color: #111827; }
.toast-message { font-size: 0.85rem; color: #4b5563; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-count { background: #ef4444; color: #fff; font-size: 0.7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
/* Customer Table */
.customer-table th, .customer-table td { border-bottom: 1px solid #e2e8f0; font-size: 0.9rem; }
.customer-table tr:hover { background: #f1f5f9; }
.customer-table td { padding: 10px 15px; color: #475569; }
/* Suggest Area */
.suggest-area { position: absolute; z-index: 1000; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); width: 100%; max-height: 200px; overflow-y: auto; margin-top: 2px; }
.suggest-area div { padding: 8px 12px; cursor: pointer; font-size: 0.9rem; border-bottom: 1px solid #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-area div:last-child { border-bottom: none; }
/* 振り分けルールの並び替えボタン */
.sorting-rule-item { transition: background 0.2s; border-left: 3px solid transparent; }
.sorting-rule-item:hover { background: #f9fafb !important; }
.sorting-rule-item.active { background: #eff6ff !important; border-left-color: var(--primary-color); }
.rule-reorder-btns .btn-icon { width: 26px; height: 26px; padding: 0; font-size: 0.7rem; color: #94a3b8; border: 1px solid #e2e8f0; border-radius: 4px; background: #fff; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.rule-reorder-btns .btn-icon:hover:not(:disabled) { color: var(--primary-color); border-color: var(--primary-color); background: #f5f3ff; }
.rule-reorder-btns .btn-icon:disabled { opacity: 0.3; cursor: default; background: #f8fafc; }
.suggest-area div.over { background: #f1f5f9; }
.suggest-area div.select { background: #e2e8f0; font-weight: 600; }
.suggest-area strong { color: var(--primary-color); font-weight: 700; }

/* ========== 設定管理モーダル内のリストアイテム ========== */
.signature-list-item, .mail-account-list-item, .status-list-item { display: flex; align-items: center; gap: 12px; padding: 15px 20px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: all 0.2s; background: #fff; }
.signature-list-item:hover, .mail-account-list-item:hover, .status-list-item:hover { background: #f8fafc; }
.signature-list-item.active, .mail-account-list-item.active, .status-list-item.active { background: #eff6ff; border-left: 4px solid var(--primary-color); padding-left: 16px; }
.signature-item-name, .mail-account-item-name, .status-item-name { font-weight: 600; color: #1e293b; margin-bottom: 4px; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.signature-item-preview, .mail-account-item-desc, .status-item-desc { font-size: 0.8rem; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.badge-default { background: #e0e7ff; color: #4338ca; font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.signature-list-item .btn-delete, .mail-account-list-item .btn-delete, .status-list-item .btn-delete { opacity: 0; transition: opacity 0.2s; color: #94a3b8; }
.signature-list-item:hover .btn-delete, .mail-account-list-item:hover .btn-delete, .status-list-item:hover .btn-delete { opacity: 1; color: #ef4444; }
/* AI要約のスタイル */
.thread-message-summary { margin-top: 20px; padding: 12px 16px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; }
.summary-label { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #92400e; font-size: 0.8125rem; margin-bottom: 8px; }
.summary-label i { color: #f59e0b; }
.summary-content { color: #92400e; line-height: 1.6; font-size: 0.875rem; white-space: pre-wrap; }

/* ========== Rich Editor ========== */
.rich-editor-container { display: flex; flex-direction: column; border: 1px solid var(--border-color); border-radius: 8px; background: var(--white); flex: 1; min-height: 500px; margin-bottom: 8px; overflow: hidden; }
.rich-editor-toolbar { padding: 6px 10px; background: #f8fafc; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.toolbar-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid transparent; border-radius: 4px; color: #475569; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; }
.toolbar-btn:hover { background: #e2e8f0; color: var(--text-main); }
.toolbar-btn.active { background: #e0e7ff; color: var(--primary-color); border-color: #c7d2fe; }
.toolbar-divider { width: 1px; height: 20px; background: #e2e8f0; margin: 0 6px; }
.rich-editor { flex: 1; padding: 12px 15px; overflow-y: auto; font-size: 1rem; line-height: 1.6; outline: none; min-height: 300px; word-break: break-word; }
.rich-editor:empty:before { content: attr(data-placeholder); color: #94a3b8; pointer-events: none; }
.rich-editor b, .rich-editor strong { font-weight: 700; }
.rich-editor i, .rich-editor em { font-style: italic; }
.rich-editor u { text-decoration: underline; }
.rich-editor ul, .rich-editor ol { padding-left: 25px; margin: 10px 0; }
/* 本文エディタ枠の直下：ヒント＋テンプレート（ツールバーと同系の帯） */
.rich-editor-footer-bar { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 6px 12px 8px; border-top: 1px solid var(--border-color); background: #f8fafc; }
.rich-editor-footer-bar--compose { justify-content: flex-end; }
.rich-editor-hint-text { flex: 1; min-width: 0; font-size: 0.75rem; color: #6b7280; line-height: 1.4; }
/* compose-select は 1rem のため、この帯では控えめに（ヒント・meta-controls に揃える） */
.rich-editor-footer-bar .rich-editor-footer-template.compose-select { flex-shrink: 0; margin-left: auto; min-width: 120px; max-width: min(55%, 320px); font-size: 0.8125rem; font-weight: 500; line-height: 1.35; padding: 4px 26px 4px 8px; background-position: right 8px center; background-size: 10px 10px; }

/* ========== Notification Stack (Right Bottom) ========== */
#notification-stack { position: fixed; bottom: 20px; right: 20px; z-index: 99999; width: 340px; max-height: 80vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px; scrollbar-width: thin; }
#notification-stack::-webkit-scrollbar { width: 4px; }
#notification-stack::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }
.notification-card { background: #ffffff; border-radius: 10px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05); border: 1px solid var(--border-color); padding: 9px 16px; position: relative; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; animation: slide-in-bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1); border-left: 4px solid var(--primary-color); }
.notification-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); }
@keyframes slide-in-bottom { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.notification-card-close { position: absolute; top: 5px; right: 6px; width: 16px; height: 16px; border: none; background: #f3f4f6; color: #94a3b8; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.53rem; transition: all 0.2s; }
.notification-card-close:hover { background: #fee2e2; color: #ef4444; }
.notification-card-head { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 2px; }
.notification-card-sub { display: flex; align-items: center; gap: 8px; min-width: 0; }
.notification-card-title { flex: 1; min-width: 0; font-weight: 700; font-size: 0.8125rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notification-card-meta { font-size: 0.7rem; color: #4f46e5; font-weight: 600; margin-bottom: 1px; }
.notification-card-body { font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.notification-card-sub .notification-card-body { flex: 1; min-width: 0; }
.notification-card-time { flex-shrink: 0; font-size: 0.7rem; color: #94a3b8; line-height: 1; text-align: right; }

/* 通知カードの緊急度別スタイル */
.notification-card.urgency-urgent { background-color: #fffbeb; border-left-color: #f59e0b; }
.notification-card.urgency-critical { background-color: #fef2f2; border-left-color: #ef4444; }
.notification-card.urgency-urgent .notification-card-meta { color: #b45309; }
.notification-card.urgency-critical .notification-card-meta { color: #b91c1c; }
/* 顧客情報ツールチップ */
.customer-info-tooltip { position: fixed; z-index: 10000; width: 280px; padding: 12px; background: #ffffff; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15); font-size: 0.85rem; color: #1e293b; line-height: 1.5; pointer-events: auto; }
.customer-info-tooltip .tooltip-row { margin-bottom: 8px; }
.customer-info-tooltip .tooltip-row:last-child { margin-bottom: 0; }
.customer-info-tooltip .tooltip-label { font-size: 0.725rem; font-weight: 700; color: #64748b; margin-bottom: 2px; border-bottom: 1px solid #f1f5f9; }
.customer-info-tooltip .tooltip-value { min-height: 1.2em; word-break: break-all; -webkit-user-select: text; user-select: text; font-weight: 500; }
.btn-trash-move { padding: 4px; border: none; background: transparent; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; }
.btn-trash-move:hover { background: #fee2e2; color: #dc2626 !important; transform: scale(1.1); }