/* connect.css - Custom UI components for Social Connect integration */

/* 1. Common UI Utilities (Extending Bootstrap/Mobirise) */

.w240 {
  width: 240px !important;
}


.no-cursor {
  cursor: default;
}

/* 2. Avatars & Thumbnails (30px Standard) */
.page-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
  border: 1px solid #eee;
  flex-shrink: 0;
}

.card-header {
  background-color: #e5e5e5;
}

#expPageInfo .post-thumb,
#expPostInfo .post-thumb,
.ts-dropdown .option .post-thumb,
.ts-control .item .post-thumb,
#commentsBody .post-thumb {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  margin-right: 12px;
  object-fit: cover;
  border: 1px solid #eee;
  flex-shrink: 0;
}

/* 3. Post Preview Gallery (Custom Layout) */
.post-preview-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  float: left;
  margin-right: 12px;
  max-width: 200px;
}

.post-preview-gallery img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
  transition: opacity 0.2s;
}

@media (max-width: 575.98px) {
  .post-preview-gallery {
    max-width: 130px !important;
    margin-right: 8px !important;
  }

  .progress-placeholder {
    height: 0px !important;
    ;
  }
}

/* 4. Progress Bars (Custom Logic/Layout) */
.progress-placeholder {
  height: 18px;
  display: block;
}

.progress-container {
  margin-left: 93px;
  height: 18px;
  display: flex !important;
  align-items: center;
  visibility: hidden;
  margin-top: 0;
  margin-bottom: 0;
}

.progress-container.active {
  visibility: visible;
}

.progress-container .progress {
  flex: 1;
  height: 6px;
  background-color: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
}

.progress-container .progress-bar {
  background-color: var(--sp88blue);
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* 停用動畫類別：用於重置進度條時防止產生縮回效果 */
.notransition {
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

.progress-container .progress-text {
  min-width: 50px;
  font-size: 9px !important;
  margin-left: 8px;
  text-align: center;
  color: #7b8794;
  white-space: nowrap;
}

/* Page Auth Warning Position */
#pageAuthWarningWrapper.page-auth-warning-wrapper {
  margin-left: 93px !important;
  margin-top: 4px;
}

@media (max-width: 767.98px) {
  .progress-container {
    margin-left: 0;
    width: 100%;
  }

  .progress-container .progress-text {
    min-width: auto;
    width: auto;
  }

  #pageAuthWarningWrapper.page-auth-warning-wrapper {
    margin-left: 0 !important;
  }
}

/* 5. FB/IG Selection UI (Tom Select & Manual Controls) */
.select-row .select-control {
  height: 38px;
  font-size: 0.9rem;
  border-radius: 0.25rem 0 0 0.25rem;
  border-right: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none !important;
  /* 隱藏原生箭頭 */
  padding-right: 30px !important;
}

.select-row .btn-refresh {
  height: 38px;
  width: 42px;
  padding: 0 !important;
  border-radius: 0 0.25rem 0.25rem 0;
  border-left: 0;
  font-size: 0.9rem;
}

/* Tom Select Overrides */
.ts-control {
  min-height: 38px !important;
  height: 38px !important;
  padding: 0px 10px !important;
  display: flex !important;
  align-items: center !important;
  font-size: 0.9rem !important;
  border-color: #dee2e6 !important;
  border-radius: 0.25rem 0 0 0.25rem !important;
}

/* .ts-wrapper.dropdown-active .ts-control>input {
  position: absolute !important;
  left: -9999px !important;
} */

.ts-wrapper.single .ts-control {
  background-image: none !important;
}

#loadedPostsCount,
#loadMorePostsBtn {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  line-height: 1.2;
}

.note-align {
  min-height: 20px;
}

.post-loading-status {
  position: relative;
  height: 20px;
  min-width: 0;
}

.post-loading-status .progress-container,
.post-loading-status .note-align {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0 !important;
}

#loadMorePostsBtn {
  white-space: nowrap;
}

/* Setup card: stable two-column form layout for translated labels. */
#setupSection {
  --setup-label-width: 12.5rem;
  --setup-label-gap: 0.75rem;
}

@media (min-width: 768px) {
  #setupSection .select-row-container,
  #setupSection .select-progress-col,
  #setupSection #postSelectionRow {
    display: grid !important;
    grid-template-columns: var(--setup-label-width) minmax(0, 1fr);
    column-gap: var(--setup-label-gap);
    align-items: center;
  }

  #setupSection .select-progress-col>.select-row-container,
  #setupSection #postSelectionRow>.select-row {
    display: contents !important;
  }

  #setupSection .select-row-container>.filter-label,
  #setupSection .select-progress-col>.select-row-container>.filter-label,
  #setupSection #postSelectionRow>.select-row>.filter-label {
    grid-column: 1;
    margin-right: 0 !important;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #setupSection .select-row-container>.filter-label+div,
  #setupSection .select-progress-col>.select-row-container>.filter-label+div,
  #setupSection #postSelectionRow>.select-row>.filter-label+div {
    grid-column: 2;
    min-width: 0;
    width: 100%;
  }

  #setupSection #pageAuthWarningWrapper,
  #setupSection #pageLoadingProgress,
  #setupSection #postLoadingProgress,
  #setupSection .post-loading-status,
  #setupSection .note-align,
  #setupSection .progress-placeholder {
    grid-column: 2;
    margin-left: 0 !important;
  }

  #setupSection .progress-container .progress {
    margin-left: 0 !important;
  }

  #setupSection .note-section {
    margin-left: calc(var(--setup-label-width) + var(--setup-label-gap)) !important;
    padding-left: 0 !important;
  }
}

