:root {
    --bg: #0e1621;
    --text: #fff;
    --hint: #a5b0bf;
    --secondary: #17212b;
    --stroke: rgba(255, 255, 255, .10);
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);

    --glass-bg: rgba(16, 22, 28, .55);
    --glass-border: rgba(255, 255, 255, .12);
    --tab-active-bg: rgba(255, 255, 255, .08);

    --tabbar-total: 82px;
    --radius: 22px;
}

/* базовые */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

/* Размытый фон */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(60% 80% at 10% 10%, #6ea8ff33 0%, transparent 60%),
        radial-gradient(70% 90% at 90% 20%, #ff7aa933 0%, transparent 60%),
        radial-gradient(80% 70% at 50% 100%, #31e7c233 0%, transparent 60%),
        linear-gradient(180deg, var(--bg), var(--bg));
    filter: blur(28px) saturate(120%);
    transform: scale(1.1);
}

/* контейнер */
.app {
    position: relative;
    min-height: 100dvh;
    padding: calc(10px + var(--safe-top)) 14px 0;
}

/* шапка + чипы */
.topbar {
    margin-bottom: 10px;
}

.topbar h1 {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.2;
}

.chips {
    display: flex;
    gap: 8px;
}

.chip {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: transparent;
    color: var(--text);
    font-weight: 600;
}

.chip--active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* страницы */
.page {
    display: none;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    height: min(calc(100dvh - var(--safe-top) - var(--tabbar-total) - 10px),
            calc(100svh - var(--safe-top) - var(--tabbar-total) - 10px));
    padding-bottom: 12px;
}

.page--active {
    display: block;
}

/* карточки */
.cards {
    display: grid;
    gap: 12px;
}

.cards> :last-child {
    margin-bottom: calc(var(--tabbar-total) + var(--safe-bottom) + 28px);
}

.card {
    position: relative;
    overflow: hidden;
    width: 100%;
    border: 0;
    border-radius: 28px;
    min-height: clamp(140px, 26vh, 300px);
    cursor: pointer;
    isolation: isolate;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    transition: transform .06s ease;
}

.card:active {
    transform: scale(.99);
}

.card-bg,
.card-bg img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.card-bg img {
    object-fit: cover;
    background: #0b0d10;
    backface-visibility: hidden;
}

.card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .55) 100%);
}

.card-content {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}

.card-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.15;
}

.card-sub {
    font-size: 13px;
    opacity: .95;
}

/* профиль */
.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 6vh;
}

.profile-avatar {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    overflow: hidden;
    background: #00000022;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.profile-avatar.has-photo img {
    display: block;
}

.profile-initials {
    font-weight: 800;
    font-size: 28px;
}

.profile-name {
    font-weight: 800;
}

/* стеклянный таббар */
.tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(8px + var(--safe-bottom));
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    padding: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
    z-index: 100;
}

.tab {
    height: 44px;
    border: 0;
    background: transparent;
    font-weight: 800;
    border-radius: 14px;
    color: var(--text);
}

.tab--active {
    background: var(--tab-active-bg);
    box-shadow: inset 0 0 0 1px var(--glass-border);
}

/* формы и контент */
.content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: var(--secondary);
    color: var(--text);
    font-size: 14px;
}

button {
    background: var(--text);
    color: var(--bg);
    font-weight: 700;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    border: none;
    transition: transform 0.08s ease;
}

button:active {
    transform: scale(0.97);
}

/* ============================== */
/* НОВЫЙ ЭКРАН ОЖИДАНИЯ */
/* ============================== */
.page-loading {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(160deg, #1a2332, #0e1621);
    color: #fff;
    z-index: 9999;
    transition: opacity .4s ease;
}

.page-loading.active {
    display: flex;
    opacity: 1;
}

.loading-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    animation: fadeIn 1s ease forwards;
}

