* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Noto Sans JP', sans-serif;
}

input, textarea, select, button {
  font-family: inherit;
}

/* トースト通知アニメーション */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* SmartPortalデザインシステム移行: 管理コンソール（admin.html/users.html）も
   一般画面と同じ藍色（--color-accent）をブランドカラーとして使う（管理/一般の
   ブランド色分岐は廃止し、藍色に統一）。--success/--danger/--warning は
   ブランドカラーとは独立した機能的な意味色のため、--dt-accent-success /
   --color-status-* の意味的な対応を維持する（ブランド色の変更に影響されない）。 */
:root {
  --page-bg: var(--color-bg-subtle, #f0f2f5);
  --surface-bg: var(--color-surface, #ffffff);
  --surface-subtle: var(--color-bg-subtle, #f7f9fc);
  --text-main: var(--color-text, #0a0f1a);
  --text-muted: var(--color-text-muted, #4a5568);
  --text-light: var(--color-text-subtle, #6b7280);
  --accent-main: var(--color-accent, #1e3a5f);
  --accent-strong: var(--color-accent-hover, #16293f);
  --accent-soft: var(--color-accent-soft, rgba(30, 58, 95, 0.10));
  --accent-gradient: var(--color-accent, #1e3a5f);
  --success: var(--dt-accent-success, #059669);
  --danger: var(--color-status-incident, #dc2626);
  --warning: var(--color-status-maintenance, #d97706);
  --border-color: var(--color-border, #e2e8f0);
  --radius-large: 16px;
  --radius-medium: var(--radius-md, 12px);
  --radius-small: var(--radius-sm, 8px);
  --shadow-soft: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
  --shadow-medium: var(--shadow-md, 0 4px 12px rgba(15, 23, 42, 0.08));
  --shadow-large: var(--shadow-lg, 0 8px 24px rgba(15, 23, 42, 0.10));
  --font-base: var(--font-family, 'Roboto', 'Noto Sans JP', sans-serif);
  --transition-fast: var(--transition-fast, 0.15s cubic-bezier(0.4, 0, 0.2, 1));
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* ACL モーダル互換エイリアス（.acl-* が参照する未定義変数を既存ダーク対応変数へマップ） */
  --bg-primary: var(--surface-bg);            /* #ffffff (light) / #161b22 (dark) */
  --bg-secondary: var(--surface-subtle);      /* #f7f9fc (light) / #1c2128 (dark) */
  --text-primary: var(--text-main);           /* #0a0f1a (light) / #e6edf3 (dark) */
  --border-main: var(--border-color);         /* #e2e8f0 (light) / #30363d (dark) */
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: var(--color-bg-subtle) !important;
    --surface-bg: var(--color-surface) !important;
    --surface-subtle: var(--color-bg-subtle) !important;
    --text-main: var(--color-text) !important;
    --text-muted: var(--color-text-muted) !important;
    --text-light: var(--color-text-subtle) !important;
    --accent-main: var(--color-accent) !important;
    --accent-strong: var(--color-accent-hover) !important;
    --accent-soft: var(--color-accent-soft) !important;
    --accent-gradient: var(--color-accent) !important;
    --success: var(--dt-accent-success) !important;
    --danger: var(--color-status-incident) !important;
    --border-color: var(--color-border) !important;
    --shadow-soft: var(--shadow-sm) !important;
    --shadow-medium: var(--shadow-md) !important;
    --shadow-large: var(--shadow-lg) !important;
  }

  body {
    background: var(--color-bg) !important;
    color: var(--color-text) !important;
  }
}

body {
  background: var(--page-bg);
  color: var(--text-main);
  font-family: var(--font-family, 'Roboto', 'Noto Sans JP', sans-serif) !important;
  font-size: 13.5px;
  line-height: 1.65;
  min-height: 100vh;
  letter-spacing: 0.01em;
}

* {
  font-family: var(--font-family, 'Roboto', 'Noto Sans JP', sans-serif);
}

a {
  color: var(--accent-main);
  text-decoration: none;
}

button {
  font-family: inherit;
}

.main-wrapper {
  min-height: 100vh;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  height: 56px;
  background: var(--surface-bg);
  border-bottom: none;
  box-shadow: none;
  position: relative;
  z-index: 100;
}

.app-header__inner {
  height: 56px;
  width: 100%;
  padding: 0 70px 0 20px;
  display: flex;
  align-items: center;
}

.app-header__row {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  width: 100%;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.app-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-main);
  flex-shrink: 0;
}

.app-logo .lucide-icon {
  margin: 0;
}

.app-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-main);
  line-height: 1;
}

.brand-accent-text {
  color: var(--accent-main);
}

/* ヘッダー内ボタンの縦幅統一 */
.app-header__toolbar-row .btn-primary {
  padding: 10px 18px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
  height: auto !important;
  white-space: nowrap !important;
}

.app-header__toolbar-row {
  flex-wrap: nowrap;
}

.app-header .btn-secondary {
  background: var(--surface-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.app-header .btn-secondary:hover {
  background: #edf0f4;
}

.header-menu-item .lucide-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.header-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.app-header__status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ヘッダー: ロゴ直後に検索(flex:1;max-width:420px)、その後ろのアクション群は
   margin-left:autoで右端に固定（検索欄が狭くても右端の位置は動かない） */
.app-header__toolbar-row {
  display: none;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

body.admin-logged-in .app-header__toolbar-row {
  display: flex;
}

.app-header__toolbar-row .room-search-bar-container {
  flex: 1;
  max-width: 420px;
  min-width: 160px;
}

.app-header__toolbar-row .room-search-bar-container .filter-container {
  margin: 0;
}

.app-header__toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* ハンバーガーメニュー */
.hamburger-menu {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 3000;
  display: none;
}

/* ログイン後のみ表示（ログイン前はメニュー項目が無いため非表示） */
body.admin-logged-in .hamburger-menu {
  display: block;
}

.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-small);
  cursor: pointer;
  position: relative;
  z-index: 1001;
  box-shadow: none;
  transition: background 0.2s ease;
}

.hamburger-btn:hover {
  background: var(--surface-subtle);
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
  height: 18px;
  margin: auto;
  justify-content: center;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn.active .hamburger-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger-btn.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.hamburger-dropdown {
  display: none;
  position: fixed;
  top: 60px;
  right: 16px;
  min-width: 220px;
  max-width: 280px;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-soft);
  z-index: 3001;
  overflow: hidden;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.hamburger-dropdown.show {
  display: block;
}

.hamburger-dropdown .btn {
  width: 100%;
  justify-content: flex-start;
  border-radius: 0;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 400;
  border: none;
}

.hamburger-dropdown .btn:hover {
  background: var(--surface-subtle);
  transform: none;
  box-shadow: none;
}

.hamburger-section-label {
  padding: 8px 16px 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hamburger-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* 会議室操作の「⋮」メニュー */
.room-more-menu {
  position: static;
}

/* 三点マークボタン: ホバー・フォーカス時は背景色を変えてアイコンを見やすくする */
.room-more-menu .btn-icon:hover,
.room-more-menu .btn-icon:focus-visible {
  background: var(--accent-main) !important;
  border-color: var(--accent-main) !important;
  color: white !important;
}

.room-more-menu .btn-icon:focus {
  outline: none;
}

.room-more-dropdown {
  display: none;
  position: fixed;
  min-width: 180px;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  z-index: 9999;
  overflow: hidden;
}

.room-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  font-size: 13.5px;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.room-menu-item:hover {
  background: var(--accent-soft);
}

.room-menu-item .lucide-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.room-menu-item--danger {
  color: var(--danger) !important;
}
.room-menu-item--danger .lucide-icon {
  color: var(--danger) !important;
}
.room-menu-item--danger:hover {
  background: rgba(220, 53, 69, 0.08);
}

.room-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.hidden {
  display: none !important;
}

.help-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent-main);
  background: #fff;
  color: var(--accent-main);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.help-button:hover {
  background: var(--accent-main);
  color: #fff;
  transform: scale(1.05);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-main);
  font-weight: 600;
  font-size: 13.5px;
}

.status-chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-main);
}

.site-main {
  flex: 1;
}

.site-main__inner {
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.site-main__inner > * {
  margin-top: 0;
}

.site-main__inner > *:first-child {
  margin-top: 0;
}

.auth-section {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 68px);
  background: var(--surface-subtle, #f3f4f6);
  position: relative;
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .auth-section {
    background: #0d1117 !important;
  }
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  animation: authCardIn 0.2s ease-out;
}

@keyframes authCardIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.auth-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.auth-header-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-main);
}

.auth-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-main);
}

.auth-caption {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.input-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.auth-submit {
  margin-top: 8px;
  height: 44px;
  font-size: 13.5px;
  border-radius: var(--radius-small);
}

/* ログインフォームの入力欄: 枠線カードではなく下線のみのシンプルな見た目 */
.auth-form .input-field {
  border: none;
  border-bottom: 1.5px solid var(--border-color);
  border-radius: 0;
  padding: 8px 2px;
  background: transparent;
  font-size: 13.5px;
}

.auth-form .input-field:hover {
  border-bottom-color: #c4cad4;
}

.auth-form .input-field:focus {
  border-bottom-color: var(--accent-main);
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  .auth-form .input-field {
    background: transparent;
  }
}

.auth-footer {
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.auth-footer__text {
  font-size: 13.5px;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.input-field {
  width: 100%;
  border-radius: var(--radius-small);
  border: 1.5px solid var(--border-color);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text-main);
  background: var(--surface-bg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.input-field:hover {
  border-color: #c4cad4;
}

.input-field:focus {
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 36px;
}

@media (prefers-color-scheme: dark) {
  .input-field {
    background: #0d1117;
    color: #e6edf3;
    border-color: #30363d;
  }

  .input-field:focus {
    border-color: var(--accent-main);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
  }
  
  .input-field::placeholder {
    color: #6e7681;
  }
}

.form-error {
  min-height: 20px;
  font-size: 13.5px;
  color: var(--danger);
}

/* フォームヘルプテキスト */
.form-hint {
  display: block;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* フォームセクション見出し */
.form-section-title {
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ボタングループ */
.btn-group {
  display: flex;
  gap: 4px;
}

.btn-group--gap-sm {
  gap: 6px;
}

.btn-group--gap-md {
  gap: 8px;
}

/* パネルヘッダーツールバー */
.panel-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

/* ツールバー内の会議室検索バー */
.room-search-bar-container {
  flex: 1 1 320px;
  min-width: 240px;
  white-space: normal;
}

.room-search-bar-container .filter-container {
  margin: 0;
}

/* 録音履歴アクションドロップダウン */
.action-dropdown {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  margin-right: 4px;
}

.action-dropdown summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
  padding: 6px 12px;
}

.action-dropdown summary::-webkit-details-marker {
  display: none;
}

.action-dropdown .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface-bg);
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  margin-top: 4px;
  min-width: 180px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-dropdown .dropdown-menu--right {
  left: auto;
  right: 0;
}

.dropdown-section-title {
  margin-bottom: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-divider {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-top: 12px;
}

.dropdown-btn-group {
  display: flex;
  gap: 6px;
}

.dropdown-btn-group--vertical {
  flex-direction: column;
}

.dropdown-btn {
  flex: 1;
  font-size: 13.5px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.dropdown-btn--full {
  padding: 8px 12px;
}

/* フォルダアイテムのスペーサー */
.folder-item__spacer {
  display: inline-block;
  width: 4px;
  flex-shrink: 0;
}

.folder-item__chevron {
  width: 14px;
  height: 14px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.folder-item__chevron:hover {
  color: var(--accent-main);
}

/* 以下のルールは#adminSection.admin-dashboardで上書きされます */

.dashboard-card {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-large);
  padding: 28px;
  box-shadow: var(--shadow-medium);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: box-shadow var(--transition-normal);
}

.dashboard-card:hover {
  box-shadow: var(--shadow-large);
}

.dashboard-card__header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-title {
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-caption {
  font-size: 13.5px;
  color: var(--text-muted);
}

.dashboard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-light);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 111, 235, 0.08);
  border: 1px solid rgba(31, 111, 235, 0.18);
  color: var(--accent-main);
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-small);
  border: 1.5px solid transparent;
  background: var(--surface-bg);
  color: var(--text-main);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  letter-spacing: 0.01em;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.10);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--accent-main);
  border-color: var(--accent-main);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 4px 14px rgba(31, 111, 235, 0.30);
}

.btn-secondary {
  background: var(--surface-subtle);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
  background: #edf0f4;
  border-color: #c4cad4;
}

.btn-outline {
  background: var(--surface-bg);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--accent-main);
  color: var(--accent-main);
  background: var(--accent-soft);
}

/* 小さいボタン（履歴テーブル用） */
.btn-small {
  padding: 4px 10px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-small.btn-primary {
  background: var(--accent-main);
  color: #fff;
}

.btn-small.btn-primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.btn-small.btn-secondary {
  background: var(--surface-subtle);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-small.btn-secondary:hover:not(:disabled) {
  background: var(--border-color);
}

.btn.btn-warning {
  background: #ff9800;
  color: #ffffff;
  border-color: #ff9800;
}

.btn.btn-warning:hover:not(:disabled) {
  background: #f57c00;
  border-color: #f57c00;
}

.btn-small.btn-warning {
  background: #ff9800;
  color: #ffffff;
  border-color: #ff9800;
}

.btn-small.btn-warning:hover:not(:disabled) {
  background: #f57c00;
  border-color: #f57c00;
}

.btn-small.btn-info {
  background: #2196F3;
  color: #ffffff;
  border-color: #2196F3;
}

.btn-small.btn-info:hover:not(:disabled) {
  background: #1976D2;
  border-color: #1976D2;
}

/* トグルスイッチ */
.toggle-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch-input {
  display: none;
}

.toggle-switch-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 24px;
  transition: background 0.3s ease;
}

.toggle-switch-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch-input:checked + .toggle-switch-slider {
  background: var(--accent-main);
}

.toggle-switch-input:checked + .toggle-switch-slider::after {
  transform: translateX(20px);
}

.toggle-switch-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

/* ダークモード時のボタンスタイル
   SmartPortalデザインシステム移行: 以前はここで#3b82f6等を直接ハードコードして
   おり、--accent-main（管理画面ではグレー系--color-highlightに再割り当て済み）
   を無視してしまっていた。トークン参照に変更し、管理/一般画面の色分岐が
   ダークモードでも正しく反映されるようにする。 */
@media (prefers-color-scheme: dark) {
  .btn-primary {
    background: var(--accent-main) !important;
    border-color: var(--accent-main) !important;
    color: #ffffff !important;
  }

  .btn-primary:hover:not(:disabled) {
    background: var(--accent-strong) !important;
    border-color: var(--accent-strong) !important;
    box-shadow: 0 1px 3px rgba(1, 4, 9, 0.3) !important;
  }

  .btn-secondary {
    background: #21262d !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
  }

  .btn-secondary:hover:not(:disabled) {
    background: #30363d !important;
    border-color: #444c56 !important;
  }

  .btn-outline {
    background: transparent !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
  }

  .btn-outline:hover:not(:disabled) {
    background: var(--accent-soft) !important;
    border-color: var(--accent-main) !important;
    color: var(--accent-main) !important;
  }

  .btn-ghost {
    background: transparent !important;
    border-color: transparent !important;
    color: #8b949e !important;
  }

  .btn-ghost:hover:not(:disabled) {
    background: var(--accent-soft) !important;
    border-color: var(--accent-main) !important;
    color: var(--accent-main) !important;
  }

}

.btn-danger {
  background: #fef0f0;
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(217, 45, 32, 0.12);
  border-color: rgba(217, 45, 32, 0.6);
}

/* =============== アクションドロップダウン =============== */
.action-dropdown {
  position: relative;
  z-index: 1;
}

.action-dropdown[open] {
  z-index: 1000;
}

.action-dropdown > summary {
  list-style: none;
  cursor: pointer;
}

.action-dropdown > summary::-webkit-details-marker {
  display: none;
}

.action-dropdown > summary::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.2s ease;
}

.action-dropdown[open] > summary::after {
  transform: rotate(180deg);
}

.action-dropdown .dropdown-menu {
  animation: dropdownFadeIn 0.15s ease-out;
  z-index: 1000;
}

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

/* ダークモード時のドロップダウン */
@media (prefers-color-scheme: dark) {
  .action-dropdown .dropdown-menu {
    background: #21262d !important;
    border-color: #30363d !important;
  }
  
  .action-dropdown .dropdown-menu div[style*="border-top"] {
    border-color: #30363d !important;
  }
}

.data-panel {
  background: var(--surface-bg);
  display: flex;
  flex-direction: column;
}

.data-panel__header {
  display: none;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-bg);
}

.data-panel__header > div:first-child {
  flex: 1;
  min-width: 200px;
}

.panel-title {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* モバイル用ツールバー（デスクトップでは非表示） */
.mobile-toolbar {
  display: none;
}

.panel-caption {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

.table-wrapper table th,
.table-wrapper table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 13.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: var(--text-main);
}

.table-wrapper table tbody td {
  border-bottom: 1px solid var(--border-color);
}

.table-wrapper table th {
  background: var(--surface-bg);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
  position: sticky;
  top: 0;
  z-index: 1;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

th[style*="cursor: pointer"]:hover {
  background: var(--accent-soft);
  color: var(--accent-main);
  transition: all var(--transition-fast);
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--color-bg-subtle);
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 600;
  cursor: default;
}

.status .lucide-icon {
  width: 18px;
  height: 18px;
  margin: 0;
}

.status.active {
  color: var(--success);
}

.status.inactive {
  color: #64748b;
}

.status.used {
  color: var(--accent-main);
}

.status.expired {
  color: var(--danger);
}

/* 会議室一覧の状態バッジ（アイコン+テキスト）: アイコン単体より一目で意味が分かるようにする
   注意: .status-badge は他機能（タスク管理等）でも使われているクラス名のため、
   会議室一覧専用にroom-status-badgeという名前にして衝突を避ける */
.room-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  justify-content: flex-start;
}

.room-status-badge .lucide-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.room-status-badge__label {
  line-height: 1;
}

.room-status-badge--active {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}

.room-status-badge--inactive {
  background: var(--color-highlight-soft);
  color: var(--color-highlight);
}

.room-status-badge--used {
  background: rgba(29, 90, 153, 0.12);
  color: var(--color-status-normal);
}

.room-status-badge--expired {
  background: rgba(217, 45, 32, 0.12);
  color: var(--danger);
}

@media (prefers-color-scheme: dark) {
  .room-status-badge--used {
    background: rgba(88, 166, 255, 0.16);
  }
  .room-status-badge--expired {
    background: rgba(248, 81, 73, 0.16);
  }
}

.room-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: var(--radius-small);
  border: 1px dashed rgba(31, 111, 235, 0.35);
  background: #fff;
  font-family: 'Roboto Mono', 'Noto Sans JP', monospace;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-strong);
}

.expiry-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 開始予定が未設定の場合の簡易表示。ネイティブのdatetime-local空表示
   （「年/月/日 --:--」）は意味が伝わりにくいため、クリックするまではテキストにする */
.scheduled-start-unset {
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
}

.scheduled-start-unset:hover {
  background: var(--surface-subtle);
  border-color: var(--border-color);
}

.scheduled-start-input--hidden {
  display: none;
}

input[type="datetime-local"] {
  padding: 6px 4px;
  border: none;
  border-radius: var(--radius-small);
  font-size: 13.5px;
  color: var(--text-main);
  background: transparent;
  color-scheme: light;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input[type="datetime-local"]:focus {
  border: none;
  box-shadow: none;
  outline: none;
  background: var(--surface-subtle);
}

input[type="datetime-local"].pending {
  border: none;
  background: #fff4e5;
}

@media (prefers-color-scheme: dark) {
  input[type="datetime-local"] {
    background: transparent;
    color: #e6edf3;
    border: none;
    color-scheme: dark;
  }
  
  input[type="datetime-local"]:focus {
    border: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.05);
  }
  
  input[type="datetime-local"].pending {
    border: none;
    background: #3d2a1f;
  }
}

#autoRefreshToggle {
  position: relative;
  width: 44px;
  height: 24px;
  appearance: none;
  background: #d7dde7;
  border-radius: 14px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

#autoRefreshToggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

#autoRefreshToggle:checked {
  background: var(--accent-main);
}

#autoRefreshToggle:checked::after {
  transform: translateX(18px);
}

