{# Project-level token overrides for the admin chrome.
#
# IMPORTANT: this partial is included AFTER `<link rel="stylesheet"
# href="/static/admin.css">` in `_base.html`. That ordering is the
# whole point — a project override here wins ties on source order
# without needing `!important`.
#
# The framework is light-only, so a single `html { ... }` block at
# specificity (0,0,1,0) is enough to override the `:root` tokens.
#
# When no fields are set on `AdminTheme`, no markup is emitted at
# all and admin.css is the single source of truth. #}
{% if has_theme_overrides %}
<style>
html {
{%- if accent_hex %}
--rio-accent: {{ accent_hex }};
--rio-accent-rgb: {{ accent_rgb }};
{%- endif %}
{%- if theme_bg %}
--rio-bg: {{ theme_bg }};
{%- endif %}
{%- if theme_surface %}
--rio-surface: {{ theme_surface }};
{%- endif %}
{%- if theme_text %}
--rio-text: {{ theme_text }};
{%- endif %}
{%- if theme_text_muted %}
--rio-text-muted: {{ theme_text_muted }};
{%- endif %}
{%- if theme_border %}
--rio-border: {{ theme_border }};
{%- endif %}
}
</style>
{% endif %}