.loader-circle {
    width: 80px;
    height: 80px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1.1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================== */
/* КРАСИВЫЙ ЭКРАН ОЖИДАНИЯ */
/* ============================== */

.page-loading {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, #2b3550 0%, #0e1621 100%);
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    z-index: 9999;
    animation: fadeIn 0.6s ease forwards;
}

.page-loading.active,
.page-loading.page--active {
    display: flex;
    flex-direction: column;
}

.waiting-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.7s ease forwards;
    transform: translateY(-10px);
}

.waiting-tip {
    margin-top: 22px;
    width: 100%;
    max-width: 340px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 14px 16px;
    border-radius: 18px;
    cursor: pointer;

    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);

    font-size: 13px;
    line-height: 1.4;
    color: #dbe4ff;

    opacity: 0;
    animation: tipFadeIn 0.6s ease forwards;
}


.waiting-tip:active {
    transform: scale(0.98);
}

.tip-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.tip-text {
    text-align: left;
}

@keyframes tipFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.waiting-circle {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1.1s linear infinite;
}

.waiting-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: pulse 2.4s ease-in-out infinite;
    border-radius: 50%;
}

.waiting-wrapper h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.waiting-wrapper p {
    max-width: 240px;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.8;
}

/* Анимации */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==== FIX: Mobile Telegram display bug ==== */
.page-loading {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 30%, #2b3550 0%, #0e1621 100%);
    z-index: 99999;
    opacity: 0;
    transition: opacity .4s ease;
    pointer-events: none;
}

.page-loading.page--active {
    display: flex;
    opacity: 1;
    pointer-events: all;
}






.btn-add {
    background: var(--secondary);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-weight: 700;
    margin-top: 4px;
}



#publishSiteBtn {
    margin-top: 12px;
}



/* Заголовки */
.builder-step h2 {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 800;
}

.builder-step {
    padding: 16px;
}

/* ============================================
   ★★★ WEBFLOW-ПОДОБНЫЙ КОНСТРУКТОР САЙТОВ ★★★
   ============================================ */

/* === Сетка конструктора === */
.builder-grid {
    display: grid;
    grid-template-columns: 240px 1fr 260px;
    height: calc(100vh - 90px);
    /* <— ОБЫЧНЫЙ vh, не dvh */
    gap: 14px;
    padding: 10px;
}

#page-make-website {
    height: 100vh;
    overflow: hidden;
}

/* === Левый сайдбар — элементы === */
.builder-sidebar-left {
    height: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    overflow-y: auto;
    backdrop-filter: blur(18px);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 14px;
}

.elements-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.element-btn {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--secondary);
    border: 1px solid var(--stroke);
    color: var(--text);
    text-align: left;
    font-weight: 600;
    cursor: grab;
    transition: 0.15s;
}

.element-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sub {
    margin-top: 16px;
    opacity: 0.6;
    font-size: 14px;
}

/* === Центральный холст === */
.builder-canvas-wrapper {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 10px;
    backdrop-filter: blur(18px);
    position: relative;
    overflow: visible;
    margin: 0;
    padding: 0;
}

#builder-canvas {
    min-width: 300px;
    min-height: 300px;
    width: 100%;
    height: 100%;
    background: white;
    border: 1px dashed #ccc;
    border-radius: 14px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.canvas-placeholder {
    opacity: 0.5;
    text-align: center;
    margin-top: 40px;
}


.canvas-element.selected {
    background: rgba(59, 130, 246, 0.05);
    outline: none;
    border-radius: 6px;
    position: absolute;
    z-index: 10;
}


/* Кнопка публикации */
.publish-btn {
    width: 100%;
    background: #3b82f6;
    color: white;
    margin-top: 20px;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
}

.publish-btn:active {
    transform: scale(0.97);
}

/* Скрывать topbar и tabbar, когда открыт конструктор */
.page-make-website-open .topbar,
.page-make-website-open .tabbar {
    display: none !important;
}

.page-website-preview-open .topbar,
.page-website-preview-open .tabbar {
    display: none !important;
}

.canvas-element {
    overflow: hidden;
    /* или auto */
    user-select: none !important;
    cursor: grab;
    border: none !important;
    position: absolute;
}

.canvas-element:hover:not(.selected) {
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.6);
}