.btn-confirm {
  padding: 8px 14px;
  font-size: 13.5px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 6px 12px rgba(30, 166, 117, 0.25);
}

.btn-confirm:hover {
  transform: translateY(-1px);
  background: #17895d;
}

.btn-confirm.pending {
  background: #ff6600;
  box-shadow: 0 6px 12px rgba(255, 102, 0, 0.25);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.pending-notice {
  color: #ff6600;
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 4px;
}

.expired {
  color: var(--danger);
  font-weight: 700;
}

.expiring-soon {
  color: #ff6600;
  font-weight: 700;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1000;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 24px;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
  animation: modalOverlayIn 0.2s ease;
}

@keyframes modalOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =============== 議事録の単独ページ表示（新しいタブで開いた場合） ===============
   #minutes/roomId/recordId のディープリンクで開いた場合、管理ダッシュボードは
   表示せず、議事録モーダルを浮いたカードではなくページ全体として表示する。 */
html.standalone-minutes-view body {
  background: var(--page-bg);
}

html.standalone-minutes-view .app-header,
html.standalone-minutes-view .folder-sidebar,
html.standalone-minutes-view .data-panel,
html.standalone-minutes-view .hamburger-menu,
html.standalone-minutes-view body.admin-logged-in .hamburger-menu {
  display: none !important;
}

html.standalone-minutes-view #minutesDisplayModal,
html.standalone-minutes-view #htmlEditorModal {
  position: fixed;
  inset: 0;
  background: var(--page-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  animation: none;
}

html.standalone-minutes-view #minutesDisplayModal .modal-content,
html.standalone-minutes-view #htmlEditorModal .modal-content {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  animation: none;
}

/* 単独ページ表示では戻る先のダッシュボードが存在しないため、
   最大化ボタン・閉じるボタンは不要（会議キー入力ページ等に戻る導線もない） */
html.standalone-minutes-view #viewMaximizeBtn,
html.standalone-minutes-view #minutesDisplayModal .modal-close,
html.standalone-minutes-view #editMaximizeBtn,
html.standalone-minutes-view #htmlEditorModal .modal-close {
  display: none !important;
}

.modal-content {
  background: var(--surface-bg);
  margin: auto;
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-large);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  animation: modalContentIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalContentIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-bg);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.modal-header h2 .lucide-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-main);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-small);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--accent-soft);
  color: var(--text-main);
}

.modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.6;
}

.modal-footer {
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  background: var(--surface-subtle);
  flex-shrink: 0;
  border-radius: 0 0 var(--radius-large) var(--radius-large);
}

.modal-submit {
  width: 100%;
}

@media (max-width: 768px) {
  .app-header__inner {
    padding: 0 60px 0 16px;
  }

  .site-main__inner {
    padding: 24px 16px 40px;
  }

  .auth-section {
    padding: 24px 0;
    min-height: calc(100vh - 150px);
  }

  .dashboard-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .table-wrapper {
    padding: 8px;
  }

  .table-wrapper table {
    min-width: 760px;
  }
}

/* 録音履歴スタイル */
.history-stats-container {
  background: var(--surface-subtle);
  padding: 16px;
  border-radius: var(--radius-medium);
  margin-bottom: 20px;
}

.history-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.history-stat-card {
  background: var(--surface-bg);
  padding: 12px;
  border-radius: var(--radius-small);
  border: 1px solid var(--border-color);
}

.history-stat-label {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.history-stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.char-counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.char-counter-error {
  color: var(--danger);
}

.form-label-hint {
  font-weight: normal;
  color: var(--text-muted);
  font-size: 1em;
}

.history-stat-sub {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
}

.history-stat-detail {
  font-size: 13.5px;
  color: var(--text-light);
  margin-top: 2px;
}

.history-note {
  font-size: 13.5px;
  color: var(--text-light);
  margin-top: 8px;
  line-height: 1.5;
}

/* 録音履歴モーダルの横幅を拡大 */
#historyModal .modal-content {
  max-width: 1200px;
}

/* 録音履歴コンテンツに水平スクロールを追加 */
#historyContent {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  min-width: 1100px; /* テーブルの最小幅を確保 */
  border-collapse: collapse;
  table-layout: fixed;
  margin-bottom: 200px; /* ドロップダウンメニュー表示用の余白 */
}

.history-table thead tr {
  background: var(--surface-subtle);
  border-bottom: 2px solid var(--border-color);
}

.history-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-main);
}

/* 録音履歴テーブルの列幅を固定 */
.history-table th:nth-child(1),
.history-table td:nth-child(1) { width: 170px; } /* 開始日時 */
.history-table th:nth-child(2),
.history-table td:nth-child(2) { width: 170px; } /* 終了日時 */
.history-table th:nth-child(3),
.history-table td:nth-child(3) { width: 100px; } /* 録音時間 */
.history-table th:nth-child(4),
.history-table td:nth-child(4) { width: 200px; max-width: 200px; } /* 会議名 */
.history-table th:nth-child(5),
.history-table td:nth-child(5) { width: 108px; } /* ステータス */
.history-table th:nth-child(6),
.history-table td:nth-child(6) { width: 352px; min-width: 352px; } /* ファイルダウンロード */

.history-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.history-table tbody tr:hover {
  background: var(--surface-subtle);
}

/* ドロップダウンが開いている行を最前面に */
.history-table tbody tr:has(.action-dropdown[open]) {
  z-index: 100;
}

.history-table td {
  padding: 12px;
  color: var(--text-main);
}

/* ドロップダウンを含むセルは overflow を visible に */
.history-table td:last-child {
  overflow: visible;
  position: relative;
}

.status-recording {
  color: var(--success);
  font-weight: 600;
}

.status-completed {
  color: var(--text-muted);
  font-weight: 600;
}

.status-warning {
  color: var(--color-status-maintenance);
  font-weight: 600;
}

.history-error {
  text-align: center;
  padding: 20px;
  color: var(--danger);
}

.history-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

@media (prefers-color-scheme: dark) {
  .history-stats-container {
    background: rgba(30, 41, 59, 0.6);
  }

  .history-stat-card {
    background: var(--surface-subtle);
    border-color: #30363d;
  }

  .history-table thead tr {
    background: rgba(30, 41, 59, 0.6);
  }

  .history-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.4);
  }

  .modal {
    background: rgba(0, 0, 0, 0.65);
  }
}

/* ========================================
   モバイル対応（768px以下）
   ======================================== */
@media (max-width: 768px) {
  /* ヘッダーをモバイル用に調整（右側はハンバーガーメニュー分の余白を確保） */
  .app-header__inner {
    padding: 0 60px 0 16px;
  }

  .app-header__brand {
    margin-bottom: 0;
  }

  .app-title {
    font-size: 15px;
  }

  /* スマホ: 検索バーは非表示、新規作成・ユーザー名・更新ボタンのみ表示（右寄せ） */
  .app-header__toolbar-row {
    display: none !important;
    margin-left: auto;
  }

  body.admin-logged-in .app-header__toolbar-row {
    display: flex !important;
    margin-left: auto;
  }

  .app-header__toolbar-row .room-search-bar-container {
    display: none;
  }

  /* 新規作成ボタンの高さ調整 */
  .app-header__toolbar-row .btn-primary {
    padding: 6px 12px;
    font-size: 13.5px;
    line-height: 1.5;
    font-weight: 500;
  }

  /* ハンバーガーメニュー表示（モバイルでもアクセスできるように、ログイン後のみ） */
  body.admin-logged-in .hamburger-menu {
    display: block !important;
  }

  /* 認証カードを画面幅いっぱいに */
  .auth-card {
    max-width: 100%;
    margin: 0;
  }

  .auth-title {
    font-size: 16px;
  }

  .auth-caption {
    font-size: 13.5px;
  }

  /* ボタンを大きくタッチしやすく */
  .btn {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 13.5px;
  }

  /* インプットフィールドも大きく */
  .input-field {
    min-height: 44px;
    font-size: 13.5px; /* iOS のズーム防止 */
    padding: 12px 16px;
  }

  /* データパネルのヘッダーを縦並び */
  .data-panel__header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }

  .data-panel__header > div:last-child {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .data-panel__header label {
    width: 100%;
    justify-content: space-between;
  }

  /* テーブルをスクロール可能に */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .rooms-table {
    min-width: 0; /* カードレイアウトで横スクロール不要 */
    font-size: 13.5px;
  }

  .rooms-table th,
  .rooms-table td {
    padding: 10px 8px;
  }

  /* モーダルを画面いっぱいに */
  .modal-content {
    width: 95%;
    max-width: 95%;
    margin: 20px auto;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }

  .modal-header h2 {
    font-size: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  /* ハンバーガーメニューはモバイルでも表示 */

  .hamburger-btn {
    width: 44px;
    height: 44px;
  }

  .hamburger-dropdown {
    right: 8px;
    min-width: 220px;
  }

  /* QRコードモーダル */
  #qrCodeDisplay {
    max-width: 250px;
  }

  /* 録音履歴テーブル */
  .history-table {
    min-width: 700px;
    font-size: 13.5px;
  }

  /* 会議情報モーダルのテキストエリア */
  #meetingInfoContent,
  #meetingInfoParticipants {
    font-size: 13.5px; /* iOS ズーム防止 */
  }

  /* ヘッダーツールバーのボタンレイアウト */
  .app-header__toolbar-row {
    flex-direction: row;
    gap: 8px;
  }

  .app-header__toolbar-row .btn {
    width: auto;
    padding: 6px 10px !important;
    font-size: 13.5px !important;
    white-space: nowrap;
  }

  /* パネルタイトル */
  .panel-title {
    font-size: 16px;
  }

  /* チェックボックスのサイズ調整 */
  input[type="checkbox"] {
    min-width: 36px;
    min-height: 20px;
  }

  /* タッチフィードバックの無効化 */
  * {
    -webkit-tap-highlight-color: transparent;
  }

  button,
  a,
  .btn {
    -webkit-tap-highlight-color: rgba(31, 111, 235, 0.1);
  }
}

/* さらに小さい画面（480px以下）用の調整 */
@media (max-width: 480px) {
  .app-header__inner {
    padding: 0 56px 0 12px;
  }

  .site-main__inner {
    padding: 12px;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }

  .data-panel {
    padding: 16px;
  }

  .hamburger-dropdown {
    right: 4px;
    min-width: 200px;
  }
}

/* ダウンロードボタンのローディング状態 */
.btn-downloading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-downloading::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  0% { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}

/* ローディング中のボタンテキスト調整 */
.btn-downloading {
  padding-right: 28px;
}

/* 大きなモーダル用のスタイル */
.modal-content-large {
  max-width: 900px;
  width: 95%;
}

/* ヘルプモーダル用の横幅拡張 */
#helpModal .modal-content {
  max-width: 1000px;
  width: 95%;
  max-height: 85vh;
}

/* 議事録表示モーダル用の横幅拡張 */
#minutesDisplayModal .modal-content {
  max-width: 1200px;
  width: 95%;
  max-height: 90vh;
}

/* 議事録編集モーダル用の横幅拡張 */
#htmlEditorModal .modal-content {
  max-width: 1200px;
  width: 95%;
}

/* タスク進捗モーダル */
#taskProgressModal .modal-content {
  max-width: 1100px;
  width: 95%;
  max-height: 85vh;
}

/* Pleasanter設定モーダル */
#pleasanterSettingsModal .modal-content {
  max-width: 700px;
  width: 95%;
  max-height: 85vh;
}

/* 用語辞書モーダル */
#vocabularyModal .modal-content {
  max-width: 900px;
  width: 95%;
  max-height: 85vh;
}

/* 音声アップロードモーダル */
#audioUploadModal .modal-content {
  max-width: 600px;
  max-height: 85vh;
}

/* 音声アップロードモーダル用のスタイル */
#audioUploadModal .input-field,
#minutesDisplayModal .input-field {
  width: 100%;
}

#minutesDisplayContent {
  background: var(--surface-subtle);
  padding: 20px;
  border-radius: var(--radius-medium);
  border: 1px solid var(--border-color);
}

#minutesDisplayContent h1,
#minutesDisplayContent h2,
#minutesDisplayContent h3 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--text-main);
}

#minutesDisplayContent h1:first-child,
#minutesDisplayContent h2:first-child,
#minutesDisplayContent h3:first-child {
  margin-top: 0;
}

#minutesDisplayContent p {
  margin-bottom: 10px;
}

#minutesDisplayContent ul,
#minutesDisplayContent ol {
  margin-left: 20px;
  margin-bottom: 10px;
}

/* ダウンロード進捗表示 */
.download-progress-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(4px);
}

.download-progress-modal {
  background: var(--surface-bg);
  border-radius: var(--radius-large);
  padding: 32px 40px;
  min-width: 400px;
  max-width: 500px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.download-progress-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.download-progress-filename {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
  word-break: break-all;
}

.download-progress-bar-container {
  background: var(--surface-subtle);
  border-radius: 10px;
  height: 20px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.download-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-main), var(--accent-strong));
  border-radius: 10px;
  transition: width 0.3s ease;
  position: relative;
}

.download-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.download-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-muted);
}

.download-progress-percent {
  font-weight: 600;
  color: var(--accent-main);
}

.download-progress-size {
  color: var(--text-light);
}

.download-progress-cancel {
  margin-top: 20px;
  padding: 10px 24px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius-small);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.2s;
}

.download-progress-cancel:hover {
  background: #b91c1c;
}

/* ボタン内プログレス（インライン表示用） */
.btn-with-progress {
  position: relative;
  overflow: hidden;
}

.btn-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.8);
  transition: width 0.2s ease;
}

/* 議事録表示スタイル */
.minutes-content {
  color: var(--text-main);
}

.minutes-content h1 {
  font-size: 1.5em;
  font-weight: 700;
  margin: 1em 0 0.5em 0;
  padding-bottom: 0.3em;
  border-bottom: 2px solid var(--accent-main);
  color: var(--text-main);
}

.minutes-content h2 {
  font-size: 1.3em;
  font-weight: 600;
  margin: 1em 0 0.5em 0;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.minutes-content h3 {
  font-size: 1.1em;
  font-weight: 600;
  margin: 0.8em 0 0.4em 0;
  color: var(--accent-main);
}

.minutes-content h4, .minutes-content h5, .minutes-content h6 {
  font-size: 1em;
  font-weight: 600;
  margin: 0.6em 0 0.3em 0;
  color: var(--text-main);
}

.minutes-content p {
  margin: 0.5em 0;
  line-height: 1.8;
}

.minutes-content ul, .minutes-content ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.minutes-content li {
  margin: 0.3em 0;
  line-height: 1.6;
}

.minutes-content strong {
  font-weight: 700;
  color: var(--text-main);
}

.minutes-content em {
  font-style: italic;
}

.minutes-content code {
  background: var(--surface-subtle);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 1em;
}

.minutes-content blockquote {
  border-left: 4px solid var(--accent-main);
  padding-left: 1em;
  margin: 0.5em 0;
  color: var(--text-muted);
  font-style: italic;
}

.minutes-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1em 0;
}

/* 議事録内のテーブルスタイル */
.minutes-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13.5px;
}

