/* ==========================================================================
   Socrates UI — design layer
   Refines the legacy Flatty/Bootstrap 2 theme without changing its markup
   contracts. Loaded after all theme CSS. Editor CSS loads later, so editor
   rules are scoped with body.sx-app for specificity.
   ========================================================================== */

:root {
    /* Brand (derived from the existing #22226B navy) */
    --sx-brand-900: #14143f;
    --sx-brand-800: #1b1b55;
    --sx-brand-700: #22226b;
    --sx-brand-600: #2c2c8a;
    --sx-brand-500: #3f3fb3;
    --sx-brand-400: #6a6ad2;
    --sx-brand-100: #e9e9f8;
    --sx-brand-50: #f4f4fc;

    /* Neutrals */
    --sx-ink: #171933;
    --sx-text: #33364f;
    --sx-muted: #686c86;
    --sx-subtle: #9195ab;
    --sx-border: #e2e4ee;
    --sx-border-strong: #cdd0df;
    --sx-canvas: #f5f6fa;
    --sx-surface: #ffffff;
    --sx-surface-2: #f9fafc;

    /* Status */
    --sx-success: #16794a;
    --sx-success-bg: #e6f5ed;
    --sx-warning: #93570a;
    --sx-warning-bg: #fdf1dc;
    --sx-danger: #be3128;
    --sx-danger-bg: #fdeceb;
    --sx-info: #2a52be;
    --sx-info-bg: #e8eefc;

    --sx-radius-sm: 6px;
    --sx-radius: 10px;
    --sx-radius-lg: 14px;
    --sx-shadow-sm: 0 1px 2px rgba(23, 25, 51, .06);
    --sx-shadow: 0 1px 2px rgba(23, 25, 51, .05), 0 4px 14px rgba(23, 25, 51, .06);
    --sx-shadow-lg: 0 12px 40px rgba(23, 25, 51, .16);
    --sx-ring: 0 0 0 3px rgba(63, 63, 179, .28);

    --sx-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sx-topbar-h: 56px;
    --sx-nav-w: 248px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body.sx-app,
body.sx-auth-page {
    font-family: var(--sx-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--sx-text);
    background: var(--sx-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.sx-app h1, body.sx-app h2, body.sx-app h3, body.sx-app h4, body.sx-app h5,
body.sx-auth-page h1, body.sx-auth-page h2 {
    font-family: var(--sx-font);
    color: var(--sx-ink);
    letter-spacing: -0.01em;
}

body.sx-app #content a:not([class]) { color: var(--sx-brand-500); }
body.sx-app #content a:not([class]):hover { color: var(--sx-brand-700); }

body.sx-app :focus-visible,
body.sx-auth-page :focus-visible {
    outline: none;
    box-shadow: var(--sx-ring);
}

.sx-icon { flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.sx-logo { display: block; }
body.sx-app [hidden],
body.sx-auth-page [hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
body.sx-app { padding-top: var(--sx-topbar-h); }

body.sx-app header .navbar { min-height: var(--sx-topbar-h); }
body.sx-app header .navbar .navbar-inner,
body.sx-app.contrast-symbaloo header .navbar .navbar-inner {
    background: var(--sx-brand-700);
    min-height: var(--sx-topbar-h);
    border: 0;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
    padding: 0;
}
body.sx-app header .navbar .container-fluid {
    display: flex;
    align-items: center;
    height: var(--sx-topbar-h);
    padding: 0 16px 0 0;
}

body.sx-app header .navbar .brand.sx-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--sx-nav-w);
    height: var(--sx-topbar-h);
    margin: 0;
    padding: 0 0 0 20px;
    justify-content: flex-start;
    color: #fff;
    border: 0;
    background: transparent;
    float: none;
}
body.sx-app .sx-brand__mark { height: 30px; width: auto; color: #fff; transition: opacity .15s; }
body.sx-app .sx-brand:hover .sx-brand__mark { opacity: .85; }
.sx-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 8px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}
.sx-nav-toggle:hover { background: rgba(255, 255, 255, .12); }

/* Editor tool buttons */
body.sx-app #iconbar.sx-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: rgba(255, 255, 255, .07);
    border-radius: 10px;
}
body.sx-app #iconbar.sx-toolbar a.btn,
body.sx-app #iconbar.sx-toolbar button.btn,
body.sx-app .navbar .navbar-inner .container-fluid #iconbar a.btn {
    position: static;
    top: auto;
    float: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 7px !important;
    background: transparent !important;
    color: rgba(255, 255, 255, .86);
    box-shadow: none;
    text-shadow: none;
    transition: background-color .15s, color .15s, opacity .15s;
}
body.sx-app #iconbar.sx-toolbar a.btn .sx-icon { width: 19px; height: 19px; }
body.sx-app #iconbar.sx-toolbar a.btn:hover,
body.sx-app #iconbar.sx-toolbar a.btn:focus-visible {
    background: rgba(255, 255, 255, .14) !important;
    color: #fff;
}
body.sx-app #iconbar.sx-toolbar a.btn.inactive {
    opacity: .38;
    cursor: not-allowed;
}
body.sx-app #iconbar.sx-toolbar a.btn.inactive:hover { background: transparent !important; }
body.sx-app #iconbar.sx-toolbar button.btn:focus-visible { outline: 2px solid rgba(255,255,255,.82); outline-offset: 2px; }
body.sx-app #iconbar.sx-toolbar button.btn.is-active { background: rgba(255,255,255,.16) !important; color: #fff; }
.sx-toolbar__divider { width: 1px; height: 20px; margin: 0 4px; background: rgba(255, 255, 255, .18); }
body.sx-app.sx-nav-collapsed { --sx-nav-w: 0px; }
body.sx-app.sx-nav-collapsed #main-nav { display: none; }

/* Contextual link editor panel */
body.sx-app #sidebar.sx-link-panel-open {
    display: block !important;
    position: fixed;
    z-index: 12001;
    top: var(--sx-topbar-h);
    bottom: 0;
    left: 0;
    width: min(380px, 100vw);
    height: auto;
    margin: 0 !important;
    overflow: auto;
    background: var(--sx-surface);
    border-right: 1px solid var(--sx-border);
    box-shadow: 8px 0 30px rgba(20,20,42,.12);
}
body.sx-app #sidebar.sx-link-panel-open .well:not(.sidebar-links) { display: none !important; }
body.sx-app #sidebar.sx-link-panel-open .well.sidebar-links {
    display: block !important;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: auto !important;
    min-height: 100%;
    margin: 0;
    padding: 24px;
    border: 0;
    border-radius: 0;
    background: var(--sx-surface);
    box-shadow: none;
}
body.sx-app .sx-link-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 24px; }
body.sx-app .sx-link-eyebrow { color: var(--sx-brand-600); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
body.sx-app .sx-link-heading h2 { margin: 6px 0 8px; color: var(--sx-ink); font-size: 23px; line-height: 1.25; letter-spacing: -.03em; }
body.sx-app .sx-link-heading p { margin: 0; color: var(--sx-muted); font-size: 13px; line-height: 1.5; }
body.sx-app .sx-link-close { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 1px solid var(--sx-border); border-radius: 9px; background: var(--sx-surface); color: var(--sx-muted); cursor: pointer; }
body.sx-app .sx-link-close:hover { background: var(--sx-surface-2); color: var(--sx-ink); }
body.sx-app .sx-link-close .sx-icon { width: 18px; height: 18px; }
body.sx-app .sidebar-links .sx-link-field { margin: 0 0 17px; }
body.sx-app .sidebar-links .sx-link-field label { display: block; margin: 0 0 6px; color: var(--sx-ink); font-size: 12px; font-weight: 600; }
body.sx-app .sidebar-links .sx-link-field label span { color: var(--sx-muted); font-weight: 400; }
body.sx-app .sidebar-links .sx-link-field input,
body.sx-app .sidebar-links .sx-link-field select { box-sizing: border-box; width: 100%; max-width: none; height: 42px; margin: 0; padding: 9px 12px; border: 1px solid var(--sx-border-strong); border-radius: 8px; background-color: var(--sx-surface); color: var(--sx-ink); font: 14px/22px var(--sx-font); box-shadow: none; }
body.sx-app .sidebar-links .sx-link-field input:focus,
body.sx-app .sidebar-links .sx-link-field select:focus { outline: none; border-color: var(--sx-brand-400); box-shadow: 0 0 0 3px var(--sx-brand-50); }
body.sx-app .sx-link-actions { display: flex; justify-content: flex-start; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--sx-border); }
body.sx-app .sx-link-actions .btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--sx-brand-600); border-radius: 8px; background: var(--sx-brand-600); color: #fff; font-size: 13px; font-weight: 600; box-shadow: none; text-shadow: none; }
body.sx-app .sx-link-actions .sx-icon { width: 16px; height: 16px; }
body.sx-app .sx-editor-select__status { display: block; margin: 8px 0; color: var(--sx-muted); font-size: 12px; }
body.sx-app .sx-editor-select__status[hidden] { display: none; }
body.sx-app .sx-editor-select__status.is-error { color: var(--sx-danger); }
body.sx-app .codex-editor .sx-editor-select { box-sizing: border-box; width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--sx-border-strong); border-radius: 8px; background: var(--sx-surface); color: var(--sx-ink); font: 14px/1.5 var(--sx-font); }
body.sx-app .codex-editor .sx-editor-select:focus { outline: none; border-color: var(--sx-brand-400); box-shadow: 0 0 0 3px var(--sx-brand-50); }

