/* ============================================
   RV0K / IPS-STYLE THEME - COMPLETE REBUILD
   For MyBB using IPS layout classnames
   ============================================
   - Accent color driven by --rv0k-accent (from Rv0k Theme Engine)
   - Optional canvas overlay background (#rv0k-bg-canvas)
   - Desktop: fixed sidebar + header aligned to it
   - Mobile: NO SIDEBAR, full-width header like stock theme
   ============================================ */

/* ============================================
   1. CSS VARIABLES & THEME CONFIGURATION
   ============================================ */

:root {
    /* Spacing System */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-7: 32px;
    --sp-8: 40px;
    --sp-9: 48px;
    --sp-10: 64px;

    /* Border Radius */
    --radius-1: 4px;
    --radius-2: 8px;

    /* Borders */
    --border-1px: 1px solid rgba(var(--theme-text_light), 0.15);

    /* Color Palette - Semantic */
    --positive-dark: #2C8C69;
    --positive-light: #f0faf6;
    --negative-dark: #C53030;
    --negative-light: #FFF5F5;
    --intermediate-dark: #DD6B20;
    --intermediate-light: #FFFAF0;
    --informational-dark: #2981bf;
    --informational-light: #e9f0f5;
    --general-dark: #7f858d;
    --general-light: #f0f4f8;

    /* Box Styling */
    --box--boxShadow: 0px 2px 4px -1px rgba(var(--theme-area_background_dark), 0.1);
    --box--color: rgb(var(--theme-area_background_dark));
    --box--backgroundColor: rgb(var(--theme-area_background_reset));
    --box--radius: var(--radius-1);

    /* Component-Specific */
    --popup--radius: var(--radius-1);
    --popup--border: 1px solid rgba(var(--theme-area_background_dark), 0.1);
    --popup--boxShadow: 0 8px 50px rgba(0, 0, 0, 0.1), 0px 4px 15px rgba(0, 0, 0, 0.05);
    --dialog--boxShadow: 0px 5px 55px rgba(var(--theme-area_background_dark), 0.4),
                         0px 7px 24px -12px rgba(var(--theme-area_background_dark), 0.7);

    /* Layout Dimensions */
    --header--height: 80px;
    --responsive-header--height: 55px;
    --logo--height: 100%;
    --primary-navigation--height: 52px;
    --secondary-navigation--height: 50px;

    /* Sidebar Dimensions (desktop only) */
    --sidebar--width-desktop: 60px;

    /* Form Elements */
    --form-field--radius: var(--radius-1);
    --form-field--borderColor: rgba(var(--theme-text_light), 0.4);
    --form-field--borderHoverColor: rgba(var(--theme-text_light), 0.8);
    --form-field--focusShadow: rgba(var(--theme-active_input_border), 0.3) 0px 0px 0px 4px;

    /* Button Styling */
    --button--radius: var(--radius-1);

    /* Trophy Colors */
    --trophy-first--background: #fac746;
    --trophy-first--color: #704926;
    --trophy-second--background: #c0c0c0;
    --trophy-third--background: #cd7f32;

    /* Container Widths */
    --container--width: var(--ae-container-width);
    --minimal_container--width: var(--ae-container-width-minimal);

    /* Theme Colors (RGB) */
    --theme-active_input_border: 251, 196, 40;
    --theme-alternate_button: 22, 22, 29;
    --theme-area_background: 26, 26, 33;
    --theme-area_background_dark: 26, 26, 33;
    --theme-area_background_light: 26, 26, 33;
    --theme-area_background_reset: 22, 22, 29;
    --theme-brand_primary: 251, 196, 40;
    --theme-page_background: 17, 17, 23;
    --theme-text_color: 188, 188, 188;
    --theme-text_dark: 188, 188, 188;
    --theme-text_light: 153, 153, 153;
    --theme-text_very_light: 255, 255, 255;

    /* Rv0k Accent hook
       - JS from Rv0k Theme Engine sets --rv0k-accent dynamically
       - We feed that into existing theme vars
    */
    --rv0k-accent: #fbc428; /* default, overridden by JS */
    --accent-color: var(--rv0k-accent);

    --ae-main-color: var(--accent-color);
    --ae-second-color: var(--accent-color);
    --theme-link: var(--theme-brand_primary);
    --theme-link_hover: var(--theme-brand_primary);
}