@media (max-width: 767.98px) {
  #setupSection .selection-col {
    margin-bottom: 0 !important;
  }

  #setupSection .select-row-container.flex-column,
  #setupSection #postSelectionRow>.select-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
    margin-bottom: 0 !important;
  }

  #setupSection .select-row-container.flex-column>.filter-label,
  #setupSection #postSelectionRow>.select-row>.filter-label {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.2 !important;
    margin-bottom: 0 !important;
    flex: 0 0 auto !important;
    display: block !important;
    font-weight: bold;
    color: #4a5568;
  }

  #setupSection .select-row-container.flex-column>.filter-label+div,
  #setupSection #postSelectionRow>.select-row>.filter-label+div {
    width: 100% !important;
    min-width: 0;
  }

  #setupSection .note-section {
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
}

/* 統一 TomSelect 箭頭為 FontAwesome Chevron */
.ts-wrapper.single .ts-control::after {
  content: "\f078" !important;
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  display: block;
  position: absolute;
  top: 50%;
  right: 12px !important;
  margin-top: 0 !important;
  transform: translateY(-50%);
  border: none !important;
  width: auto !important;
  height: auto !important;
  font-size: 10px;
  color: #6c757d;
  transition: transform 0.2s ease;
  line-height: 1;
}

.ts-wrapper.single.dropdown-active .ts-control::after {
  transform: translateY(-50%) rotate(180deg) !important;
}

.ts-control .item {
  display: flex !important;
  align-items: center !important;
  width: 100%;
}

.post-preview-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  font-size: 10px;
  /* Small text for No Image */
  line-height: 1;
  /* Restore placeholder styling */
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  display: flex !important;
  justify-content: center;
  align-items: center;
  color: #6c757d;
}


body>.ts-dropdown.form-control.select-control {
  z-index: 9999 !important;
  padding: 0 !important;
  border: 1px solid #dee2e6 !important;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .1) !important;
}

.ts-dropdown .option {
  padding: 8px 12px !important;
  display: flex !important;
  align-items: flex-start !important;
  cursor: pointer;
}

/* 1. 選中/滑過項目的背景：用淺灰代替藍色 */
.ts-dropdown .option.active,
.ts-dropdown .option:hover {
  background-color: #f2f2f2 !important;
  color: #333 !important;
}

/* 1. 已選中的選項 (selected)：用稍深一點的灰 (#e9ecef) */
.ts-dropdown .option.selected {
  background-color: #e9ecef !important;
  color: #333 !important;
}

/* 2. Placeholder：包含控制項 input 與下拉選單搜尋框 input */
.ts-control input::placeholder,
.ts-dropdown .ts-dropdown-input::placeholder {
  color: #495057 !important;
  opacity: 1 !important;
}

/* 3. 停用狀態 (Disabled)：淺灰底 (#f5f5f5) + 灰字 (#999) */
.select-control:disabled,
.ts-wrapper.disabled .ts-control {
  background-color: #f5f5f5 !important;
  color: #999 !important;
  border-color: #dee2e6 !important;
  opacity: 1 !important;
  cursor: not-allowed;
}

.ts-wrapper.disabled .ts-control .item,
.ts-wrapper.disabled .ts-control input::placeholder {
  color: #999 !important;
}



/* 移除最後一個選項的底部邊框，避免誤會還有更多內容 */
.ts-dropdown .option:last-child {
  border-bottom: none !important;
}

.ts-dropdown-content {
  max-height: 350px !important;
  /* 增加顯示高度，約可顯示 8-10 筆 */
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding-bottom: 0px !important;
  /* 為底部陰影預留空間，避免被 overflow 裁切 */
}

/* 針對 SweetAlert 內嵌時的 Tom Select 下拉選單特殊處理 */
.swal2-container .ts-dropdown,
body>.ts-dropdown.form-control.select-control {
  z-index: 99999 !important;
  /* 確保在 SweetAlert 之上 */
}

/* 手機版：確保下拉選單可以正常捲動 */
@media (max-width: 767.98px) {
  .ts-dropdown-content {
    max-height: 300px !important;
    /* 手機版降低高度，避免超出螢幕 */
  }

  /* SweetAlert 內的下拉選單 */
  .swal2-container .ts-dropdown-content {
    max-height: 40vh !important;
    /* 使用視窗高度的 40% */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 8px !important;
    /* 為底部陰影預留空間 */
  }

}

/* Flatpickr Overrides */
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
  background: var(--sp88blue) !important;
  border-color: var(--sp88blue) !important;
}

/* 6. Filtering & Comments List Styles */
.filter-panel {
  /*  font-size: 0.9rem; */
}

.filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.filter-block {
  display: flex;
  align-items: flex-start;
  /* 改為頂部對齊 */
  flex: 0 1 auto;
  /* 預設自動調整寬度 */
  min-width: 0;
  width: 100%;
  margin-bottom: 0.8rem;
  /* 減少組間距離,讓篩選區更緊湊 */
}

/* 強制佔據整行的區塊 */
.filter-block.full-row {
  flex: 0 0 100%;
  /* 強制單欄 */
}


.filter-label {
  flex: 0 0 85px;
  font-weight: 400;
  font-size: 1rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  height: 31px;
  /* 與 form-control-sm (31px) 完全同步 */
}

.filter-content {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  /* 讓每一排的所有元件中心對齊 */
  gap: 2px 16px;
  /* 減少垂直間距從 4px 改為 2px */
  min-width: 0;
}

/* Filter card: align translated labels and option areas to a shared vertical edge. */
#tableSection {
  --filter-label-width: 12rem;
  --filter-label-gap: 0.75rem;
}

@media (min-width: 768px) {
  #tableSection .filter-grid {
    display: block;
  }

  #tableSection .filter-block,
  #tableSection .filter-block.full-row {
    display: grid !important;
    grid-template-columns: var(--filter-label-width) minmax(0, 1fr);
    column-gap: var(--filter-label-gap);
    align-items: start;
    width: 100%;
    margin-bottom: 0.8rem;
  }

  #tableSection #filter_group_date {
    max-width: none !important;
  }

  #tableSection .filter-label {
    grid-column: 1;
    width: auto !important;
    flex: none !important;
    margin-right: 0 !important;
    min-width: 0;
    height: auto;
    min-height: 31px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #tableSection .filter-content {
    grid-column: 2;
    min-width: 0;
    width: 100%;
  }

  #tableSection #filter_group_date .filter-content>div {
    flex-wrap: nowrap !important;
    align-items: center !important;
  }

  #tableSection #filter_group_date input.flatpickr-input,
  #tableSection #filter_group_date input.form-control {
    width: 200px !important;
    flex: 0 0 200px;
  }

  #tableSection #filter_group_date .text-muted {
    flex: 0 0 auto;
    text-align: center;
  }
}