/* Right hand menus */
body.sx-app header .navbar .nav.pull-right.sx-topnav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 0 auto;
    float: none;
}
body.sx-app header .navbar .sx-topnav > li { float: none; }
body.sx-app header .navbar .sx-topnav > li > a,
body.sx-app header .navbar .navbar-inner .nav > li.dropdown.light > a,
body.sx-app header .navbar .navbar-inner .nav > li.dropdown.dark > a {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    text-shadow: none;
    box-shadow: none;
}
body.sx-app header .navbar .sx-topnav > li > a:hover,
body.sx-app header .navbar .sx-topnav > li.open > a {
    background: rgba(255, 255, 255, .12) !important;
    color: #fff;
}
body.sx-app header .navbar .sx-topnav .caret { border-top-color: currentColor; border-bottom-color: currentColor; margin: 0; opacity: .7; }
.sx-topnav__label { color: rgba(255, 255, 255, .6); font-weight: 400; }

.sx-user__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}
.sx-user__avatar--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sx-brand-400);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
}

/* Dropdowns */
body.sx-app .dropdown-menu {
    padding: 6px;
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    box-shadow: var(--sx-shadow-lg);
    min-width: 200px;
}
body.sx-app header .navbar .nav ul.dropdown-menu { width: auto; }
body.sx-app .dropdown-menu > li > a {
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--sx-text);
    font-size: 13px;
    line-height: 1.4;
}
body.sx-app .dropdown-menu > li > a:hover,
body.sx-app .dropdown-menu > li > a:focus {
    background: var(--sx-brand-50) !important;
    color: var(--sx-brand-700);
}
body.sx-app .dropdown-menu > .active > a,
body.sx-app .dropdown-menu > .active > a:hover,
body.sx-app .dropdown-menu > .active > a:focus {
    background: var(--sx-brand-100) !important;
    color: var(--sx-brand-700);
    font-weight: 600;
}
body.sx-app header .navbar .navbar-inner .sx-topnav > li { background: transparent !important; }
body.sx-app .dropdown-menu .divider { margin: 6px 0; background: var(--sx-border); border: 0; height: 1px; }
body.sx-app .dropdown-menu .nav-header {
    padding: 6px 10px 4px;
    font-size: 11px;
    color: var(--sx-subtle);
    text-transform: uppercase;
    letter-spacing: .06em;
    text-shadow: none;
}
body.sx-app .dropdown-menu [class^="icon-"],
body.sx-app .dropdown-menu [class*=" icon-"] { width: 18px; color: var(--sx-subtle); }
body.sx-app .navbar .nav > li > .dropdown-menu:before,
body.sx-app .navbar .nav > li > .dropdown-menu:after { display: none; }
body.sx-app .navbar .pull-right > li > .dropdown-menu { right: 0; left: auto; margin-top: 6px; }
.sx-user__header { padding: 8px 10px 6px; display: flex; flex-direction: column; }
.sx-user__header strong { color: var(--sx-ink); font-size: 13px; }
.sx-user__header span { color: var(--sx-muted); font-size: 12px; }

/* --------------------------------------------------------------------------
   Sidebar navigation
   -------------------------------------------------------------------------- */
body.sx-app #main-nav {
    width: var(--sx-nav-w);
    flex: 0 0 var(--sx-nav-w);
    background: transparent;
    position: sticky;
    top: var(--sx-topbar-h);
    max-height: calc(100vh - var(--sx-topbar-h));
    overflow-y: auto;
    box-sizing: border-box;
}
body.sx-app #main-nav-bg { display: none; }
body.sx-app #main-nav .navigation { padding: 14px 12px 24px; }
body.sx-app #main-nav .navigation .nav { background: transparent; border: 0; }
body.sx-app #main-nav .navigation > .nav { margin: 0; }
body.sx-app #main-nav .navigation .nav > li { border: 0; margin: 0; }
body.sx-app #main-nav .navigation > .nav > li { margin-bottom: 2px; }
body.sx-app #main-nav .navigation > .nav > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sx-text);
    font-size: 14px;
    font-weight: 500;
    text-shadow: none;
    transition: background-color .12s, color .12s;
}
body.sx-app #main-nav .navigation > .nav > li > a > i:first-child {
    width: 20px;
    margin: 0;
    font-size: 15px;
    color: var(--sx-subtle);
    text-align: center;
    position: static;
}
body.sx-app #main-nav .navigation > .nav > li > a > span { flex: 1; }
body.sx-app #main-nav .navigation > .nav > li > a i.angle-down {
    position: static;
    margin: 0;
    font-size: 13px;
    color: var(--sx-subtle);
    transition: transform .2s;
}
body.sx-app #main-nav .navigation > .nav > li > a.dropdown-collapse:not(.in) i.angle-down { transform: rotate(-90deg); }
body.sx-app #main-nav .navigation > .nav > li > a:hover {
    background: var(--sx-surface-2);
    color: var(--sx-ink);
}
body.sx-app #main-nav .navigation > .nav > li.active > a,
body.sx-app #main-nav .navigation > .nav > li.active > a:hover {
    background: var(--sx-brand-100);
    color: var(--sx-brand-700);
}
body.sx-app #main-nav .navigation > .nav > li.active > a > i:first-child,
body.sx-app #main-nav .navigation > .nav > li.is-current > a > i:first-child { color: var(--sx-brand-600); }
body.sx-app #main-nav .navigation > .nav > li.is-current > a { color: var(--sx-ink); }

/* Sub items */
body.sx-app #main-nav .navigation .nav > li > ul.nav {
    margin: 2px 0 8px;
    padding: 0 0 0 20px;
    background: transparent;
    border: 0;
}
body.sx-app #main-nav .navigation .nav > li > ul.nav > li > a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px 0 19px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--sx-muted);
    font-size: 13.5px;
    text-shadow: none;
}
body.sx-app #main-nav .navigation .nav > li > ul.nav > li > a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2px;
    border-radius: 2px;
    background: var(--sx-border);
}
body.sx-app #main-nav .navigation .nav > li > ul.nav > li > a > i { display: none; }
body.sx-app #main-nav .navigation .nav > li > ul.nav > li > a:hover {
    background: var(--sx-surface-2);
    color: var(--sx-ink);
}
body.sx-app #main-nav .navigation .nav > li > ul.nav > li.active > a {
    background: var(--sx-brand-50);
    color: var(--sx-brand-700);
    font-weight: 600;
}
body.sx-app #main-nav .navigation .nav > li > ul.nav > li.active > a::before { background: var(--sx-brand-500); }

/* --------------------------------------------------------------------------
   Content canvas & page header
   -------------------------------------------------------------------------- */
body.sx-app #wrapper {
    display: flex;
    align-items: flex-start;
    overflow: visible; /* Flatty sets hidden, which would break the sticky sidebar */
    overflow: clip;
    min-height: calc(100vh - var(--sx-topbar-h));
    /* Paint the sidebar column to the bottom of the page */
    background: linear-gradient(90deg, var(--sx-surface) 0 var(--sx-nav-w), var(--sx-border) var(--sx-nav-w) calc(var(--sx-nav-w) + 1px), transparent 0);
}
body.sx-app #content {
    flex: 1;
    min-width: 0;
    margin-left: 0;
    background: var(--sx-canvas);
    min-height: calc(100vh - var(--sx-topbar-h));
    padding-bottom: 48px;
}
body.sx-app #content-wrapper { margin: 0; }
body.sx-app footer { height: 0; margin: 0; }
body.sx-app #content-wrapper .main-content {
    float: none;
    width: auto;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px;
}

body.sx-app .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin: 0 0 20px;
    padding: 28px 0 0;
    border: 0;
    background: transparent;
}
body.sx-app .page-header::before,
body.sx-app .page-header::after { display: none; }
body.sx-app .page-header h1,
body.sx-app .page-header h1.pull-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    float: none;
    margin: 0;
    font-size: 24px;
    font-weight: 650;
    line-height: 1.25;
}
body.sx-app .page-header h1 > i { display: none; }
body.sx-app .page-header .pull-right { float: none; }
.sx-page-header__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 6px 0 0;
    color: var(--sx-muted);
    font-size: 13px;
}
.sx-page-header__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sx-chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border: 1px solid var(--sx-border);
    border-radius: 999px;
    background: var(--sx-surface);
    color: var(--sx-text);
    font-size: 12px;
    font-weight: 600;
}

body.sx-app .sx-flash {
    max-width: 1320px;
    margin: 20px auto 0;
    box-sizing: border-box;
    width: calc(100% - 64px);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.sx-btn,
body.sx-app #content .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--sx-border-strong);
    border-radius: 8px !important;
    background: var(--sx-surface);
    background-image: none;
    color: var(--sx-ink);
    font-family: var(--sx-font);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    text-shadow: none;
    white-space: nowrap;
    box-shadow: var(--sx-shadow-sm);
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
    vertical-align: middle;
    box-sizing: border-box;
}
.sx-btn:hover,
body.sx-app #content .btn:hover {
    border-color: var(--sx-subtle);
    background: var(--sx-surface-2);
    color: var(--sx-ink);
    text-decoration: none;
}
.sx-btn:active,
body.sx-app #content .btn:active { transform: translateY(1px); }
body.sx-app #content .btn [class^="icon-"],
body.sx-app #content .btn [class*=" icon-"] { color: inherit; margin: 0; line-height: 1; }
.sx-btn .sx-icon { width: 17px; height: 17px; }

