/* cms-only styles; every rule scoped under .cms_shell */

.cms_shell {
    --cms_gap_xs: 6px;
    --cms_gap_sm: 10px;
    --cms_gap_md: 16px;
    --cms_gap_lg: 24px;
    --cms_radius: 8px;
    --cms_radius_sm: 6px;
    --cms_border: 1px solid rgba(255, 255, 255, 0.14);
    --cms_border_subtle: 1px solid rgba(255, 255, 255, 0.08);
    --cms_panel_bg: rgba(255, 255, 255, 0.04);
    --cms_panel_bg_sunk: rgba(0, 0, 0, 0.22);
    --cms_text_muted: rgba(255, 255, 255, 0.72);
    --cms_text_faint: rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: calc(100vh - 226px);
    box-sizing: border-box;
}

.cms_shell .cms_page {
    width: 100%;
    padding-bottom: 48px;
    box-sizing: border-box;
}

.cms_shell .cms_breadcrumb {
    margin: var(--cms_gap_md) 0 var(--cms_gap_md);
    padding-top: 0;
}

.cms_shell .cms_breadcrumb_list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 1.35;
}

.cms_shell .cms_breadcrumb_item {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.cms_shell .cms_breadcrumb_item + .cms_breadcrumb_item::before {
    content: ">";
    margin: 0 0.45em;
    color: var(--cms_text_faint);
    font-weight: 300;
    pointer-events: none;
}

.cms_shell .cms_breadcrumb_link {
    font-size: inherit;
    font-weight: 400;
    color: var(--cms_text_muted);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.cms_shell .cms_breadcrumb_link:hover {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.55);
}

.cms_shell .cms_breadcrumb_parent {
    font-size: inherit;
    font-weight: 400;
    color: var(--cms_text_muted);
}

.cms_shell .cms_breadcrumb_current {
    font-size: inherit;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
}

.cms_shell .cms_page_header {
    margin-bottom: var(--cms_gap_md);
}

.cms_shell .cms_tools_page_header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--cms_gap_md);
    margin-bottom: 0;
}

.cms_shell .cms_tools_page_header_text {
    flex: 1 1 220px;
    min-width: 0;
}

.cms_shell .cms_tools_page_header_actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--cms_gap_xs);
    padding-top: 18px;
}

.cms_shell .cms_icon_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: rgba(255, 255, 255, 0.75);
    background: transparent;
    border: var(--cms_border);
    border-radius: var(--cms_radius_sm);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.cms_shell .cms_icon_btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.35);
}

.cms_shell .cms_icon_btn.cms_icon_btn_active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.45);
}

.cms_shell .cms_title {
    margin: 0;
    padding-top: 12px;
    font-size: 42px;
    font-weight: 500;
    line-height: 1.05;
}

@media screen and (max-width: 600px) {
    .cms_shell .cms_title {
        font-size: 32px;
    }
}

.cms_shell .cms_lead {
    margin: 8px 0 0;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.35;
    color: var(--cms_text_muted);
}

.cms_shell .cms_label {
    display: block;
    margin: 0 0 var(--cms_gap_xs);
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
}

.cms_shell .cms_hint {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.35;
    color: var(--cms_text_faint);
}

.cms_shell .cms_stack {
    display: flex;
    flex-direction: column;
    gap: var(--cms_gap_sm);
}

.cms_shell .cms_stack_lg {
    gap: var(--cms_gap_md);
}

/* seed / secondary actions: shrink to label width, hug end of row */
.cms_shell .cms_stack.cms_stack_end {
    align-items: flex-end;
}

.cms_shell .cms_stack.cms_stack_end .cms_btn {
    width: fit-content;
}

.cms_shell .cms_panel {
    border: var(--cms_border);
    border-radius: var(--cms_radius);
    background: var(--cms_panel_bg);
    padding: var(--cms_gap_md);
    margin-bottom: var(--cms_gap_md);
    box-sizing: border-box;
}

/* page sections block: no panel chrome (do not combine with .cms_panel — use alone) */
.cms_shell .cms_sections_wrap {
    margin-bottom: var(--cms_gap_md);
    box-sizing: border-box;
}

.cms_shell .cms_panel_title {
    margin: 0 0 var(--cms_gap_sm);
    font-size: 17px;
    font-weight: 500;
}

.cms_shell .cms_toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cms_gap_xs);
    margin: 0 0 var(--cms_gap_sm);
}

.cms_shell .cms_toolbar_flush {
    margin-bottom: 0;
}

.cms_shell .cms_sections_wrap > .cms_toolbar_flush {
    margin-bottom: var(--cms_gap_md);
}

.cms_shell .cms_input,
.cms_shell .cms_textarea {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    background-color: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    outline: none;
    padding: 5px 10px;
    font-size: 16px;
    font-family: inherit;
}