/* ============================================
   2. RESET & BASE STYLES
   ============================================ */

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

html {
    min-height: 100%;
    position: relative;
    line-height: 1.15;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
                 "Segoe UI Symbol";
    font-size: 13px;
    line-height: 1.5;
    color: rgb(var(--theme-text_color));
    height: 100%;
    background-color: rgb(var(--theme-page_background));
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden !important;
    position: relative; /* Needed for canvas layering */
}

/* Remove scrolling when needed */
body.ipsNoScroll {
    overflow: hidden;
}

/* Link Styles */
a {
    color: rgb(var(--theme-link));
    text-decoration: none;
    -webkit-text-decoration-skip: objects;
}

a:hover {
    color: rgb(var(--theme-link_hover));
}

a:active,
a:focus,
a:hover {
    outline: 0 !important;
}

/* Image Defaults */
img {
    vertical-align: middle;
    border-style: none;
}

/* Emoji Support */
span.ipsEmoji,
div.ipsEmoji {
    font-weight: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
                 "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";
}

img.ipsEmoji {
    height: 1.25em;
    width: 1.25em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}


/* ============================================
   2.1 CANVAS BACKGROUND OVERLAY
   ============================================ */

#rv0k-bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Ensure main layout is above canvas */
#ipsLayout_sidebar,
#ipsLayout_header,
#ipsLayout_mainArea,
#ipsLayout_contentArea,
#ipsLayout_body {
    position: relative;
    z-index: 1;
}


/* ============================================
   3. TYPOGRAPHY
   ============================================ */

.ipsType_pageTitle,
.ipsType_sectionTitle,
.ipsType_secondaryTitle,
.ipsType_sectionHead,
.ipsType_minorHeading {
    font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.ipsType_pageTitle {
    font-size: 24px;
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: 0;
    color: rgb(var(--theme-text_dark));
}

.ipsType_pageTitle > .fa {
    font-size: 18px;
}

.ipsType_pageTitle a:not(.ipsBadge):not(.ipsButton) {
    color: inherit;
}

.ipsType_sectionTitle {
    font-size: 16px;
    line-height: 1;
    font-weight: bold;
    background: var(--ae-title-color);
    padding: var(--ae-ten-px);
    margin: 0;
    color: rgb(var(--theme-section_title_font));
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.ipsType_sectionHead {
    font-size: 18px;
    color: rgb(var(--theme-text_dark));
    line-height: 24px;
    font-weight: bold;
    display: inline-block;
    margin: 0;
}

.ipsType_minorHeading {
    color: rgb(var(--theme-text_light));
    text-transform: uppercase;
    font-size: 12px;
    margin: 0;
}

/* Sizes */
.ipsType_small { font-size: 12px; }
.ipsType_small:not(.ipsType_richText) { line-height: 1.45; }

.ipsType_medium { font-size: 13px; }
.ipsType_medium:not(.ipsType_richText) { line-height: 1.53; }

.ipsType_normal { font-size: 14px; }
.ipsType_normal:not(.ipsType_richText) { line-height: 1.5; }

.ipsType_large { font-size: 16px; }
.ipsType_large:not(.ipsType_richText) { line-height: 1.25; }

.ipsType_veryLarge {
    font-size: 36px;
    line-height: 1.18;
    font-weight: bold;
    letter-spacing: -0.9px;
    color: rgb(var(--theme-text_dark));
}

.ipsType_huge {
    font-size: 64px;
    line-height: 1.11;
    font-weight: 300;
    color: rgb(var(--theme-text_dark));
}

/* Alignment */
.ipsType_center { text-align: center; }
.ipsType_left { text-align: left; }
html[dir="rtl"] .ipsType_left { text-align: right; }
.ipsType_right { text-align: right; }
html[dir="rtl"] .ipsType_right { text-align: left; }
.ipsType_justify { text-align: justify; }

/* Style helpers */
.ipsType_bold { font-weight: bold; }
.ipsType_unbold { font-weight: normal; }
.ipsType_monospace { font-family: monospace; }
.ipsType_uppercase { text-transform: uppercase; }

.ipsType_light { color: rgb(var(--theme-text_light)); }
.ipsType_dark { color: rgb(var(--theme-text_dark)); }
.ipsType_warning,
.ipsType_negative { color: var(--negative-dark); }
.ipsType_success,
.ipsType_positive { color: var(--positive-dark); }
.ipsType_neutral { color: rgb(var(--theme-text_light)); }

/* Rich text */
.ipsType_richText {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
}

.ipsType_richText a { text-decoration: underline; }

.ipsType_richText > p:first-child { margin-top: 0; }
.ipsType_richText > p:last-child { margin-bottom: 0; }

.ipsType_richText img {
    max-width: 100%;
}

/* Highlight */
mark {
    background: rgba(var(--theme-featured), 0.1);
    padding: 0 5px;
    color: rgb(var(--theme-featured)) !important;
    font-weight: inherit;
    display: inline-block;
    border-radius: var(--radius-1);
}


/* ============================================
   4. LAYOUT & GRID SYSTEM
   ============================================ */

/* Main layout wrappers */

#ipsLayout_body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.ipsWrapper,
#ipsLayout_wrap {
    margin: 0 !important;
    padding: 0 !important;
}

/* SIDEBAR (DESKTOP ONLY) */

#ipsLayout_sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: var(--sidebar--width-desktop) !important;
    min-width: var(--sidebar--width-desktop) !important;
    max-width: var(--sidebar--width-desktop) !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #0d0d10 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateZ(0) !important;
}