.minutes-content table th,
.minutes-content table td {
  border: 1px solid var(--border-color, #d9e2ec);
  padding: 10px 12px;
  text-align: left;
}

.minutes-content table th {
  background: rgba(0, 102, 204, 0.08);
  font-weight: 600;
}

.minutes-content table tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* 議事録のハイライトとラベルスタイル（録音画面と統一） */
.note-highlight {
  display: block;
  border-radius: 8px;
  padding: 0;
  background: transparent !important;
  border-left: none;
  line-height: 1.6;
  margin: 0 0 8px;
}

/* リストアイテム内のラベル付きハイライトはインデントを維持 */
li.note-highlight {
  display: list-item;
  margin: 0;
  padding: 0;
}

/* ラベル付きリストアイテムはビュレットを非表示 */
li.has-label {
  list-style: none;
}

li:has(.note-label) {
  list-style: none;
}

/* 重要項目の文字色は通常テキストと同じ（ラベルで識別） */
.note-highlight.note-critical,
.note-highlight.note-important,
.note-highlight.note-decision,
.note-highlight.note-action,
.note-highlight.note-deadline,
.note-highlight.note-next,
.note-highlight.note-issue,
.note-highlight.note-confirm,
.note-highlight.note-pending {
  background: transparent !important;
  border-left: none;
  color: inherit;
}

.note-label {
  font-size: inherit;
  font-weight: 700;
  margin-right: 0;
  display: inline;
  vertical-align: baseline;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: inherit;
}

.note-label::after {
  content: '：';
}

/* カラーモード（祖先要素に .theme-color が付与されている間だけ有効） */
.theme-color .note-label.note-critical  { color: var(--note-critical-color); }
.theme-color .note-label.note-important { color: var(--note-important-color); }
.theme-color .note-label.note-decision  { color: var(--note-decision-color); }
.theme-color .note-label.note-action    { color: var(--note-action-color); }
.theme-color .note-label.note-deadline  { color: var(--note-deadline-color); }
.theme-color .note-label.note-next      { color: var(--note-next-color); }
.theme-color .note-label.note-issue     { color: var(--note-issue-color); }
.theme-color .note-label.note-confirm   { color: var(--note-confirm-color); }
.theme-color .note-label.note-pending   { color: var(--note-pending-color); }

/* 話者ラベルのスタイル */
.speaker-label {
  display: inline-block;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 1em;
  margin-right: 6px;
  white-space: nowrap;
}

/* 話者ごとの色（最大10人対応） */
.speaker-label.spk-0 {
  background-color: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.speaker-label.spk-1 {
  background-color: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.speaker-label.spk-2 {
  background-color: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.speaker-label.spk-3 {
  background-color: rgba(31, 111, 235, 0.15);
  color: #2563eb;
  border: 1px solid rgba(31, 111, 235, 0.3);
}

.speaker-label.spk-4 {
  background-color: rgba(236, 72, 153, 0.15);
  color: #db2777;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.speaker-label.spk-5 {
  background-color: rgba(14, 165, 233, 0.15);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.speaker-label.spk-6 {
  background-color: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.speaker-label.spk-7 {
  background-color: rgba(251, 146, 60, 0.15);
  color: #ea580c;
  border: 1px solid rgba(251, 146, 60, 0.3);
}

.speaker-label.spk-8 {
  background-color: rgba(168, 85, 247, 0.15);
  color: #9333ea;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.speaker-label.spk-9 {
  background-color: rgba(244, 63, 94, 0.15);
  color: #e11d48;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  .minutes-content {
    background: #1c2128 !important;
    color: #e6edf3 !important;
  }
  
  .minutes-content * {
    color: inherit !important;
  }
  
  .minutes-content h1,
  .minutes-content h2,
  .minutes-content h3,
  .minutes-content h4,
  .minutes-content h5,
  .minutes-content h6,
  .minutes-content p,
  .minutes-content li,
  .minutes-content span,
  .minutes-content div {
    color: #e6edf3 !important;
  }
  
  .minutes-content h3 {
    color: var(--accent-main) !important;
  }
  
  .minutes-content code {
    background: #2d333b;
    color: #e6edf3 !important;
  }
  
  /* タグのスパンは白文字のまま維持 */
  .minutes-content span[style*="background-color"] {
    color: white !important;
  }
}

/* =============== カスタムボキャブラリー管理 =============== */

.vocab-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
}

.vocab-tab {
  padding: 12px 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.vocab-tab:hover {
  color: var(--text-main);
  background: var(--surface-subtle);
}

.vocab-tab.active {
  color: var(--accent-main);
  border-bottom-color: var(--accent-main);
}

.vocab-panel {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.vocab-info {
  margin-bottom: 20px;
}

.vocab-description {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.vocab-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-subtle);
  border-radius: var(--radius-small);
  font-size: 13.5px;
}

.vocab-status-label {
  font-weight: 600;
  color: var(--text-main);
}

.vocab-status-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13.5px;
}

.vocab-status-value.pending {
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
}

.vocab-status-value.ready {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
}

.vocab-status-value.failed {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
}

.vocab-status-value.none {
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.vocab-phrase-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-medium);
  margin-bottom: 16px;
  background: var(--surface-bg);
}

.vocab-phrase-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.vocab-phrase-item:last-child {
  border-bottom: none;
}

.vocab-phrase-item:hover {
  background: var(--surface-subtle);
}

.vocab-phrase-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.vocab-phrase-text {
  font-size: 13.5px;
  color: var(--text-main);
  font-weight: 500;
}

.vocab-phrase-attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vocab-phrase-attr {
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 2px 8px;
  border-radius: 4px;
}

.vocab-phrase-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  transition: all 0.15s ease;
}

.vocab-phrase-delete:hover {
  background: rgba(244, 67, 54, 0.1);
  color: #f44336;
}

.vocab-phrase-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}

.vocab-add-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.vocab-add-form .input-field {
  flex: 1;
}

/* 拡張フォーム（SoundsLike, DisplayAs対応） */
.vocab-add-form-extended {
  flex-direction: column;
}

.vocab-add-form-extended .vocab-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.vocab-add-form-extended .vocab-input-group {
  flex: 1;
  min-width: 150px;
}

.vocab-add-form-extended .vocab-input-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.vocab-add-form-extended .vocab-input-group label .required {
  color: var(--danger);
}

.vocab-add-form-extended .vocab-input-group .input-field {
  width: 100%;
}

.vocab-add-form-extended .btn {
  flex-shrink: 0;
  height: 38px;
}

.vocab-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.vocab-help {
  background: var(--surface-subtle);
  border-radius: var(--radius-medium);
  padding: 16px 20px;
  margin-top: 20px;
}

.vocab-help h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.vocab-help p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.6;
}

.vocab-help ul {
  margin: 0;
  padding-left: 20px;
}

.vocab-help li {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.5;
}

.vocab-help li strong {
  color: var(--text-main);
}

.btn-danger {
  background: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.3);
  color: #f44336;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(244, 67, 54, 0.2);
  border-color: rgba(244, 67, 54, 0.5);
}

/* =============== HTML議事録エディタ =============== */
.modal-fullscreen {
  max-width: 95vw !important;
  width: 95vw !important;
  height: 90vh !important;
  max-height: 90vh !important;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  overflow: hidden;
}

/* モーダル最大化状態 */
.modal-fullscreen.maximized {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.modal-fullscreen.maximized .modal-header {
  border-radius: 0;
  flex-shrink: 0;
}

.modal-fullscreen.maximized .modal-body {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.modal-fullscreen.maximized .modal-footer {
  border-radius: 0;
  flex-shrink: 0;
}

.html-editor-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 16px !important;
}

.editor-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-medium);
  gap: 8px;
  flex-wrap: wrap;
}

.editor-toolbar-left {
  display: flex;
  gap: 4px;
  align-items: center;
}

.editor-toolbar-center {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.editor-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
  margin: 0 8px;
}

.wysiwyg-tools {
  display: flex;
  gap: 2px;
  align-items: center;
}

/* ========================================
   検索と置換バー
   ======================================== */
.find-replace-bar {
  position: relative;
  padding: 10px 40px 10px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-medium) var(--radius-medium);
  margin-top: -13px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.find-replace-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.find-replace-input-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0 10px;
  min-height: 34px;
}

.find-replace-input-group:focus-within {
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.find-replace-icon {
  width: 14px !important;
  height: 14px !important;
  color: var(--text-muted);
  flex-shrink: 0;
}

.find-replace-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13.5px;
  padding: 6px 0;
  outline: none;
  min-width: 0;
}

.find-replace-input::placeholder {
  color: var(--text-muted);
}

.find-replace-count {
  font-size: 13.5px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.find-replace-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.find-replace-options {
  padding-top: 2px;
}

.find-replace-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
}

.find-replace-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.find-replace-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.btn-icon.active {
  background: var(--accent-soft);
  color: var(--accent-main);
  border-color: var(--accent-main);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon .lucide-icon {
  width: 20px !important;
  height: 20px !important;
}

.btn-icon:hover {
  background: var(--accent-soft);
  border-color: var(--accent-main);
  color: var(--accent-main);
}

.btn-icon:active {
  background: var(--accent-main);
  color: white;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-main);
}

.format-select {
  padding: 6px 10px;
  font-size: 13.5px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--surface-bg);
  color: var(--text-main);
  cursor: pointer;
  min-width: 80px;
}

.format-select:hover {
  border-color: var(--accent-main);
}

.format-select:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.editor-file-info {
  font-size: 13.5px;
  color: var(--text-muted);
}

.editor-view-btn {
  font-size: 13.5px;
  padding: 6px 12px;
}

.editor-view-btn.active {
  background: var(--accent-main);
  color: white;
  border-color: var(--accent-main);
}

.editor-container {
  display: flex;
  flex: 1;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-medium);
}

.editor-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.code-pane {
  background: var(--surface-subtle);
}

.wysiwyg-pane {
  background: white;
}

.pane-header {
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--surface-bg);
  border-bottom: 1px solid var(--border-color);
}

.editor-divider {
  width: 4px;
  background: var(--border-color);
  cursor: col-resize;
  flex-shrink: 0;
}

.editor-divider:hover {
  background: var(--accent-main);
}

.html-code-area {
  flex: 1;
  width: 100%;
  padding: 16px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  font-size: 13.5px;
  line-height: 1.6;
  border: none;
  resize: none;
  background: var(--surface-subtle);
  color: var(--text-main);
  outline: none;
  tab-size: 2;
}

.html-code-area:focus {
  outline: none;
}

.html-preview-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: white;
}

.html-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--surface-bg);
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  .wysiwyg-pane {
    background: #1c2128;
  }
  
  .html-preview-frame {
    background: #1c2128;
  }
  
  .html-code-area {
    background: #0d1117;
    color: #e6edf3;
  }
  
  .format-select {
    background: #1c2128;
    border-color: #30363d;
    color: #e6edf3;
  }
  
  .btn-icon {
    color: #e6edf3;
  }
  
  .btn-icon:hover {
    background: color-mix(in srgb, var(--accent-main) 15%, transparent);
    color: var(--accent-main);
  }
  
  .editor-toolbar {
    background: #1c2128;
    border-color: #30363d;
  }
  
  .vocab-status {
    background: #1c2128;
  }
  
  .vocab-phrase-list {
    background: #0d1117;
    border-color: #30363d;
  }
  
  .vocab-phrase-item {
    border-color: #30363d;
  }
  
  .vocab-phrase-item:hover {
    background: #1c2128;
  }
  
  .vocab-help {
    background: #1c2128;
  }
}

/* ローディングスピナー */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-main);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 議事録タブスタイル */
.minutes-tab {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.minutes-tab:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.05);
}

.minutes-tab.active {
  background: var(--accent-main);
  color: white;
}

/* =============== 議事録選択リスト =============== */
.minutes-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.minutes-select-item:last-child {
  border-bottom: none;
}

.minutes-select-item:hover {
  background: var(--surface-subtle);
}

.minutes-select-item-info {
  flex: 1;
  overflow: hidden;
}

.minutes-select-item-date {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.minutes-select-item-detail {
  font-size: 13.5px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.minutes-select-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent-main);
}

.minutes-select-item-badge.latest {
  background: rgba(30, 166, 117, 0.12);
  color: var(--success);
}

.minutes-select-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 16px;
}

/* =============== ダークモード追加対応 =============== */
@media (prefers-color-scheme: dark) {
  /* 会議詳細モーダルのキー情報セクション */
  .key-info-section {
    background: var(--surface-subtle) !important;
  }
  
  .key-code-primary {
    background: transparent !important;
    color: var(--accent-main) !important;
    border-color: var(--accent-main) !important;
  }
  
  .key-code-secondary {
    background: transparent !important;
    color: #3fb950 !important;
    border-color: #3fb950 !important;
  }
  
  .key-code-neutral {
    background: transparent !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
  }
  
  .key-code-disabled {
    background: var(--surface-subtle) !important;
    color: var(--text-muted) !important;
  }
  
  /* ローディングやメッセージテキスト */
  .loading-text, .empty-text, .muted-text {
    color: var(--text-muted) !important;
  }
  
  /* 履歴の費用表示 */
  .cost-highlight {
    color: #f97583 !important;
  }
  
  .warning-text {
    color: #d29922 !important;
  }
  
  /* タブホバー */
  .minutes-tab:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* ダークモード対応用ユーティリティクラス */
.key-info-section {
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

/* ========== 会議詳細パネル（右サイドの浮動パネル。一覧表と重なって最前面に表示） ========== */
.meeting-detail-panel {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 630px;
  max-width: calc(100% - 24px);
  height: 100%;
  overflow: hidden;
  background: var(--surface-bg);
  border-left: 1px solid var(--border-color, #e2e8f0);
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
  flex-direction: column;
  z-index: 500;
  transform: translateX(100%);
  transition: transform 0.25s ease-in-out;
}

.meeting-detail-panel.is-open {
  display: flex;
  transform: translateX(0);
}

.meeting-detail-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: var(--surface-bg);
  flex-shrink: 0;
}

.meeting-detail-panel__header h2 {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.meeting-detail-panel__header h2 .lucide-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-main);
}

.meeting-detail-panel__footer {
  padding: 10px 18px;
  gap: 10px;
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-color, #e2e8f0);
  background: var(--surface-subtle);
  flex-shrink: 0;
}

.meeting-detail-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* モバイル: 右パネルは画面全体に固定表示 */
@media (max-width: 768px) {
  .meeting-detail-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    z-index: 1000;
  }

  .meeting-detail-body {
    width: auto;
  }
}

/* セクション共通 */
.meeting-detail-section {
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.meeting-detail-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.meeting-detail-section--keys {
  background: transparent;
}

.meeting-detail-section__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main, #1a202c);
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meeting-detail-section__title .lucide-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-main);
}

/* フィールド */
.meeting-detail-field {
  margin-bottom: 6px;
}

.meeting-detail-body .input-field {
  padding: 7px 10px;
  font-size: 13.5px;
}

.meeting-detail-field:last-child {
  margin-bottom: 0;
}

.meeting-detail-label {
  display: block;
  margin-bottom: 2px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main, #1a202c);
}

.meeting-detail-label__hint {
  font-weight: 400;
  color: var(--text-muted, #64748b);
  font-size: 1em;
}

/* キー行（code + コピーボタン） */
.meeting-detail-key-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meeting-detail-key-code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-detail-copy-btn {
  flex-shrink: 0;
  padding: 5px !important;
}

/* 会議キー・参加キーの2カラムグリッド */
.meeting-detail-keys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* 文字数カウント行 */
.meeting-detail-charcount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.meeting-detail-charcount__error {
  color: var(--danger, #dc2626);
  font-size: 1em;
}

.meeting-detail-charcount__count {
  margin-left: auto;
  font-size: 1em;
  color: var(--text-muted, #64748b);
}

.meeting-detail-error {
  margin-top: 4px;
}

/* ダークモード */
@media (prefers-color-scheme: dark) {
  .meeting-detail-section {
    border-color: var(--border-color, #30363d);
  }
}

/* モバイル: 2カラム → 1カラム */
@media (max-width: 480px) {
  .meeting-detail-keys-grid {
    grid-template-columns: 1fr;
  }
}

.key-code-primary {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--accent-main, #1976d2);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: monospace;
  color: var(--accent-main, #1976d2);
}

.key-code-secondary {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid #388e3c;
  border-radius: 6px;
  font-size: 13.5px;
  font-family: monospace;
  color: #388e3c;
}

.key-code-neutral {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: monospace;
}

.key-code-disabled {
  padding: 6px 10px;
  background: transparent;
  border: 1px dashed var(--border-color, #e2e8f0);
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text-muted, #999);
}

.loading-text, .empty-text {
  color: #666;
}

.muted-text {
  color: var(--text-muted);
}

.cost-highlight {
  color: #ff6b6b;
}

.warning-text {
  color: #ff9800;
}

/* HTMLファイル編集モーダル */
#htmlFileUploadArea {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 400px;
  padding: 24px;
  width: 100%;
}

#htmlFileUploadArea.hidden {
  display: none !important;
}

.upload-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  padding: 48px 24px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-large);
  background: var(--surface-subtle);
  text-align: center;
  transition: all 0.2s ease;
}

.upload-drop-zone.drag-over {
  border-color: var(--accent-main);
  background: var(--accent-soft);
}

.upload-drop-zone:hover {
  border-color: var(--accent-main);
}

#htmlFileEditorArea {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.file-editor-view-btn.active {
  background: var(--accent-main);
  color: white;
  border-color: var(--accent-main);
}

/* ==================== 音声プレイヤースタイル ==================== */

#audioPlayerModal input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  cursor: pointer;
}

#audioPlayerModal input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent-main);
  border-radius: 50%;
  cursor: pointer;
}

#audioPlayerModal input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--accent-main);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}


/* 文字起こしビューアスタイル */
.transcript-segments {
  line-height: 1.8;
}

.transcript-segment {
  border-left: 3px solid var(--accent-main);
}

.transcript-segment:hover {
  background: var(--surface-hover, #f0f0f0) !important;
}

/* 音声プレイヤー字幕スタイル */
#subtitleText {
  transition: opacity 0.15s ease-out;
}

#subtitleContainer {
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.3);
}

/* =============== AIサイドパネルスタイル =============== */
.ai-side-panel {
  width: 380px;
  min-width: 280px;
  max-width: 60%;
  background: var(--surface-bg);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: none; /* リサイズ中のtransitionを無効化 */
  order: 2; /* 右側に配置 */
  position: relative;
}

/* パネルリサイズハンドル（編集画面用） */
.panel-resizer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: transparent;
  cursor: col-resize;
  z-index: 10;
  transition: background 0.2s ease;
}

.panel-resizer:hover,
.panel-resizer.resizing {
  background: var(--accent-main);
}

.panel-resizer::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 40px;
  background: var(--border-color);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.panel-resizer:hover::before,
.panel-resizer.resizing::before {
  opacity: 1;
  background: white;
}

#mainEditorArea {
  order: 1; /* 左側に配置 */
}

.ai-side-panel.collapsed {
  width: 0;
  min-width: 0;
  border-left: none;
}

.ai-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-subtle);
}

.ai-panel-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.ai-panel-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-panel-section-header .lucide-icon {
  width: 14px;
  height: 14px;
}

.ai-panel-selected-text {
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  font-size: 13.5px;
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-muted);
}

.ai-panel-selected-text.has-selection {
  color: var(--text-main);
  background: rgba(31, 111, 235, 0.05);
  border-color: var(--accent-main);
}

/* クイック編集ドロップダウン行 */
.ai-panel-quick-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.ai-quick-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-bg);
  color: var(--text-main);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-quick-select:hover {
  border-color: var(--accent-main);
}

.ai-quick-select:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* クイック質問カスタムドロップダウン */
.quick-question-dropdown {
  position: relative;
  width: 100%;
}

.quick-question-trigger {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-bg);
  color: var(--text-main);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quick-question-trigger:hover {
  border-color: var(--accent-main);
}

.quick-question-trigger .lucide-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.quick-question-trigger.open .lucide-icon {
  transform: rotate(180deg);
}

.quick-question-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
}

.quick-question-item {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: background 0.15s ease;
}

.quick-question-item:hover {
  background: var(--accent-soft);
}

.quick-question-item:first-child {
  border-radius: 7px 7px 0 0;
}

.quick-question-item:last-child {
  border-radius: 0 0 7px 7px;
}

.quick-question-item .lucide-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-main);
  flex-shrink: 0;
}

/* クイック編集カスタムドロップダウン */
.quick-edit-dropdown {
  position: relative;
  width: 100%;
}

.quick-edit-trigger {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-bg);
  color: var(--text-main);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quick-edit-trigger:hover {
  border-color: var(--accent-main);
}

.quick-edit-trigger .lucide-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.quick-edit-trigger.open .lucide-icon {
  transform: rotate(180deg);
}

.quick-edit-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}

.quick-edit-item {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: background 0.15s ease;
}

.quick-edit-item:hover {
  background: var(--accent-soft);
}

