/* Shared palette tokens; print certificates retain their own ink colors. */
@media screen {
html[data-palette="burgundy"][data-theme="light"] { --palette-hue:220; --accent:#801638; --accent-2:#253f65; }
html[data-palette="burgundy"][data-theme="dark"] { --palette-hue:220; --accent:#f2a0bb; --accent-2:#a9c4ef; }
html[data-palette="navy"][data-theme="light"] { --palette-hue:38; --accent:#203c78; --accent-2:#79582e; --navigation-custom:#eee3cf; --navigation-ink:#203c78; }
html[data-palette="navy"][data-theme="dark"] { --palette-hue:220; --accent:#a6bfff; --accent-2:#eed7ae; }

html[data-palette="ruby"][data-theme="light"] { --palette-hue:185; --accent:#b31e38; --accent-2:#206369; }
html[data-palette="ruby"][data-theme="dark"] { --palette-hue:185; --accent:#ff8c9e; --accent-2:#8dd4d8; }
html[data-palette="emerald"][data-theme="light"] { --palette-hue:36; --accent:#08734f; --accent-2:#79582e; }
html[data-palette="emerald"][data-theme="dark"] { --palette-hue:155; --accent:#65ddb0; --accent-2:#e4c390; }
html[data-palette="ocean"][data-theme="light"] { --palette-hue:32; --accent:#1667b2; --accent-2:#825235; }
html[data-palette="ocean"][data-theme="dark"] { --palette-hue:210; --accent:#8fc5ff; --accent-2:#e9bf9c; }
html[data-palette="violet"][data-theme="light"] { --palette-hue:210; --accent:#7941b7; --accent-2:#376075; }
html[data-palette="violet"][data-theme="dark"] { --palette-hue:210; --accent:#d0a4ff; --accent-2:#a4cadc; }
html[data-palette="amber"][data-theme="light"] { --palette-hue:220; --accent:#925500; --accent-2:#253f65; }
html[data-palette="amber"][data-theme="dark"] { --palette-hue:220; --accent:#ffca7a; --accent-2:#a9c4ef; }
html[data-palette="slate"][data-theme="light"] { --palette-hue:150; --accent:#4d617e; --accent-2:#306447; }
html[data-palette="slate"][data-theme="dark"] { --palette-hue:150; --accent:#bccce4; --accent-2:#a4d8b8; }

html[data-palette][data-theme="light"] { color-scheme:light; --bg:hsl(var(--palette-hue) 24% 97%); --surface:#fff; --surface-strong:hsl(var(--palette-hue) 28% 96%); --surface-hover:hsl(var(--palette-hue) 25% 92%); --text:#182331; --text-dim:#485569; --text-faint:#59667a; --border:hsl(var(--palette-hue) 17% 84%); --border-strong:hsl(var(--palette-hue) 20% 70%); --accent-contrast:#fff; }
html[data-palette][data-theme="dark"] { color-scheme:dark; --bg:hsl(var(--palette-hue) 20% 9%); --surface:hsl(var(--palette-hue) 19% 14%); --surface-strong:hsl(var(--palette-hue) 19% 18%); --surface-hover:hsl(var(--palette-hue) 19% 22%); --text:#f3f5fa; --text-dim:#c7cfdd; --text-faint:#a6b1c4; --border:hsl(var(--palette-hue) 15% 30%); --border-strong:hsl(var(--palette-hue) 16% 44%); --accent-contrast:#172130; }
html[data-palette] { --accent-soft:color-mix(in srgb, var(--accent) 12%, transparent); --bg-glow-1:color-mix(in srgb, var(--accent) 10%, transparent); --bg-glow-2:transparent; }
html[data-palette] body.workspace-app { --text-faint:var(--text-dim); }
html[data-palette] .admin-overview { --overview-surface:var(--surface); --overview-muted:var(--surface-strong); --overview-secondary:var(--text-dim); }
html[data-palette] .admin-overview .overview-welcome { border-inline-start-color:var(--accent); background:linear-gradient(110deg,var(--accent-soft),transparent 55%),var(--surface); }
html[data-palette] .btn-primary { background:var(--accent); color:var(--accent-contrast); border-color:var(--accent); }
html[data-palette] .sidebar .nav-item.active { background:var(--accent-soft); color:var(--accent); border-color:var(--accent); }
html[data-palette][data-theme] :is(.vf-page,.dir-wrap) { --bg:inherit; --surface:inherit; --surface-strong:inherit; --surface-hover:inherit; --text:inherit; --text-dim:inherit; --text-faint:inherit; --border:inherit; --border-strong:inherit; --accent:inherit; --accent-2:inherit; --accent-soft:inherit; --accent-contrast:inherit; background:transparent; }
/* A content wrapper is not a card. Paint the public canvas only once so
   its centered margins never expose a different background. */
html[data-palette]:has(:is(.dir-wrap,.vf-page,.certificate-public)),
html[data-palette] body:has(:is(.dir-wrap,.vf-page,.certificate-public)) { background:var(--bg); background-image:none; }
html[data-palette] body:has(:is(.dir-wrap,.vf-page,.certificate-public)) { min-height:100dvh; }
html[data-palette] body:has(:is(.dir-wrap,.vf-page,.certificate-public)) > .fx-canvas { display:none; }
html[data-palette][data-theme] .vf-page :is(.glass,.vf-topbar,.vf-sidebar,.vf-filter-group,.vf-chip,.vf-product-caption,.vf-results-disclosure,.purchase-card,.vf-qr-card,.vf-note) { background:var(--surface); color:var(--text); border-color:var(--border); }
html[data-palette][data-theme] .vf-page :is(input,.vf-icon-btn) { background:var(--surface-strong); color:var(--text); }
html[data-palette][data-theme] .vf-page .vf-product-caption span { color:var(--text-dim); }
html[data-palette][data-theme] .vf-page .vf-hero-visual { flex-direction:column; gap:10px; padding:70px 14px 85px; background:linear-gradient(145deg,var(--accent-soft),var(--surface-strong)); }
html[data-palette][data-theme] .vf-page .vf-hero-visual .plan-stars { padding:8px 0 0; position:relative; z-index:1; }
html[data-palette][data-theme] .vf-page .vf-hero-visual .plan-stars-caption { position:relative; z-index:1; margin:0; color:var(--text-dim); }
html[data-palette][data-theme] .vf-page :is(.vf-hero-visual .pkg,.vf-hero-visual .ribbon,.vf-searchbar input,.purchase-form input[type="tel"]) { background:var(--surface-strong); color:var(--text); border-color:var(--border); }
html[data-palette][data-theme] .vf-page :is(.vf-product-caption strong,.vf-hero-visual .pkg b) { color:var(--text); }
html[data-palette][data-theme] .vf-page :is(.vf-qr-card,.vf-sidebar,.vf-directory-link,.purchase-form button,.vf-sidebar-head) { background:var(--surface-strong); color:var(--text); border-color:var(--border); }
html[data-palette][data-theme] .vf-page :is(.purchase-form button,.btn-primary) { background:var(--accent); color:var(--accent-contrast); }
/* Shared roles keep controls and decorative widgets consistent across palettes.
   Status colors, brand artwork, QR pixels and printed paper retain their meaning. */
html[data-palette][data-theme="light"] {
  --control-border:hsl(var(--palette-hue) 12% 48%);
  --success:#18703c; --warn:#875600; --danger:#b42335; --info:#1765a3;
  --status-contrast:#fff;
}
html[data-palette][data-theme="dark"] {
  --control-border:hsl(var(--palette-hue) 16% 62%);
  --success:#7be0a0; --warn:#ffd080; --danger:#ff9eac; --info:#9acaff;
  --status-contrast:#172130;
}
html[data-palette] {
  --accent-hover:color-mix(in srgb,var(--accent) 88%,var(--text));
  --success-soft:color-mix(in srgb,var(--success) 12%,transparent);
  --warn-soft:color-mix(in srgb,var(--warn) 12%,transparent);
  --danger-soft:color-mix(in srgb,var(--danger) 12%,transparent);
  --info-soft:color-mix(in srgb,var(--info) 12%,transparent);
  --hero-bg:hsl(var(--palette-hue) 48% 20%);
  --elev-accent:0 10px 30px -12px color-mix(in srgb,var(--accent) 35%,transparent);
  --shadow-lift:0 16px 40px -18px color-mix(in srgb,var(--accent) 28%,transparent);
  --shadow-ambient:0 8px 24px -12px rgb(15 23 42 / 14%);
  accent-color:var(--accent);
}
html[data-palette] :is(input:not([type="hidden"]),select,textarea) { border-color:var(--control-border); }
html[data-palette] :is(input,textarea)::placeholder { color:var(--text-faint); opacity:1; }
html[data-palette] :is(a,button,input,select,textarea,summary):focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
html[data-palette] :is(.logo,.user-pill .avatar,.mobile-theme-toggle .knob,.queue-item .qi-icon,.pagination button:hover) { color:var(--accent-contrast); }
html[data-palette][data-theme] :is(.module-icon,.overview-icon,.dir-hub-card .icon) { background:var(--accent-soft); color:var(--accent); }
html[data-palette] :is(.edit-btn,.password-btn) { background:var(--accent); color:var(--accent-contrast); }
html[data-palette] .delete-btn { background:var(--danger); color:var(--status-contrast); }
html[data-palette] .enable-btn { background:var(--success); color:var(--status-contrast); }
html[data-palette] .disable-btn { background:var(--warn); color:var(--status-contrast); }
html[data-palette] .dock-item.active .dock-icon { color:var(--accent-contrast); box-shadow:var(--elev-accent); }
html[data-palette] .pricing-track span { background:var(--accent); }
html[data-palette] .plan-stars svg { stroke:var(--accent); }
html[data-palette] :is(.plan-stars svg.filled,.plan-star-fill) { fill:var(--accent); stroke:var(--accent); }
html[data-palette] .plan-choice:has(input:checked) .plan-stars { background:var(--accent-soft); }
html[data-palette] .survey-stars :is(input:checked~label,label:hover,label:hover~label) { color:var(--accent); }
html[data-palette] .survey-bars meter::-moz-meter-bar { background:var(--accent); }
html[data-palette] .auth-hero { background:radial-gradient(ellipse at 20% 25%,var(--accent-soft),transparent 60%),var(--surface-strong); color:var(--text); }
html[data-palette] .auth-hero :is(.auth-headline,.role-slide-label) { color:var(--text); }
html[data-palette] .auth-hero :is(.role-slide-line,.footer-tag) { color:var(--text-dim); }
html[data-palette] .auth-hero .role-chip { background:var(--surface); border-color:var(--control-border); color:var(--text); }
html[data-palette] .auth-hero :is(.role-chip.hover-active,.role-chip:hover) { background:var(--accent); border-color:var(--accent); color:var(--accent-contrast); }
html[data-palette] .auth-hero .role-slide { border-color:var(--border); }
html[data-palette] .auth-hero .role-slide-dot { background:var(--control-border); }
html[data-palette] .auth-hero .role-slide-dot.active { background:var(--accent); }
html[data-palette] .auth-hero .role-chips { scrollbar-color:var(--accent) transparent; }
html[data-palette] .split-wrap .left-panel { background:var(--surface); color:var(--text); }
html[data-palette] .left-panel :is(h1,h2,h3,.field label) { color:var(--text); }
html[data-palette] .left-panel :is(.desc,.note,.footer-note,.avatar-upload-text,.group-count-row span,.map-manual-title,.map-manual-row label,.dynamic-map-hint) { color:var(--text-dim); }
html[data-palette] .left-panel :is(.welcome-tag,.secondary-links a,.avatar-upload-text strong) { color:var(--accent); }
html[data-palette] .left-panel :is(input,select,textarea,.map-manual-coordinates,.avatar-preview) { background:var(--surface-strong); color:var(--text); border-color:var(--control-border); }
html[data-palette] .left-panel :is(input,select,textarea):focus { border-color:var(--accent); box-shadow:var(--ring); }
html[data-palette] .left-panel .btn-otp { background:var(--accent); color:var(--accent-contrast); box-shadow:var(--elev-accent); }
html[data-palette] .left-panel .icon-badge { background:var(--surface-strong); border-color:var(--border); box-shadow:var(--elev-accent); }
html[data-palette][data-theme] :is(.vf-page,.dir-wrap) { --success:inherit; --success-soft:inherit; --warn:inherit; --warn-soft:inherit; --danger:inherit; --danger-soft:inherit; }
html[data-palette][data-theme] :is(.dir-header .mark,.dir-filter-bar button) { background:var(--accent); color:var(--accent-contrast); }
html[data-palette][data-theme] .dir-header .mark { background:var(--surface-strong); box-shadow:none; }
html[data-palette][data-theme] .dir-wrap .dir-header .mark { background:transparent; }
html[data-palette][data-theme] .dir-hero { background:linear-gradient(125deg,var(--hero-bg),color-mix(in srgb,var(--hero-bg) 85%,black)); box-shadow:var(--elev-accent); }
html[data-palette][data-theme] .dir-search :is(input,button) { background:var(--surface); color:var(--text); border-color:var(--control-border); }
html[data-palette][data-theme] .dir-search button { color:var(--accent); }
html[data-palette][data-theme] .dir-wrap :is(a,button,input,select,textarea):focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
html[data-palette][data-theme] .dir-hub-card .card-action { color:var(--accent); }
html[data-palette][data-theme] .dir-hub-guide { background:var(--accent-soft); border-color:var(--border); }
html[data-palette][data-theme] .vf-page .vf-filter-group { --group-accent:var(--accent); --group-soft:var(--accent-soft); }
html[data-palette][data-theme] .vf-page :is(.vf-login-link,.vf-filter-value,.vf-person .photo) { color:var(--accent); }
html[data-palette][data-theme] .vf-page :is(.vf-sidebar-head p,.vf-qr-card .s) { color:var(--text-dim); }
html[data-palette][data-theme] .vf-page .vf-sidebar-head a { color:var(--accent-2); background:var(--surface); border-color:var(--companion-border); }
html[data-palette][data-theme] .vf-page .vf-bars .fill { background:var(--accent); }
html[data-palette][data-theme] .vf-page .status-badge.approved { color:var(--success); background:var(--success-soft); }
html[data-palette][data-theme] .vf-page .vf-public-certificate { background:var(--hero-bg) !important; border-color:var(--accent) !important; box-shadow:var(--elev-accent) !important; }
html[data-palette][data-theme] .vf-page .vf-tree-apply { background:var(--accent); color:var(--accent-contrast); box-shadow:var(--elev-accent); }
html[data-palette][data-theme] .vf-page :is(.vf-person .photo,.vf-bars .track) { background:var(--surface-strong); border-color:var(--border); }
html[data-palette][data-theme] .vf-page .vf-sec-label::before { background:var(--accent); box-shadow:none; }
html[data-palette] .map-chooser-option:not(.map-chooser-option--neshan):not(.map-chooser-option--google) .map-chooser-mark { background:var(--accent); color:var(--accent-contrast); }
html[data-palette][data-theme] .vf-page :is(.vf-tree summary:hover,.vf-filter-row:hover) { background:var(--surface-hover); }
html[data-palette][data-theme] .vf-page .vf-chip.ok { color:var(--success); background:var(--success-soft); border-color:var(--success); }
html[data-palette][data-theme] :is(.dir-nav a[aria-current],.dir-active-filters span,.dir-state-action) { background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
html[data-palette][data-theme] :is(.dir-reset,.dir-wrap .field-row a) { color:var(--accent); }
html[data-palette][data-theme] .dir-state-action:hover { background:var(--surface-hover); }
html[data-palette][data-theme] .dir-skip { background:var(--surface); color:var(--accent); }
/* Primary color identifies actions; its companion anchors navigation and
   supporting information. Keep both visible instead of a single-hue wash. */
html[data-palette] {
  --companion-soft:color-mix(in srgb,var(--accent-2) 12%,var(--surface));
  --companion-border:color-mix(in srgb,var(--accent-2) 28%,var(--surface));
}
html[data-palette][data-theme="light"] { --navigation-bg:var(--navigation-custom,var(--accent-2)); }
html[data-palette][data-theme="dark"] { --navigation-bg:hsl(var(--palette-hue) 35% 12%); }
html[data-palette="navy"] { --hero-bg:#203c78; }
html[data-palette="burgundy"] { --hero-bg:#253f65; }
html[data-palette] .sidebar { background:var(--navigation-bg); color:var(--navigation-ink,#f3f5fa); }
html[data-palette] .sidebar :is(.nav-item,.nav-section-label,.brand-name) { color:var(--navigation-ink,#f3f5fa); }
html[data-palette] .sidebar :is(.logo,.help-card,.help-card p,.help-card a) { color:var(--navigation-ink,#f3f5fa); }
html[data-palette] .sidebar .help-card { background:#ffffff0c; border-color:currentColor; }
html[data-palette] .sidebar .nav-item:hover { background:#ffffff18; color:var(--navigation-ink,#fff); }
html[data-palette] .sidebar .nav-item.active { background:var(--accent); color:var(--accent-contrast); border-color:var(--accent); }
html[data-palette] .sidebar .nav-item.active::before { background:currentColor; box-shadow:none; }
html[data-palette][data-theme] :is(.workspace-hero,.admin-overview .overview-welcome) { background:linear-gradient(110deg,var(--companion-soft),var(--surface)); border-inline-start-color:var(--accent); }
html[data-palette][data-theme] :is(.module-icon,.overview-icon,.dir-hub-card .icon) { background:var(--companion-soft); color:var(--accent-2); }
html[data-palette][data-theme] :is(.workspace-stat .value,.workspace-stat .stat-action,.certificate-eyebrow) { color:var(--accent-2); }
html[data-palette][data-theme] .btn-secondary { color:var(--accent-2); background:var(--companion-soft); border-color:var(--companion-border); }
html[data-palette][data-theme] :is(.vf-page .vf-sidebar-head,.vf-page .vf-filter-group[open] summary,.dir-hub-guide,.certificate-public dl>div) { background:var(--companion-soft); }
html[data-palette][data-theme] .vf-page .vf-hero-visual { background:linear-gradient(145deg,var(--companion-soft),var(--surface-strong)); }
html[data-palette] .plan-stars svg { stroke:var(--accent-2); }
html[data-palette] :is(.plan-stars svg.filled,.plan-star-fill) { fill:var(--accent-2); stroke:var(--accent-2); }
html[data-palette] .auth-hero { background:radial-gradient(ellipse at 20% 25%,var(--companion-soft),transparent 65%),var(--surface-strong); }
html[data-palette] .glass::before { display:none; }
.public-theme-controls { display:flex; justify-content:flex-end; margin:0 0 18px; }
.public-theme-controls .theme-picker { width:min(100%,360px); }
.vf-topbar-actions .public-theme-controls { margin:0; }
html[data-palette][data-theme] .vf-topbar-inner { flex-wrap:wrap; }
html[data-palette][data-theme] .vf-topbar-actions { flex-wrap:wrap; }
.account-controls { display:grid; gap:10px; max-width:100%; }
.theme-picker { display:flex; gap:10px; flex-wrap:wrap; }
.theme-picker label { display:grid; gap:4px; flex:1; min-width:0; font-size:.78rem; color:var(--text-dim); }
.theme-picker label:has([data-palette-select]) { flex:1.6; }
.theme-picker select { width:100%; min-width:0; min-height:44px; border:1px solid var(--control-border); border-radius:10px; background:var(--surface); color:var(--text); padding:6px 8px; font:inherit; }
.theme-picker select:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
@media(max-width:600px) { .account-controls { width:100%; } .account-controls .user-pill { width:100%; } }
@media(max-width:600px) {
  .public-theme-controls,.public-theme-controls .theme-picker { width:100%; }
  .vf-topbar-actions { width:100%; }
  .vf-topbar-actions .public-theme-controls { flex:1; }
}
}
@media print { .theme-picker { display:none; } }