/* Sidebar scrollbar */
#ipsLayout_sidebar::-webkit-scrollbar {
    width: 3px;
}
#ipsLayout_sidebar::-webkit-scrollbar-track {
    background: transparent;
}
#ipsLayout_sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#ipsLayout_sidebar a,
#ipsLayout_sidebar button,
#ipsLayout_sidebar .sidebar-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 12px 0 !important;
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#ipsLayout_sidebar a:hover,
#ipsLayout_sidebar button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* MAIN AREA (DESKTOP) */

#ipsLayout_mainArea,
#ipsLayout_contentArea {
    margin-left: var(--sidebar--width-desktop) !important;
    width: calc(100% - var(--sidebar--width-desktop)) !important;
    display: block !important;
    min-height: 350px;
    padding: 0;
}

/* HEADER (DESKTOP) */

#ipsLayout_header {
    position: sticky !important;
    top: 0 !important;
    left: var(--sidebar--width-desktop) !important;
    width: calc(100vw - var(--sidebar--width-desktop)) !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 10000 !important;
    background-color: rgb(var(--theme-page_background)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 0 !important;
    transform: translateZ(0) !important;
}

#ipsLayout_header header {
    background-color: var(--ae-title-color) !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Enhanced shadow when scrolled */
#ipsLayout_header.is-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

/* Container inside header */
#ipsLayout_header .ipsLayout_container,
#ipsLayout_header header > .ipsLayout_container {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Generic container */
.ipsLayout_container {
    max-width: var(--container--width);
    padding: 0 15px;
    margin: 0 auto;
    position: relative;
}

/* GRID */

ul.ipsGrid,
ol.ipsGrid {
    padding: 0;
    margin: 0;
}

.ipsGrid:before,
.ipsGrid:after {
    display: table;
    content: "";
    line-height: 0;
}

.ipsGrid:after {
    clear: both;
}

.ipsGrid > [class*="ipsGrid_span"] {
    display: block;
    width: 100%;
    min-height: 30px;
    box-sizing: border-box;
}

html[dir="ltr"] .ipsGrid > [class*="ipsGrid_span"] {
    float: left;
    margin-left: 2.127659574468085%;
}

html[dir="rtl"] .ipsGrid > [class*="ipsGrid_span"] {
    float: right;
    margin-right: 2.127659574468085%;
}

