/* Theme-safe merged patch: keeps previous modules and restores reliable light/dark behavior */
:root {
  --app-bg: #f1f5f9;
  --panel: rgba(255,255,255,.88);
  --panel-solid: #ffffff;
  --panel-muted: #f8fafc;
  --text-main: #0f172a;
  --text-soft: #475569;
  --border-soft: rgba(148,163,184,.28);
  --shadow-soft: 0 20px 45px rgba(15,23,42,.08);
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --accent: #f43f5e;
  --success: #10b981;
  --hero-gradient: linear-gradient(135deg, rgba(99,102,241,.18), rgba(244,63,94,.12) 50%, rgba(14,165,233,.16));
}

html.dark,
html[data-theme="dark"],
body.dark {
  --app-bg: #020617;
  --panel: rgba(15,23,42,.82);
  --panel-solid: #0f172a;
  --panel-muted: #111827;
  --text-main: #e2e8f0;
  --text-soft: #94a3b8;
  --border-soft: rgba(148,163,184,.16);
  --shadow-soft: 0 24px 56px rgba(2,6,23,.48);
  --hero-gradient: linear-gradient(135deg, rgba(79,70,229,.26), rgba(244,63,94,.14) 52%, rgba(14,165,233,.18));
}

html, body {
  min-height: 100%;
}

body {
  background: radial-gradient(circle at top, rgba(99,102,241,.08), transparent 30%), var(--app-bg) !important;
  color: var(--text-soft) !important;
  transition: background .25s ease, color .25s ease;
}

body.auth-page {
  background: linear-gradient(180deg, rgba(99,102,241,.08), rgba(15,23,42,0) 18%), var(--app-bg) !important;
}

.sidebar-surface {
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%) !important;
}

html.dark .sidebar-surface,
html[data-theme="dark"] .sidebar-surface,
body.dark .sidebar-surface {
  background: linear-gradient(180deg, #020617 0%, #0f172a 100%) !important;
}

.app-surface,
.bg-white,
main.bg-white {
  background: var(--panel-solid) !important;
}

.border-slate-200,
.border-slate-100 {
  border-color: var(--border-soft) !important;
}

.text-slate-800,
.text-slate-700,
.text-slate-900 {
  color: var(--text-main) !important;
}

.text-slate-600,
.text-slate-500,
.text-slate-400,
body p,
body li,
body small,
body label {
  color: var(--text-soft) !important;
}

.catalog-shell {
  background: transparent;
}

.glass-card,
.feature-card,
.info-card,
.category-card,
.metrics-card,
.hero-panel,
.content-panel,
.card,
.auth-panel,
.stat-panel,
.toolbar-panel,
.empty-panel,
.alert-panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  border-radius: 24px;
}

.hero-panel {
  background-image: var(--hero-gradient);
  position: relative;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(12px);
  opacity: .65;
}

.hero-orb.orb-a { width: 180px; height: 180px; background: rgba(99,102,241,.35); top: -60px; right: -30px; }
.hero-orb.orb-b { width: 140px; height: 140px; background: rgba(244,63,94,.24); bottom: -55px; left: -40px; }

.section-title,
.section-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:1.25rem;
}

.section-kicker {
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  padding:.45rem .8rem;
  border-radius:999px;
  background:rgba(99,102,241,.1);
  color:var(--brand);
  font-size:.78rem;
  font-weight:700;
  letter-spacing:.02em;
}

body.dark .section-kicker { background: rgba(129,140,248,.16); color:#c7d2fe; }

.feature-card,
.category-card,
.metrics-card,
.info-card,
.card,
.auth-panel,
.stat-panel,
.toolbar-panel,
.empty-panel,
.alert-panel {
  border-radius: 20px;
}

.channel-card,
.dashboard-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.channel-card:hover,
.dashboard-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99,102,241,.35) !important;
}

.channel-cover,
.dashboard-card-cover {
  height: 220px;
  width: 100%;
  object-fit: cover;
  display:block;
}

.channel-overlay {
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, transparent 35%, rgba(15,23,42,.72) 100%);
  pointer-events:none;
}

.channel-topbadges {
  position:absolute;
  top:14px;
  left:14px;
  right:14px;
  display:flex;
  justify-content:space-between;
  gap:.5rem;
  z-index:2;
}

.channel-badge,
.status-badge {
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.45rem .75rem;
  border-radius:999px;
  font-size:.75rem;
  font-weight:700;
  background:rgba(255,255,255,.92);
  color:#0f172a;
}