.sx-btn--primary,
body.sx-app #content .btn.btn-primary,
body.sx-app #content .btn.sx-action-publish {
    border-color: var(--sx-brand-600);
    background: var(--sx-brand-600);
    color: #fff;
}
.sx-btn--primary:hover,
body.sx-app #content .btn.btn-primary:hover,
body.sx-app #content .btn.sx-action-publish:hover {
    border-color: var(--sx-brand-700);
    background: var(--sx-brand-700);
    color: #fff;
}
body.sx-app #content .btn.btn-success {
    border-color: var(--sx-border-strong);
    background: var(--sx-surface);
    color: var(--sx-ink);
}
body.sx-app #content .btn.btn-info {
    border-color: var(--sx-border-strong);
    background: var(--sx-surface);
    color: var(--sx-ink);
}
body.sx-app #content .btn.btn-danger {
    border-color: #f0c4c1;
    background: var(--sx-surface);
    color: var(--sx-danger);
}
body.sx-app #content .btn.btn-danger:hover {
    border-color: var(--sx-danger);
    background: var(--sx-danger);
    color: #fff;
}
.sx-btn--secondary { background: var(--sx-surface); }
.sx-btn--block { display: flex; width: 100%; }
.sx-btn--lg { height: 44px; font-size: 15px; border-radius: 9px; }
.sx-btn.is-busy,
body.sx-app #content .btn.is-busy { opacity: .7; cursor: progress; pointer-events: none; }

/* Small icon buttons in table rows */
body.sx-app #content td.actions { white-space: nowrap; }
body.sx-app #content .btn.sx-row-action {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0 2px;
    box-shadow: none;
    color: var(--sx-muted);
    background: var(--sx-surface);
    border-color: var(--sx-border);
}
body.sx-app #content .btn.sx-row-action:hover { color: var(--sx-brand-700); border-color: var(--sx-brand-400); background: var(--sx-brand-50); }
body.sx-app #content .btn.btn-danger.sx-row-action:hover { color: #fff; border-color: var(--sx-danger); background: var(--sx-danger); }

.sx-link { color: var(--sx-brand-500); font-weight: 600; text-decoration: none; }
.sx-link:hover { color: var(--sx-brand-700); text-decoration: underline; text-underline-offset: 3px; }
.sx-link--small { font-size: 13px; }

/* --------------------------------------------------------------------------
   Forms (generated by the CMS form builder)
   -------------------------------------------------------------------------- */
body.sx-app #content form.form-horizontal {
    margin: 0 0 24px;
    padding: 24px 28px;
    background: var(--sx-surface);
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-lg);
    box-shadow: var(--sx-shadow-sm);
}
body.sx-app #content .form-horizontal .control-group {
    margin: 0 0 20px;
    padding: 0;
}
body.sx-app #content .form-horizontal .control-label {
    float: none;
    display: block;
    width: auto;
    margin: 0 0 6px;
    padding: 0;
    text-align: left;
    color: var(--sx-ink);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
}
body.sx-app #content .form-horizontal .controls { margin-left: 0; }
body.sx-app #content .form-horizontal .help-block,
body.sx-app #content .form-horizontal .help-inline {
    margin-top: 6px;
    color: var(--sx-muted);
    font-size: 12.5px;
}
body.sx-app #content form h5 {
    margin: 28px 0 4px;
    font-size: 15px;
    font-weight: 650;
}
body.sx-app #content form hr { margin: 8px 0 20px; border: 0; border-top: 1px solid var(--sx-border); }

/* Inputs */
body.sx-app #content input[type="text"],
body.sx-app #content input[type="password"],
body.sx-app #content input[type="email"],
body.sx-app #content input[type="url"],
body.sx-app #content input[type="number"],
body.sx-app #content input[type="search"],
body.sx-app #content input[type="tel"],
body.sx-app #content input:not([type]),
body.sx-app #content input[type="date"],
body.sx-app #content input[type="datetime-local"],
body.sx-app #content input[type="time"],
body.sx-app #content select,
body.sx-app #content textarea,
body.sx-app #content .uneditable-input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--sx-border-strong);
    border-radius: 8px;
    background-color: var(--sx-surface);
    color: var(--sx-ink);
    font-family: var(--sx-font);
    font-size: 14px;
    line-height: 38px;
    box-shadow: inset 0 1px 1px rgba(23, 25, 51, .03);
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
body.sx-app #content textarea {
    height: auto;
    min-height: 96px;
    padding: 10px 12px;
    line-height: 1.5;
}
body.sx-app #content select { padding-right: 32px; }
body.sx-app #content select[multiple] { height: auto; padding: 6px; }
body.sx-app #content input[type="text"]:hover,
body.sx-app #content input[type="password"]:hover,
body.sx-app #content select:hover,
body.sx-app #content textarea:hover { border-color: var(--sx-subtle); }
body.sx-app #content input:focus,
body.sx-app #content select:focus,
body.sx-app #content textarea:focus {
    outline: none;
    border-color: var(--sx-brand-500);
    box-shadow: var(--sx-ring);
}
body.sx-app #content input[readonly] { background: var(--sx-surface-2); color: var(--sx-muted); }
body.sx-app #content input[type="checkbox"],
body.sx-app #content input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
    accent-color: var(--sx-brand-600);
    vertical-align: middle;
    box-shadow: none;
}
body.sx-app #content .controls label.radio,
body.sx-app #content .controls label.checkbox {
    display: flex;
    align-items: center;
    padding-left: 0;
    margin-bottom: 6px;
}
body.sx-app #content .controls label.radio input,
body.sx-app #content .controls label.checkbox input { float: none; margin-left: 0; }
body.sx-app #content input.span1 { width: 120px; }
body.sx-app #content input.span6 { max-width: 360px; }

/* File upload widget */
body.sx-app #content .fileupload .input-append { display: inline-flex; }
body.sx-app #content .fileupload .uneditable-input { border-radius: 8px 0 0 8px; }
body.sx-app #content .fileupload .input-append .btn { border-radius: 0 !important; margin-left: -1px; height: 40px; box-shadow: none; }
body.sx-app #content .fileupload .input-append .btn:last-child { border-radius: 0 8px 8px 0 !important; }

/* Chosen (multiselect) */
body.sx-app #content .chosen-container-multi .chosen-choices {
    min-height: 40px;
    padding: 4px 6px;
    border: 1px solid var(--sx-border-strong);
    border-radius: 8px;
    background-image: none;
}
body.sx-app #content .chosen-container-multi .chosen-choices li.search-choice {
    border: 0;
    border-radius: 6px;
    background: var(--sx-brand-100);
    background-image: none;
    color: var(--sx-brand-700);
    box-shadow: none;
}
body.sx-app #content .chosen-container-active .chosen-choices { border-color: var(--sx-brand-500); box-shadow: var(--sx-ring); }

/* Sticky action bar */
body.sx-app #content .sx-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin: 28px -28px -24px;
    padding: 14px 28px;
    border-top: 1px solid var(--sx-border);
    border-radius: 0 0 var(--sx-radius-lg) var(--sx-radius-lg);
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: saturate(160%) blur(8px);
    backdrop-filter: saturate(160%) blur(8px);
}
body.sx-app #content .sx-form-actions > .control-label { display: none; }
body.sx-app #content .sx-form-actions > .controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
body.sx-app #content .sx-form-actions .btn.sx-action-cancel {
    margin-left: auto;
    border-color: transparent;
    background: transparent;
    color: var(--sx-muted);
    box-shadow: none;
}
body.sx-app #content .sx-form-actions .btn.sx-action-cancel:hover {
    background: var(--sx-surface-2);
    color: var(--sx-ink);
    border-color: transparent;
}
body.sx-app #content .sx-form-actions .btn.sx-action-copy { box-shadow: none; }
/* When a page can be published, "Save draft" is the secondary action */
body.sx-app #content .sx-form-actions .btn.sx-action-save:has(~ .sx-action-publish) {
    border-color: var(--sx-border-strong);
    background: var(--sx-surface);
    color: var(--sx-ink);
}
body.sx-app #content .sx-form-actions .btn.sx-action-save:has(~ .sx-action-publish):hover { background: var(--sx-surface-2); }

/* Meta data form that follows the main form */
body.sx-app #content #metatag_form { margin-top: 8px; }
body.sx-app #content .seo_example {
    padding: 20px 24px;
    border: 1px dashed var(--sx-border-strong);
    border-radius: var(--sx-radius);
    background: var(--sx-surface);
}

/* --------------------------------------------------------------------------
   Overviews: filters, tables, pagination
   -------------------------------------------------------------------------- */
body.sx-app #content .filters.alert {
    display: block;
    margin: 0 0 12px;
    padding: 14px 18px;
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    background: var(--sx-surface);
    color: var(--sx-text);
    text-shadow: none;
    box-shadow: var(--sx-shadow-sm);
}
body.sx-app #content .filters.alert .controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    height: auto !important;
}
body.sx-app #content .filters.alert .controls > br { display: none; }
body.sx-app #content .filters.alert strong { color: var(--sx-ink); font-size: 13px; margin-right: 4px; }
body.sx-app #content .filters.alert .control-label { margin: 0; color: var(--sx-muted); font-size: 13px; }
body.sx-app #content .filters.alert input[type="text"] { width: 240px; height: 36px; margin: 0; line-height: 34px; }
body.sx-app #content .filters.alert select { width: auto; height: 36px; margin: 0; line-height: 34px; }
body.sx-app #content .filters.alert .btn { height: 36px; margin: 0; }

