@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700;800&display=swap");

:root {
  --card: #f7f8f8;
  --ring: #1da1f2;
  --input: #f7f9fa;
  --muted: #e5e5e6;
  --accent: #e3ecf6;
  --border: #e1eaef;
  --radius: 1.3rem;
  --chart-1: #1e9df1;
  --chart-2: #00b87a;
  --chart-3: #f7b928;
  --chart-4: #17bf63;
  --chart-5: #e0245e;
  --popover: #ffffff;
  --primary: #1e9df1;
  --sidebar: #f7f8f8;
  --font-mono: Menlo, monospace;
  --font-sans: "Open Sans", sans-serif;
  --secondary: #0f1419;
  --background: #ffffff;
  --font-serif: Georgia, serif;
  --foreground: #0f1419;
  --destructive: #f4212e;
  --shadow-blur: 0px;
  --shadow-color: rgba(29, 161, 242, 0.15);
  --sidebar-ring: #1da1f2;
  --shadow-spread: 0px;
  --shadow-opacity: 0;
  --sidebar-accent: #e3ecf6;
  --sidebar-border: #e1e8ed;
  --card-foreground: #0f1419;
  --shadow-offset-x: 0px;
  --shadow-offset-y: 2px;
  --sidebar-primary: #1e9df1;
  --muted-foreground: #344552;
  --accent-foreground: #1e9df1;
  --popover-foreground: #0f1419;
  --primary-foreground: #ffffff;
  --sidebar-foreground: #0f1419;
  --secondary-foreground: #ffffff;
  --destructive-foreground: #ffffff;
  --sidebar-accent-foreground: #1e9df1;
  --sidebar-primary-foreground: #ffffff;
}

html[data-theme="dark"] {
  --card: #17181c;
  --ring: #1da1f2;
  --input: #22303c;
  --muted: #181818;
  --accent: #061622;
  --border: #242628;
  --chart-1: #1e9df1;
  --chart-2: #00b87a;
  --chart-3: #f7b928;
  --chart-4: #17bf63;
  --chart-5: #e0245e;
  --popover: #000000;
  --primary: #1c9cf0;
  --sidebar: #17181c;
  --secondary: #f0f3f4;
  --background: #000000;
  --foreground: #e7e9ea;
  --destructive: #f4212e;
  --shadow-color: rgba(29, 161, 242, 0.25);
  --sidebar-ring: #1da1f2;
  --sidebar-accent: #061622;
  --sidebar-border: #38444d;
  --card-foreground: #d9d9d9;
  --sidebar-primary: #1da1f2;
  --muted-foreground: #a8b0b7;
  --accent-foreground: #1c9cf0;
  --popover-foreground: #e7e9ea;
  --primary-foreground: #ffffff;
  --sidebar-foreground: #d9d9d9;
  --secondary-foreground: #0f1419;
  --destructive-foreground: #ffffff;
  --sidebar-accent-foreground: #1c9cf0;
  --sidebar-primary-foreground: #ffffff;
}

html {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  font-family: var(--font-sans) !important;
  color: var(--foreground) !important;
  background:
    radial-gradient(circle at 12% 10%, rgba(30, 157, 241, 0.12), transparent 20%),
    radial-gradient(circle at 88% 12%, rgba(0, 184, 122, 0.10), transparent 18%),
    linear-gradient(180deg, color-mix(in srgb, var(--background) 96%, var(--accent) 4%), var(--background)) !important;
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
  font-size: 16px !important;
  line-height: 1.45;
}

* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--primary) 38%, transparent) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--primary) 38%, transparent);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

a {
  color: var(--primary);
}

.shell,
.page,
.content,
.main {
  width: min(100%, 1720px) !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.content,
.page,
.main,
.shell {
  padding-left: clamp(16px, 2vw, 32px) !important;
  padding-right: clamp(16px, 2vw, 32px) !important;
}

.topbar {
  min-height: 74px !important;
  background: color-mix(in srgb, var(--background) 88%, transparent) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 90%, transparent) !important;
  box-shadow: 0 12px 32px rgba(15, 20, 25, 0.06) !important;
  backdrop-filter: blur(18px);
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 65%, #8fd5ff)) !important;
  border-radius: 1rem !important;
  box-shadow: 0 12px 24px rgba(29, 161, 242, 0.22);
}

