:root {
    --cp-bg: #f4f6f8;
    --cp-surface: #ffffff;
    --cp-border: #d9e0e7;
    --cp-text: #18212f;
    --cp-muted: #697586;
    --cp-accent: #0f766e;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--cp-bg);
    color: var(--cp-text);
    min-height: 100vh;
}

.save-notice {
    align-items: center;
    align-self: flex-start;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    color: #065f46;
    display: inline-flex;
    font-size: 0.88rem;
    font-weight: 750;
    gap: 0.4rem;
    line-height: 1;
    padding: 0.42rem 0.7rem;
    width: max-content;
}

.auth-shell {
    align-items: center;
    display: flex;
    min-height: 100vh;
    padding: 1rem;
}

.auth-panel {
    margin: 0 auto;
    max-width: 460px;
    width: 100%;
}

.auth-panel h1 {
    font-size: 1.35rem;
    line-height: 1.2;
    margin: 0 0 1rem;
}

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

.sidebar {
    background: #ffffff;
    border-right: 1px solid var(--cp-border);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
}

.brand {
    align-items: center;
    display: flex;
    font-weight: 800;
    gap: 0.75rem;
    min-height: 44px;
}

.brand-mark {
    align-items: center;
    color: var(--cp-accent);
    display: inline-flex;
    flex: 0 0 auto;
    height: 38px;
    justify-content: center;
    width: 52px;
}

.brand-glyph {
    display: block;
    height: 38px;
    overflow: visible;
    width: 52px;
}

.brand-glyph-cloud {
    fill: currentColor;
}

.brand-glyph-lines {
    fill: none;
    stroke: #ffffff;
    stroke-linecap: round;
    stroke-width: 4;
}

.brand-glyph-rain {
    fill: none;
    stroke: #38bdf8;
    stroke-linecap: round;
    stroke-width: 4;
}

.brand-glyph-spark {
    fill: none;
    stroke: #f59e0b;
    stroke-linecap: round;
    stroke-width: 3.4;
}

.nav-link {
    color: var(--cp-muted);
    min-height: 40px;
}

.nav-link.active {
    background: var(--cp-accent) !important;
}

.main {
    min-width: 0;
    padding: 1.5rem;
}

.topbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.topbar h1 {
    font-size: 1.5rem;
    line-height: 1.2;
    margin: 0;
}

.topbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.site-switcher {
    min-width: min(280px, 100%);
}

.panel {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    padding: 1rem;
}

.panel h2 {
    font-size: 1.05rem;
    line-height: 1.3;
    margin: 0 0 1rem;
}

.compact-panel {
    max-width: 720px;
}

