:root {
  color-scheme: light dark;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #0b0d10;
  color: #e8ecf2;
  --surface: rgba(22, 28, 34, 0.9);
  --surface-hover: rgba(32, 38, 46, 0.95);
  --accent: #339dff;
  --accent-soft: rgba(51, 157, 255, 0.18);
  --danger: #ff5f5f;
  --border: rgba(255, 255, 255, 0.08);
  --muted: rgba(232, 236, 242, 0.66);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 10% 20%, rgba(51, 157, 255, 0.15), transparent 35%),
              radial-gradient(circle at 70% 10%, rgba(77, 255, 189, 0.12), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(244, 151, 255, 0.12), transparent 55%),
              #0b0d10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ============================================
   CONSOLIDATED HEADER - Single Navigation Bar
   ============================================ */

.app-header-consolidated {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 12px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 0;
  position: sticky;
  top: 20px;
  z-index: 100;
  backdrop-filter: blur(12px);
}

/* Left Section: Branding + Tabs */
.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  min-width: 0;
}

.header-branding {
  flex-shrink: 0;
}

.header-branding h1 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  background: linear-gradient(135deg, #f5f8fc 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: default;
}

/* Navigation Tabs */
.header-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  flex-shrink: 0;
}

.nav-tab {
  position: relative;
  padding: 8px 20px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #e8ecf2;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #0a1929;
  background: var(--accent);
  font-weight: 600;
}

.nav-tab.active:hover {
  background: #2b8ae6;
}

/* Right Section: Controls */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Search Toggle Switch */
.search-toggle-wrapper {
  display: flex;
  align-items: center;
}

.search-toggle-control {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.search-toggle-control:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
}

.search-toggle-control input[type="checkbox"] {
  display: none;
}

.search-toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

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

.search-toggle-control input[type="checkbox"]:checked + .search-toggle-slider {
  background: #22c55e;
  border-color: #22c55e;
}

.search-toggle-control input[type="checkbox"]:checked + .search-toggle-slider::before {
  transform: translateX(20px);
}

.search-toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.search-label-active {
  display: none;
  color: #22c55e;
  font-weight: 600;
}

.search-toggle-control input[type="checkbox"]:checked ~ .search-toggle-label .search-label-inactive {
  display: none;
}

.search-toggle-control input[type="checkbox"]:checked ~ .search-toggle-label .search-label-active {
  display: inline;
}

/* Header Icon Button */
.header-icon-btn {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #e8ecf2 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.header-icon-btn.settings-expanded {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--accent) !important;
  border-color: rgba(51, 157, 255, 0.3) !important;
}

.header-icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Modern Button System */
.btn-primary {
  background: var(--accent) !important;
  color: #0a1929 !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 12px 24px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
  text-transform: none !important;
}

.btn-primary:hover {
  background: #2b8ae6 !important;
  box-shadow: 0 2px 6px rgba(51, 157, 255, 0.25) !important;
}

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

.btn-primary.search-active {
  background: var(--danger) !important;
  color: white !important;
  box-shadow: 0 1px 3px rgba(255, 95, 95, 0.3) !important;
}

.btn-primary.search-active:hover {
  background: #ff4545 !important;
  box-shadow: 0 2px 6px rgba(255, 95, 95, 0.4) !important;
}