.quick-edit-item:first-child {
  border-radius: 7px 7px 0 0;
}

.quick-edit-item:last-child {
  border-radius: 0 0 7px 7px;
}

.quick-edit-item .lucide-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-main);
  flex-shrink: 0;
}

/* チャットメインエリア（大きく表示） */
.ai-panel-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.ai-panel-chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 16px 12px;
  color: var(--text-muted);
}

/* チャット入力エリア（編集画面 - 閲覧画面と統一） */
.ai-panel-chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--surface-bg);
  align-items: flex-end;
}

.ai-panel-selected-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  margin-bottom: 4px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-main);
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--accent-main);
}

.ai-panel-selected-indicator .lucide-icon {
  width: 12px;
  height: 12px;
}

.ai-panel-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.ai-panel-chat-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 13.5px;
  resize: none;
  background: var(--surface-bg);
  color: var(--text-main);
  line-height: 1.4;
}

.ai-panel-chat-input:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ai-panel-chat-send {
  padding: 10px 14px;
  border-radius: 10px;
  height: fit-content;
}

.ai-panel-chat-send .lucide-icon {
  width: 18px;
  height: 18px;
  margin: 0;
}

/* アクションバー（差分がある時に表示） */
.ai-panel-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border-color);
}

.ai-panel-action-info {
  font-size: 13.5px;
  color: var(--text-muted);
}

.ai-diff-stats-inline {
  display: flex;
  gap: 12px;
}

.ai-diff-stats-inline .added {
  color: #28a745;
}

.ai-diff-stats-inline .removed {
  color: #d73a49;
}

.ai-panel-action-btns {
  display: flex;
  gap: 8px;
}

.ai-panel-action-btns .btn-success {
  background: #28a745;
  border-color: #28a745;
  color: white;
}

.ai-panel-action-btns .btn-success:hover {
  background: #22863a;
  border-color: #22863a;
}

/* エディタ内の差分ハイライト */
.ai-diff-highlight-added {
  background: rgba(34, 197, 94, 0.2) !important;
  border-left: 3px solid #28a745 !important;
  padding-left: 8px !important;
  margin: 2px 0 !important;
  display: block !important;
}

.ai-diff-highlight-removed {
  background: rgba(248, 81, 73, 0.2) !important;
  border-left: 3px solid #d73a49 !important;
  padding-left: 8px !important;
  margin: 2px 0 !important;
  text-decoration: line-through !important;
  color: #cb2431 !important;
  display: block !important;
}

/* AI編集パネル ダークモード対応 */
@media (prefers-color-scheme: dark) {
  .ai-diff-stats-inline .added {
    color: #3fb950;
  }

  .ai-diff-stats-inline .removed {
    color: #f85149;
  }

  .ai-panel-action-bar {
    background: var(--surface-subtle);
  }

  .ai-panel-action-btns .btn-success {
    background: #238636;
    border-color: #238636;
  }

  .ai-panel-action-btns .btn-success:hover {
    background: #2ea043;
    border-color: #2ea043;
  }

  .ai-diff-highlight-added {
    background: rgba(63, 185, 80, 0.15) !important;
    border-left-color: #3fb950 !important;
  }

  .ai-diff-highlight-removed {
    background: rgba(248, 81, 73, 0.15) !important;
    border-left-color: #f85149 !important;
    color: #f85149 !important;
  }
}

/* 旧スタイル（互換性のため残す） */
.ai-panel-quick-actions {
  display: none; /* 非表示 */
}

.ai-quick-btn {
  display: none; /* 非表示 */
}

/* 差分プレビュー（旧） */
.ai-panel-diff-section {
  display: none; /* 新方式では使用しない */
}

/* アニメーション */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ai-loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* レスポンシブ */
@media (max-width: 1200px) {
  .ai-side-panel {
    width: 320px;
    min-width: 320px;
  }
}

@media (max-width: 768px) {
  .ai-side-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    min-width: 100%;
    z-index: 100;
  }
}

/* ========================================
   AIチャットパネル（議事録閲覧用）
   ======================================== */
.ai-chat-panel {
  width: 380px;
  min-width: 280px;
  max-width: 60%;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-medium);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: none; /* リサイズ中のtransitionを無効化 */
  position: relative;
}

/* パネルリサイズハンドル（閲覧画面用） */
.ai-chat-panel .panel-resizer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: transparent;
  cursor: col-resize;
  z-index: 10;
  transition: background 0.2s ease;
}

.ai-chat-panel .panel-resizer:hover,
.ai-chat-panel .panel-resizer.resizing {
  background: var(--accent-main);
  border-radius: var(--radius-medium) 0 0 var(--radius-medium);
}

.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-color);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 12px;
  color: var(--text-muted);
}

.ai-chat-message {
  display: flex;
  flex-direction: column;
  max-width: 90%;
}

.ai-chat-message.user {
  align-self: flex-end;
}

.ai-chat-message.assistant {
  align-self: flex-start;
}

.ai-chat-message-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 13.5px;
  word-wrap: break-word;
}

.ai-chat-message.user .ai-chat-message-bubble {
  background: var(--accent-main);
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-chat-message.assistant .ai-chat-message-bubble {
  background: #f0f0f0;
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-color);
}

.ai-chat-message-time {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
  padding: 0 4px;
}

.ai-chat-message.user .ai-chat-message-time {
  text-align: right;
  color: #4a5568;
}

.ai-chat-thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-subtle);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13.5px;
  align-self: flex-start;
}

.ai-chat-thinking-dots {
  display: flex;
  gap: 4px;
}

.ai-chat-thinking-dots span {
  width: 6px;
  height: 6px;
  background: var(--accent-main);
  border-radius: 50%;
  animation: aiChatDotPulse 1.4s infinite ease-in-out both;
}

.ai-chat-thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-chat-thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
.ai-chat-thinking-dots span:nth-child(3) { animation-delay: 0; }

@keyframes aiChatDotPulse {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.ai-chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--surface-bg);
  align-items: flex-end;
}

.ai-chat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.4;
  background: var(--surface-subtle);
  color: var(--text-main);
  min-height: 44px;
  max-height: 120px;
}

.ai-chat-input:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.ai-chat-input::placeholder {
  color: var(--text-muted);
}

.ai-chat-send-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* AIチャットトグルボタンがアクティブな時 */
#aiChatToggleBtn.active {
  background: var(--accent-main);
  color: white;
  border-color: var(--accent-main);
}

#aiChatToggleBtn.active:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

/* Markdown表示用 */
.ai-chat-message-bubble h1,
.ai-chat-message-bubble h2,
.ai-chat-message-bubble h3 {
  margin: 8px 0 4px 0;
  font-size: 1em;
  font-weight: 600;
}

.ai-chat-message-bubble ul,
.ai-chat-message-bubble ol {
  margin: 4px 0;
  padding-left: 20px;
}

.ai-chat-message-bubble li {
  margin: 2px 0;
}

.ai-chat-message-bubble p {
  margin: 4px 0;
}

.ai-chat-message-bubble code {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 1em;
}

.ai-chat-message-bubble pre {
  background: rgba(0, 0, 0, 0.1);
  padding: 8px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 8px 0;
}

.ai-chat-message-bubble pre code {
  background: none;
  padding: 0;
}

/* AIチャットパネル内の表スタイル */
.ai-chat-message-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13.5px;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.ai-chat-message-bubble table th,
.ai-chat-message-bubble table td {
  border: 1px solid var(--border-color);
  padding: 6px 8px;
  text-align: left;
  white-space: normal;
  min-width: 60px;
}

.ai-chat-message-bubble table th {
  background: rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

.ai-chat-message-bubble table tbody {
  display: table;
  width: 100%;
}

.ai-chat-message-bubble table thead {
  display: table;
  width: 100%;
}

/* デスクトップ: AI閉じるボタン非表示 */
.ai-chat-close-btn {
  display: none;
}

/* ========================================
   精度向上の質問パネル（議事録閲覧用）
   ======================================== */
.accuracy-questions-toggle-btn,
#accuracyQuestionsToggleBtn {
  position: relative;
}

.accuracy-questions-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--dt-accent-danger, #dc2626);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

#accuracyQuestionsToggleBtn.active {
  background: var(--accent-main);
  color: white;
  border-color: var(--accent-main);
}

#accuracyQuestionsToggleBtn.active:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.accuracy-questions-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accuracy-question-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-medium);
  background: var(--surface-bg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accuracy-question-card.answered {
  background: var(--surface-subtle);
  border-color: var(--dt-color-success-300, #86efac);
}

.accuracy-question-card.previewing {
  border-color: var(--accent-main);
}

.accuracy-question-preview-diff {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.accuracy-question-preview-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.accuracy-question-preview-diff-content {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  max-height: 220px;
  overflow-y: auto;
  font-size: 13.5px;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  background: var(--surface-bg);
}

.accuracy-question-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  font-weight: 600;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
}

.accuracy-question-status.pending {
  background: var(--dt-color-primary-50, #eff6ff);
  color: var(--dt-color-primary-700, #1a5cc7);
}

.accuracy-question-status.answered {
  background: var(--dt-color-success-100, #dcfce7);
  color: var(--dt-color-success-700, #15803d);
}

.accuracy-question-status .lucide-icon {
  width: 13px;
  height: 13px;
}

.accuracy-question-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
}

.accuracy-question-reason {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.accuracy-question-answer-display {
  font-size: 13.5px;
  color: var(--text-main);
  background: var(--surface-bg);
  border-left: 3px solid var(--dt-color-success-500, #059669);
  padding: 6px 10px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.accuracy-question-answer-input {
  width: 100%;
  resize: vertical;
  min-height: 56px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  padding: 8px 10px;
  font-size: 13.5px;
  line-height: 1.4;
  background: var(--surface-subtle);
  color: var(--text-main);
  font-family: inherit;
}

.accuracy-question-answer-input:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.accuracy-question-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.accuracy-questions-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 12px;
  font-size: 13.5px;
}

.accuracy-questions-generating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 12px;
  color: var(--text-muted);
}

/* レスポンシブ対応 */
@media (max-width: 900px) {
  .ai-chat-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    border-radius: 0;
    z-index: 10;
  }
  
  .ai-chat-panel .panel-resizer {
    display: none;
  }

  /* モバイル: AI閉じるボタン表示 */
  .ai-chat-close-btn {
    display: inline-flex;
  }
}

/* 全議事録AIチャット回答エリア */
.global-ai-response {
  background: var(--surface-bg);
  border-radius: var(--radius-medium);
  padding: 24px;
  line-height: 1.8;
}

.global-ai-response h1,
.global-ai-response h2,
.global-ai-response h3 {
  margin-top: 20px;
  margin-bottom: 12px;
  color: var(--text-main);
}

.global-ai-response h1:first-child,
.global-ai-response h2:first-child,
.global-ai-response h3:first-child {
  margin-top: 0;
}

.global-ai-response ul,
.global-ai-response ol {
  margin: 12px 0;
  padding-left: 24px;
}

.global-ai-response li {
  margin: 6px 0;
}

.global-ai-response p {
  margin: 12px 0;
}

.global-ai-response strong {
  color: var(--accent-main);
}

/* 表のラッパー（横スクロール対応） */
.global-ai-response .table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 16px 0;
}

.global-ai-response table {
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  white-space: nowrap;
}

.global-ai-response table th,
.global-ai-response table td {
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  text-align: left;
  white-space: normal;
  min-width: 80px;
}

.global-ai-response table th {
  background: var(--surface-subtle);
  font-weight: 600;
  white-space: nowrap;
}

.global-ai-response code {
  background: var(--surface-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 1em;
}

.global-ai-response pre {
  background: var(--surface-subtle);
  padding: 16px;
  border-radius: var(--radius-small);
  overflow-x: auto;
  margin: 16px 0;
}

.global-ai-response pre code {
  background: none;
  padding: 0;
}

/* AIチャット 参照議事録リンク */
.ai-chat-references {
  margin-top: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
}

.ai-chat-references-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  border-radius: var(--radius-small);
  transition: background 0.2s;
}

.ai-chat-references-header:hover {
  background: var(--surface-subtle);
}

.ai-chat-references-header i {
  transition: transform 0.2s;
}

.ai-chat-references.expanded .ai-chat-references-header i {
  transform: rotate(180deg);
}

.ai-chat-references-list {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.ai-chat-references.expanded .ai-chat-references-list {
  display: flex;
}

.ai-chat-reference-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-subtle);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13.5px;
}

.ai-chat-reference-item:hover {
  background: var(--accent-soft);
  color: var(--accent-main);
}

.ai-chat-reference-item .ref-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.ai-chat-reference-item .ref-date {
  color: var(--text-muted);
  font-size: 13.5px;
  white-space: nowrap;
}

/* 参照元ツールチップ */
.ref-tooltip-wrapper {
  display: inline-block;
  position: static;
  vertical-align: middle;
}

.ref-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 4px;
  opacity: 0.5;
  transition: opacity 0.2s;
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 2px 4px;
  color: var(--accent-main);
  position: relative;
}

.ref-tooltip-icon:hover {
  opacity: 1;
}

/* グローバルツールチップ（body直下に追加） */
#globalRefTooltip {
  position: fixed;
  background: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  z-index: 999999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  max-width: 300px;
  word-break: break-all;
  display: none;
}

#globalRefTooltip.visible {
  display: block;
}

/* ダークモード対応 */
[data-theme="dark"] #globalRefTooltip {
  background: #555;
  color: #fff;
}

/* タスク管理連携スタイル */
.form-section {
  padding: 20px;
  background: var(--surface-subtle);
  border-radius: var(--radius-medium);
  border: 1px solid var(--border-color);
}

.form-section h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

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

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

/* Pleasanterモーダル（他のモーダルより前面に表示） */
#taskExtractionModal,
#taskProgressModal,
#pleasanterSettingsModal {
  z-index: 1100;
}

/* タスクモーダルタブ */
.task-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s, border-color 0.2s;
}

.task-tab:hover {
  color: var(--text-main);
}

.task-tab.active {
  color: var(--accent-main);
  border-bottom-color: var(--accent-main);
  font-weight: 500;
}

.task-tab .lucide-icon {
  width: 16px;
  height: 16px;
}

/* タスク一覧ヘッダー */
.task-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.task-list-count {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

/* タスクフィルタエリア */
.task-filter-area {
  background: var(--surface-subtle);
  padding: 16px;
  border-radius: var(--radius-medium);
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.task-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .task-filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .task-filter-grid {
    grid-template-columns: 1fr;
  }
}

.task-filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-filter-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.task-filter-select {
  padding: 8px 10px;
  font-size: 13.5px;
  width: 100%;
  border-radius: var(--radius-small);
}

.task-filter-search {
  display: flex;
  gap: 10px;
  align-items: center;
}

.task-search-input-wrapper {
  flex: 1;
  position: relative;
}

.task-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.task-search-input {
  width: 100%;
  padding: 8px 10px 8px 34px;
  font-size: 13.5px;
  border-radius: var(--radius-small);
}

.task-filter-clear {
  padding: 8px 14px;
  font-size: 13.5px;
  white-space: nowrap;
}

/* タスクカード */
.task-card {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-medium);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.task-card:hover {
  border-color: var(--accent-main);
  box-shadow: 0 2px 8px rgba(31, 111, 235, 0.1);
}

.task-card.selected {
  border-color: var(--accent-main);
  background: var(--accent-soft);
}

.task-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.task-card-checkbox {
  margin-top: 0;
  flex-shrink: 0;
}

.task-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
}

.task-title-input {
  border: 1px solid transparent;
  background: transparent;
}

.task-title-input:hover,
.task-title-input:focus {
  border-color: var(--border-color);
  background: var(--surface-bg);
}

.task-card-body {
  margin-bottom: 12px;
}

.task-card-body textarea {
  border: 1px solid var(--border-color);
  background: var(--surface-subtle);
}

.task-card-meta {
  display: flex;
  gap: 16px;
  padding-left: 28px;
  flex-wrap: wrap;
}

.task-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.task-card-meta-item .lucide-icon {
  width: 14px;
  height: 14px;
}

/* 類似タスク警告 */
.similar-task-warning {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid #ffc107;
  border-radius: var(--radius-small);
  padding: 12px;
  margin-top: 12px;
  margin-left: 28px;
}

.similar-task-warning-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #856404;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.similar-task-item {
  background: var(--surface-bg);
  border-radius: var(--radius-small);
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 13.5px;
}

.similar-task-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* タスク進捗テーブル */
.task-progress-table {
  width: 100%;
  border-collapse: collapse;
}

.task-progress-table th,
.task-progress-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 13.5px;
}

.task-progress-table th {
  background: var(--surface-subtle);
  font-weight: 600;
  color: var(--text-muted);
}

.task-progress-table tr:hover {
  background: var(--surface-subtle);
}

/* ステータスバッジ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
}

.status-badge.status-new {
  background: rgba(29, 90, 153, 0.1);
  color: var(--color-status-normal);
}

.status-badge.status-in-progress {
  background: rgba(242, 180, 0, 0.12);
  color: var(--color-status-maintenance);
}

.status-badge.status-completed {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}

.status-badge.status-closed {
  background: var(--color-highlight-soft);
  color: var(--color-highlight);
}

/* ステータス選択ドロップダウン */
.status-select {
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background: var(--surface-bg);
  font-size: 13.5px;
  cursor: pointer;
}

.status-select:hover {
  border-color: var(--accent-main);
}

/* プロジェクト選択 */
.project-select-wrapper {
  margin-top: 8px;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent-main);
  border-radius: 12px;
  font-size: 13.5px;
  margin-right: 6px;
  margin-bottom: 6px;
}

/* 業務区分タグ */
.category-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 500;
}

