@import url('../variables.css');

html {
  font-size: var(--base-font-size, 16px);
  overscroll-behavior-x: none;
}

* {
  box-sizing: border-box;
}

/* アクセシビリティ: 動きを減らす設定を持つユーザーにはアニメーションを抑制
 * - OS 設定「視差効果を減らす」「動きを減らす」相当
 * - VR 酔い・前庭疾患・集中力 への配慮
 * - ショートコード: 速度/遅延 を 0.01ms にして実質無効化（完全 none だと JS が期待する完了イベントが出ないため微小値を残す） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a,
button,
[role='button'],
input,
select,
textarea,
label {
  touch-action: manipulation;
}

*:focus-visible {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 2px;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', system-ui, sans-serif;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  /* 文字サイズ設定と連動 (utils/font-size.ts の LINE_HEIGHT_MAP)。
     大きい文字ほど行間の倍率も上げる */
  line-height: var(--base-line-height, 1.7);
  font-feature-settings: 'palt';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: all var(--animation-duration) ease;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* 背景画像オーバーレイ */
#app-bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

#main-app {
  position: relative;
  z-index: 1;
}

.app-header {
  background: var(--color-surface);
  color: var(--color-text);
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: var(--app-update-bar-height);
  z-index: 100;
  backdrop-filter: blur(10px);
}

.app-header .page {
  max-width: 100%;
}

body.chat-active .app-header {
  position: fixed;
  width: 100%;
  left: 0;
  top: var(--app-update-bar-height);
  z-index: 100;
}

body.chat-active .main-content {
  height: calc(100vh - var(--app-update-bar-height));
  padding-top: calc(70px + var(--app-update-bar-height));
  padding-bottom: 0;
  overflow: hidden;
  gap: 0;
}

body.chat-active .page {
  height: 100%;
}

body.chat-active #chat-view {
  height: 100%;
  margin-bottom: 0;
}

/* チャットレイアウト: ツールバー / (AI検索結果) / メッセージ / フォーム のグリッド */
body.chat-active .chat-layout {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100%;
  overflow: hidden;
}

/* AI検索結果が非表示の時は行を潰す */
body.chat-active .chat-layout > .chat-ai-search-result.hidden {
  display: none;
}

body.chat-active #messages {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  min-height: 0;
  max-height: none;
}

body.chat-active #message-form {
  padding: 12px 24px 24px;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
}

.app-header__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.status-badge {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
}

.status-badge--connecting {
  color: var(--color-status-warn);
}

.status-badge--online {
  color: var(--color-status-ok);
}

.status-badge--offline {
  color: var(--color-status-off);
}

.app-header__hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--color-muted);
}

.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  margin-left: 300px;
  /* 80px (main) + 220px (sub) = サイドメニュー実幅ぴったり。過剰だと左余白だけ広くなる */
}

.sidebar {
  width: 280px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  z-index: 50;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
}

.sidebar__header {
  padding: 24px;
  border-bottom: 1px solid var(--color-border);
}

.sidebar__mobile-toggle {
  display: none;
}

.sidebar__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--color-text);
}

.sidebar__subtitle {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin: 0;
}

.sidebar__content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.sidebar__section {
  margin-bottom: 24px;
}

.sidebar__section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 12px 0;
  padding: 0 8px;
}

.sidebar__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar__menu-item {
  margin-bottom: 4px;
}

.sidebar__section-header {
  padding: 12px 16px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-muted);
  letter-spacing: 0.05em;
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  list-style: none;
}

.sidebar__section-header:first-child {
  border-top: none;
  margin-top: 0;
}

/* グループ / ダイレクトの見出し (「+ セクション」を右端に寄せる。両方に同じ形を当てる) */
.sidebar__section-header--groups,
.sidebar__section-header--directs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
}

/* 見出しのラベル: クリックで配下セクションを一括開閉する */
.sidebar__section-toggle-label {
  cursor: pointer;
}

