/* =====================
   MKP WebHub — Premium UI/UX Styles
   Applies to ALL pages (X-Ray + Dashboard + Jobs + LIVE + etc.)
   Target: 900+ / 1000 Marketing Tool Standard
   ===================== */

/* ===================== Typography & Spacing ===================== */
.xray-page { font-size: 14px; }
.xray-page .page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 20px; }
.xray-page .card { border-radius: 12px; transition: box-shadow 0.2s, transform 0.15s; }
.xray-page .card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

/* ===================== Color Coding System ===================== */
.score-excellent { color: #4CAF50; } /* ER>5%, Grade S/A */
.score-good { color: #EA8623; }      /* ER 2-5%, Grade B */
.score-average { color: #FFC107; }   /* ER 1-2%, Grade C */
.score-poor { color: #F44336; }      /* ER<1%, Grade D */

/* ===================== Skeleton Loading ===================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text { height: 14px; margin-bottom: 6px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 8px; }
.skeleton-thumb { width: 48px; height: 64px; border-radius: 6px; }
.skeleton-stat { width: 60px; height: 32px; border-radius: 6px; }

.skeleton-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===================== Smooth Transitions ===================== */
.tab-content-enter { animation: fadeSlideIn 0.25s ease; }

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

.modal-overlay { animation: fadeIn 0.2s ease; }
.modal { animation: scaleIn 0.25s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ===================== Score Gauges ===================== */
.gauge-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-weight: 700;
  font-size: 14px;
}

.gauge-ring::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bg-card);
}

.gauge-ring span { position: relative; z-index: 1; }

.gauge-ring.grade-s { background: conic-gradient(var(--grade-s) var(--pct), var(--bg-primary) var(--pct)); color: var(--grade-s); }
.gauge-ring.grade-a { background: conic-gradient(var(--grade-a) var(--pct), var(--bg-primary) var(--pct)); color: var(--grade-a); }
.gauge-ring.grade-b { background: conic-gradient(var(--grade-b) var(--pct), var(--bg-primary) var(--pct)); color: var(--grade-b); }
.gauge-ring.grade-c { background: conic-gradient(#FFC107 var(--pct), var(--bg-primary) var(--pct)); color: #FFC107; }
.gauge-ring.grade-d { background: conic-gradient(#F44336 var(--pct), var(--bg-primary) var(--pct)); color: #F44336; }

/* ===================== Sparkline (CSS-only mini chart) ===================== */
.sparkline {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 20px;
  vertical-align: middle;
}

.sparkline-bar {
  width: 3px;
  background: var(--accent);
  border-radius: 1px 1px 0 0;
  transition: height 0.3s;
  min-height: 2px;
}

.sparkline-bar.high { background: #4CAF50; }
.sparkline-bar.low { background: #F44336; }

/* ===================== ER% Meter ===================== */
.er-meter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.er-bar {
  width: 50px;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
}

.er-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ===================== Video Card (Grid View) ===================== */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.video-card-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.video-card-body { padding: 10px 12px; }
.video-card-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.video-card-author { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }

.video-card-stats {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.video-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  background: rgba(0,0,0,0.6);
}

.video-card-actions {
  display: flex;
  gap: 4px;
  padding: 6px 12px 10px;
}

/* ===================== Filter Bar Enhanced ===================== */
.xray-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.xray-filter-bar .filter-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.xray-filter-bar label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Filter Presets */
.filter-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.preset-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.preset-btn:hover, .preset-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(234, 134, 35, 0.08);
}

/* ===================== Table Enhanced ===================== */
.xray-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.xray-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 8px;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.xray-table td { padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 13px; }
.xray-table tr { transition: background 0.15s; }
.xray-table tr:hover { background: rgba(234, 134, 35, 0.04); }

/* ===================== Stat Cards Enhanced ===================== */
.xray-stat {
  text-align: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.xray-stat:hover { border-color: var(--accent); }

.xray-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.xray-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===================== Detail Modal Tabs ===================== */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.detail-tab {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.detail-tab:hover { color: var(--text-primary); }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===================== Empty States ===================== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state-desc {
  font-size: 13px;
  max-width: 300px;
  margin: 0 auto;
  line-height: 1.5;
}

.empty-state-action {
  margin-top: 16px;
}

/* Illustrated empty states with CSS art */
.empty-illust {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  position: relative;
  opacity: 0.15;
}

.empty-illust-circle {
  width: 100%;
  height: 100%;
  border: 3px dashed var(--text-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-illust-circle .material-symbols-rounded {
  font-size: 48px;
  color: var(--accent);
  opacity: 0.8;
}

/* Bear watermark for empty states */
.empty-bear {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  background: url('../img/logo.png') center/contain no-repeat;
  opacity: 0.08;
  filter: grayscale(1);
}

/* ===================== Tooltips ===================== */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(30,30,30,0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1001;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: rgba(30,30,30,0.95);
  color: #f0f0f0;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  max-width: 280px;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after { opacity: 1; }

/* Tooltip positions */
[data-tooltip-pos="right"]::before {
  bottom: auto; left: calc(100% + 2px); top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: rgba(30,30,30,0.95);
}
[data-tooltip-pos="right"]::after {
  bottom: auto; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%);
}

/* ===================== Favorites Folder ===================== */
.fav-folder {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.fav-folder:hover { border-color: var(--accent); }

.fav-folder-header {
  padding: 10px 14px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.fav-folder-header:hover { background: var(--bg-hover); }

.fav-folder-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

/* ===================== Hashtag Links ===================== */
.hashtag-link {
  color: var(--accent);
  cursor: pointer;
  transition: opacity 0.15s;
}

.hashtag-link:hover { opacity: 0.7; text-decoration: underline; }

/* ===================== Keyboard Shortcuts Hint ===================== */
.kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-family: monospace;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
}

/* ===================== Responsive ===================== */
@media (max-width: 1200px) {
  .xray-filter-bar { padding: 8px 12px; }
  .filter-group { min-width: 0; }
  .form-input-sm { width: 70px !important; }
}

@media (max-width: 768px) {
  .xray-page .page-title { font-size: 22px; }
  .video-card-thumb { height: 140px; }
  .xray-stat-value { font-size: 18px; }
  .xray-filter-bar { gap: 4px; }
  .detail-tab { padding: 6px 10px; font-size: 11px; }
  .grid.grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 480px) {
  .grid.grid-3 { grid-template-columns: 1fr !important; }
  .grid.grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .xray-table td, .xray-table th { padding: 6px 4px; font-size: 11px; }
}

/* ===================== SHARED PREMIUM STYLES ===================== */

/* Page wrapper animation */
.content > * { animation: fadeSlideIn 0.3s ease; }

/* Premium Cards — used everywhere */
.premium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.premium-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  border-color: rgba(234, 134, 35, 0.2);
}

/* Premium Stat Cards */
.premium-stat {
  text-align: center;
  padding: 14px 10px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  overflow: hidden;
  min-width: 0;
}

.premium-stat:hover { border-color: var(--accent); transform: translateY(-2px); }

.premium-stat .value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.premium-stat .label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.premium-stat .sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Trend Indicator */
.trend-up { color: #4CAF50; }
.trend-up::before { content: '▲ '; font-size: 9px; }
.trend-down { color: #F44336; }
.trend-down::before { content: '▼ '; font-size: 9px; }
.trend-neutral { color: var(--text-muted); }

/* Premium Progress Bar */
.premium-progress {
  width: 100%;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
}

.premium-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
  background: linear-gradient(90deg, var(--accent), #F5A040);
}

.premium-progress-fill.success { background: var(--success-gradient); }
.premium-progress-fill.danger { background: var(--danger-gradient); }

/* Premium Table */
.premium-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.premium-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 12px 10px;
  border-bottom: 2px solid var(--border);
  text-align: left;
}
.premium-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px;
}
.premium-table tr { transition: background 0.15s; }
.premium-table tr:hover { background: rgba(234, 134, 35, 0.04); }

/* ===================== Analytics Charts ===================== */

/* Vertical Bar Chart */
.chart-bar-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding: 12px 0;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.chart-bar-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  min-height: 16px;
}

.chart-bar-track {
  flex: 1;
  width: 100%;
  max-width: 40px;
  display: flex;
  align-items: flex-end;
  background: var(--bg-primary);
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}

.chart-bar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.6s ease;
  min-height: 3px;
}

.chart-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-bar-label.active {
  color: var(--accent);
  font-weight: 700;
}

/* Horizontal Feature Chart */
.feature-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feature-chart-label {
  width: 100px;
  font-size: 11px;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}

.feature-chart-bar {
  flex: 1;
  height: 20px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.feature-chart-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #F5A040);
  border-radius: 4px;
  transition: width 0.6s ease;
  min-width: 3px;
}

.feature-chart-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 30px;
  text-align: right;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-running { background: rgba(33,150,243,0.15); color: #64B5F6; }
.status-running::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #64B5F6; animation: pulse 1.5s infinite; }
.status-completed { background: rgba(76,175,80,0.15); color: #81C784; }
.status-failed { background: rgba(244,67,54,0.15); color: #E57373; }
.status-pending { background: rgba(255,255,255,0.05); color: var(--text-secondary); }
/* 2026-05-02 PM bug #7 fix · partial completion (some clips ok, some failed) */
.status-warning { background: rgba(255,167,38,0.18); color: #FFB74D; }
.status-paused { background: rgba(255,193,7,0.15); color: #FFD54F; }

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Quick Stats Row */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  /* polish 22 · removed overflow:hidden · it was clipping the top border
   * of dashboard stat cards (Online / Clips Today / Jobs Running / AI Calls/HR)
   * boss screenshot showed clean cut across top edge of all 4 cards */
}

/* ===================== DASHBOARD SPECIFIC ===================== */

.dashboard-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.dashboard-chart-placeholder {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* ===================== JOBS SPECIFIC ===================== */

.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s;
}

.job-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.job-card .job-info { flex: 1; min-width: 0; }
.job-card .job-title { font-weight: 600; font-size: 14px; }
.job-card .job-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.job-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}

/* ===================== LIVE SPECIFIC ===================== */

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(244,67,54,0.15);
  color: #F44336;
}

.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #F44336;
  animation: pulse 1.5s infinite;
}

.pulse-meter {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
}

.pulse-bar {
  width: 4px;
  border-radius: 2px;
  background: var(--accent);
  animation: pulseBar 1s ease infinite;
}

.pulse-bar:nth-child(1) { animation-delay: 0s; }
.pulse-bar:nth-child(2) { animation-delay: 0.1s; }
.pulse-bar:nth-child(3) { animation-delay: 0.2s; }
.pulse-bar:nth-child(4) { animation-delay: 0.3s; }
.pulse-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes pulseBar {
  0%, 100% { height: 8px; opacity: 0.5; }
  50% { height: 20px; opacity: 1; }
}

/* ===================== STUDIO SPECIFIC ===================== */

.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.file-card:hover { background: var(--bg-hover); }

.file-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ===================== CONTENT CREATE SPECIFIC ===================== */

.mode-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.mode-card:hover, .mode-card.active {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(234, 134, 35, 0.15);
}

.mode-card .mode-icon { font-size: 36px; margin-bottom: 8px; }
.mode-card .mode-title { font-weight: 700; font-size: 15px; }
.mode-card .mode-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===================== GLOBAL ENHANCEMENTS ===================== */

/* Better buttons */
.btn {
  transition: all 0.15s;
  font-weight: 500;
}

.btn:active { transform: scale(0.97); }

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(234, 134, 35, 0.3);
}

/* Better inputs */
.form-input:focus, .form-input-sm:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(234, 134, 35, 0.1);
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Better page title */
.page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* Notification dot */
.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
  display: inline-block;
  animation: pulse 1.5s infinite;
}

/* Glass effect for special elements */
.glass {
  background: rgba(30, 30, 30, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ════════════════════════════════════════════════════════════════════
   Settings Tabs · 2026-05-21 night · Plan A+B redesign
   Sticky tab bar groups 13 cards (full) / 7 cards (Lite) into
   logical sections. All cards stay in DOM (display:none) so mount
   points (pacingCard / poolCard / byokStatus / mediaSettingsMount)
   work regardless of which tab is active.
   ════════════════════════════════════════════════════════════════════ */
.settings-tab-nav {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}
.settings-tab-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.settings-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}
.settings-tab-btn.active {
  background: linear-gradient(135deg, var(--accent), #F5A040);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(234, 134, 35, 0.3);
}
.settings-tab-panel {
  display: none;
  animation: fadeSlideIn 0.25s ease;
}
.settings-tab-panel.active {
  display: block;
}

/* Settings labels — replaces inline `style="display:block;font-size:12px..."` */
.settings-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.settings-label-hint {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 11px;
  margin-left: 4px;
}

/* Cost warning block (BYOK · AI Studio $ BILLED warning) */
.settings-cost-warning {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.settings-cost-warning strong:first-child { color: #ef4444; }

/* Info block (subtle hint · grey background · used everywhere) */
.settings-info-block {
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.settings-info-block.success {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--text-secondary);
}

/* Plan Benefits tile · clear hierarchy
   number (28px) > label (14px) > caption (11px)
   replaces inline style="padding:16px;background:..." mess */
.settings-benefit-tile {
  padding: 18px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
  text-align: left;
}
.settings-benefit-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234, 134, 35, 0.12);
}
.settings-benefit-tile .icon {
  font-size: 28px;
  line-height: 1;
}
.settings-benefit-tile .title {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.settings-benefit-tile .value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-top: 6px;
}
.settings-benefit-tile .value .unit {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 4px;
}
.settings-benefit-tile .caption {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.settings-benefit-tile.muted .value { color: var(--text-secondary); font-size: 20px; }

/* 2026-05-22 · Drop zone for Recipe slot folder/file upload */
.pool-drop-zone {
  transition: all 0.15s ease;
}
.pool-drop-zone.drag-over {
  border-color: var(--accent) !important;
  background: rgba(234, 134, 35, 0.12) !important;
  transform: scale(1.01);
}
.pool-drop-zone label.btn {
  margin: 0;
}

/* ════════════════════════════════════════════════════════════════════
   BYOK Card V2 · 2026-05-22 · Boss feedback "ดูยุบยับไปหมด"
   Vertex AI = hero card (full-width + accent border · "แนะนำ" badge)
   AI Studio + ChatGPT = secondary 2-col grid (smaller · de-emphasized)
   Simpler Thai-first language · tech jargon hidden in <details>
   ════════════════════════════════════════════════════════════════════ */
.byok-status-bar {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 12px 0 16px;
}
.byok-status-bar.ok { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.3); color: #10b981; }
.byok-status-bar.warn { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.3); }
.byok-status-bar.err { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.3); color: #ef4444; }

/* Vertex AI · hero card (recommended) */
.byok-hero {
  position: relative;
  padding: 18px;
  background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(16,185,129,0.02));
  border: 2px solid rgba(16,185,129,0.35);
  border-radius: 12px;
  margin-bottom: 14px;
}
.byok-hero-ribbon {
  position: absolute;
  top: -10px;
  left: 14px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(16,185,129,0.35);
}
.byok-hero-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  margin-bottom: 8px;
}
.byok-hero-perks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.byok-hero-perks span::before { content: '✓ '; color: #10b981; font-weight: 700; }
.byok-hero textarea {
  font-family: ui-monospace, Menlo, Consolas, monospace !important;
  font-size: 12px !important;
  height: 90px !important;
  resize: vertical;
  width: 100%;
  line-height: 1.55;
}
.byok-howto {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.byok-howto summary {
  cursor: pointer;
  padding: 6px 0;
  color: var(--accent);
  user-select: none;
}
.byok-howto summary:hover { color: var(--accent-hover, #F5A040); }
.byok-howto-body {
  padding: 10px 14px;
  margin-top: 6px;
  background: var(--bg-secondary);
  border-radius: 6px;
  line-height: 1.7;
}

/* Cost-billed alternatives · 2-col grid */
.byok-alt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 720px) { .byok-alt-grid { grid-template-columns: 1fr; } }
.byok-alt-card {
  padding: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.byok-alt-card .head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13px;
}
.byok-cost-pill {
  background: rgba(239,68,68,0.18);
  color: #ef4444;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.byok-alt-card .hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.55;
}
.byok-alt-card .hint a { color: var(--accent); text-decoration: none; }
.byok-alt-card .hint a:hover { text-decoration: underline; }

/* Allocation block */
.byok-allocation {
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
}
.byok-allocation-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.byok-allocation-note {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--bg-card);
  border-radius: 6px;
  line-height: 1.6;
}

/* Action row */
.byok-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 6px;
}
.byok-msg {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.55;
}
