/* ============================================================
   GLOBAL STYLES
   Общие стили сайта, каталога, конфигуратора и панели управления.
   ============================================================ */

:root {
    --bg: #101014;
    --surface: #191920;
    --surface-2: #202029;
    --surface-3: #2a2a34;
    --border: #333340;
    --border-soft: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --muted: #b9b9c7;
    --accent: #f4d28d;
    --accent-hover: #ffe2a6;
    --danger: #9d1b1b;
    --radius: 18px;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
    line-height: 1.5;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
}

h2 {
    margin-bottom: 14px;
}

p {
    color: #dedee8;
}

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

a:hover {
    color: var(--accent-hover);
}

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 28px;
    background: #17171d;
    border-bottom: 1px solid #292934;
}

.brand {
    flex: 0 0 auto;
    font-weight: 800;
    color: white;
    font-size: 22px;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 11px;
    color: #f2f2f7;
}

nav a:hover {
    background: var(--surface-2);
    color: var(--accent-hover);
}

main {
    width: min(100%, 1320px);
    margin: 0 auto;
    padding: 32px 28px 48px;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: center;
    margin-bottom: 24px;
}

.catalog-hero {
    align-items: flex-start;
}

.catalog-hero h1 {
    margin-bottom: 8px;
}

.catalog-hero p,
.muted {
    color: var(--muted);
}

.hero input,
input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 11px 13px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #0d0d11;
    color: var(--text);
    outline: none;
}

textarea {
    min-height: 105px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #6b5f45;
    box-shadow: 0 0 0 3px rgba(244, 210, 141, 0.12);
}

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

.card,
.formbox,
.panel aside,
.stats div {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 18px;
}

.card h3,
.card p {
    margin-bottom: 0;
}

.card b {
    margin-top: auto;
    font-size: 18px;
}

.card.wide {
    margin-bottom: 18px;
}

.thumb,
.viewer {
    height: 300px;
    background: #0b0b0f;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    overflow: hidden;
}

.viewer {
    height: 520px;
}

model-viewer {
    width: 100%;
    height: 100%;
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    background: var(--accent);
    color: #111;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.btn:hover,
button:hover {
    background: var(--accent-hover);
    color: #111;
    transform: translateY(-1px);
}

.btn.ghost {
    background: var(--surface-3);
    color: var(--text);
    border-color: #3b3b47;
}

.btn.ghost:hover {
    background: #343440;
    color: var(--text);
}

.btn.small {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 13px;
    border-radius: 10px;
}

.danger {
    background: var(--danger) !important;
    color: white !important;
}

.actions,
.form-actions,
.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.actions {
    margin-top: 6px;
}

.detail {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 30px;
}

.price {
    font-size: 28px;
    font-weight: 800;
    color: white;
}

.formbox {
    max-width: 600px;
    padding: 24px;
}

.formbox form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.formbox form p {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
    color: var(--muted);
}

.formbox label {
    color: #d8d8e4;
    font-size: 14px;
    font-weight: 700;
}

.formbox .helptext,
.formbox ul {
    color: var(--muted);
    font-size: 13px;
    margin: 4px 0 0;
}

.formbox ul {
    padding-left: 18px;
}

.formbox button,
.formbox .btn {
    width: max-content;
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin: 18px 0;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid #2c2c38;
    text-align: left;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: 0;
}

th {
    color: #eeeeF6;
    background: #202029;
}

.msg {
    width: min(calc(100% - 56px), 1264px);
    margin: 16px auto 0;
    padding: 12px 16px;
    border-radius: 14px;
    background: #27364b;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.panel {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.panel aside {
    padding: 18px;
    height: max-content;
    position: sticky;
    top: 24px;
}

.panel aside h3 {
    margin-bottom: 12px;
}

.panel aside a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 6px;
}

.panel aside a:hover {
    background: #252531;
}

.panel section > .btn,
.panel section > a.btn {
    margin-bottom: 14px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}

.stats div {
    padding: 20px;
    color: var(--muted);
}

.stats b {
    display: block;
    font-size: 30px;
    margin-top: 8px;
    color: white;
}

.scene-detail {
    display: grid;
    grid-template-columns: minmax(360px, 1.4fr) minmax(280px, 0.6fr);
    gap: 26px;
    align-items: start;
}

.scene-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.scene-toolbar label {
    color: var(--muted);
    font-size: 14px;
}

.scene-toolbar select {
    min-width: 210px;
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    padding: 0 12px;
}

.scene-viewer {
    min-height: 460px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-soft);
    background: #090a0d;
    box-shadow: var(--shadow);
}

.scene-viewer canvas {
    width: 100% !important;
}