/* 最近見たチャット (自分専用ショートカット。既存リストと分離、非 draggable) */
.sidebar__section-header--recent-views {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar__section-recent-label {
  cursor: pointer;
}

.chat-recent-view-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.chat-recent-view-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.chat-recent-view-time {
  flex-shrink: 0;
  font-size: 0.6875rem;
  color: var(--color-text-tertiary, #8a94a6);
}

.sidebar__section-header--custom {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 8px;
  background: var(--color-surface);
  border-top: none;
  margin-top: 8px;
}

.sidebar__section-add-btn {
  margin-left: auto;
  padding: 2px 6px;
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 0.6875rem;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0.35;
  transition: opacity 0.15s;
}

.sidebar__section-header--groups:hover .sidebar__section-add-btn,
.sidebar__section-header--directs:hover .sidebar__section-add-btn {
  opacity: 1;
}

.sidebar__section-chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--color-muted);
}

.sidebar__section-chevron-icon {
  transition: transform 0.2s ease;
  transform: rotate(90deg);
}

.sidebar__section-chevron.collapsed .sidebar__section-chevron-icon {
  transform: rotate(0deg);
}

.sidebar__section-custom-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  text-transform: none;
}

.sidebar__section-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.35;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.sidebar__section-header--custom:hover .sidebar__section-actions {
  opacity: 1;
}

.sidebar__section-action-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 3px;
  color: var(--color-muted);
}

.sidebar__section-action-btn:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.sidebar__section-action-btn--danger:hover {
  color: var(--color-error, #e53e3e);
}

/* セクション折りたたみ時の未読合計バッジ */
.sidebar__section-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--color-accent-strong, #7986cb);
  color: #fff;
  border-radius: 8px;
  flex-shrink: 0;
  margin-right: 2px;
}

/* セクションヘッダーのドラッグ操作 */
.sidebar__section-header--custom[draggable='true'] {
  cursor: grab;
  user-select: none;
}

.sidebar__section-header--custom.section-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.sidebar__section-header--custom.section-drag-over {
  box-shadow: 0 -2px 0 0 rgba(100, 150, 255, 0.9);
}

/* 空セクションでもチャットをドロップできるよう最小高さを確保 */
.chat-section-container:not(.collapsed) {
  min-height: 24px;
  padding-top: 4px;
}

.chat-section-name-popup {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.12);
  padding: 10px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-section-name-popup__input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.8125rem;
  box-sizing: border-box;
}

.chat-section-name-popup__input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.chat-section-name-popup__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.chat-section-name-popup__btn {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
}

.chat-section-name-popup__btn--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.chat-move-section-panel {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  min-width: 180px;
  overflow: hidden;
}

.chat-move-section-panel__title {
  padding: 8px 12px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-muted);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}

.chat-move-section-panel__list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.chat-move-section-panel__item {
  display: block;
  width: 100%;
  padding: 7px 12px;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 0.8125rem;
  cursor: pointer;
}

.chat-move-section-panel__item:hover {
  background: var(--color-target);
}

.chat-move-section-panel__item.current {
  color: var(--color-accent-strong);
  font-weight: 500;
}

.guest-chat-message {
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: 12px;
  margin: 16px 0;
}

.guest-chat-message button:hover {
  background: var(--color-accent-strong) !important;
}

.sidebar__menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.85rem;
  transition: all var(--animation-duration) ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .sidebar__menu-link:hover {
    background: var(--color-target);
    color: var(--color-accent-strong);
  }

  .sidebar__menu-link--active:hover {
    background: var(--color-target);
    color: var(--color-accent-strong);
  }
}

.sidebar__menu-link--active {
  background: rgba(168, 184, 232, 0.12);
  color: var(--color-accent-strong);
  border-radius: 8px;
  font-weight: 500;
}

/* ホームチャット（デフォルトチャット）の特別スタイル */
.sidebar__menu-link--home {
  font-weight: 500;
}

.sidebar__menu-icon {
  width: 1.125rem !important;
  height: 1.125rem !important;
  max-width: 1.125rem !important;
  max-height: 1.125rem !important;
  min-width: 1.125rem !important;
  min-height: 1.125rem !important;
  flex-shrink: 0;
  display: block !important;
}

/* 1対1チャットのアバター画像 */
.sidebar__menu-avatar {
  width: 18px !important;
  height: 18px !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block !important;
}

/* プライベートチャット専用スタイル */
.sidebar__menu-link--private {
  position: relative;
}

