/* ===========================================================================
   LinkSpace Chat skin for Element Web
   ---------------------------------------------------------------------------
   Loaded by the container entrypoint, which copies this file into /app and
   adds a <link> to index.html. It is applied on top of Element's own
   stylesheets, so an Element upgrade cannot silently drop it.

   Approach: Element 1.12 builds its UI from Compound design tokens, and every
   accent surface resolves back to the `green` primitive ramp
   (--cpd-color-text-action-accent is --cpd-color-green-900, and so on).
   Re-mapping those 14 primitives re-skins links, badges, selection, toggles,
   focus rings and the composer in one move, while keeping the tonal
   relationships Compound designed.

   Compound flips its ramps between light and dark (step 900 is a deep tone
   on a light ground and a bright one on a dark ground), so there is one cyan
   ramp per theme, both hued to the CAMTEL cyan (#00B0F0). The app is dark by
   default, so the dark ramp is also the fallback on :root.

   Nothing here changes Element's layout or spacing rhythm. Those carry real
   usability decisions, so this is a re-skin, not a re-build.
   =========================================================================== */

/* --- Typography: the same faces the app uses, self-hosted, no CDN -------- */
@font-face {
    font-family: 'Inter';
    src: url('camtel-fonts/inter-var.woff2') format('woff2-variations');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Plex Mono';
    src: url('camtel-fonts/ibm-plex-mono-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Plex Mono';
    src: url('camtel-fonts/ibm-plex-mono-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* --- CAMTEL accent ramp, dark (default) ---------------------------------- */
:root,
.cpd-theme-dark,
.mx_theme_dark {
    --cpd-color-green-100: #071a26;
    --cpd-color-green-200: #08202f;
    --cpd-color-green-300: #0a2a3d;
    --cpd-color-green-400: #0c3a55;
    --cpd-color-green-500: #0e4b6e;
    --cpd-color-green-600: #106592;
    --cpd-color-green-700: #0f83bd;
    --cpd-color-green-800: #00a0d8;
    --cpd-color-green-900: #38bdf8;
    --cpd-color-green-1000: #5cc9f8;
    --cpd-color-green-1100: #86d7fa;
    --cpd-color-green-1200: #b1e5fb;
    --cpd-color-green-1300: #d6f1fd;
    --cpd-color-green-1400: #eef9fe;

    /* Element's older, non-Compound variables still drive a few surfaces. */
    --accent: #00b0f0;
    --accent-color: #00b0f0;
    --accent-1200: #b1e5fb;

    --cpd-font-family-sans: 'Inter', ui-sans-serif, system-ui, -apple-system,
        'Segoe UI', Roboto, sans-serif;
}

/* --- CAMTEL accent ramp, light ------------------------------------------- */
.cpd-theme-light,
.mx_theme_light {
    --cpd-color-green-100: #f4fbfe;
    --cpd-color-green-200: #e9f7fd;
    --cpd-color-green-300: #d6f0fb;
    --cpd-color-green-400: #a9e0f6;
    --cpd-color-green-500: #6fc9ef;
    --cpd-color-green-600: #38b3e6;
    --cpd-color-green-700: #0093cf;
    --cpd-color-green-800: #00709e;
    --cpd-color-green-900: #00587d;
    --cpd-color-green-1000: #004e6f;
    --cpd-color-green-1100: #004360;
    --cpd-color-green-1200: #00354c;
    --cpd-color-green-1300: #002738;
    --cpd-color-green-1400: #001a26;

    --accent: #0093cf;
    --accent-color: #0093cf;
    --accent-1200: #00354c;
}

body,
.mx_MatrixChat,
.mx_MatrixChat_wrapper {
    font-family: var(--cpd-font-family-sans);
}

/* Code and inline monospace pick up the app's mono face. */
code, pre, .mx_EventTile_content code, .mx_EventTile_pre {
    font-family: 'Plex Mono', ui-monospace, Consolas, monospace;
}

/* --- Brand mark ----------------------------------------------------------
   Staff are sent straight through SSO and rarely see the auth screens, but
   anyone who does must see the LinkSpace mark, never Element's wordmark. The
   mark keeps its aspect ratio and is never stretched. */
.mx_Welcome .mx_AuthHeaderLogo img,
.mx_AuthHeaderLogo img,
.mx_ServerPicker_headerLogo {
    content: url('linkspace-mark.png');
    max-height: 44px;
    width: auto;
    object-fit: contain;
}

/* Belt and braces under config: nothing on the auth pages may advertise
   another client. */
.mx_AuthBody_mobileApps,
.mx_MobileAppDownload,
.mx_AuthFooter {
    display: none !important;
}

/* --- Ground --------------------------------------------------------------
   The auth pages paint their own background; ours is the app's sky so the
   frame reads as part of one product during the brief SSO hand-off. */
.mx_AuthPage {
    background: #050B1A !important;
}

/* --- Mobile polish -------------------------------------------------------
   Element inside the CAMTEL workspace runs in a frame that already provides
   the app chrome, so on a phone the goal is to give the timeline back as much
   width as possible without touching Element's layout logic. */
@media (max-width: 640px) {
    /* Element's own safe-area padding assumes it owns the viewport; inside the
       shell the frame handles that, so the doubled inset is removed. */
    .mx_MatrixChat_wrapper {
        padding-bottom: 0;
    }

    /* Reclaim horizontal room in the timeline on narrow screens. */
    .mx_EventTile {
        padding-inline: 8px;
    }
}

/* --- Focus visibility ----------------------------------------------------
   Match the app, where keyboard focus is the one place the Cameroon-flag
   gold appears. Element's default focus ring is the accent colour, which is
   now cyan and therefore harder to separate from selected state. */
:focus-visible {
    outline: 3px solid #fcd116 !important;
    outline-offset: 2px;
}