.product-info {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.product-info h1,
.product-info p {
    margin-bottom: 0;
}

.product-info > .btn {
    width: 100%;
}

.error-text {
    margin-top: 12px;
    color: #ff8b8b;
}

.catalog-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) minmax(130px, 0.6fr) minmax(130px, 0.6fr) auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 26px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.filter-field,
.config-search {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.filter-field label,
.config-search label {
    color: #d8d8e4;
    font-size: 14px;
    font-weight: 700;
}

.auth-page {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.auth-page .formbox {
    width: min(100%, 460px);
}

.config-search {
    margin: 14px 0 12px;
}

.auth-switch {
    margin: 20px 0 0;
    text-align: center;
    color: #d8d8e4;
}

.auth-switch a {
    font-weight: 800;
}

.auth-notice {
    margin-top: 8px;
    padding: 18px;
    border: 1px solid #3a3a48;
    border-radius: 16px;
    background: #202029;
}

.auth-notice p {
    margin-bottom: 14px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.75fr) minmax(320px, 1fr);
    gap: 26px;
    align-items: start;
}

.checkout-grid .formbox {
    max-width: none;
}

.order-summary table {
    margin-top: 12px;
    margin-bottom: 16px;
}

.order-summary h3 {
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .catalog-filters {
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions {
        grid-column: 1 / -1;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    main {
        padding: 24px 18px 40px;
    }

    .scene-detail,
    .detail,
    .panel,
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .product-info,
    .panel aside {
        position: static;
    }
}

@media (max-width: 700px) {
    .top {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 18px;
    }

    nav {
        justify-content: flex-start;
        width: 100%;
    }

    nav a {
        min-height: 36px;
        padding: 7px 9px;
    }

    .catalog-filters,
    .stats {
        grid-template-columns: 1fr;
    }

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

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .actions,
    .filter-actions,
    .form-actions {
        align-items: stretch;
    }

    .actions .btn,
    .filter-actions .btn,
    .filter-actions button,
    .form-actions .btn,
    .form-actions button {
        flex: 1 1 160px;
    }

    .scene-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.scene-toolbar label {
    color: var(--muted);
    font-size: 14px;
}

.scene-toolbar select {
    min-width: 210px;
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    padding: 0 12px;
}

.scene-viewer {
        min-height: 360px;
    }
}


.panel-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 4px 0 24px;
}

.panel-list-actions + table {
    margin-top: 0;
}

.panel section > .btn,
.panel section > a.btn {
    margin-bottom: 24px;
}

.panel-edit-form {
    margin-top: 8px;
}

.checkout-grid {
    gap: 34px;
}

.checkout-formbox,
.order-summary {
    align-self: start;
}

.auth-box form .center-actions {
    display: flex;
    justify-content: center;
    margin-top: 4px;
}

.auth-box form .center-actions .btn {
    min-width: 170px;
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
    border-color: #ff8b8b;
    box-shadow: 0 0 0 3px rgba(255, 139, 139, 0.12);
}

.field-errors,
.errorlist {
    color: #ff9d9d;
    font-size: 13px;
    line-height: 1.35;
}

.field-errors ul,
ul.errorlist {
    margin: 4px 0 0;
    padding-left: 18px;
}

.formbox .helptext {
    display: none;
}

.formbox .helptext.visible,
.form-field.has-error .helptext {
    display: block;
    color: #ffcf9d;
}

.formbox form > .form-actions {
    margin-top: 4px;
}

@media (max-width: 900px) {
    .checkout-grid {
        gap: 24px;
    }
}

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

.panel-page-header h1,
.panel-page-header p {
    margin-bottom: 0;
}

.panel-card {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel-order-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(260px, 0.55fr);
    gap: 26px;
    align-items: start;
    margin-bottom: 26px;
}

.panel-order-info h2,
.panel-status-card h2,
.panel-order-items h2 {
    margin-bottom: 18px;
}

.info-list {
    display: grid;
    gap: 14px;
}

.info-list div {
    display: grid;
    gap: 5px;
    padding: 14px;
    background: #15151c;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
}

.info-list span,
.order-item-row span {
    color: var(--muted);
    font-size: 13px;
}

.info-list b {
    color: #f4f4f8;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.panel-status-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-status-form label {
    display: block;
    margin-bottom: 7px;
    color: #d8d8e4;
    font-size: 14px;
    font-weight: 700;
}

.order-items-list {
    display: grid;
    gap: 12px;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    background: #15151c;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
}

.order-item-row div {
    display: grid;
    gap: 5px;
}

.order-item-row strong {
    flex: 0 0 auto;
    color: white;
}

@media (max-width: 900px) {
    .panel-page-header,
    .order-item-row {
        flex-direction: column;
    }

    .panel-order-layout {
        grid-template-columns: 1fr;
    }
}

.panel-edit-form .category-widget {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel-edit-form .category-fields-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 16px;
    align-items: start;
}

.panel-edit-form .category-fields-row select,
.panel-edit-form .category-fields-row input {
    width: 100%;
    min-width: 0;
}

.panel-edit-form .category-helptext,
.panel-edit-form .category-message {
    margin-top: 0;
    grid-column: 1 / -1;
}

.formbox form .checkbox-field,
.panel-status-form .checkbox-field {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 10px;
}

.formbox form .checkbox-field label,
.panel-status-form .checkbox-field label {
    margin: 0;
    order: 1;
}

.formbox form .checkbox-field input[type="checkbox"],
.panel-status-form .checkbox-field input[type="checkbox"],
input[type="checkbox"] {
    width: 18px;
    min-width: 18px;
    max-width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    margin: 0;
    flex: 0 0 18px;
    border-radius: 5px;
    order: 2;
}

.panel-status-card .form-field label:empty {
    display: none;
}

@media (max-width: 700px) {
    .panel-edit-form .category-fields-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.panel-header-actions,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.inline-delete-form,
.table-actions form {
    margin: 0;
}

.table-actions .btn.small {
    min-height: 32px;
}

.new-category-field[hidden] {
    display: none !important;
}


@media (max-width: 900px) {
    .panel-header-actions {
        width: 100%;
    }
}

.btn.secondary {
    background: var(--surface-3);
    color: var(--text);
    border-color: #3b3b47;
}

.btn.secondary:hover {
    background: #343440;
    color: var(--text);
}

.model-size-status {
    display: block;
    margin-top: 6px;
}

.panel-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
    margin: 18px 0 22px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: rgba(255,255,255,.04);
}

.panel-filters input,
.panel-filters select,
.catalog-filters input,
.catalog-filters select {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
}

.panel-filters .filter-actions,
.catalog-filters .filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.panel-filters .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 2px;
}

.panel-filters .filter-actions .btn,
.panel-filters .filter-actions button {
    min-width: 112px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 28px 0 8px;
}

.page-link {
    display: inline-flex;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.06);
    text-decoration: none;
}