.status-badge.is-muted { background: var(--panel-muted); color: var(--text-main); border:1px solid var(--border-soft); }
.status-badge.is-success { background: rgba(16,185,129,.12); color: #047857; }
.status-badge.is-warning { background: rgba(244,63,94,.12); color: #be123c; }
.status-badge.is-info { background: rgba(99,102,241,.12); color: #4338ca; }

body.dark .channel-badge,
html.dark .status-badge,
html[data-theme="dark"] .status-badge,
body.dark .status-badge {
  background: rgba(15,23,42,.88);
  color:#e2e8f0;
  border:1px solid rgba(148,163,184,.18);
}

.channel-content,
.dashboard-card-content {
  padding: 1.1rem 1.1rem 1.2rem;
}

.channel-title,
.dashboard-card-title {
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text-main);
}

.channel-description,
.dashboard-card-description {
  margin-top:.65rem;
  min-height: 4.4em;
  color: var(--text-soft);
  font-size:.92rem;
}

.channel-meta,
.dashboard-card-meta {
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
  margin-top:1rem;
}

.meta-pill {
  display:inline-flex;
  align-items:center;
  gap:.42rem;
  padding:.55rem .78rem;
  border-radius:999px;
  background: var(--panel-muted);
  color: var(--text-main);
  font-size:.82rem;
  border:1px solid var(--border-soft);
}

.channel-cta,
.dashboard-card-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: .7rem;
  margin-top: 1rem;
}

.btn,
button.btn,
a.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.55rem;
  border-radius: 14px;
  font-weight: 700;
  min-height: 46px;
  padding: .72rem 1.05rem;
}

.btn-premium {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color:#fff !important;
  border:none !important;
  box-shadow: 0 14px 28px rgba(99,102,241,.24);
}

.btn-soft {
  background: var(--panel-muted) !important;
  color: var(--text-main) !important;
  border:1px solid var(--border-soft) !important;
}

.btn-accent { background: linear-gradient(135deg, #f43f5e, #fb7185) !important; color:#fff !important; border:none !important; }
.btn-success { background: linear-gradient(135deg, #10b981, #34d399) !important; color:#fff !important; border:none !important; }

.btn-icon-toggle,
.theme-toggle {
  display:inline-flex;
  align-items:center;
  gap:.6rem;
  padding:.72rem 1rem;
  border-radius:14px;
  border:1px solid var(--border-soft);
  background: var(--panel);
  color:var(--text-main);
  box-shadow: var(--shadow-soft);
}

.search-shell { padding:1rem; border-radius:20px; }
.search-shell .form-input,
.form-input,
textarea.form-input,
select.form-input {
  min-height: 54px;
  border-radius: 16px;
  background: var(--panel-solid);
  color: var(--text-main);
  width: 100%;
  border: 1px solid var(--border-soft) !important;
  box-shadow: none !important;
}

textarea.form-input {
  min-height: 140px;
  padding-top: .95rem;
}

.search-shell .form-input::placeholder,
.form-input::placeholder { color: var(--text-soft); }

.category-card {
  padding: 1.15rem;
  transition: transform .2s ease, border-color .2s ease;
}

.category-card:hover { transform: translateY(-4px); border-color: rgba(99,102,241,.35); }
.category-card .category-link { color: var(--text-main); font-weight: 700; }
.category-card .category-link:hover { color: var(--brand); }
.category-card .category-footer { margin-top: .9rem; display:flex; justify-content:space-between; align-items:center; gap: .75rem; color: var(--text-soft); font-size:.84rem; }

.article-copy { line-height: 1.8; }
.article-copy p { margin-bottom: .9rem; }
.theme-ready * { transition: background-color .25s ease, border-color .25s ease, color .2s ease; }

.page-frame {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .95rem;
  flex-wrap: wrap;
}

.header-actions .btn {
  margin-left: 0;
}

.header-brand-note {
  max-width: 40ch;
}

.home-stack,
.content-section {
  display: grid;
  gap: 2rem;
}

.home-section {
  display: grid;
  gap: 1.25rem;
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .8fr);
  gap: 1.5rem;
  align-items: center;
}

.home-title {
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.08;
  font-weight: 800;
  margin: 1rem 0;
  max-width: 14ch;
}

.home-lead {
  max-width: 60ch;
  font-size: 1.05rem;
  line-height: 1.8;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 1.5rem;
}

.home-hero-side { display: grid; gap: 1rem; }
.home-search { padding: 1rem; }

.home-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .85rem;
  align-items: center;
}

.home-search-inputwrap { position: relative; }
.home-search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); z-index: 2; }
.home-search-input { width: 100%; padding-left: 2.9rem !important; padding-right: 1rem !important; }
.home-search-btn { min-height: 54px; border-radius: 16px !important; white-space: nowrap; }

.home-top-grid,
.home-categories-grid,
.form-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

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

#sidebar { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.35) transparent; }
#sidebar::-webkit-scrollbar { width: 8px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border-radius: 999px; }

