/* Force correct tokens + light theme (loaded as static file, not hashed) */
:root {
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --font-display: "Chakra Petch", "Vazirmatn", system-ui, sans-serif;
  --font-body: "Vazirmatn", "Chakra Petch", system-ui, sans-serif;
  --step-0: .9375rem; --step-1: 1.0625rem; --step-2: 1.375rem;
  --step-3: 1.875rem; --step-4: 2.5rem; --shell: 1200px;
}

html[lang="fa"] { --font-display: "Vazirmatn", system-ui, sans-serif; }

html[data-theme="light"],
html.theme-light {
  color-scheme: light !important;
  --bg: #EAF4FB !important;
  --bg-2: #DCECF7 !important;
  --card: #F7FBFE !important;
  --card-2: #FFFFFF !important;
  --cyan: #0891B2 !important;
  --purple: #7C3AED !important;
  --text: #0B1C2C !important;
  --muted: #4B6478 !important;
  --line: rgba(12, 40, 70, 0.10) !important;
  --line-strong: rgba(12, 40, 70, 0.18) !important;
  --cyan-dim: rgba(8, 145, 178, 0.12) !important;
  --purple-dim: rgba(124, 58, 237, 0.10) !important;
  --btn-hover: #E2F0F8 !important;
  --header-bg: rgba(234, 244, 251, 0.92) !important;
  --shadow-soft: 0 10px 28px -14px rgba(15, 60, 90, 0.18) !important;
  --hero-bg: linear-gradient(135deg, #f8fcff 0%, #e8f4fb 55%, #f0eafc 100%) !important;
  --hero-glow: radial-gradient(520px 300px at 88% 10%, rgba(124,58,237,.12), transparent 65%),
               radial-gradient(460px 280px at 4% 96%, rgba(8,145,178,.12), transparent 60%) !important;
  --ambient-grid: rgba(8, 80, 120, 0.06) !important;
  --glow-cyan: rgba(56, 189, 248, 0.22) !important;
  --glow-purple: rgba(167, 139, 250, 0.16) !important;
}

html[data-theme="light"] body,
html.theme-light body {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: var(--font-body) !important;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html.theme-light h1,
html.theme-light h2,
html.theme-light h3 {
  color: var(--text) !important;
  font-family: var(--font-display) !important;
}

html[data-theme="light"] .site-header,
html.theme-light .site-header {
  background: var(--header-bg) !important;
  border-bottom: 1px solid var(--line) !important;
}

html[data-theme="light"] .home-hero,
html.theme-light .home-hero {
  background: var(--hero-bg) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-soft) !important;
  color: var(--text) !important;
}
html[data-theme="light"] .home-hero h1,
html.theme-light .home-hero h1 { color: var(--text) !important; }
html[data-theme="light"] .home-hero p,
html.theme-light .home-hero p { color: var(--muted) !important; }

html[data-theme="light"] .pcard,
html[data-theme="light"] .panel,
html[data-theme="light"] .type-tile,
html[data-theme="light"] .filters,
html[data-theme="light"] .ad-banner,
html.theme-light .pcard,
html.theme-light .panel,
html.theme-light .type-tile,
html.theme-light .filters,
html.theme-light .ad-banner {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-soft) !important;
}

html[data-theme="light"] .type-tile p,
html[data-theme="light"] .pcard .summary,
html.theme-light .type-tile p,
html.theme-light .pcard .summary { color: var(--muted) !important; }

html[data-theme="light"] .btn-primary,
html.theme-light .btn-primary { color: #fff !important; }

html[data-theme="light"] .btn-ghost,
html.theme-light .btn-ghost {
  background: var(--card-2) !important;
  color: var(--text) !important;
  border-color: var(--line-strong) !important;
}

html[data-theme="light"] .header-tools .btn,
html[data-theme="light"] .btn-donate,
html.theme-light .header-tools .btn,
html.theme-light .btn-donate {
  background: var(--card-2) !important;
  color: var(--text) !important;
  border-color: var(--line-strong) !important;
}

html[data-theme="light"] .detail-title h1,
html[data-theme="light"] .detail-name,
html.theme-light .detail-title h1,
html.theme-light .detail-name { color: var(--text) !important; text-shadow: none !important; }

html[data-theme="light"] .detail-title p,
html.theme-light .detail-title p { color: var(--muted) !important; }

html[data-theme="light"] .site-footer,
html.theme-light .site-footer {
  background: var(--bg-2) !important;
  border-top-color: var(--line) !important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html.theme-light input,
html.theme-light select,
html.theme-light textarea {
  background: #fff !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

@media (max-width: 720px) {
  html[data-theme="light"] .type-grid,
  html.theme-light .type-grid { grid-template-columns: 1fr 1fr !important; }
  html[data-theme="light"] .card-grid,
  html.theme-light .card-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 420px) {
  html[data-theme="light"] .type-grid,
  html.theme-light .type-grid { grid-template-columns: 1fr !important; }
}

.pcard{display:flex!important;flex-direction:column!important;height:100%!important;}
.pcard-body{display:flex!important;flex-direction:column!important;flex:1!important;}
.pcard-actions{margin-top:auto!important;display:flex!important;flex-wrap:nowrap!important;gap:.45rem!important;}
.pcard-actions .btn{flex:1 1 0!important;min-width:0!important;justify-content:center!important;}

/* Light mode — new components (files accordion + creator links + aligned card actions) */
html[data-theme="light"] .file-acc,
html.theme-light .file-acc {
  background: var(--card-2) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
html[data-theme="light"] .file-acc-name,
html.theme-light .file-acc-name { color: var(--text) !important; }
html[data-theme="light"] .files-filters .chip,
html.theme-light .files-filters .chip {
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
}
html[data-theme="light"] .files-filters .chip.is-active,
html.theme-light .files-filters .chip.is-active {
  background: var(--cyan-dim) !important;
  color: var(--cyan) !important;
  border-color: rgba(8,145,178,.35) !important;
}
html[data-theme="light"] .creator-card,
html.theme-light .creator-card {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
html[data-theme="light"] .creator-link-btn,
html.theme-light .creator-link-btn {
  background: var(--card-2) !important;
  border-color: var(--line-strong) !important;
  color: var(--text) !important;
}
html[data-theme="light"] .pcard,
html.theme-light .pcard {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}
html[data-theme="light"] .pcard-body,
html.theme-light .pcard-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
}
html[data-theme="light"] .pcard-actions,
html.theme-light .pcard-actions {
  margin-top: auto !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: .45rem !important;
}
html[data-theme="light"] .pcard-actions .btn,
html.theme-light .pcard-actions .btn {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  justify-content: center !important;
}
html[data-theme="light"] .footer-brand-line,
html.theme-light .footer-brand-line {
  color: var(--muted) !important;
}
html[data-theme="light"] .disclaimer,
html.theme-light .disclaimer {
  color: var(--muted) !important;
}

html[data-theme="light"] .creator-links,
html.theme-light .creator-links { margin-top: auto !important; }