body.sx-app #content table.table {
    width: 100%;
    margin: 12px 0 16px;
    border: 1px solid var(--sx-border);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--sx-radius);
    background: var(--sx-surface);
    box-shadow: var(--sx-shadow-sm);
    overflow: hidden;
}
body.sx-app #content table.table th,
body.sx-app #content table.table td {
    padding: 11px 14px;
    border: 0;
    border-top: 1px solid var(--sx-border);
    vertical-align: middle;
    line-height: 1.45;
}
body.sx-app #content table.table thead th {
    border-top: 0;
    background: var(--sx-surface-2);
    color: var(--sx-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
body.sx-app #content table.table-striped tbody > tr:nth-child(odd) > td { background: transparent; }
body.sx-app #content table.table tbody tr:hover > td { background: var(--sx-brand-50); }
body.sx-app #content table.table th.actions,
body.sx-app #content table.table td.actions { width: 1%; text-align: right; }
body.sx-app #content table.overview:not(.module) td:first-child { color: var(--sx-subtle); font-variant-numeric: tabular-nums; width: 64px; }

body.sx-app #content .pagination { margin: 8px 0 20px; }
body.sx-app #content .pagination ul { display: inline-flex; gap: 4px; box-shadow: none; border-radius: 0; }
body.sx-app #content .pagination ul > li > a,
body.sx-app #content .pagination ul > li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--sx-border);
    border-radius: 8px !important;
    background: var(--sx-surface);
    color: var(--sx-text);
    line-height: 1;
    float: none;
}
body.sx-app #content .pagination ul > li > a:hover { background: var(--sx-surface-2); }
body.sx-app #content .pagination ul > .active > a,
body.sx-app #content .pagination ul > .active > span {
    border-color: var(--sx-brand-600);
    background: var(--sx-brand-600);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Alerts & labels
   -------------------------------------------------------------------------- */
body.sx-app #content .alert:not(.filters) {
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: var(--sx-radius);
    text-shadow: none;
    font-size: 14px;
}
body.sx-app #content .alert-success { background: var(--sx-success-bg); border-color: #bfe3cf; color: var(--sx-success); }
body.sx-app #content .alert-error,
body.sx-app #content .alert-danger { background: var(--sx-danger-bg); border-color: #f3c6c2; color: var(--sx-danger); }
body.sx-app #content .alert-info:not(.filters) { background: var(--sx-info-bg); border-color: #c9d6f7; color: var(--sx-info); }
body.sx-app #content .alert .close { top: 0; right: 0; opacity: .5; }

body.sx-app .label {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-shadow: none;
}
body.sx-app .label-success { background: var(--sx-success-bg); color: var(--sx-success); }
body.sx-app .label-important,
body.sx-app .label-danger { background: var(--sx-danger-bg); color: var(--sx-danger); }
body.sx-app .label-warning { background: var(--sx-warning-bg); color: var(--sx-warning); }
body.sx-app .label-info { background: var(--sx-info-bg); color: var(--sx-info); }

.sx-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.sx-badge--success { background: var(--sx-success-bg); color: var(--sx-success); }
.sx-badge--warning { background: var(--sx-warning-bg); color: var(--sx-warning); }
.sx-badge--info { background: var(--sx-info-bg); color: var(--sx-info); }
.sx-badge--neutral { background: #eef0f5; color: var(--sx-muted); }
.sx-badges { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.sx-dashboard .page-header { margin-bottom: 24px; }

.sx-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 24px;
}
.sx-stat {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "label icon" "value icon" "hint hint";
    align-items: start;
    padding: 18px 20px;
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-lg);
    background: var(--sx-surface);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--sx-shadow-sm);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
body.sx-app a.sx-stat:hover {
    border-color: var(--sx-border-strong);
    box-shadow: var(--sx-shadow);
    color: inherit;
    text-decoration: none;
    transform: translateY(-1px);
}
.sx-stat__label { grid-area: label; color: var(--sx-muted); font-size: 13px; font-weight: 600; }
.sx-stat__value {
    grid-area: value;
    margin-top: 4px;
    color: var(--sx-ink);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.sx-stat__hint { grid-area: hint; margin-top: 8px; color: var(--sx-subtle); font-size: 12.5px; }
.sx-stat__icon {
    grid-area: icon;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--sx-brand-50);
    color: var(--sx-brand-600);
}
.sx-stat--success .sx-stat__icon { background: var(--sx-success-bg); color: var(--sx-success); }
.sx-stat--warning .sx-stat__icon { background: var(--sx-warning-bg); color: var(--sx-warning); }
.sx-stat--info .sx-stat__icon { background: var(--sx-info-bg); color: var(--sx-info); }

.sx-dashboard__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 32px;
}
.sx-card {
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius-lg);
    background: var(--sx-surface);
    box-shadow: var(--sx-shadow-sm);
    overflow: hidden;
}
.sx-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--sx-border);
}
body.sx-app .sx-card__title { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.3; }
.sx-card__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #eef0f5;
    color: var(--sx-muted);
    font-size: 12px;
    font-weight: 700;
}
.sx-card__footer { padding: 12px 20px; border-top: 1px solid var(--sx-border); }

.sx-list { margin: 0; padding: 0; list-style: none; }
.sx-list__item + .sx-list__item { border-top: 1px solid var(--sx-border); }
body.sx-app a.sx-list__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px 13px 20px;
    color: inherit;
    text-decoration: none;
    transition: background-color .12s;
}
body.sx-app a.sx-list__link:hover { background: var(--sx-surface-2); color: inherit; }
.sx-list__main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sx-list__title { color: var(--sx-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-list__meta { color: var(--sx-muted); font-size: 12.5px; }
.sx-list__chevron { width: 18px; height: 18px; color: var(--sx-subtle); }

.sx-timeline { margin: 0; padding: 8px 20px 12px; list-style: none; }
.sx-timeline__item { position: relative; padding: 10px 0 10px 20px; }
.sx-timeline__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sx-border-strong);
}
.sx-timeline__item::after {
    content: "";
    position: absolute;
    left: 3.5px;
    top: 28px;
    bottom: -6px;
    width: 1px;
    background: var(--sx-border);
}
.sx-timeline__item:last-child::after { display: none; }
.sx-timeline__item--publish::before { background: var(--sx-success); }
.sx-timeline__item--restore::before { background: var(--sx-warning); }
.sx-timeline__text { margin: 0; color: var(--sx-text); font-size: 13.5px; line-height: 1.45; }
.sx-timeline__text strong { color: var(--sx-ink); }
.sx-timeline__text a { font-weight: 600; }
.sx-timeline__time { color: var(--sx-subtle); font-size: 12px; }

.sx-empty { padding: 32px 24px; text-align: center; }
.sx-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--sx-success-bg);
    color: var(--sx-success);
}
.sx-empty__title { margin: 0; color: var(--sx-ink); font-weight: 650; }
.sx-empty__text { margin: 4px 0 0; color: var(--sx-muted); font-size: 13px; }

.sx-section { margin: 0 0 32px; }
body.sx-app .sx-section__title {
    margin: 0 0 12px;
    color: var(--sx-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.sx-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
body.sx-app a.sx-shortcut {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    background: var(--sx-surface);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}
body.sx-app a.sx-shortcut:hover { border-color: var(--sx-brand-400); box-shadow: var(--sx-shadow); color: inherit; }
.sx-shortcut__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--sx-brand-50);
    color: var(--sx-brand-600);
    flex: 0 0 auto;
    transition: background-color .15s, color .15s;
}
body.sx-app a.sx-shortcut:hover .sx-shortcut__icon { background: var(--sx-brand-600); color: #fff; }
.sx-shortcut__text { display: flex; flex-direction: column; min-width: 0; }
.sx-shortcut__label { color: var(--sx-ink); font-weight: 650; }
.sx-shortcut__hint { color: var(--sx-muted); font-size: 12.5px; }

/* --------------------------------------------------------------------------
   Editor.js
   -------------------------------------------------------------------------- */
body.sx-app #content .control-group #htmljs.controls,
body.sx-app #content .codex-editor {
    border: 1px solid var(--sx-border-strong);
    border-radius: 0 0 var(--sx-radius) var(--sx-radius);
    background: var(--sx-surface);
}
body.sx-app #content #htmljs .codex-editor { border: 0; border-radius: 0; padding: 20px 16px 8px; }
body.sx-app #content #htmljs .codex-editor__redactor { padding-bottom: 120px !important; }

/* Template / version toolbar above the editor */
body.sx-app .temp_dupli {
    padding: 8px;
    border: 1px solid var(--sx-border-strong);
    border-bottom: 0;
    border-radius: var(--sx-radius) var(--sx-radius) 0 0;
    background: var(--sx-surface-2);
}
body.sx-app .temp_dupli_tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
body.sx-app #content .temp_dupli .btn,
body.sx-app .temp_dupli .lp-revs__btn {
    height: 32px;
    margin: 0;
    padding: 0 11px;
    border: 1px solid var(--sx-border-strong);
    border-radius: 7px;
    background: var(--sx-surface);
    color: var(--sx-text);
    font-size: 13px;
    font-weight: 600;
    box-shadow: none;
}
body.sx-app .temp_dupli .btn svg { width: 15px; height: 15px; margin-right: 2px; }
body.sx-app .temp_dupli .lp-revs { margin-left: 0; }
body.sx-app .temp_dupli .lp-revs__count { background: var(--sx-brand-600); }
body.sx-app .temp_dupli_tools_form,
body.sx-app .temp_dupli_tools_selector { gap: 8px; margin-top: 8px; padding: 8px 0 0; border-top: 1px solid var(--sx-border); }
body.sx-app .temp_dupli input { height: 32px; border: 1px solid var(--sx-border-strong); border-radius: 7px; padding: 0 10px; }

/* Draft / published status + autosave status */
body.sx-app .control-group .published_label {
    top: -2px;
    right: 0;
    margin: 0;
    height: 22px;
    padding: 0 9px;
    align-items: center;
    border-radius: 999px;
    background: var(--sx-success-bg);
    color: var(--sx-success);
    font-size: 11.5px;
    font-weight: 600;
}
body.sx-app .control-group .published_label.not { background: var(--sx-warning-bg); color: var(--sx-warning); }
.sx-save-status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--sx-muted);
    font-size: 12.5px;
}
.sx-save-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sx-subtle);
}
.sx-save-status.is-saving::before { background: var(--sx-brand-400); animation: sx-pulse 1s ease-in-out infinite; }
.sx-save-status.is-saved::before { background: var(--sx-success); }
.sx-save-status.is-error { color: var(--sx-danger); }
.sx-save-status.is-error::before { background: var(--sx-danger); }
@keyframes sx-pulse { 50% { opacity: .3; } }