.category-tag.category-routine {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.category-tag.category-pj {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.category-tag.category-incident {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}


/* ============================================
   フォルダ管理スタイル
   ============================================ */

/* フォルダサイドバー */
#adminSection.admin-dashboard.logged-in {
  display: flex;
  flex-direction: row;
  gap: 0;
  height: calc(100vh - 60px); /* ヘッダー60px分（フッターは各サイドバー内に収めたため確保不要） */
  overflow: hidden;
  padding: 0;
  margin: 0;
  position: relative;
}

.folder-sidebar {
  width: 280px;
  background: var(--surface-bg);
  border-right: none;
  display: flex;
  flex-direction: row;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.3s ease-in-out;
  margin-left: 0;
  padding-left: 0;
  box-shadow: none;
}

.folder-sidebar__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.folder-sidebar__content {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  /* 縦スクロールバーをシンプルに、目立たない表示にする */
  scrollbar-width: thin;
  scrollbar-color: var(--border-color, #cbd5e1) transparent;
}

.folder-sidebar__content::-webkit-scrollbar {
  width: 6px;
}

.folder-sidebar__content::-webkit-scrollbar-track {
  background: transparent;
}

.folder-sidebar__content::-webkit-scrollbar-thumb {
  background: var(--border-color, #cbd5e1);
  border-radius: 6px;
}

.folder-sidebar__content::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, #94a3b8);
}

/* サイドバー下部の開発元表記（旧: ページ全体固定フッター）
   常に画面幅いっぱいのフッターとして表示する必要はないため、サイドバー内に収める */
.folder-sidebar__footer {
  flex-shrink: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.folder-sidebar__footer-text {
  font-size: 13px;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.folder-sidebar__footer-text a {
  color: var(--accent-main);
  text-decoration: none;
  font-weight: 500;
}

.folder-sidebar__footer-text a:hover {
  text-decoration: underline;
}

/* フォルダアイテム */
.folder-item {
  display: flex;
  align-items: center;
  padding: 10px 12px 10px 28px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  border-left: 3px solid transparent;
}

.folder-item:hover {
  background: var(--surface-subtle);
}

/* 選択中フォルダの強調: 薄い青背景＋左端の太い青ライン＋太字＋アイコン/件数バッジを強調色にする。
   一覧内で選択状態が1つだけであることが一目でわかるようにする */
.folder-item--active {
  background: var(--accent-soft);
  border-left-width: 3px;
  border-left-color: var(--accent-main);
}

.folder-item--active .folder-item__name {
  font-weight: 700;
  color: var(--accent-strong, var(--accent-main));
}

.folder-item--active .folder-item__icon {
  color: var(--accent-main);
}

.folder-item--all {
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
  padding: 12px 12px 12px 8px;
}

.folder-item__icon {
  margin-right: 8px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.folder-item__name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-item__count {
  background: var(--border-color);
  color: var(--text-muted);
  font-size: 13.5px;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: auto;
  font-weight: 500;
  min-width: 20px;
  text-align: center;
}

.folder-item--active .folder-item__count {
  background: var(--accent-main);
  color: #fff;
}

.folder-item__create-btn {
  margin-left: 4px;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-muted);
}

.folder-item__create-btn:hover {
  background: var(--surface-bg);
  color: var(--accent-main);
}

.folder-item__create-btn .lucide-icon {
  width: 14px;
  height: 14px;
  margin: 0;
}

.folder-item__chevron {
  margin-right: 4px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.folder-item--expanded .folder-item__chevron {
  transform: rotate(90deg);
}

.folder-children {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease-out, opacity 0.2s ease-out;
}

.folder-item--expanded + .folder-children {
  max-height: 9999px;
  opacity: 1;
  transition: max-height 0.35s ease-in, opacity 0.25s ease-in;
}

/* フォルダモーダルのカラーピッカー */
.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.color-option:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.color-option.selected {
  border-color: var(--text-main);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text-main);
}

/* フォルダモーダルのアイコンピッカー */
.icon-option {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-option:hover {
  border-color: var(--accent-main);
  background: var(--accent-soft);
}

.icon-option.selected {
  border-color: var(--accent-main);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-main);
}

/* コンテキストメニュー */
.context-menu {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
}

.context-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.context-menu-item:hover {
  background: var(--surface-subtle);
}

.context-menu-item--danger {
  color: var(--danger);
}

.context-menu-item--danger:hover {
  background: rgba(217, 45, 32, 0.1);
}

.context-menu-item .lucide-icon {
  margin-right: 8px;
  width: 16px;
  height: 16px;
}

/* data-panelの幅調整 */
.data-panel {
  flex: 1;
  min-width: 0;
}

/* レスポンシブ対応 */
/* ボタンアイコン */
.btn-icon {
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--surface-subtle);
  color: var(--accent-main);
}

.btn-icon--sm {
  padding: 4px;
}

.btn-icon--sm .lucide-icon {
  width: 16px;
  height: 16px;
}

.btn-icon--danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.btn-icon--success:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

/* data-panelの調整 */
#adminSection.admin-dashboard .data-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--surface-bg);
  /* 一括操作バーをフロート表示するための位置基準 */
  position: relative;
}

.data-panel__header {
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 0 12px 12px;
  /* 横スクロールバーを常に表示（低解像度対応） */
  scrollbar-gutter: stable;
}

/* admin-dashboard全体の背景 */
#adminSection {
  background: var(--page-bg);
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
  #adminSection.admin-dashboard.logged-in {
    flex-direction: column;
    padding: 0;
    gap: 0;
    height: auto;
    min-height: calc(100vh - 60px);
    overflow: visible;
  }

  /* フォルダリストを折りたたみ可能にする */
  .folder-sidebar__content {
    max-height: 200px;
    overflow-y: auto;
  }

  /* データパネル: フルハイト確保 */
  #adminSection.admin-dashboard .data-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
    flex: 1;
    padding-bottom: 40px;
  }

  .data-panel__header {
    display: flex;
    padding: 12px;
  }

  /* スマホ: ヘッダーの検索/使い方/マニュアル行（デスクトップ用）を非表示。
     検索と再読み込みはパネルタイトル行のmobile-toolbarに、
     使い方/マニュアルはハンバーガーメニューに別途配置している */
  .app-header__toolbar-row {
    display: none !important;
  }

  /* モバイル: パネルタイトル行 */
  .panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  /* モバイル: タイトル横のツールバー */
  .mobile-toolbar {
    display: flex !important;
    align-items: center;
    gap: 4px;
  }

  .mobile-toolbar .btn-icon {
    min-height: 36px;
    min-width: 36px;
    padding: 6px;
  }

  .mobile-folder-toggle {
    color: var(--accent-main);
  }

  /* フォルダサイドバー: モバイルではデフォルト非表示 */
  .folder-sidebar {
    display: none !important;
  }

  .folder-sidebar.mobile-open {
    display: flex !important;
    width: 100%;
    height: auto;
    max-height: 240px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
  }

  /* サイトメイン余白 */
  .site-main__inner {
    padding: 8px;
  }
}

/* さらに小さい画面（480px以下）用の調整 */
@media (max-width: 480px) {
  .folder-sidebar.mobile-open {
    max-height: 180px;
  }

  .folder-sidebar__content {
    max-height: 160px;
  }

  .data-panel__header {
    padding: 10px;
  }

  .data-panel__header .panel-title {
    font-size: 13.5px;
  }
}

/* フォルダ移動モーダル */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  animation: fadeIn 0.2s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

@keyframes spinning {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spinning {
  animation: spinning 1s linear infinite;
}

.modal-overlay .modal-content {
  background: var(--surface-bg);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-large);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  position: relative;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-overlay .modal-content h2 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.modal-overlay .modal-content label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text-main);
}

.modal-overlay .modal-content .input-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-medium);
  font-size: 13.5px;
  color: var(--text-main);
  transition: all 0.2s;
  background: var(--surface-bg);
}

.modal-overlay .modal-content .input-field:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-overlay .modal-content .input-field:disabled {
  background: var(--surface-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
}

.modal-folder-info {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface-subtle);
  border-radius: var(--radius-medium);
  border: 1px solid var(--border-color);
}

.modal-folder-info__label {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.modal-folder-info__value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-folder-info__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.modal-button-container {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}
/* ========================================
   ユーティリティクラス
   ======================================== */

/* 非表示 */
.u-hidden {
  display: none !important;
}

/* マージン */
.u-mt-0 { margin-top: 0 !important; }
.u-mt-8 { margin-top: 8px !important; }
.u-mt-12 { margin-top: 12px !important; }
.u-mt-16 { margin-top: 16px !important; }
.u-mt-20 { margin-top: 20px !important; }
.u-mt-24 { margin-top: 24px !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-6 { margin-bottom: 6px !important; }
.u-mb-8 { margin-bottom: 8px !important; }
.u-mb-12 { margin-bottom: 12px !important; }
.u-mb-16 { margin-bottom: 16px !important; }
.u-mb-20 { margin-bottom: 20px !important; }
.u-ml-12 { margin-left: 12px !important; }
.u-ml-auto { margin-left: auto !important; }

/* パディング */
.u-p-8 { padding: 8px !important; }
.u-p-12 { padding: 12px !important; }
.u-py-40 { padding-top: 40px !important; padding-bottom: 40px !important; }

/* フレックス */
.u-flex {
  display: flex !important;
}
.u-flex-col {
  flex-direction: column !important;
}
.u-flex-wrap {
  flex-wrap: wrap !important;
}
.u-flex-1 {
  flex: 1 !important;
}
.u-items-center {
  align-items: center !important;
}
.u-justify-center {
  justify-content: center !important;
}
.u-justify-between {
  justify-content: space-between !important;
}
.u-justify-end {
  justify-content: flex-end !important;
}
.u-gap-4 { gap: 4px !important; }
.u-gap-6 { gap: 6px !important; }
.u-gap-8 { gap: 8px !important; }
.u-gap-12 { gap: 12px !important; }
.u-gap-16 { gap: 16px !important; }

/* グリッド */
.u-grid {
  display: grid !important;
}
.u-grid-cols-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}

/* テキスト */
.u-text-center {
  text-align: center !important;
}
.u-text-muted {
  color: var(--text-muted) !important;
}
.u-text-main {
  color: var(--text-main) !important;
}
.u-text-xs {
  font-size: 13.5px !important;
}
.u-text-sm {
  font-size: 13.5px !important;
}
.u-text-md {
  font-size: 13.5px !important;
}
.u-font-semibold {
  font-weight: 600 !important;
}

/* 表示 */
.u-block {
  display: block !important;
}
.u-nowrap {
  white-space: nowrap !important;
}

/* サイズ */
.u-w-full {
  width: 100% !important;
}

/* スクロール */
.u-scroll-y {
  overflow-y: auto !important;
}
.u-max-h-200 {
  max-height: 200px !important;
}
.u-max-h-250 {
  max-height: 250px !important;
}
.u-max-h-500 {
  max-height: 500px !important;
}
.u-max-h-600 {
  max-height: 600px !important;
}
.u-max-h-700 {
  max-height: 700px !important;
}

/* アイコン */
.lucide-icon--sm {
  width: 14px !important;
  height: 14px !important;
}
.lucide-icon--md {
  width: 16px !important;
  height: 16px !important;
}
.lucide-icon--lg {
  width: 20px !important;
  height: 20px !important;
}

/* フォーム */
.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text-main);
}
.form-group {
  margin-bottom: 16px;
}
.form-group--lg {
  margin-bottom: 4px;
}
.form-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.input-field--sm {
  padding: 6px 10px !important;
  font-size: 13.5px !important;
}
.input-field--resizable {
  resize: vertical;
}

/* 録音履歴: 中央モーダルではなく右スライドインパネルとして表示する
   （.modal-content側にmargin-left:autoで右端に固定。justify-content:flex-endは
   このモーダルの構成では効かない環境があったため使わない） */
#historyModal {
  align-items: stretch;
  padding: 0;
}

#historyModal .modal-content {
  width: 560px;
  max-width: 90vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  border-radius: 0;
  border-top: none;
  border-right: none;
  border-bottom: none;
  animation: none;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#historyModal.show .modal-content {
  transform: translateX(0);
}

@media (max-width: 768px) {
  #historyModal .modal-content {
    width: 100vw;
    max-width: 100vw;
  }
}

/* モーダル */
.modal-content--wide {
  max-width: 900px;
}
.modal-content--xl {
  max-width: 1400px;
  width: 95%;
}
.modal-body--flex {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* タブ */
.task-modal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0;
}

/* ローディング */
.loading-section {
  text-align: center;
  padding: 40px;
}
.loading-section__spinner {
  margin: 0 auto 16px;
}

/* AIチャット */
.ai-chat-room-panel {
  width: 280px;
  min-width: 200px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--surface-bg);
}
.ai-chat-section-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}
.ai-chat-folder-filter {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-subtle);
}
.ai-chat-filter-label {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* アップロード */
.upload-progress-bar {
  background: var(--border-color);
  border-radius: 8px;
  height: 24px;
  overflow: hidden;
  margin-bottom: 8px;
}
.upload-progress-fill {
  background: var(--accent-main);
  height: 100%;
  width: 0%;
  transition: width 0.3s;
}
.file-list-container {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-subtle);
  max-height: 200px;
  overflow-y: auto;
}
.user-mapping-list {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}

/* ステータステキスト */
.status-text {
  font-size: 13.5px;
}

/* ボタンコンテナ */
.btn-container {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.btn-container--center {
  justify-content: center;
}
.btn-container--end {
  justify-content: flex-end;
}

/* フィルタ */
.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-label {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* AIチャット追加クラス */
.ai-chat-select-actions {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 6px;
  background: var(--surface-subtle);
}
.ai-chat-select-btn {
  flex: 1;
  font-size: 13.5px !important;
  padding: 4px 8px !important;
}
.ai-chat-room-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.ai-chat-room-status {
  padding: 8px 12px;
  border-top: 1px solid var(--border-color);
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--surface-subtle);
}
.ai-chat-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--surface-subtle);
}
.ai-chat-welcome {
  padding: 60px 20px;
  text-align: center;
}
.ai-chat-welcome__icon {
  width: 48px;
  height: 48px;
  color: var(--accent-main);
  margin-bottom: 16px;
}
.ai-chat-welcome__title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 16px;
}
.ai-chat-welcome__desc {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}
.ai-chat-welcome__example {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 16px;
}
.ai-chat-header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-chat-header__icon {
  color: var(--accent-main);
}

/* AIチャット ダウンロードドロップダウン */
.ai-chat-download-menu {
  min-width: 180px;
  padding: 10px 8px;
}

.ai-chat-download-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-small);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.15s ease;
}

.ai-chat-download-item:hover {
  background: var(--surface-hover);
}

.ai-chat-download-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--accent-main);
  flex-shrink: 0;
}

.ai-chat-download-item__icon .lucide-icon {
  width: 14px;
  height: 14px;
}

.ai-chat-download-item:hover .ai-chat-download-item__icon {
  background: var(--accent-subtle, rgba(31,111,235,0.1));
}

.ai-chat-download-item__body {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.ai-chat-download-item__label {
  font-weight: 500;
}

.ai-chat-download-item__ext {
  font-size: 13.5px;
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
}
/* 中央パネル 最新回答ツールバー */
.ai-chat-content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 6px 14px;
  margin: -24px -24px 16px -24px;
  background: var(--surface-main, var(--bg-primary));
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: -24px;
  z-index: 2;
}
.ai-chat-content-toolbar__label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.ai-chat-quick-section {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
}

/* 議事録表示モーダル */
.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header-left,
.modal-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-title--inline {
  margin: 0;
}
.minutes-tab-container {
  display: flex;
  background: var(--surface-subtle);
  border-radius: 8px;
  padding: 4px;
}
.minutes-content-area {
  flex: 1;
  overflow-y: auto;
  line-height: 1.8;
  padding: 24px;
  background: var(--surface-subtle);
}
.modal-footer-actions {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  flex-wrap: wrap;
  flex-shrink: 0;
  justify-content: flex-end;
  border-top: 1px solid var(--border-color);
  background: var(--surface-bg);
}
.ai-chat-welcome-inner {
  text-align: center;
}
.ai-chat-welcome-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-main);
  margin-bottom: 12px;
}

/* ============================================
   UI/UX 最適化スタイル
   ============================================ */

/* インタラクティブ要素の基本トランジション */
.btn,
.input-field,
.toggle-switch-slider,
.folder-item,
.room-menu-item,
table tr,
.modal-content {
  transition: all 0.2s ease;
}

/* ボタンのホバー・アクティブ状態の強化 */
.btn:active {
  transform: scale(0.98);
}

.btn-outline:hover {
  background: var(--accent-soft);
  border-color: var(--accent-main);
}