.logo-text,
.page-title,
.panel-title,
.card-title,
.rh-title,
.section-title,
.plan-name,
.hero h1,
.hero-copy h1,
.org-name,
.source-card-name,
.author-name,
.point-title,
.feature h3,
.step-title {
  color: var(--foreground) !important;
  font-family: var(--font-sans) !important;
  letter-spacing: -0.02em;
}

.page-sub,
.panel-sub,
.card-sub,
.rh-sub,
.section-sub,
.metric-label,
.metric-note,
.point-text,
.feature p,
.plan-sub,
.plan-note,
.muted,
.review-count-lbl,
.upload-sub,
.empty-sub,
.table-empty-sub,
.src-org,
.org-url,
.review-date,
.chip-label,
.field-error,
.user-name,
.demo-head,
.stat-label {
  color: var(--muted-foreground) !important;
  opacity: 1 !important;
}

.hero-copy p,
.hero-copy .point-text,
.hero-copy .point-title,
.hero-copy .eyebrow,
.hero-copy .secondary-btn,
.hero-copy .ghost-btn,
.hero-card .card-title,
.hero-card .metric-label,
.hero-card .metric-note,
.settings-banner {
  opacity: 1 !important;
}

.left-panel,
.right-header,
.filter-bar,
.table-wrap,
.card,
.panel,
.plan-card,
.hero,
.hero-copy,
.hero-card,
.demo-table,
.metric-card,
.stat-card,
.main .card,
.sidebar-card {
  background: color-mix(in srgb, var(--card) 88%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent) !important;
  box-shadow: 0 22px 48px rgba(15, 20, 25, 0.06), 0 4px 16px rgba(29, 161, 242, 0.06) !important;
  border-radius: var(--radius) !important;
  backdrop-filter: blur(16px);
}

.left-panel {
  width: 360px !important;
}

.right-panel {
  min-width: 0;
}

.right-header {
  padding: 24px 28px !important;
}

.panel-title,
.card-title,
.rh-title,
.page-title,
.section-title {
  font-size: 1.15rem !important;
}

.page-sub,
.panel-sub,
.card-sub,
.rh-sub,
.section-sub,
.lead,
.point-text,
.feature p,
.plan-sub,
.plan-note,
.table-empty-sub,
.review-date,
.src-org,
.org-url,
.upload-sub {
  font-size: 0.96rem !important;
  line-height: 1.55 !important;
}

.nav-link,
.nav a,
.ghost-btn,
.secondary-btn,
.logout-btn,
.export-btn,
.refresh-btn,
.tab-btn,
.template-link,
.submit-btn,
.btn,
.src-btn,
.form-label,
.chip-label,
.user-name,
.sub-pill {
  font-size: 0.95rem !important;
}

.search-input,
.form-input,
.date-input,
.filter-select,
.plan-select,
.review-text,
.plan-item,
.author-name,
.source-card-name,
.org-name,
.step-text,
.plan-item,
.empty-text,
.table-empty-text,
.review-count,
.stat-lbl {
  font-size: 1rem !important;
}

.upload-title,
.sources-table td,
.sources-table th,
.sidebar-link,
.sidebar-link span {
  font-size: 1rem !important;
}

.form-label,
.section-label,
.review-count-lbl,
.page-sub,
.panel-sub,
.card-sub,
.org-url,
.upload-sub {
  opacity: 1 !important;
}

.table-head,
th,
.demo-head {
  font-size: 0.85rem !important;
}

.stats-row {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px !important;
}

.stat-card,
.metric-card,
.feature,
.point,
.source-card {
  background: color-mix(in srgb, var(--background) 92%, var(--accent) 8%) !important;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent) !important;
  border-radius: calc(var(--radius) - 0.2rem) !important;
}

.stat-num,
.metric-num,
.plan-price {
  font-family: var(--font-sans) !important;
  color: var(--foreground) !important;
  font-weight: 800 !important;
}

.stat-num,
.metric-num {
  font-size: clamp(1.9rem, 2vw, 2.6rem) !important;
}

.table-head,
th {
  background: color-mix(in srgb, var(--accent) 70%, var(--background)) !important;
  color: var(--muted-foreground) !important;
}