.cms_shell .cms_input:focus,
.cms_shell .cms_textarea:focus {
    border-color: rgba(255, 255, 255, 0.38);
}

.cms_shell .cms_textarea {
    min-height: 80px;
    resize: vertical;
}

.cms_shell .cms_textarea_tall {
    min-height: 100px;
}

.cms_shell .cms_textarea_compact {
    min-height: 56px;
}

.cms_shell .cms_btn {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 14px;
    width: auto;
    min-width: unset;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--cms_radius_sm);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.cms_shell .cms_btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.85);
}

.cms_shell .cms_btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.cms_shell .cms_btn_primary {
    border-color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.cms_shell .cms_tools_page_header_actions .cms_btn.cms_tools_header_save {
    margin: 0;
    height: 44px;
    min-height: 44px;
    padding: 0 16px;
    box-sizing: border-box;
    gap: 8px;
}

.cms_shell .cms_tools_page_header_actions .cms_btn.cms_tools_header_save svg {
    flex-shrink: 0;
}

.cms_shell .cms_btn_danger {
    border-color: rgba(255, 120, 120, 0.55);
    color: #ffb4b4;
}

.cms_shell .cms_btn_danger:hover:not(:disabled) {
    background: rgba(255, 80, 80, 0.12);
    border-color: rgba(255, 160, 160, 0.75);
}

.cms_shell .cms_alert_error {
    margin: 0;
    font-size: 14px;
    color: #ff8f8f;
}

.cms_shell .cms_alert_ok {
    margin: 0;
    font-size: 14px;
    color: #9cffb2;
}

.cms_shell .cms_section_card {
    border: var(--cms_border);
    border-radius: var(--cms_radius);
    padding: var(--cms_gap_md);
    margin-bottom: var(--cms_gap_md);
    box-sizing: border-box;
    contain: layout;
}

.cms_shell .cms_section_card.cms_section_card_collapsed {
    padding-bottom: calc(var(--cms_gap_md) - 11px);
}

.cms_shell .cms_section_header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cms_gap_sm);
    margin-bottom: var(--cms_gap_sm);
}

.cms_shell .cms_section_title_row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--cms_gap_sm);
    flex: 1 1 auto;
    min-width: 0;
}

.cms_shell .cms_section_collapse_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--cms_text_faint);
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.cms_shell .cms_section_collapse_btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
}

.cms_shell .cms_section_collapse_btn svg {
    transition: transform 0.15s ease;
}

.cms_shell .cms_section_collapse_btn_open svg {
    transform: rotate(90deg);
}

.cms_shell .cms_section_meta_inline_label {
    flex: 0 0 140px;
    max-width: 140px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--cms_text_muted);
}

.cms_shell .cms_section_title_row .cms_input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.cms_shell .cms_column_block {
    margin-bottom: var(--cms_gap_md);
    padding: var(--cms_gap_sm);
    background: var(--cms_panel_bg_sunk);
    border-radius: var(--cms_radius_sm);
    box-sizing: border-box;
}

.cms_shell .cms_card_block {
    margin-bottom: var(--cms_gap_sm);
    padding-bottom: var(--cms_gap_sm);
    border-bottom: var(--cms_border_subtle);
    box-sizing: border-box;
}

.cms_shell .cms_card_block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.cms_shell .cms_simple_card_block {
    margin-bottom: var(--cms_gap_sm);
    padding-left: var(--cms_gap_sm);
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
}

.cms_shell .cms_details {
    border: none;
    margin: 0;
    padding: 0;
}

.cms_shell .cms_checkbox_row {
    display: flex;
    align-items: center;
    gap: var(--cms_gap_sm);
    margin-top: var(--cms_gap_xs);
    font-size: 14px;
    font-weight: 300;
    color: var(--cms_text_muted);
}

.cms_shell .cms_sticky_save {
    position: sticky;
    bottom: 0;
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cms_gap_sm);
    margin-top: var(--cms_gap_lg);
    padding: var(--cms_gap_md);
    background: rgba(2, 1, 3, 0.92);
    border: var(--cms_border);
    border-radius: var(--cms_radius);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}

.cms_shell .cms_sticky_save_hint {
    margin: 0;
    font-size: 13px;
    color: var(--cms_text_faint);
    flex: 1 1 auto;
}

.cms_shell .cms_spacing_top {
    margin-top: var(--cms_gap_md);
}

/* card matrix: field names in first column, one column per card */
.cms_shell .cms_matrix_wrap {
    overflow-x: auto;
    margin-top: var(--cms_gap_sm);
    -webkit-overflow-scrolling: touch;
    border-radius: var(--cms_radius_sm);
    border: var(--cms_border_subtle);
    contain: layout;
}