.resize-handle {
    opacity: 0;
    pointer-events: auto;
}

.canvas-element *:not(.resize-handle) {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    user-select: none !important;
    border: 1px dashed transparent;
    transition: 0.2s;
    white-space: pre-wrap;
}

.canvas-element>* {
    pointer-events: none;
}

/* Все ручки скрыты по умолчанию */
.canvas-element .resize-handle {
    display: none;
    pointer-events: auto;
    padding: 0 !important;
    width: 10px !important;
    height: 10px !important;
}

.canvas-element:hover .resize-handle,
.canvas-element.selected .resize-handle {
    opacity: 1;
}

/* А вот у выбранного — показываются */
.canvas-element.selected .resize-handle {
    width: 4px;
    height: 4px;
    background: #3b82f6;
    border-radius: 50%;
    position: absolute;
    z-index: 20;
    display: block;
}


/* Позиции */
.resize-tl {
    top: -2px;
    left: -2px;
    cursor: nwse-resize;
}

.resize-tr {
    top: -2px;
    right: -2px;
    cursor: nesw-resize;
}

.resize-bl {
    bottom: -2px;
    left: -2px;
    cursor: nesw-resize;
}

.resize-br {
    bottom: -2px;
    right: -2px;
    cursor: nwse-resize;
}

.resize-t {
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.resize-b {
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.resize-l {
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.resize-r {
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}



.canvas-element.dragging {
    opacity: 0.85;
    z-index: 9999;
    cursor: grabbing !important;
}

.color-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-preview {
    width: 100%;
    height: 4px;
    border-radius: 4px;
    cursor: pointer;
    background: #000;
    transition: 0.15s;
    margin-top: 6px;
    /* ← Добавили отступ вниз */
}

.color-preview:hover {
    opacity: 0.7;
}

.hidden-color {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.builder-sidebar-right {
    background: #f7f8fa;
    padding: 20px;
    border-left: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 16px;
    height: calc(100vh - 32px);
    overflow-y: auto;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.settings-block {
    background: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
}

.settings-block label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.settings-block input,
.settings-block select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 14px;
    color: #333;
    transition: 0.15s;
}

.settings-block input:focus,
.settings-block select:focus {
    border-color: #3b82f6;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Чтобы последний блок не имел лишней полоски */
.settings-block:last-child {
    border-bottom: none;
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.align-row {
    display: flex;
    gap: 6px;
}

.align-btn {
    flex: 1;
    padding: 10px 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: 0.15s;
}

.align-btn:hover {
    background: #f1f5f9;
}

.align-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.color-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-preview {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #ccc;
    cursor: pointer;
}

.hidden-color {
    display: none;
}

.z-row {
    display: flex;
    gap: 8px;
}

.z-row button {
    flex: 1;
    padding: 8px 0;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    transition: 0.15s;
}

.z-row button:hover {
    background: #f1f5f9;
}

#duplicate,
#delete {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

#duplicate {
    background: #e0f2fe;
    color: #0369a1;
}

#duplicate:hover {
    background: #bae6fd;
}

#delete {
    background: #fee2e2;
    color: #b91c1c;
}

#delete:hover {
    background: #fecaca;
}

.mini-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    margin-left: 2px;
}

/* Блок в стиле Webflow */
.webflow-block {
    padding: 10px 0;
}

/* Блок секции */
.wf-section-title {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.65;
    margin-bottom: 6px;
    display: block;
}

/* Обёртка поля */
.wf-field {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Маленький заголовок X Y Д В */
.wf-label-small {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.75;
    margin-bottom: 2px;
    /* ← регулирует расстояние до input */
    position: relative;
    /* больше НЕ absolute */
}

/* Чистый Webflow-style input */
.wf-input {
    width: 100%;
    padding: 8px 30px 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: var(--secondary);
    color: var(--text);
    font-size: 14px;
    appearance: textfield;
}

/* убираем стрелки у input number */
.wf-input::-webkit-inner-spin-button,
.wf-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* Подпись px внутри */
.wf-unit {
    position: absolute;
    right: 10px;
    bottom: 11px;
    font-size: 14px;
    opacity: 0.65;
    pointer-events: none;
}


.wf-input:focus {
    border-bottom: 1px solid #3b82f6;
}


.settings-box input[type="number"] {
    position: relative;
}

/* Маскируем область стрелок */
.settings-box input[type="number"]::-webkit-inner-spin-button {
    opacity: 0;
    pointer-events: none;
}

.settings-box input[type="number"]::-webkit-outer-spin-button {
    opacity: 0;
    pointer-events: none;
}

.settings-box input[type="number"] {
    /* для Firefox */
    background-image: linear-gradient(180deg, transparent 0, transparent 100%);
}

.wf-align-row {
    display: flex;
    gap: 8px;
}

.wf-align-btn,
.wf-valign-btn {
    width: 36px;
    height: 36px;

    border-radius: 10px;
    border: none;

    background: #f2f3f5;
    color: #111;

    font-size: 16px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background 0.15s, color 0.15s;
}

.wf-align-btn:hover,
.wf-valign-btn:hover {
    background: #e6e7ea;
}

.wf-align-btn.active,
.wf-valign-btn.active {
    background: #000;
    color: #fff;
}



/* Обёртка */
.wf-color-field {
    position: relative;
    width: 60px;
    height: 40px;
}

/* Квадрат с цветом */
.wf-color-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--stroke);
    background: #000;
    cursor: pointer;
}