.sidebar__menu-link--private::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 50%;
  opacity: 0.7;
}

.sidebar__menu-link--private .sidebar__menu-icon {
  color: var(--color-primary);
  opacity: 0.9;
}

/* 未読チャット表示 */
.chat-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-name--unread {
  font-weight: 700;
}

.chat-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--color-accent-strong, #7986cb);
  color: #fff;
  border-radius: 10px;

  /* Absolute positioning for consistent alignment */
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.2s ease;
}

/* Hide badge when hovering over the link (to show options button) */
@media (hover: hover) and (pointer: fine) {
  .sidebar__menu-link:hover .chat-unread-badge {
    opacity: 0;
  }
}

/* SVGアイコンの強制サイズ調整。
   包む .sidebar__menu-icon と同じ値にする (片方だけ px で残すと枠から突き出る) */
.sidebar__menu-link svg {
  width: 1.125rem !important;
  height: 1.125rem !important;
  max-width: 1.125rem !important;
  max-height: 1.125rem !important;
  min-width: 1.125rem !important;
  min-height: 1.125rem !important;
  flex-shrink: 0;
}

/* お気に入りアイコンコンテナ */
.chat-icon-container {
  position: relative;
  display: inline-block;
}

/* お気に入り星バッジ（上記ルールから除外） */
.sidebar__menu-link svg.chat-favorite-star-badge {
  position: absolute !important;
  bottom: -3px !important;
  right: -3px !important;
  width: 10px !important;
  height: 10px !important;
  max-width: 10px !important;
  max-height: 10px !important;
  min-width: 10px !important;
  min-height: 10px !important;
  background-color: var(--sidebar-bg, #2c2c2c) !important;
  border-radius: 50% !important;
  padding: 1px !important;
}

/* タグ削除ボタン */
.sidebar__menu-item {
  position: relative;
}

.tag-edit-btn,
.tag-delete-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0;
  z-index: 10;
}

.tag-edit-btn {
  right: 32px;
}

.tag-edit-btn svg {
  width: 14px;
  height: 14px;
}

.tag-delete-btn {
  right: 8px;
  font-size: 0.875rem;
  font-weight: bold;
}

@media (hover: hover) and (pointer: fine) {
  .sidebar__menu-item:hover .tag-edit-btn,
  .sidebar__menu-item:hover .tag-delete-btn {
    opacity: 1;
  }

  .tag-edit-btn:hover {
    background: var(--color-accent);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
  }

  .tag-delete-btn:hover {
    background: var(--color-danger);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
  }
}

/* チャットアイテムコンテナ */
.chat-item-container {
  display: flex;
  align-items: center;
  position: relative;
}

.chat-item-container .sidebar__menu-link {
  flex: 1;
  margin-right: 4px;
}

/* チャットオプションボタン */
.chat-options-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--animation-duration) ease;
  flex-shrink: 0;

  /* Absolute positioning */
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

@media (hover: hover) and (pointer: fine) {
  .chat-item:hover .chat-options-btn {
    opacity: 1;
  }

  .chat-options-btn:hover {
    background: var(--color-target);
    color: var(--color-accent-strong);
  }
}

/* チャットオプションメニュー */
.chat-options-menu {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.12);
  padding: 8px 0;
  z-index: 1000;
  min-width: 140px;
  position: absolute;
}

.chat-options-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chat-options-list li {
  margin: 0;
}

.chat-options-list button {
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 16px;
  text-align: left;
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--animation-duration) ease;
}

.chat-options-list button:hover {
  background: var(--color-target);
  transform: translateX(2px);
}

.chat-options-list button.delete-option {
  color: #dc3545;
}

.chat-options-list button.delete-option:hover {
  background: #dc3545;
  color: var(--color-button-text);
  transform: translateX(2px);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: padding-right 0.25s ease;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  padding: 0 24px;
  flex: 1;
}