/* Blocks: constant spacing so focusing a block never shifts the layout */
body.sx-app #content .codex-editor .ce-block,
body.sx-app #content .codex-editor .ce-block.ce-block--focused {
    padding: 34px 16px 16px !important;
    border: 0;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px transparent;
    transition: background-color .15s, box-shadow .15s;
}
body.sx-app #content .codex-editor .ce-block:hover { box-shadow: inset 0 0 0 1px var(--sx-border); }
body.sx-app #content .codex-editor .ce-block.ce-block--focused {
    background: var(--sx-surface);
    box-shadow: inset 0 0 0 1px var(--sx-brand-400);
}
body.sx-app #content .codex-editor .ce-block.ce-block--selected .ce-block__content { background: var(--sx-brand-100); }
body.sx-app #content .codex-editor .cdx-block { background: transparent; margin-bottom: 0; }
body.sx-app #content .codex-editor .ce-paragraph { font-size: 15px; line-height: 1.6; color: var(--sx-ink); }
body.sx-app #content .codex-editor .ce-toolbar__content { border-top: 0; }
body.sx-app .codex-editor .ce-block { position: relative; padding-top: 34px !important; }
body.sx-app .codex-editor .sx-editorjs-block-label {
    position: absolute;
    z-index: 2;
    top: 5px;
    left: 16px;
    padding: 2px 7px;
    border: 1px solid var(--sx-border);
    border-radius: 5px;
    background: var(--sx-surface-2);
    color: var(--sx-muted);
    font: 600 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .02em;
    pointer-events: none;
}

body.sx-app #content .codex-editor .ce-toolbar__plus,
body.sx-app #content .codex-editor .ce-toolbar__settings-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--sx-border);
    border-radius: 7px;
    background: var(--sx-surface);
    color: var(--sx-text);
    box-shadow: var(--sx-shadow-sm);
    padding: 0;
}
body.sx-app #content .codex-editor .ce-toolbar__plus:hover,
body.sx-app #content .codex-editor .ce-toolbar__settings-btn:hover { border-color: var(--sx-brand-400); color: var(--sx-brand-600); background: var(--sx-brand-50); }
body.sx-app #content .codex-editor .ce-toolbar__settings-btn svg { fill: currentColor; }

body.sx-app .ce-popover,
body.sx-app .ce-popover__container,
body.sx-app .ce-inline-toolbar,
body.sx-app .ce-conversion-toolbar {
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    box-shadow: var(--sx-shadow-lg);
}
body.sx-app .ce-popover-item:hover:not(.ce-popover-item--no-hover) { background: var(--sx-brand-50); }
body.sx-app .ce-popover-item__icon { border-radius: 6px; box-shadow: none; border: 1px solid var(--sx-border); }

/* Editor workspace: crisp controls and quiet, paper-like content. */
body.sx-app #htmljs > .codex-editor { border: 1px solid var(--sx-border); border-radius: 12px; padding: 24px 16px; background: var(--sx-surface); }
body.sx-app .codex-editor .ce-block__content { max-width: calc(100% - 56px); }
body.sx-app .codex-editor .ce-toolbar__content { max-width: calc(100% - 56px); }
body.sx-app .codex-editor .ce-toolbar__actions { gap: 5px; }
body.sx-app .codex-editor .ce-header { padding: 0 !important; line-height: 1.3; letter-spacing: -.025em; }
body.sx-app .codex-editor .ce-inline-tool { background: transparent; color: var(--sx-text); border-radius: 6px; }
body.sx-app .codex-editor .ce-inline-tool:hover,
body.sx-app .codex-editor .ce-inline-tool--active { background: var(--sx-brand-50); color: var(--sx-brand-600); }
body.sx-app .codex-editor .ce-inline-tool svg { fill: currentColor; }
body.sx-app .ce-popover { border: 0; box-shadow: none; }
body.sx-app div.ce-popover__container { width: 290px !important; padding: 8px; border-radius: 12px; background: var(--sx-surface); color: var(--sx-ink); }
body.sx-app .ce-popover__items { padding: 4px 0; }
body.sx-app .ce-popover-item { gap: 10px; padding: 8px; border-radius: 7px; font-family: var(--sx-font); font-size: 13px; font-weight: 500; }
body.sx-app .ce-popover-item__icon { width: 30px; height: 30px; flex: 0 0 30px; background: var(--sx-surface-2); color: var(--sx-brand-600); border: 0; }
body.sx-app .ce-popover-item__icon svg { width: 18px; height: 18px; fill: currentColor; }
body.sx-app .ce-popover-item--focused:not(.ce-popover-item--no-hover) { background: var(--sx-brand-50); }
body.sx-app .ce-popover .cdx-search-field { margin: 0 0 6px; padding: 8px 10px; border: 1px solid var(--sx-border); border-radius: 8px; background: var(--sx-surface-2); }
body.sx-app .ce-popover .cdx-search-field__input { height: 24px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 13px !important; }
body.sx-app .ce-popover .cdx-search-field:focus-within { border-color: var(--sx-brand-400); box-shadow: 0 0 0 3px var(--sx-brand-50); }
body.sx-app .widget-image__area { border: 1px dashed var(--sx-border-strong); border-radius: 10px; background: var(--sx-surface-2); transition: border-color .15s, background .15s; }
body.sx-app .widget-image__area:hover { border-color: var(--sx-brand-400); background: var(--sx-brand-50); }
body.sx-app .widget-image__placeholder { padding: 24px; gap: 14px; color: var(--sx-muted); font-size: 14px; }
body.sx-app .widget-image__placeholder-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--sx-surface); color: var(--sx-brand-600); }
body.sx-app .widget-image__placeholder-icon svg { width: 22px; height: 22px; }

/* Columns tool */
body.sx-app .editorjs_ui_columns_box { margin: 0 8px 8px; padding: 4px 6px 4px 12px; gap: 4px; border: 1px solid var(--sx-border); border-radius: 8px; background: var(--sx-surface-2); box-shadow: none; }
body.sx-app .editorjs_ui_columns_box .sx-columns-label { padding: 0 10px 0 0; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--sx-muted); cursor: default; }
body.sx-app .editorjs_ui_columns_box button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 5px; background: var(--sx-surface); color: var(--sx-brand-600); cursor: pointer; }
body.sx-app .editorjs_ui_columns_box button:hover { background: var(--sx-brand-100); }
body.sx-app .editorjs_ui_columns_box button svg { width: 12px; max-height: 12px; fill: currentColor; }
body.sx-app #content .editorjs_ui_columns_box input { width: 28px; height: 28px; min-height: 0; padding: 0; margin: 0; border: 0; background: transparent; box-shadow: none; color: var(--sx-ink); font-size: 13px; }
body.sx-app .editorjs_editor_block_preview,
body.sx-app .editorjs_editor_block_edit {
    border: 1px solid var(--sx-border);
    border-radius: 8px;
    background: var(--sx-surface);
    transition: border-color .15s, box-shadow .15s;
}
body.sx-app .editorjs_editor_block_preview:hover { border-color: var(--sx-brand-400); box-shadow: var(--sx-shadow-sm); }
body.sx-app .editorjs_coll_toolbox { right: 8px; top: 8px; padding: 3px; border-color: var(--sx-border); border-radius: 7px; box-shadow: none; background: var(--sx-surface-2); }
body.sx-app .editorjs_coll_toolbox svg { fill: currentColor; width: 13px; height: 13px; }
body.sx-app .editorjs_editor_block_preview { padding: 48px 20px 20px; }
body.sx-app .editorjs_coll_toolbox a { color: var(--sx-text); border-radius: 50%; }
body.sx-app .editorjs_coll_toolbox a:hover { background: var(--sx-brand-50); color: var(--sx-brand-600); }