/* Grid spans */
.ipsApp .ipsGrid > .ipsGrid_span12 { width: 100%; }
.ipsApp .ipsGrid > .ipsGrid_span11 { width: 91.48936170212765%; }
.ipsApp .ipsGrid > .ipsGrid_span10 { width: 82.97872340425532%; }
.ipsApp .ipsGrid > .ipsGrid_span9 { width: 74.46808510638297%; }
.ipsApp .ipsGrid > .ipsGrid_span8 { width: 65.95744680851064%; }
.ipsApp .ipsGrid > .ipsGrid_span7 { width: 57.44680851063829%; }
.ipsApp .ipsGrid > .ipsGrid_span6 { width: 48.93617021276595%; }
.ipsApp .ipsGrid > .ipsGrid_span5 { width: 40.42553191489362%; }
.ipsApp .ipsGrid > .ipsGrid_span4 { width: 31.914893617021278%; }
.ipsApp .ipsGrid > .ipsGrid_span3 { width: 23.404255319148934%; }
.ipsApp .ipsGrid > .ipsGrid_span2 { width: 14.893617021276595%; }
.ipsApp .ipsGrid > .ipsGrid_span1 { width: 6.382978723404255%; }

/* Flexbox utilities */
.ipsFlex { display: flex; }
.ipsFlex > * {
    flex: 0 1 auto;
    min-width: 0;
}

.ipsFlex-ai\:start { align-items: flex-start; }
.ipsFlex-ai\:center { align-items: center; }
.ipsFlex-ai\:end { align-items: flex-end; }
.ipsFlex-ai\:stretch { align-items: stretch; }

.ipsFlex-jc\:start { justify-content: flex-start; }
.ipsFlex-jc\:center { justify-content: center; }
.ipsFlex-jc\:end { justify-content: flex-end; }
.ipsFlex-jc\:around { justify-content: space-around; }
.ipsFlex-jc\:between { justify-content: space-between; }

.ipsFlex-fd\:column { flex-direction: column; }
.ipsFlex-fd\:row { flex-direction: row; }

.ipsFlex-fw\:wrap { flex-wrap: wrap; }
.ipsFlex-fw\:nowrap { flex-wrap: nowrap; }


/* ============================================
   5. NAVIGATION COMPONENTS
   ============================================ */

#ipsLayout_header nav {
    position: relative;
}

.ipsNavBar_primary > ul,
.ipsNavBar_secondary {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ipsNavBar_primary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#ipsLayout_header .ipsNavBar_primary {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

#ipsLayout_header .ipsNavBar_primary > ul {
    margin: 0 !important;
    padding: 0 !important;
}

.ipsNavBar_primary > ul > li,
.ipsNavBar_secondary > li {
    display: inline-block;
}

html[dir="ltr"] .ipsNavBar_primary > ul > li,
html[dir="ltr"] .ipsNavBar_secondary > li {
    float: left;
}

html[dir="rtl"] .ipsNavBar_primary > ul > li,
html[dir="rtl"] .ipsNavBar_secondary > li {
    float: right;
}

.ipsNavBar_primary > ul > li > a {
    font-size: 14px;
    color: inherit;
    padding: 0 18px;
    height: 55px;
    line-height: 55px;
    font-weight: 600;
    transition: ease-in-out 0.5s;
    z-index: 999;
}

.ipsNavBar_primary > ul > li > a:hover {
    color: var(--ae-second-color);
    transition: ease-in 0.4s;
}

.ipsNavBar_primary > ul > li.ipsNavBar_active > a {
    color: var(--ae-second-color) !important;
}

/* Logo and site title */

#ipsLayout_header #elLogo {
    margin: 0 !important;
    padding: 0 15px 0 0 !important;
    border: 0 !important;
}

#ipsLayout_header #elLogo img {
    border: 0 !important;
    border-right: 0 !important;
    padding-right: 15px;
}

#ipsLayout_header #elSiteTitle {
    margin: 0 !important;
    padding: 0 15px 0 0 !important;
}

/* User nav */
#ipsLayout_header #elUserNav {
    margin: 0 !important;
    padding-right: 0 !important;
}

/* Breadcrumb */

.ipsBreadcrumb {
    position: relative;
    font-size: 13px;
    font-weight: 400;
    padding: 15px var(--ae-ten-px);
    color: inherit;
    margin: var(--ae-five-px) var(--ae-zero-px);
    border-radius: var(--ae-five-px);
    background: var(--ae-box-color);
}