/* サイドパネルが開いてる時はコンテンツを左寄せ */
body.side-panel-open .page {
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.page--full-width {
  max-width: none;
  padding: 0;
}

main {
  padding: 12px 0 36px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

#chat-view {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

/* ビュー切り替えフェードアニメーション */
#dashboard-view,
#profile-view,
#admin-view,
#media-view,
#knowledge-detail-view,
#knowledge-editor-view {
  display: none;
}

#dashboard-view.active,
#profile-view.active,
#admin-view.active,
#media-view.active,
#chat-view.active,
#knowledge-view.active,
#knowledge-detail-view.active,
#knowledge-editor-view.active {
  display: block;
  animation: view-fade-in 0.15s ease-out;
}

@keyframes view-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  color: var(--color-muted);
}

.toolbar__left {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.toolbar__filter {
  display: flex;
  flex-direction: row;
  gap: 6px;
  margin: 16px 0 8px;
  align-items: center;
  font-size: 0.7rem;
  color: var(--color-muted);
}

.toolbar__filter span {
  white-space: nowrap;
  font-weight: 400;
}

.toolbar__filter select {
  font-size: 0.75rem;
  padding: 6px 10px;
  border-width: 1px;
}

select,
input[type='text'],
textarea {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 0.5rem;
  /* 余白と角丸も文字サイズ設定に連動させる (標準 = 8px 12px / 8px で従来どおり)。
     モバイルは iOS のズーム対策で文字だけ 16px に底上げされるため、
     余白まで固定すると「小さめ」を選んでも入力欄だけ大きいまま浮く */
  padding: 0.5rem 0.75rem;
  font-size: 0.92rem;
  transition: all var(--animation-duration) cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--color-text);
  font-family: inherit;
}

select {
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.theme-dark select {
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

select:focus,
input[type='text']:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent-text);
}

#messages {
  flex: 1;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  padding: 20px;
  margin: 8px 0 240px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-soft);
  max-height: calc(100vh - 280px);
  min-height: 74vh;
}

#messages::-webkit-scrollbar {
  width: 8px;
}

#messages::-webkit-scrollbar-track {
  background: var(--color-bg);
  border-radius: 4px;
}

#messages::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
  transition: background var(--animation-duration);
}

#messages::-webkit-scrollbar-thumb:hover {
  background: var(--color-muted);
}

.messages__empty {
  color: var(--color-muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 32px 0;
}

.message {
  margin-bottom: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  will-change: transform;
  --bubble-bg: var(--color-surface);
  --bubble-border: var(--color-border);
  --bubble-text: var(--color-text);
  --bubble-shadow: var(--shadow-soft);
  animation: messageSlide var(--message-motion-duration) cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.message::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 0;
  right: 0;
  height: 40px;
  z-index: 5;
  pointer-events: none;
}

@keyframes messageSlide {
  to {
    transform: translateY(0);
  }
}

.message:last-child {
  margin-bottom: 0;
}

.message__bubble {
  padding: 14px 18px;
  border-radius: 24px;
  position: relative;
  word-wrap: break-word;
  border: 1px solid var(--bubble-border);
  background: var(--bubble-bg);
  color: var(--bubble-text);
  box-shadow: var(--bubble-shadow);
  transition: all var(--animation-duration) ease;
  backdrop-filter: blur(10px);
  width: fit-content;
  /* 短文でも一定の見た目の安定感を確保するため min-width を引き上げ。
     120px だとアバターの右に小さな点のような吹き出しになり、
     コンテンツによってサイズがバラついて見える原因になっていた。 */
  min-width: 240px;
  max-width: 65%;
}

.message:hover .message__bubble {
  box-shadow: var(--shadow-hover);
}

.theme-dark .message__bubble {
  border: 1px solid var(--bubble-border);
  background: var(--bubble-bg);
  box-shadow: var(--bubble-shadow);
}

/* ピン留めメッセージバー */
.pinned-message-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-surface);
  border: 2px solid rgba(var(--color-accent-rgb), 0.8);
  border-radius: 8px;
  font-size: 0.82rem;
  flex-shrink: 0;
  margin-bottom: 4px;
}

.pinned-message-bar__icon {
  flex-shrink: 0;
  opacity: 0.85;
  color: var(--color-accent);
}

.pinned-message-bar__body {
  flex: 1;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--color-text);
}

.pinned-message-bar__body:hover {
  text-decoration: underline;
}

