@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Source+Sans+3:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap');

/* Opt-in Freelancer styling. Operational states keep their semantic colours. */
body.portal-freelancer {
    color-scheme: dark;
    --fl-font-sans: 'Source Sans 3',system-ui,sans-serif;
    --fl-font-mono: 'IBM Plex Mono',monospace;
    --fp-display: 'Syne',system-ui,sans-serif;
    --fl-bg:#070e15; --fl-bg-soft:#0b121a;
    --fl-surface:#0d1621; --fl-surface-soft:#111c28; --fl-surface-muted:#111c28;
    --fl-elevated:#111c28; --fl-glass:#0d1621;
    --fl-text:#e7edf3; --fl-text-strong:#e7edf3; --fl-muted:#8d9aa7; --fl-muted-strong:#a4b0ba;
    --fl-border:#26313c; --fl-border-strong:#394653;
    --fl-accent:#d6ae58; --fl-accent-hover:#e6bf6b; --fl-accent-soft:#d6ae5812;
    --fl-brand:#d6ae58; --fl-brand-hover:#e6bf6b;
    --fl-cyan:#d6ae58; --fl-cyan-soft:#d6ae5812;
    --fl-success:#39ba98; --fl-success-soft:#39ba9812;
    --fl-danger:#e98080; --fl-danger-soft:#e9808012;
    --fl-radius:8px; --fl-radius-lg:13px; --fl-radius-xl:13px;
    --fl-shadow:none; --fl-shadow-sm:none; --fl-shadow-lg:none;
    --fl-focus:0 0 0 3px #d6ae5820;
    --bg:var(--fl-bg); --panel:var(--fl-surface); --panel-2:var(--fl-surface-soft);
    --card:var(--fl-surface); --card-bg:var(--fl-surface); --surface:var(--fl-surface);
    --text:var(--fl-text); --muted:var(--fl-muted); --border:var(--fl-border);
    --accent:var(--fl-accent); --accent2:var(--fl-accent); --primary:var(--fl-accent);
    --font-ui:var(--fl-font-sans); --font-mono:var(--fl-font-mono);
    --em-bg:var(--fl-bg); --em-panel:var(--fl-surface); --em-panel-2:var(--fl-surface-soft);
    --em-text:var(--fl-text); --em-muted:var(--fl-muted); --em-border:var(--fl-border); --em-teal:var(--fl-accent);
    --panel-strong:var(--fl-surface); --panel-soft:var(--fl-surface-soft); --line:var(--fl-border);
    --shadow:none; --soft-shadow:none; --accent-soft:var(--fl-accent-soft); --primary-strong:var(--fl-accent-hover);
    --flight-bg:var(--fl-bg); --flight-panel:var(--fl-surface); --flight-text:var(--fl-text); --flight-muted:var(--fl-muted);
    --flight-line:var(--fl-border); --flight-accent:var(--fl-accent); --flight-accent-2:var(--fl-accent-hover);
    --ach-bg:var(--fl-bg); --ach-panel:var(--fl-surface); --ach-panel-strong:var(--fl-surface-soft);
    --ach-line:var(--fl-border); --ach-text:var(--fl-text); --ach-muted:var(--fl-muted);
    --ach-blue:var(--fl-accent); --ach-blue-2:var(--fl-accent-hover); --ach-good:var(--fl-success); --ach-shadow:none;
    --friends-bg:var(--fl-bg); --friends-panel:var(--fl-surface); --friends-panel-strong:var(--fl-surface-soft);
    --friends-line:var(--fl-border); --friends-text:var(--fl-text); --friends-muted:var(--fl-muted);
    --friends-accent:var(--fl-accent); --friends-accent-soft:var(--fl-accent-soft); --friends-inset:var(--fl-surface-soft); --friends-shadow:none;
    --portal-content-top:calc(var(--portal-topbar-h,64px) + var(--dev-impersonate-banner-h,0px));
    background:radial-gradient(ellipse at 65% 0,rgba(18,38,54,.19),transparent 65%),var(--fl-bg) !important;
    color:var(--fl-text) !important;
    font:15px/1.55 var(--fl-font-sans) !important;
}
body.portal-freelancer::before { display:none !important; }
body.portal-freelancer:has(.sb-mobile-bar) { padding-top:var(--portal-content-top) !important; }
body.portal-freelancer :is(.main,.em-main,.page-wrap) { font-family:var(--fl-font-sans); }
body.portal-freelancer :is(h1,.page-title,.hero-title,.ach-hero h2,.friends-title,.support-command-copy h2) {
    font-family:var(--fp-display) !important; font-weight:700 !important; letter-spacing:-.7px;
}
body.portal-freelancer :is(h2,h3,h4,.ops-title,.panel-title,.section-title) { font-family:var(--fl-font-sans); font-weight:700; }
body.portal-freelancer :is(.mono,.summary-value,.stat-value,.weather-big,.ach-stat strong,.flight-metric strong) { font-family:var(--fl-font-mono) !important; font-weight:500 !important; }
body.portal-freelancer :is(.page-header,.page-head,.friends-toolbar,.support-command-bar,.flight-home-hero,.flight-calendar-head,.ach-hero) {
    background:linear-gradient(135deg,#ffffff06,transparent 55%),var(--fl-surface) !important;
    border:1px solid var(--fl-border) !important; border-radius:13px !important; box-shadow:none !important;
}
body.portal-freelancer :is(.panel,.ops-card,.ops-widget,.stat-card,.summary-card,.data-panel,.quick-panel,.quick-card,.mini-panel,.flight-panel,.flight-card,.trophy-card,.ach-stat,.friend-column,.friend-card,.em-shell,.em-workspace,.flight-calendar-panel,.flight-calendar-mini,.calendar-type-card,.support-stat,.support-help-card) {
    background:linear-gradient(135deg,#ffffff06,transparent 55%),var(--fl-surface) !important;
    border-color:var(--fl-border) !important; border-radius:13px !important; box-shadow:none !important;
}
body.portal-freelancer :is(.panel-head,.panel-heading,.ops-widget-header,.chat-header,.sidebar-header,.window-header,.em-topbar,.em-toolbar) {
    background:var(--fl-surface) !important; border-color:var(--fl-border) !important;
}
body.portal-freelancer :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),textarea,select,.form-control,.form-select,.compose-box,.compose-input,.friend-search,.log-row,.flight-history-row) {
    background:var(--fl-surface-soft) !important; color:var(--fl-text) !important; border-color:var(--fl-border) !important; box-shadow:none;
    font-family:var(--fl-font-sans);
}
body.portal-freelancer :is(.btn-action,.btn-soft,.flight-btn,.find-friends-btn,.friend-action,.ach-back,.btn-ghost,.btn-submit,.page-link-soft) {
    border:1px solid #d6ae5855 !important; border-radius:6px !important; background:#0d1722 !important;
    color:var(--fl-accent) !important; box-shadow:none !important; font:700 12px/1.4 var(--fl-font-sans) !important;
}
body.portal-freelancer :is(.btn-primary,.btn-action.primary,.flight-btn.primary,.btn-submit,.page-link-soft.active,.ach-tabs a.is-active,.em-compose-btn,.compose-btn) {
    background:var(--fl-accent) !important; border-color:var(--fl-accent) !important; color:#101720 !important; box-shadow:none !important;
}
body.portal-freelancer :is(.btn-danger,.friend-action.danger,.flight-btn.danger) { background:#e9808012 !important; color:#e98080 !important; border-color:#e9808040 !important; }
body.portal-freelancer :is(.btn-primary,.btn-action.primary,.flight-btn.primary,.btn-submit):hover { background:#e6bf6b !important; }
body.portal-freelancer :focus-visible { outline:2px solid var(--fl-accent); outline-offset:3px; }
body.portal-freelancer :is(th,.filter-label,.summary-label,.stat-label,.flight-kicker,.ach-kicker) { color:var(--fl-muted) !important; font-weight:600; letter-spacing:1px; }
body.portal-freelancer :is(th,td,.table-soft,.table-shell,.log-table) { border-color:var(--fl-border) !important; }
body.portal-freelancer :is(th,thead) { background:#ffffff02 !important; }
body.portal-freelancer :is(.table-soft td,.log-row td) { background:var(--fl-surface) !important; }
body.portal-freelancer :is(.badge-pill,.data-tag,.route-pill,.hero-pill,.chip) { border-color:var(--fl-border) !important; background:#ffffff03 !important; box-shadow:none; }
body.portal-freelancer :is(.quick-ico,.panel-title>i,.ops-title>i,.flight-kicker>i,.support-kicker,.em-mailbox-address,.em-empty>i) { color:var(--fl-accent) !important; }
body.portal-freelancer .sb-mobile-bar { background:#0b121a !important; border-color:var(--fl-border) !important; }
body.portal-freelancer .sidebar { background:#0b121a !important; border-color:var(--fl-border) !important; }
body.portal-freelancer .ach-ring { box-shadow:none; }
body.portal-freelancer .ach-ring-core { background:var(--fl-panel,var(--fl-surface)) !important; }
body.portal-freelancer .trophy-progress { background:var(--fl-border) !important; }
body.portal-freelancer .trophy-progress>span { background:var(--fl-success) !important; }
body.portal-freelancer .friend-card { background:var(--fl-surface-soft) !important; }
body.portal-freelancer .friend-menu { background:var(--fl-surface-soft); border-color:var(--fl-border); }
body.portal-freelancer .em-mailbox-address { font-family:var(--fl-font-mono); }
body.portal-freelancer :is(.em-folder.active,.em-folder.is-active,.em-filter.active) { color:var(--fl-accent) !important; background:var(--fl-accent-soft) !important; }
body.portal-freelancer .em-composer { background:var(--fl-surface); color:var(--fl-text); }
body.portal-freelancer :is(.flight-calendar-day) { background:var(--fl-surface) !important; border-color:var(--fl-border) !important; }
body.portal-freelancer :is(.flight-calendar-day.is-selected,.flight-calendar-day:hover) { background:#d6ae5812 !important; border-color:#d6ae5870 !important; }
body.portal-freelancer :is(.flight-calendar-day.is-today .day-number) { background:var(--fl-accent) !important; color:#101720 !important; }
/* Fixed messaging canvases must reserve the actual portal-header height. */
body.portal-freelancer:not(.mail-overlay) .os-desktop {
    top:var(--portal-content-top) !important; bottom:0 !important;
    height:auto !important; min-height:0;
}
body.portal-freelancer:not(.mail-overlay) :is(.mail-sidebar,.mail-stage,.chat-window) {
    height:100% !important; min-height:0 !important; max-height:100% !important;
    background:var(--fl-surface) !important; border-color:var(--fl-border) !important; box-shadow:none !important;
}
body.portal-freelancer :is(.msg-me,.message.sent .message-bubble,.chat-msg.msg-me) { background:#d6ae5820 !important; border:1px solid #d6ae5840; color:var(--fl-text) !important; box-shadow:none !important; }
body.portal-freelancer :is(.msg-other,.window-input,.chat-input-area,.message-input) { background:var(--fl-surface-soft) !important; border-color:var(--fl-border) !important; color:var(--fl-text) !important; }
body.portal-freelancer .thread-item.active { background:#d6ae5812 !important; border-color:#d6ae5840 !important; }
body.portal-freelancer.portal-messages>.main { height:calc(100dvh - var(--portal-content-top)) !important; min-height:0 !important; }
@media(max-width:760px) {
    body.portal-freelancer:not(.mail-overlay) :is(.mail-sidebar,.chat-window) {
        top:var(--portal-content-top) !important; bottom:0 !important;
        height:calc(100dvh - var(--portal-content-top)) !important; max-height:calc(100dvh - var(--portal-content-top)) !important;
        padding-top:0 !important;
    }
}
@media(prefers-reduced-motion:reduce) { body.portal-freelancer * { scroll-behavior:auto !important; } }