.btn-secondary:hover {
  background: var(--surface-subtle);
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

/* 入力フィールドのフォーカス状態強化 */
.input-field:focus {
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.input-field:hover:not(:focus):not(:disabled) {
  border-color: var(--text-muted);
}

.input-field:disabled {
  background: var(--surface-subtle);
  cursor: not-allowed;
  opacity: 0.6;
}

/* テーブル行のホバーエフェクト */
.table-wrapper table tbody tr {
  transition: background-color 0.15s ease;
}

.table-wrapper table tbody tr:hover {
  background-color: var(--color-bg-subtle);
}

/* 保存インジケーター */
.save-indicator {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13.5px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.save-indicator--saving {
  color: var(--accent-main);
}

.save-indicator--saved {
  color: var(--success);
}

.save-indicator--error {
  color: var(--danger);
}

/* ローディングスピナーアニメーション */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.save-indicator .lucide-icon {
  animation: spin 1s linear infinite;
}

.save-indicator--saved .lucide-icon,
.save-indicator--error .lucide-icon {
  animation: none;
}

/* テーブルセルのユーティリティ */
/* 全選択チェックボックス列: 共通の .table-wrapper table td { padding: 12px 14px }
   のままだと幅40pxのセルにチェックボックスが収まらず、overflow:hidden +
   text-overflow:ellipsis によって「...」が表示されてしまう。
   詳細度をそのルールより上げて狭いパディングに上書きし、省略表示も無効にする。 */
.rooms-table td.td-checkbox,
.rooms-table th.td-checkbox {
  width: 40px;
  padding: 8px 4px;
  overflow: visible;
  text-overflow: unset;
}

.td-status {
  width: 132px;
  text-align: left;
  padding: 8px 8px;
  /* バッジ（アイコン+テキスト）が列幅を僅かに超えても、省略記号「…」が
     小さな点のように見えて誤解を招くため、このセルでは省略表示を無効にする */
  overflow: visible;
  text-overflow: unset;
}

/* 作成者・所属フォルダは優先度の低い情報のため、幅を縮小し文字も少し小さくする */
.td-creator {
  width: 96px;
  font-size: 13.5px;
  padding: 8px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-folder {
  width: 120px;
  font-size: 13.5px;
  padding: 8px 10px;
}

.folder-cell-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.folder-cell-label__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-meeting-title {
  /* 幅は指定せず、テーブルの残りスペースを最大限受け取る（一覧の主要列） */
  overflow: hidden;
}

.td-scheduled-start {
  width: 226px;
  min-width: 226px;
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
}

.td-actions {
  /* 議事録・録音ボタン＋⋮メニューの合計幅（約217px）に対して190pxでは狭く、
     ⋮メニューのホバー背景がセルの overflow: hidden で右側だけ切れて見えていた。
     余裕を持って220pxに広げる。 */
  width: 220px;
  text-align: left;
}

.room-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 主要操作ボタン（議事録/録音）: メインカラーの濃淡で塗り分けた背景+白抜き文字にして
   一目で押せる操作だとわかるようにする（議事録=通常色、録音=濃い色） */
.room-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-small, 8px);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  transition: filter var(--transition-fast);
}

.room-action-btn .lucide-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.room-action-btn--minutes {
  background: #2563eb !important;
  color: #fff !important;
  border-color: transparent !important;
}

.room-action-btn--minutes:hover:not(:disabled) {
  background: #2563eb !important;
  color: #fff !important;
  border-color: transparent !important;
  filter: brightness(0.92);
}

.room-action-btn--recording {
  background: #1e40af !important;
  color: #fff !important;
  border-color: transparent !important;
}

.room-action-btn--recording:hover:not(:disabled) {
  background: #1e40af !important;
  color: #fff !important;
  border-color: transparent !important;
  filter: brightness(0.92);
}

@media (prefers-color-scheme: dark) {
  .room-action-btn--minutes,
  .room-action-btn--minutes:hover:not(:disabled) {
    background: #4f8ef7 !important;
    color: #fff !important;
  }

  .room-action-btn--recording,
  .room-action-btn--recording:hover:not(:disabled) {
    background: #3661c9 !important;
    color: #fff !important;
  }
}

.td-memo {
  width: 180px;
}

/* メモ欄: クリックしたときだけ入力欄に切り替える。常時入力欄を出すと視覚的ノイズが多いため、
   通常はテキスト（または未入力時は「+ メモ」の簡易表示）にする */
.memo-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.memo-display {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-size: 13.5px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memo-display:hover {
  background: var(--surface-subtle);
  border-color: var(--border-color);
}

.memo-display--empty {
  color: var(--text-muted);
}

.memo-display--empty .lucide-icon {
  width: 13px;
  height: 13px;
}

.memo-display--hidden {
  display: none;
}

.memo-input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  font-size: 13.5px;
}

.memo-input--hidden {
  display: none;
}

.memo-status {
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 会議キー表示 */
.room-key-display {
  font-size: 13.5px;
  padding: 4px 6px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.room-key-display:hover {
  background: var(--accent-soft);
}

/* 会議名入力コンテナ */
.meeting-title-container {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.meeting-title-text {
  font-size: 13.5px;
  color: var(--text-main);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 0;
  cursor: default;
}

.meeting-title-text.meeting-title-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.meeting-title-input {
  font-size: 13.5px;
  padding: 6px 10px;
  flex: 1;
  min-width: 0;
}

.meeting-title-input--hidden {
  display: none;
}

.meeting-title-edit-btn {
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
  border: none;
  background: transparent;
}

.meeting-title-container:hover .meeting-title-edit-btn {
  opacity: 1;
}

.meeting-title-edit-btn:hover {
  opacity: 1;
  color: var(--accent-main);
  background: transparent;
  border: none;
}

/* 有効期限の警告アイコン（会議名の左側、ホバーで期限日時を表示） */
.meeting-expiry-warn-icon-wrapper {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: default;
}

.meeting-expiry-warn-icon {
  width: 16px !important;
  height: 16px !important;
  margin: 0;
  flex-shrink: 0;
  color: var(--warning);
  cursor: default;
}

.meeting-expiry-warn-icon--expired {
  color: var(--danger);
}

/* 詳細ボタン: 会議名列の視覚的ノイズを減らすため、通常時は控えめ（半透明）にし、
   行/会議名にホバーしたときだけアイコンを強調する（編集ボタンと同じパターン） */
.btn-detail {
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
  border: none;
  background: transparent;
}

.meeting-title-container:hover .btn-detail {
  opacity: 1;
}

.btn-detail:hover:not(:disabled) {
  opacity: 1;
  color: var(--accent-main);
  background: transparent;
  border: none;
}

.btn-detail--disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

/* 日時表示 */
.datetime-display {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.datetime-display__sub {
  color: var(--text-muted);
  font-size: 13.5px;
}

/* 期限切れバッジ */
.badge-expired {
  background: var(--danger);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 500;
}

/* メモ入力 */
.memo-textarea {
  width: 100%;
  min-height: 32px;
  max-height: 80px;
  font-size: 13.5px;
  padding: 6px 8px;
  resize: vertical;
}

/* フィルター行のユーティリティ */
.filter-row-cell {
  padding: 8px 12px;
  background: transparent;
}

.filter-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

/* 検索アイコンをボタン化し、クリックでも検索を実行できるようにする
   （別の「検索」ボタンを廃止し、視覚的なノイズを減らす）。
   button. でセレクタの詳細度を上げ、後方の [title] { position: relative } に
   上書きされないようにする */
button.search-input-icon-btn {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 1;
}

.search-input-icon-btn:hover {
  background: var(--surface-subtle);
  color: var(--accent-main);
}

.search-input-icon {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.search-input {
  flex: 1;
  font-size: 13.5px;
  padding: 8px 12px 8px 36px;
}

/* ソート矢印 */
.sort-arrow {
  font-size: 13.5px;
  color: var(--accent-main);
  margin-left: 4px;
}

/* テーブルヘッダーのソート可能列 */
th[data-sortable] {
  cursor: pointer;
  user-select: none;
}

th[data-sortable]:hover {
  background: var(--surface-subtle);
}

/* 空状態メッセージ */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

/* モーダルのオーバーレイアニメーション */
.modal {
  transition: opacity 0.2s ease;
}

.modal.show {
  opacity: 1;
}

.modal-content {
  transform: translateY(0);
  transition: transform 0.2s ease;
}

.modal.show .modal-content {
  animation: modalSlideIn 0.2s ease;
}

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

/* カード風パネル */
.data-panel {
  background: var(--surface-bg);
  border-radius: 0;
  box-shadow: none;
}

/* ステータスバッジの改善 */
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.status:hover {
  transform: scale(1.1);
}

/* フォルダアイテムのホバー */
.folder-item:hover {
  background: var(--accent-soft);
}

.folder-item--active {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent-main);
}

/* スクロールバーのカスタマイズ */
.table-wrapper::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.ai-chat-content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.ai-chat-content::-webkit-scrollbar-track {
  background: var(--surface-subtle);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.ai-chat-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.ai-chat-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ツールチップ風ホバー効果 */
[title] {
  position: relative;
}

/* レスポンシブ改善 */
@media (max-width: 768px) {
  .filter-container {
    flex-wrap: wrap;
  }
  
  .search-input-wrapper {
    width: 100%;
    flex: none;
  }
}

/* プリントスタイル */
@media print {
  .app-header,
  .folder-sidebar,
  .panel-toolbar,
  .btn {
    display: none !important;
  }
  
  .data-panel {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   ユーティリティクラス
   ============================================ */

/* テキストカラー */
.text-muted {
  color: var(--text-muted) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.text-success {
  color: var(--success) !important;
}

/* テキストスタイル */
.text-bold {
  font-weight: bold !important;
}

.text-center {
  text-align: center !important;
}

/* テーブルスタイル
   幅は画面いっぱいに広げ、列幅はtable-layout: fixedで固定配分する。
   会議名列だけ幅を指定せず、残りのスペースを最大限受け取るようにする。 */
.rooms-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}

/* ========================================
   横スクロール対応（低解像度ディスプレイ）
   IDセレクタで確実に適用
   ======================================== */
#roomList {
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  /* 縦スクロールバーはシンプルに、横スクロールバー（低解像度対応）は必要な場合のみ表示 */
  scrollbar-width: thin;
  scrollbar-color: var(--border-color, #cbd5e1) transparent;
}

/* Webkit系ブラウザ: #roomList専用スクロールバー（縦は細くシンプル、横は視認性を維持） */
#roomList::-webkit-scrollbar {
  width: 6px;
  height: 12px;
}

#roomList::-webkit-scrollbar-track {
  background: transparent;
}

#roomList::-webkit-scrollbar-thumb {
  background: var(--border-color, #cbd5e1);
  border-radius: 6px;
  border: none;
  min-width: 40px;
}

#roomList::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, #94a3b8);
}

#roomList::-webkit-scrollbar-corner {
  background: transparent;
}

#roomList > .rooms-table {
  width: 100% !important;
  min-width: 960px !important;
  table-layout: fixed !important;
}

.rooms-table th,
.rooms-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.th-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.th-sortable:hover {
  background: var(--surface-subtle);
}

/* Excel風の列フィルタ（所属フォルダ・作成者など） */
th.th-filterable {
  display: table-cell;
}

th.th-filterable > .th-header-content {
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.column-filter-icon {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.column-filter-icon:hover {
  background: var(--surface-hover, rgba(0, 0, 0, 0.06));
  color: var(--text-primary);
}

.column-filter-icon .lucide-icon {
  width: 14px;
  height: 14px;
}

.column-filter-icon--active {
  color: var(--accent-main);
}

.column-filter-dropdown {
  z-index: 2000;
  width: 220px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.column-filter-search {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.column-filter-search .input-field {
  width: 100%;
  font-size: 13.5px;
  padding: 6px 8px;
}

.column-filter-list {
  overflow-y: auto;
  padding: 4px 0;
}

.column-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-filter-option:hover {
  background: var(--surface-subtle);
}

.column-filter-option input[type="checkbox"] {
  flex-shrink: 0;
}

.column-filter-option--all {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2px;
  font-weight: 600;
}

/* 期限切れ行 */
.row-expired {
  opacity: 0.6;
}

/* ボタンサイズバリエーション */
.btn-search {
  padding: 8px 20px;
  font-size: 13.5px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-filter {
  padding: 8px 16px;
  font-size: 13.5px;
  white-space: nowrap;
}

/* ============================================
   定期会議管理
   ============================================ */

.recurring-meetings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.recurring-meetings-header .form-desc {
  flex: 1;
  margin: 0;
}

/* 定期会議フォーム */
.recurring-meeting-form {
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.recurring-meeting-form h3 {
  margin: 0 0 16px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

/* 定期会議テーブル */
.recurring-meetings-table {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.recurring-meetings-table-header {
  display: grid;
  grid-template-columns: 1fr 140px 150px 80px 130px;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-color);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recurring-meetings-table-row {
  display: grid;
  grid-template-columns: 1fr 140px 150px 80px 130px;
  gap: 12px;
  padding: 14px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

.recurring-meetings-table-row:last-child {
  border-bottom: none;
}

.recurring-meetings-table-row:hover {
  background: var(--surface-subtle);
}

.rmtr-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rmtr-name-text {
  font-weight: 500;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rmtr-time {
  font-size: 13.5px;
}

.rmtr-pattern {
  font-size: 13.5px;
  color: var(--text-sub);
}

.rmtr-folder {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rmtr-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

/* ステータスバッジ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-badge.status--active {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}

.status-badge.status--inactive {
  background: var(--color-highlight-soft);
  color: var(--color-highlight);
}

/* 定期会議フッター */
.recurring-meetings-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* 空状態 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

/* modal-content--lg */
.modal-content--lg {
  max-width: 800px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .recurring-meetings-header {
    flex-direction: column;
  }
  
  .recurring-meetings-table-header,
  .recurring-meetings-table-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .rmth-pattern,
  .rmth-folder,
  .rmtr-pattern,
  .rmtr-folder {
    display: none;
  }
}

/* ============================================
   高度な検索
   ============================================ */

.advanced-search-form {
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.advanced-search-results {
  min-height: 200px;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.search-results-count {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.search-result-item:hover {
  border-color: var(--accent-main);
  background: var(--surface-subtle);
}

.search-result-main {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.search-result-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.search-result-snippet {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--surface-subtle);
  border-radius: 4px;
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.match-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.match-badge--meta {
  background: color-mix(in srgb, var(--accent-main) 15%, transparent);
  color: var(--accent-main);
}

.match-badge--minutes {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.match-badge--speaker {
  background: rgba(31, 111, 235, 0.15);
  color: #60a5fa;
}

.lucide-icon--xs {
  width: 12px;
  height: 12px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-sub);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .search-result-item {
    flex-direction: column;
    gap: 12px;
  }
  
  .search-result-badges {
    flex-direction: row;
  }
}

/* =============== 一括操作バー =============== */
/* テーブルの直前に通常のフローで挿入すると表示・非表示ごとに表全体が
   上下にずれて操作しづらく、テーブル上部にフロート表示すると1行目と
   重なって操作しづらいため、data-panelの下部中央にフロート表示する
   （表のレイアウトには影響しない） */
.bulk-action-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #e8f4fd 0%, #dbeafe 100%);
  border: 1px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
  animation: slideInUp 0.2s ease-out;
  white-space: nowrap;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

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

.bulk-action-bar .selected-count {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.bulk-action-bar .bulk-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-action-bar .bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bulk-action-bar .bulk-btn-delete {
  background: #fee2e2;
  color: #dc2626;
}

.bulk-action-bar .bulk-btn-delete:hover {
  background: #fecaca;
}

.bulk-action-bar .bulk-btn-move {
  background: #fef3c7;
  color: #d97706;
}

.bulk-action-bar .bulk-btn-move:hover {
  background: #fde68a;
}

.bulk-action-bar .bulk-btn-extend {
  background: #d1fae5;
  color: #059669;
}

.bulk-action-bar .bulk-btn-extend:hover {
  background: #a7f3d0;
}

.bulk-action-bar .bulk-btn-cancel {
  background: #f3f4f6;
  color: #6b7280;
}

.bulk-action-bar .bulk-btn-cancel:hover {
  background: #e5e7eb;
}

/* 会議室リストのチェックボックス */
.rooms-list .room-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.rooms-list th:first-child,
.rooms-list td:first-child {
  width: 40px;
  text-align: center;
}

/* 一括移動モーダル */
.bulk-move-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.bulk-move-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  min-width: 320px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.bulk-move-content h3 {
  margin: 0 0 16px 0;
  color: var(--text-main);
}

.bulk-folder-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.bulk-folder-item {
  padding: 12px 16px;
  margin: 4px 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.bulk-folder-item:hover {
  background: #f3f4f6;
  border-color: var(--accent);
}

.bulk-folder-item i {
  color: var(--accent);
}

.bulk-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 一括期限延長モーダル */
.bulk-extend-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  min-width: 300px;
}

.bulk-extend-content h3 {
  margin: 0 0 16px 0;
  color: var(--text-main);
}

.bulk-extend-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.bulk-extend-option {
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-weight: 500;
  transition: all 0.15s ease;
}

.bulk-extend-option:hover {
  background: #d1fae5;
  border-color: #059669;
  color: #059669;
}

/* =============== ドラッグ＆ドロップ =============== */
.row-dragging {
  opacity: 0.5;
  background: #e0f2fe !important;
}

.rooms-table tr[draggable="true"] {
  cursor: grab;
}

.rooms-table tr[draggable="true"]:active {
  cursor: grabbing;
}

.folder-item--dragover {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
  border: 2px dashed var(--accent) !important;
  border-radius: 8px;
  transform: scale(1.02);
  transition: all 0.15s ease;
}

.folder-item--all.folder-item--dragover {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
  border: 2px dashed #059669 !important;
}

/* ============================================================
   COMPREHENSIVE DARK MODE OVERRIDES
   GitHub Dark palette:
     page-bg: #0d1117  surface-bg: #161b22  surface-subtle: #1c2128
     border: #30363d   text-main: #e6edf3   text-muted: #8b949e
     accent: #58a6ff   success: #34d399     danger: #f87171
   ============================================================ */
@media (prefers-color-scheme: dark) {

  /* --- Help Button --- */
  .help-button {
    background: #161b22 !important;
    color: #e6edf3 !important;
    border-color: #30363d !important;
  }
  .help-button:hover {
    background: #1c2128 !important;
    border-color: var(--accent-main) !important;
  }

  /* --- Input field hover --- */
  .input-field:hover {
    border-color: var(--accent-main) !important;
  }

  /* --- Toggle Switches --- */
  .toggle-switch-slider {
    background: #30363d !important;
  }
  .toggle-switch-slider::after {
    background: #8b949e !important;
  }
  input:checked + .toggle-switch-slider {
    background: #1e3a5f !important;
  }
  input:checked + .toggle-switch-slider::after {
    background: var(--accent-main) !important;
  }
  #autoRefreshToggle .toggle-switch-slider {
    background: #30363d !important;
  }
  #autoRefreshToggle input:checked + .toggle-switch-slider {
    background: #1e3a5f !important;
  }

  /* --- Warning / Info / Danger Buttons --- */
  .btn.btn-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
  }
  .btn.btn-warning:hover {
    background: rgba(245, 158, 11, 0.25) !important;
  }
  .btn-small.btn-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
  }
  .btn-small.btn-warning:hover {
    background: rgba(245, 158, 11, 0.25) !important;
  }
  .btn-small.btn-info {
    background: color-mix(in srgb, var(--accent-main) 15%, transparent) !important;
    color: var(--accent-main) !important;
    border-color: color-mix(in srgb, var(--accent-main) 30%, transparent) !important;
  }
  .btn-small.btn-info:hover {
    background: rgba(88, 166, 255, 0.25) !important;
  }
  .btn-danger,
  .btn-small.btn-danger {
    background: rgba(248, 113, 113, 0.12) !important;
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
  }
  .btn-danger:hover,
  .btn-small.btn-danger:hover {
    background: rgba(248, 113, 113, 0.22) !important;
  }

  /* --- Status Inactive --- */
  .status.inactive {
    background: rgba(139, 148, 158, 0.15) !important;
    color: #8b949e !important;
  }

  /* --- Auto Refresh / Pending / Expiring --- */
  .pending-notice {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #fbbf24 !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
  }
  .expiring-soon {
    background: rgba(248, 113, 113, 0.12) !important;
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
  }

  /* --- Minutes Content Table Hover --- */
  .minutes-content table tr:hover {
    background: rgba(88, 166, 255, 0.06) !important;
  }
  .minutes-content table th {
    background: #161b22 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
  }
  .minutes-content table td {
    border-color: #30363d !important;
  }

  /* --- Transcript Segment Hover --- */
  .transcript-segment:hover {
    background: rgba(88, 166, 255, 0.06) !important;
  }

  /* --- AI Chat --- */
  .ai-chat-message.assistant .ai-chat-message-bubble {
    background: #1c2128 !important;
    color: #e6edf3 !important;
    border-color: #30363d !important;
  }
  .ai-chat-message.user .ai-chat-message-bubble {
    background: rgba(88, 166, 255, 0.12) !important;
    color: #e6edf3 !important;
  }
  .ai-chat-message .ai-chat-message-time {
    color: #6e7681 !important;
  }
  .ai-chat-message-bubble code {
    background: rgba(110, 118, 129, 0.2) !important;
    color: #e6edf3 !important;
    border: 1px solid #30363d !important;
  }
  .ai-chat-message-bubble pre {
    background: #0d1117 !important;
    color: #e6edf3 !important;
    border: 1px solid #30363d !important;
  }
  .ai-chat-message-bubble pre code {
    background: transparent !important;
    border: none !important;
  }
  .ai-chat-input-container {
    background: #161b22 !important;
    border-color: #30363d !important;
  }
  .ai-chat-input {
    background: #0d1117 !important;
    color: #e6edf3 !important;
    border-color: #30363d !important;
  }
  .ai-chat-input:focus {
    border-color: var(--accent-main) !important;
  }
  .ai-chat-header {
    background: #161b22 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
  }

  /* --- Modal Folder Info --- */
  .modal-folder-info {
    background: linear-gradient(135deg, #161b22 0%, #1c2128 100%) !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
  }
  .modal-folder-info .folder-info-label {
    color: #8b949e !important;
  }
  .modal-folder-info .folder-info-value {
    color: #e6edf3 !important;
  }

  /* --- Similar Task Warning --- */
  .similar-task-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    color: #fbbf24 !important;
  }
  .similar-task-warning strong {
    color: #fbbf24 !important;
  }

  /* --- Bulk Action Bar --- */
  .bulk-action-bar {
    background: linear-gradient(135deg, #161b22 0%, #1c2128 100%) !important;
    border-color: #30363d !important;
    box-shadow: 0 4px 12px rgba(1, 4, 9, 0.4) !important;
    color: #e6edf3 !important;
  }
  .bulk-action-bar .bulk-count {
    color: var(--accent-main) !important;
  }
  .bulk-btn-delete {
    background: rgba(248, 113, 113, 0.15) !important;
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
  }
  .bulk-btn-delete:hover {
    background: rgba(248, 113, 113, 0.25) !important;
  }
  .bulk-btn-move {
    background: color-mix(in srgb, var(--accent-main) 15%, transparent) !important;
    color: var(--accent-main) !important;
    border-color: color-mix(in srgb, var(--accent-main) 30%, transparent) !important;
  }
  .bulk-btn-move:hover {
    background: color-mix(in srgb, var(--accent-main) 25%, transparent) !important;
  }
  .bulk-btn-extend {
    background: rgba(52, 211, 153, 0.15) !important;
    color: #34d399 !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
  }
  .bulk-btn-extend:hover {
    background: rgba(52, 211, 153, 0.25) !important;
  }
  .bulk-btn-cancel {
    background: rgba(139, 148, 158, 0.12) !important;
    color: #8b949e !important;
    border-color: rgba(139, 148, 158, 0.25) !important;
  }
  .bulk-btn-cancel:hover {
    background: rgba(139, 148, 158, 0.22) !important;
    color: #e6edf3 !important;
  }

  /* --- Bulk Move / Extend Modals --- */
  .bulk-move-content {
    background: #161b22 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
  }
  .bulk-folder-item {
    background: #1c2128 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
  }
  .bulk-folder-item:hover,
  .bulk-folder-item.selected {
    background: color-mix(in srgb, var(--accent-main) 12%, transparent) !important;
    border-color: var(--accent-main) !important;
  }
  .bulk-extend-content {
    background: #161b22 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
  }
  .bulk-extend-option {
    background: #1c2128 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
  }
  .bulk-extend-option:hover,
  .bulk-extend-option.selected {
    background: color-mix(in srgb, var(--accent-main) 12%, transparent) !important;
    border-color: var(--accent-main) !important;
  }

  /* --- Drag & Drop States --- */
  .row-dragging {
    background: color-mix(in srgb, var(--accent-main) 10%, transparent) !important;
    border-color: var(--accent-main) !important;
    box-shadow: 0 4px 12px rgba(1, 4, 9, 0.4) !important;
  }
  .folder-item--dragover {
    background: color-mix(in srgb, var(--accent-main) 10%, transparent) !important;
    border: 2px dashed var(--accent-main) !important;
  }
  .folder-item--all.folder-item--dragover {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.12) 0%, rgba(52, 211, 153, 0.06) 100%) !important;
    border: 2px dashed #34d399 !important;
  }

  /* --- Scrollbar --- */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: #0d1117;
  }
  ::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #484f58;
  }

  /* --- Selection --- */
  ::selection {
    background: rgba(88, 166, 255, 0.25);
    color: #e6edf3;
  }

  /* --- Modal Overlay / Content --- */
  .modal-overlay {
    background: rgba(1, 4, 9, 0.7) !important;
  }
  .modal-content {
    background: #161b22 !important;
    border-color: #30363d !important;
    box-shadow: 0 8px 24px rgba(1, 4, 9, 0.5) !important;
  }
  .modal-header {
    border-color: #30363d !important;
    color: #e6edf3 !important;
  }
  .modal-body {
    color: #e6edf3 !important;
  }
  .modal-footer {
    border-color: #30363d !important;
  }

  /* --- Tab Navigation --- */
  .tab-btn {
    color: #8b949e !important;
  }
  .tab-btn:hover {
    color: #e6edf3 !important;
    background: color-mix(in srgb, var(--accent-main) 6%, transparent) !important;
  }
  .tab-btn.active {
    color: var(--accent-main) !important;
    border-color: var(--accent-main) !important;
  }

  /* --- Cards / Panels --- */
  .card,
  .panel,
  .section-card {
    background: #161b22 !important;
    border-color: #30363d !important;
  }

  /* --- Table zebra and borders --- */
  .history-table tbody tr:nth-child(even) {
    background: rgba(22, 27, 34, 0.5) !important;
  }
  .history-table tbody tr:hover {
    background: rgba(88, 166, 255, 0.06) !important;
  }

  /* --- Placeholders --- */
  .input-field::placeholder,
  input::placeholder,
  textarea::placeholder {
    color: #484f58 !important;
  }

  /* --- Tooltip --- */
  .tooltip,
  [data-tooltip]::after {
    background: #1c2128 !important;
    color: #e6edf3 !important;
    border-color: #30363d !important;
  }

  /* --- Notification / Toast --- */
  .notification,
  .toast {
    background: #161b22 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
    box-shadow: 0 4px 12px rgba(1, 4, 9, 0.4) !important;
  }

  /* --- Checkbox styling --- */
  .bulk-checkbox,
  input[type="checkbox"] {
    accent-color: var(--accent-main) !important;
  }

  /* --- Context Menu --- */
  .context-menu {
    background: #161b22 !important;
    border-color: #30363d !important;
    box-shadow: 0 4px 12px rgba(1, 4, 9, 0.5) !important;
  }
  .context-menu-item {
    color: #e6edf3 !important;
  }
  .context-menu-item:hover {
    background: rgba(88, 166, 255, 0.1) !important;
  }

  /* --- Select Elements --- */
  select {
    background: #0d1117 !important;
    color: #e6edf3 !important;
    border-color: #30363d !important;
  }
  select:hover {
    border-color: var(--accent-main) !important;
  }
  select option {
    background: #161b22 !important;
    color: #e6edf3 !important;
  }

  /* --- Textarea --- */
  textarea {
    background: #0d1117 !important;
    color: #e6edf3 !important;
    border-color: #30363d !important;
  }
  textarea:focus {
    border-color: var(--accent-main) !important;
  }

  /* --- Empty States / Placeholders --- */
  .empty-state,
  .no-data,
  .placeholder-text {
    color: #8b949e !important;
  }

  /* --- Badge --- */
  .badge {
    background: color-mix(in srgb, var(--accent-main) 15%, transparent) !important;
    color: var(--accent-main) !important;
  }

  /* --- Search Results Highlight --- */
  .search-highlight,
  mark {
    background: rgba(210, 153, 34, 0.3) !important;
    color: #e6edf3 !important;
  }
}

/* =====================================================
   MOBILE RESPONSIVENESS FIXES
   ===================================================== */

/* --- 768px: Tablet & small laptop fixes --- */
@media (max-width: 768px) {
  /* Touch target minimum: 44px for all interactive elements */
  .btn-small {
    min-height: 36px;
    min-width: 36px;
    padding: 6px 12px;
    font-size: 13.5px;
  }

  .btn-icon {
    min-width: 40px;
    min-height: 40px;
  }

  .modal-close {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .help-button {
    width: 40px;
    height: 40px;
  }

  .color-option {
    width: 36px;
    height: 36px;
  }

  .folder-item__create-btn {
    width: 36px;
    height: 36px;
    padding: 6px;
  }

  .folder-item__create-btn .lucide-icon {
    width: 16px;
    height: 16px;
  }

  /* Minutes content tables: horizontal scroll */
  .minutes-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .minutes-content table {
    min-width: 500px;
  }

  /* Global AI response table fix */
  .global-ai-response table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .global-ai-response table th,
  .global-ai-response table td {
    white-space: normal;
    word-break: break-word;
    font-size: 13.5px;
    padding: 8px;
  }

  /* Task progress table: overflow wrapper */
  .task-progress-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .task-progress-table th,
  .task-progress-table td {
    padding: 8px;
    font-size: 13.5px;
    white-space: nowrap;
  }

  /* Bulk action bar: wrap on mobile */
  .bulk-action-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
  }

  .bulk-action-bar .btn-small {
    flex: 1 1 auto;
    min-width: 100px;
    text-align: center;
    justify-content: center;
  }

  /* Vocabulary add form: stack vertically */
  .vocab-add-form {
    flex-direction: column;
    gap: 8px;
  }

  .vocab-add-form input,
  .vocab-add-form select {
    width: 100%;
  }

  .vocab-add-form .btn {
    width: 100%;
  }

  /* Vocabulary phrase items: better touch targets */
  .vocab-phrase-delete {
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Editor toolbar: compact on tablet */
  .editor-toolbar {
    gap: 4px;
    padding: 6px 8px;
  }

  .editor-toolbar-left,
  .editor-toolbar-center,
  .editor-toolbar-right {
    gap: 2px;
  }
}

/* --- 480px: Small phone fixes --- */
@media (max-width: 480px) {
  /* Auth section pseudo-elements: hide decorative circles */
  .auth-section::before,
  .auth-section::after {
    display: none;
  }

  /* Download progress modal: fit screen */
  .download-progress-modal {
    min-width: auto;
    width: calc(100vw - 24px);
    max-width: 100%;
  }

  /* Touch targets: full 44px minimum */
  .btn-small {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 14px;
    font-size: 13.5px;
  }

  .btn-icon {
    min-width: 44px;
    min-height: 44px;
  }

  .modal-close {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .help-button {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .vocab-phrase-delete {
    min-width: 44px;
    min-height: 44px;
  }

  .color-option {
    width: 40px;
    height: 40px;
  }

  .icon-option {
    width: 44px;
    height: 44px;
  }

  /* Bulk action bar: full-width stacked */
  .bulk-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px;
  }

  .bulk-action-bar .btn-small {
    min-width: auto;
    width: 100%;
  }

  /* Data table cells: tighter padding */
  .data-table th,
  .data-table td {
    padding: 8px 6px;
    font-size: 13.5px;
  }

  /* Modal footer buttons: stack vertically */
  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  /* Editor toolbar: compact phone layout */
  .editor-toolbar {
    padding: 4px 6px;
    gap: 2px;
  }

  .editor-toolbar .btn-icon {
    min-width: 36px;
    min-height: 36px;
  }

  /* Search and filter bars: stack */
  .search-bar,
  .filter-bar {
    flex-direction: column;
    gap: 8px;
  }

  .search-bar input,
  .filter-bar select {
    width: 100%;
  }

  /* Vocab phrase item: wrap content */
  .vocab-phrase-item {
    flex-wrap: wrap;
    gap: 6px;
  }

  .vocab-phrase-item .vocab-status {
    font-size: 13.5px;
  }

  /* Task progress table on small phones */
  .task-progress-table th,
  .task-progress-table td {
    padding: 6px 4px;
    font-size: 13.5px;
  }

  /* Minutes content tables */
  .minutes-content table {
    font-size: 13.5px;
  }

  .minutes-content table th,
  .minutes-content table td {
    padding: 6px 8px;
  }
}

/* =====================================================
   MOBILE CARD LAYOUT: 会議室テーブル → カード表示
   ===================================================== */
@media (max-width: 768px) {
  /* テーブル横スクロールを解除 */
  .table-wrapper {
    overflow-x: visible !important;
  }

  .table-wrapper table,
  .rooms-table {
    min-width: 0 !important;
    display: block;
  }

  /* フィルタ行: 維持してフル幅に */
  .rooms-table thead {
    display: block;
  }

  .rooms-table thead tr:first-child {
    display: block;
  }

  .rooms-table thead tr:first-child th {
    display: block;
    width: 100% !important;
    padding: 8px;
  }

  .filter-container {
    flex-direction: column;
    gap: 8px;
  }

  .filter-container .search-input-wrapper {
    width: 100%;
  }

  .filter-container .btn-search,
  .filter-container .btn-filter {
    width: 100%;
    justify-content: center;
  }

  /* ヘッダー行を非表示 */
  .rooms-table thead tr:nth-child(2) {
    display: none;
  }

  /* tbody → ブロック */
  .rooms-table tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
  }

  /* 各行 → カード */
  .rooms-table tbody tr {
    display: grid !important;
    grid-template-columns: 24px 1fr auto;
    grid-template-rows: auto;
    gap: 0;
    align-items: center;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.2s;
    position: relative;
  }

  .rooms-table tbody tr:hover {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  }

  .rooms-table tbody tr.row-expired {
    opacity: 0.55;
    border-color: var(--border-color);
  }

  /* すべてのtdのデフォルトスタイルをリセット */
  .rooms-table tbody td {
    display: none;
    border-bottom: none;
    padding: 0;
    overflow: visible;
    white-space: normal;
    text-overflow: unset;
  }

  /* チェックボックス: 非表示 */
  .rooms-table tbody .td-checkbox {
    display: none;
  }

  /* ステータス: カード左アイコン */
  .rooms-table tbody .td-status {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 1;
    grid-row: 1;
    padding-right: 8px;
    width: 24px;
    flex-shrink: 0;
  }

  .rooms-table tbody .td-status .status,
  .rooms-table tbody .td-status .room-status-badge {
    font-size: 0;
    padding: 0;
    background: none !important;
  }

  .rooms-table tbody .td-status .status .lucide-icon,
  .rooms-table tbody .td-status .room-status-badge .lucide-icon {
    width: 16px;
    height: 16px;
  }

  .rooms-table tbody .td-status .room-status-badge__label {
    display: none;
  }

  /* 会議名: メインコンテンツ */
  .rooms-table tbody .td-meeting-title {
    display: block;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
  }

  .rooms-table tbody .td-meeting-title .meeting-title-container {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .rooms-table tbody .td-meeting-title .meeting-title-text {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
  }

  .rooms-table tbody .td-meeting-title .meeting-title-edit-btn {
    display: none;
  }

  .rooms-table tbody .td-meeting-title .btn-detail {
    display: none;
  }

  /* 操作ボタン: カード右側 */
  .rooms-table tbody .td-actions {
    display: flex !important;
    grid-column: 3;
    grid-row: 1;
    align-items: center;
    white-space: normal !important;
    width: auto !important;
    padding: 0 0 0 4px !important;
    flex-shrink: 0;
  }

  .rooms-table tbody .td-actions > div {
    gap: 0 !important;
  }

  .rooms-table tbody .td-actions .btn-ghost {
    padding: 6px !important;
  }

  .rooms-table tbody .td-actions .btn-ghost .lucide-icon {
    width: 18px !important;
    height: 18px !important;
  }

  /* スマホのカード表示ではアイコンのみにして省スペース化する */
  .rooms-table tbody .td-actions .room-action-btn span {
    display: none;
  }

  /* スマホ: 削除ボタン非表示（ハンバーガーメニューから操作可能） */
  .rooms-table tbody .td-actions .room-more-menu {
    display: none;
  }

  /* 非表示カラム: 開始予定、メモ、フォルダ、作成者 */
  .rooms-table tbody .td-scheduled-start,
  .rooms-table tbody .td-folder,
  .rooms-table tbody .td-creator,
  .rooms-table tbody .td-memo {
    display: none !important;
  }

  /* 旧スタイル互換: inline style で操作セル指定されている場合 */
  .rooms-table tbody td[style*="width: 140px"] {
    display: flex !important;
    grid-column: 3;
    grid-row: 1;
    align-items: center;
    white-space: normal !important;
    width: auto !important;
    padding: 0 0 0 4px !important;
    flex-shrink: 0;
  }

  .rooms-table tbody td[style*="width: 140px"] > div {
    gap: 0 !important;
  }

  .rooms-table tbody td[style*="width: 140px"] .btn-ghost {
    padding: 6px !important;
  }

  .rooms-table tbody td[style*="width: 140px"] .btn-ghost .lucide-icon {
    width: 18px !important;
    height: 18px !important;
  }

  .rooms-table tbody td[style*="width: 140px"] .room-more-menu {
    display: none;
  }

  .rooms-table tbody td[style*="min-width: 150px"],
  .rooms-table tbody td[style*="min-width: 200px"] {
    display: none !important;
  }

  /* === 議事録モーダル: スマホ全画面表示 === */
  #minutesDisplayModal .modal-content,
  #minutesDisplayModal .modal-fullscreen {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  /* 議事録ヘッダー: コンパクト化 */
  #minutesDisplayModal .modal-header {
    padding: 8px 12px;
  }

  #minutesDisplayModal .modal-header-row {
    flex-wrap: wrap;
    gap: 4px;
  }

  #minutesDisplayModal .modal-header-left {
    gap: 8px;
  }

  #minutesDisplayModal .modal-title--inline {
    font-size: 13.5px;
  }

  #minutesDisplayModal .modal-header-right {
    gap: 6px;
  }

  /* タブ切替: コンパクト */
  #minutesDisplayModal .minutes-tab-container {
    padding: 2px;
  }

  #minutesDisplayModal .minutes-tab {
    padding: 4px 10px;
    font-size: 13.5px;
  }

  /* 最大化ボタン非表示（既に全画面） */
  #minutesDisplayModal #viewMaximizeBtn {
    display: none;
  }

  /* 議事録コンテンツエリア */
  #minutesDisplayModal .minutes-content-area {
    padding: 12px;
    font-size: 13.5px;
    line-height: 1.7;
  }

  /* 本文レイアウト: 縦積み */
  #minutesDisplayModal .modal-body--flex .u-flex-1.u-flex {
    flex-direction: column !important;
  }

  /* AIチャットパネル: 下半分表示（absoluteを解除） */
  #minutesDisplayModal .ai-chat-panel {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 50vh;
    max-height: 50vh;
    border-radius: 0;
    border-left: none;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
  }

  #minutesDisplayModal .ai-chat-panel .panel-resizer {
    display: none;
  }

  /* フッター: スマホ用に簡略化 */
  #minutesDisplayModal .modal-footer-actions {
    padding: 8px 12px;
    gap: 8px;
    justify-content: center;
  }

  /* 編集・ダウンロード・タスク抽出ボタンを非表示 */
  #minutesDisplayModal .modal-footer-actions .btn-secondary {
    display: none;
  }

  /* 閉じるボタンのみ表示 */
  #minutesDisplayModal .modal-footer-actions .btn-primary {
    flex: 1;
    justify-content: center;
  }

  /* フィルタ: 高度な検索ボタンを非表示 */
  .filter-container .btn-search:nth-child(3) {
    display: none;
  }

  /* ドラッグ無効化 */
  .rooms-table tbody tr[draggable="true"] {
    cursor: default;
  }

  /* カード選択時のハイライト */
  .rooms-table tbody tr.row-selected {
    border-color: var(--accent-main);
    background: var(--accent-soft);
  }

  /* 一括操作バー: モバイルでは画面下部に固定表示する
     （デスクトップ用のtop/transform指定を打ち消すため明示的にリセットする） */
  .bulk-action-bar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 0;
    z-index: 100;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px;
    gap: 6px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
  }

  /* ===== スマホ専用: シンプルUI ===== */

  /* ハンバーガーメニューを表示（モバイルでも使用、ログイン後のみ） */
  body.admin-logged-in .hamburger-menu {
    display: block !important;
  }

  /* 検索・フィルター行を非表示 */
  .rooms-table thead tr:first-child {
    display: none !important;
  }

  .filter-container {
    display: none !important;
  }

  /* 横スクロール防止 */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  #roomList {
    overflow-x: hidden !important;
  }

  .room-table-scroll-inner {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  /* カードレイアウト: 会議名の下にボタンを配置 */
  .rooms-table tbody tr {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 8px !important;
  }

  /* チェックボックス列を非表示 */
  .rooms-table tbody .td-checkbox {
    display: none !important;
  }

  /* ステータスアイコンを非表示 */
  .rooms-table tbody .td-status {
    display: none !important;
  }

  /* 会議名: フル幅、2行まで表示 */
  .rooms-table tbody .td-meeting-title {
    grid-column: 1 !important;
    grid-row: 1 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .rooms-table tbody .td-meeting-title .meeting-title-text {
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    max-width: 100% !important;
  }

  /* 操作ボタン: 会議名の下に横並び */
  .rooms-table tbody .td-actions,
  .rooms-table tbody td[style*="width: 140px"] {
    display: flex !important;
    grid-column: 1 !important;
    grid-row: 2 !important;
    justify-content: flex-start !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .rooms-table tbody .td-actions > div,
  .rooms-table tbody td[style*="width: 140px"] > div {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
  }

  /* 閲覧ボタン・マイクボタンのみ表示、ラベル付き（ラベルはJS側のspanで併記済みのためテキストはそのまま表示する） */
  .rooms-table tbody .td-actions .room-action-btn--minutes,
  .rooms-table tbody .td-actions .room-action-btn--recording,
  .rooms-table tbody td[style*="width: 140px"] .btn-ghost:nth-child(1),
  .rooms-table tbody td[style*="width: 140px"] .btn-ghost:nth-child(2) {
    display: inline-flex !important;
    align-items: center;
    flex-direction: row;
    gap: 4px;
    padding: 8px 12px !important;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    min-height: 40px;
    flex: 1;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--surface-subtle);
    white-space: nowrap;
  }

  .rooms-table tbody .td-actions .room-action-btn--minutes {
    color: #fff !important;
    border-color: #2563eb !important;
    background: #2563eb !important;
  }

  .rooms-table tbody .td-actions .room-action-btn--recording {
    color: #fff !important;
    border-color: #1e40af !important;
    background: #1e40af !important;
  }

  /* 削除ボタン・その他メニューを非表示 */
  .rooms-table tbody .td-actions .btn-delete-room {
    display: none !important;
  }

  .rooms-table tbody .td-actions .room-more-menu {
    display: none !important;
  }

  /* 旧スタイル互換の削除ボタン非表示 */
  .rooms-table tbody td[style*="width: 140px"] .btn-ghost:nth-child(3) {
    display: none !important;
  }

  .rooms-table tbody td[style*="width: 140px"] .room-more-menu {
    display: none !important;
  }

  /* === 議事録閲覧モーダル: 全画面 + 最小機能 === */

  /* AIチャットパネルを非表示 */
  #minutesDisplayModal .ai-chat-panel {
    display: none !important;
  }

  /* AIチャットトグルボタンを非表示 */
  #minutesDisplayModal #aiChatToggleBtn {
    display: none !important;
  }

  /* タブ切り替え（通常版/詳細版）を非表示 */
  #minutesDisplayModal .minutes-tab-container {
    display: none !important;
  }

  /* フッター: 閉じるボタンのみ（編集・DL・タスク等非表示） */
  #minutesDisplayModal .modal-footer-actions .btn-secondary {
    display: none !important;
  }

  /* 議事録コンテンツ: フル幅表示 */
  #minutesDisplayModal .modal-body--flex .u-flex-1.u-flex {
    flex-direction: column !important;
  }

  #minutesDisplayModal .minutes-content-area {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* ===== カードレイアウト: 480px以下の追加調整 ===== */