.page-link.current {
    background: rgba(255,255,255,.18);
    font-weight: 700;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.home-hero {
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(135deg, #1f1f28, #141419);
    box-shadow: var(--shadow);
}
.home-hero p {
    max-width: 760px;
    font-size: 18px;
}
.home-section {
    margin-top: 34px;
}
.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}
.section-head.compact {
    margin-bottom: 12px;
}
.section-head h2,
.section-head h3,
.section-head p {
    margin-bottom: 0;
}
.category-block {
    margin-bottom: 28px;
}
.small-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.compact-card {
    min-height: 210px;
}
.panel-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
    margin-bottom: 16px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.panel-filters .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-top: 2px;
}
.preset-field {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
}
.preset-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #d8d8d8;
}
.preset-field select {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0 12px;
    margin-bottom: 10px;
}
.preset-field option { color: #111; }
.preset-description { margin: 0 0 10px; }
@media (max-width: 760px) {
    .home-hero { padding: 24px; }
    .section-head { flex-direction: column; }
}

.configurable-home-block .section-head > div {
    max-width: 820px;
}
.home-preset-viewer {
    width: 100%;
    min-height: 240px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    background: #090a0d;
}
.home-preset-viewer canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.preset-preview-card {
    min-height: 420px;
}
.preset-editor-form {
    margin-bottom: 22px;
}
.preset-editor-meta {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, .8fr) auto;
    gap: 16px;
    align-items: end;
}
.preset-editor-description {
    grid-column: 1 / -1;
}
.preset-editor-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.preset-editor-products {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow: auto;
}
.preset-editor-products h2 {
    margin-bottom: 10px;
}
.preset-editor-products input {
    margin-bottom: 12px;
}

#presetProductList {
    display: grid;
    gap: 10px;
}

#presetProductList .product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

#presetProductList .product-row span {
    display: block;
    min-width: 0;
    line-height: 1.35;
}

#presetProductList .product-row small {
    display: inline-block;
    margin-top: 4px;
    color: var(--muted);
}

#presetProductList .product-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    margin-left: 8px;
}

@media (max-width: 520px) {
    #presetProductList .product-row {
        align-items: flex-start;
        flex-direction: column;
    }

    #presetProductList .product-row .btn {
        width: 100%;
        margin-left: 0;
    }
}

.preset-editor-scene-wrap {
    position: relative;
    min-height: 620px;
}
#presetEditorScene {
    min-height: 620px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-soft);
    background: #090a0d;
    box-shadow: var(--shadow);
}
#presetEditorScene canvas {
    width: 100% !important;
    min-height: 620px;
    display: block;
}
#presetEditorControls {
    position: fixed;
    display: none;
    z-index: 60;
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(15, 15, 18, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}
#presetEditorControls button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 9px;
    background: #24242c;
    color: white;
}
.preset-editor-status {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
}
@media (max-width: 1000px) {
    .preset-editor-layout,
    .preset-editor-meta {
        grid-template-columns: 1fr;
    }
    .preset-editor-products {
        position: static;
        max-height: none;
    }
}