#ipsLayout_header .ipsBreadcrumb {
    margin: 0 !important;
    border-radius: 0 !important;
}

.ipsBreadcrumb > ul {
    margin: 0;
    padding: 0;
}

.ipsBreadcrumb li {
    display: inline-block;
    line-height: 30px;
    max-width: 100%;
    height: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.ipsBreadcrumb a {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: inherit;
}

.ipsBreadcrumb a:hover {
    color: var(--ae-main-color);
}


/* ============================================
   6. BUTTONS & FORM ELEMENTS
   ============================================ */

.ipsApp .ipsButton {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    padding: 10px 20px;
    border-radius: var(--button--radius);
    transition: 0.1s all linear;
    cursor: pointer;
    border: 0;
    user-select: none;
}

.ipsApp .ipsButton:hover:not(:active) {
    background-image: var(--ae-gradient-color);
    color: var(--ae-text-color);
    transition: 0.5s all linear;
}

/* Variants */

.ipsApp .ipsButton_normal {
    background: rgb(var(--theme-normal_button));
    color: rgb(var(--theme-normal_button_font));
}

.ipsApp .ipsButton_primary {
    font-weight: 500;
    background: rgb(var(--theme-primary_button));
    color: rgb(var(--theme-primary_button_font));
}

.ipsApp .ipsButton_positive {
    background: var(--positive-dark);
    color: var(--positive-light);
}

.ipsApp .ipsButton_negative {
    background: var(--negative-dark);
    color: var(--negative-light);
}

/* Sizes */

.ipsApp .ipsButton_small {
    font-size: 13px;
    line-height: 2.83;
    padding: 0 18px;
}

.ipsApp .ipsButton_large {
    font-size: 14px;
    line-height: 3;
    padding: 0 20px;
}

.ipsApp .ipsButton_verySmall {
    font-size: 13px;
    line-height: 2.33;
    padding: 0 15px;
}

/* Inputs */

.ipsApp input[type="text"],
.ipsApp input[type="password"],
.ipsApp input[type="email"],
.ipsApp textarea,
.ipsApp select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: rgb(var(--theme-area_background_reset));
    border: 1px solid var(--form-field--borderColor);
    border-radius: var(--form-field--radius);
    width: 100%;
    max-width: 350px;
    padding: var(--sp-2);
    color: inherit;
}

.ipsApp input:hover,
.ipsApp textarea:hover,
.ipsApp select:hover {
    border-color: var(--form-field--borderHoverColor);
}

.ipsApp input:focus,
.ipsApp textarea:focus,
.ipsApp select:focus {
    box-shadow: var(--form-field--focusShadow);
    border-color: rgb(var(--theme-active_input_border));
    outline: 0;
}

/* Toggle */

.ipsToggle {
    width: 42px;
    background: rgb(var(--theme-area_background_light));
    display: inline-block;
    height: 22px;
    line-height: 22px;
    border-radius: 11px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    vertical-align: middle;
    cursor: pointer;
    transition: all 0.3s linear;
}

.ipsToggle.ipsToggle_on {
    background: rgb(var(--theme-active_input_border));
}

.ipsToggle span {
    background: #fff;
    border-radius: 9px;
    height: 16px;
    width: 16px;
    top: 2px;
    display: block;
    position: absolute;
    transition: all 0.2s linear;
}


/* ============================================
   7. CONTENT COMPONENTS
   ============================================ */

.ipsBox {
    box-shadow: var(--box--boxShadow);
    border-radius: var(--box--radius);
    background-color: var(--box--color);
}

.ipsComment {
    position: relative;
    margin-bottom: var(--sp-5);
    padding: 0;
    background: rgb(var(--theme-area_background_reset));
}

.ipsComment_header {
    padding: var(--sp-4) var(--sp-5) 0;
    position: relative;
}

.ipsComment_content {
    position: relative;
}

/* Quotes */

.ipsQuote,
.ipsSpoiler {
    margin: 0;
    padding: var(--sp-4);
    position: relative;
    background: rgb(var(--theme-area_background_light));
    border-radius: var(--radius-1);
    clear: both;
    border: 4px solid rgba(var(--theme-area_background_dark), .15);
}