.filter-content>*,
.auth-actions>* {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* 使用者資訊容器 */
.user-info-wrapper {
  margin-right: 10px;
  /* 與按鈕的間距 */
}

/* 管理帳號的按鈕區塊 */
.auth-actions {
  display: none;
  align-items: center;
  gap: 0;
  /* 使用 ml-2 來控制間距 */
  flex: 0 0 auto;
  /* 不自動擴展 */
  padding-left: 44px;
  /* 大頭貼寬度(32px) + 右邊距(12px) = 44px */
  margin-left: -44px;
  /* 完全抵消 padding-left，讓同行時緊接在名稱後（只有 user-info-wrapper 的 10px margin 生效） */
}

.auth-actions.active {
  display: flex !important;
}

/* 針對卡片標題列中按鈕形式的 auth-actions 特別修正（移除原本設計在頭像旁的複寫間距） */
.card-header .auth-actions {
  padding-left: 0 !important;
  margin-left: 0 !important;
}

@media (max-width: 768px) {
  .auth-actions {
    margin-left: 0px;
  }
}


/* 勾選框與標籤對齊修正 */
.form-check {
  display: inline-flex !important;
  align-items: center !important;
  padding-left: 0 !important;
  margin-bottom: 0 !important;
  cursor: pointer;
  min-height: 31px;
}

.form-check-input {
  position: relative !important;
  margin-top: 0 !important;
  margin-left: 0 !important;
  margin-right: 0px !important;
  cursor: pointer;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.form-check-label {
  cursor: pointer;
  user-select: none;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
  white-space: nowrap;
}

.filter-content input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 31px;
}

/* 修復管理帳號的「退出」標籤位置 */
#btnLogout {
  padding: 4px 10px;
  display: inline-flex !important;
  align-items: center !important;
  /* vertical-align: middle; */
  cursor: pointer;
}

.note-align {
  margin-left: 93px;
}

/* 日期區間：桌機版時限制寬度 */
@media (min-width: 768px) {
  #filter_group_date {
    flex: 0 0 auto;
    max-width: 550px;
    /* 限制最大寬度，約可容納兩個時間選擇器 + 標籤 + 波浪號 */
  }
}


@media (max-width: 767.98px) {
  .note-align {
    margin-left: 0;
  }
}

@media (max-width: 576px) {
  .filter-block {
    flex-direction: column !important;
    align-items: flex-start !important;
    flex: 1 1 100% !important;
    gap: 4px;
    margin-top: 2px;
    margin-bottom: 2px;
    width: 100%;
  }

  .filter-label {
    width: 100%;
    min-height: auto !important;
    margin-bottom: 0px !important;
    flex: 0 0 auto !important;
  }
}

.reaction-img {
  width: 15px;
  height: 15px;
  vertical-align: middle;
}

/* 手機版:心情選項固定寬度,確保對齊 */
@media (max-width: 767.98px) {
  .reaction-item {
    flex: 0 0 calc(50% - 10px) !important;
    max-width: calc(50% - 10px) !important;
    margin-right: 0 !important;
  }
}

/* 桌機版:全不選需要左邊距 */
@media (min-width: 768px) {
  .react-deselect {
    margin-left: 0.25rem !important;
  }
}

.exclude-tag {
  display: inline-flex;
  align-items: center;
  background-color: #e9ecef;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-right: 6px;
  margin-bottom: 6px;
  border: 1px solid #dee2e6;
}

.exclude-tag .remove-tag,
.exclude-tag .remove-search-tag {
  margin-left: 6px;
  cursor: pointer;
  color: #dc3545;
  font-weight: bold;
}

/* Gmail-style Search Tags */
.search-input-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  background-color: #fff;
  min-height: 34px;
  flex: 1;
}

.search-input-container .exclude-tag {
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  padding: 1px 6px;
}

.search-tags-inline {
  display: contents;
}

.search-input-inline {
  border: none;
  outline: none;
  flex: 1;
  min-width: 120px;
  background: transparent;
}

/* List Row Appearance */
tr.row-hidden {
  background-color: #f2f2f2 !important;
  color: #999 !important;
}

tr.row-hidden .text-muted {
  color: #aaa !important;
}

tr.row-hidden img {
  opacity: 0.6;
}



/* comment table模式切換：隱藏特定欄位 */
#commentsTable.mode-comments .col-reactions {
  display: none !important;
}

#commentsTable.mode-reactions .col-status,
#commentsTable.mode-reactions .col-content,
#commentsTable.mode-reactions .col-image,
#commentsTable.mode-reactions .col-mentions,
#commentsTable.mode-reactions .col-date,
#commentsTable.mode-reactions .col-link {
  display: none !important;
}

/* Table Alignment */

#commentsTable th,
#commentsTable td {
  text-align: left;
  /* 預設靠左 */
  vertical-align: middle;
}

#commentsTable td {
  min-width: 80px;
}

#commentsTable td.col-content {
  padding: 0.75rem 0.75rem;
}

#commentsTable td.col-content .comment-content-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  white-space: normal;
  line-height: 1.5;
  max-height: calc(1.5em * 3);
  min-height: calc(1.5em * 3);
}

#commentsTable .text-center,
#commentsTable th.text-center {
  text-align: center !important;
}

#commentsTable .text-right,
#commentsTable th.text-right {
  text-align: right !important;
}

/* 特別指定置中的欄位（依據 header 定義） */
#commentsTable td:nth-child(1),
/* 狀態 */
#commentsTable td:nth-child(4),
/* 圖片 */
#commentsTable td:nth-child(5),
/* 標註 */
#commentsTable td:nth-child(8),
/* 前往 */
#commentsTable td:nth-child(9)

