/* Shared F&F identity. Load after page layout styles on every web surface. */
@font-face { font-family:'FF Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('fonts/inter-regular.ttf') format('truetype'); }
@font-face { font-family:'FF Inter'; font-style:normal; font-weight:500; font-display:swap; src:url('fonts/inter-medium.ttf') format('truetype'); }
@font-face { font-family:'FF Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('fonts/inter-semibold.ttf') format('truetype'); }
@font-face { font-family:'FF Inter'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/inter-bold.ttf') format('truetype'); }
:root, :root[data-theme="dark"] {
    color-scheme:dark;
    --brand-gold:#ffc345; --brand-gold-hover:#ffd16a; --brand-ink:#201a0e;
    --bg:#101416; --bg-soft:#13181b; --surface:#181d20;
    --surface-muted:#1d2327; --surface-raised:#22292d;
    --text:#f3f4f5; --text-muted:#acb4be; --text-subtle:#808b96;
    --border:#2b3237; --border-strong:#465057;
    --primary:var(--brand-gold); --primary-strong:var(--brand-gold-hover); --primary-soft:#29261c;
    --success:#69d89a; --success-soft:#162d23; --danger:#ff8585; --danger-soft:#341f23;
    --warning:var(--primary); --warning-soft:var(--primary-soft); --info:#b7c5d0;
    --shadow-sm:none; --shadow-md:0 8px 24px #0002; --shadow-lg:0 16px 40px #0004;
    --brand-radius:10px; --brand-card-radius:14px;
}
:root[data-theme="light"] {
    color-scheme:light;
    --bg:#f5f6f7; --bg-soft:#f0f1f3; --surface:#fff; --surface-muted:#f4f5f6;
    --surface-raised:#e9ecef; --text:#20262b; --text-muted:#57626d; --text-subtle:#65727c;
    --border:#dce0e3; --border-strong:#bbc3ca;
    --primary:#936000; --primary-strong:#785000; --primary-soft:#fff2cf;
    --success:#197948; --success-soft:#e7f5ec; --danger:#b32938; --danger-soft:#ffebee; --info:#485d6b;
}
/* Bridge established component variables to the single palette. */
:root, :root[data-theme] {
    --panel:var(--surface); --panel-soft:var(--surface-muted); --panel-strong:var(--surface-raised);
    --muted:var(--text-muted); --line:var(--border); --line-bright:var(--border-strong);
    --accent:var(--primary); --accent-bright:var(--primary-strong); --accent-strong:var(--primary-strong); --accent-2:var(--primary);
    --purple:var(--primary); --shadow:var(--shadow-lg);
    --accent-purple:var(--primary); --accent-green:var(--success); --good:var(--success); --warn:var(--warning); --shadow-soft:var(--shadow-sm);
    --control-bg:var(--bg); --control-bg-2:var(--bg-soft); --control-panel:var(--surface);
    --control-panel-strong:var(--surface-raised); --control-text:var(--text); --control-muted:var(--text-muted);
    --control-line:var(--border); --control-line-bright:var(--border-strong);
    --control-blue:var(--primary); --control-cyan:var(--primary); --control-purple:var(--primary);
    --control-gold:var(--primary); --control-green:var(--success);
    --auth-bg:var(--bg); --auth-panel:var(--surface); --auth-panel-strong:var(--surface-raised);
    --auth-border:var(--border); --auth-border-hot:var(--primary); --auth-text:var(--text); --auth-muted:var(--text-muted);
    --auth-blue:var(--brand-gold); --auth-blue-strong:var(--brand-gold-hover); --auth-blue-soft:var(--primary-soft);
    --auth-cyan:var(--primary); --auth-purple:var(--primary); --auth-danger:var(--danger); --auth-warning:var(--warning);
}
body.ff-page, body.tv-page, body.auth-page { background:var(--bg); color:var(--text); font-family:'FF Inter','Segoe UI',system-ui,sans-serif; }
:root[data-theme] body:is(.ff-page,.tv-page,.auth-page) { background:var(--bg); }
body :is(button,input,select,textarea) { font-family:inherit; }
body :focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
body :is(input,select,textarea) { accent-color:var(--primary); }
::selection { background:var(--primary-soft); color:var(--text); }
/* Shared components; dimensions and behavior stay with each page layout. */
:root[data-theme] body :is(.ff-card,.control-card,.panel,.card,.module-registry-card,.premium-guild-card,.plex-admin,.request-dialog,.login-card,.search-panel,.wishes,.hero,.auth-card) {
    background:var(--surface); border-color:var(--border); color:var(--text); border-radius:var(--brand-card-radius); box-shadow:var(--shadow-sm);
}
:root[data-theme] body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),select,textarea) {
    background:var(--bg-soft); border-color:var(--border-strong); color:var(--text); border-radius:6px;
}
:root[data-theme] body :is(.ff-server-picker select) { background:transparent; border:0; }
:root[data-theme] body :is(.table-action,.button,.btn-primary,.control-button,.discord-login-btn) {
    border-radius:6px; box-shadow:none; text-shadow:none; font-weight:600;
}
:root[data-theme] body :is(.table-action,.button,.button.secondary,.button-secondary,.control-button,.discord-login-btn.secondary,.discord-login-btn.invite) {
    background:var(--surface-muted); border-color:var(--border-strong); color:var(--text);
}
:root[data-theme] body :is(.button.primary,.button-primary,.button.discord,.btn-primary,.discord-login-btn:not(.secondary):not(.invite),.control-button[type="submit"]) {
    background:var(--brand-gold); border-color:var(--brand-gold); color:var(--brand-ink);
}
:root[data-theme] body :is(.button.primary,.button-primary,.button.discord,.btn-primary,.discord-login-btn:not(.secondary):not(.invite)):hover {
    background:var(--brand-gold-hover); border-color:var(--brand-gold-hover); color:var(--brand-ink);
}
:root[data-theme] body :is(.table-action,.button.secondary,.button-secondary,.control-button):hover {
    background:var(--surface-raised); border-color:var(--primary); color:var(--text);
}
:root[data-theme] body :is(.table-action.danger,.button.danger,.button.danger-outline,.btn-danger) {
    background:var(--danger-soft); border-color:var(--danger); color:var(--danger);
}
:root[data-theme] body :is(.notice,.panel-note,.preview-mode-banner,.auth-alert-warning) {
    background:var(--primary-soft); border-color:var(--border-strong); color:var(--text);
}
:root[data-theme] body :is(.notice.error,.auth-alert:not(.auth-alert-warning)) {
    background:var(--danger-soft); border-color:var(--danger); color:var(--danger);
}
:root[data-theme] body :is(.notice.success,.request-success) {
    background:var(--success-soft); border-color:var(--success); color:var(--success);
}
:root[data-theme] body :is(.auth-alert strong,.auth-alert-warning strong) { color:inherit; }
:root[data-theme] body :is(.compact-table th,.table th,.plex-admin th) { background:var(--surface-muted); color:var(--text-muted); border-color:var(--border); }
:root[data-theme] body :is(.compact-table td,.table td,.plex-admin td) { border-color:var(--border); }
:root[data-theme] body :is(.compact-table tr:hover td,.table tr:hover td) { background:var(--surface-muted); }
:root[data-theme] body :is(.hero-tags span,.tag,.badge,.status-pill,.status) { background:var(--surface-muted); border-color:var(--border); color:var(--text-muted); }
:root[data-theme] body :is(.status-pill.online,.status-pill.healthy,.status-pill.success,.status-approved,.status-added,.status-completed,.tv-wish-status.status-approved,.tv-wish-status.status-completed) { background:var(--success-soft); color:var(--success); border-color:var(--success); }
:root[data-theme] body :is(.status-pill.error,.status-pill.danger,.status-pill.offline,.status-rejected,.status-cancelled,.status-failed,.tv-wish-status.status-rejected) { background:var(--danger-soft); color:var(--danger); border-color:var(--danger); }
:root[data-theme] body :is(.status-pill.warning,.status-pill.pending,.status-new,.status-pending,.status-reviewing,.tv-wish-status.status-pending) { background:var(--primary-soft); color:var(--primary); border-color:var(--border-strong); }
:root[data-theme] body :is(.stat-icon,.module-icon,.metric-icon,.quick-icon,.module-registry-icon) { background:var(--primary-soft); color:var(--primary); border-color:var(--border); }
:root[data-theme] body :is(.server-detail-tabs a.is-active,.tabs a.is-active,.tabs button.is-active,.tab-link.is-active) { background:var(--primary-soft); color:var(--primary); border-color:var(--primary); }
:root[data-theme] body :is(.topbar,.control-topbar,.owner-mini-panel,.owner-overview-list > div,.global-controls,.command-sync-status,.empty-state,.empty-dashboard-state) { background:var(--surface-muted); border-color:var(--border); color:var(--text); box-shadow:none; }
/* Brand assets and login. */
body.auth-page::before, body.auth-page::after, .auth-card::before { display:none; }
:root[data-theme] body .auth-logo { background:#101416; border:1px solid var(--border); box-shadow:none; border-radius:var(--brand-card-radius); width:112px; height:112px; }
.auth-logo img { width:100%; height:100%; object-fit:contain; }
:root[data-theme] body .hero-bot-image { object-fit:contain; background:#101416; padding:12px; border-radius:var(--brand-card-radius); filter:none; }
:root[data-theme] body .discord-glyph { background:transparent; }
:root[data-theme] .discord-login-btn:not(.secondary):not(.invite) .discord-glyph { color:var(--brand-ink); }
:root[data-theme] .discord-login-btn:not(.secondary):not(.invite) .discord-glyph path { fill:currentColor; }
body .brand-theme-toggle { display:inline-flex; align-items:center; justify-content:center; min-width:40px; min-height:40px; padding:8px 12px; border:1px solid var(--border-strong); border-radius:6px; background:var(--surface); color:var(--text); cursor:pointer; }
.auth-card > .brand-theme-toggle { justify-self:end; }
/* Plex uses the same brand without importing the dashboard's layout. */
body.tv-page { font-size:14px; line-height:1.5; }
.tv-page .tv-header, .tv-page .tv-footer { background:var(--bg); border-color:var(--border); backdrop-filter:none; }
.tv-page .tv-brand img { width:60px; height:60px; object-fit:contain; }
.tv-page .tv-brand { color:var(--text); }
.tv-page .flag-button { box-shadow:none; }
.tv-page .flag-button.is-active { border-color:var(--primary); box-shadow:0 0 0 2px var(--primary-soft); }
.tv-page .tv-vision-points span { color:var(--text-muted); }
.tv-page .eyebrow { color:var(--primary); }
.tv-page :is(.request-stage,.preference-panel,.scope-panel,.catalog-options,.request-summary > div,.request-toolbar,.tv-vision-points span,.scope-flags) { background:var(--surface-muted); border-color:var(--border); }
.tv-page :is(.scope-option,.catalog-choice) { background:var(--surface); border-color:var(--border-strong); }
.tv-page :is(.scope-option,.catalog-choice):has(input:checked) { background:var(--primary-soft); border-color:var(--primary); }
.tv-page .request-steps li.is-current > span { background:var(--primary-soft); border-color:var(--primary); color:var(--primary); }
.tv-page .request-steps li.is-complete > span, .tv-page .success-mark { background:var(--success-soft); color:var(--success); }
.tv-page .poster-fallback { background:var(--surface-raised); color:var(--text-muted); }
.tv-page .cancel-zone { background:var(--danger-soft); border-color:var(--danger); }
.tv-page .request-dialog::backdrop { background:#0009; }
:root[data-theme="light"] .tv-brand img { background:#101416; border-radius:8px; }
@media(max-width:600px) { .tv-page .tv-header { height:auto; min-height:78px; padding:8px 12px; gap:10px; flex-wrap:wrap; } .tv-page .tv-header-actions { flex-wrap:wrap; justify-content:flex-end; gap:8px; } .tv-page .tv-brand img { width:44px; height:48px; } .tv-page .tv-brand { font-size:16px; } }
@media(prefers-reduced-motion:reduce) { .tv-page *, .auth-page * { animation:none !important; transition:none !important; scroll-behavior:auto !important; } }