.panel-page-header.stacked {
    align-items: flex-start;
}
.home-containers-header {
    margin-top: 28px;
    margin-bottom: 12px;
}
.add-container-under-title {
    display: inline-flex;
    margin-top: 14px;
}
.sortable-blocks {
    display: grid;
    gap: 12px;
}
.sortable-block {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 8px 22px rgba(0,0,0,.16);
}
.sortable-block.is-dragging {
    opacity: .55;
}
.drag-handle {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    cursor: grab;
    user-select: none;
    font-weight: 800;
}
.sortable-block-main {
    display: grid;
    gap: 5px;
}
.sortable-block-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.sortable-block-meta span {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    font-size: 12px;
}
.empty-state {
    padding: 20px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    color: var(--muted);
}
.sort-save-status {
    min-height: 22px;
    margin-top: 10px;
}
@media (max-width: 760px) {
    .sortable-block {
        grid-template-columns: 36px 1fr;
    }
    .sortable-block .table-actions {
        grid-column: 2;
    }
}

.panel-page-header.stacked .preset-create-under-title,
.panel-page-header.stacked .add-container-under-title {
    margin-top: 12px;
}

.confirm-delete-form,
.confirm-delete-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.confirm-delete-actions .btn,
.confirm-delete-form .btn {
    width: max-content;
}

.visually-hidden-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.selection-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.selection-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.selection-results,
.selection-picked {
    padding: 12px;
    background: #111117;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.selection-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow: auto;
}

.selection-result {
    justify-content: flex-start;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
    text-align: left;
}

.selection-result.active,
.selection-result:hover {
    background: #343440;
    color: var(--accent-hover);
}

.selection-picked b {
    display: block;
    margin-bottom: 10px;
    color: #ededf7;
}

.selection-picked-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selection-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
}

.selection-chip button {
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    padding: 0;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
}

.selection-empty {
    color: var(--muted);
    font-size: 14px;
}

.preset-create-choice {
    padding: 20px;
    margin-bottom: 18px;
}

.preset-create-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.panel-filters .filter-actions {
    align-self: end;
}

.table-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0 0 12px;
}

.table-toolbar + table {
    margin-top: 0;
}

.homepage-combined-block {
    display: grid;
    gap: 28px;
}

.homepage-settings-inner-form {
    display: grid;
    gap: 14px;
}

.homepage-containers-panel {
    display: grid;
    gap: 14px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.home-containers-title h2 {
    margin-bottom: 6px;
}

.add-container-under-list {
    justify-self: start;
    margin-top: 2px;
}

@media (max-width: 700px) {
    .table-toolbar {
        justify-content: stretch;
    }
    .table-toolbar .btn {
        width: 100%;
        justify-content: center;
    }
}

.preset-create-tabs .btn.active {
    box-shadow: 0 0 0 2px rgba(255,255,255,.16) inset;
}

.preset-create-section[hidden] {
    display: none !important;
}

.panel-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.panel-title-row h1 {
    margin: 0;
}

.header-create-btn {
    border: 0;
    box-shadow: none;
}

.panel-title-row + .panel-filters {
    margin-top: 0;
}

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

    .panel-title-row .header-create-btn {
        width: 100%;
    }
}

.selection-columns {
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(220px, 360px);
    gap: 14px;
    align-items: start;
}

.selection-box {
    padding: 12px;
    background: #111117;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.selection-box-title {
    margin-bottom: 10px;
    color: #ededf7;
    font-weight: 800;
}

.selection-box .selection-search {
    width: 100%;
    margin-bottom: 10px;
}

.selection-results,
.selection-picked-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.selection-result-row,
.selection-picked-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.selection-result-row.is-added {
    opacity: .45;
    filter: grayscale(1);
}

.selection-result-name,
.selection-picked-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selection-row-add,
.selection-remove-btn {
    white-space: nowrap;
}

@media (max-width: 820px) {
    .selection-columns {
        grid-template-columns: 1fr;
    }
}

.selection-box .selection-results,
.selection-box .selection-picked-list {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0 4px 0 0;
}

.delete-modal[hidden] {
    display: none;
}

.delete-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.delete-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 12, 0.68);
    backdrop-filter: blur(3px);
}

.delete-modal-card {
    position: relative;
    width: min(420px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: #171923;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    padding: 24px;
}

.delete-modal-card h2 {
    margin: 0 0 10px;
}

.delete-modal-card p {
    margin: 0 0 20px;
    color: #c9ced8;
}

.delete-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