.channel-cover-link,
.channel-title-link { display: block; }
.channel-title-link { color: inherit; }
.channel-title-link:hover,
.channel-card:hover .channel-title-link { color: var(--brand); }
.channel-btn-secondary,
.channel-btn-main { width: 100%; text-align: center; }

.breadcrumbs {
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
  align-items:center;
  margin-bottom:1.5rem;
}

.breadcrumbs a { color: var(--text-soft); }
.breadcrumbs a:hover { color: var(--brand); }

.section-note {
  max-width: 42ch;
  line-height: 1.65;
  margin: 0;
}

.auth-layout-brand {
  display:flex;
  align-items:center;
  gap:.75rem;
  color: var(--text-main) !important;
}

.auth-layout-brand span {
  font-size: 1.09375rem;
  white-space: nowrap;
  font-weight: 800;
  text-transform: uppercase;
  color: inherit !important;
}

.auth-shell__intro { margin-bottom: 1.5rem; }
.auth-shell__subtitle { line-height: 1.75; margin-top: .7rem; }
.auth-panel { padding: 1.75rem; }
.auth-help-list { display:grid; gap:.75rem; margin-top:1.25rem; }
.auth-help-item { display:flex; gap:.8rem; align-items:flex-start; }
.auth-help-dot { width: 2rem; height: 2rem; border-radius: 999px; display:inline-flex; align-items:center; justify-content:center; background: rgba(99,102,241,.1); color: var(--brand); font-weight: 700; flex-shrink: 0; }

.auth-visual-copy {
  position: absolute;
  left: 2rem;
  right: 2rem;
  bottom: 2rem;
  z-index: 2;
  padding: 1.5rem;
  border-radius: 24px;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(10px);
  color: #fff;
}

.auth-visual-copy p,
.auth-visual-copy h2,
.auth-visual-copy li { color: #fff !important; }

.dashboard-toolbar {
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:flex-start;
  gap:1rem;
}

.dashboard-card-cover-wrap { position: relative; }
.dashboard-card-cover-wrap::after {
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(15,23,42,0) 20%, rgba(15,23,42,.25) 100%);
}

.dashboard-empty {
  padding: 2rem;
  text-align: center;
}

.dashboard-links { display:flex; flex-wrap:wrap; gap:.75rem; }

body.dark .app-surface,
body.dark .page-frame,
body.dark main.grow,
body.dark .grow { background: transparent !important; }

body.dark .channel-card,
body.dark .feature-card,
body.dark .category-card,
body.dark .info-card,
body.dark .metrics-card,
body.dark .content-panel,
body.dark .glass-card,
body.dark .hero-panel,
body.dark .card,
body.dark .auth-panel,
body.dark .stat-panel,
body.dark .toolbar-panel,
body.dark .empty-panel,
html.dark .alert-panel,
html[data-theme="dark"] .alert-panel,
body.dark .alert-panel {
  background-color: rgba(9, 20, 43, 0.92);
}

body.dark .content-panel,
body.dark .article-copy,
body.dark .article-copy p,
body.dark .article-copy li,
body.dark .article-copy h1,
body.dark .article-copy h2,
body.dark .article-copy h3,
html.dark .article-copy h4,
html[data-theme="dark"] .article-copy h4,
body.dark .article-copy h4 {
  color: var(--text-main) !important;
}

body.dark .content-panel p,
body.dark .content-panel span,
body.dark .content-panel li,
body.dark .content-panel .text-slate-600,
body.dark .content-panel .text-slate-500,
body.dark .section-note,
body.dark .auth-shell__subtitle,
html.dark .dashboard-card-description,
html[data-theme="dark"] .dashboard-card-description,
body.dark .dashboard-card-description {
  color: var(--text-soft) !important;
}

body.dark .home-title,
body.dark .channel-title,
body.dark .category-link,
body.dark .section-title h2,
body.dark .content-panel h1,
body.dark .content-panel h2,
body.dark .content-panel h3,
body.dark .dashboard-card-title,
body.dark .auth-layout-brand,
html.dark .auth-layout-brand span,
html[data-theme="dark"] .auth-layout-brand span,
body.dark .auth-layout-brand span {
  color: #f8fafc !important;
}

body.dark .home-lead,
body.dark .channel-description,
body.dark .category-card p,
body.dark .metrics-card .text-sm,
body.dark .feature-card p,
html.dark .header-brand-note,
html[data-theme="dark"] .header-brand-note,
body.dark .header-brand-note {
  color: #cbd5e1 !important;
}