/* Editor modals */
body.sx-app .editorjs_modal { background: rgba(20, 20, 63, .55); padding: 4vh 16px 96px; }
body.sx-app .editorjs_modal_center { max-width: 720px; }
body.sx-app .editorjs_modal_header {
    min-height: 48px;
    border: 1px solid var(--sx-border);
    border-bottom: 0;
    border-radius: var(--sx-radius-lg) var(--sx-radius-lg) 0 0;
    background: var(--sx-surface-2);
}
body.sx-app .editorjs_modal_tab { height: 36px; font-weight: 600; color: var(--sx-muted); border-radius: 8px 8px 0 0; cursor: pointer; }
body.sx-app .editorjs_modal_tab.active { background: var(--sx-surface); color: var(--sx-ink); box-shadow: 0 -1px 0 var(--sx-border), 1px 0 0 var(--sx-border), -1px 0 0 var(--sx-border); }
body.sx-app .editorjs_modal_center .codex-editor,
body.sx-app .editorjs_modal_settings_content {
    border: 1px solid var(--sx-border);
    border-top: 0;
    border-radius: 0 0 var(--sx-radius-lg) var(--sx-radius-lg);
    padding: 24px;
    box-shadow: var(--sx-shadow-lg);
}
body.sx-app .editorjs_modal_center * { color: var(--sx-ink); }
body.sx-app .editorjs_modal_center .ce-block { padding: 34px 16px 16px !important; border: 0; border-radius: 8px; background: transparent; }
body.sx-app .editorjs_modal_center .cdx-block { background: transparent; }
body.sx-app .editorjs_modal_center .ce-block--focused { box-shadow: inset 0 0 0 1px var(--sx-brand-400); }
body.sx-app .editorjs_modal_center [contenteditable]:focus { outline: none; }
body.sx-app .editorjs_modal_center .ce-toolbar__plus,
body.sx-app .editorjs_modal_center .ce-toolbar__settings-btn { width: 30px; height: 30px; border: 1px solid var(--sx-border); border-radius: 7px; background: var(--sx-surface); box-shadow: var(--sx-shadow-sm); padding: 0; }
body.sx-app .editorjs_modal_settings_field_row { max-width: none; }
body.sx-app .editorjs_modal_settings_field_row input[type=text],
body.sx-app .editorjs_modal_settings_field_row textarea {
    border: 1px solid var(--sx-border-strong);
    border-radius: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
}
body.sx-app .editorjs_modal_footer {
    height: 64px;
    max-width: 720px;
    padding: 0 16px;
    gap: 8px;
    border: 1px solid var(--sx-border);
    border-bottom: 0;
    border-radius: var(--sx-radius-lg) var(--sx-radius-lg) 0 0;
    background: var(--sx-surface);
    box-shadow: 0 -8px 24px rgba(20, 20, 63, .12);
}
body.sx-app .editorjs_default_btn {
    height: 36px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--sx-border-strong);
    border-radius: 8px;
    background: var(--sx-surface);
    color: var(--sx-ink);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 34px;
    text-transform: none;
    box-shadow: none;
}
body.sx-app .editorjs_default_btn.positive_btn { border-color: var(--sx-brand-600); background: var(--sx-brand-600); color: #fff; }
body.sx-app .editorjs_default_btn.negative_btn { color: var(--sx-danger); border-color: #f0c4c1; }

.sx-section-help { display: flex; gap: 14px; padding: 18px 22px; margin: 0 0 24px; border: 1px solid var(--sx-border); border-left: 3px solid var(--sx-brand-400); border-radius: 8px; background: var(--sx-surface); color: var(--sx-muted); font-size: 14px; line-height: 1.65; }
.sx-section-help__icon { flex: 0 0 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--sx-brand-50); color: var(--sx-brand-600); font-family: Georgia, serif; font-style: italic; font-weight: bold; }
.sx-section-help__body { min-width: 0; }
.sx-section-help p { margin: 0; }
.sx-section-help details { margin-top: 8px; }
.sx-section-help summary { cursor: pointer; color: var(--sx-brand-600); font-size: 13px; font-weight: 600; }
.sx-section-help ol { margin: 12px 0 4px 20px; }
.sx-section-help li { padding: 0 0 6px 4px; }
.sx-section-help__example { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; padding: 10px 14px; border-radius: 6px; background: var(--sx-surface-2); }
.sx-section-help__example span { font-size: 12px; font-weight: 600; }
.sx-section-help__example code { padding: 0; border: 0; background: transparent; color: var(--sx-ink); }

/* One icon family throughout the editor, including nested editor controls. */
body.sx-app svg.sx-editor-icon { width: 20px; height: 20px; fill: none !important; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
/* Settings use the same quiet, outlined controls as the toolbox. */
body.sx-app .ce-popover .setting_icons,
body.sx-app .ce-settings .setting_icons,
body.sx-app .ce-popover .cdx-settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex: 0 0 36px;
  margin: 3px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #666980;
  cursor: pointer;
  vertical-align: middle;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
body.sx-app .ce-popover .setting_icons:hover,
body.sx-app .ce-settings .setting_icons:hover,
body.sx-app .ce-popover .cdx-settings-button:hover { background: #f3f3fa; color: #353575; }
body.sx-app .ce-popover .cdx-settings-button--active,
body.sx-app .ce-settings .cdx-settings-button--active { background: #eeeef9; border-color: #d8d8ef; color: #383882; box-shadow: none; }
body.sx-app [data-sx-setting]:focus-visible { outline: 2px solid #7070b7; outline-offset: 2px; }
body.sx-app .hero_content_settings,
body.sx-app .hero_bg_settings,
body.sx-app .hero_align_settings { display: flex; gap: 2px; align-items: center; padding: 2px 0; }
body.sx-app .setting_icons svg.sx-editor-icon,
body.sx-app .hero_bg_image_toolbar svg.sx-editor-icon { width: 20px; height: 20px; }
body.sx-app svg.sx-editor-icon :not(.sx-editor-swatch) { fill: none !important; stroke: currentColor; }
body.sx-app svg.sx-editor-icon .sx-editor-swatch { stroke: none; }
body.sx-app .ce-popover hr { margin: 10px 0; border: 0; border-top: 1px solid #e9e9f1; }
body.sx-app .ce-popover__custom-content { max-height: min(520px, 60vh); overflow-y: auto; scrollbar-width: thin; }
body.sx-app .ce-popover__custom-content .hero_content_settings,
body.sx-app .ce-popover__custom-content .hero_bg_settings { justify-content: flex-start; min-height: 44px; }
body.sx-app .ce-popover .setting_icons { box-sizing: border-box; }
body.sx-app .ce-popover--opened > .ce-popover__container { max-height: min(560px, 70vh) !important; overflow-y: auto; scrollbar-width: thin; }
body.sx-app .groupbuttons_wrapper button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
body.sx-app .ce-popover-item__icon svg.sx-editor-icon { width: 20px; height: 20px; }
body.sx-app .ce-popover-item { min-height: 44px; transition: background .12s, color .12s; }
body.sx-app .ce-popover-item__title { color: var(--sx-ink); }
body.sx-app .ce-popover__items { scrollbar-width: thin; scrollbar-color: var(--sx-border-strong) transparent; }
body.sx-app .ce-popover .cdx-search-field__icon { color: var(--sx-muted); }
body.sx-app .ce-inline-toolbar { padding: 5px; background: var(--sx-surface); }
body.sx-app .ce-inline-tool { min-width: 34px; min-height: 34px; }
body.sx-app .editorjs_coll_toolbox { display: flex; gap: 3px; padding: 4px; }
body.sx-app .editorjs_coll_toolbox button,
body.sx-app .editorjs_plus_btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--sx-muted); cursor: pointer; }
body.sx-app .editorjs_coll_toolbox button:hover,
body.sx-app .editorjs_plus_btn:hover { background: var(--sx-brand-50); color: var(--sx-brand-600); }
body.sx-app .editorjs_coll_toolbox button:focus-visible,
body.sx-app .editorjs_ui_columns_box button:focus-visible { outline: 2px solid var(--sx-brand-400); outline-offset: 2px; }
body.sx-app .editorjs_ui_columns_box button svg.sx-editor-icon { width: 16px; height: 16px; max-height: none; }
body.sx-app .editorjs_modal_center input:not([type]),
body.sx-app .editorjs_modal_center input[type=text],
body.sx-app .editorjs_modal_center input[type=number],
body.sx-app .editorjs_modal_center select,
body.sx-app .editorjs_modal_center textarea,
body.sx-app .codex-editor .block_row .cdx-input { box-sizing: border-box; width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--sx-border-strong); border-radius: 8px; background: var(--sx-surface); font-family: var(--sx-font); font-size: 14px; line-height: 1.5; box-shadow: none; }
body.sx-app .editorjs_modal_center input:focus,
body.sx-app .editorjs_modal_center select:focus,
body.sx-app .editorjs_modal_center textarea:focus,
body.sx-app .codex-editor .block_row .cdx-input:focus { outline: none; border-color: var(--sx-brand-400); box-shadow: 0 0 0 3px var(--sx-brand-50); }
body.sx-app .editorjs_modal_settings_field_row,
body.sx-app .editorjs_modal_settings_field_row label,
body.sx-app .editorjs_modal_settings_field_row .field_label { font-size: 13px; line-height: 1.6; }
body.sx-app .codex-editor .block_row { margin: 12px 0; }
body.sx-app .codex-editor .selectize-input { border: 1px solid var(--sx-border-strong); border-radius: 8px; min-height: 42px; padding: 9px 12px; box-shadow: none; }
body.sx-app .codex-editor .selectize-input .item { border-radius: 5px; padding: 3px 8px; background: var(--sx-brand-50); color: var(--sx-brand-600); }
body.sx-app .tc-table { border-radius: 8px; overflow: hidden; border-color: var(--sx-border); }
body.sx-app .tc-cell { border-color: var(--sx-border); padding: 12px; font-size: 14px; }
body.sx-app .cdx-quote { padding-left: 18px; border-left: 3px solid var(--sx-brand-400); }
body.sx-app .cdx-quote__caption { margin-top: 10px; color: var(--sx-muted); font-size: 13px; }
body.sx-app .ce-rawtool__textarea { border-radius: 8px; padding: 16px; background: #f5f6fa; color: var(--sx-ink); font-size: 13px; line-height: 1.7; }

/* Media drawer: labelled filters, quiet upload surface, clear file selection. */
body.sx-media-open { overflow: hidden; }
body.sx-app .media_wrapper { position: fixed; inset: 0 auto 0 0; box-sizing: border-box; width: min(400px,100%); max-width: none; padding: 0; background: var(--sx-surface); box-shadow: 8px 0 32px rgba(20,20,42,.12); z-index: 12000; opacity: 1; transform: none; transition: opacity .15s; }
body.sx-app .media_wrapper.close { transform: none; opacity: 0; pointer-events: none; }
body.sx-app .media_wrapper.remove { display: none; }
body.sx-app .media_wrapper.open { display: flex; }
body.sx-app .media_panel.sidebar-images { box-sizing: border-box; display: flex; flex-direction: column; width: 100%; max-width: none; flex: 0 0 auto; height: 100%; padding: 24px; background: var(--sx-surface); border-right: 1px solid var(--sx-border); overflow-y: auto; }
body.sx-app .sx-media-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
body.sx-app .sx-media-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sx-brand-600); }
body.sx-app .sx-media-heading h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.035em; margin: 6px 0 8px; color: var(--sx-ink); }
body.sx-app .sx-media-heading p { font-size: 13px; line-height: 1.5; margin: 0; color: var(--sx-muted); }
body.sx-app .media_panel .media_close { float: none; position: static; display: grid; place-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; margin: 0; padding: 0; border: 1px solid var(--sx-border); border-radius: 8px; background: var(--sx-surface); color: var(--sx-muted); cursor: pointer; }
body.sx-app .media_panel .media_close:hover { background: var(--sx-surface-2); color: var(--sx-ink); }
body.sx-app .media_panel .media_close svg { display: block; width: 18px; height: 18px; margin: 0; fill: none; }
body.sx-app .sx-media-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; padding-bottom: 20px; }
body.sx-app .sx-media-filters > div:first-child { grid-column: 1 / -1; }
body.sx-app .sx-media-filters label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--sx-ink); }
body.sx-app .media_panel .media__search_box { box-sizing: border-box; width: 100%; max-width: none; height: 42px; margin: 0; padding: 10px 12px; border: 1px solid var(--sx-border-strong); border-radius: 8px; background-color: var(--sx-surface); color: var(--sx-ink); font-family: var(--sx-font); font-size: 13px; line-height: 20px; box-shadow: none; }
body.sx-app .media_panel select.media__search_box { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
body.sx-app .media_panel input[type=search] { padding-left: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236b7280' stroke-width='1.5'%3E%3Ccircle cx='8' cy='8' r='5'/%3E%3Cpath d='m12 12 4 4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 11px center; }
body.sx-app .media_panel .media__search_box:focus { outline: none; border-color: var(--sx-brand-400); box-shadow: 0 0 0 3px var(--sx-brand-50); }
body.sx-app .media_panel_uploader { margin-bottom: 22px; }
body.sx-app .media_uploader { padding: 0; margin: 0; border: 1px dashed var(--sx-border-strong); border-radius: 10px; background: var(--sx-surface-2); box-shadow: none; }
body.sx-app .media_uploader .icon { box-sizing: border-box; min-height: 140px; gap: 10px; padding: 20px 12px; border: 0; color: var(--sx-muted); font-size: 13px; text-align: center; }
body.sx-app .media_uploader .icon strong { color: var(--sx-brand-600); font-weight: 600; }
body.sx-app .media_uploader .icon small { font-size: 11px; color: var(--sx-muted); }
body.sx-app .media_uploader .icon svg.sx-editor-icon { width: 26px; height: 26px; margin: 0 0 2px; color: var(--sx-brand-600); }
body.sx-app .media_uploader:hover,
body.sx-app .media_uploader.active,
body.sx-app .media_uploader:focus-within { background: var(--sx-brand-50); border-color: var(--sx-brand-400); }
body.sx-app .media_uploader:focus-within { outline: 2px solid var(--sx-brand-400); outline-offset: 2px; }
body.sx-app .media_uploader input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
body.sx-app .media_panel .media_library { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); grid-auto-rows: auto; align-content: start; gap: 12px; overflow: visible; flex: 1; border: 0; padding: 0; }
body.sx-app .media_panel .media_img_wr { display: block; min-width: 0; height: auto; overflow: visible; margin: 0; }
body.sx-app .media_panel .media_library::after,
body.sx-app .media_panel .media_img_wr::after { display: none; }
body.sx-app .media_panel .media_img { position: static; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
body.sx-app .media_panel .media_image_container { box-sizing: border-box; width: 100%; height: 110px; border: 1px solid var(--sx-border); border-radius: 8px; padding: 6px; background: var(--sx-surface-2); transition: border-color .15s, box-shadow .15s; }
body.sx-app .media_panel .media_image_container:hover,
body.sx-app .media_panel .media_image_container[aria-pressed=true] { border-color: var(--sx-brand-400); box-shadow: 0 0 0 2px var(--sx-brand-50); }
body.sx-app .media_panel .media_image_container:focus-visible { outline: 2px solid var(--sx-brand-400); outline-offset: 2px; }
body.sx-app .sx-media-caption { display: block; padding-top: 6px; font-size: 11px; line-height: 1.5; color: var(--sx-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sx-app .media_panel .media_delete_btn { width: 24px; height: 24px; top: 5px; right: 5px; border: 1px solid var(--sx-border); border-radius: 6px; background: var(--sx-surface); color: var(--sx-muted); box-shadow: var(--sx-shadow-sm); font-size: 17px; opacity: 0; }
body.sx-app .media_img_wr:hover .media_delete_btn,
body.sx-app .media_img_wr:focus-within .media_delete_btn { opacity: 1; }
body.sx-app .media_panel .media_delete_btn:hover { background: #fff0ef; color: var(--sx-danger); }
body.sx-app .sx-media-empty { grid-column: 1 / -1; padding: 36px 12px; text-align: center; font-size: 14px; color: var(--sx-ink); }
body.sx-app .sx-media-empty small { display: block; margin-top: 8px; color: var(--sx-muted); font-size: 12px; }
body.sx-app .media_panel .media__load_more { margin-top: 20px; }
@media (max-width: 520px) {
    body.sx-app .media_panel.sidebar-images { width: 100%; padding: 20px; }
    body.sx-app .media_panel .media_library { grid-template-columns: repeat(2,minmax(0,1fr)); }
    body.sx-app .media_panel .media_delete_btn { opacity: 1; }
}

/* Version history panel tweaks */
body.sx-app .lp-revs__panel { border-color: var(--sx-border); border-radius: var(--sx-radius-lg); box-shadow: var(--sx-shadow-lg); }

/* --------------------------------------------------------------------------
   Signed-out screens (login, forgot/reset password)
   -------------------------------------------------------------------------- */
body.sx-auth-page { padding: 0; background: var(--sx-canvas); }
body.sx-auth-page #wrapper { min-height: 100vh; }
body.sx-auth-page footer { display: none; }

.sx-auth {
    display: grid;
    grid-template-columns: minmax(360px, 44%) 1fr;
    min-height: 100vh;
}
.sx-auth__brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(1200px 600px at 110% 120%, rgba(106, 106, 210, .45), transparent 60%),
        radial-gradient(700px 500px at -10% -20%, rgba(63, 63, 179, .55), transparent 60%),
        var(--sx-brand-800);
}
.sx-auth__brand::after {
    /* Quiet, oversized echo of the brand mark */
    content: "";
    position: absolute;
    right: -8%;
    bottom: -10%;
    width: 70%;
    aspect-ratio: 95 / 78;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .07);
    box-shadow: 0 0 0 60px rgba(255, 255, 255, .025), 0 0 0 140px rgba(255, 255, 255, .02);
    pointer-events: none;
}
.sx-auth__logo { position: relative; z-index: 1; display: inline-block; color: #fff; width: 220px; max-width: 70%; }
.sx-auth__logo .sx-logo { width: 100%; height: auto; }
.sx-auth__intro { position: relative; z-index: 1; max-width: 420px; }
.sx-auth__eyebrow {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, .62);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.sx-auth__claim {
    margin: 0;
    color: #fff;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.sx-auth__meta { position: relative; z-index: 1; margin: 0; color: rgba(255, 255, 255, .5); font-size: 13px; }

.sx-auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}
.sx-auth__card { width: 100%; max-width: 400px; }
.sx-auth__header { margin-bottom: 24px; }
body.sx-auth-page .sx-auth__title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}
.sx-auth__lead { margin: 0; color: var(--sx-muted); font-size: 15px; line-height: 1.55; }
.sx-auth__lead strong { color: var(--sx-ink); }

.sx-form { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.sx-field { display: flex; flex-direction: column; gap: 6px; }
.sx-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sx-label { margin: 0; color: var(--sx-ink); font-size: 14px; font-weight: 600; }

body.sx-auth-page input.sx-input {
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--sx-border-strong);
    border-radius: 9px;
    background: var(--sx-surface);
    color: var(--sx-ink);
    font-family: var(--sx-font);
    font-size: 15px;
    line-height: 42px;
    box-shadow: inset 0 1px 1px rgba(23, 25, 51, .03);
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
body.sx-auth-page input.sx-input:hover { border-color: var(--sx-subtle); }
body.sx-auth-page input.sx-input:focus {
    outline: none;
    border-color: var(--sx-brand-500);
    box-shadow: var(--sx-ring);
}
body.sx-auth-page input.sx-input[aria-invalid="true"] { border-color: var(--sx-danger); }
body.sx-auth-page input.sx-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(190, 49, 40, .2); }

.sx-password { position: relative; }
body.sx-auth-page .sx-password input.sx-input { padding-right: 48px; }
.sx-password__toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--sx-muted);
    cursor: pointer;
    transform: translateY(-50%);
}
.sx-password__toggle:hover { background: var(--sx-surface-2); color: var(--sx-ink); }
.sx-password__toggle .sx-password__hide,
.sx-password__toggle[aria-pressed="true"] .sx-password__show { display: none; }
.sx-password__toggle[aria-pressed="true"] .sx-password__hide { display: inline-block; }