/* 操作 */
  {
  text-align: center;
}

/* 心情欄位不換行 */
.reaction-container {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.reaction-container .reaction-img {
  margin-right: 4px;
}


/* 7. Loading Overlays (Specialized) */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.loading-overlay .loading-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}
#setupSection[aria-busy="true"] > :not(.setup-loading-overlay) {
  pointer-events: none;
  user-select: none;
}
.setup-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.68);
  border-radius: inherit;
  cursor: wait;
}
.setup-loading-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid rgba(25, 188, 211, 0.2);
  border-top-color: rgba(25, 188, 211, 0.72);
  border-radius: 50%;
  animation: setup-loading-spin 0.8s linear infinite;
}
@keyframes setup-loading-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .setup-loading-spinner { animation-duration: 1.6s; }
}

#longLoadingIndicator img {
  animation: none;
  transition: none;
  max-width: 100%;
  height: auto !important;
  object-fit: contain;
  flex: 0 0 auto;
}




/* 8. Connect Social Specific (connect-social.php) */
.dc-label-chip {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #bbb;
  color: #FFF;
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 14px;
}

.footer-text {
  text-align: center;
  font-size: 12px;
  color: #9aa5b1;
  margin-top: 0px;
}

/* 9. Pagination Overrides */
.pagination .page-link {
  color: var(--sp88blue);
}

.pagination .page-item.active .page-link {
  background-color: var(--sp88blue);
  border-color: var(--sp88blue);
  color: #fff;
}

.pagination .page-item.active .page-link:hover {
  background-color: var(--sp88blue);
  border-color: var(--sp88blue);
}

.pagination .page-link:hover {
  color: var(--sp88blue);
  background-color: #f8f9fa;
}

.pagination .page-link:focus {
  box-shadow: 0 0 0 0.2rem rgba(25, 188, 211, 0.25);
}

/* 7. Filter Tabs & Unqualified List */
.filter-tabs {
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid #dee2e6;
  margin-top: 1.5rem;
  padding-left: 5px;
  gap: 6px;
}

.filter-tab-item {
  padding: 10px 16px;
  /* Reduced from 24px to prevent wrap */
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: #718096;
  background: #f1f5f9;
  background: #f2f2f2;
  border: 1px solid #dee2e6;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  margin-bottom: -1px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  white-space: nowrap;
  /* Prevent text wrapping */
}
.filter-tab-item > span{
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}  

@media (max-width: 576px) {
  .filter-tab-item {
    padding: 8px 10px;
    /* Compress more on mobile */
    font-size: 0.9rem;
  }

  .filter-tab-item .badge {
    margin-left: 6px;
    padding: 3px 6px;
  }
}

.filter-tab-item:hover {
  background: #f8fafc;
  color: var(--sp88blue);
}

.filter-tab-item.active {
  background: #ffffff;
  /* color: #495057;*/
  color: var(--sp88blue);
  font-weight: 900;
  font-size: 0.95rem;
  border-bottom: 2px solid #ffffff;
  /* 蓋住底線 */
  z-index: 3;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.04);
}

.filter-tab-item .badge {
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 800;
}

.filter-tab-item.active .badge-info {
  background-color: var(--sp88blue) !important;
}

.filter-tab-item.active .badge-light {
  background-color: #f1f5f9 !important;
  color: #64748b !important;
}

.col-reason {
  color: #dc3545;
}

#commentsTable thead th.col-reason {
  color: #495057;
}

.reason-tag {
  display: inline-block;
  padding: 1px 6px;
  background-color: #fff5f5;
  border: 1px solid #ffe3e3;
  border-radius: 4px;
  color: #dc3545;
  font-size: 0.75rem;
  margin-right: 4px;
  margin-bottom: 4px;
  white-space: nowrap;
}

/* 10. Empty Row Placeholder */
.empty-row td {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  border-color: transparent !important;
  color: transparent;
}

.empty-row td > div {
  min-height: 4em;
}

.empty-row:hover {
  background-color: transparent !important;
}

/* 固定留言表格容器高度，避免最後一頁內容不足導致表格高度跳動 */
.comments-table-wrapper {
  min-height: 520px;
}

/* 沒有符合條件的留言時，不保留完整五列的表格高度 */
.comments-table-wrapper.is-empty {
  min-height: 160px;
}

.comments-table-wrapper.is-empty .empty-row {
  display: none;
}

/* 留言者頭像右下角的平台來源標記 */
.comment-avatar-wrap {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 40px;
  margin-right: 0.5rem;
  align-items: flex-start;
  justify-content: flex-start;
  flex: 0 0 40px;
}

.comment-avatar-main {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 0.72rem;
  font-weight: bold;
  line-height: 1;
  object-fit: cover;
  overflow: hidden;
}

.comment-avatar-source {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #fff;
  background-repeat: no-repeat;
  color: #000;
  font-size: 12px;
  line-height: 1;
  /*box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;*/
  overflow: hidden;
}

.comment-avatar-source > .bi,
.comment-avatar-source > .bi::before {
  display: block;
  line-height: 1;
  vertical-align: 0;
}

.comment-avatar-wrap > .mr-2 {
  margin-right: 0 !important;
}

.comment-avatar-source.is-facebook {
  color: #1877f2;
}

.comment-avatar-source.is-instagram {
  width: 14px;
  height: 14px;
  background: #e1306c;
  color: #fff;
  font-size: 8px;
}

.comment-avatar-source.is-youtube {
  color: #f00;
}

/* Mention Tag Highlighting */
.mention-tag {
  /* Facebook Blue 
  color: #3b5998;*/
  color: var(--sp88blue);

  font-weight: 900;
  background-color: rgba(59, 89, 152, 0.05);
  padding: 0 2px;
  border-radius: 3px;
}

/* Post Preview Thumb Fix */
.post-preview-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover !important;
  /* Prevent distortion */
  border-radius: 4px;
  flex-shrink: 0;
}

