@font-face {
    font-family: 'ConstantiaCustom';
    src: url('/constan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg: #1f2128;
    --panel: #e3e6eb;
    --panel-2: #f5f7fb;
    --panel-3: #d4d9e2;
    --white: #ffffff;
    --border: #b4bcc9;
    --text: #1f2630;
    --muted: #697586;
    --sidebar-1: #1b2f7e;
    --sidebar-2: #12245f;
    --brand: #3578f6;
    --brand-2: #235dd1;
    --success: #17b77a;
    --warning: #e98b2c;
    --danger: #d64d4d;
    --purple: #8d64ff;
    --shadow: 0 20px 55px rgba(7, 16, 35, 0.28);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--brand-2);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

body.cms-admin-body {
    background: linear-gradient(180deg, #254ac8 0%, #20317f 16%, #1f2128 16%, #1f2128 100%);
}

.cms-admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.cms-sidebar {
    background: linear-gradient(180deg, #284fbf 0%, #1c2a66 22%, #232733 100%);
    color: #fff;
    padding: 28px 18px;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cms-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 8px 10px;
}

.cms-sidebar-icon,
.cms-public-mark {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-family: 'ConstantiaCustom', Georgia, serif;
    font-size: 2rem;
    letter-spacing: 0.02em;
}

.cms-sidebar-title,
.cms-public-title,
.cms-topbar-title,
.cms-card-title,
.cms-page-title,
.cms-form-title {
    font-family: 'ConstantiaCustom', Georgia, serif;
}

.cms-sidebar-title {
    font-size: 1.9rem;
    line-height: 1;
}

.cms-sidebar-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 4px;
}

.cms-sidebar-nav,
.cms-sidebar-footer {
    display: grid;
    gap: 10px;
}

.cms-sidebar-footer {
    margin-top: auto;
}

.cms-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.18s ease, transform 0.18s ease;
}

.cms-sidebar-link:hover,
.cms-sidebar-link.is-active {
    background: linear-gradient(135deg, rgba(53, 120, 246, 0.98), rgba(34, 95, 207, 0.98));
    text-decoration: none;
    transform: translateX(2px);
}

.cms-sidebar-link-icon {
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
}

.cms-main {
    padding: 26px;
    min-width: 0;
}

.cms-stage {
    background: rgba(255, 255, 255, 0.26);
    border-radius: 28px;
    padding: 0;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.cms-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: #f4f6fb;
    border-bottom: 1px solid var(--border);
    padding: 22px 28px;
}

.cms-topbar-left,
.cms-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cms-topbar-title {
    font-size: 2rem;
    line-height: 1;
}

.cms-topbar-subtitle {
    color: var(--muted);
    margin-top: 3px;
    font-size: 0.94rem;
}

.cms-mobile-nav-toggle {
    display: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}

.cms-user-pill,
.cms-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
}

.cms-user-avatar {
    font-size: 1.1rem;
}

.cms-user-count {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #232733;
    color: #fff;
    font-size: 0.85rem;
}

.cms-site-switcher select,
.cms-field,
.cms-textarea,
.cms-editor-source,
.cms-form select,
.cms-form input,
.cms-form textarea {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--text);
}

.cms-content {
    padding: 28px;
    background: #eef1f6;
    min-height: calc(100vh - 94px);
}

.cms-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}

.cms-page-title {
    margin: 0;
    font-size: 2.25rem;
}

.cms-page-subtitle {
    color: var(--muted);
    margin-top: 6px;
}

