:root { --cms-width: 246px; --cms-ink: #182338; --cms-muted: #536580; --cms-line: #dfe5ee; --cms-blue: #2547a4; }
body { margin: 0; background: #f4f6f9; color: var(--cms-ink); font-family: system-ui, sans-serif; }
a { color: var(--cms-blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #6084f5; outline-offset: 2px; }
.btn-primary { --bs-btn-bg: #2547a4; --bs-btn-border-color: #2547a4; --bs-btn-hover-bg: #1e3780; --bs-btn-hover-border-color: #1e3780; }
.cms-sidebar { --bs-offcanvas-width: var(--cms-width); background: #14233e; color: #fff; overflow-y: auto; }
.sidebar-brand { display: flex; gap: .65rem; align-items: center; font-weight: 750; font-size: 1.1rem; padding: 1.1rem .9rem; border-block-end: 1px solid #33425c; }
.cms-brand-mark { display: inline-grid; place-items: center; min-width: 34px; height: 34px; color: white; background: #3659b9; border-radius: 8px; font-weight: 780; }
.cms-nav { padding: .8rem .65rem 1.1rem; }
.cms-nav-dashboard-row, .cms-nav-group {
    padding-block-end: .25rem;
    border-block-end: 1px solid #435370;
}
.cms-nav-group { margin-block-start: .25rem; }
.cms-nav-heading {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 44px;
    padding: .6rem .65rem;
    border-radius: .45rem;
    color: #e7edf9;
    font-size: .875rem;
    font-weight: 650;
    list-style: none;
    text-decoration: none;
    cursor: pointer;
}
.cms-nav-heading::-webkit-details-marker { display: none; }
.cms-nav-heading svg {
    flex: 0 0 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.cms-nav-group > summary::after {
    content: "";
    flex: 0 0 .45rem;
    width: .45rem;
    height: .45rem;
    margin-inline-start: auto;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}
.cms-nav-group[open] > summary::after { transform: rotate(225deg) translateY(-2px); }
.cms-nav-heading:hover, .cms-nav-heading.current-group, .cms-nav-link:hover { background: #253755; color: white; }
.cms-nav-children {
    list-style: none;
    margin: .25rem .1rem .45rem;
    margin-inline-start: 1.2rem;
    padding: 0;
    padding-inline-start: .6rem;
    border-inline-start: 1px solid #435370;
}
.cms-nav-link {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: .4rem .6rem;
    color: #e7edf9;
    text-decoration: none;
    border-radius: .4rem;
    font-size: .875rem;
}
.cms-nav-link.active, .cms-nav-dashboard.active { color: white; background: #2d4d9b; font-weight: 650; }
.cms-topbar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; min-height: 60px; padding: .6rem clamp(.75rem, 3vw, 2rem); border-block-end: 1px solid var(--cms-line); background: white; }
.cms-topbar .dropdown-toggle { max-width: 36vw; overflow: hidden; text-overflow: ellipsis; }
.cms-workspace { padding: clamp(.85rem, 2.5vw, 2rem); }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: .9rem; flex-wrap: wrap; margin-block-end: 1.3rem; }
.page-header h1 { font-size: clamp(1.65rem, 3vw, 2.25rem); margin: 0; font-weight: 745; letter-spacing: -.035em; }
.page-header p { margin: .3rem 0 0; color: var(--cms-muted); }
.card { --bs-card-border-color: var(--cms-line); --bs-card-border-radius: .65rem; --bs-card-cap-bg: white; min-width: 0; }
.card-header { padding: .9rem 1rem; font-weight: 620; }
.stat-card:hover { border-color: #8098d7; }
.stat-label { font-size: .86rem; color: var(--cms-muted); font-weight: 625; }
.stat-number { color: var(--cms-ink); font-size: 2rem; font-weight: 740; }
.filter-grid { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; }
.filter-grid > div { flex: 1 1 130px; }
.filter-grid > div:first-child { flex: 2 1 210px; }
.filter-grid > div:last-child { flex: 0 0 auto; }
.bulk-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: #f7f9fd; padding: .75rem 1rem; border-block: 1px solid var(--cms-line); font-size: .85rem; }
.table-responsive { position: relative; }
.cms-table th { white-space: nowrap; color: #4b5c76; background: #f9fafc; font-size: .78rem; }
.table-responsive { position: relative; }
.cms-table td, .cms-table th { padding: .75rem .9rem; }
.cms-table td { overflow-wrap: anywhere; }
.state { background: #edf0f5; color: #3a485c; padding: .23rem .52rem; border-radius: .3rem; font-size: .78rem; font-weight: 630; white-space: nowrap; }
.state-active, .state-published, .state-confirmed, .state-sent { background: #e0f4e9; color: #165838; }
.state-draft, .state-pending, .state-unread { background: #fff2d6; color: #60400b; }
.state-failed { background: #fce5e8; color: #792234; }
.empty-state { text-align: center; padding: 2.5rem 1rem; }
.translation-panel { border: 1px solid var(--cms-line); border-radius: .45rem; margin-block-end: .65rem; }
.translation-panel:last-child { margin-block-end: 0; }
.translation-panel summary { padding: .7rem .85rem; cursor: pointer; }
.translation-fields { padding: .85rem; border-block-start: 1px solid var(--cms-line); }
.seo-fields { padding: .8rem; border: 1px solid var(--cms-line); border-radius: .4rem; }
.seo-fields legend { float: none; width: auto; padding-inline: .35rem; margin-bottom: 0; }
.media-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #e7ecf5; border-radius: .5rem; }
.picker-result { text-align: start; display: block; width: 100%; height: 100%; overflow-wrap: anywhere; }
.picker-result img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .35rem; margin-block-end: .4rem; }
.media-choice { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .5rem; border: 1px solid var(--cms-line); border-radius: .35rem; overflow-wrap: anywhere; }
.form-label { font-weight: 590; }
.auth-workspace { max-width: 480px; padding: clamp(1rem, 10vh, 6rem) 1rem 2rem; margin-inline: auto; }
.auth-card { box-shadow: 0 .7rem 2.4rem #16264c14; }
.cms-auth-brand { font-weight: 750; text-decoration: none; color: var(--cms-ink); }
.skip-link { position: fixed; inset-block-start: .4rem; inset-inline-start: .4rem; z-index: 1100; padding: .5rem; background: #fff; }
.inquiry-message { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 992px) {
    .cms-sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--cms-width); background-color: #14233e !important; }
    .cms-workspace, .cms-topbar { margin-inline-start: var(--cms-width); }
    .sidebar-hidden .cms-sidebar { visibility: hidden; }
    .sidebar-hidden .cms-workspace, .sidebar-hidden .cms-topbar { margin-inline-start: 0; }
}

.media-library-grid, .media-upload-grid { display: grid; gap: 1rem; }
.media-library-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.media-upload-grid { grid-template-columns: minmax(0, 1fr); align-items: end; }
.media-library-grid > *, .media-upload-grid > *, .picker-result { min-inline-size: 0; }
.media-library-grid .card { overflow-wrap: anywhere; }
.media-file-placeholder { display: grid; place-items: center; aspect-ratio: 16/10; border-radius: .5rem; padding: .75rem; background: #e7ecf5; color: #3c4f66; font-size: .86rem; }
.media-upload-note { grid-column: 1 / -1; }
@media (min-width: 780px) {
    .media-upload-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto auto; }
}

/* Website settings forms */
.smtp-panel { container-type: inline-size; }
.smtp-grid { display: grid; gap: 0 1rem; }
.smtp-grid > * { min-inline-size: 0; }
.smtp-full { grid-column: 1 / -1; }
@container (min-width: 24rem) {
    .smtp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.timezone-select { position: relative; }
.timezone-select [hidden] { display: none !important; }
.timezone-popup {
    position: absolute;
    inset-inline: .5rem;
    inset-block-start: calc(100% + .25rem);
    z-index: 20;
    padding: .5rem;
    border: 1px solid var(--cms-line);
    border-radius: .5rem;
    background: var(--bs-body-bg);
    box-shadow: 0 .6rem 1.8rem rgba(23, 42, 67, .14);
}
.timezone-select.timezone-opens-up .timezone-popup { inset-block-start: auto; inset-block-end: calc(100% - 1.5rem); }
.timezone-options { overflow-y: auto; overscroll-behavior: contain; }
.timezone-options [role="option"] { padding: .4rem .55rem; border-radius: .25rem; cursor: pointer; overflow-wrap: anywhere; }
.timezone-options [role="option"][aria-selected="true"] { font-weight: 600; }
.timezone-options [role="option"]:hover, .timezone-options .is-highlighted { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }

/* Media filters follow available workspace width, including beside the sidebar. */
.media-upload-summary { cursor: pointer; }
.media-filter-panel { container-type: inline-size; }
.media-filter-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; gap: .75rem; }
.media-filter-grid > * { min-inline-size: 0; }
.media-filter-grid .btn { justify-self: start; }
@container (min-width: 31rem) {
    .media-filter-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
}

/* Selected media and visual editing. */
.selected-media-preview {
    display: grid;
    place-items: center;
    flex: 0 0 5rem;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: .3rem;
    background: #edf1f7;
    text-align: center;
    color: var(--cms-muted);
    font-size: .7rem;
}
.selected-media-preview img { width: 100%; height: 100%; object-fit: cover; }
[data-media-slot="logo"] .selected-media-preview img { object-fit: contain; padding: .25rem; }
.selected-media-name { flex: 1 1 0; min-inline-size: 0; font-size: .85rem; color: var(--cms-muted); }
.visual-editor { min-block-size: 11rem; overflow-wrap: anywhere; white-space: normal; }
.visual-editor table { width: auto; max-inline-size: 100%; }
.visual-editor :is(td, th) { border: 1px solid var(--cms-line); padding: .25rem; }
.section-position { color: var(--cms-muted); font-variant-numeric: tabular-nums; }
.section-heading-preview { display: block; overflow-wrap: anywhere; font-weight: 600; }