/* Consistent thumb size in dropdown */
.ts-dropdown .post-preview-thumb {
  width: 32px;
  height: 32px;
}

.fa-brands-size {
  /*font-size: 3.2rem;*/
  font-size: 4.8rem;
}

/* Text Clamp for Post Dropdown */
.text-clamp-custom {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  /* Mobile default 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  line-height: 1.4;
  margin-top: 2px;
}

@media (min-width: 768px) {
  .text-clamp-custom {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Desktop 2 lines */
  }
}

/* Post Dropdown Desktop Layout:
   On desktop, merge meta row (date/likes/comments) and content into one line 
   Disabling this to allow the message to move to the second line as requested.
@media (min-width: 768px) {
  .ts-dropdown .option .post-option-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 6px;
  }
  .ts-dropdown .option .post-option-meta {
    display: inline-flex !important;
    flex-shrink: 0;
    margin-bottom: 0 !important;
    white-space: nowrap;
  }
  .ts-dropdown .option .post-option-text {
    display: inline;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    overflow: visible !important;
    margin-top: 0 !important;
    white-space: normal;
    flex: 1;
    min-width: 0;
  }
}
*/


/* SweetAlert 社群匯入彈窗樣式 */
.popup-social {
  padding: 0 !important;
}

.popup-social .swal2-html-container {
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* 手機版：確保 SweetAlert 內的 iframe 有足夠高度 */
@media (max-width: 767.98px) {
  .popup-social {
    width: 95% !important;
    max-width: 95% !important;
  }

  .popup-social iframe {
    height: 75vh !important;
    min-height: 500px !important;
  }

  /* 確保 SweetAlert 本身可以捲動 */
  .popup-social .swal2-popup {
    max-height: 90vh !important;
    overflow-y: auto !important;
  }

  /* 確保所有卡片在手機版都有左右邊距 */
  #dashboard-section .card {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
  }
}

/* 10. Responsive Spacing Optimizations (修正手機版與桌機版的間距優化) */

/* 確保 Tom Select 在所有寬度下都有穩定的容器寬度，解決下拉清單變成垂直條的問題 */
.ts-wrapper {
  width: 100% !important;
}

/* 針對所有寬度：保留佔位空間，確保標籤對齊且不會跳動 */
.progress-placeholder {
  height: 18px;
  display: block;
}

/* 進度條容器在不活動時仍佔空間，避免跳動 */
#dashboard-section .progress-container:not(.active) {
  visibility: hidden !important;
}

@media (max-width: 767.98px) {

  /* 1. 壓縮每一「組」選擇區域之間的垂直距離 (間距由進度條負責) */
  #dashboard-section .selection-col {
    margin-bottom: 0 !important;
  }

  /* 2. 針對標籤垂直堆疊模式下的壓縮 (md 以下) */
  #dashboard-section .select-row-container.flex-column .filter-label,
  #exportPostDetails .d-flex.flex-column .filter-label,
  .filter-block .filter-label {
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.2 !important;
    margin-bottom: 0 !important;
    /* 降低標籤與內容的距離 */
    flex: 0 0 auto !important;
    width: 100% !important;
    display: block !important;
    font-weight: bold;
    color: #4a5568;
  }

  /* 堆疊時標籤與內容的間距 - 拉近 */
  #dashboard-section .select-row-container.flex-column,
  .filter-block {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
    margin-bottom: 1.2rem !important;
    /* 拉大每組之間的距離 */
  }

  #dashboard-section .select-row-container.flex-column.no-mb {
    /* 特殊情況 內容間有進度條因此不用間距 */
    margin-bottom: 0 !important;
  }

  #dashboard-section .progress-container {

    width: calc(100% - 5px) !important;
    height: 18px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }


  /* 3. 修正第二張卡片 (篩選區) 的跑版問題 */
  .filter-content {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding-left: 0 !important;
    /* 移除可能的縮排 */
  }

  #tableSection,
  #tableSection .card-body,
  #tableSection .filter-panel,
  #tableSection .filter-grid,
  #tableSection .filter-block,
  #tableSection .filter-content {
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #tableSection .card-body {
    overflow-x: hidden;
  }

  #tableSection .filter-content>.d-flex,
  #tableSection .filter-content>.d-flex.flex-grow-1,
  #tableSection #filter_group_content .filter-content>.d-flex,
  #tableSection #filter_group_mentions .filter-content>.d-flex {
    flex-wrap: wrap !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin-right: 0 !important;
  }

  #tableSection .form-check,
  #tableSection .form-check-label {
    max-width: 100% !important;
  }

  #tableSection .form-check-label {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  #tableSection #keyword_match_mode {
    flex: 1 1 140px;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #tableSection #searchInputContainer {
    flex: 1 0 100%;
    width: 100% !important;
  }
  /* 確保輸入框與容器在手機版不溢出 */
  .filter-content input[type="text"],
  .filter-content input[type="number"],
  .search-input-container {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 修正 checkbox 為垂直居中 (桌機/手機同步) */
  .form-check {
    display: flex !important;
    align-items: center !important;
    padding-left: 0 !important;
    margin-bottom: 0.5rem !important;
    width: auto !important;
  }

  .form-check-input {
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 0px !important;
    position: relative !important;
    top: 0 !important;
  }

  .form-check-label {
    line-height: 1.2 !important;
    display: flex !important;
    align-items: center !important;
    white-space: nowrap !important;
  }

  /* 關鍵字輸入框換行並滿版 */
  .search-input-container {
    width: 100% !important;
    margin-top: 2px !important;
  }

  /* 標註好友特定名稱輸入框 */
  #mention_specific_name {
    width: 100% !important;
    max-width: none !important;
  }

  /* 日期區間滿版且換行 (手機版) */
  #filter_group_date .filter-content .flex-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 5px !important;
  }

  #filter_group_date .filter-content input.flatpickr-input {
    width: 100% !important;
    flex: 0 0 auto !important;
    max-width: none !important;
    margin-bottom: 0 !important;
    height: 36px !important;
    /* 強制固定高度，防止變巨大 */
    min-height: 36px !important;
    font-size: 1rem !important;
  }

  /* 貼文網址區塊修正 */
  #tableSection #filter_group_date .filter-content input.form-control {
    width: 100% !important;
    flex: 0 0 auto !important;
    max-width: none !important;
  }

  #tableSection .filter-tabs {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  #tableSection .filter-tabs>.ml-auto {
    margin-left: 0 !important;
    padding-left: 4px;
    white-space: nowrap;
  }

  .comments-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
  }

  #authSection #userInfo {
    width: 100%;
    align-items: stretch !important;
  }

  #btnGoogleLogin.btn-google-login {
    width: 100%;
    min-height: 40px;
    height: auto;
    justify-content: center;
    flex-wrap: wrap;
    padding: 8px 12px;
    margin-left: 0 !important;
    white-space: normal;
  }

  #btnGoogleLogin.btn-google-login .text-muted {
    flex: 0 0 100%;
    margin-left: 0 !important;
    margin-top: 4px;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
  }
  #postLinkDisplay .filter-label {
    margin-bottom: 0 !important;
  }

  #postLinkAnchor {
    word-break: break-all;
    display: block;
    margin-top: 2px;
  }

  /* 表格手機版顯示優化 */
  #commentsTable thead th {
    font-size: 0.8rem;
    padding: 8px 4px;
  }

  #commentsTable th.text-nowrap,
  #commentsTable td.text-nowrap {
    white-space: normal !important;
  }

  .col-content {
    width: 60% !important;
    /* 加大內容比例 */
    min-width: 150px;
  }

  .col-user {
    width: 25% !important;
    min-width: 80px;
  }

  #filter_group_date .filter-content .text-muted {
    text-align: center;
    width: 100%;
    margin: 2px 0;
  }

  /* 移除手機版不必要的縮排 */
  .note-align {
    margin-left: 0 !important;
  }
}