body.dark .meta-pill,
body.dark .search-shell .form-input,
body.dark .btn-soft,
body.dark .btn-icon-toggle,
body.dark .theme-toggle,
html.dark .form-input,
html[data-theme="dark"] .form-input,
body.dark .form-input {
  background: rgba(15, 23, 42, 0.82) !important;
  color: #e2e8f0 !important;
}

body.dark .section-title .btn-accent,
body.dark .btn-premium,
body.dark .btn-accent,
html.dark .btn-success,
html[data-theme="dark"] .btn-success,
body.dark .btn-success {
  color: #fff !important;
}

body.dark .category-footer a,
body.dark a.text-indigo-500,
html.dark .breadcrumbs a:hover,
html[data-theme="dark"] .breadcrumbs a:hover,
body.dark .breadcrumbs a:hover {
  color: #c7d2fe !important;
}

@media (max-width: 1279px) {
  .home-hero-grid { grid-template-columns: 1fr; }
  .home-title { max-width: none; }
}

@media (max-width: 1100px) {
  .home-top-grid,
  .home-categories-grid,
  .form-grid,
  .stats-grid,
  .form-grid--2,
  .stats-grid.stats-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .hero-panel,
  .card,
  .content-panel,
  .auth-panel { border-radius: 20px; }
  .channel-cover,
  .dashboard-card-cover { height: 200px; }
  .page-frame { max-width: 100%; }
  .home-stack,
  .content-section { gap: 1.25rem; }
  .home-search-form,
  .home-top-grid,
  .home-categories-grid,
  .form-grid,
  .stats-grid,
  .form-grid--2,
  .stats-grid.stats-grid--2 { grid-template-columns: 1fr; }
  .home-search-btn { width: 100%; }
  .section-title,
  .section-head,
  .dashboard-toolbar { flex-direction: column; align-items: flex-start; }
  .home-title { font-size: 2rem; }
  .header-actions { gap: .55rem; }
  .btn-icon-toggle,
  .theme-toggle { padding: .72rem .85rem; }
  .auth-visual-copy { left: 1rem; right: 1rem; bottom: 1rem; padding: 1rem; }
}


body.no-sidebar-layout {
  min-height: 100vh;
}

.site-topbar {
  background: rgba(255,255,255,.88);
  box-shadow: 0 12px 30px rgba(15,23,42,.05);
}

html.dark .site-topbar,
html[data-theme="dark"] .site-topbar,
body.dark .site-topbar {
  background: rgba(2,6,23,.86);
  border-color: rgba(148,163,184,.12) !important;
  box-shadow: 0 16px 34px rgba(2,6,23,.34);
}

.site-topbar__inner,
.site-topbar__subline {
  max-width: 1480px;
  margin: 0 auto;
}

.site-topbar__inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-topbar__subline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .85rem;
  padding-bottom: .95rem;
  border-top: 1px solid var(--border-soft);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
}

.site-brand__icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 28px rgba(99,102,241,.24);
  font-size: 1.1rem;
}

.site-brand__copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-brand__label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--text-soft);
}

.site-brand__name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  gap: .55rem;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .72rem 1rem;
  border-radius: 14px;
  color: var(--text-main);
  font-size: .95rem;
  font-weight: 700;
  transition: .2s ease;
}

.site-nav a:hover {
  background: var(--panel-muted);
  color: var(--brand);
}

.page-frame {
  max-width: 1480px;
  margin: 0 auto;
}

body.dark,
body.dark .catalog-shell,
body.dark .page-frame,
body.dark main,
html.dark .bg-slate-100,
html[data-theme="dark"] .bg-slate-100,
body.dark .bg-slate-100 {
  background-color: var(--app-bg) !important;
}

body.dark .app-surface,
body.dark main.bg-white,
body.dark .site-topbar,
html.dark .page-frame,
html[data-theme="dark"] .page-frame,
body.dark .page-frame {
  color: var(--text-soft);
}

body.dark .btn-icon-toggle,
html.dark .theme-toggle,
html[data-theme="dark"] .theme-toggle,
body.dark .theme-toggle {
  background: rgba(15,23,42,.88);
}