/* Настраиваем системный color picker */
.wf-color-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.builder-sidebar-left,
.builder-canvas-wrapper,
.builder-sidebar-right {
    overflow-y: auto;
    overscroll-behavior: contain;
    /* чтобы не прокручивалось то, что под ними */
}

/* Контейнер строки поворота */
.wf-field-rotate {
    position: relative;
    width: 120px;
    /* компактнее */
    margin-top: 6px;
}

/* Поле ввода поворота */
.wf-input-rotate {
    width: 100%;
    padding: 8px 28px 8px 10px;
    /* место под градусы справа */
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: var(--secondary);
    color: var(--text);
    font-size: 14px;
}

.wf-input-rotate:focus {
    border-bottom: 1px solid #3b82f6;
}

/* Значок "°" справа */
.wf-unit-rotate {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    opacity: 0.65;
    pointer-events: none;
}

/* Ряд кнопок */
.wf-z-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.wf-layer-controls {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.wf-layer-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--secondary);
    border: 1px solid var(--stroke);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.15s;
    padding: 0;
}

.wf-layer-btn img {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

.wf-layer-btn:hover {
    background: rgba(0, 0, 0, 0.07);
}

.wf-layer-btn:active {
    transform: scale(0.95);
}

.inner-tabs {
    width: 100%;
    height: 100%;
}

.tabs-header {
    display: flex;
    gap: 6px;
}

.tab-btn {
    padding: 6px 12px;
    border-radius: 6px;
    background: #f2f2f2;
}

.tab-btn.active {
    background: #000;
    color: #fff;
}

.inner-input {
    box-sizing: border-box;
    font-size: 14px;
}

.inner-accordion {
    width: 100%;
}

.accordion-item {
    margin-bottom: 6px;
}

.accordion-body {
    border: 1px solid #eee;
    border-top: none;
}

.inner-checkbox,
.inner-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.inner-tooltip {
    pointer-events: none;
}

/* Выравнивание по границе */
.canvas-element.align-match {
    outline: 2px solid #22c55e;
    outline-offset: -2px;
    z-index: 50;
    border-radius: 6px;
}

.alignment-guide {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
}

.alignment-guide.vertical {
    width: 1px;
    background: repeating-linear-gradient(to bottom,
            #2563eb,
            #2563eb 4px,
            transparent 4px,
            transparent 8px);
}

.alignment-guide.horizontal {
    height: 1px;
    background: repeating-linear-gradient(to right,
            #2563eb,
            #2563eb 4px,
            transparent 4px,
            transparent 8px);
}

#alignment-guides {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}


/* сами ручки */
.canvas-resize-handle {
    position: absolute;
    background: transparent;
    z-index: 50;
}

/* справа */
.canvas-resize-handle.right {
    top: 0;
    right: -6px;
    width: 12px;
    height: 100%;
    cursor: ew-resize;
}

/* снизу */
.canvas-resize-handle.bottom {
    left: 0;
    bottom: -6px;
    height: 12px;
    width: 100%;
    cursor: ns-resize;
}

/* угол */
.canvas-resize-handle.corner {
    right: -6px;
    bottom: -6px;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
}

/* визуальный намёк */
.canvas-resize-handle:hover {
    background: rgba(0, 0, 0, 0.05);
}



/* === Выделение любого выбранного элемента === */
.canvas-element.selected::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid #2563eb;
    pointer-events: none;
    z-index: 9999;
    box-sizing: border-box;
}