.sidebar-title {
  color: var(--muted-foreground) !important;
}

.sidebar-link {
  background: color-mix(in srgb, var(--background) 92%, var(--accent) 8%) !important;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent) !important;
  color: color-mix(in srgb, var(--foreground) 90%, var(--muted-foreground)) !important;
}

.sidebar-link:hover {
  background: color-mix(in srgb, var(--accent) 58%, var(--background)) !important;
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border)) !important;
  color: var(--foreground) !important;
}

.sidebar-link.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 24%, var(--background)), color-mix(in srgb, var(--accent) 80%, var(--background))) !important;
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border)) !important;
  color: var(--primary) !important;
}

.table-row:hover,
.demo-row:hover,
.sources-table tr:hover td {
  background: color-mix(in srgb, var(--accent) 45%, transparent) !important;
}

.table-row,
.demo-row,
.sources-table td,
.sources-table tr,
.table-row:nth-child(odd),
.table-row:nth-child(even) {
  background: transparent !important;
}

.table-body,
.table-wrap {
  min-height: 0;
}

.search-input,
.form-input,
.date-input,
.filter-select,
.plan-select {
  background: var(--input) !important;
  border: 1px solid var(--border) !important;
  border-radius: calc(var(--radius) - 0.55rem) !important;
  color: var(--foreground) !important;
  font-family: var(--font-sans) !important;
}

.search-input:focus,
.form-input:focus,
.date-input:focus,
.filter-select:focus,
.plan-select:focus {
  border-color: var(--ring) !important;
  box-shadow: 0 0 0 4px rgba(29, 161, 242, 0.16) !important;
}

.chip,
.ghost-btn,
.secondary-btn,
.logout-btn,
.export-btn,
.refresh-btn,
.btn-outline,
.btn-sm,
.btn-danger-sm,
.btn-blue-sm,
.btn-orange-sm,
.btn-google-sm {
  background: color-mix(in srgb, var(--background) 90%, var(--accent) 10%) !important;
  border: 1px solid var(--border) !important;
  color: var(--foreground) !important;
}

.chip.active,
.filter-select.active-filter,
.date-input.active-filter,
.nav-link.active,
.nav a.active,
.tab-btn.active,
.tab-btn.active.yandex-tab {
  background: color-mix(in srgb, var(--accent) 90%, var(--background)) !important;
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border)) !important;
  color: var(--accent-foreground) !important;
}

.nav-link,
.nav a,
.ghost-btn,
.secondary-btn,
.logout-btn,
.export-btn,
.refresh-btn,
.tab-btn,
.template-link,
.submit-btn,
.primary-btn,
.btn,
.src-btn {
  font-family: var(--font-sans) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.nav-link:hover,
.nav a:hover {
  background: color-mix(in srgb, var(--accent) 80%, transparent) !important;
  color: var(--primary) !important;
}

.settings-banner,
.template-link,
.review-toggle {
  color: var(--primary) !important;
  font-weight: 700 !important;
}

.settings-banner {
  background: linear-gradient(135deg, #eaf4ff, #f4fbff) !important;
  border: 1px solid #5ea9dd !important;
  color: #085c9a !important;
  box-shadow: 0 10px 22px rgba(30, 157, 241, 0.18) !important;
}

.settings-banner:hover {
  background: linear-gradient(135deg, #d2e9ff, #ebf6ff) !important;
  color: #064a7d !important;
}

.settings-banner svg {
  color: #0b69b3 !important;
  stroke: currentColor !important;
}

.primary-btn,
.submit-btn,
.btn-primary,
.scrape-all-btn,
.btn-green,
.btn-orange,
.btn-scrape,
.btn-scrape-yandex,
.btn-scrape-google {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 72%, #8bd4ff)) !important;
  color: var(--primary-foreground) !important;
  border: none !important;
  box-shadow: 0 14px 28px rgba(29, 161, 242, 0.22) !important;
}

.btn-green {
  background: linear-gradient(135deg, var(--chart-2), var(--chart-4)) !important;
}

.btn-orange,
.btn-scrape-yandex {
  background: linear-gradient(135deg, #ff884f, #ff5f2a) !important;
}

.btn-scrape-google {
  background: linear-gradient(135deg, #4285f4, #1e9df1) !important;
}

.primary-btn:hover,
.submit-btn:hover,
.btn-primary:hover,
.scrape-all-btn:hover,
.btn-green:hover,
.btn-orange:hover,
.btn-scrape:hover,
.btn-scrape-yandex:hover,
.btn-scrape-google:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.review-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--accent) 82%, var(--background)) !important;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border)) !important;
  box-shadow: none !important;
}