.cms_shell .cms_matrix_wrap.cms_matrix_wrap_visual {
    width: calc(100% + 16px);
    margin-left: 0;
    box-sizing: border-box;
}

.cms_shell .cms_matrix_table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.cms_shell .cms_matrix_table.cms_matrix_table_visual,
.cms_shell .cms_matrix_table.cms_matrix_table_links {
    min-width: max-content;
    width: max-content;
}

.cms_shell .cms_matrix_table_links col.cms_matrix_col_field {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

.cms_shell .cms_matrix_table_links col.cms_matrix_col_card {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
}

.cms_shell .cms_matrix_table_visual col.cms_matrix_col_field {
    width: 350px;
    min-width: 350px;
    max-width: 350px;
}

.cms_shell .cms_matrix_table_visual col.cms_matrix_col_card {
    width: 625px;
    min-width: 625px;
    max-width: 625px;
}

.cms_shell .cms_matrix_table th,
.cms_shell .cms_matrix_table td {
    padding: var(--cms_gap_xs) var(--cms_gap_sm);
    border: var(--cms_border_subtle);
    vertical-align: top;
    box-sizing: border-box;
}

.cms_shell .cms_matrix_corner {
    width: 120px;
    min-width: 120px;
    background: var(--cms_panel_bg_sunk);
    border: var(--cms_border_subtle);
}

.cms_shell .cms_matrix_row_label {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    color: var(--cms_text_muted);
    background: var(--cms_panel_bg_sunk);
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.25);
}

.cms_shell .cms_matrix_col_head {
    min-width: 200px;
    width: 220px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    text-align: left;
}

.cms_shell .cms_matrix_col_head_inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--cms_gap_xs);
    width: 100%;
    box-sizing: border-box;
}

.cms_shell .cms_matrix_col_head_inner > span {
    min-width: 0;
    text-align: left;
}

.cms_shell .cms_matrix_col_head_inner > .cms_btn {
    flex-shrink: 0;
}

.cms_shell .cms_matrix_data_cell {
    min-width: 200px;
    width: 220px;
}

.cms_shell .cms_matrix_table_visual .cms_matrix_corner {
    width: 350px;
    min-width: 350px;
    max-width: 350px;
}

.cms_shell .cms_matrix_table_visual .cms_matrix_row_label {
    width: 350px;
    min-width: 350px;
    max-width: 350px;
}

.cms_shell .cms_matrix_table_visual .cms_matrix_col_head {
    width: 625px;
    min-width: 625px;
    max-width: 625px;
}

.cms_shell .cms_matrix_table_visual .cms_matrix_data_cell {
    width: 625px;
    min-width: 625px;
    max-width: 625px;
}

.cms_shell .cms_matrix_cell_input {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    background-color: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    outline: none;
    padding: 6px 8px;
    font-size: 14px;
    font-family: inherit;
}

.cms_shell .cms_matrix_cell_textarea {
    width: 100%;
    min-height: 72px;
    margin: 0;
    resize: vertical;
    box-sizing: border-box;
    background-color: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    outline: none;
    padding: 6px 8px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.35;
}

.cms_shell .cms_matrix_cell_input:focus,
.cms_shell .cms_matrix_cell_textarea:focus {
    border-color: rgba(255, 255, 255, 0.38);
}

.cms_shell .cms_matrix_cell_check {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
}

.cms_shell .cms_matrix_image_field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cms_shell .cms_matrix_image_preview_wrap {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--cms_border, rgba(255, 255, 255, 0.12));
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.cms_shell .cms_matrix_image_preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cms_shell .cms_matrix_image_actions {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.cms_shell .cms_matrix_choose_file_btn {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.cms_shell .cms_matrix_image_file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cms_shell .cms_matrix_image_error {
    margin: 0;
    font-size: 12px;
    color: #f87171;
    line-height: 1.3;
}

.cms_shell .cms_matrix_block_title {
    margin: var(--cms_gap_md) 0 var(--cms_gap_xs);
    font-size: 14px;
    font-weight: 600;
    color: var(--cms_text_muted);
}

.cms_shell .cms_matrix_block_title:first-child {
    margin-top: 0;
}

.cms_shell .cms_section_meta_table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-bottom: var(--cms_gap_md);
}

.cms_shell .cms_section_meta_table th {
    width: 140px;
    max-width: 140px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    color: var(--cms_text_muted);
    padding: var(--cms_gap_xs) var(--cms_gap_sm) var(--cms_gap_xs) 0;
    vertical-align: middle;
}

.cms_shell .cms_section_meta_table td {
    padding: var(--cms_gap_xs) 0;
    vertical-align: middle;
    min-width: 0;
}