@media (max-width: 1024px) {
  .site-topbar__inner,
  .site-topbar__subline {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-nav a,
  .btn,
  button.btn,
  a.btn,
  .btn-icon-toggle {
    width: 100%;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .header-brand-note {
    display: none;
  }
}


.channel-card {
  display: flex;
  flex-direction: column;
}

.channel-content {
  display: flex;
  flex-direction: column;
  gap: .95rem;
  height: 100%;
}

.channel-content__top {
  display: grid;
  gap: .6rem;
}

.channel-cover {
  height: 205px;
}

.channel-description {
  min-height: 3.9em;
  line-height: 1.62;
}

.meta-pill--accent {
  background: rgba(99,102,241,.12);
  color: #4338ca;
}

.meta-pill--type {
  background: rgba(14,165,233,.1);
  color: #075985;
}

html.dark .meta-pill--accent,
html[data-theme="dark"] .meta-pill--accent,
body.dark .meta-pill--accent {
  background: rgba(129,140,248,.16);
  color: #c7d2fe;
}

html.dark .meta-pill--type,
html[data-theme="dark"] .meta-pill--type,
body.dark .meta-pill--type {
  background: rgba(56,189,248,.14);
  color: #bae6fd;
}

.channel-cta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  margin-top: auto;
}

.channel-cta .btn {
  min-height: 48px;
}

.project-hero__grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.project-hero__media {
  display: flex;
  justify-content: center;
}

.project-hero__image {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(15,23,42,.18);
}

.project-hero__content {
  display: grid;
  gap: 1rem;
}

.project-hero__kickers {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.project-hero__lead {
  font-size: 1rem;
  line-height: 1.85;
  margin: 0;
}

.project-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
}

.project-description {
  word-break: break-word;
}

.project-sidebar {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

.project-sidebar__card,
.project-sidebar__related .channel-card {
  position: sticky;
  top: 120px;
}

.project-sidebar__related + .project-sidebar__related .channel-card {
  top: 150px;
}

.category-hero,
.category-section-title,
.catalog-pagination-wrap {
  width: 100%;
}

.site-topbar__brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 46px;
  padding: .72rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--text-main);
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.site-menu-toggle__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.site-mobile-panel {
  display: none;
  padding-bottom: 1rem;
}

.site-mobile-panel__card {
  padding: 1rem;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.site-nav--mobile,
.header-actions--mobile {
  display: none;
}

@media (max-width: 1279px) {
  .project-sidebar__card,
  .project-sidebar__related .channel-card,
  .project-sidebar__related + .project-sidebar__related .channel-card {
    position: static;
  }
}

@media (max-width: 900px) {
  .project-hero__grid {
    grid-template-columns: 1fr;
  }

  .project-hero__media {
    justify-content: flex-start;
  }

  .project-hero__image {
    max-width: 180px;
  }
}

@media (max-width: 768px) {
  .channel-cover {
    height: 190px;
  }

  .channel-cta {
    grid-template-columns: 1fr;
  }

  .project-hero__actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .site-nav--desktop,
  .header-actions--desktop {
    display: none;
  }

  .site-menu-toggle,
  .site-mobile-panel,
  .site-nav--mobile,
  .header-actions--mobile {
    display: flex;
  }

  .site-mobile-panel[data-mobile-menu][hidden] {
    display: none !important;
  }

  .site-mobile-panel {
    flex-direction: column;
    width: 100%;
  }

  .site-mobile-panel__card,
  .site-nav--mobile,
  .header-actions--mobile {
    width: 100%;
  }

  .site-nav--mobile,
  .header-actions--mobile {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
  }

  .site-nav--mobile a,
  .header-actions--mobile .btn,
  .header-actions--mobile .btn-icon-toggle {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .page-frame {
    padding-top: 1.2rem !important;
    padding-bottom: 1.5rem !important;
  }

  .content-panel,
  .info-card,
  .hero-panel,
  .channel-card,
  .site-mobile-panel__card {
    border-radius: 18px;
  }

  .site-topbar__inner {
    min-height: auto;
  }

  .site-topbar__brandrow {
    width: 100%;
  }

  .site-brand__name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-topbar__subline {
    padding-top: .7rem;
    padding-bottom: .8rem;
  }

  .breadcrumbs {
    gap: .45rem;
    margin-bottom: 1rem;
  }

  .breadcrumbs li {
    font-size: .82rem;
  }

  .project-hero__image {
    max-width: 140px;
    border-radius: 22px;
  }

  .project-hero__kickers,
  .channel-meta {
    gap: .5rem;
  }

  .meta-pill,
  .channel-badge,
  .status-badge {
    font-size: .76rem;
    padding: .48rem .72rem;
  }

  .channel-content {
    padding: 1rem;
  }
}

/* Add project rebuild */
.form-helper {
  margin-top: .55rem;
  font-size: .86rem;
  line-height: 1.65;
  color: var(--text-soft);
}

.form-helper span {
  color: var(--text-main) !important;
  font-weight: 600;
}

.add-project-layout {
  align-items: start;
}

.add-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.category-price-note,
.my-cards-results-note,
.preview-note {
  margin-top: .9rem;
  padding: .9rem 1rem;
  border-radius: 16px;
  background: var(--panel-muted);
  border: 1px solid var(--border-soft);
  color: var(--text-soft);
  line-height: 1.65;
}

.image-preview-box {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px dashed var(--border-soft);
  background: var(--panel-muted);
  min-height: 100%;
}

.image-preview-box__media {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: var(--panel);
  border: 1px solid var(--border-soft);
}

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

.image-preview-box__title,
.description-counter {
  color: var(--text-main);
  font-weight: 700;
}

.image-preview-box__text {
  margin: .3rem 0 0;
  line-height: 1.65;
}

.add-checklist {
  display: grid;
  gap: .75rem;
}

.add-checklist__item {
  position: relative;
  padding-left: 1.6rem;
  line-height: 1.7;
}

.add-checklist__item::before {
  content: '•';
  position: absolute;
  left: .3rem;
  top: 0;
  color: var(--brand);
  font-weight: 800;
}

.add-submit-row {
  align-items: center;
}

.preview-card__coverwrap {
  min-height: 220px;
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(244,63,94,.1));
}

.preview-card__cover {
  object-fit: cover;
}

.preview-card__desc {
  min-height: 5.2em;
}

/* My cards rebuild */
.my-cards-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.my-cards-search-wrap {
  flex: 1 1 320px;
}

.my-cards-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.my-cards-filter-group .btn.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.my-card-actions__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}

[data-my-card][hidden] {
  display: none !important;
}

@media (max-width: 1024px) {
  .my-cards-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .image-preview-box,
  .my-card-actions__row {
    grid-template-columns: 1fr;
  }

  .add-project-actions,
  .my-cards-filter-group {
    width: 100%;
  }

  .add-project-actions .btn,
  .my-cards-filter-group .btn {
    width: 100%;
  }
}


/* === MERGED: promotion page styles === */
.promotion-hero{position:relative;overflow:hidden;}
.promotion-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;}
.promotion-metric-card,.promotion-summary,.promotion-warning,.promotion-type-item,.promotion-active-item{border:1px solid rgba(148,163,184,.22);border-radius:20px;background:rgba(255,255,255,.75);padding:1rem 1.1rem;}
.promotion-metric-card__label{font-size:.85rem;color:#64748b;margin-bottom:.35rem;}
.promotion-metric-card__value{font-size:1.75rem;font-weight:700;color:#0f172a;line-height:1.1;}
.promotion-metric-card__note,.promotion-active-item__meta,.promotion-type-item span{font-size:.92rem;color:#64748b;}
.form-helper{font-size:.92rem;color:#64748b;line-height:1.55;}
.promotion-summary{font-weight:600;color:#0f172a;background:rgba(99,102,241,.08);}
.promotion-warning{background:rgba(245,158,11,.12);color:#92400e;}
.promotion-types{display:grid;gap:.75rem;}
.promotion-type-item{display:flex;flex-direction:column;gap:.2rem;}
.promotion-active-list{display:grid;gap:1rem;}
.promotion-active-item{display:flex;justify-content:space-between;gap:1rem;align-items:center;}
.promotion-active-item__title{font-weight:700;color:#0f172a;margin-bottom:.2rem;}
.dark .promotion-metric-card,.dark .promotion-summary,.dark .promotion-warning,.dark .promotion-type-item,.dark .promotion-active-item{background:rgba(15,23,42,.78);border-color:rgba(148,163,184,.18);}
.dark .promotion-metric-card__value,.dark .promotion-active-item__title,.dark .promotion-summary{color:#e2e8f0;}
.dark .promotion-metric-card__label,.dark .promotion-metric-card__note,.dark .promotion-active-item__meta,.dark .promotion-type-item span,.dark .form-helper{color:#94a3b8;}
.dark .promotion-warning{color:#fcd34d;background:rgba(245,158,11,.14);}
@media (max-width: 1024px){.promotion-metrics{grid-template-columns:1fr;}}
@media (max-width: 640px){.promotion-active-item{flex-direction:column;align-items:stretch;}}

/* === MERGED: project card extra styles === */
.project-fact-card,
.project-step-card,
.project-promo-card {
  border:1px solid var(--border-soft);
  background:var(--panel-muted);
  border-radius:20px;
}

.project-fact-card {
  display:flex;
  align-items:center;
  gap:1rem;
  padding:1rem 1.05rem;
}

.project-fact-card__icon {
  width:52px;
  height:52px;
  flex:0 0 52px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  background:rgba(99,102,241,.1);
  font-size:1.35rem;
}

.project-fact-card__label {
  font-size:.82rem;
  color:var(--text-soft);
  margin-bottom:.2rem;
}

.project-fact-card__value {
  font-size:1rem;
  line-height:1.45;
  color:var(--text-main);
  font-weight:700;
}

.project-step-card {
  display:flex;
  gap:1rem;
  padding:1.1rem;
  align-items:flex-start;
}

.project-step-card__num {
  width:40px;
  height:40px;
  flex:0 0 40px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, var(--brand), var(--brand-2));
  color:#fff;
  font-weight:800;
  box-shadow:0 12px 22px rgba(99,102,241,.18);
}

.project-step-card__title {
  margin:0 0 .45rem;
  color:var(--text-main);
  font-size:1rem;
  font-weight:700;
}

.project-step-card__text {
  margin:0;
  color:var(--text-soft);
  line-height:1.7;
}

.project-share-box {
  display:grid;
  gap:.75rem;
}

.project-share-box__input {
  font-size:.88rem;
}

.project-promo-card {
  background-image:var(--hero-gradient);
}

.project-promo-card__actions {
  display:grid;
  gap:.75rem;
}

.project-sidebar .project-sidebar__card {
  overflow:hidden;
}

body.dark .project-fact-card,
body.dark .project-step-card,
html.dark .project-promo-card,
html[data-theme="dark"] .project-promo-card,
body.dark .project-promo-card {
  background:rgba(15,23,42,.78);
}

html.dark .project-fact-card__icon,
html[data-theme="dark"] .project-fact-card__icon,
body.dark .project-fact-card__icon {
  background:rgba(129,140,248,.16);
}

.copy-feedback {
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:1000;
  padding:.9rem 1rem;
  border-radius:16px;
  background:rgba(15,23,42,.92);
  color:#fff;
  box-shadow:0 18px 40px rgba(2,6,23,.3);
  opacity:0;
  transform:translateY(10px);
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
}

.copy-feedback.is-visible {
  opacity:1;
  transform:translateY(0);
}

@media (max-width: 900px) {
  .project-facts-grid,
  .project-steps-grid {
    grid-template-columns:1fr;
  }
}

@media (max-width: 640px) {
  .project-fact-card,
  .project-step-card {
    padding:1rem;
    border-radius:18px;
  }

  .project-fact-card__icon {
    width:46px;
    height:46px;
    flex-basis:46px;
    border-radius:14px;
  }
}


/* ===== My Cards V2 additive layer ===== */
.mycards-v2__hero {
  overflow: hidden;
}

.mycards-v2__hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: 1.5rem;
  align-items: center;
}

.mycards-v2__title {
  margin: 1rem 0 .85rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  font-weight: 800;
  color: var(--text-main);
}

.mycards-v2__lead {
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-soft);
}

.mycards-v2__hero-actions {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
}

.mycards-v2__summary-card {
  padding: 1.35rem;
  border-radius: 24px;
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 18px 40px rgba(15,23,42,.08);
}

html.dark .mycards-v2__summary-card,
html[data-theme="dark"] .mycards-v2__summary-card,
body.dark .mycards-v2__summary-card {
  background: rgba(2,6,23,.32);
  border-color: rgba(148,163,184,.16);
}

.mycards-v2__summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.mycards-v2__summary-head span {
  font-size: .82rem;
  color: var(--text-soft);
}

.mycards-v2__summary-list {
  display: grid;
  gap: .85rem;
}

.mycards-v2__summary-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .9rem 1rem;
  border-radius: 18px;
  background: rgba(248,250,252,.75);
}

html.dark .mycards-v2__summary-item,
html[data-theme="dark"] .mycards-v2__summary-item,
body.dark .mycards-v2__summary-item {
  background: rgba(15,23,42,.72);
}

.mycards-v2__summary-item strong,
.mycards-v2__summary-item span,
.mycards-v2__summary-note {
  display: block;
}

.mycards-v2__summary-item strong {
  color: var(--text-main);
  font-size: 1rem;
}

.mycards-v2__summary-item span:last-child {
  color: var(--text-soft);
  font-size: .9rem;
}

.mycards-v2__summary-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(99,102,241,.12);
  font-size: 1.1rem;
}

.mycards-v2__summary-note {
  margin-top: 1rem;
  font-size: .92rem;
  line-height: 1.7;
}

.mycards-v2__stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
}

.mycards-stat-card {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.05rem;
  border-radius: 22px;
  border: 1px solid var(--border-soft);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.mycards-stat-card strong,
.mycards-stat-card span {
  display: block;
}

.mycards-stat-card strong {
  color: var(--text-main);
  font-size: 1.2rem;
  line-height: 1.1;
}

.mycards-stat-card span:last-child {
  color: var(--text-soft);
  font-size: .88rem;
  margin-top: .18rem;
}

.mycards-stat-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(99,102,241,.12);
}

.mycards-stat-card.is-success .mycards-stat-card__icon { background: rgba(16,185,129,.14); }
.mycards-stat-card.is-warning .mycards-stat-card__icon { background: rgba(245,158,11,.16); }
.mycards-stat-card.is-dark .mycards-stat-card__icon { background: rgba(15,23,42,.12); }
.mycards-stat-card.is-accent .mycards-stat-card__icon { background: rgba(244,63,94,.12); }
.mycards-stat-card.is-soft .mycards-stat-card__icon { background: rgba(14,165,233,.12); }

.mycards-v2__controls-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 1.25rem;
  align-items: end;
}

.mycards-v2__search {
  position: relative;
}

.dashboard-search-input {
  position: relative;
}

.dashboard-search-input i {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: var(--text-soft);
  z-index: 2;
}

.dashboard-search-input .form-input {
  padding-left: 2.8rem;
}

.mycards-v2__filters {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.filter-chip {
  border: 1px solid var(--border-soft);
  background: var(--panel-muted);
  color: var(--text-main);
  border-radius: 999px;
  padding: .72rem 1rem;
  font-size: .9rem;
  font-weight: 700;
  transition: .2s ease;
}

.filter-chip:hover,
.filter-chip.is-active {
  background: rgba(99,102,241,.12);
  border-color: rgba(99,102,241,.28);
  color: var(--brand);
}

.mycard-item {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.mycard-item:hover {
  transform: translateY(-6px);
  border-color: rgba(99,102,241,.35);
}

.mycard-item__cover-wrap {
  position: relative;
  min-height: 230px;
}

.mycard-item__cover {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
}

.mycard-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,.06) 10%, rgba(15,23,42,.78) 100%);
}

.mycard-item__topline,
.mycard-item__bottommeta {
  position: absolute;
  left: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.mycard-item__topline { top: 1rem; }
.mycard-item__bottommeta { bottom: 1rem; }

.mycard-item__badges {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.mycard-item__copy {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(15,23,42,.18);
}

html.dark .mycard-item__copy,
html[data-theme="dark"] .mycard-item__copy,
body.dark .mycard-item__copy {
  background: rgba(15,23,42,.9);
  color: #e2e8f0;
}

.mycard-item__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.2rem;
  flex: 1 1 auto;
}

.mycard-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.mycard-item__title {
  margin: 0 0 .45rem;
  color: var(--text-main);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
}

.mycard-item__desc {
  margin: 0;
  color: var(--text-soft);
  font-size: .95rem;
  line-height: 1.75;
}

.mycard-item__type {
  flex: 0 0 auto;
  max-width: 150px;
  text-align: center;
  padding: .6rem .75rem;
  border-radius: 999px;
  background: rgba(99,102,241,.1);
  color: var(--brand);
  font-size: .8rem;
  font-weight: 800;
}

.mycard-item__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.mycard-fact {
  padding: .85rem;
  border-radius: 18px;
  background: var(--panel-muted);
  border: 1px solid var(--border-soft);
}

.mycard-fact__label,
.mycard-fact__value {
  display: block;
}

.mycard-fact__label {
  font-size: .78rem;
  color: var(--text-soft);
  margin-bottom: .3rem;
}

.mycard-fact__value {
  color: var(--text-main);
  font-weight: 800;
}

.mycard-item__actions {
  display: grid;
  gap: .75rem;
}

.mycard-item__actions--main {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mycard-item__actions--secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mycard-item__actions .btn {
  justify-content: center;
}

.mycards-v2__empty-state,
.mycards-v2__empty-filter {
  text-align: center;
}

.mycards-v2__empty-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 1rem;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99,102,241,.12);
  font-size: 2rem;
}

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

@media (max-width: 1024px) {
  .mycards-v2__hero-grid,
  .mycards-v2__controls-grid {
    grid-template-columns: 1fr;
  }

  .mycards-v2__summary-card {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .mycards-v2__stats-grid,
  .mycard-item__facts,
  .mycard-item__actions--main,
  .mycard-item__actions--secondary {
    grid-template-columns: 1fr;
  }

  .mycard-item__head {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .mycards-v2__hero-actions,
  .mycards-v2__filters,
  .mycard-item__bottommeta,
  .mycard-item__badges {
    gap: .55rem;
  }

  .mycards-v2__hero-actions .btn,
  .mycard-item__actions .btn {
    width: 100%;
  }

  .mycard-item__cover-wrap,
  .mycard-item__cover {
    min-height: 200px;
    height: 200px;
  }

  .mycard-item__body {
    padding: 1rem;
  }
}

/* Extra safety for theme roots */
html.dark body,
html[data-theme="dark"] body {
  background: radial-gradient(circle at top, rgba(99,102,241,.08), transparent 30%), var(--app-bg) !important;
  color: var(--text-soft) !important;
}

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

html:not(.dark)[data-theme="light"] .theme-ready,
html[data-theme="light"] body {
  color-scheme: light;
}