.review-toggle:hover {
  background: color-mix(in srgb, var(--accent) 96%, var(--background)) !important;
}

.review-text {
  color: color-mix(in srgb, var(--foreground) 92%, var(--background)) !important;
  line-height: 1.7 !important;
}

.hero-copy h1,
.hero h1 {
  color: #081018 !important;
  font-size: clamp(2rem, 2vw + 1rem, 3.2rem) !important;
  max-width: 14ch !important;
}

.hero-copy p,
.hero-copy .point-text,
.hero-card .metric-label,
.hero-card .metric-note,
.hero .section-sub,
.hero .card-sub {
  color: #314453 !important;
}

.hero-copy .eyebrow {
  background: #dceefe !important;
  color: #0a6fba !important;
  border: 1px solid #b4d6f0 !important;
}

.alert,
.flash,
.live-pill,
.status-badge,
.badge,
.sub-pill,
.rating-badge,
.step,
.plan-item,
.notice {
  border-radius: 999px !important;
}

.alert-success,
.status-ok,
.badge-active {
  background: color-mix(in srgb, var(--chart-2) 12%, var(--background)) !important;
  border-color: color-mix(in srgb, var(--chart-2) 24%, transparent) !important;
  color: var(--chart-2) !important;
}

.alert-error,
.status-error,
.badge-expired {
  background: color-mix(in srgb, var(--destructive) 10%, var(--background)) !important;
  border-color: color-mix(in srgb, var(--destructive) 24%, transparent) !important;
  color: var(--destructive) !important;
}

.alert-info,
.flash,
.badge-admin {
  background: color-mix(in srgb, var(--primary) 10%, var(--background)) !important;
  border-color: color-mix(in srgb, var(--primary) 24%, transparent) !important;
  color: var(--primary) !important;
}

.alert-warn,
.status-pending {
  background: color-mix(in srgb, var(--chart-3) 12%, var(--background)) !important;
  border-color: color-mix(in srgb, var(--chart-3) 24%, transparent) !important;
  color: #b87a00 !important;
}

.sub-pill {
  background: linear-gradient(135deg, #e9f4ff, #f6fbff) !important;
  border: 1px solid #8dbfe4 !important;
  color: #0d4f7a !important;
  box-shadow: 0 6px 16px rgba(30, 157, 241, 0.10) !important;
}

.sub-pill [data-local-datetime] {
  color: #083f63 !important;
  font-weight: 700 !important;
}

.rb-green {
  background: color-mix(in srgb, var(--chart-2) 14%, var(--background)) !important;
  color: var(--chart-2) !important;
}

.rb-yellow {
  background: color-mix(in srgb, var(--chart-3) 16%, var(--background)) !important;
  color: #b87a00 !important;
}

.rb-red {
  background: color-mix(in srgb, var(--destructive) 12%, var(--background)) !important;
  color: var(--destructive) !important;
}

.rb-gray {
  background: color-mix(in srgb, var(--muted) 80%, var(--background)) !important;
  color: var(--muted-foreground) !important;
}

.hero-copy,
.hero-card,
.plan-card,
.page .hero {
  position: relative;
  overflow: hidden;
}

.hero-copy::before,
.hero-card::before,
.plan-card::before,
.page .hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--chart-1), var(--chart-2), var(--chart-3));
}

.hero-copy h1,
.hero h1 {
  font-size: clamp(2.4rem, 3vw + 1rem, 4.4rem) !important;
  line-height: 0.96 !important;
  max-width: 12ch !important;
}