@media (max-width: 480px) {
  .rooms-table tbody {
    padding: 4px;
    gap: 6px;
  }

  .rooms-table tbody tr {
    padding: 10px;
    border-radius: 8px;
  }

  .rooms-table tbody .td-meeting-title .meeting-title-text {
    font-size: 13.5px;
  }

  .rooms-table tbody .td-status .status .lucide-icon {
    width: 14px;
    height: 14px;
  }

  .rooms-table tbody .td-status {
    width: 20px;
    padding-right: 6px;
  }

  .rooms-table tbody .td-actions .btn-ghost,
  .rooms-table tbody td[style*="width: 140px"] .btn-ghost {
    padding: 4px !important;
  }

  .rooms-table tbody .td-actions .btn-ghost .lucide-icon,
  .rooms-table tbody td[style*="width: 140px"] .btn-ghost .lucide-icon {
    width: 16px !important;
    height: 16px !important;
  }

  /* フィルタセクション */
  .filter-row-cell {
    padding: 4px !important;
  }

  .search-input {
    font-size: 13.5px !important;
    padding: 8px 8px 8px 32px !important;
  }

  .btn-search {
    padding: 8px 12px;
    font-size: 13.5px;
  }

  /* 検索ボタン1つのみ表示 */
  .filter-container .btn-search:nth-child(3) {
    display: none;
  }

  /* 議事録モーダル: さらにコンパクト */
  #minutesDisplayModal .modal-header {
    padding: 6px 10px;
  }

  #minutesDisplayModal .minutes-content-area {
    padding: 10px;
    font-size: 13.5px;
  }

  #minutesDisplayModal .ai-chat-panel {
    height: 45vh;
    max-height: 45vh;
  }

  #minutesDisplayModal .ai-chat-input {
    font-size: 13.5px;
  }
}

