/* ==========================================
   Loading Screen
   ========================================== */
.app-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.app-loading.hide {
  opacity: 0;
  visibility: hidden;
}

.app-loading__content {
  text-align: center;
}

.app-loading__logo {
  max-height: 60px;
  max-width: 250px;
  object-fit: contain;
  margin-bottom: 24px;
}

.app-loading__title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.app-loading__spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   新しいメッセージボタン
   ======================================== */

.new-message-button {
  position: fixed;
  bottom: 120px;
  right: 24px;
  z-index: 1000;

  display: flex;
  align-items: center;
  gap: 8px;

  padding: 12px 16px;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: 24px;

  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;

  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.new-message-button.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.new-message-button:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.new-message-button:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.new-message-button:active {
  transform: translateY(0) scale(0.98);
}

.new-message-button svg {
  flex-shrink: 0;
  transform: rotate(180deg);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .new-message-button {
    bottom: 90px;
    right: 16px;
    padding: 10px 14px;
    font-size: 0.8125rem;
  }

  .new-message-button svg {
    width: 18px;
    height: 18px;
  }
}

/* キャッチアップボタン */
.catch-up-button {
  position: fixed;
  bottom: 175px;
  right: 24px;
  z-index: 1000;

  display: flex;
  align-items: center;
  gap: 6px;

  padding: 10px 14px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 24px;

  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.catch-up-button:hover {
  background: var(--color-bg-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.catch-up-button svg {
  color: var(--color-accent);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .catch-up-button {
    bottom: 140px;
    right: 16px;
    padding: 8px 12px;
    font-size: 0.75rem;
  }
}

/* マーカーラインのハイライトアニメーション */
.marker-line--highlight {
  animation: marker-highlight 1.5s ease-out;
}

@keyframes marker-highlight {
  0% {
    opacity: 1;
  }
  30% {
    opacity: 0.4;
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

/* 検索機能 */
.toolbar__search-btn {
  padding: 4px;
  flex-shrink: 0;
  margin-bottom: 9px;
}

.toolbar__search-btn.hidden {
  display: none;
}

.search-bar {
  display: flex;
  margin-bottom: 6px;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.search-bar.hidden {
  display: none;
}

.search-bar__input-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

input[type='text'].search-bar__input {
  width: 100%;
  padding: 4px 50px 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-background);
  color: var(--color-text);
  font-size: 0.8rem;
  font-family: inherit;
}

input[type='text'].search-bar__input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.search-bar__counter {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

.search-bar__nav,
.search-bar__close {
  padding: 4px;
  min-width: auto;
  flex-shrink: 0;
}

.search-bar__nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .toolbar {
    gap: 4px;
    align-items: stretch;
  }

  .toolbar__left {
    gap: 4px;
    flex-wrap: nowrap;
  }

  .toolbar__filter {
    margin-bottom: 4px;
  }

  .toolbar__filter-label {
    display: none;
  }

  .search-bar {
    width: 100%;
  }

  .toolbar__search-btn {
    order: 1;
  }

  /* モバイル時の検索バー固定配置 */
  .search-bar--mobile-fixed {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 100;
    width: auto;
    padding: 0 12px 8px;
    margin: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
}

/* 検索結果ハイライト */
.message--search-match .message__bubble {
  outline: 2px solid rgba(101, 116, 205, 0.35);
  outline-offset: 1px;
  transition: all var(--animation-duration) ease;
}

.message--search-active .message__bubble {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  border: var(--color-accent-border);
  background: var(--color-accent-bg);
  box-shadow: 0 0 24px var(--color-accent-bg);
  font-weight: 500;
}

/* ローディングオーバーレイ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(2px);
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px;
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.loading-spinner .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(var(--color-accent-rgb, 101, 116, 205), 0.2);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner p {
  margin: 0;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== プラグインアクションメニュー（汎用） ===== */
.plugin-action-container {
  position: absolute;
  bottom: 4px;
  right: 8px;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.plugin-action-trigger {
  background: transparent;
  border: none;
  padding: 2px;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plugin-action-trigger:hover {
  opacity: 1;
  background: rgba(128, 128, 128, 0.15);
}

.plugin-action-trigger svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.plugin-action-menu {
  position: fixed;
  display: none;
  min-width: 160px;
  background: var(--color-surface);
  border: 1px solid rgba(var(--color-text-rgb, 128, 128, 128), 0.2);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  overflow: hidden;
}

.plugin-action-menu.show {
  display: block;
  animation: menuFadeIn 0.15s ease-out;
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.plugin-action-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(var(--color-text-rgb, 128, 128, 128), 0.1);
  cursor: pointer;
  text-align: left;
  font-size: 0.85rem;
  color: var(--color-text);
  transition: background 0.2s ease;
}

.plugin-action-menu-item:last-child {
  border-bottom: none;
}

.plugin-action-menu-item:hover {
  background: rgba(var(--color-accent-rgb, 101, 116, 205), 0.1);
}

.plugin-action-menu-item svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.plugin-action-menu-item span {
  flex: 1;
  white-space: nowrap;
}

/* ----------------------------------------
   MEDIA IMAGE TOOLS (圧縮・リサイズ)
   ---------------------------------------- */
.media-image-tools {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.image-compress-container,
.image-resize-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.compress-info,
.resize-info {
  font-size: 0.95rem;
  color: var(--color-text);
}

.compress-controls,
.resize-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.slider-group label {
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 500;
}

.quality-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-border);
  outline: none;
  cursor: pointer;
}

.quality-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quality-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.quality-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.quality-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.resize-inputs {
  display: flex;
  gap: 16px;
  width: 100%;
}

.resize-inputs .input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.resize-inputs .input-group label {
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 500;
}

.resize-inputs .input-group input {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.95rem;
}

.resize-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.resize-presets span {
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 500;
}

.btn-preset {
  padding: 6px 12px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-preset:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.compress-result,
.resize-result {
  padding: 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  display: none;
}

.compress-result.show,
.resize-result.show {
  display: block;
}

.success-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--color-status-on);
  background: rgba(76, 175, 80, 0.1);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--color-status-on);
}

.error-message {
  color: var(--color-status-off);
  background: rgba(244, 67, 54, 0.1);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--color-status-off);
}

.info-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--color-accent);
  background: rgba(99, 102, 241, 0.1);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--color-accent);
}

/* ==========================================
   Unread Line (控えめなデザイン)
   ========================================== */
.unread-line {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
  height: 1px;
  cursor: pointer;
}

.unread-line__line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border);
}