.btn-secondary {
  background: var(--surface-hover) !important;
  color: var(--muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  padding: 12px 20px !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-secondary:hover {
  background: var(--accent-soft) !important;
  color: #e8ecf2 !important;
  border-color: var(--accent) !important;
  transform: translateY(-1px) !important;
}

.btn-secondary:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.btn-icon-only {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 10px 16px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.btn-icon-only:hover {
  background: var(--surface-hover) !important;
  color: #e8ecf2 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.btn-icon-only.settings-expanded,
.header-icon-btn.settings-expanded {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--accent) !important;
  border-color: rgba(51, 157, 255, 0.3) !important;
}

.btn-text {
  font-weight: inherit;
  line-height: 1.4;
}

/* Legacy button support - for any remaining old buttons */
button:not([class*="btn-"]):not([class*="action-button"]):not([class*="toggle"]):not([class*="context-menu"]):not([class*="dismiss"]) {
  background: var(--accent);
  color: #0a1929;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

button:not([class*="btn-"]):not([class*="action-button"]):not([class*="toggle"]):not([class*="context-menu"]):not([class*="dismiss"]):hover {
  background: #2b8ae6;
}

main {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-height: 0;
}

/* Feed container spacing */
.feed, .bulk-analysis {
  padding: 24px;
  margin-top: 0;
}

/* Settings Section Headers */
.settings-section-header {
  margin: 32px 0 24px 0;
  padding: 0 4px;
}

.settings-section-header:first-child {
  margin-top: 0;
}

.section-title {
  margin: 0 0 4px 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #f5f8fc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-description {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Settings Cards */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 20px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.settings-card.collapsed .settings-card-content {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.settings-card:not(.collapsed) .settings-card-content {
  max-height: none;
  opacity: 1;
  transition: all 0.3s ease;
}

.settings-card.management-card {
  background: rgba(22, 28, 34, 0.7);
  border-color: rgba(255, 255, 255, 0.06);
}

.settings-card.management-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-card:hover {
  border-color: rgba(51, 157, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.settings-card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 17, 23, 0.4);
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: all 0.2s ease;
}

.settings-card-header:hover {
  background: rgba(12, 17, 23, 0.6);
}

.settings-card.collapsed .settings-card-header {
  border-bottom: none;
  padding-bottom: 20px;
}

.settings-card-header::after {
  content: '▼';
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.3s ease;
}

.settings-card.collapsed .settings-card-header::after {
  transform: translateY(-50%) rotate(-90deg);
}

/* Marketplace Header Toggle */
.marketplace-header-toggle {
  position: absolute;
  right: 60px;
  top: 20px;
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  user-select: none;
  z-index: 5;
}

.marketplace-header-toggle input[type="checkbox"] {
  display: none;
}

.marketplace-header-toggle .toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

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

.marketplace-header-toggle input[type="checkbox"]:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.marketplace-header-toggle input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.marketplace-header-toggle:hover .toggle-slider {
  border-color: rgba(255, 255, 255, 0.2);
}

.settings-card-title {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f5f8fc;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Integration Badge */
.integration-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(51, 157, 255, 0.15) 0%, rgba(51, 157, 255, 0.05) 100%);
  border: 1px solid rgba(51, 157, 255, 0.3);
  color: #339dff;
}

.integration-badge::before {
  content: "✓";
  font-size: 0.9rem;
  font-weight: 700;
}

.integration-badge.legacy {
  background: linear-gradient(135deg, rgba(255, 157, 51, 0.15) 0%, rgba(255, 157, 51, 0.05) 100%);
  border-color: rgba(255, 157, 51, 0.3);
  color: #ff9d33;
}

.integration-badge.legacy::before {
  content: "⚠";
}

.settings-card-description {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.settings-card-content {
  padding: 16px 20px;
}

.settings-group {
  margin-bottom: 12px;
}

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

/* Section Headers Inside Settings Groups - Minimized */
.settings-group h4 {
  margin: 0 0 8px 0;
  padding-bottom: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(232, 236, 242, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* COMPACT LAYOUT SYSTEM - Dense, Scannable Settings */

/* Compact form row - horizontal layout for multiple short fields */
.settings-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 16px;
  align-items: start;
}

/* 2-column layout - for pairs of fields */
.settings-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
  align-items: start;
}

/* 3-column layout - for trios of fields */
.settings-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
  align-items: start;
}

/* 4-column layout - for quads of fields */
.settings-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 16px;
  align-items: start;
}

/* Compact label - minimal vertical space */
.settings-label-compact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-label-compact .label-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: #e8ecf2;
}

.settings-label-compact .label-hint {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: normal;
  line-height: 1.3;
}

/* Inline checkboxes/toggles - arrange in rows */
.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}

/* Compact toggle switch - smaller for dense layouts */
.toggle-switch-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch-compact input[type="checkbox"] {
  display: none;
}

.toggle-switch-compact .toggle-slider {
  position: relative;
  width: 36px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.toggle-switch-compact .toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch-compact input[type="checkbox"]:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch-compact input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(16px);
}

.toggle-switch-compact .toggle-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #e8ecf2;
  white-space: nowrap;
}

/* Compact input sizing */
.input-tiny {
  max-width: 80px !important;
}

.input-xs {
  max-width: 120px !important;
}

/* Reduce padding on compact inputs */
.settings-input-compact {
  padding: 8px 12px !important;
  font-size: 0.85rem !important;
}

/* Compact checkbox group - wrap horizontally */
.checkbox-group-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

/* Field group with inline hint */
.field-with-hint {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-with-hint .inline-hint {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Reduced vertical spacing for compact sections */
.settings-group-compact {
  margin-bottom: 10px;
}

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

.settings-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e8ecf2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.label-hint {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.settings-input {
  width: 100%;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: rgba(17, 23, 31, 0.8);
  color: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

/* Input Field Width Classes */
.settings-input.input-small,
.settings-label.input-small .settings-input {
  max-width: 200px;
}

.settings-input.input-medium,
.settings-label.input-medium .settings-input {
  max-width: 400px;
}

.settings-input.input-large,
.settings-label.input-large .settings-input {
  max-width: 600px;
}

.settings-input.input-full,
.settings-label.input-full .settings-input {
  max-width: 100%;
}

.settings-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51, 157, 255, 0.1);
  background-color: rgba(17, 23, 31, 0.95);
}

/* Validation States */
.settings-input.invalid,
.config-input.invalid {
  border-color: var(--danger);
  background-color: rgba(255, 95, 95, 0.05);
}

.settings-input.invalid:focus,
.config-input.invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 95, 95, 0.1);
}