/* --- 360px: Ultra-narrow phone fixes --- */
@media (max-width: 360px) {
  .app-header__inner {
    padding: 0 52px 0 8px;
  }

  .site-main__inner {
    padding: 8px;
  }

  .modal-content {
    padding: 0;
  }

  .data-panel {
    padding: 10px;
  }

  .data-panel__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .data-panel__title {
    font-size: 13.5px;
  }

  .hamburger-dropdown {
    right: 2px;
    min-width: 180px;
    max-width: calc(100vw - 16px);
  }

  /* Extra compact table for very small screens */
  .data-table th,
  .data-table td {
    padding: 6px 4px;
    font-size: 13.5px;
  }

  .btn-small {
    padding: 6px 10px;
    font-size: 13.5px;
    min-height: 40px;
  }

  /* Stack action buttons in table rows */
  .data-table .action-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  /* Minutes heading sizes */
  .minutes-content h1 { font-size: 16px; }
  .minutes-content h2 { font-size: 13.5px; }
  .minutes-content h3 { font-size: 13.5px; }

  /* Folder sidebar: full width on ultra narrow */
  .folder-sidebar {
    width: 100% !important;
    max-width: 100vw;
  }
}

/* === SSO Login === */
.sso-login-section {
  margin-top: 8px;
}

.sso-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  color: var(--text-muted, #999);
  font-size: 13.5px;
}

.sso-divider::before,
.sso-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-main, #e0e0e0);
}

.sso-divider span {
  padding: 0 12px;
}

.btn-sso {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--surface-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.btn-sso:hover {
  background: var(--surface-subtle);
  border-color: #c4cad4;
}

.sso-microsoft-icon {
  flex-shrink: 0;
}

/* === グループ管理 === */
.group-management-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.create-group-form {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 8px;
}

.create-group-form .form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.create-group-form .input-field {
  flex: 1;
}

.group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.group-item {
  padding: 12px;
  border: 1px solid var(--border-main, #e0e0e0);
  border-radius: 8px;
  background: var(--bg-primary, #fff);
}

.group-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.group-item-name {
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-item-actions {
  display: flex;
  gap: 4px;
}

.group-item-members {
  font-size: 13.5px;
  color: var(--text-muted, #999);
}

.group-acl-resources {
  margin-top: 8px;
}

.group-acl-resources-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  color: var(--primary, #2563eb);
  cursor: pointer;
  user-select: none;
}

.group-acl-resources-toggle:hover {
  text-decoration: underline;
}

.group-acl-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}

.group-acl-resources-list {
  margin-top: 6px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-acl-resource-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-primary, #333);
  padding: 3px 0;
}

.group-acl-resource-type {
  color: var(--text-muted, #999);
  min-width: 40px;
}

.group-acl-resource-name {
  font-weight: 500;
  margin-right: 4px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
}

.badge-info {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-secondary {
  background: #f1f5f9;
  color: #475569;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

/* === アクセス制御 === */
/* === ACL Tabs === */
.acl-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 10px;
  padding: 4px;
}

.acl-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted, #999);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.acl-tab .lucide-icon {
  width: 16px;
  height: 16px;
}

.acl-tab:hover {
  color: var(--text-primary, #333);
  background: var(--accent-soft);
}

.acl-tab.active {
  color: var(--accent-main, #3b82f6);
  background: var(--bg-primary, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 600;
}

/* ACL content area */
.acl-content {
  min-height: 200px;
}

.acl-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-muted, #999);
  font-size: 13.5px;
}

.acl-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-main, #e0e0e0);
  border-top-color: var(--accent-main, #3b82f6);
  border-radius: 50%;
  animation: acl-spin 0.7s linear infinite;
}

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

.acl-empty-state {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted, #999);
}

.acl-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.acl-empty-icon .lucide-icon {
  width: 24px;
  height: 24px;
}

.acl-empty-state p {
  font-size: 13.5px;
  margin: 0;
}

/* ACL resource cards */
.acl-resource-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acl-resource-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-main, #e0e0e0);
  border-radius: 10px;
  transition: all 0.15s ease;
}

.acl-resource-card:hover {
  border-color: var(--accent-main, #3b82f6);
  box-shadow: 0 2px 8px var(--accent-soft);
}

.acl-resource-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-muted, #888);
}

.acl-resource-icon .lucide-icon {
  width: 18px;
  height: 18px;
}

.acl-resource-info {
  flex: 1;
  min-width: 0;
}

.acl-resource-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acl-resource-meta {
  font-size: 13.5px;
  color: var(--text-muted, #999);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.acl-resource-grants {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
}

.acl-grant-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}

.acl-grant-badge--user {
  background: var(--accent-soft);
  color: var(--accent-main);
}

.acl-grant-badge--group {
  background: var(--accent-soft);
  color: var(--dt-accent-primary, var(--accent-main));
}

.acl-grant-badge--open {
  background: rgba(16,185,129,0.12);
  color: var(--dt-color-success-500, var(--success, #059669));
}

.acl-resource-action {
  flex-shrink: 0;
}

/* === Access Edit Modal === */
.acl-edit-resource {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary, #333);
}

.acl-edit-resource .lucide-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-main, #3b82f6);
}

.acl-edit-section {
  margin-bottom: 20px;
}

.acl-edit-section-header {
  margin-bottom: 10px;
}

.acl-edit-section-header h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted, #666);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.acl-edit-section-header h3 .lucide-icon {
  width: 15px;
  height: 15px;
}

/* Grants list */
.acl-grants-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border-main, #e0e0e0);
  border-radius: 10px;
}

.acl-grants-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  color: var(--text-muted, #999);
  font-size: 13.5px;
}

.acl-grants-empty .lucide-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.acl-grant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-main, #e0e0e0);
  transition: background 0.15s;
}

.acl-grant-row:last-child {
  border-bottom: none;
}

.acl-grant-row:hover {
  background: var(--bg-secondary, #f8f9fa);
}

.acl-grant-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.acl-grant-avatar--user {
  background: var(--accent-soft);
  color: var(--accent-main);
}

.acl-grant-avatar--group {
  background: var(--accent-soft);
  color: var(--dt-accent-primary, var(--accent-main));
}

.acl-grant-avatar .lucide-icon {
  width: 16px;
  height: 16px;
}

.acl-grant-info {
  flex: 1;
  min-width: 0;
}

.acl-grant-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary, #333);
  display: flex;
  align-items: center;
  gap: 6px;
}

.acl-grant-dept {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-muted, #888);
  background: var(--bg-secondary, #f3f4f6);
  padding: 1px 6px;
  border-radius: 4px;
}

.acl-grant-perms {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.acl-perm-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 500;
}

.acl-perm-tag--read {
  background: rgba(16,185,129,0.14);
  color: var(--dt-color-success-500, var(--success));
}

.acl-perm-tag--write {
  background: rgba(245,158,11,0.14);
  color: var(--dt-color-warning-500, var(--warning));
}

.acl-perm-tag--admin {
  background: rgba(239,68,68,0.14);
  color: var(--dt-color-danger-500, var(--danger));
}

.acl-grant-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted, #999);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.acl-grant-remove:hover {
  background: rgba(239,68,68,0.12);
  color: var(--dt-color-danger-500, var(--danger));
}

.acl-grant-remove .lucide-icon {
  width: 15px;
  height: 15px;
}

/* Add grant form */
.acl-add-form {
  padding: 14px 16px;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 10px;
  border: 1px dashed var(--border-main, #e0e0e0);
}

.acl-add-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.acl-add-row:last-child {
  margin-bottom: 0;
}

.acl-add-field {
  flex-shrink: 0;
}

.acl-add-field--grow {
  flex: 1;
  min-width: 0;
}

.acl-add-form .form-group {
  margin-bottom: 0;
}

.acl-add-form label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted, #666);
  margin-bottom: 4px;
  display: block;
}

.acl-add-action {
  flex-shrink: 0;
  padding-bottom: 1px;
}

/* フォルダオプション（配下適用・自動継承） */
.acl-folder-options {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border-main, #e0e0e0);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acl-option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--text-primary, #333);
  white-space: nowrap;
}

.acl-option-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary, #2563eb);
  flex-shrink: 0;
}

/* Permission chip toggles */
.acl-permissions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.acl-perm-label {
  cursor: pointer;
  display: inline-flex;
}

.acl-perm-label input[type="checkbox"] {
  display: none;
}

.acl-perm-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1.5px solid var(--border-main, #e0e0e0);
  background: var(--bg-primary, #fff);
  color: var(--text-muted, #999);
  transition: all 0.15s;
  user-select: none;
}

.acl-perm-chip .lucide-icon {
  width: 14px;
  height: 14px;
}

.acl-perm-label input[type="checkbox"]:checked + .acl-perm-chip--read {
  background: rgba(16,185,129,0.12);
  border-color: var(--dt-color-success-500, var(--success));
  color: var(--dt-color-success-500, var(--success));
}

.acl-perm-label input[type="checkbox"]:checked + .acl-perm-chip--write {
  background: rgba(245,158,11,0.12);
  border-color: var(--dt-color-warning-500, var(--warning));
  color: var(--dt-color-warning-500, var(--warning));
}

.acl-perm-label input[type="checkbox"]:checked + .acl-perm-chip--admin {
  background: rgba(239,68,68,0.12);
  border-color: var(--dt-color-danger-500, var(--danger));
  color: var(--dt-color-danger-500, var(--danger));
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-main, #e0e0e0);
}

.loading-text {
  text-align: center;
  padding: 20px;
  color: var(--text-muted, #999);
}

/* =============== チュートリアル =============== */

.btn-tutorial {
  background: var(--surface-bg) !important;
  color: var(--accent-main) !important;
  border: 1px solid var(--accent-main) !important;
  transition: all 0.15s ease;
}
.btn-tutorial:hover {
  background: var(--accent-soft) !important;
}

.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90000;
  animation: tutorialFadeIn 0.2s ease;
}

.tutorial-spotlight {
  position: absolute;
  z-index: 90001;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  background: transparent;
  pointer-events: none;
  transition: all 0.3s ease;
  animation: tutorialPulse 2s ease-in-out infinite;
}

.tutorial-popover {
  position: absolute;
  z-index: 90002;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px 24px 16px;
  max-width: 360px;
  min-width: 280px;
  animation: tutorialPopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tutorial-popover__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}

.tutorial-popover__close:hover {
  background: #f0f0f0;
  color: #333;
}

.tutorial-popover__step {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.tutorial-popover__title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 8px;
  line-height: 1.3;
}

.tutorial-popover__desc {
  font-size: 13.5px;
  color: #555;
  line-height: 1.65;
  margin-bottom: 16px;
  white-space: pre-line;
}

.tutorial-popover__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.tutorial-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  padding: 6px 14px;
}

.tutorial-btn .lucide-icon {
  width: 14px;
  height: 14px;
}

@keyframes tutorialFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tutorialPopIn {
  from { opacity: 0; transform: scale(0.9) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes tutorialPulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(59, 130, 246, 0.3); }
  50% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(59, 130, 246, 0.15); }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  .tutorial-overlay {
    background: rgba(0, 0, 0, 0.6);
  }
  .tutorial-spotlight {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
  }
  .tutorial-popover {
    background: #1c2128;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
  .tutorial-popover__close:hover {
    background: #30363d;
    color: #e6edf3;
  }
  .tutorial-popover__step {
    color: var(--accent-main);
  }
  .tutorial-popover__title {
    color: #e6edf3;
  }
  .tutorial-popover__desc {
    color: #8b949e;
  }
  .tutorial-popover__actions {
    border-top-color: #30363d;
  }
  @keyframes tutorialPulse {
    0%, 100% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(88, 166, 255, 0.3); }
    50% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 0 6px rgba(88, 166, 255, 0.15); }
  }
}

/* ========== アジェンダ管理コンソール用エディタ ========== */
.agenda-admin-toolbar {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

.agenda-admin-toolbar button {
  min-width: 30px;
  min-height: 28px;
  padding: 0 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1;
  color: #374151;
  transition: background 120ms;
}

.agenda-admin-toolbar button:hover {
  background: #e5e7eb;
}

.agenda-admin-editor {
  border-radius: 0 0 6px 6px !important;
  outline: none;
  line-height: 1.6;
  font-size: 13.5px;
  padding: 8px 10px;
  word-wrap: break-word;
  min-height: 360px;
}

.agenda-admin-editor:focus {
  border-color: var(--accent-main) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-main) 15%, transparent);
}

.agenda-admin-editor[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

.agenda-admin-editor ul,
.agenda-admin-editor ol {
  padding-left: 20px;
  margin: 4px 0;
}

.agenda-admin-editor ul {
  list-style: disc;
}

.agenda-admin-editor ol {
  list-style: decimal;
}