body.sx-auth-page .sx-btn--primary { margin-top: 4px; }

.sx-alert {
    display: flex;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 14px;
    line-height: 1.45;
}
.sx-alert .sx-icon { width: 20px; height: 20px; margin-top: 0; }
.sx-alert--error { background: var(--sx-danger-bg); border-color: #f3c6c2; color: var(--sx-danger); }
.sx-alert--success { background: var(--sx-success-bg); border-color: #bfe3cf; color: var(--sx-success); }

.sx-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 28px;
    color: var(--sx-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.sx-back:hover { color: var(--sx-ink); text-decoration: none; }
.sx-back .sx-icon { width: 18px; height: 18px; }

.sx-auth__state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
    border-radius: 14px;
    background: var(--sx-brand-50);
    color: var(--sx-brand-600);
}
.sx-auth__state-icon .sx-icon { width: 26px; height: 26px; }
.sx-auth__state-icon--warning { background: var(--sx-warning-bg); color: var(--sx-warning); }
.sx-auth__hints {
    margin: 20px 0 0;
    padding: 14px 16px 14px 34px;
    border-radius: 9px;
    background: var(--sx-surface);
    border: 1px solid var(--sx-border);
    color: var(--sx-text);
    font-size: 14px;
    line-height: 1.6;
}
.sx-auth__actions { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 28px; }

.sx-rules { margin: -4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sx-rules li { display: flex; align-items: center; gap: 8px; color: var(--sx-muted); font-size: 13px; }
.sx-rules li .sx-icon {
    width: 18px;
    height: 18px;
    padding: 2px;
    border-radius: 50%;
    background: #eef0f5;
    color: transparent;
    box-sizing: border-box;
    transition: background-color .15s, color .15s;
}
.sx-rules li.is-met { color: var(--sx-success); }
.sx-rules li.is-met .sx-icon { background: var(--sx-success); color: #fff; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .sx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sx-dashboard__grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sx-auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .sx-auth__brand { padding: 28px 24px; min-height: 0; }
    .sx-auth__brand::after,
    .sx-auth__intro,
    .sx-auth__meta { display: none; }
    .sx-auth__logo { width: 160px; }
    .sx-auth__panel { align-items: flex-start; padding: 36px 20px 48px; }
}

@media (max-width: 768px) {
    :root { --sx-nav-w: 0px; }
    body.sx-app header .navbar .brand.sx-brand { width: auto; padding: 0 12px 0 4px; }
    body.sx-app .sx-nav-toggle { display: inline-flex; }
    body.sx-app #wrapper { display: block; }
    body.sx-app.sx-nav-collapsed #main-nav { display: none; }
    body.sx-app.sx-nav-collapsed #wrapper { background: transparent; }
    body.sx-app #main-nav {
        display: none;
        float: none;
        width: 100%;
        min-height: 0;
        max-height: none;
        position: static;
        background: var(--sx-surface);
        border-right: 0;
        border-bottom: 1px solid var(--sx-border);
    }
    body.sx-app.sx-nav-open #main-nav { display: block; }
    body.sx-app #main-nav .navigation > .nav > li span,
    body.sx-app #main-nav .navigation > .nav > li i.angle-down { display: inline !important; }
    body.sx-app #main-nav .navigation > .nav > li > ul.in { display: block !important; }
    body.sx-app #content { margin-left: 0 !important; }
    body.sx-app #content-wrapper .main-content { padding: 0 16px; }
    body.sx-app #content form.form-horizontal { padding: 18px 16px; }
    body.sx-app #content .sx-form-actions { margin: 24px -16px -18px; padding: 12px 16px; }
    body.sx-app .sx-toolbar__divider { display: none; }
    .sx-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .sx-stat { padding: 14px; }
    .sx-stat__value { font-size: 26px; }
    .sx-stat__icon { display: none; }
    .sx-page-header__actions { width: 100%; }
}

@media (max-width: 480px) {
    body.sx-app #sidebar.sx-link-panel-open { width: 100vw; }
}

@media (max-width: 480px) {
    body.sx-app #iconbar.sx-toolbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Overview markup separates buttons with <br>; spacing is handled here instead */
body.sx-app #content .main-content > br { display: none; }
body.sx-app #content .main-content > .btn { margin: 0 8px 12px 0; }

/* Buttons inside table rows are secondary by nature: keep them quiet */
body.sx-app #content table .btn:not(.btn-danger) {
    height: 32px;
    min-width: 32px;
    padding: 0 9px;
    border-color: var(--sx-border);
    background: var(--sx-surface);
    color: var(--sx-text);
    box-shadow: none;
}
body.sx-app #content table .btn:not(.btn-danger):hover {
    border-color: var(--sx-brand-400);
    background: var(--sx-brand-50);
    color: var(--sx-brand-700);
}
body.sx-app #content table .btn.btn-danger { height: 32px; min-width: 32px; padding: 0 9px; box-shadow: none; }

/* --------------------------------------------------------------------------
   Sidebar forms (rendered in an iframe inside #sideform)
   -------------------------------------------------------------------------- */
body.sx-iframe { padding: 0 !important; background: var(--sx-surface); min-height: 0; }
body.sx-iframe #content {
    display: block;
    min-height: 0;
    padding: 20px 24px 0;
    background: var(--sx-surface);
}
body.sx-iframe .sx-iframe__title { margin: 4px 40px 16px 0; font-size: 20px; font-weight: 650; }
body.sx-iframe #content form.form-horizontal {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
body.sx-iframe #content .sx-form-actions { margin: 24px -24px 0; padding: 14px 24px; border-radius: 0; }
body.sx-iframe #content .form-horizontal .controls button { width: auto; margin-bottom: 0; }
body.sx-iframe #content .btn.btn-info.media-library-select { color: var(--sx-ink); }
body.sx-app #sideform {
    box-sizing: border-box; display: none; position: fixed; inset: 0 0 0 auto; width: min(500px, 100%); height: 100%; min-height: 0;
    margin: 0; padding: 0; border: 0; border-left: 1px solid var(--sx-border); border-radius: 0;
    box-shadow: -8px 0 32px rgba(20, 20, 40, .12);
    background: var(--sx-surface); z-index: 2001; overflow: hidden;
}
body.sx-app #sideform.is-open { display: block; }
.sx-form-sidebar__window { position: relative; width: 100%; height: 100%; background: var(--sx-surface); overflow: hidden; }
body.sx-app #sideform iframe { display: block; width: 100%; height: 100%; min-height: 0; border: 0; }
#sideform a.sidebar-close {
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    position: absolute; top: 16px; right: 16px; margin: 0;
    padding: 0;
    border: 1px solid var(--sx-border);
    border-radius: 8px;
    background: var(--sx-surface);
    background-image: none;
    color: var(--sx-text);
    text-shadow: none;
    box-shadow: none;
}
#sideform a.sidebar-close:hover { background: var(--sx-surface-2); color: var(--sx-ink); }