.validation-error {
  display: block;
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-weight: 500;
  animation: slideInError 0.2s ease-out;
}

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

.save-state-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  animation: fadeIn 0.2s ease-out;
}

.save-state-indicator.saved {
  color: #50c878;
  background-color: rgba(80, 200, 120, 0.1);
}

.save-state-indicator.unsaved {
  color: #ff9f43;
  background-color: rgba(255, 159, 67, 0.1);
}

.save-state-indicator.saving {
  color: var(--accent);
  background-color: rgba(51, 157, 255, 0.1);
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface);
}

/* Info Icon & Tooltip Styles */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(51, 157, 255, 0.15);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: help;
  margin-left: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.info-icon:hover {
  background: rgba(51, 157, 255, 0.25);
  transform: scale(1.1);
}

.info-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22, 28, 34, 0.98);
  color: #e8ecf2;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 300px;
  width: max-content;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.info-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(22, 28, 34, 0.98);
}

.info-icon:hover .info-tooltip,
.info-icon:focus .info-tooltip {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 12px);
}

/* Confirmation Modal Styles */
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.confirm-modal.active {
  opacity: 1;
  visibility: visible;
}

.confirm-modal-content {
  background: var(--surface);
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 95, 95, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.confirm-modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.confirm-modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 12px;
}

.confirm-modal-body {
  padding: 24px;
  color: var(--muted);
  line-height: 1.6;
}

.confirm-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 24px;
  border-top: 1px solid var(--border);
}

/* Settings Section Headers */
.settings-section-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.settings-section-header h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-section-description {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* When Made Multi-Select Styles */
.when-made-multiselect {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(17, 23, 31, 0.4);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.when-made-option {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: rgba(17, 23, 31, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.when-made-option:hover {
  border-color: var(--accent);
  background: rgba(17, 23, 31, 0.8);
  transform: translateY(-1px);
}

.when-made-option.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(51, 157, 255, 0.15) 0%, rgba(51, 157, 255, 0.08) 100%);
}

.when-made-option input[type="checkbox"] {
  margin: 0;
  margin-right: 0.6rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.when-made-option label {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
  margin: 0;
}

.when-made-option.selected label {
  color: var(--text-primary);
}

.time-input {
  max-width: 150px;
}

.scheduler-status {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.scheduler-timezone {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.scheduler-status.scheduler-active .scheduler-timezone {
  color: #28a745;
}

.scheduler-status.scheduler-inactive .scheduler-timezone {
  color: var(--muted);
}

/* Modern Toggle Switches */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

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

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e8ecf2;
}

/* Marketplace toggles layout */
.marketplace-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

/* Highlight inputs */
.highlight-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.highlight-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.highlight-indicator.green {
  background: #22c55e;
}

.highlight-indicator.red {
  background: #ef4444;
}

/* Settings actions */
.settings-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Actor configuration forms */
.actor-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-textarea {
  min-height: 96px;
  resize: vertical;
}

.option-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(17, 23, 31, 0.7);
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.2s ease;
}

.option-chip:hover {
  border-color: var(--accent);
}

.option-chip input {
  margin: 0;
}

.option-chip input:checked + span {
  color: var(--accent);
  font-weight: 600;
}

/* ============================================
   NOTIFICATION CHIPS
   ============================================ */

.notification-chips-container {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.notification-chips-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.notification-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  align-items: center;
}

.notification-chips:empty::after {
  content: 'Add search terms to enable notifications';
  color: rgba(232, 236, 242, 0.4);
  font-size: 0.8rem;
  font-style: italic;
}

.notification-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(17, 23, 31, 0.6);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  user-select: none;
}

.notification-chip:hover {
  border-color: var(--accent);
  background: rgba(17, 23, 31, 0.8);
}

.notification-chip-icon {
  display: none;
}

.notification-chip-text {
  color: #e8e8e8;
  font-weight: 500;
}

/* Active state - notifications enabled */
.notification-chip.active {
  background: rgba(51, 157, 255, 0.15);
  border-color: var(--accent);
}

.notification-chip.active .notification-chip-icon {
  color: var(--accent);
}

.notification-chip.active .notification-chip-text {
  color: var(--accent);
  font-weight: 600;
}

.notification-chip.active:hover {
  background: rgba(51, 157, 255, 0.25);
}

/* Inactive state - notifications disabled */
.notification-chip:not(.active) .notification-chip-icon {
  color: rgba(232, 236, 242, 0.4);
}

.notification-chip:not(.active) .notification-chip-text {
  color: rgba(232, 236, 242, 0.6);
}

.actor-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: start;
}

/* Special grid for price pairs - keeps them together */
.actor-config-grid.price-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 300px));
  max-width: 620px;
}

