.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 22px;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
}

.glass {
  background: linear-gradient(140deg, rgba(17, 17, 17, 0.75), rgba(30, 30, 30, 0.4));
}

.section-title {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  margin-bottom: 18px;
}

.input, .select {
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.6);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input-group {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  height: 44px;
  width: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.6);
  color: var(--text);
  cursor: pointer;
}

.btn.ghost {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 10, 0.5);
  color: var(--text);
}

.validate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.status-inline {
  font-size: 12px;
  color: var(--muted);
}

.input:focus, .select:focus {
  border-color: rgba(36, 209, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(36, 209, 255, 0.15);
}

.btn {
  height: 44px;
  border-radius: 12px;
  border: none;
  padding: 0 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  box-shadow: 0 10px 24px rgba(31, 106, 165, 0.4);
}

.btn.primary:hover { transform: translateY(-1px); }

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

.nav-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.4);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, border 0.2s ease;
}

.nav-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 209, 255, 0.4);
}

.nav-btn.active {
  background: rgba(36, 209, 255, 0.15);
  border-color: rgba(36, 209, 255, 0.5);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.ai-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 6px;
}

.ai-card {
  background: rgba(15, 15, 15, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
}

.ai-title { font-weight: 700; margin-bottom: 8px; }

.ai-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.provider-card {
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.4);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border 0.2s ease, background 0.2s ease;
}

.provider-card:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 209, 255, 0.4);
}

.provider-card.active {
  background: rgba(36, 209, 255, 0.15);
  border-color: rgba(36, 209, 255, 0.5);
}

.url-field.hidden { display: none; }

.hidden { display: none !important; }

.source-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.5);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

.tab-btn.active {
  background: rgba(36, 209, 255, 0.15);
  border-color: rgba(36, 209, 255, 0.5);
  color: var(--text);
}

.source-slot { min-width: 0; }

.upload-picker.hidden { display: none; }

.upload-picker {
  position: relative;
  height: 44px;
}

.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-input-label {
  display: flex;
  align-items: center;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.6);
  color: var(--muted);
  padding: 0 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.field { display: grid; gap: 8px; }

.label { font-size: 12px; color: var(--muted); }

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.5);
}

.switch input { display: none; }

.slider {
  width: 42px;
  height: 24px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.slider::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}

.switch input:checked + .slider { background: rgba(36, 209, 255, 0.6); }
.switch input:checked + .slider::after { transform: translateX(18px); }

.switch-label { font-size: 13px; color: var(--muted); }

.progress {
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 18px;
}

.bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--brand));
  transition: width 0.2s ease;
}

.status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.activity-log {
  margin-top: 8px;
  max-height: 140px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.5);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-log-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  opacity: 0.6;
  line-height: 1.5;
}

.activity-log-row.active {
  color: rgba(255, 255, 255, 0.92);
  opacity: 1;
}

.activity-log-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-log-time {
  flex-shrink: 0;
  font-size: 10.5px;
  color: var(--muted);
}

.activity-log-time.stale {
  color: #e0a030;
  font-weight: 600;
}

/* Highlight review/checklist — shown once AI-highlight-finding pauses at
   "awaiting_selection", equivalent of the desktop app's
   HighlightSelectionPage. See home.js's hsContainer / app.js's
   renderHighlightSelection(). */
.highlight-selection {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hs-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hs-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-right: auto;
}

.btn.ghost.small {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
}

.hs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 2px;
}

.hs-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.5);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hs-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.hs-checkbox {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.hs-badge {
  font-size: 13px;
  flex-shrink: 0;
}

.hs-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.hs-hook {
  font-size: 12.5px;
  color: #e0c04a;
  font-style: italic;
}

.hs-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.hs-transcript {
  font-size: 11.5px;
  color: var(--muted);
  opacity: 0.75;
  line-height: 1.5;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding-left: 8px;
}

.hs-footer {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.hs-actions {
  display: flex;
  gap: 10px;
}

.cookies-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
}

.cookies-info { display: grid; gap: 4px; }

.cookies-file-input { display: none; }

.results-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.4);
}

.result-name { font-size: 13px; word-break: break-all; }

.result-size { font-size: 12px; color: var(--muted); margin-left: 8px; }

.results-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.retention-note { font-size: 12px; color: var(--muted); }

.entrance { animation: entrance 0.6s ease both; }

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

/* Login overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 36px 32px;
  animation: entrance 0.4s ease both;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.login-icon { width: 36px; height: 36px; border-radius: 8px; }

.login-title { font-size: 18px; font-weight: 700; }

.login-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 24px; }

.login-field { margin-bottom: 16px; }

.login-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.login-input { width: 100%; box-sizing: border-box; }

.login-error {
  font-size: 13px;
  color: #ff6b6b;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.login-btn { width: 100%; margin-top: 4px; height: 44px; font-size: 15px; }

/* Logout button */
.logout-btn { color: var(--muted); font-size: 13px; }

/* YouTube thumbnail preview */
.thumb-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  aspect-ratio: 16/9;
  background: rgba(10, 10, 10, 0.4);
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* API Setup modal */
.setup-badge {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 20px;
  transition: color 0.2s, border-color 0.2s;
}
.setup-badge--none { color: var(--muted); }
.setup-badge--ok { background: rgba(255,255,255,0.04); }

.setup-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