.pinned-message-bar__unpin {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.6;
}

.pinned-message-bar__unpin:hover {
  opacity: 1;
}

/* ピンボタン（アクティブ状態） */
.message__action-btn.pin.pinned svg {
  stroke: var(--color-accent);
}

/* システムメッセージ（ウェルカムメッセージ等） */
.message--system {
  align-self: center;
  align-items: center;
  width: 100%;
  max-width: 540px;
}

.message--system .message__bubble {
  background: transparent;
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 12px;
  color: var(--color-text-muted, #999);
  font-size: 0.85rem;
  text-align: center;
  box-shadow: none;
  padding: 12px 20px;
  /* 鬼教官 H-1（チャット吹き出しレビュー）対応:
     通常 bubble の min-width: 240px を継承すると system メッセージ（短文中央寄せ）
     で余白過多になるため上書き解除。 */
  min-width: 0;
}

.theme-dark .message--system .message__bubble {
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.5);
}

.message--system .message__actions,
.message--system .message__reactions {
  display: none;
}

.message--other {
  align-self: flex-start;
  align-items: flex-start;
}

.message--other .message__bubble {
  border-radius: 4px 24px 24px 24px;
}

.message--self {
  /* align-self: flex-end は親 (#messages の stretch) を override して
     .message--self の幅を content size (= bubble の min-width 240px) に
     縛ってしまい、 中の bubble の max-width: 65% が本来の 65% を取れない
     原因だった。 親の stretch に任せて、 中の bubble の右寄せは
     align-items: flex-end (cross-axis: 横軸方向の子の寄せ) だけで十分。 */
  align-items: flex-end;
}

.message--self .message__bubble {
  justify-self: flex-end;
  border-radius: 24px 4px 24px 24px;
}

.message--target:not(.message--self) {
  --bubble-shadow: 0 0 0 2px rgba(101, 116, 205, 0.28), var(--shadow-soft);
}