[dir="ltr"] .ipsQuote,
[dir="ltr"] .ipsSpoiler {
    border-width: 0 0 0 4px;
}

.ipsQuote_citation {
    background: rgb(var(--theme-area_background));
    margin: calc(var(--sp-4) * -1);
    margin-bottom: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    color: rgb(var(--theme-text_color));
    font-weight: bold;
    font-size: 13px;
    display: block;
    cursor: pointer;
}

/* Code */

.ipsCode {
    background: rgb(var(--theme-area_background_light));
    padding: 15px !important;
    clear: both;
    direction: ltr;
    word-wrap: normal;
    border: 0 !important;
    margin: 0;
    border-radius: var(--radius-1);
}

/* Badges */

.ipsBadge {
    padding: 0 1em;
    line-height: 2;
    border-radius: 100px;
    font-weight: 500;
    display: inline-block;
    vertical-align: middle;
    text-shadow: none;
    letter-spacing: 0;
    background: var(--badge--background, currentColor);
}

.ipsBadge_positive {
    --badge--background: var(--positive-light);
    --badge--color: var(--positive-dark);
}

.ipsBadge_negative {
    --badge--color: var(--negative-dark);
}

/* Avatars */

.ipsUserPhoto {
    background: rgb(var(--theme-area_background_reset));
    vertical-align: middle;
    display: inline-block;
    line-height: 1px;
    position: relative;
    margin: 2px;
    border-radius: 500px;
}

.ipsUserPhoto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ipsUserPhoto_tiny { width: 34px; height: 34px; }
.ipsUserPhoto_small { width: 54px; height: 54px; }
.ipsUserPhoto_medium { width: 75px; height: 75px; }
.ipsUserPhoto_large { width: 90px; height: 90px; }

/* Modals */

.ipsModal {
    background: rgba(var(--theme-area_background_dark), 0.7);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 15000;
}

.ipsDialog {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 20000;
    padding-bottom: 15px;
}

.ipsDialog > div {
    display: block;
    width: 90%;
    max-width: 1200px;
    background: rgb(var(--theme-area_background_reset));
    margin: 3% auto 0 auto;
    box-shadow: var(--dialog--boxShadow);
    position: relative;
    border-radius: var(--radius-2);
}

/* Tooltips */

.ipsTooltip {
    background: #2a2a2a;
    border-color: #2a2a2a;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    font-size: 12px;
    color: #fff;
    position: absolute;
    padding: 0 8px;
    pointer-events: none;
    border-radius: var(--popup--radius);
    user-select: none;
}

/* Loading Spinner */

.ipsLoading {
    position: relative;
}

.ipsLoading:before {
    content: '';
    border-radius: 50%;
    width: 1em;
    height: 1em;
    border: calc(2px + .03em) solid rgba(var(--theme-text_color), 0.1);
    border-top-color: rgb(var(--theme-text_color));
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -.5em;
    margin-left: -.5em;
    font-size: 50px;
    animation: spinner 0.65s infinite linear;
}

@keyframes spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(359deg); }
}


/* ============================================
   8. UTILITY CLASSES
   ============================================ */

.ipsMargin { margin: var(--sp-5) !important; }
.ipsMargin_top { margin-top: var(--sp-5) !important; }
.ipsMargin_bottom { margin-bottom: var(--sp-5) !important; }
.ipsMargin_left { margin-left: var(--sp-5) !important; }
.ipsMargin_right { margin-right: var(--sp-5) !important; }

.ipsMargin\:half { margin: var(--sp-3) !important; }
.ipsMargin\:double { margin: var(--sp-8) !important; }
.ipsMargin\:none { margin: 0 !important; }

.ipsPad,
.ipsApp ul.ipsPad,
.ipsApp ol.ipsPad {
    padding: var(--sp-5);
}

.ipsPadding { padding: var(--sp-5) !important; }
.ipsPadding_top { padding-top: var(--sp-5) !important; }
.ipsPadding_bottom { padding-bottom: var(--sp-5) !important; }
.ipsPadding_left { padding-left: var(--sp-5) !important; }
.ipsPadding_right { padding-right: var(--sp-5) !important; }