/* 針對中大螢幕 (>=768px) 的水平排版微調 */
@media (min-width: 768px) {
  #dashboard-section .selection-col {
    margin-bottom: 0 !important;
  }

  /* 讓進度條與標籤對齊 (93px = 85px label + 8px mr-2) */
  #dashboard-section .progress-container.active {
    margin-left: 93px !important;
    margin-top: 0;
    margin-bottom: 0;
  }

  /* 貼文預覽區塊的子行間距同步 */
  #postLinkDisplay {
    margin-top: 0 !important;
    margin-bottom: 18px !important;
  }

  #importOptionsSection {
    margin-top: 0 !important;
    margin-bottom: 18px !important;
  }

  #pageAuthWarningWrapper.page-auth-warning-wrapper {
    margin-left: 93px !important;
  }
}

/* 優化管理按鈕區塊與下拉選單深度 */
@media (max-width: 1199.98px) {
  #dashboard-section .auth-actions {
    padding-left: 0 !important;
    margin-left: 0 !important;
    flex-wrap: wrap !important;
    gap: 4px 8px !important;
  }

  /* 移除強制寬度與位移，解決溢出問題 */
}

/* 11. Overriding Font Sizes to 15px 
#dashboard-section {
  font-size: 15px;
}

#dashboard-section input,
#dashboard-section select,
#dashboard-section textarea,
#dashboard-section button,
#dashboard-section .form-control,
#dashboard-section .form-control-sm,
#dashboard-section .ts-control,
#dashboard-section .ts-control input,
#dashboard-section .filter-label,
#dashboard-section .form-check-label,
#dashboard-section .badge,
#dashboard-section .filter-tab-item,
#dashboard-section th,
#dashboard-section td,
#dashboard-section .search-input-inline,
#dashboard-section .exclude-tag,
#dashboard-section label,
#dashboard-section strong:not(.note-section strong),
#dashboard-section span:not(.fa):not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-brands):not(.fa-regular):not(.note-section span) {
  font-size: 15px !important;
}


*/
.filter-label{
  margin-right: 8px ;
}

/* Tom-Select Dropdown Options (Since they append to body) */
body>.ts-dropdown .option,
.swal2-container .ts-dropdown .option,
#dashboard-section .ts-dropdown .option,
body>.ts-dropdown .option *:not(.fa):not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-brands):not(.fa-regular),
.swal2-container .ts-dropdown .option *:not(.fa):not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-brands):not(.fa-regular),
#dashboard-section .ts-dropdown .option *:not(.fa):not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-brands):not(.fa-regular),
#dashboard-section .ts-control .item,
#dashboard-section .ts-control .item *:not(.fa):not(.fas):not(.far):not(.fab):not(.fa-solid):not(.fa-brands):not(.fa-regular) {
  font-size: 15px !important;
}

/* Specific Tom-Select placeholder */
#dashboard-section .ts-control input::placeholder {
  font-size: 15px !important;
}

/* Restore Note Section Small Font */
#dashboard-section .note-section,
#dashboard-section .note-section * {
  font-size: 13px !important;
}

/* 12. Reduce Input Padding & Height */
#dashboard-section input.form-control,
#dashboard-section select.form-control,
#dashboard-section .form-control-sm,
#dashboard-section .search-input-inline,
#dashboard-section .ts-control input {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

#dashboard-section .ts-wrapper.form-control {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  height: auto !important;
}

#dashboard-section .ts-wrapper.form-control .ts-control {
  border: 1px solid #dee2e6 !important;
}

#dashboard-section .ts-wrapper.form-control:hover .ts-control,
#dashboard-section .ts-wrapper.form-control.focus .ts-control {
  border-color: var(--icon_color, #19bcd3) !important;
}

#dashboard-section .ts-control {
  min-height: 38px !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  padding: 4px 12px !important;
}

/* Give images inside Tom-Select enough breathing room */
#dashboard-section .ts-control .item .post-thumb,
#dashboard-section .ts-control .item .page-avatar,
#dashboard-section .ts-control .item img,
#dashboard-section .ts-dropdown .option .post-thumb,
#dashboard-section .ts-dropdown .option .page-avatar,
#dashboard-section .ts-dropdown .option img {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  margin-right: 10px !important;
}