/* 送信メッセージ（自分） */
.message--self .message__bubble {
  --bubble-bg: var(--self-bg-light, #e8e7e6);
  --bubble-border: var(--self-border-light, #585858);
  --bubble-text: var(--self-text-light, #121110);
  --bubble-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.theme-dark .message--self .message__bubble {
  --bubble-bg: var(--self-bg, #424749);
  --bubble-border: var(--self-border, #a7a7a7);
  --bubble-text: var(--self-text, #edeef1);
  --bubble-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* 受信メッセージ（他人） */
.message--other .message__bubble {
  --bubble-bg: var(--other-bg-light, #c9cac6);
  --bubble-border: var(--other-border-light, #8e8f80);
  --bubble-text: var(--other-text-light, #121110);
  --bubble-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.theme-dark .message--other .message__bubble {
  --bubble-bg: var(--other-bg, #363539);
  --bubble-border: var(--other-border, #71707f);
  --bubble-text: var(--other-text, #edeef1);
  --bubble-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.message__header {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.message--self .message__header {
  justify-content: flex-end;
}

.message__from {
  font-weight: 600;
  color: var(--color-text);
}

.message__arrow {
  color: var(--color-text-tertiary);
}

.message__to {
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* クリック可能なユーザーのホバー効果（イベント委譲で処理） */
.message__sender-username,
.message__recipient-name {
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 3px;
  padding: 1px 4px;
  margin: -1px -4px;
}

.message__sender-username:hover,
.message__recipient-name:hover {
  background: var(--color-hover);
  color: var(--color-accent-text);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.message__time {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-tertiary);
}

.message__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: 4px;
}

.message--other .message__avatar {
  margin-left: 0;
  margin-right: 4px;
}

.message__avatar--clickable {
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.message__avatar--clickable:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message__body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  /* 本文は文字サイズ設定に連動させる (標準 = 1.4 で従来どおり、 大きくすると行間も広がる) */
  line-height: var(--line-height-tight, 1.4);
}

/* Markdown対応メッセージのスタイル */
.message__body--markdown {
  white-space: normal;
}

.message__body--markdown h2,
.message__body--markdown h3,
.message__body--markdown h4 {
  margin: 0.5em 0 0.25em;
  font-weight: 600;
}
.message__body--markdown h2 {
  font-size: 1.2em;
}
.message__body--markdown h3 {
  font-size: 1.1em;
}
.message__body--markdown h4 {
  font-size: 1em;
}

.message__body--markdown ul,
.message__body--markdown ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}
.message__body--markdown li {
  margin: 0.25em 0;
}

.message__body--markdown code {
  background: var(--color-code-bg, rgba(127, 127, 127, 0.15));
  color: var(--color-code-text, inherit);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}

.message__body--markdown pre {
  background: var(--color-code-bg, rgba(127, 127, 127, 0.15));
  color: var(--color-code-text, inherit);
  padding: 0.75em;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.5em 0;
}
.message__body--markdown pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.message__body--markdown blockquote {
  border: 1px solid var(--color-border);
  background: rgba(var(--color-accent-rgb, 101, 116, 205), 0.04);
  border-radius: 6px;
  margin: 0.5em 0;
  padding: 0.6em 1em;
  color: var(--color-text-secondary);
}

.message__body--markdown table {
  border-collapse: collapse;
  margin: 0.5em 0;
  width: 100%;
}
.message__body--markdown th,
.message__body--markdown td {
  border: 1px solid var(--color-border);
  padding: 0.4em 0.6em;
  text-align: left;
}
.message__body--markdown th {
  background: var(--color-surface);
  font-weight: 600;
}

.message__body--markdown p {
  margin: 0.5em 0;
}
.message__body--markdown p:first-child {
  margin-top: 0;
}
.message__body--markdown p:last-child {
  margin-bottom: 0;
}

.mention {
  background: rgba(var(--color-bg-rgb), 0.2);
  color: var(--color-accent-text);
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.mention:hover {
  background: rgba(var(--color-bg-rgb), 0.4);
  color: var(--color-accent-hover);
}

.theme-dark .mention {
  background: rgba(var(--color-bg-rgb), 0.04);
  color: var(--color-accent-text);
}

.theme-dark .mention:hover {
  background: rgba(var(--color-bg-rgb), 0.12);
  color: var(--color-accent-hover);
}

/* メッセージ内のリンク */
.message-link,
.auto-link {
  color: var(--color-link);
  text-decoration: none;
  /* word-break: break-all はリンクの min-content を 1 文字幅まで縮めるため、
     親の `.message__bubble { width: fit-content }` が極端に狭くなる原因になっていた。
     overflow-wrap でコンテナを溢れたときだけ切る方針に変更し、 URL 全体の幅を
     min-content として保持する。 max-width (65%) を超えたら自然に折り返される。 */
  word-break: normal;
  overflow-wrap: break-word;
  transition: all 0.2s ease;
}

.message-link:hover,
.auto-link:hover {
  text-decoration: underline;
}

.message__actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.message__actions:hover {
  opacity: 0.8;
}

.message__action-btn {
  background: transparent;
  border: none;
  color: rgba(var(--color-text-rgb, 128, 128, 128), 0.95);
  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;
}

.message__action-btn:hover {
  color: var(--color-accent-text);
  background: rgba(var(--color-accent-rgb, 101, 116, 205), 0.1);
}

.message__action-btn.delete:hover {
  color: rgba(222, 147, 147, 1);
  background: rgba(222, 147, 147, 0.1);
}

/* リアクション関連スタイル */
.message__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}

.message__reaction-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(var(--color-text-rgb, 128, 128, 128), 0.2);
  background: rgba(var(--color-surface-rgb, 255, 255, 255), 0.5);
  color: var(--color-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.message__reaction-item:hover {
  border-color: var(--color-accent-text);
  background: rgba(var(--color-accent-rgb, 101, 116, 205), 0.1);
  transform: scale(1.05);
}

.message__reaction-item--active {
  border-color: var(--color-accent-text);
  background: rgba(var(--color-accent-rgb, 101, 116, 205), 0.2);
}

.message__reaction-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.message__reaction-icon svg {
  width: 100%;
  height: 100%;
}

.message__reaction-count {
  font-weight: 500;
  font-size: 0.8rem;
  min-width: 12px;
  text-align: center;
}

.message__reaction-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px dashed rgba(var(--color-text-rgb, 128, 128, 128), 0.3);
  background: transparent;
  color: rgba(var(--color-text-rgb, 128, 128, 128), 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.message__reaction-add-btn:hover {
  border-color: var(--color-accent-text);
  color: var(--color-accent-text);
  background: rgba(var(--color-accent-rgb, 101, 116, 205), 0.1);
  transform: scale(1.1);
}

/* リアクションピッカー */
.reaction-picker {
  position: fixed;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid rgba(var(--color-text-rgb, 128, 128, 128), 0.2);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  max-width: 360px;
  animation: pickerFadeIn 0.15s ease-out;
}

/* ピッカーのフェードインアニメーション */
@keyframes pickerFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 下に表示される場合のアニメーション */
.reaction-picker--below {
  animation: pickerFadeInBelow 0.15s ease-out;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reaction-picker__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-picker__item svg {
  width: 24px;
  height: 24px;
}

.reaction-picker__item:hover {
  background: rgba(var(--color-accent-rgb, 101, 116, 205), 0.1);
  border-color: var(--color-accent-text);
  transform: scale(1.15);
}

/* ダークテーマ対応 */
.theme-dark .message__reaction-item {
  background: rgba(31, 31, 31, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.theme-dark .message__reaction-item:hover {
  background: rgba(101, 116, 205, 0.2);
}

.theme-dark .message__reaction-item--active {
  background: rgba(101, 116, 205, 0.3);
}

.theme-dark .reaction-picker {
  background: rgba(31, 31, 31, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.theme-dark .reaction-picker__item:hover {
  background: rgba(101, 116, 205, 0.2);
}

/* 汎用リアクションバー（ノート・メディア等、チャット以外のコンテンツ向け） */
/* 既存 .message__reaction-* とは別の中立名前空間。見た目は揃える。 */
.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.reaction-bar__item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(var(--color-text-rgb, 128, 128, 128), 0.2);
  background: rgba(var(--color-surface-rgb, 255, 255, 255), 0.5);
  color: var(--color-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-bar__item:hover {
  border-color: var(--color-accent-text);
  background: rgba(var(--color-accent-rgb, 101, 116, 205), 0.1);
  transform: scale(1.05);
}

.reaction-bar__item--active {
  border-color: var(--color-accent-text);
  background: rgba(var(--color-accent-rgb, 101, 116, 205), 0.2);
}

.reaction-bar__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.reaction-bar__icon svg {
  width: 100%;
  height: 100%;
}

.reaction-bar__count {
  font-weight: 500;
  font-size: 0.8rem;
  min-width: 12px;
  text-align: center;
}

.reaction-bar__add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px dashed rgba(var(--color-text-rgb, 128, 128, 128), 0.3);
  background: transparent;
  color: rgba(var(--color-text-rgb, 128, 128, 128), 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-bar__add:hover {
  border-color: var(--color-accent-text);
  color: var(--color-accent-text);
  background: rgba(var(--color-accent-rgb, 101, 116, 205), 0.1);
  transform: scale(1.1);
}

.theme-dark .reaction-bar__item {
  background: rgba(31, 31, 31, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.theme-dark .reaction-bar__item:hover {
  background: rgba(101, 116, 205, 0.2);
}

.theme-dark .reaction-bar__item--active {
  background: rgba(101, 116, 205, 0.3);
}

/* ノート閲覧モードのリアクションバー配置 */
.knowledge-detail-reactions {
  margin-top: 20px;
}

/* 上部バー（メタ情報の直下）はタイトル付近に寄せるため余白を詰める */
.knowledge-detail-reactions--top {
  margin-top: 10px;
  margin-bottom: 4px;
}

/* メディア詳細パネルのリアクションバー配置 (プレビュー直下アクション行の左端) */
.media-side-panel-reactions {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
}
.media-side-panel-reactions:empty {
  display: none;
}

/* ナレッジから元メッセージへのリンク */
.knowledge-source-message {
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(var(--color-accent-rgb, 101, 116, 205), 0.08);
  border: 1px solid rgba(var(--color-accent-rgb, 101, 116, 205), 0.4);
  border-radius: 6px;
}

.knowledge-source-message-link {
  color: var(--color-accent-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity 0.2s ease;
}

.knowledge-source-message-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.theme-dark .knowledge-source-message {
  background: rgba(101, 116, 205, 0.1);
}

/* 編集モード用スタイル */
.message__edit-form {
  display: none;
  width: 100%;
  margin-top: 8px;
}

.message__edit-textarea {
  width: 100%;
  /* min-width: 400px は親 .message__bubble (max-width: 65%) を押し広げて
     編集 textarea が吹き出しからはみ出る原因だった。
     親 bubble 幅に追従させるため min-width を解除。
     編集モード時は .message--editing .message__bubble 側で十分な幅を確保する。 */
  min-width: 0;
  min-height: 180px;
  height: auto;
  max-height: 400px;
  padding: 12px 16px;
  border: 2px solid var(--color-accent-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  /* 鬼教官 M-3（チャット吹き出しレビュー）対応:
     resize: vertical だとユーザーが手動で textarea を伸ばし bubble の
     max-height を超えて見切れる事故が起きる。max-height で十分なスクロールが
     提供されるため手動リサイズは不要。 */
  resize: none;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.message__edit-textarea:focus {
  border-color: var(--color-accent-strong);
}

.message__edit-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

.message__edit-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.message__edit-btn--save {
  background: var(--color-accent-bg);
  color: var(--color-button-text);
}

.message__edit-btn--save:hover {
  background: var(--color-accent-strong);
}

.message__edit-btn--cancel {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.message__edit-btn--cancel:hover {
  background: var(--color-target);
}

.message--editing .message__body {
  display: none;
}

.message--editing .message__edit-form {
  display: block;
}

/* 編集モード時、textarea を快適に編集できる幅を吹き出し側で確保する。
   通常時は fit-content + max-width: 65% でコンテンツに合わせるが、
   編集中は十分な編集領域を確保しつつ、self/other の左右寄せ（align-self）が
   壊れないよう width: fit-content を維持して min-width で底上げする。
   - min-width 420px: textarea が快適に書ける最低幅
   - max-width 720px: 4K 等の超ワイド画面で過大に広がるのを抑える上限
   鬼教官 H-2 対応で width: 100% は使わない（self の右寄せが消えるため）。 */
.message--editing .message__bubble {
  min-width: 420px;
  max-width: 720px;
}

/* 鬼教官 L-1 対応: 編集中はホバーシャドウを抑止（広い bubble で目立つため） */
.message--editing:hover .message__bubble {
  box-shadow: var(--bubble-shadow);
}

/* 退職済みユーザーのアバター */
.avatar--deleted {
  filter: grayscale(1);
  opacity: 0.5;
}

/* チャット 日付セパレーター (sticky で上端追従、 Slack 風)
 * 通常時 (フロー内) は中央ラベル + 両側の薄い横線。
 * 上端に貼り付いた時 (is-stuck) は横線を消してラベルだけにする
 * (横線がコンテンツに被って見づらくなるのを避けるため)。
 * `top: -1px` トリックで IntersectionObserver が threshold:[1] で stuck を検出できる。
 */
.message-date-separator {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.75rem 0 0.5rem;
  pointer-events: none;
}
.message-date-separator::before,
.message-date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
/* 上端に貼り付いてる時は横線を消す (コンテンツとの被り回避) */
.message-date-separator.is-stuck::before,
.message-date-separator.is-stuck::after {
  content: none;
}
.message-date-separator__label {
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  white-space: nowrap;
  pointer-events: auto;
}

/* ===== PWA インストールヒント (ログイン画面) ===== */
.pwa-login-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
}

.pwa-login-hint__label {
  background: none;
  border: none;
  color: var(--color-text-secondary, #8a93a5);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 4px;
}

.pwa-login-hint__label:hover {
  color: var(--color-text, #e0e0e0);
}

.pwa-login-hint__dismiss {
  background: none;
  border: none;
  color: var(--color-text-secondary, #8a93a5);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 6px 8px;
}

/* マイページ: PWA カードの説明文 */
.profile-pwa-status {
  font-size: 0.85rem;
  color: var(--color-text-secondary, #8a93a5);
  margin: 0 0 10px;
}
