/* Approved Daylight/Paper contrast update, 2026-10-21. Color-only layer. */
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) {
--astra-on-accent:var(--astra-accent-ink);--astra-positive:#176533;--astra-positive-bg:#e8f7ed;--astra-caution:#744900;--astra-caution-bg:#fff2cf;--astra-negative:#922838;--astra-negative-bg:#ffebee;--ink:var(--astra-text);--panel:var(--astra-panel);--soft:var(--astra-panel-2);--soft-strong:var(--astra-accent-soft);--surface-alt:var(--astra-panel-2);--border:var(--astra-line);
}
:root[data-astra-app="true"][data-astra-theme="daylight"] {
--astra-line:#c3d0df;
--astra-control-line:#718299;
--astra-text:#162b44;
--astra-muted:#465c75;
--astra-accent:#175ec4;
--astra-accent-ink:#ffffff;
--astra-link:#1c55a0;
--astra-accent-soft:#e5efff;
}
:root[data-astra-app="true"][data-astra-theme="paper"] {
--astra-line:#d5c5b1;
--astra-control-line:#927b63;
--astra-text:#392e25;
--astra-muted:#66523f;
--astra-accent:#855326;
--astra-accent-ink:#ffffff;
--astra-link:#744923;
--astra-accent-soft:#f0e2d1;
}
/* Secondary actions, disclosures and the old cream diagnostic button. */
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .secondary-button, .saved-video-detail summary, .saved-analysis-detail summary,
  .saved-pager button, .customer-library-disclosure-actions button,
  .customer-image-actions button, .saved-report-version, .report-corner-close
) {
  background: var(--astra-panel-2);
  color: var(--astra-text);
  border-color: var(--astra-control-line);
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .secondary-button, .saved-video-detail summary, .saved-analysis-detail summary,
  .saved-pager button, .saved-report-version, .report-corner-close
):not(:disabled):hover {
  background: var(--astra-accent-soft);
  color: var(--astra-text);
  border-color: var(--astra-accent);
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .primary-button, button.primary, #analyzeBtn, #variantGenerate
):not(:disabled) {
  background: var(--astra-accent);
  color: var(--astra-accent-ink);
  border-color: var(--astra-accent);
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .primary-button, button.primary, #analyzeBtn, #variantGenerate
):not(:disabled):hover {
  background: var(--astra-link);
  color: var(--astra-accent-ink);
  border-color: var(--astra-link);
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .primary-button, button.primary, #analyzeBtn, #variantGenerate,
  .secondary-button, .danger-button
) :is(strong, b, span:not(.google-mark)) { color: inherit; }
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  button:disabled, #analyzeBtn:disabled, #variantGenerate:disabled, .saved-pager button:disabled
) {
  background: var(--astra-input);
  color: var(--astra-muted);
  border-color: var(--astra-line);
  opacity: 1;
  box-shadow: none;
  cursor: not-allowed;
}

/* Links stay recognizable without depending on hue alone. */
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) a:not(.primary-button):not(.secondary-button):not(.nav-item),
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .text-button, .auth-text-button, .auth-signup-entry button
) {
  color: var(--astra-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) a:not(.primary-button):not(.secondary-button):not(.nav-item):hover,
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .text-button, .auth-text-button, .auth-signup-entry button
):hover { color: var(--astra-accent); }
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--astra-accent);
  outline-offset: 3px;
}

/* Editable controls need a visible boundary, not a low-opacity fill. */
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  input:not([type="checkbox"]):not([type="radio"]), textarea, select
) {
  background-color: var(--astra-input);
  color: var(--astra-text);
  border-color: var(--astra-control-line);
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(input, textarea)::placeholder {
  color: var(--astra-muted);
  opacity: 1;
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--astra-accent);
}

/* Paired dark surfaces for reports, policy guidance, account and payment UI. */
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .saved-source-heading, .saved-analysis-id-map, .saved-report-comparison,
  .saved-report-comparison-header, .analysis-completion-notice,
  .policy-risk-panel, .policy-score-disclaimer, .policy-risk-reference,
  .sandbox-payment-instruction, .sandbox-payment-status,
  .customer-auth-gate-card, .customer-auth-gate-status,
  .auth-redirect-hint, .magic-link-limit-hint
) {
  background: var(--astra-panel-2);
  color: var(--astra-text);
  border-color: var(--astra-line);
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .policy-risk-panel, .policy-score-disclaimer, .policy-risk-reference,
  .policy-risk-links, .policy-risk-summary, .saved-source-heading,
  .saved-report-comparison, .customer-library-card, .video-card-head,
  .credit-quota-card, .sandbox-plan-card, .sandbox-payment-instruction,
  .supabase-security-card, .supabase-recovery-card, .customer-auth-gate-card
) :is(h1, h2, h3, h4, strong, b, label, blockquote) { color: var(--astra-text); }
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .policy-risk-links, .policy-risk-summary, .policy-risk-reference,
  .policy-risk-panel, .saved-report-comparison, .customer-auth-gate-card,
  .sandbox-payment-instruction, .sandbox-payment-status
) :is(p, small, dt, dd, .customer-auth-subtitle) { color: var(--astra-muted); }
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) .policy-risk-links { color: var(--astra-muted); }
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) .customer-auth-gate-card :is(.auth-or-divider, .auth-dialog-close, .auth-signup-entry, .auth-policy-note) {
  color: var(--astra-muted);
}

/* Semantic scores retain their meaning, with matching text and background. */
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(.score-strong, .customer-score.strong) {
  background: var(--astra-positive-bg);
  color: var(--astra-positive);
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(.score-medium, .customer-score.medium) {
  background: var(--astra-caution-bg);
  color: var(--astra-caution);
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(.score-weak, .customer-score.weak) {
  background: var(--astra-negative-bg);
  color: var(--astra-negative);
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .danger-button, .magic-link-limit-hint.is-rate-limited
) {
  background: var(--astra-negative-bg);
  color: var(--astra-negative);
  border-color: var(--astra-negative);
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) .danger-button:hover {
  background: var(--astra-negative-bg);
  color: var(--astra-text);
}
/* Legacy stage names used print-oriented dark hues on dark table cells. */
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) .stage-name {
  color: var(--astra-text);
}
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(
  .saved-analysis-score-list span, .reference-links b, .context-source,
  .current-state > strong
) { color: var(--astra-link); }
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) .sample-template-summary::before,
:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) .reference-library-summary::before {
  color: var(--astra-link);
}

:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(.analysis-industry-panel strong,.matrix-panel h2,.coverage-panel h3,.policy-risk-panel blockquote) {color:var(--astra-text);}

:root[data-astra-app="true"]:is([data-astra-theme="daylight"],[data-astra-theme="paper"]) :is(table th,table td) {color:var(--astra-text);background:var(--astra-panel);border-color:var(--astra-line);}