#dashboard-section .select-row .select-control,
#dashboard-section .select-row .btn-refresh {
  height: 38px !important;
}

#dashboard-section .search-input-container {
  min-height: 38px !important;
}

.btn_small {
  font-size: 13px !important;
}

/* 授權教學區塊 */
.connect-guide-block {
  margin-top: -8px;
  margin-bottom: 28px;
  padding: 20px 0px;
  /*background: #ffffff;
  border: 1px solid #e9eef3;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .05); */
}

.connect-guide-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.connect-guide-subtitle {
  font-size: 14px;
  line-height: 1.7;
  margin-top: 6px;
}

.connect-guide-slick {
  margin: 0 -8px;
}

.guide-slick-item {
  padding: 0 8px;
  box-sizing: border-box;
}

.guide-card {
  height: 100%;
  padding: 12px;
  /* background: #fafcfe; */
  background: #fff;
  border: 1px solid #e9eef3;
  border-radius: 12px;
}

.guide-img-wrap {
  background: #ffffff;
  /* border: 1px solid #e9eef3; */
  border-radius: 10px;
  padding: 10px;
}

.guide-img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: contain;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
}

.guide-caption {
  margin-top: 12px;
  text-align: left;
  font-size: 15px;
  line-height: 1.8;
  color: #4f5b66;
  padding: 0 10px;
}

.guide-note {
  font-size: 13px;
  line-height: 1.8;
}



/* slick arrow */
.connect-guide-block .slick-prev,
.connect-guide-block .slick-next {
  width: 42px;
  height: 42px;
  z-index: 5;
}

.connect-guide-block .slick-prev {
  left: -8px;
}

.connect-guide-block .slick-next {
  right: -8px;
}

.connect-guide-block .slick-prev:before,
.connect-guide-block .slick-next:before {
  font-size: 42px;
  color: #17b8d6;
  opacity: 1;
}

.connect-guide-block .slick-prev.slick-disabled:before,
.connect-guide-block .slick-next.slick-disabled:before {
  opacity: .25;
}

/* slick dots */
.connect-guide-block .slick-dots {
  bottom: -36px;
}

.connect-guide-block .slick-dots li button:before {
  font-size: 11px;
  color: #c5d0d8;
  opacity: 1;
}

.connect-guide-block .slick-dots li.slick-active button:before {
  color: #17b8d6;
  opacity: 1;
}

.guide-img {
  width: 100%;
  height: 430px;
  object-fit: contain;
  background: #fff;
}

.guide-caption {
  min-height: 96px;
}

@media (max-width: 991.98px) {
  .guide-img {
    height: 400px;
  }
}

@media (max-width: 767.98px) {
  .guide-img {
    height: 300px;
  }
}

@media (max-width: 991.98px) {
  .connect-guide-title {
    font-size: 22px;
  }



  .guide-caption {
    font-size: 14px;
  }
}

@media (max-width: 767.98px) {
  .connect-guide-block {
    padding: 16px 12px 18px;
    border-radius: 12px;
  }

  .connect-guide-title {
    font-size: 20px;
  }

  .connect-guide-subtitle {
    font-size: 13px;
  }

  .guide-slick-item {
    padding: 0 4px;
  }

  .guide-card {
    padding: 8px;
  }

  .guide-img-wrap {
    padding: 6px;
  }



  .guide-caption {
    font-size: 14px;
    line-height: 1.7;

  }

  .guide-note {
    font-size: 12px;
  }

  .connect-guide-block .slick-prev {
    left: -4px;
  }

  .connect-guide-block .slick-next {
    right: -4px;
  }

  .connect-guide-block .slick-prev:before,
  .connect-guide-block .slick-next:before {
    font-size: 34px;
  }
}

/* Number Spinner */
.number-spinner {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background-color: #fff;
  height: 31px;
  overflow: hidden;
  vertical-align: middle;
}

.number-spinner .btn-spin {
  width: 28px;
  height: 100%;
  border: none;
  background: #f8f9fa;
  color: #495057;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: background 0.2s;
  font-size: 14px;
  padding: 0;
}

.number-spinner .btn-spin:hover {
  background: #e9ecef;
}

.number-spinner .btn-spin:active {
  background: #dee2e6;
}

.number-spinner input {
  border: none !important;
  border-left: 1px solid #ced4da !important;
  border-right: 1px solid #ced4da !important;
  text-align: center;
  width: 45px !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 14px;
  -moz-appearance: textfield;
}