.unread-line__label {
  position: relative;
  background: var(--color-bg);
  padding: 2px 12px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  z-index: 1;
  white-space: nowrap;
}

/* ==========================================
   Marker Line (マーカーライン)
   ========================================== */
.marker-line {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  height: 8px;
  cursor: pointer;
}

.marker-line__line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border);
  opacity: 0.8;
}

.marker-line__line--top {
  top: 0;
}

.marker-line__line--bottom {
  bottom: 0;
}

.marker-line__label {
  position: relative;
  background: var(--color-bg);
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  z-index: 1;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.marker-line__icon {
  flex-shrink: 0;
  opacity: 0.7;
}

/* マーカー設置時のアニメーション */
.marker-line--entering {
  animation: markerFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes markerFadeIn {
  0% {
    opacity: 0;
    transform: scaleX(0.3);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.05);
  }
  100% {
    opacity: 1;
    transform: scaleX(1);
  }
}

/* ==========================================
   Message Spacer (メッセージ間のクリック可能エリア)
   ========================================== */
.message-spacer {
  height: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-spacer__clickable {
  /* buttonのスタイルリセット */
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;

  /* スペーサースタイル */
  width: 45%;
  height: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

/* 控えめな点線を常時表示 */
.message-spacer__clickable::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 1px;
  border-top: 1px solid var(--color-border);
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.message-spacer__clickable:hover::before {
  opacity: 0.6;
}

.message-spacer__clickable:hover {
  background-color: rgba(59, 130, 246, 0.05);
}

.message-spacer__clickable:active {
  background-color: rgba(59, 130, 246, 0.15);
  transform: scaleY(1.5);
}

.message-spacer__clickable:focus {
  outline: 2px solid rgba(59, 130, 246, 0.4);
  outline-offset: 2px;
}

/* マーカー設置済みのスペーサーは点線非表示＋高さ0 */
.message-spacer--has-marker {
  height: 0;
  margin: 0;
}

.message-spacer--has-marker .message-spacer__clickable {
  display: none;
}

/* モバイル対応 - 発見可能性向上 */
@media (max-width: 768px) {
  .message-spacer {
    height: 16px;
  }

  /* マーカー設置済みはモバイルでも高さ0 */
  .message-spacer--has-marker {
    height: 0 !important;
  }

  .message-spacer__clickable {
    width: 50%;
  }

  /* モバイルでは点線を濃く */
  .message-spacer__clickable::before {
    opacity: 0.6;
  }

  .message-spacer__clickable:hover::before {
    opacity: 0.8;
  }

  /* タップ時のフィードバック強化 */
  .message-spacer__clickable:active {
    background-color: rgba(59, 130, 246, 0.2);
    transform: scaleY(1.2);
  }
}

/* ==========================================
   Chat Search Bar (ノートと同じレイアウト)
   ========================================== */
.chat-toolbar {
  background: var(--color-bg);
  margin-bottom: 8px;
  padding-left: 16px;
  border-radius: 8px;
}

.chat-toolbar-title {
  flex: 0 0 auto;
  max-width: 180px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.chat-toolbar-title:empty {
  display: none;
}

/* チャットツールバー → 紐付きプロジェクトへのショートカット */
.chat-linked-project-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  max-width: 200px;
  transition:
    background 0.15s,
    color 0.15s;
}

.chat-linked-project-shortcut .chat-linked-project-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-linked-project-shortcut:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.chat-toolbar .chat-search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

/* 検索入力グループ（入力 + カウンター + ナビボタン） */
.chat-search-input-group {
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-color 0.15s ease;
  min-width: 120px;
  width: 280px;
  flex-shrink: 1;
}

.chat-search-input-group:focus-within {
  border-color: var(--color-accent-text);
}

input[type='text'].chat-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 0.875rem;
  box-sizing: border-box;
  min-width: 80px;
}

input[type='text'].chat-search-input:focus {
  outline: none;
}

.chat-search-counter {
  padding: 0 8px;
  font-size: 0.75rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.chat-search-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 2px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.chat-search-nav:hover:not(:disabled) {
  background: var(--color-hover);
}

.chat-search-nav:disabled {
  color: var(--color-muted);
  cursor: not-allowed;
  opacity: 0.5;
}

input[type='text'].chat-search-input::placeholder {
  color: var(--color-muted);
}

.chat-filter-select {
  padding: 10px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
  flex-shrink: 0;
}

.chat-filter-select:focus {
  outline: none;
  border-color: var(--color-accent-text);
}

.chat-participants {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .chat-toolbar {
    position: relative;
    padding: 4px 8px;
    margin-bottom: 4px;
  }

  .chat-search-bar {
    padding: 4px 8px;
    margin-bottom: 0;
  }

  .chat-search-input-group {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  .chat-search-input-group .chat-search-nav {
    width: 24px;
    height: 24px;
  }

  input[type='text'].chat-search-input {
    padding: 6px 8px;
    font-size: 0.82rem;
  }

  /* フィルタと参加者を展開メニューに格納 */
  .chat-filter-select {
    display: none;
  }

  .chat-participants {
    display: none;
  }

  /* 展開トグルボタン */
  .chat-toolbar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
  }

  .chat-toolbar-toggle:hover {
    background: var(--color-hover);
  }

  .chat-toolbar-toggle svg {
    width: 16px;
    height: 16px;
  }

  /* 展開パネル */
  .chat-toolbar-expand {
    display: none;
    gap: 6px;
    padding: 4px 0;
    align-items: center;
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .chat-toolbar-expand.is-open {
    display: flex;
  }

  .chat-toolbar-expand .chat-filter-select {
    display: block;
    padding: 6px 8px;
    font-size: 0.8rem;
    flex: 1;
    min-width: 0;
  }

  .chat-toolbar-expand .chat-participants {
    display: flex;
    margin-left: auto;
    flex-shrink: 0;
  }
}

/* デスクトップではトグルボタンと展開パネルを非表示 */
@media (min-width: 769px) {
  .chat-toolbar-toggle {
    display: none;
  }

  .chat-toolbar-expand {
    display: none;
  }
}

/* チャット→ノート化ボタン */
.chat-to-note-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.chat-to-note-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.15s;
  touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
  .chat-to-note-btn:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
  }
}

.chat-to-note-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-hover);
  z-index: 100;
  min-width: 140px;
  padding: 4px 0;
}

.chat-to-note-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 12px;
  color: var(--color-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
  .chat-to-note-option:hover {
    background: var(--color-surface-alt);
  }
}

/* ==========================================
   Tag Search Panel
   ========================================== */
.tag-search-panel {
  padding: 8px 0;
}

.tag-search-loading,
.tag-search-error {
  padding: 24px 16px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.tag-search-section {
  margin-bottom: 8px;
}

.tag-search-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-search-count {
  font-weight: 400;
  color: var(--color-text-muted);
}

.tag-search-empty {
  padding: 6px 16px 10px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.tag-search-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.12s;
}

@media (hover: hover) and (pointer: fine) {
  .tag-search-item:hover {
    background: var(--color-surface-alt);
  }
}

.tag-search-item-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tag-search-item-title {
  font-size: 0.9rem;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.tag-search-item-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 16px;
}

.tag-search-item-project,
.tag-search-item-type,
.tag-search-item-date {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-search-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tag-search-draft-badge {
  font-size: 0.72rem;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}