/* Стрелки для полей размера шрифта, междустрочный интервал и межбуквенный интервал */
.wf-number {
    position: relative;
    display: flex;
    align-items: center;
}

.wf-number input {
    width: 100%;
    padding-right: 34px;
}


.wf-arrows {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
}


.wf-arrows button {
    all: unset;
    width: 18px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    font-size: 10px;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
}

.wf-arrows button:hover {
    background: rgba(0, 0, 0, 0.06);
}


/* Подсветка для регистра */
.case-row {
    display: flex;
    gap: 8px;
}

.wf-case-btn {
    width: 42px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
    border: none;

    background: #f2f3f5;
    color: #111;

    font-weight: 600;
    cursor: pointer;

    transition: background 0.15s, color 0.15s;
}

.wf-case-btn:hover {
    background: #e6e7eb;
}

.wf-case-btn.active {
    background: #111;
    /* ТОТ ЖЕ СИНИЙ */
    color: #fff;
}



/* Прозрачность */
.wf-range {
    -webkit-appearance: none;
    appearance: none;

    width: 100%;
    height: 6px;
    border-radius: 999px;

    background: #e6e7eb;
    background-image: linear-gradient(#2563eb, #2563eb);
    background-repeat: no-repeat;
    background-size: 0% 100%;

    outline: none;
    cursor: pointer;
}

.wf-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2563eb;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    cursor: pointer;
}

.wf-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2563eb;
    border: none;
    cursor: pointer;
}

.wf-range::-moz-range-track {
    background: transparent;
}


/* Убираем расстояние между границей и картинкой */
.canvas-element,
.canvas-element * {
    padding: 0;
    box-sizing: border-box;
}

.canvas-element img {
    display: block;
}


/* Окно функции неактивно */
.card.disabled {
    opacity: 0.45;
    filter: grayscale(1);
    pointer-events: none;
    /* 🔥 ГЛАВНОЕ */
}

/* Страница профиля */
/* ===== ЛИМИТЫ ===== */

.profile-limits {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
}

.limits-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Одна строка лимита */
.limit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

/* разделители */
.limit-item:not(:last-child) {
    border-bottom: 1px solid var(--stroke);
}

/* число */
.limit-value {
    font-weight: 600;
}

/* если 0 — красным */
.limit-value.limit-zero {
    color: #ff4d4f;
}

/* ===== КНОПКА ОПЛАТЫ ===== */
.profile-pay {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.pay-btn {
    width: 100%;
    max-width: 320px;

    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;

    border: none;
    border-radius: 14px;

    padding: 14px 18px;
    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;

    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.pay-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.45);
}

.pay-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

.pay-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Фото загрузка ===== */

.photo-upload {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* превью картинки */
.photo-preview {
    width: 120px;
    height: 120px;
    object-fit: cover;

    background: var(--secondary);
    /* вместо чёрного */
    border-radius: 12px;
    border: 1px solid var(--stroke);
}

.photo-preview-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.photo-item {
    position: relative;
}

/* крестик */
.photo-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    line-height: 1;
    transition: transform .15s ease, background .15s ease;
}

.photo-remove:hover {
    transform: scale(1.1);
    background: #ff4d4f;
}

.content form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}