.page,
.content,
.main {
  animation: pageFade 0.45s ease;
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 88%, var(--accent) 12%);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 10%, rgba(30, 157, 241, 0.16), transparent 20%),
    radial-gradient(circle at 88% 12%, rgba(0, 184, 122, 0.10), transparent 18%),
    linear-gradient(180deg, #071018, #000000) !important;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .left-panel,
html[data-theme="dark"] .right-header,
html[data-theme="dark"] .filter-bar,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .hero,
html[data-theme="dark"] .hero-copy,
html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .demo-table,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .main .card,
html[data-theme="dark"] .source-card,
html[data-theme="dark"] .sidebar-card,
html[data-theme="dark"] .feature,
html[data-theme="dark"] .point {
  background: color-mix(in srgb, var(--card) 94%, #000000 6%) !important;
  border-color: color-mix(in srgb, var(--border) 95%, transparent) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), 0 4px 18px rgba(29, 161, 242, 0.10) !important;
}

html[data-theme="dark"] .table-head,
html[data-theme="dark"] th,
html[data-theme="dark"] .demo-head {
  background: #0e1720 !important;
}

html[data-theme="dark"] .table-row:hover,
html[data-theme="dark"] .demo-row:hover,
html[data-theme="dark"] .sources-table tr:hover td {
  background: rgba(29, 161, 242, 0.08) !important;
}

html[data-theme="dark"] .ghost-btn,
html[data-theme="dark"] .secondary-btn,
html[data-theme="dark"] .logout-btn,
html[data-theme="dark"] .export-btn,
html[data-theme="dark"] .refresh-btn,
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn-sm,
html[data-theme="dark"] .btn-danger-sm,
html[data-theme="dark"] .btn-blue-sm,
html[data-theme="dark"] .btn-orange-sm,
html[data-theme="dark"] .btn-google-sm,
html[data-theme="dark"] .chip {
  background: #111a22 !important;
  border-color: #273643 !important;
  color: var(--foreground) !important;
}

html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .nav a,
html[data-theme="dark"] .settings-banner,
html[data-theme="dark"] .template-link,
html[data-theme="dark"] .review-toggle {
  color: #7dccff !important;
}

html[data-theme="dark"] .settings-banner,
html[data-theme="dark"] .review-toggle {
  background: #0f1d29 !important;
  border-color: #29465b !important;
}

html[data-theme="dark"] .hero-copy h1,
html[data-theme="dark"] .hero h1,
html[data-theme="dark"] .hero-copy p,
html[data-theme="dark"] .hero-copy .point-text,
html[data-theme="dark"] .hero-card .metric-label,
html[data-theme="dark"] .hero-card .metric-note,
html[data-theme="dark"] .hero-copy .point-title {
  color: var(--foreground) !important;
}

html[data-theme="dark"] .hero-copy .eyebrow {
  background: #0f1d29 !important;
  border-color: #29465b !important;
  color: #7dccff !important;
}

html[data-theme="dark"] .settings-banner:hover,
html[data-theme="dark"] .review-toggle:hover,
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav a:hover {
  background: #152635 !important;
  color: #a8e2ff !important;
}

html[data-theme="dark"] .search-input,
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .date-input,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .plan-select {
  background: #111a22 !important;
  border-color: #2c3a46 !important;
}

html[data-theme="dark"] .sidebar-title,
html[data-theme="dark"] .page-sub,
html[data-theme="dark"] .panel-sub,
html[data-theme="dark"] .card-sub,
html[data-theme="dark"] .lead,
html[data-theme="dark"] .step-text,
html[data-theme="dark"] .step-text b,
html[data-theme="dark"] .step-text code,
html[data-theme="dark"] .review-count-lbl,
html[data-theme="dark"] .upload-sub,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .section-label,
html[data-theme="dark"] .sources-table th,
html[data-theme="dark"] .sources-table td,
html[data-theme="dark"] .org-url,
html[data-theme="dark"] .org-id-badge,
html[data-theme="dark"] .user-name {
  color: #b8c7d3 !important;
}

html[data-theme="dark"] .page-title,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .panel-title,
html[data-theme="dark"] .upload-title,
html[data-theme="dark"] .review-count,
html[data-theme="dark"] .step-title,
html[data-theme="dark"] .plan-item,
html[data-theme="dark"] .sidebar-link,
html[data-theme="dark"] .sidebar-link span,
html[data-theme="dark"] .review-text,
html[data-theme="dark"] .author-name,
html[data-theme="dark"] .source-card-name,
html[data-theme="dark"] .org-name {
  color: #f2f7fb !important;
}

html[data-theme="dark"] .sidebar-link {
  background: #0d1720 !important;
  border-color: #213444 !important;
}

html[data-theme="dark"] .sidebar-link:hover {
  background: #132230 !important;
  border-color: #31536d !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .sidebar-link.active {
  background: linear-gradient(135deg, #12324a, #102433) !important;
  border-color: #3d82ad !important;
  box-shadow: 0 16px 30px rgba(12, 40, 60, 0.42), 0 0 0 1px rgba(125, 204, 255, 0.08) inset !important;
}

html[data-theme="dark"] .sidebar-link.active,
html[data-theme="dark"] .sidebar-link.active span,
html[data-theme="dark"] .sidebar-link.active svg {
  color: #8ed5ff !important;
  stroke: currentColor !important;
}

html[data-theme="dark"] .sub-pill {
  background: #10202c !important;
  border-color: #29465b !important;
  color: #d6ecfb !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .sub-pill [data-local-datetime] {
  color: #ffffff !important;
}

html[data-theme="dark"] .upload-zone {
  background: #0d1720 !important;
  border-color: #233748 !important;
}

html[data-theme="dark"] .upload-zone:hover,
html[data-theme="dark"] .upload-zone.drag-over {
  background: #12212d !important;
  border-color: #3b6f91 !important;
}

html[data-theme="dark"] .step,
html[data-theme="dark"] .plan-item {
  background: #0d1720 !important;
  border-color: #233748 !important;
}

html[data-theme="dark"] .notice {
  background: #23120f !important;
  border-color: #6a392f !important;
  color: #ffcabd !important;
}

html[data-theme="dark"] .flash {
  background: #0f1d29 !important;
  border-color: #29465b !important;
  color: #9edcff !important;
}

html[data-theme="dark"] .template-link {
  color: #7dccff !important;
}

html[data-theme="dark"] .step-text code {
  background: #13202b !important;
}

html[data-theme="dark"] #collectionSearch {
  background: var(--input) !important;
  border-color: var(--border) !important;
  color: var(--foreground) !important;
}

.theme-toggle:hover {
  background: color-mix(in srgb, var(--accent) 70%, var(--background));
}

.theme-toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 22%, var(--border));
  flex-shrink: 0;
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  transition: transform 0.2s ease;
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(14px);
}

