/* companion-theme-scope-v1 · Day/Night/Auto across shell + tab sections */

/* Shared tokens when light */
html[data-theme="light"] {
  color-scheme: light;
  --cs-bg: #f4efe3;
  --cs-surface: #fffcf5;
  --cs-card: #fffaf0;
  --cs-text: #1a241c;
  --cs-muted: #4a554c;
  --cs-gold: #8a6d1f;
  --cs-gold-soft: rgba(138, 109, 31, 0.18);
  --cs-border: rgba(120, 100, 40, 0.28);
  --cs-plaque: #fffdf7;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --cs-bg: #07110e;
  --cs-surface: #0b1713;
  --cs-card: #0e1c17;
  --cs-text: #e8d5a3;
  --cs-muted: rgba(232, 213, 163, 0.75);
  --cs-gold: #c9a227;
  --cs-gold-soft: rgba(201, 162, 39, 0.14);
  --cs-border: rgba(201, 162, 39, 0.28);
  --cs-plaque: rgba(8, 18, 14, 0.72);
}

/* Apply to body + mount + common plaques */
html[data-theme="light"] body {
  background: var(--cs-bg) !important;
  color: var(--cs-text) !important;
}
html[data-theme="light"] #cs-mount,
html[data-theme="light"] .cs-path,
html[data-theme="light"] #cs-tab-adhkar,
html[data-theme="light"] #cs-status-banner,
html[data-theme="light"] .cs-door {
  color: var(--cs-text);
}
html[data-theme="light"] #cs-mount {
  background: transparent;
}
html[data-theme="light"] .cs-path {
  background: var(--cs-surface);
  border-color: var(--cs-border);
}
html[data-theme="light"] .cs-path-tile {
  background: var(--cs-card);
  color: var(--cs-text);
  border-color: var(--cs-border);
}
html[data-theme="light"] .cs-path h2,
html[data-theme="light"] .cs-path-tile strong {
  color: #3d3418;
}

/* Tab plaques / cards */
html[data-theme="light"] #cs-mount .cs-plaque,
html[data-theme="light"] #cs-mount .card,
html[data-theme="light"] #cs-mount section[class*="plaque"],
html[data-theme="light"] #cs-mount .asma-rich,
html[data-theme="light"] #cs-mount .pname-rich {
  background: var(--cs-plaque) !important;
  color: var(--cs-text) !important;
  border-color: var(--cs-border) !important;
}
html[data-theme="light"] #cs-mount h1,
html[data-theme="light"] #cs-mount h2,
html[data-theme="light"] #cs-mount h3,
html[data-theme="light"] #cs-mount .lead {
  color: #2a332c !important;
}
html[data-theme="light"] #cs-mount .arabic,
html[data-theme="light"] #cs-mount [lang="ar"] {
  color: #1a241c !important;
}
html[data-theme="light"] #cs-mount a {
  color: #6b5420 !important;
}
html[data-theme="light"] #cs-mount .rp-btn,
html[data-theme="light"] #cs-mount button.rp-btn,
html[data-theme="light"] #cs-mount .btn-secondary,
html[data-theme="light"] #cs-mount .btn-soft {
  background: #fff;
  color: #2a332c;
  border-color: var(--cs-border);
}
html[data-theme="light"] #cs-mount .asma-plaque,
html[data-theme="light"] #cs-mount .pname-plaque,
html[data-theme="light"] #cs-mount .asma-section,
html[data-theme="light"] #cs-mount .pname-section,
html[data-theme="light"] #cs-mount .asma-meta > div,
html[data-theme="light"] #cs-mount .asma-ayat-card {
  background: #fffef9 !important;
  border-color: var(--cs-border) !important;
  color: var(--cs-text) !important;
}
html[data-theme="light"] #cs-mount .asma-plaque .arabic,
html[data-theme="light"] #cs-mount #rp-name-ar,
html[data-theme="light"] #cs-mount #rp-pname-ar {
  color: #8a6d1f !important;
  text-shadow: none !important;
}
html[data-theme="light"] #cs-tab-adhkar {
  background: var(--cs-surface);
  border-color: var(--cs-border);
  color: var(--cs-text);
}
html[data-theme="light"] #cs-status-banner .cs-status-chip {
  background: #fffef9;
  color: #2a332c;
  border-color: var(--cs-border);
}
html[data-theme="light"] .cs-door-btn {
  background: #fffef9;
  color: #2a332c;
  border-color: var(--cs-border);
}
html[data-theme="light"] .cs-door-btn.is-active {
  background: rgba(138, 109, 31, 0.15);
  color: #3d3418;
}
html[data-theme="light"] .edu-chip,
html[data-theme="light"] .rp-chip {
  color: #6b5420;
}

/* Notes / forms light */
html[data-theme="light"] #cs-mount input,
html[data-theme="light"] #cs-mount textarea,
html[data-theme="light"] #cs-mount select {
  background: #fff;
  color: #1a241c;
  border-color: var(--cs-border);
}