.metrics {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.metric {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.35rem;
    min-height: 120px;
    padding: 1rem;
}

.metric i {
    color: var(--cp-accent);
    font-size: 1.2rem;
}

.metric span {
    color: var(--cp-muted);
    font-size: 0.85rem;
}

.metric strong {
    font-size: 1.25rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.split-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.forms-layout {
    display: grid;
    gap: 1rem;
}

.forms-layout .panel {
    min-width: 0;
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.health-list {
    display: grid;
    gap: 0.65rem;
}

.health-line {
    align-items: center;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: auto minmax(0, 150px) minmax(0, 1fr);
    min-height: 48px;
    padding: 0.6rem 0.75rem;
}

.health-line i {
    color: var(--cp-accent);
}

.health-line span {
    color: var(--cp-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.health-line strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.grid-form {
    display: grid;
    gap: 1rem;
}

.rte {
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    overflow: hidden;
}

.rte-toolbar {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid var(--cp-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem;
}

.rte-toolbar-group {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.rte-block-select {
    max-width: 160px;
}

.rte-toolbar .btn {
    align-items: center;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.rte-toolbar .btn.is-active {
    background: #ccfbf1;
    border-color: #5eead4;
    color: #0f766e;
}

.rte-table-tools {
    display: none;
}

.rte.is-table-active .rte-table-tools {
    display: inline-flex;
}

.rte-editor,
.rte .ProseMirror {
    background: #ffffff;
    min-height: 280px;
}

.rte .ProseMirror {
    cursor: text;
    min-height: 280px;
    outline: 0;
    padding: 1rem;
    pointer-events: auto;
    user-select: text;
}

.rte .ProseMirror > *:first-child {
    margin-top: 0;
}

.rte .ProseMirror > *:last-child {
    margin-bottom: 0;
}

.rte .ProseMirror img {
    cursor: pointer;
    height: auto;
    max-width: 100%;
}

.rte .ProseMirror nimbus-block {
    display: block;
    margin: 1rem 0;
}

.rte .ProseMirror td nimbus-block,
.rte .ProseMirror th nimbus-block {
    margin: 0.35rem 0;
}

.rte .ProseMirror table,
.nimbus-managed-grid-table {
    border-collapse: collapse;
    margin: 1rem 0;
    table-layout: fixed;
    width: 100%;
}

.rte .ProseMirror td,
.rte .ProseMirror th,
.nimbus-managed-grid-table td,
.nimbus-managed-grid-table th {
    border: 1px solid var(--cp-border);
    min-height: 72px;
    padding: 0.85rem;
    vertical-align: top;
}

.rte .ProseMirror td > *:first-child,
.rte .ProseMirror th > *:first-child {
    margin-top: 0;
}

.rte .ProseMirror td > *:last-child,
.rte .ProseMirror th > *:last-child {
    margin-bottom: 0;
}

.nimbus-managed-grid-table td:focus,
.nimbus-managed-grid-table th:focus {
    box-shadow: inset 0 0 0 2px var(--cp-accent);
    outline: 0;
}

.rte .selectedCell::after {
    background: rgb(15 118 110 / 12%);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.rte .ProseMirror td,
.rte .ProseMirror th {
    position: relative;
}

.rte .ProseMirror td .nimbus-block-embed,
.rte .ProseMirror th .nimbus-block-embed {
    border-radius: 6px;
    padding: 0.85rem;
}

.rte .ProseMirror td .nimbus-design-body,
.rte .ProseMirror th .nimbus-design-body {
    gap: 0.4rem;
    padding-right: 2rem;
}

.rte .ProseMirror td .nimbus-design-heading,
.rte .ProseMirror th .nimbus-design-heading {
    font-size: 1.05rem;
}

.rte .ProseMirror td .nimbus-design-summary,
.rte .ProseMirror th .nimbus-design-summary {
    font-size: 0.92rem;
}

.rte .ProseMirror td .nimbus-block-settings,
.rte .ProseMirror th .nimbus-block-settings {
    height: 30px;
    right: 0.5rem;
    top: 0.5rem;
    width: 30px;
}

.rte .ProseMirror td .nimbus-block-drag-handle,
.rte .ProseMirror th .nimbus-block-drag-handle {
    height: 30px;
    left: 0.5rem;
    top: 0.5rem;
    width: 30px;
}

.nimbus-block-embed {
    background: #f8fafc;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    color: var(--cp-text);
    display: grid;
    gap: 0.75rem;
    overflow: hidden;
    padding: 1rem;
    position: relative;
}

.nimbus-block-embed:hover {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 3px rgb(15 118 110 / 12%);
}

.ProseMirror-selectednode .nimbus-block-embed,
.nimbus-block-embed.is-selected {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 3px rgb(15 118 110 / 18%);
}

.nimbus-block-settings {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 6px;
    color: var(--cp-muted);
    display: inline-flex;
    height: 34px;
    justify-content: center;
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    width: 34px;
    z-index: 2;
}

.nimbus-block-settings:hover {
    border-color: var(--cp-accent);
    color: var(--cp-accent);
}

.nimbus-block-drag-handle {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 6px;
    color: var(--cp-muted);
    cursor: grab;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    left: 0.75rem;
    opacity: 0;
    position: absolute;
    top: 0.75rem;
    width: 34px;
    z-index: 2;
}

.nimbus-block-embed:hover .nimbus-block-drag-handle,
.nimbus-block-drag-handle:focus {
    opacity: 1;
}

.nimbus-design-block [data-block-editable] {
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 4px;
    color: inherit;
    display: block;
    font: inherit;
    outline: 0;
    padding: 0;
    width: 100%;
}

.nimbus-design-block textarea[data-block-editable] {
    line-height: inherit;
    min-height: 3.25rem;
    resize: vertical;
}

.nimbus-design-block [data-block-editable]:focus {
    box-shadow: 0 0 0 3px rgb(15 118 110 / 14%);
}

.nimbus-design-block [data-block-editable]:empty::before {
    color: currentColor;
    content: attr(data-placeholder);
    opacity: 0.5;
}

.nimbus-block-embed-icon {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 6px;
    color: var(--cp-accent);
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.nimbus-block-embed-copy {
    display: grid;
    line-height: 1.25;
    min-width: 0;
}

.nimbus-block-embed-label,
.nimbus-block-embed-copy small {
    color: var(--cp-muted);
    font-size: 0.82rem;
}

.nimbus-block-embed-copy strong,
.nimbus-block-embed-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nimbus-design-hero,
.nimbus-design-cta {
    background: #111827;
    color: #ffffff;
    padding: 1.35rem;
}

.nimbus-design-cta.has-image {
    padding: 0;
}

.nimbus-design-image {
    aspect-ratio: 16 / 9;
    display: block;
    object-fit: cover;
    width: 100%;
}

.nimbus-design-body {
    display: grid;
    gap: 0.55rem;
    padding-right: 2.5rem;
}

.nimbus-design-image + .nimbus-design-body {
    padding: 1.25rem 3.75rem 1.25rem 1.25rem;
}

.nimbus-design-eyebrow {
    color: #14b8a6;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
    text-transform: uppercase;
}

.nimbus-design-heading {
    color: inherit;
    font-size: 1.55rem;
    line-height: 1.15;
    margin: 0;
}

.nimbus-design-summary {
    color: inherit;
    margin: 0;
    opacity: 0.82;
}

.nimbus-design-button,
.nimbus-design-link {
    color: #0f766e;
    display: inline-flex !important;
    font-weight: 800;
    margin-top: 0.35rem;
    width: auto !important;
}

.nimbus-design-button {
    background: #14b8a6;
    border-radius: 6px;
    color: #052e2b;
    justify-self: start;
    padding: 0.55rem 0.85rem;
}

.nimbus-design-card,
.nimbus-design-media-text {
    background: #ffffff;
}

.nimbus-design-card {
    padding: 1.1rem 3.75rem 1.1rem 1.1rem;
}

.nimbus-design-quote {
    background: #ffffff;
    border-left: 4px solid var(--cp-accent);
    padding: 1.1rem 3.75rem 1.1rem 1.1rem;
}

.nimbus-design-quote-text {
    font-size: 1.25rem;
    line-height: 1.25;
    margin: 0;
}

.nimbus-design-attribution {
    color: var(--cp-muted);
}

.nimbus-design-media-text {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    padding: 0;
}

.nimbus-design-media-text.is-image-right .nimbus-design-media {
    order: 2;
}

.nimbus-design-media {
    align-items: center;
    background: #e5e7eb;
    display: flex;
    justify-content: center;
    min-height: 180px;
}

.nimbus-design-media img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.nimbus-design-media i {
    color: var(--cp-muted);
    font-size: 2rem;
}

.nimbus-design-media-text .nimbus-design-body {
    padding: 1.25rem 3.75rem 1.25rem 1.25rem;
}

.nimbus-design-divider {
    align-items: center;
    background: #ffffff;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.nimbus-design-divider hr {
    border: 0;
    border-top: 1px solid var(--cp-border);
    margin: 0;
}

.nimbus-design-divider-label {
    color: var(--cp-muted);
    font-size: 0.9rem;
    font-weight: 750;
}

.nimbus-design-form {
    background: #ffffff;
    padding: 1.1rem 3.75rem 1.1rem 1.1rem;
}

.nimbus-form-preview-fields {
    display: grid;
    gap: 0.45rem;
    margin: 0.35rem 0;
}

.nimbus-form-preview-field {
    background: #f8fafc;
    border: 1px solid var(--cp-border);
    border-radius: 6px;
    color: var(--cp-muted);
    min-height: 38px;
    padding: 0.45rem 0.6rem;
}

.block-editor {
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem;
}

.block-editor-heading {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
}

.block-editor h3,
.block-panel h4 {
    font-size: 0.95rem;
    line-height: 1.3;
    margin: 0;
}

.block-editor-heading span {
    color: var(--cp-muted);
    font-size: 0.85rem;
}

.block-panel {
    background: #f8fafc;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem;
}

.template-meta {
    align-items: end;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.template-default-check {
    margin-bottom: 0.45rem;
    white-space: nowrap;
}

.theme-template-picker {
    display: grid;
    gap: 0.5rem;
}

.theme-template-options {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.theme-template-option {
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    color: var(--cp-text);
    display: grid;
    gap: 0.5rem;
    min-height: 150px;
    padding: 0.75rem;
    text-align: left;
}

.theme-template-option:hover,
.theme-template-option:focus,
.theme-template-option.is-selected {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 3px rgb(15 118 110 / 14%);
    outline: 0;
}

.theme-template-option strong {
    font-size: 0.95rem;
}

.theme-template-option small {
    color: var(--cp-muted);
    line-height: 1.35;
}

.theme-template-preview {
    background:
        linear-gradient(#ffffff 0 0) 12px 14px / 48% 8px no-repeat,
        linear-gradient(#d8e0e7 0 0) 12px 30px / 72% 6px no-repeat,
        linear-gradient(#d8e0e7 0 0) 12px 43px / 55% 6px no-repeat,
        #f1f5f9;
    border: 1px solid var(--cp-border);
    border-radius: 6px;
    display: block;
    min-height: 92px;
    overflow: hidden;
}

.theme-template-preview.has-image {
    aspect-ratio: 16 / 9;
    background: #f8fafc;
    min-height: 0;
}

.theme-template-preview img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.theme-template-preview-landing,
.theme-template-preview-campaign {
    background:
        linear-gradient(#ffffff 0 0) 13px 14px / 62% 9px no-repeat,
        linear-gradient(#99f6e4 0 0) 13px 34px / 34% 10px no-repeat,
        linear-gradient(135deg, #111827, #0f766e);
}

.theme-template-preview-service {
    background:
        linear-gradient(#111827 0 0) 12px 12px / 45% 8px no-repeat,
        linear-gradient(#d8e0e7 0 0) 12px 30px / 76% 6px no-repeat,
        linear-gradient(#ffffff 0 0) 12px 48px / 28% 20px no-repeat,
        linear-gradient(#ffffff 0 0) 46% 48px / 28% 20px no-repeat,
        linear-gradient(#ffffff 0 0) 80% 48px / 16% 20px no-repeat,
        #eef7f5;
}

.theme-template-preview-contact {
    background:
        linear-gradient(#111827 0 0) 12px 12px / 36% 8px no-repeat,
        linear-gradient(#ffffff 0 0) 12px 32px / 42% 30px no-repeat,
        linear-gradient(#ffffff 0 0) 58% 32px / 32% 30px no-repeat,
        #f1f5f9;
}

.theme-template-preview-article,
.theme-template-preview-narrow {
    background:
        linear-gradient(#111827 0 0) 22px 12px / 48% 8px no-repeat,
        linear-gradient(#d8e0e7 0 0) 22px 30px / 68% 5px no-repeat,
        linear-gradient(#d8e0e7 0 0) 22px 42px / 62% 5px no-repeat,
        linear-gradient(#d8e0e7 0 0) 22px 54px / 66% 5px no-repeat,
        #ffffff;
}

.theme-designs-panel {
    margin-bottom: 1rem;
}

.theme-design-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.theme-design-card {
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.65rem;
    padding: 0.75rem;
}

.theme-design-card .theme-template-preview {
    border-radius: 8px;
    min-height: 150px;
}

.theme-design-card .theme-template-preview.has-image {
    min-height: 0;
}

.theme-design-card strong {
    font-size: 1rem;
}

.theme-design-card small {
    color: var(--cp-muted);
    line-height: 1.35;
}

.advanced-panel {
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
}

.advanced-panel summary {
    align-items: center;
    color: var(--cp-muted);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.88rem;
    font-weight: 700;
    gap: 0.4rem;
}

.block-field {
    display: grid;
    gap: 0.35rem;
}

.block-field-wide {
    grid-column: 1 / -1;
}

.form-text {
    color: var(--cp-muted);
    font-size: 0.85rem;
    margin: 0;
}

.seo-assist {
    background: #f8fafc;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.seo-preview {
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem;
}

.seo-preview span {
    color: var(--cp-muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.seo-preview strong {
    color: #1d4ed8;
    font-size: 1rem;
}

.seo-preview p {
    color: #475569;
    margin: 0;
}

.media-field {
    display: grid;
    gap: 0.45rem;
}

.media-field-control {
    align-items: stretch;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
    padding: 0.75rem;
}

.media-field-preview {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e6edf4;
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
    min-height: 112px;
    min-width: 0;
    padding: 0.65rem;
}

.media-field-preview img,
.media-field-preview .file-icon {
    aspect-ratio: 16 / 9;
    background: #eef2f6;
    border-radius: 6px;
    color: #64748b;
    display: flex;
    flex: 0 0 128px;
    height: auto;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    width: 128px;
}

.media-field-preview span:last-child {
    color: var(--cp-muted);
    font-size: 0.9rem;
    line-height: 1.25;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.media-field .media-field-actions {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-field .media-field-actions .btn {
    justify-content: center;
    min-height: 40px;
    white-space: nowrap;
    width: 100%;
}

.menu-items,
.template-slot-list,
.form-field-list {
    display: grid;
    gap: 0.9rem;
}

.menu-item-row,
.form-field-row {
    align-items: end;
    display: grid;
    gap: 0.75rem;
}

.menu-item-row {
    grid-template-columns: auto minmax(0, 220px) minmax(0, 1fr) minmax(130px, 160px) auto;
}

.form-field-row {
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    box-shadow: 0 1px 0 rgb(15 23 42 / 3%);
    gap: 0.85rem;
    grid-template-columns: 1fr;
    padding: 0.9rem;
}

.form-field-row-header {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.form-field-summary {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.form-field-summary strong {
    font-size: 0.98rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.form-field-summary small {
    color: var(--cp-muted);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.form-field-primary,
.form-field-settings {
    display: grid;
    gap: 0.75rem;
}

.form-field-primary {
    grid-template-columns: minmax(240px, 1.35fr) minmax(180px, 0.65fr);
}

.form-field-settings {
    grid-template-columns: minmax(160px, 0.65fr) minmax(160px, 0.65fr) minmax(280px, 1.7fr);
}

.form-field-row .form-label {
    display: grid;
    gap: 0.35rem;
    line-height: 1.2;
    margin: 0;
    min-width: 0;
}

.form-field-row .form-label span {
    color: #334155;
    font-size: 0.82rem;
    font-weight: 800;
}

.form-field-row .form-control,
.form-field-row .form-select {
    min-height: 44px;
}

.form-field-wide,
.form-field-options {
    grid-column: 1 / -1;
}

.form-field-row .form-field-options {
    display: none;
}

.form-field-row.is-select-field .form-field-options {
    display: grid;
}

.form-field-drag,
.form-field-remove {
    align-self: center;
    min-height: 44px;
    min-width: 44px;
}

.menu-item-row.is-dragging,
.form-field-row.is-dragging {
    opacity: 0.55;
}

.menu-item-row.is-drop-target,
.form-field-row.is-drop-target {
    outline: 2px solid var(--cp-accent);
    outline-offset: 2px;
}

.submission-list {
    display: grid;
    gap: 0.75rem;
}

.submission-item {
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.35rem;
    padding: 0.75rem;
}

.submission-item small {
    color: var(--cp-muted);
}

.submission-item dl {
    display: grid;
    gap: 0.35rem 0.75rem;
    grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
    margin: 0.5rem 0 0;
}

.submission-item dt {
    color: var(--cp-muted);
    font-weight: 750;
}

.submission-item dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.backup-item {
    align-items: center;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.backup-item > span {
    display: grid;
    min-width: 0;
}

.backup-item small,
.audit-table small,
.global-stats-table small {
    color: var(--cp-muted);
    display: block;
    overflow-wrap: anywhere;
}

.restore-form {
    align-items: center;
    display: flex;
    gap: 0.4rem;
}

.restore-form .form-control {
    max-width: 110px;
}

.audit-table td {
    vertical-align: top;
}

.compact-list {
    gap: 0.45rem;
}

.compact-item {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.template-slot-row {
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.6rem;
    padding: 0.75rem;
}

.template-slot-row.is-dragging {
    opacity: 0.55;
}

.template-slot-row.is-drop-target {
    outline: 2px solid var(--cp-accent);
    outline-offset: 2px;
}

.template-slot-header {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr) minmax(160px, 220px) auto;
}

.template-slot-summary {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.template-slot-summary strong {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.template-slot-summary small {
    color: var(--cp-muted);
}

.template-source-select {
    min-width: 0;
}

.template-slot-fields {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
}

.template-slot-fields label {
    display: grid;
    gap: 0.35rem;
}

.template-custom-blocks {
    background: #f8fafc;
}

.template-blocks-panel {
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    padding: 0.65rem;
}

.template-blocks-panel > summary {
    align-items: center;
    color: var(--cp-text);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 750;
    gap: 0.4rem;
}

.template-blocks-panel[open] > summary {
    margin-bottom: 0.65rem;
}

.drag-handle {
    align-self: end;
    cursor: grab;
    min-width: 42px;
}

.form-field-drag {
    align-self: center;
}

.drag-handle:active {
    cursor: grabbing;
}

.editor-dialog {
    align-items: center;
    background: rgb(15 23 42 / 45%);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 1050;
}

.editor-dialog-panel {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgb(15 23 42 / 24%);
    max-height: min(760px, calc(100vh - 2rem));
    max-width: 920px;
    overflow: auto;
    width: 100%;
}

.editor-dialog-header {
    align-items: center;
    border-bottom: 1px solid var(--cp-border);
    display: flex;
    justify-content: space-between;
    padding: 1rem;
}

.editor-dialog-header h2 {
    font-size: 1rem;
    margin: 0;
}

.editor-dialog-body {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.picker-list {
    display: grid;
    gap: 0.5rem;
}

.picker-row {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    min-height: 56px;
    padding: 0.75rem;
    text-align: left;
}

.nimbus-insert-menu {
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgb(15 23 42 / 18%);
    display: grid;
    gap: 0.25rem;
    min-width: 240px;
    padding: 0.45rem;
    position: absolute;
    z-index: 1060;
}

.nimbus-insert-menu-title {
    color: var(--cp-muted);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.35rem 0.5rem;
    text-transform: uppercase;
}

.nimbus-insert-menu-group {
    align-items: center;
    color: var(--cp-muted);
    display: flex;
    font-size: 0.82rem;
    font-weight: 800;
    gap: 0.45rem;
    padding: 0.65rem 0.55rem 0.1rem;
}

.nimbus-insert-menu-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--cp-text);
    display: flex;
    font-weight: 750;
    gap: 0.6rem;
    padding: 0.6rem 0.65rem;
    text-align: left;
}

.nimbus-insert-menu-item:hover,
.nimbus-insert-menu-item:focus {
    background: #ecfdf5;
    outline: none;
}

.nimbus-insert-menu-item i {
    color: var(--cp-accent);
    font-size: 1.05rem;
}

.picker-row span {
    display: grid;
    min-width: 0;
}

.picker-row small {
    color: var(--cp-muted);
    overflow-wrap: anywhere;
}

.editor-upload {
    align-items: end;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 180px) minmax(0, 180px) auto;
}

.image-size-controls {
    background: #f8fafc;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem;
}

.image-size-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-size-grid label {
    display: grid;
    gap: 0.3rem;
}

.image-size-grid span,
.image-size-actions {
    color: var(--cp-muted);
    font-size: 0.85rem;
}

.image-size-range {
    grid-column: 1 / -1;
}

.image-size-actions,
.media-picker-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.media-picker-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.media-picker-item {
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.5rem;
    padding: 0.5rem;
    text-align: left;
}

@media (max-width: 900px) {
    .menu-item-row,
    .media-field-control,
    .template-meta,
    .template-slot-header,
    .template-slot-fields {
        grid-template-columns: 1fr;
    }

    .form-field-primary,
    .form-field-settings {
        grid-template-columns: 1fr;
    }

    .template-default-check {
        white-space: normal;
    }
}

@media (max-width: 560px) {
    .form-field-row-header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .form-field-remove {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

.media-picker-item.is-selected {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 3px rgb(15 118 110 / 16%);
}

.media-picker-item img,
.media-picker-item .file-icon {
    aspect-ratio: 4 / 3;
    background: #eef2f6;
    border-radius: 6px;
    object-fit: cover;
    width: 100%;
}

.media-picker-item span:last-child {
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.item-list {
    display: grid;
    gap: 0.75rem;
}

.item {
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    padding: 0.85rem;
}

.create-item {
    background: #f8fafc;
}

.create-item summary strong {
    align-items: center;
    display: inline-flex;
    gap: 0.4rem;
}

.item summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.item summary span:first-child {
    display: grid;
    min-width: 0;
}

.item summary small {
    color: var(--cp-muted);
    overflow-wrap: anywhere;
}

.site-item {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.site-item > div:first-child {
    display: grid;
    min-width: 0;
}

.site-item small {
    color: var(--cp-muted);
    overflow-wrap: anywhere;
}

.media-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.media-item {
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem;
}

.media-item img,
.file-icon {
    aspect-ratio: 4 / 3;
    background: #eef2f6;
    border-radius: 6px;
    object-fit: cover;
    width: 100%;
}

.file-icon {
    align-items: center;
    color: var(--cp-muted);
    display: flex;
    font-size: 2rem;
    justify-content: center;
}

.empty {
    color: var(--cp-muted);
    margin: 0;
}

.publish-state {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.compact-metrics {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-bottom: 1rem;
}

.seo-issue {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.seo-issue > div {
    display: grid;
    min-width: 0;
}

.seo-issue-actions {
    align-items: center;
    display: flex !important;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.not-found-list {
    display: grid;
    gap: 0.75rem;
}

.plugins-layout {
    display: grid;
    gap: 1rem;
}

.plugins-toolbar {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 420px);
}

.plugins-toolbar h2 {
    margin-bottom: 0.2rem;
}

.plugins-upload-panel {
    justify-self: end;
    min-width: 0;
    width: min(100%, 420px);
}

.plugins-upload-panel > summary {
    align-items: center;
    border: 1px solid #0d6efd;
    border-radius: 8px;
    color: #0d6efd;
    cursor: pointer;
    display: inline-flex;
    font-weight: 750;
    gap: 0.45rem;
    justify-content: center;
    list-style: none;
    padding: 0.5rem 0.8rem;
    width: 100%;
}

.plugins-upload-panel > summary::-webkit-details-marker {
    display: none;
}

.plugins-upload-panel[open] > summary {
    background: #eff6ff;
}

.plugins-upload-panel form {
    background: #f8fafc;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    margin-top: 0.75rem;
    padding: 0.85rem;
}

.plugin-list {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.not-found-row {
    align-items: center;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.75rem;
}

.not-found-row div {
    display: grid;
    min-width: 0;
}

.not-found-row small {
    color: var(--cp-muted);
}

.plugin-card {
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    align-content: start;
    display: grid;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.9rem;
}

.plugin-card-header {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.plugin-card-badges {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.plugin-card-header > div {
    display: grid;
    min-width: 0;
}

.plugin-card-header small {
    color: var(--cp-muted);
    overflow-wrap: anywhere;
}

.plugin-card-footer {
    align-items: center;
    border-top: 1px solid #edf1f5;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-top: 0.2rem;
    padding-top: 0.75rem;
}

.plugin-details {
    min-width: 0;
}

.plugin-details > summary {
    color: var(--cp-muted);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 750;
    list-style: none;
}

.plugin-details > summary::-webkit-details-marker {
    display: none;
}

.plugin-details > summary::after {
    content: " +";
}

.plugin-details[open] > summary::after {
    content: " -";
}

.plugin-details .plugin-meta {
    background: #f8fafc;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    margin-top: 0.6rem;
    max-height: 220px;
    overflow: auto;
    padding: 0.75rem;
}

.plugin-meta {
    display: grid;
    gap: 0.55rem;
}

.plugin-meta > div {
    display: grid;
    gap: 0.25rem;
}

.plugin-meta span {
    color: var(--cp-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.plugin-meta p {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
}

.plugin-meta code {
    background: #f1f5f9;
    border: 1px solid var(--cp-border);
    border-radius: 999px;
    color: var(--cp-text);
    font-size: 0.78rem;
    padding: 0.18rem 0.45rem;
}

.theme-manager-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
}

.themes-panel-header {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    margin-bottom: 0.85rem;
}

.themes-heading-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.themes-heading-row h2 {
    margin: 0;
}

.theme-preview-page-control {
    display: grid;
    gap: 0.3rem;
    min-width: min(100%, 280px);
}

.theme-preview-page-control .form-label {
    color: var(--cp-muted);
    font-size: 0.78rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
}

.theme-manager-card {
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
}

.theme-manager-card.is-active {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 3px rgb(15 118 110 / 12%);
}

.theme-manager-preview {
    background: #f8fafc;
    border-right: 1px solid var(--cp-border);
    display: grid;
    gap: 0.55rem;
    grid-template-columns: 1fr 0.65fr;
    min-height: 100%;
    padding: 0.55rem;
}

.theme-manager-preview.has-image {
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0.55rem;
}

.theme-manager-preview img {
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    display: block;
    height: auto;
    min-height: 0;
    object-fit: contain;
    width: 100%;
}

.theme-manager-preview span {
    border-radius: 8px;
    min-height: 44px;
}

.theme-manager-preview span:first-child {
    grid-row: span 2;
}

.theme-preview-nimbus-editorial {
    background: #f7f7f4;
}

.theme-preview-nimbus-editorial span:nth-child(1) {
    background: #101216;
}

.theme-preview-nimbus-editorial span:nth-child(2) {
    background: #b42334;
}

.theme-preview-nimbus-editorial span:nth-child(3) {
    background: #08746d;
}

.theme-preview-nimbus-product {
    background: #eef6ff;
}

.theme-preview-nimbus-product span:nth-child(1) {
    background: #101828;
}

.theme-preview-nimbus-product span:nth-child(2) {
    background: #0f6bff;
}

.theme-preview-nimbus-product span:nth-child(3) {
    background: #12a37f;
}

.theme-preview-nimbus-portfolio {
    background: #0b0f14;
}

.theme-preview-nimbus-portfolio span:nth-child(1) {
    background: #7cf7c5;
}

.theme-preview-nimbus-portfolio span:nth-child(2) {
    background: #17202c;
}

.theme-preview-nimbus-portfolio span:nth-child(3) {
    background: #ff4f8b;
}

.theme-preview-nimbus-local {
    background: #f0f7ff;
}

.theme-preview-nimbus-local span:nth-child(1) {
    background: #2563eb;
}

.theme-preview-nimbus-local span:nth-child(2) {
    background: #138a56;
}

.theme-preview-nimbus-local span:nth-child(3) {
    background: #f4b400;
}

.theme-preview-nimbus-civic {
    background: #eaf3fb;
}

.theme-preview-nimbus-civic span:nth-child(1) {
    background: #005ea8;
}

.theme-preview-nimbus-civic span:nth-child(2) {
    background: #168365;
}

.theme-preview-nimbus-civic span:nth-child(3) {
    background: #f59e0b;
}

.theme-manager-body {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
    padding: 0.7rem 0.8rem;
}

.theme-manager-title {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.theme-manager-title strong,
.theme-manager-title small {
    display: block;
}

.theme-manager-title strong {
    font-size: 1rem;
    line-height: 1.2;
}

.theme-manager-title small {
    color: var(--cp-muted);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.theme-manager-description {
    color: var(--cp-muted);
    display: -webkit-box;
    font-size: 0.9rem;
    line-height: 1.35;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.theme-template-token-list {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.theme-template-token-list > summary {
    color: var(--cp-muted);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    list-style: none;
    text-transform: uppercase;
}

.theme-template-token-list > summary::-webkit-details-marker {
    display: none;
}

.theme-template-token-list > summary::after {
    content: " +";
}

.theme-template-token-list[open] > summary::after {
    content: " -";
}

.theme-template-token-list p {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
}

.theme-template-token-list code {
    background: #f1f5f9;
    border: 1px solid var(--cp-border);
    border-radius: 999px;
    color: var(--cp-text);
    font-size: 0.78rem;
    padding: 0.18rem 0.45rem;
}

.theme-card-actions {
    align-items: center;
    justify-content: flex-start;
}

.theme-card-actions form {
    margin: 0;
}

body.theme-preview-open {
    overflow: hidden;
}

.theme-live-preview {
    align-items: center;
    background: rgb(15 23 42 / 58%);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1.25rem;
    position: fixed;
    z-index: 1000;
}

.theme-live-preview[hidden] {
    display: none;
}

.theme-live-preview-dialog {
    background: #ffffff;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    box-shadow: 0 24px 80px rgb(15 23 42 / 28%);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: min(92vh, 900px);
    overflow: hidden;
    width: min(96vw, 1440px);
}

.theme-live-preview-header {
    align-items: center;
    border-bottom: 1px solid var(--cp-border);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.85rem 1rem;
}

.theme-live-preview-header p {
    color: var(--cp-muted);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0;
    margin: 0 0 0.15rem;
    text-transform: uppercase;
}

.theme-live-preview-header h2 {
    font-size: 1.05rem;
    margin: 0;
}

.theme-live-preview-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.theme-preview-device-controls {
    background: #f1f5f9;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: inline-flex;
    gap: 0.15rem;
    padding: 0.2rem;
}

.theme-preview-device-controls button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--cp-muted);
    font-weight: 750;
    line-height: 1;
    padding: 0.45rem 0.6rem;
}

.theme-preview-device-controls button.is-active {
    background: #ffffff;
    box-shadow: 0 1px 3px rgb(15 23 42 / 12%);
    color: var(--cp-text);
}

.theme-live-preview-close {
    aspect-ratio: 1;
    padding-left: 0;
    padding-right: 0;
    width: 2.35rem;
}

.theme-live-preview-frame-shell {
    background: #dfe6ee;
    display: flex;
    min-height: 0;
    overflow: auto;
    padding: 1rem;
}

.theme-live-preview-frame-shell iframe {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgb(15 23 42 / 18%);
    display: block;
    height: 100%;
    margin: 0 auto;
    min-height: 640px;
    transition: width 0.18s ease;
    width: 100%;
}

.theme-live-preview[data-theme-preview-size="tablet"] iframe {
    width: min(768px, 100%);
}

.theme-live-preview[data-theme-preview-size="mobile"] iframe {
    width: min(390px, 100%);
}

.stats-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
}

.stats-main-panel {
    grid-row: span 3;
}

.stats-chart {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
}

.stats-bar-row {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 86px minmax(0, 1fr) 72px;
}

.stats-bar-row > span {
    color: var(--cp-muted);
    font-size: 0.8rem;
}

.stats-bar-row > strong {
    font-size: 0.85rem;
    text-align: right;
}

.stats-bar-track {
    background: #edf2f7;
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.stats-bar {
    display: flex;
    height: 100%;
    min-width: 2px;
}

.stats-bar i,
.stats-legend i {
    display: block;
}

.stats-human {
    background: #0f766e;
}

.stats-bot {
    background: #64748b;
}

.stats-unknown {
    background: #d97706;
}

.stats-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.stats-legend span {
    align-items: center;
    color: var(--cp-muted);
    display: inline-flex;
    font-size: 0.85rem;
    gap: 0.35rem;
}

.stats-legend i {
    border-radius: 999px;
    height: 0.65rem;
    width: 0.65rem;
}

.stats-table code {
    white-space: normal;
}

.stats-kpi-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stats-kpi-grid article {
    background: #f8fafc;
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    display: grid;
    gap: 0.2rem;
    padding: 0.75rem;
}

.stats-kpi-grid span,
.stats-two-column h3,
.stats-three-column h3 {
    color: var(--cp-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.stats-kpi-grid strong {
    font-size: 1.1rem;
}

.stats-two-column,
.stats-three-column {
    display: grid;
    gap: 1rem;
}

.stats-two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-three-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-two-column h3,
.stats-three-column h3 {
    margin: 0 0 0.55rem;
}

.stats-dimension {
    min-width: 0;
}

.stats-bot-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.stats-bot-row > div {
    display: grid;
    min-width: 0;
}

.stats-bot-row small {
    color: var(--cp-muted);
}

.global-stats-layout {
    display: grid;
    gap: 1rem;
}

.global-stats-table td {
    vertical-align: middle;
}

.global-stats-table td,
.global-stats-table th {
    min-width: 110px;
}

.global-stats-table td:first-child {
    min-width: 240px;
}

.global-stats-table td > strong,
.global-stats-table td > small,
.global-stats-table td:first-child {
    display: grid;
}

.global-stats-table small {
    color: var(--cp-muted);
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-bottom: 1px solid var(--cp-border);
        border-right: 0;
    }

    .sidebar .nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .metrics,
    .split-layout,
    .dashboard-grid,
    .stats-layout,
    .stats-two-column,
    .stats-three-column,
    .editor-upload,
    .image-size-grid,
    .plugins-toolbar,
    .themes-panel-header {
        grid-template-columns: 1fr;
    }

    .theme-preview-page-control {
        min-width: 0;
        width: 100%;
    }

    .plugins-upload-panel {
        justify-self: stretch;
        width: 100%;
    }

    .plugin-card-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-live-preview {
        align-items: stretch;
        padding: 0.75rem;
    }

    .theme-live-preview-dialog {
        height: calc(100vh - 1.5rem);
        width: 100%;
    }

    .theme-live-preview-header {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-live-preview-actions,
    .theme-live-preview-actions .btn,
    .theme-live-preview-actions form {
        width: 100%;
    }

    .theme-preview-device-controls {
        width: 100%;
    }

    .theme-preview-device-controls button {
        flex: 1;
    }
}

@media (max-width: 560px) {
    .main {
        padding: 1rem;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions,
    .site-switcher {
        width: 100%;
    }

    .site-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .sidebar .nav {
        grid-template-columns: 1fr;
    }

    .actions-row,
    .actions-row .btn,
    .topbar .btn {
        width: 100%;
    }

    .theme-manager-grid {
        grid-template-columns: 1fr;
    }

    .theme-manager-card {
        grid-template-columns: 1fr;
    }

    .theme-manager-preview {
        border-bottom: 1px solid var(--cp-border);
        border-right: 0;
        min-height: 0;
    }

    .theme-manager-preview img {
        aspect-ratio: 16 / 9;
        height: auto;
        min-height: 0;
    }

    .theme-card-actions {
        align-items: stretch;
    }

    .backup-item,
    .health-line {
        grid-template-columns: 1fr;
    }

    .restore-form {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .restore-form .form-control {
        max-width: none;
    }
}

/* Admin polish layer: denser screens, stronger states, and calmer responsive behavior. */
:root {
    --cp-bg: #f3f6f9;
    --cp-surface: #ffffff;
    --cp-border: #d3dce6;
    --cp-border-strong: #b7c3d0;
    --cp-text: #172033;
    --cp-muted: #627084;
    --cp-accent: #0f766e;
    --cp-accent-soft: #e6f7f3;
    --cp-blue: #0d6efd;
    --cp-danger: #e11d48;
    --cp-shadow: 0 10px 28px rgb(15 23 42 / 6%);
    --cp-shadow-soft: 0 1px 2px rgb(15 23 42 / 5%);
}

html {
    background: var(--cp-bg);
}

body {
    font-feature-settings: "kern";
    text-rendering: optimizeLegibility;
}

a {
    text-underline-offset: 0.18em;
}

.btn {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-weight: 750;
    gap: 0.45rem;
    justify-content: center;
    min-height: 40px;
}

.btn-sm {
    min-height: 34px;
}

.form-control,
.form-select {
    border-color: var(--cp-border);
    border-radius: 8px;
    min-height: 42px;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--cp-border-strong);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 0.2rem rgb(15 118 110 / 14%);
}

:where(.btn, .nav-link, .nimbus-insert-menu-item, .theme-template-option, summary, button, [tabindex]):focus-visible {
    box-shadow: 0 0 0 0.22rem rgb(15 118 110 / 18%) !important;
    outline: 0;
}

.app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
    box-shadow: 1px 0 0 rgb(15 23 42 / 2%);
    gap: 1rem;
    height: 100vh;
    overflow: auto;
    position: sticky;
    top: 0;
}

.sidebar .brand {
    border-bottom: 1px solid #eef2f6;
    margin-bottom: 0.25rem;
    padding-bottom: 0.9rem;
}

.brand span {
    letter-spacing: 0;
}

.sidebar .nav-link {
    border-radius: 8px;
    color: #5c6a7d;
    font-weight: 725;
    padding: 0.55rem 0.65rem;
}

.sidebar .nav-link i {
    color: #748197;
}

.sidebar .nav-link:not(.active):hover {
    background: #eef3f7;
    color: var(--cp-text);
}

.sidebar .nav-link.active {
    box-shadow: 0 8px 18px rgb(15 118 110 / 20%);
}

.sidebar .nav-link.active i {
    color: #ffffff;
}

.sidebar .nav-link.disabled {
    opacity: 0.42;
}

.main {
    padding: clamp(1rem, 2vw, 1.65rem);
}

.topbar {
    background: linear-gradient(180deg, var(--cp-bg) 70%, rgb(243 246 249 / 0));
    margin: -0.2rem 0 1.1rem;
    padding: 0.2rem 0 0.45rem;
}

.topbar h1 {
    font-size: clamp(1.35rem, 1.2rem + 0.4vw, 1.75rem);
}

.topbar .text-secondary {
    color: var(--cp-muted) !important;
}

.site-switcher .form-select {
    background-color: #ffffff;
    font-weight: 700;
}

.panel {
    box-shadow: var(--cp-shadow-soft);
    padding: clamp(0.9rem, 1.2vw, 1.2rem);
}

.panel + .panel,
.split-layout + .panel,
.dashboard-grid + .panel,
.forms-layout + .panel {
    margin-top: 1rem;
}

.panel h2 {
    color: var(--cp-text);
    font-size: 1.08rem;
    font-weight: 800;
}

.metrics {
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.metric {
    box-shadow: var(--cp-shadow-soft);
    min-height: 96px;
    padding: 0.85rem;
}

.metric strong {
    font-size: 1.18rem;
}

.dashboard-grid,
.split-layout,
.stats-layout {
    gap: 0.9rem;
}

.item,
.plugin-card,
.theme-manager-card,
.media-item,
.form-field-row,
.template-slot-row,
.submission-item,
.not-found-row,
.health-line,
.backup-item {
    background: #ffffff;
    box-shadow: var(--cp-shadow-soft);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.item:hover,
.plugin-card:hover,
.theme-manager-card:hover,
.media-item:hover,
.form-field-row:hover,
.template-slot-row:hover,
.submission-item:hover,
.not-found-row:hover,
.health-line:hover,
.backup-item:hover {
    border-color: var(--cp-border-strong);
    box-shadow: var(--cp-shadow);
}

.empty {
    align-items: center;
    background: #f8fafc;
    border: 1px dashed #c3cedb;
    border-radius: 8px;
    color: var(--cp-muted);
    display: flex;
    font-weight: 650;
    min-height: 56px;
    padding: 0.8rem 0.9rem;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom-color: var(--cp-border);
    color: var(--cp-muted);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.table td {
    color: var(--cp-text);
}

.table-responsive {
    border: 1px solid var(--cp-border);
    border-radius: 8px;
}

.table-responsive .table > :not(caption) > * > * {
    padding: 0.7rem 0.85rem;
}

.media-field-control {
    align-items: stretch;
    grid-template-columns: 1fr;
}

.media-field-preview {
    min-height: 82px;
}

.media-field-preview img,
.media-field-preview .file-icon {
    flex-basis: 92px;
    width: 92px;
}

.media-field-preview span:last-child {
    flex: 1 1 auto;
}

.media-field .media-field-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-form > .btn.align-self-start {
    justify-self: start;
}

.media-grid {
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.media-item {
    gap: 0.55rem;
}

.media-item img,
.file-icon {
    border: 1px solid #e3e9ef;
}

.plugins-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
}

.plugins-upload-panel {
    width: min(100%, 340px);
}

.plugin-list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.plugin-card {
    gap: 0.55rem;
    padding: 0.8rem;
}

.plugin-card > p {
    color: var(--cp-muted);
    display: -webkit-box;
    line-height: 1.35;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.plugin-card-footer {
    gap: 0.55rem;
}

.plugin-card-footer .btn {
    white-space: nowrap;
}

.theme-manager-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
}

.theme-manager-card {
    grid-template-columns: 122px minmax(0, 1fr);
}

.theme-manager-card.is-active {
    box-shadow: 0 0 0 3px rgb(15 118 110 / 13%), var(--cp-shadow);
}

.theme-manager-preview {
    gap: 0.35rem;
    padding: 0.45rem;
}

.theme-manager-preview.has-image {
    padding: 0.45rem;
}

.theme-manager-preview img {
    max-height: 108px;
    object-fit: cover;
}

.theme-manager-body {
    gap: 0.45rem;
    padding: 0.65rem 0.7rem;
}

.theme-manager-description {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
}

.theme-template-token-list {
    gap: 0.3rem;
}

.theme-template-token-list code {
    font-size: 0.72rem;
    padding: 0.13rem 0.36rem;
}

.theme-card-actions {
    gap: 0.45rem;
}

.theme-card-actions .btn {
    min-height: 36px;
}

.theme-design-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}

.theme-design-card .theme-template-preview {
    min-height: 112px;
}

.form-field-row {
    padding: 0.8rem;
}

.form-field-primary {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px);
}

.form-field-settings {
    grid-template-columns: minmax(140px, 180px) minmax(140px, 180px) minmax(220px, 1fr);
}

.form-field-row .form-label span {
    color: var(--cp-muted);
}

.editor-dialog-panel,
.theme-live-preview-dialog,
.nimbus-insert-menu {
    box-shadow: 0 24px 80px rgb(15 23 42 / 20%);
}

.nimbus-insert-menu {
    padding: 0.55rem;
}

.nimbus-insert-menu-item {
    min-height: 44px;
}

.nimbus-insert-menu-item:hover,
.nimbus-insert-menu-item:focus {
    background: var(--cp-accent-soft);
}

.rte {
    background: #ffffff;
}

.rte-toolbar {
    background: #f6f8fa;
}

.rte .ProseMirror {
    line-height: 1.55;
}

.nimbus-block-embed {
    box-shadow: var(--cp-shadow-soft);
}

.save-notice {
    box-shadow: 0 8px 22px rgb(6 95 70 / 10%);
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        height: auto;
        position: static;
    }

    .sidebar .brand {
        margin-bottom: 0;
    }

    .sidebar .nav {
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    }

    .sidebar form.mt-auto {
        margin-top: 0.4rem !important;
    }

    .plugins-toolbar,
    .themes-panel-header,
    .media-field-control,
    .form-field-primary,
    .form-field-settings {
        grid-template-columns: 1fr;
    }

    .plugins-upload-panel,
    .media-field .media-field-actions {
        justify-self: stretch;
        width: 100%;
    }

    .media-field .media-field-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions,
    .site-switcher,
    .topbar .btn {
        width: 100%;
    }

    .theme-manager-grid,
    .plugin-list,
    .media-grid,
    .theme-design-grid {
        grid-template-columns: 1fr;
    }

    .theme-manager-card {
        grid-template-columns: 1fr;
    }

    .theme-manager-preview {
        border-bottom: 1px solid var(--cp-border);
        border-right: 0;
    }

    .theme-manager-preview img {
        max-height: none;
    }

    .theme-card-actions,
    .plugin-card-footer,
    .seo-issue,
    .not-found-row,
    .backup-item {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-card-actions .btn,
    .theme-card-actions form,
    .plugin-card-footer .btn,
    .plugin-card-footer form,
    .seo-issue-actions,
    .seo-issue-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 0.8rem;
    }

    .sidebar {
        padding: 0.8rem;
    }

    .sidebar .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar .nav-link {
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0.45rem;
    }

    .sidebar .nav-link span {
        font-size: 0.86rem;
    }

    .panel {
        padding: 0.85rem;
    }

    .actions-row .btn,
    .media-field .media-field-actions,
    .media-field .media-field-actions .btn {
        width: 100%;
    }

    .media-field .media-field-actions {
        grid-template-columns: 1fr;
    }
}