.ipsPadding\:half { padding: var(--sp-3) !important; }
.ipsPadding\:double { padding: var(--sp-8) !important; }
.ipsPadding\:none { padding: 0 !important; }

.ipsHide { display: none; }
.ipsResponsive_block { display: block !important; }
.ipsResponsive_inline { display: inline !important; }
.ipsResponsive_inlineBlock { display: inline-block !important; }

.ipsPos_left { float: left; }
.ipsPos_right { float: right; }
.ipsPos_none { float: none; }
.ipsPos_center { margin: 0 auto; }
.ipsPos_middle { vertical-align: middle; }
.ipsPos_top { vertical-align: top; }

.ipsClear { clear: both; }
.ipsClearfix:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: " ";
    clear: both;
    height: 0;
}

.ipsBorder { border: var(--border-1px) !important; }
.ipsBorder_top { border-top: var(--border-1px) !important; }
.ipsBorder_bottom { border-bottom: var(--border-1px) !important; }
.ipsBorder_left { border-left: var(--border-1px) !important; }
.ipsBorder_right { border-right: var(--border-1px) !important; }
.ipsBorder\:none { border: 0 !important; }

.ipsFaded { opacity: 0.4; }
.ipsFaded.ipsFaded_more { opacity: 0.25; }
.ipsFaded_withHover { transition: 0.2s all linear; }
.ipsFaded_withHover:hover { opacity: 1; }

.ipsCursor_pointer { cursor: pointer !important; }
.ipsCursor_default { cursor: default; }
.ipsCursor_help { cursor: help !important; }
.ipsCursor_drag { cursor: move !important; }


/* ============================================
   9. RESPONSIVE DESIGN
   ============================================ */

/* Tablet and down */
@media (max-width: 979px) {
    .md\:ipsHide { display: none; }
    .md\:ipsFlex { display: flex; }
    .md\:ipsPos_none { float: none; }
    .md\:ipsClear { clear: both; }

    /* Keep desktop behaviour until mobile breakpoint (767px) */
}

/* Mobile (NO SIDEBAR, full-width header) */
@media (max-width: 767px) {
    .sm\:ipsHide { display: none; }
    .sm\:ipsFlex { display: flex; }
    .sm\:ipsPos_none { float: none; }
    .sm\:ipsClear { clear: both; }

    /* Hide sidebar */
    #ipsLayout_sidebar {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
    }

    /* Main area takes full width */
    #ipsLayout_mainArea,
    #ipsLayout_contentArea {
        margin-left: 0 !important;
        width: 100% !important;
    }

    #ipsLayout_body {
        margin-left: 0 !important;
        width: 100% !important;
        padding-left: 0 !important;
    }

    /* Header full width */
    #ipsLayout_header {
        left: 0 !important;
        width: 100% !important;
        position: -webkit-sticky !important;
        position: sticky !important;
    }

    #ipsLayout_header .ipsLayout_container,
    #ipsLayout_header header > .ipsLayout_container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    #ipsLayout_header #elLogo img {
        padding-right: 10px !important;
    }

    .ipsLayout_container {
        padding: 0 10px;
    }

    /* iOS height fixes */
    html {
        height: -webkit-fill-available !important;
    }

    body {
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
    }
}

/* Very small mobile */
@media (max-width: 480px) {
    #ipsLayout_sidebar {
        display: none !important;
    }

    #ipsLayout_mainArea,
    #ipsLayout_contentArea,
    #ipsLayout_body,
    #ipsLayout_header {
        margin-left: 0 !important;
        left: 0 !important;
        width: 100% !important;
    }
}

/* Print */
@media print {
    .ipsPrint {
        margin-left: 50px;
        margin-right: 50px;
        -webkit-print-color-adjust: exact;
    }

    #ipsLayout_sidebar {
        display: none !important;
    }

    #ipsLayout_mainArea,
    #ipsLayout_contentArea {
        margin-left: 0 !important;
        width: 100% !important;
    }

    #ipsLayout_header {
        left: 0 !important;
        width: 100% !important;
        position: relative !important;
    }
}