.theme-toggle-label {
  white-space: nowrap;
}

.topbar-right,
.nav-actions,
.user-box {
  gap: 12px !important;
}

@media (max-width: 1280px) {
  .stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .content {
    flex-direction: column !important;
  }

  .left-panel {
    width: 100% !important;
  }

  .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }

  .topbar {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    gap: 12px !important;
  }

  .topbar-right,
  .user-box,
  .topbar-left,
  .nav-actions {
    width: 100%;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
  }

  .logo-group {
    width: 100%;
  }

  .content,
  .page,
  .main,
  .shell {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .app-sidebar {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .sidebar-card {
    padding: 12px !important;
    border-radius: 18px !important;
  }

  .sidebar-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
  }

  .sidebar-link {
    min-height: 48px;
    justify-content: flex-start;
  }

  .right-header,
  .filter-bar,
  .table-wrap,
  .left-panel,
  .card,
  .panel,
  .hero,
  .hero-copy,
  .hero-card,
  .sidebar-card {
    border-radius: 18px !important;
  }

  .right-header,
  .filter-bar {
    padding: 16px !important;
  }

  .search-wrap,
  .search-input {
    width: 100% !important;
  }

  .source-badge,
  .sub-pill {
    max-width: 100%;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .hero-copy h1,
  .hero h1 {
    max-width: none !important;
    font-size: clamp(2rem, 9vw, 3.2rem) !important;
  }

  .theme-toggle {
    width: 100%;
    justify-content: center;
  }

  .sources-table,
  .sources-table thead,
  .sources-table tbody,
  .sources-table tr,
  .sources-table th,
  .sources-table td {
    display: block;
    width: 100%;
  }

  .sources-table thead {
    display: none;
  }

  .sources-table tr {
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    margin-bottom: 12px;
    padding: 10px;
    background: color-mix(in srgb, var(--card) 92%, transparent) !important;
  }

  .sources-table td {
    border: none !important;
    padding: 8px 6px !important;
  }
}