.cms-action-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cms-button,
.cms-button-secondary,
.cms-button-danger,
.cms-button-ghost {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.cms-button:hover,
.cms-button-secondary:hover,
.cms-button-danger:hover,
.cms-button-ghost:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.cms-button {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
}

.cms-button-secondary {
    background: linear-gradient(135deg, #1ec6b5, #13a6a5);
    color: #fff;
}

.cms-button-danger {
    background: linear-gradient(135deg, #ef6b6b, #ca4848);
    color: #fff;
}

.cms-button-ghost {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.cms-grid,
.cms-stats {
    display: grid;
    gap: 20px;
}

.cms-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 22px;
}

.cms-stat-card,
.cms-panel,
.cms-form-card,
.cms-login-card,
.cms-public-card,
.cms-card {
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 14px 28px rgba(17, 26, 48, 0.12);
}

.cms-stat-card {
    padding: 22px;
    color: #fff;
    display: grid;
    gap: 8px;
}

.cms-stat-card.blue { background: linear-gradient(135deg, #4184ff, #2e64db); }
.cms-stat-card.teal { background: linear-gradient(135deg, #24c6b8, #17a89f); }
.cms-stat-card.orange { background: linear-gradient(135deg, #ff9741, #f28122); }
.cms-stat-card.purple { background: linear-gradient(135deg, #966cff, #7652ea); }

.cms-stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}

.cms-stat-label {
    opacity: 0.94;
}

.cms-dashboard-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
}

.cms-panel {
    background: #f8f9fc;
    overflow: hidden;
}

.cms-panel-header {
    padding: 20px 22px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.cms-card-title {
    margin: 0;
    font-size: 1.6rem;
}

.cms-panel-body {
    padding: 20px 22px 22px;
}

.cms-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.cms-quick-card {
    min-height: 128px;
    padding: 18px;
    border-radius: 18px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    font-weight: 700;
}

.cms-quick-card.blue { background: linear-gradient(135deg, #3d8dff, #2465dc); }
.cms-quick-card.orange { background: linear-gradient(135deg, #ff7a55, #fb4e31); }
.cms-quick-card.green { background: linear-gradient(135deg, #5dd56c, #37b251); }
.cms-quick-card.yellow { background: linear-gradient(135deg, #ffc43e, #e8a51f); color: #3f3308; }
.cms-quick-card.purple { background: linear-gradient(135deg, #9d6dff, #6f48dc); }
.cms-quick-card.cyan { background: linear-gradient(135deg, #3ebde8, #1e99d2); }

.cms-chart {
    width: 100%;
    height: 260px;
    background: linear-gradient(180deg, #fafdff, #ecf3ff);
    border: 1px solid #d7e0f0;
    border-radius: 18px;
    overflow: hidden;
}

.cms-list,
.cms-table {
    width: 100%;
    border-collapse: collapse;
}

.cms-list-row,
.cms-table tr {
    border-bottom: 1px solid #d8dde8;
}

.cms-list-row:last-child,
.cms-table tr:last-child {
    border-bottom: 0;
}

.cms-list-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
}

.cms-list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: linear-gradient(135deg, #74a9ff, #547eff);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.cms-table-wrap {
    overflow-x: auto;
}

.cms-table th,
.cms-table td {
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
}

.cms-table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.cms-table td.sort-handle {
    cursor: move;
    font-size: 1.35rem;
    color: var(--muted);
}

.cms-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.cms-form-grid.one {
    grid-template-columns: 1fr;
}

.cms-form-card {
    padding: 24px;
    background: #f7f9fd;
}

.cms-form-title {
    margin: 0 0 18px;
    font-size: 1.9rem;
}

.cms-form-note,
.cms-note,
.cms-meta {
    color: var(--muted);
}

.cms-label {
    display: grid;
    gap: 8px;
    font-weight: 700;
    color: #394455;
}

.cms-textarea,
.cms-editor-source,
textarea.cms-textarea {
    min-height: 160px;
    resize: vertical;
}

.cms-editor-card {
    background: #f7f9fd;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.cms-editor-toolbar {
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    background: #fff;
}

.cms-editor {
    min-height: 360px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0 0 18px 18px;
}

.cms-editor .ql-editor {
    min-height: 360px;
}

.cms-editor-source {
    display: none;
    min-height: 360px;
    border-radius: 18px;
    font-family: Consolas, Monaco, monospace;
}

.ql-toolbar .ql-python::after {
    content: 'Py';
    font-size: 0.83rem;
    font-weight: 700;
}

.ql-python-block,
.cms-python-render {
    border: 1px solid #d8deea;
    background: #f8fafc;
    border-radius: 18px;
    overflow: hidden;
    margin: 12px 0;
}

.ql-python-block pre,
.cms-python-render pre {
    margin: 0;
    border-radius: 0;
}

.ql-python-toolbar,
.cms-python-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #edf4ff, #dce8ff);
    border-bottom: 1px solid #d0ddf3;
    font-weight: 700;
    color: #284067;
}

.ql-python-actions {
    display: inline-flex;
    gap: 8px;
}

.ql-python-actions button {
    border: 1px solid #b8c7e4;
    border-radius: 10px;
    background: #fff;
    padding: 6px 10px;
    cursor: pointer;
}

.cms-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 14, 24, 0.64);
    z-index: 999;
    padding: 32px;
}

.cms-modal-backdrop.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cms-modal {
    width: min(1040px, 96vw);
    max-height: 92vh;
    overflow: hidden;
    background: #f9fbff;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.cms-modal-header,
.cms-modal-footer {
    padding: 18px 22px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.cms-modal-footer {
    border-top: 1px solid var(--border);
    border-bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.cms-modal-body {
    padding: 22px;
    overflow: auto;
}

.cms-media-modal {
    height: min(92vh, 960px);
}

.cms-media-modal-body {
    padding: 0;
    overflow: hidden;
    min-height: 0;
    display: flex;
}

.cms-modal-title {
    margin: 0;
    font-size: 1.55rem;
}

.cms-modal-textarea {
    width: 100%;
    min-height: 420px;
    resize: vertical;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 14px;
    font-family: Consolas, Monaco, monospace;
}

#cms-elfinder-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    display: block;
    flex: 1 1 auto;
}

.cms-flash {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 700;
}

.cms-flash-success { background: rgba(23, 183, 122, 0.14); color: #0f7f57; }
.cms-flash-error { background: rgba(214, 77, 77, 0.14); color: #a33939; }
.cms-flash-info { background: rgba(53, 120, 246, 0.12); color: #2451b1; }

.ui-sortable-helper {
    box-shadow: 0 18px 36px rgba(11, 25, 56, 0.24);
}

.ui-state-highlight.cms-sort-placeholder {
    height: 54px;
    border-radius: 14px;
    background: rgba(65, 132, 255, 0.12);
    border: 2px dashed rgba(65, 132, 255, 0.5);
}

body.cms-public-body {
    background:
        radial-gradient(circle at top left, rgba(74, 116, 255, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(44, 204, 255, 0.1), transparent 24%),
        linear-gradient(180deg, #141824 0%, #0f131b 100%);
    color: #e8edf7;
}

.cms-public-shell-tt {
    padding-top: 34px;
}

.cms-public-header-tt {
    margin-bottom: 26px;
}

.ai-nav.tt-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-radius: 24px;
    background: rgba(11, 16, 26, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 18px;
    z-index: 50;
}

.ai-nav .header-left,
.ai-nav .header-right,
.tt-nav-menu-wrap {
    display: flex;
    align-items: center;
}

.ai-nav .header-left {
    gap: 18px;
    min-width: 0;
}

.ai-nav .header-right {
    margin-left: auto;
}

.ai-nav .logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    min-width: 0;
}

.ai-nav .logo:hover {
    text-decoration: none;
}

.logo-mark {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(56, 116, 255, 0.94), rgba(94, 54, 255, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-family: 'ConstantiaCustom', Georgia, serif;
    font-size: 1.65rem;
    box-shadow: 0 16px 32px rgba(35, 93, 209, 0.26);
    flex: 0 0 auto;
}

.logo-text-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo-text {
    font-family: 'ConstantiaCustom', Georgia, serif;
    font-size: 1.35rem;
    line-height: 1.05;
    color: #ffffff;
    white-space: nowrap;
}

.logo-subtext {
    margin-top: 4px;
    color: rgba(232, 237, 247, 0.72);
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 44vw;
}

.menu-button,
.menu-toggle {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.menu-button:hover,
.menu-button:focus-visible,
.menu-toggle:hover,
.menu-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
    outline: none;
    text-decoration: none;
}

.menu-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    font-weight: 700;
}

.menu-toggle {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    display: none;
}

.dropdown {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    min-width: 320px;
    max-width: min(92vw, 460px);
    padding: 12px;
    border-radius: 24px;
    background: rgba(11, 16, 26, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
    display: none;
}

.dropdown.show {
    display: block;
}

.tt-nav-menu-wrap {
    position: relative;
}

.dropdown-item + .dropdown-item,
.dropdown-item + .dropdown-link,
.dropdown-link + .dropdown-item,
.dropdown-link + .dropdown-link {
    margin-top: 8px;
}

.dropdown-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}

.dropdown-link,
.submenu-toggle {
    border-radius: 16px;
}

.dropdown-link {
    display: block;
    width: 100%;
    padding: 13px 15px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f2f6ff;
    font-weight: 700;
    line-height: 1.35;
}

.dropdown-link:hover,
.dropdown-link:focus-visible {
    background: rgba(68, 121, 255, 0.16);
    border-color: rgba(116, 156, 255, 0.38);
    color: #ffffff;
    text-decoration: none;
    outline: none;
}

.submenu-toggle {
    width: 48px;
    min-width: 48px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #cfd9ee;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.submenu-toggle:hover,
.submenu-toggle:focus-visible {
    background: rgba(68, 121, 255, 0.16);
    border-color: rgba(116, 156, 255, 0.38);
    color: #ffffff;
    outline: none;
}

.dropdown-item.has-children.open > .dropdown-row .submenu-toggle svg {
    transform: rotate(90deg);
}

.dropdown-item.has-children .submenu-toggle svg {
    transition: transform 0.18s ease;
}

.sub-dropdown {
    display: none;
    margin-top: 8px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.dropdown-item.has-children.open > .sub-dropdown {
    display: block;
}

.dropdown-sub-link {
    background: rgba(255, 255, 255, 0.04);
}

.cms-public-card-tt {
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.cms-public-admin-row {
    margin-top: 18px;
}

@media (max-width: 768px) {
    .ai-nav.tt-nav {
        padding: 14px;
        border-radius: 22px;
        top: 12px;
    }

    .ai-nav .header-left {
        min-width: 0;
        flex: 1 1 auto;
    }

    .logo-subtext,
    .tt-nav-menu-wrap .menu-button {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .dropdown {
        left: auto;
        right: 0;
        min-width: min(88vw, 360px);
    }

    .dropdown.mobile-full {
        position: fixed;
        top: 88px;
        left: 16px;
        right: 16px;
        min-width: 0;
        max-width: none;
        max-height: calc(100vh - 112px);
        overflow: auto;
    }

    .logo-text {
        font-size: 1.15rem;
        white-space: normal;
    }
}

.cms-public-shell {
    max-width: 1220px;
    margin: 0 auto;
    padding: 28px 22px 60px;
}

.cms-public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.cms-public-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cms-public-title {
    font-size: 2rem;
    margin: 0;
}

.cms-public-tagline {
    color: #aab6c9;
    margin-top: 5px;
}

.cms-public-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cms-public-nav a {
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}

.cms-public-card {
    background: #f8fbff;
    color: var(--text);
    padding: 26px;
    margin-bottom: 20px;
}

.cms-public-card h2,
.cms-public-card h3 {
    font-family: 'ConstantiaCustom', Georgia, serif;
    margin-top: 0;
}

.cms-inline-gallery {
    margin-top: 18px;
    margin-bottom: 18px;
}

.cms-login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background: linear-gradient(135deg, #264ed4 0%, #162148 28%, #1f2128 100%);
}

.cms-login-card {
    width: min(540px, 96vw);
    padding: 34px;
    background: #f7f9fc;
}

.cms-login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.cms-login-title {
    margin: 0;
    font-size: 2rem;
    font-family: 'ConstantiaCustom', Georgia, serif;
}

.cms-login-note {
    color: var(--muted);
    margin-bottom: 20px;
}

.cms-login-help {
    margin-top: 18px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(53, 120, 246, 0.08);
    color: #3157a9;
}

.cms-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(53, 120, 246, 0.12);
    color: #2c58b4;
    font-weight: 700;
    font-size: 0.85rem;
}

.cms-danger-link {
    color: #c33e3e;
    font-weight: 700;
}

@media (max-width: 1120px) {
    .cms-stats,
    .cms-dashboard-grid,
    .cms-mini-grid,
    .cms-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 920px) {
    .cms-admin-shell {
        grid-template-columns: 1fr;
    }

    .cms-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 1000;
        width: min(300px, 86vw);
    }

    .cms-sidebar.is-open {
        transform: translateX(0);
    }

    .cms-mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .cms-main {
        padding: 16px;
    }

    .cms-topbar,
    .cms-content {
        padding: 18px;
    }
}

@media (max-width: 720px) {
    .cms-stats,
    .cms-dashboard-grid,
    .cms-mini-grid,
    .cms-form-grid {
        grid-template-columns: 1fr;
    }

    .cms-page-header,
    .cms-topbar,
    .cms-public-header {
        flex-direction: column;
        align-items: stretch;
    }

    .cms-modal-backdrop {
        padding: 10px;
    }

    .cms-modal-body {
        padding: 12px;
    }
}

/* 2026-03-30 TrioDesktop public site refresh */
body.cms-public-body {
    background:
        radial-gradient(circle at top left, rgba(75, 137, 255, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(95, 214, 255, 0.08), transparent 24%),
        linear-gradient(180deg, #0d1016 0%, #121822 100%);
    color: #ecf2ff;
}

body.tt-menu-open {
    overflow: hidden;
}

.cms-public-shell-tt {
    padding: 0 0 64px;
    max-width: 1240px;
}

.tt-site-header {
    position: sticky;

    z-index: 80;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding-top:25px;

    background: linear-gradient(90deg, rgba(13, 16, 24, 0.96) 0%, rgba(32, 24, 16, 0.94) 50%, rgba(13, 16, 24, 0.96) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
}

.tt-site-header-inner {
    max-width: 1240px;
    margin: 0 auto;
    min-height: 78px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.tt-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: #ffffff;
}

.tt-brand:hover {
    text-decoration: none;
}

.tt-brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: linear-gradient(145deg, #2c6cff 0%, #59c9ff 100%);
    color: #ffffff;
    font-family: 'ConstantiaCustom', Georgia, serif;
    font-size: 1.5rem;
    box-shadow: 0 14px 28px rgba(32, 112, 255, 0.28);
}

.tt-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tt-brand-title {
    color: #ffffff;
    font-family: 'ConstantiaCustom', Georgia, serif;
    font-size: 1.3rem;
    line-height: 1.05;
    white-space: nowrap;
}

.tt-brand-tagline {
    margin-top: 4px;
    color: rgba(236, 242, 255, 0.72);
    font-size: 0.84rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 38vw;
}

.tt-nav-panel {
    margin-left: auto;
}

.tt-nav-list,
.tt-submenu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tt-nav-list {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tt-nav-item {
    position: relative;
}

.tt-nav-parent {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tt-nav-link,
.tt-submenu-link,
.tt-nav-expand,
.tt-hamburger {
    appearance: none;
    border: 0;
    background: transparent;
    color: #edf3ff;
}

.tt-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tt-nav-link:hover,
.tt-nav-link:focus-visible,
.tt-submenu-link:hover,
.tt-submenu-link:focus-visible,
.tt-nav-expand:hover,
.tt-nav-expand:focus-visible,
.tt-hamburger:hover,
.tt-hamburger:focus-visible {
    text-decoration: none;
    outline: none;
    background: rgba(255, 255, 255, 0.09);
}

.tt-nav-expand {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(237, 243, 255, 0.9);
}

.tt-nav-item.has-children:hover > .tt-nav-parent .tt-nav-expand svg,
.tt-nav-item.has-children:focus-within > .tt-nav-parent .tt-nav-expand svg,
.tt-nav-item.has-children.open > .tt-nav-parent .tt-nav-expand svg {
    transform: rotate(180deg);
}

.tt-nav-expand svg {
    transition: transform 0.2s ease;
}

/* live-site submenu fix: remove rollout gap completely */
.tt-submenu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    max-width: min(88vw, 340px);
    padding: 12px;
    margin-top: 0;
    border-radius: 20px;
    background: rgba(14, 19, 29, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.34);
    display: none;
    z-index: 200;
}

.tt-submenu-panel::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
    background: transparent;
}

.tt-nav-item.has-children:hover > .tt-submenu-panel,
.tt-nav-item.has-children:focus-within > .tt-submenu-panel,
.tt-nav-item.has-children.open > .tt-submenu-panel {
    display: block;
}

.tt-submenu-list {
    display: grid;
    gap: 8px;
}

.tt-submenu-link {
    display: block;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    font-weight: 700;
}

.tt-submenu-parent-link {
    margin-bottom: 8px;
    background: rgba(52, 111, 255, 0.18);
}

.tt-hamburger {
    display: none;
    width: 46px;
    height: 46px;
    margin-left: auto;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cms-public-admin-row {
    margin: 24px 22px 0;
}

.cms-public-card-tt {
    margin: 28px 22px 0;
    padding: 38px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(18, 24, 36, 0.96) 0%, rgba(13, 17, 25, 0.96) 100%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.tt-page-heading {
    margin-bottom: 18px;
}

.tt-page-kicker {
    margin: 0 0 10px;
    color: #73b9ff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tt-page-heading h1 {
    margin: 0;
    color: #ffffff;
    font-family: 'ConstantiaCustom', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.05;
}

.tt-public-content {
    color: #e8eefb;
    font-size: 1.05rem;
    line-height: 1.75;
}

.tt-public-content h1,
.tt-public-content h2,
.tt-public-content h3 {
    color: #ffffff;
    font-family: 'ConstantiaCustom', Georgia, serif;
    line-height: 1.12;
    margin-top: 0;
}

.tt-public-content h1 {
    font-size: clamp(2rem, 4.2vw, 3.35rem);
    margin-bottom: 16px;
}

.tt-public-content h2 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    margin: 32px 0 14px;
}

.tt-public-content h3 {
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    margin: 24px 0 12px;
}

.tt-public-content p {
    margin: 0 0 18px;
}

.tt-public-content p:first-of-type {
    color: rgba(232, 238, 251, 0.86);
    font-size: 1.1rem;
}

.tt-public-content a {
    color: #66afff;
}

.tt-public-content ul,
.tt-public-content ol {
    margin: 0 0 22px 24px;
}

.tt-public-content li + li {
    margin-top: 8px;
}

.tt-public-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 20px;
}

.tt-media-stage,
.tt-inline-media {
    margin: 24px 0;
}

.tt-media-stage {
    padding: 18px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(16, 23, 35, 0.98) 0%, rgba(11, 15, 22, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 24px 60px rgba(0, 0, 0, 0.24);
}

.tt-media-stage img,
.tt-inline-media img {
    width: 100%;
    background: #0d1118;
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.28);
}

.tt-badge-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.tt-badge {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.tt-badge img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.tt-public-content .tt-inline-media {
    padding: 12px 0;
}

.tt-public-content .tt-inline-media img {
    max-width: 920px;
}

@media (max-width: 900px) {
    .tt-site-header-inner {
        min-height: 72px;
        padding: 0 16px;
        gap: 14px;
    }

    .tt-brand-tagline {
        display: none;
    }

    .tt-nav-panel {
        position: fixed;
        top: 84px;
        left: 16px;
        right: 16px;
        margin-left: 0;
        padding: 14px;
        border-radius: 22px;
        background: rgba(14, 19, 29, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 28px 56px rgba(0, 0, 0, 0.36);
        display: none;
    }

    .tt-nav-panel.show {
        display: block;
    }

    .tt-nav-list {
        display: grid;
        gap: 8px;
    }

    .tt-nav-link {
        width: 100%;
        min-height: 48px;
    }

    .tt-nav-parent {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .tt-submenu-panel {
        position: static;
        min-width: 0;
        max-width: none;
        margin-top: 8px;
        padding: 10px;
        display: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.03);
    }

    .tt-submenu-panel::before {
        display: none;
    }

    .tt-nav-item.has-children:hover > .tt-submenu-panel,
    .tt-nav-item.has-children:focus-within > .tt-submenu-panel {
        display: none;
    }

    .tt-nav-item.has-children.open > .tt-submenu-panel {
        display: block;
    }

    .tt-hamburger {
        display: inline-flex;
    }

    .cms-public-card-tt,
    .cms-public-admin-row {
        margin-left: 16px;
        margin-right: 16px;
    }

    .cms-public-card-tt {
        padding: 26px 20px;
        border-radius: 24px;
    }

    .tt-badge {
        width: 52px;
        height: 52px;
    }

    .tt-badge img {
        width: 30px;
        height: 30px;
    }
}