.actor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.actor-actions .action-button {
  flex: 0 0 auto;
}

/* Time inputs */
.time-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

/* Action buttons */
.action-button {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid var(--border) !important;
  padding: 10px 16px !important;
  border-radius: 8px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease !important;
  cursor: pointer;
  white-space: nowrap;
}

/* Save Filters Button - Primary Style */
.action-button.primary {
  background: var(--accent) !important;
  color: #0a1929 !important;
  border-color: var(--accent) !important;
  font-weight: 600 !important;
}

.action-button.primary:hover:not(:disabled) {
  background: #2b8ae6 !important;
  box-shadow: 0 2px 6px rgba(51, 157, 255, 0.25) !important;
  transform: translateY(-1px) !important;
}

.action-button.primary:disabled {
  opacity: 0.5 !important;
  cursor: default !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Save button loading state */
.action-button.primary.saving {
  opacity: 0.8 !important;
  pointer-events: none !important;
}

.action-button.primary.saving .button-text::after {
  content: '...';
  animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Unsaved indicator dot */
.unsaved-indicator {
  color: #ff6b6b;
  font-size: 1.2rem;
  line-height: 1;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Save status message */
.save-status-message {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 8px;
  text-align: center;
}

.save-status-message.success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.save-status-message.error {
  background: rgba(255, 95, 95, 0.15);
  color: #ff5f5f;
  border: 1px solid rgba(255, 95, 95, 0.3);
}

.save-status-message.saving {
  background: rgba(51, 157, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(51, 157, 255, 0.3);
}

/* Button icon spacing */
.button-icon {
  font-size: 1rem;
  line-height: 1;
}

.action-button:hover {
  background: var(--surface-hover) !important;
  color: #e8ecf2 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.action-button.danger {
  color: #ff5f5f !important;
  border-color: rgba(255, 95, 95, 0.3) !important;
}

.action-button.danger:hover {
  background: rgba(255, 95, 95, 0.1) !important;
  color: #ff3030 !important;
  border-color: rgba(255, 95, 95, 0.5) !important;
}

.action-button.secondary {
  background: transparent !important;
  color: var(--muted) !important;
}

/* Backup Actions Grid */
.backup-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.button-text {
  font-weight: inherit;
}

/* Highlighted text styles */
.highlight-green {
  background-color: rgba(34, 197, 94, 0.25);
  color: #22c55e;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 500;
}

.highlight-red {
  background-color: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 500;
}


/* Settings Panel */
.settings-panel {
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.settings-panel:not(.collapsed) {
  overflow: visible;
}

.settings-panel.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.settings-panel:not(.collapsed) {
  max-height: none;
  opacity: 1;
  margin-bottom: 8px;
}

/* Settings Panel Footer */
.settings-panel-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 24px;
  background: linear-gradient(to top, rgba(22, 28, 34, 0.98) 0%, rgba(22, 28, 34, 0.95) 100%);
  border-top: 2px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(16px);
  z-index: 10;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.settings-panel-footer:hover {
  background: linear-gradient(to top, rgba(32, 38, 46, 0.98) 0%, rgba(32, 38, 46, 0.95) 100%);
  border-top-color: var(--accent);
  box-shadow: 0 -8px 24px rgba(51, 157, 255, 0.15);
}

.settings-panel-footer:active {
  transform: scale(0.99);
}

.settings-footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 600px;
}

.footer-arrow {
  font-size: 14px;
  color: var(--accent);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.settings-panel-footer:hover .footer-arrow {
  opacity: 1;
  transform: translateY(-2px);
}

.footer-text {
  font-size: 1rem;
  font-weight: 600;
  color: #f5f8fc;
  letter-spacing: 0.3px;
}

@media (max-width: 768px) {
  .settings-panel-footer {
    padding: 16px 20px;
  }
  
  .settings-footer-content {
    gap: 12px;
  }
  
  .footer-arrow {
    font-size: 12px;
  }
  
  .footer-text {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .settings-panel-footer {
    padding: 14px 16px;
  }
  
  .settings-footer-content {
    gap: 10px;
  }
}

/* ============================================
   FEED STATUS BAR (Slim Bar Below Header)
   ============================================ */

.feed-status-bar {
  background: rgba(22, 28, 34, 0.6);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  margin-bottom: 0;
  backdrop-filter: blur(8px);
  position: sticky;
  top: calc(20px + 56px); /* below header */
  z-index: 99;
}

.feed-status-bar.error-state {
  border-bottom-color: rgba(255, 95, 95, 0.4);
  background: rgba(255, 95, 95, 0.08);
}

.status-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.status-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.status-message-text {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connection-status {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  cursor: help;
  white-space: nowrap;
}

.connection-status[data-status="connected"] {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.connection-status[data-status="connecting"],
.connection-status[data-status="reconnecting"] {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

.connection-status[data-status="disconnected"] {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.ai-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.ai-status-indicator.enabled {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.ai-status-indicator.disabled {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.ai-status-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.ai-status-text {
  line-height: 1;
  font-size: 0.8rem;
}

.status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  justify-content: flex-end;
}

.item-counter {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  padding: 4px 12px;
  background: var(--accent-soft);
  border-radius: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  order: 10; /* Keep item counter on the right */
}

.item-counter:hover {
  background: rgba(51, 157, 255, 0.25);
}

.status-action-btn {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(20px); /* Slide in from right */
  pointer-events: none;
  max-width: 0;
  overflow: hidden;
  padding-left: 0 !important;
  padding-right: 0 !important;
  order: 1; /* Buttons appear before item counter */
}

/* Show buttons on hover of status-actions container */
.status-actions:hover .status-action-btn,
.status-actions:focus-within .status-action-btn,
.status-action-btn:focus {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  max-width: 200px;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

.status-action-btn:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

.status-action-btn.clear-btn:hover {
  color: var(--danger) !important;
  border-color: var(--danger) !important;
}

/* Mobile touch support */
@media (hover: none) {
  .status-actions.show-actions .status-action-btn {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    max-width: 200px;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

.feed {
  display: grid;
  gap: 12px;
}

.feed.grid-view {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, border 0.18s ease, background 0.18s ease;
  position: relative;
  min-height: 140px;
}

.feed.grid-view .card {
  flex-direction: column;
  padding: 0; /* Remove padding to allow full-width image */
  gap: 0;
}

/* Grid view: full-width image at top */
.feed.grid-view .media-row {
  display: block; /* Override flex layout */
  margin: 0;
  padding: 0;
  border-radius: 16px 16px 0 0; /* Round top corners only */
  overflow: hidden;
}

.feed.grid-view .media-row .thumb-wrapper {
  width: 100%;
  height: 220px;
  border-radius: 0; /* No rounded corners, handled by media-row */
  display: block; /* Full-width block element */
  flex: none; /* Override flex properties */
}

/* Grid view: hide media-row price, show inline price */
.feed.grid-view .media-row .price {
  display: none;
}

/* Grid view: add padding back to card-body for content */
.feed.grid-view .card-body {
  padding: 16px;
  padding-bottom: 40px;
  gap: 12px;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(51, 157, 255, 0.45);
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 2px solid transparent;
  pointer-events: none;
  transition: opacity 0.2s ease;
  opacity: 0;
}

.card.is-new::after {
  border-color: rgba(77, 255, 189, 0.7);
  opacity: 1;
  animation: pulse 1.8s ease-in-out 3;
}


@keyframes pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.6; }
}

.thumb-wrapper {
  flex: 0 0 140px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(12, 17, 23, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Duplicate rule removed - see .feed.grid-view .media-row .thumb-wrapper above */

.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center; /* Ensure image is centered */
  cursor: pointer;
  display: block; /* Remove any inline spacing */
}

/* Image expansion overlay */
.image-expansion-overlay {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.image-expansion-overlay.visible {
  opacity: 1;
}

.image-expansion-overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}


.media-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-shrink: 0;
}

.media-row .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f5f8fc;
  white-space: nowrap;
  margin-top: 4px;
}

.title-link {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f5f8fc;
  text-decoration: none;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
}

.title-link:hover {
  color: var(--accent);
}

.title-link.is-disabled {
  pointer-events: none;
  color: rgba(245, 248, 252, 0.45);
  cursor: default;
}

/* Inline price elements - hidden by default (list view) */
.inline-price {
  display: none;
}

.price-title-separator {
  display: none;
}

.inline-title {
  display: inline;
}

/* Grid view: show inline price + title with bullet separator */
.feed.grid-view .inline-price {
  display: inline;
  font-size: 1.5rem;
  font-weight: 700;
  color: #f5f8fc;
  white-space: nowrap;
}

.feed.grid-view .price-title-separator {
  display: inline;
  color: rgba(232, 236, 242, 0.6);
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0 4px;
}

.feed.grid-view .inline-title {
  display: inline;
  font-size: 1.1rem;
  font-weight: 600;
}

.seller {
  font-size: 0.9rem;
  color: var(--muted);
  display: inline-block;
}

.seller.is-hidden {
  display: none;
}

.seller-name {
  transition: all 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}

.seller-name:hover {
  color: var(--accent);
  text-decoration: underline;
}

.marketplace-badge {
  color: var(--muted);
  font-weight: 400;
  cursor: default;
}

.timestamp {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.75rem;
  color: rgba(232, 236, 242, 0.5);
  font-weight: 400;
  pointer-events: none;
  z-index: 5;
}

/* Grid view: adjust timestamp for padded card-body */
.feed.grid-view .timestamp {
  bottom: 16px;
  right: 16px;
}

/* Summary wrapper and expansion */
.summary-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.summary {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(232, 236, 242, 0.8);
  line-height: 1.5;
  overflow: hidden;
  transition: max-height 0.3s ease;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.summary.truncated {
  max-height: 4.5em; /* ~3 lines based on line-height: 1.5 */
  position: relative;
}

.summary.truncated::after {
  content: '...';
  position: absolute;
  bottom: 0;
  right: 0;
  padding-left: 40px;
  background: linear-gradient(to right, transparent, rgba(22, 29, 38, 1) 50%);
}

.summary.expanded {
  max-height: none;
}

.summary.expanded::after {
  content: none;
}

.summary-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  color: rgba(232, 236, 242, 0.5);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.2s ease;
  font-weight: 400;
}

.summary-toggle:hover {
  color: rgba(232, 236, 242, 0.8);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 28px; /* Space for bottom-right timestamp */
  flex: 1;
  min-width: 0; /* Allow text to wrap properly */
}

.dismiss-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  z-index: 10;
}

.card:hover .dismiss-x {
  opacity: 1;
}

.dismiss-x:hover {
  background: rgba(255, 95, 95, 0.8);
  transform: none;
  box-shadow: none;
}

/* Enhanced Empty State */
.empty-state {
  text-align: center;
  padding: 60px 32px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--muted);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}


.empty-state p {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 8px;
  color: #e8ecf2;
}

.empty-state small {
  font-size: 0.88rem;
  opacity: 0.7;
  display: block;
  margin-top: 8px;
}

.subtle-text {
  color: var(--muted);
  font-size: 0.85rem;
}

.context-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 1000;
  min-width: 160px;
}

.context-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: #e8ecf2;
  text-align: left;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.context-menu-item:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.context-menu-item:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.context-menu-item:hover {
  background: var(--surface-hover);
  transform: none;
  box-shadow: none;
}

#block-seller-btn:hover {
  background: transparent !important;
  color: var(--danger) !important;
}

#save-seller-btn:hover {
  background: transparent !important;
  color: var(--accent) !important;
}

/* Mobile responsive - stack compact layouts on small screens */
@media (max-width: 768px) {
  .settings-row,
  .settings-row-2,
  .settings-row-3,
  .settings-row-4 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .toggle-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Allow full width on mobile for compact inputs */
  .input-tiny,
  .input-xs {
    max-width: 100% !important;
  }

  /* Stack 4-column price/sort/results layout on mobile */
  .settings-group-compact > div[style*="140px 140px 1fr 110px"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 480px) {
  /* Stack all fields vertically on very small screens */
  .settings-group-compact > div[style*="140px 140px 1fr 110px"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  /* Consolidated header responsive */
  .app-header-consolidated {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .header-left {
    flex: 1 1 100%;
    gap: 16px;
  }

  .header-branding h1 {
    font-size: 1.1rem;
  }

  .header-nav-tabs {
    flex: 1;
  }

  .nav-tab {
    padding: 6px 16px;
    font-size: 0.85rem;
  }

  .header-right {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .search-toggle-control {
    padding: 6px 10px;
  }

  .search-toggle-label {
    font-size: 0.85rem;
  }

  .search-toggle-slider {
    width: 40px;
    height: 22px;
  }

  .search-toggle-slider::before {
    width: 16px;
    height: 16px;
  }

  .search-toggle-control input[type="checkbox"]:checked + .search-toggle-slider::before {
    transform: translateX(18px);
  }

  .header-icon-btn {
    padding: 8px !important;
  }

  .header-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Status bar responsive */
  .feed-status-bar {
    padding: 8px 16px;
  }

  .status-bar-content {
    flex-wrap: wrap;
    gap: 12px;
  }

  .status-info {
    gap: 12px;
  }

  .status-message-text {
    font-size: 0.8rem;
  }

  .status-actions {
    gap: 6px;
  }

  .status-action-btn {
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
  }

  .item-counter {
    font-size: 0.8rem;
    padding: 3px 10px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
  }

  .btn-icon-only {
    min-width: 44px !important;
    height: 44px !important;
    padding: 10px !important;
  }

  .card {
    flex-direction: column;
    padding: 12px;
    gap: 12px;
  }

  .thumb-wrapper {
    width: 100%;
    height: 200px;
  }

  /* Mobile: adjust inline price sizing */
  .feed.grid-view .inline-price {
    font-size: 1.3rem;
  }
  
  .feed.grid-view .card-body {
    padding: 12px;
    padding-bottom: 36px;
  }
  
  .feed.grid-view .timestamp {
    bottom: 12px;
    right: 12px;
  }

  /* Status bar mobile adjustments */
  .status-content {
    flex-wrap: wrap;
  }

  .item-counter-wrapper {
    flex-wrap: nowrap;
  }

  .export-csv-btn,
  .clear-results-btn {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
  }

  /* Settings mobile adjustments */
  .settings-card-header {
    padding: 16px 20px 12px;
  }

  .settings-card-content {
    padding: 16px 20px;
  }

  .settings-card-title {
    font-size: 1rem;
  }

  /* Marketplace header toggle mobile adjustments */
  .marketplace-header-toggle {
    right: 50px;
    top: 16px;
  }

  .marketplace-header-toggle .toggle-slider {
    width: 40px;
    height: 22px;
  }

  .marketplace-header-toggle .toggle-slider::before {
    width: 16px;
    height: 16px;
  }

  .marketplace-header-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(18px);
  }

  .settings-card-header::after {
    right: 20px;
  }

  .highlight-inputs {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .time-inputs {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .marketplace-toggles {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .backup-actions-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .action-button {
    justify-content: center;
  }

  /* Section headers mobile adjustments */
  .settings-section-header {
    margin: 24px 0 16px 0;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .section-description {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .settings-card-header {
    padding: 12px 16px 8px;
  }

  .settings-card-content {
    padding: 12px 16px;
  }

  .settings-input {
    padding: 10px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    max-width: 100% !important; /* Full width on mobile */
  }
  
  /* Force all width classes to full width on mobile */
  .settings-input.input-small,
  .settings-input.input-medium,
  .settings-input.input-large,
  .settings-label.input-small .settings-input,
  .settings-label.input-medium .settings-input,
  .settings-label.input-large .settings-input {
    max-width: 100% !important;
  }

  /* Marketplace header toggle for small screens */
  .marketplace-header-toggle {
    right: 45px;
    top: 12px;
  }

  .marketplace-header-toggle .toggle-slider {
    width: 36px;
    height: 20px;
  }

  .marketplace-header-toggle .toggle-slider::before {
    width: 14px;
    height: 14px;
    top: 2px;
    left: 2px;
  }

  .marketplace-header-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(16px);
  }

  .settings-card-header::after {
    right: 16px;
  }

  .toggle-switch {
    gap: 10px;
  }

  .toggle-slider {
    width: 40px;
    height: 22px;
  }

  .toggle-slider::before {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
  }

  .toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(18px);
  }
}

/* Notification styles */
.notification-info {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.notification-info code {
  background: var(--bg-primary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85em;
}

.notification-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

.notification-status.loading {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
}

.notification-status.success {
  background: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.notification-status.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

/* Authentication Styles */
.auth-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 10% 20%, rgba(51, 157, 255, 0.15), transparent 35%),
              radial-gradient(circle at 70% 10%, rgba(77, 255, 189, 0.12), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(244, 151, 255, 0.12), transparent 55%),
              #0b0d10;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  margin: 0 0 8px 0;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f5f8fc 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e8ecf2;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: rgba(17, 23, 31, 0.8);
  color: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51, 157, 255, 0.1);
  background-color: rgba(17, 23, 31, 0.95);
}

.auth-input::placeholder {
  color: var(--muted);
}

.auth-button {
  background: var(--accent) !important;
  color: #071524 !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 14px 20px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(51, 157, 255, 0.25) !important;
  margin-top: 8px;
}

.auth-button:hover:not(:disabled) {
  background: #2b8ae6 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 16px rgba(51, 157, 255, 0.4) !important;
}

.auth-button:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: 0 2px 8px rgba(51, 157, 255, 0.15) !important;
}

.forgot-password-link {
  text-align: right;
  margin-top: -8px;
  margin-bottom: 8px;
}

.forgot-password-text {
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.forgot-password-text:hover {
  color: #2b8ae6;
  text-decoration: underline;
}

.auth-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  margin-top: 8px;
}

.auth-message.error {
  background: rgba(255, 95, 95, 0.1);
  color: #ff5f5f;
  border: 1px solid rgba(255, 95, 95, 0.3);
}

.auth-message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.auth-toggle {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.toggle-button {
  background: none !important;
  border: none !important;
  color: var(--muted) !important;
  font-size: 0.9rem !important;
  cursor: pointer !important;
  transition: color 0.2s ease !important;
  padding: 0 !important;
}

.toggle-button:hover {
  color: var(--accent) !important;
  transform: none !important;
  box-shadow: none !important;
}

.toggle-button strong {
  color: var(--accent);
  font-weight: 600;
}

/* User actions in header */
.user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Settings icon button */
.btn-icon-only svg {
  width: 20px;
  height: 20px;
}

/* User Menu Dropdown */
.user-menu-wrapper {
  position: relative;
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 6px 12px 6px 6px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.user-avatar-btn:hover {
  background: var(--surface-hover) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.user-avatar-btn.active {
  background: var(--surface-hover) !important;
  border-color: var(--accent) !important;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #4dffbd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #0a1929;
  flex-shrink: 0;
}

.dropdown-arrow {
  color: var(--muted);
  transition: transform 0.2s ease;
}

.user-avatar-btn.active .dropdown-arrow {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow: hidden;
  animation: dropdownSlide 0.2s ease-out;
}

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

.user-dropdown-header {
  padding: 16px;
  background: rgba(12, 17, 23, 0.4);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-email-display {
  font-size: 0.9rem;
  font-weight: 500;
  color: #f5f8fc;
  word-break: break-word;
}

.user-subscription-status {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.subscription-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.subscription-badge-inline.trial {
  background: rgba(51, 157, 255, 0.15);
  color: var(--accent);
}

.subscription-badge-inline.pro {
  background: linear-gradient(135deg, rgba(51, 157, 255, 0.2), rgba(77, 255, 189, 0.2));
  color: #4dffbd;
}

.subscription-badge-inline.enterprise {
  background: linear-gradient(135deg, rgba(244, 151, 255, 0.2), rgba(51, 157, 255, 0.2));
  color: #f497ff;
}

.subscription-badge-inline.free {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.subscription-badge-inline.admin {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.25), rgba(255, 159, 64, 0.25));
  color: #ff9f40;
  border: 1px solid rgba(255, 159, 64, 0.3);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(255, 159, 64, 0.3);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.user-dropdown-actions {
  padding: 8px;
}

.dropdown-action-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  color: #e8ecf2 !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  text-align: left;
}

.dropdown-action-item:hover {
  background: var(--surface-hover) !important;
}

.dropdown-action-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
}

.dropdown-action-item:hover svg {
  color: var(--accent);
}

/* Legacy user-email class - hide it */
.user-email {
  display: none;
}

/* Mobile adjustments for auth */
@media (max-width: 768px) {
  .auth-card {
    padding: 32px 24px;
    margin: 20px;
  }
  
  .auth-header h1 {
    font-size: 1.6rem;
  }
  
  .header-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .user-actions {
    gap: 8px;
  }

  .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .user-dropdown {
    min-width: 260px;
  }

  /* Settings icon adjustment */
  .btn-icon-only svg {
    width: 18px;
    height: 18px;
  }
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: currentColor;
  animation: spin 1s ease-in-out infinite;
}

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

/* AI Verdict Styles */
.ai-verdict-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: rgba(51, 157, 255, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(51, 157, 255, 0.15);
  margin: 8px 0;
}

.ai-verdict-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  flex-wrap: wrap;
}

.ai-verdict-badge.buy {
  color: #4ade80;
}

.ai-verdict-badge.review {
  color: #fbbf24;
}

.ai-verdict-badge.pass {
  color: #9ca3af;
}

.ai-verdict-icon {
  font-size: 16px;
  line-height: 1;
}

/* .ai-verdict-text - no styles needed, metrics wrap naturally */

.ai-verdict-score {
  font-size: 12px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-weight: 600;
}

.ai-verdict-metrics {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.ai-verdict-reason {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  display: none;
}

/* Loading Skeleton Styles */
@keyframes skeleton-pulse {
  0%, 100% {
    background-color: rgba(255, 255, 255, 0.05);
  }
  50% {
    background-color: rgba(255, 255, 255, 0.12);
  }
}

.loading-skeleton {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
  color: transparent !important;
  position: relative;
  overflow: hidden;
}

.loading-skeleton::placeholder {
  color: transparent !important;
}

/* Enhanced loading skeleton for textareas and inputs */
textarea.loading-skeleton,
input.loading-skeleton,
select.loading-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

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

/* Settings loading states */
.settings-loading {
  opacity: 0.6;
  pointer-events: none;
}

.settings-loading-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(51, 157, 255, 0.1);
  border: 1px solid rgba(51, 157, 255, 0.3);
  border-radius: 8px;
  font-size: 13px;
  color: var(--accent);
  animation: pulse-soft 2s ease-in-out infinite;
}

@keyframes pulse-soft {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

.settings-loading-indicator::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

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