.number-spinner input::-webkit-inner-spin-button,
.number-spinner input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
@media (max-width: 804px) {
  #dashboard-section>.container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
  }

  #setupSection,
  #tableSection {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  #setupSection .card-body,
  #tableSection .card-body {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #setupSection .card-body>.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #setupSection .selection-col {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #setupSection .select-row-container,
  #setupSection #postSelectionRow,
  #setupSection #postSelectionRow>.select-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 4px !important;
  }

  #setupSection .select-row-container>.filter-label,
  #setupSection #postSelectionRow>.select-row>.filter-label {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    flex: 0 0 auto !important;
    display: block !important;
  }

  #setupSection .select-row-container>.filter-label+div,
  #setupSection #postSelectionRow>.select-row>.filter-label+div,
  #setupSection .select-row-container>div:not(.filter-label) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #setupSection .progress-container,
  #setupSection .progress-placeholder,
  #setupSection .note-section,
  #pageAuthWarningWrapper.page-auth-warning-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  #authSection #userInfo {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-right: 0 !important;
    gap: 6px;
  }

  #authSection #userInfo.yt-account-info {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap;
    gap: 0 2px;
  }

  #authSection #userInfo.yt-account-info .yt-account-name {
    flex: 0 1 auto;
    overflow-wrap: anywhere;
  }

  #btnGoogleLogin.btn-google-login {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 40px;
    height: auto;
    justify-content: center;
    margin-left: 0 !important;
    padding: 8px 12px;
    box-sizing: border-box;
  }

  .yt-google-login-note {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #tableSection .filter-grid,
  #tableSection .filter-block,
  #tableSection .filter-block.full-row,
  #tableSection .filter-content,
  #tableSection .filter-content>.d-flex,
  #tableSection .filter-content>.d-flex.flex-grow-1 {
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #tableSection .filter-grid {
    display: flex !important;
    flex-wrap: wrap !important;
  }

  #tableSection .filter-block,
  #tableSection .filter-block.full-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }

  #tableSection .filter-label {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin-right: 0 !important;
    flex: 0 0 auto !important;
    display: block !important;
  }

  #tableSection .filter-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding-left: 0 !important;
  }

  #tableSection #filter_group_content .filter-content>.d-flex,
  #tableSection #filter_group_mentions .filter-content>.d-flex,
  #tableSection #filter_group_date .filter-content>.d-flex,
  #tableSection #filter_group_date .filter-content .flex-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }

  #tableSection #keyword_match_mode,
  #tableSection #filter_group_date input.form-control,
  #tableSection #filter_group_date input.flatpickr-input,
  #tableSection .search-input-container {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
  }

  #tableSection #filter_group_date .text-muted {
    width: 100% !important;
    text-align: center;
  }
}
@media (max-width: 804px) {
  #tableSection #filter_group_content>.filter-content>.form-check,
  #tableSection #filter_group_mentions>.filter-content>.d-flex {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 4px !important;
  }

  #tableSection #filter_group_content>.filter-content>.form-check {
    width: auto !important;
    align-self: flex-start;
  }

  #tableSection #filter_group_content>.filter-content>.form-check .form-check-label,
  #tableSection #filter_group_mentions>.filter-content>.d-flex .form-check-label {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
  }

  #tableSection #filter_group_mentions>.filter-content>.d-flex>.form-check,
  #tableSection #filter_group_mentions>.filter-content>.d-flex>.d-flex {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    margin-bottom: 0 !important;
  }

  #tableSection #filter_group_mentions>.filter-content>.d-flex>div[style*="min-width"] {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #tableSection #filter_group_mentions #mention_specific_name {
    width: 100% !important;
    min-width: 0 !important;
  }

  #tableSection #filter_group_mentions .number-spinner {
    flex: 0 0 auto !important;
  }
}



@keyframes reauthAttentionPulse {
  0%, 100% {
    border-color: #dc3545;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.18);
    transform: translateZ(0) scale(1);
  }
  50% {
    border-color: #ff6b7a;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
    transform: translateZ(0) scale(1.05);
  }
}

.reauth-attention {
  animation: reauthAttentionPulse 1.05s ease-in-out infinite;
  border-color: #dc3545 !important;
  outline: 2px solid rgba(220, 53, 69, 0.35) !important;
  outline-offset: 2px;
  position: relative;
  z-index: 2;
}

.reauth-attention:focus {
  outline: 2px solid rgba(220, 53, 69, 0.65) !important;
}
#authSection #userInfo.yt-account-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0 2px;
  min-width: 0;
}

#authSection #userInfo.yt-account-info .yt-account-avatar {
  width: 24px;
  margin-right: 0 !important;
  height: 24px;
  border-radius: 50%;
  flex: 0 0 auto;
  object-fit: cover;
}

#authSection #userInfo.yt-account-info .yt-account-name {
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  font-weight: bold;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#authSection #userInfo.yt-account-info .yt-account-logout {
  flex: 0 0 auto;
  margin-left: 4px;
  line-height: 1.25;
  text-decoration: none;
}
@media (min-width: 805px) {
  #setupSection .select-row-container,
  #setupSection .select-progress-col,
  #setupSection #postSelectionRow {
    display: grid !important;
    grid-template-columns: var(--setup-label-width) minmax(0, 1fr) !important;
    column-gap: var(--setup-label-gap) !important;
    align-items: center !important;
  }

  #setupSection .select-progress-col>.select-row-container,
  #setupSection #postSelectionRow>.select-row {
    display: contents !important;
  }

  #setupSection .select-row-container>.filter-label,
  #setupSection .select-progress-col>.select-row-container>.filter-label,
  #setupSection #postSelectionRow>.select-row>.filter-label {
    grid-column: 1 !important;
    width: auto !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  #setupSection .select-row-container>.filter-label+div,
  #setupSection .select-progress-col>.select-row-container>.filter-label+div,
  #setupSection #postSelectionRow>.select-row>.filter-label+div {
    grid-column: 2 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #setupSection #pageAuthWarningWrapper,
  #setupSection #pageLoadingProgress,
  #setupSection #postLoadingProgress,
  #setupSection .post-loading-status,
  #setupSection .note-align,
  #setupSection .progress-placeholder {
    grid-column: 2 !important;
    margin-left: 0 !important;
  }
}
@media (min-width: 768px) and (max-width: 804px) {
  #setupSection .selection-col {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #setupSection .select-row-container,
  #setupSection .select-progress-col,
  #setupSection #postSelectionRow,
  #setupSection .select-progress-col>.select-row-container,
  #setupSection #postSelectionRow>.select-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 4px !important;
  }

  #setupSection .select-row-container>.filter-label,
  #setupSection .select-progress-col>.select-row-container>.filter-label,
  #setupSection #postSelectionRow>.select-row>.filter-label {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    flex: 0 0 auto !important;
    display: block !important;
  }

  #setupSection .select-row-container>.filter-label+div,
  #setupSection .select-progress-col>.select-row-container>.filter-label+div,
  #setupSection #postSelectionRow>.select-row>.filter-label+div,
  #setupSection .select-row-container>div:not(.filter-label) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #setupSection #pageAuthWarningWrapper,
  #setupSection #pageLoadingProgress,
  #setupSection #postLoadingProgress,
  #setupSection .post-loading-status,
  #setupSection .note-section,
  #setupSection .progress-placeholder {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
}