/* Respect bootstrap-fileupload state classes (our .btn display rule would otherwise reveal hidden parts) */
body.sx-app .fileupload-new .fileupload-exists,
body.sx-app .fileupload-exists .fileupload-new { display: none !important; }
body.sx-app #content .fileupload .btn-file { position: relative; overflow: hidden; }
body.sx-app #content .fileupload .btn-file > input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
body.sx-app #content .fileupload .input-append { flex-wrap: nowrap; max-width: 100%; }
body.sx-app #content .fileupload .uneditable-input { min-width: 0; flex: 1 1 auto; }
body.sx-app #content .fileupload .input-append > .btn { flex: 0 0 auto; }
body.sx-app #content .fileupload .input-append { display: flex; width: 100%; max-width: 480px; }
body.sx-app #content .fileupload .uneditable-input { width: auto; }
.sx-multiselect { position: relative; width: 100%; margin: 12px 0; font: 14px/1.5 var(--sx-font, sans-serif); color: var(--sx-ink, #25253d); }
.sx-multiselect [hidden] { display: none !important; }
.sx-multiselect__control { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 6px 9px; box-sizing: border-box; border: 1px solid var(--sx-border-strong, #cdcddd); border-radius: 8px; background: var(--sx-surface, #fff); cursor: text; }
.sx-multiselect:focus-within .sx-multiselect__control { border-color: var(--sx-brand-400, #7070b7); box-shadow: 0 0 0 3px var(--sx-brand-50, #eeeef9); }
.sx-multiselect__chips { display: contents; }
.sx-multiselect__chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 5px 3px 9px; border-radius: 5px; background: var(--sx-brand-50, #eeeef9); color: var(--sx-brand-600, #383882); }
.sx-multiselect__chip > span { overflow-wrap: anywhere; }
body.sx-app .editor_blocks input.sx-multiselect__search, .sx-multiselect input.sx-multiselect__search { flex: 1 1 130px; width: 130px; min-width: 60px; height: 30px; min-height: 0; margin: 0; padding: 3px 4px; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; box-shadow: none; outline: none; }
.sx-multiselect button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; margin: 0; padding: 4px; border: 0; border-radius: 4px; background: transparent; color: var(--sx-muted, #77778b); box-shadow: none; cursor: pointer; }
.sx-multiselect button:hover { background: var(--sx-brand-50, #eeeef9); color: var(--sx-brand-600, #383882); }
.sx-multiselect button:focus-visible { outline: 2px solid var(--sx-brand-400, #7070b7); outline-offset: 1px; }
.sx-multiselect button svg { width: 16px; height: 16px; }
.sx-multiselect button.sx-multiselect__toggle { border-left: 1px solid var(--sx-border, #e4e4ee); border-radius: 0; padding-left: 9px; }
.sx-multiselect.is-open .sx-multiselect__toggle svg { transform: rotate(180deg); }
.sx-multiselect__list { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 50; box-sizing: border-box; max-height: 240px; padding: 5px; overflow-y: auto; border: 1px solid var(--sx-border-strong, #cdcddd); border-radius: 8px; background: var(--sx-surface, #fff); box-shadow: 0 8px 24px rgba(25,25,55,.12); scrollbar-width: thin; }
.sx-multiselect__option { position: relative; padding: 9px 32px 9px 10px; border-radius: 5px; overflow-wrap: anywhere; cursor: pointer; }
.sx-multiselect__option:hover, .sx-multiselect__option.is-active { background: var(--sx-surface-2, #f5f5fa); }
.sx-multiselect__option.is-selected { background: var(--sx-brand-50, #eeeef9); color: var(--sx-brand-600, #383882); }
.sx-multiselect__option.is-selected::after { content: '✓'; position: absolute; right: 12px; top: 9px; }
.sx-multiselect__option[aria-disabled=true], .sx-multiselect.is-disabled { opacity: .6; cursor: default; }
.sx-multiselect__empty { padding: 12px 10px; color: var(--sx-muted, #77778b); }
