* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-main: #080a12;
    --bg-dark: #0c0f1a;
    --bg-panel: #111625;
    --bg-panel-2: #151a2b;

    --border: #252c42;
    --border-light: #323b57;

    --purple: #7c3aed;
    --purple-light: #a78bfa;
    --blue: #2563eb;
    --cyan: #38bdf8;

    --text: #f5f7ff;
    --muted: #969fb7;

    --gradient: linear-gradient(
        135deg,
        #7c3aed,
        #2563eb
    );
}


/* =========================================
   BODY
========================================= */

body {
    width: 100vw;
    height: 100vh;

    overflow: hidden;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background:
        radial-gradient(
            circle at 10% 0%,
            rgba(124, 58, 237, 0.16),
            transparent 28%
        ),
        radial-gradient(
            circle at 90% 10%,
            rgba(37, 99, 235, 0.12),
            transparent 28%
        ),
        var(--bg-main);

    color: var(--text);
}


/* =========================================
   TOP BAR
========================================= */

.topbar {
    height: 54px;

    display: flex;
    align-items: center;

    padding: 0 16px;

    background:
        linear-gradient(
            180deg,
            #111629,
            #0d111f
        );

    border-bottom: 1px solid var(--border);

    box-shadow:
        0 5px 25px rgba(0, 0, 0, 0.35);

    position: relative;

    z-index: 500;
}


/* =========================================
   BRAND
========================================= */

.brand {
    width: 180px;

    display: flex;
    align-items: center;

    gap: 10px;

    font-size: 18px;
    font-weight: 700;
}

.brand-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background:
        linear-gradient(
            135deg,
            #7c3aed,
            #2563eb
        );

    color: #ffffff;

    font-size: 18px;
    font-weight: 800;

    box-shadow:
        0 0 18px rgba(124, 58, 237, 0.50),
        0 0 35px rgba(37, 99, 235, 0.20);
}

.brand-text {
    display: flex;
    align-items: baseline;

    gap: 6px;
}

.brand-name {
    color: #ffffff;

    font-size: 19px;
    font-weight: 800;

    letter-spacing: -0.4px;
}

.brand-photo {
    font-size: 13px;
    font-weight: 700;

    letter-spacing: 0.3px;

    background:
        linear-gradient(
            90deg,
            #a78bfa,
            #38bdf8
        );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


/* =========================================
   TOP MENU
========================================= */

.menu {
    display: flex;

    gap: 3px;
}

.menu button {
    padding: 8px 12px;

    border: 1px solid transparent;

    border-radius: 6px;

    background: transparent;

    color: #b8c0d4;

    cursor: pointer;

    transition: 0.18s ease;
}

.menu button:hover {
    color: #ffffff;

    background:
        rgba(124, 58, 237, 0.13);

    border-color:
        rgba(124, 58, 237, 0.25);
}


/* =========================================
   TOP ACTIONS
========================================= */

.top-actions {
    margin-left: auto;

    display: flex;

    gap: 8px;
}

.top-actions button {
    cursor: pointer;

    font-family: inherit;
}

.btn-secondary,
.btn-primary {
    padding: 8px 16px;

    border-radius: 7px;

    font-weight: 600;

    transition: 0.18s ease;
}

.btn-secondary {
    background:
        #171c2d !important;

    border: 1px solid
        var(--border-light) !important;

    color: #dce2f1 !important;
}

.btn-secondary:hover {
    background:
        #202740 !important;

    border-color:
        rgba(124, 58, 237, 0.55) !important;
}

.btn-primary {
    background:
        linear-gradient(
            135deg,
            #7c3aed,
            #2563eb
        ) !important;

    border: none !important;

    color: #ffffff !important;

    box-shadow:
        0 5px 18px rgba(124, 58, 237, 0.30);
}

.btn-primary:hover {
    transform: translateY(-1px);

    box-shadow:
        0 8px 25px rgba(124, 58, 237, 0.48);
}


/* =========================================
   EDITOR
========================================= */

.editor {
    height: calc(100vh - 82px);

    display: flex;

    min-height: 0;
}


/* =========================================
   TOOLBAR
========================================= */

.toolbar {
    width: 82px;

    flex-shrink: 0;

    position: relative;

    display: flex;

    flex-direction: column;

    align-items: center;

    padding-top: 12px;

    gap: 7px;

    background:
        linear-gradient(
            180deg,
            #111625,
            #0d101b
        );

    border-right: 1px solid var(--border);

    box-shadow:
        5px 0 25px rgba(0, 0, 0, 0.20);
}

.tool {
    width: 50px;
    height: 50px;

    flex-shrink: 0;

    border: 1px solid transparent;

    border-radius: 8px;

    background: transparent;

    color: #aeb7cc;

    font-size: 19px;

    cursor: pointer;

    transition: 0.18s ease;
}

.tool:hover {
    background:
        rgba(124, 58, 237, 0.13);

    color: #ffffff;

    border-color:
        rgba(124, 58, 237, 0.20);
}

.tool.active {
    background:
        linear-gradient(
            135deg,
            rgba(124, 58, 237, 0.32),
            rgba(37, 99, 235, 0.18)
        );

    color: #ffffff;

    border-color:
        rgba(124, 58, 237, 0.40);

    box-shadow:
        inset 3px 0 0 #8b5cf6,
        0 0 18px rgba(124, 58, 237, 0.12);
}


/* =========================================
   TOOLBAR RESIZER
========================================= */

.toolbar-resizer {
    position: absolute;

    right: -5px;

    top: 0;
    bottom: 0;

    width: 10px;

    cursor: ew-resize;

    z-index: 9999;

    background: transparent;
}

.toolbar-resizer:hover {
    background:
        linear-gradient(
            180deg,
            #7c3aed,
            #38bdf8
        );
}


/* =========================================
   WORKSPACE
========================================= */

.workspace {
    flex: 1;

    min-width: 0;
    min-height: 0;

    display: flex;

    flex-direction: column;

    background:
        radial-gradient(
            circle at 50% 40%,
            rgba(124, 58, 237, 0.035),
            transparent 45%
        ),
        #0b0e18;
}


/* =========================================
   WORKSPACE TOP
========================================= */

.workspace-top {
    height: 42px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 15px;

    background:
        rgba(14, 18, 31, 0.96);

    border-bottom: 1px solid var(--border);

    font-size: 13px;

    color: var(--muted);
}

.zoom {
    display: flex;

    align-items: center;

    gap: 8px;
}

.zoom button {
    width: 27px;
    height: 27px;

    border: 1px solid var(--border-light);

    border-radius: 6px;

    background:
        #151b2d;

    color: #cbd3e6;

    cursor: pointer;
}

.zoom button:hover {
    background:
        #202740;

    border-color:
        rgba(124, 58, 237, 0.50);

    color: #ffffff;
}


/* =========================================
   CANVAS AREA
========================================= */

.canvas-area {
    flex: 1;

    min-width: 0;
    min-height: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: auto;

    padding: 40px;

    background-color: #080a11;

    background-image:
        linear-gradient(
            45deg,
            #111522 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #111522 25%,
            transparent 25%
        ),
        linear-gradient(
            45deg,
            transparent 75%,
            #111522 75%
        ),
        linear-gradient(
            -45deg,
            transparent 75%,
            #111522 75%
        );

    background-size: 24px 24px;

    background-position:
        0 0,
        0 12px,
        12px -12px,
        -12px 0;
}


/* =========================================
   CANVAS WRAPPER
========================================= */

.canvas-wrapper {
    flex-shrink: 0;

    position: relative;

    width: max-content;
    height: max-content;

    display: block;

    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(124, 58, 237, 0.15),
        0 0 45px rgba(37, 99, 235, 0.06);
}


/* =========================================
   CANVAS
========================================= */

canvas {
    display: block;

    flex-shrink: 0;

    background: white;

    max-width: none;
    max-height: none;

    width: auto;
    height: auto;

    object-fit: contain;

    aspect-ratio: auto;

    image-rendering: auto;
}


/* =========================================
   RIGHT PANEL
========================================= */

.right-panel {
    width: 340px;

    flex-shrink: 0;

    position: relative;

    overflow-y: auto;

    background:
        linear-gradient(
            180deg,
            #111625,
            #0d101b
        );

    border-left: 1px solid var(--border);

    color: #e8ebf5;

    box-shadow:
        -5px 0 25px rgba(0, 0, 0, 0.18);
}


/* =========================================
   RIGHT PANEL RESIZER
========================================= */

.panel-resizer {
    position: absolute;

    left: -5px;

    top: 0;
    bottom: 0;

    width: 10px;

    cursor: ew-resize;

    z-index: 9999;

    background: transparent;
}

.panel-resizer:hover {
    background:
        linear-gradient(
            180deg,
            #7c3aed,
            #38bdf8
        );
}


/* =========================================
   PANELS
========================================= */

.panel {
    padding: 15px;

    border-bottom: 1px solid var(--border);
}

.panel-title {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 15px;

    font-size: 13px;

    font-weight: 700;

    color: #eef1f9;
}

.panel-title button {
    width: 27px;
    height: 27px;

    border: 1px solid var(--border-light);

    border-radius: 6px;

    background:
        #191f33;

    color: #d5dced;

    font-size: 18px;

    cursor: pointer;
}

.panel-title button:hover {
    background:
        var(--purple);

    color: #ffffff;
}


/* =========================================
   PROPERTIES
========================================= */

.property {
    margin-bottom: 15px;
}

.property label {
    display: block;

    margin-bottom: 7px;

    font-size: 11px;

    color: #939cb2;
}

.inputs {
    display: flex;

    gap: 7px;
}

.inputs input {
    width: 50%;

    height: 32px;

    padding: 0 8px;

    border: 1px solid #293149;

    border-radius: 6px;

    background: #0c101c;

    color: #e7eaf4;

    outline: none;
}

.inputs input:focus {
    border-color: #7c3aed;

    box-shadow:
        0 0 0 2px rgba(124, 58, 237, 0.12);
}


/* =========================================
   LAYERS
========================================= */

.layer {
    height: 42px;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 0 10px;

    border: 1px solid transparent;

    border-radius: 7px;

    color: #adb6ca;

    font-size: 13px;

    cursor: pointer;
}

.layer:hover {
    background:
        rgba(124, 58, 237, 0.09);

    color: #ffffff;
}

.layer.active {
    background:
        linear-gradient(
            90deg,
            rgba(124, 58, 237, 0.20),
            rgba(37, 99, 235, 0.08)
        );

    border-color:
        rgba(124, 58, 237, 0.28);

    color: #ffffff;
}


/* =========================================
   COLOR
========================================= */

.color-box {
    position: relative;

    width: 70px;
    height: 55px;

    background: #0c101c;

    border: 1px solid #303851;

    border-radius: 8px;
}

.foreground,
.background {
    position: absolute;

    width: 38px;
    height: 38px;

    border: 2px solid white;

    border-radius: 5px;
}

.foreground {
    top: 0;
    left: 0;

    background: #000000;

    z-index: 2;
}

.background {
    top: 15px;
    left: 20px;

    background: #ffffff;
}


/* =========================================
   STATUS BAR
========================================= */

.statusbar {
    height: 28px;

    display: flex;

    align-items: center;

    gap: 25px;

    padding: 0 12px;

    background:
        linear-gradient(
            90deg,
            #0d101b,
            #111625,
            #0d101b
        );

    border-top: 1px solid var(--border);

    color: #858da5;

    font-size: 11px;
}

.statusbar span:first-child {
    color: #a78bfa;
}


/* =========================================
   NEW CANVAS MODAL
========================================= */

.canvas-modal {
    position: fixed;

    inset: 0;

    background:
        rgba(3, 5, 12, 0.76);

    backdrop-filter: blur(7px);

    display: none;

    align-items: center;

    justify-content: center;

    z-index: 1000;
}

.canvas-modal.active {
    display: flex;
}

.canvas-modal-box {
    width: 440px;

    max-width:
        calc(100vw - 40px);

    background:
        linear-gradient(
            145deg,
            #161c30,
            #0d1220
        );

    border: 1px solid #303953;

    border-radius: 13px;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.70),
        0 0 45px rgba(124, 58, 237, 0.12);

    overflow: hidden;
}

.canvas-modal-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 18px 20px;

    border-bottom: 1px solid var(--border);
}

.canvas-modal-header h2 {
    font-size: 20px;

    color: #ffffff;
}

.canvas-modal-header button {
    width: 32px;
    height: 32px;

    border: none;

    border-radius: 7px;

    background: transparent;

    color: #aab1c2;

    font-size: 26px;

    cursor: pointer;
}

.canvas-modal-header button:hover {
    background: #252c43;

    color: #ffffff;
}

.canvas-form {
    padding: 20px;
}


/* =========================================
   FORM
========================================= */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    color: #aeb7ca;

    font-size: 13px;
}

.form-group input,
.form-group select {
    width: 100%;

    height: 42px;

    padding: 0 12px;

    border: 1px solid #2c354e;

    border-radius: 7px;

    background: #0b0f1b;

    color: #eef1f8;

    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #7c3aed;

    box-shadow:
        0 0 0 2px rgba(124, 58, 237, 0.12);
}

.form-row {
    display: flex;

    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}


/* =========================================
   CREATE CANVAS BUTTON
========================================= */

.create-canvas-btn {
    width: 100%;

    height: 46px;

    margin-top: 5px;

    border: none;

    border-radius: 8px;

    background:
        linear-gradient(
            135deg,
            #7c3aed,
            #2563eb
        );

    color: #ffffff;

    font-size: 15px;

    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 8px 25px rgba(124, 58, 237, 0.28);

    transition: 0.18s ease;
}

.create-canvas-btn:hover {
    transform: translateY(-1px);

    box-shadow:
        0 11px 32px rgba(124, 58, 237, 0.45);
}


/* =========================================
   EXPORT MODAL
========================================= */

.export-modal {
    position: fixed;

    inset: 0;

    display: none;

    align-items: center;

    justify-content: center;

    background:
        rgba(3, 5, 12, 0.76);

    backdrop-filter: blur(7px);

    z-index: 9999;
}

.export-modal.active {
    display: flex;
}

.export-modal-box {
    width: 460px;

    max-width:
        calc(100vw - 40px);

    background:
        linear-gradient(
            145deg,
            #161c30,
            #0d1220
        );

    border: 1px solid #303953;

    border-radius: 14px;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.70),
        0 0 45px rgba(124, 58, 237, 0.12);

    overflow: hidden;
}

.export-modal-header {
    height: 64px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 20px;

    border-bottom: 1px solid var(--border);

    background:
        rgba(21, 27, 45, 0.95);
}

.export-modal-header h2 {
    font-size: 19px;

    color: #ffffff;
}

#closeExportModal {
    width: 34px;
    height: 34px;

    border: 0;

    border-radius: 8px;

    background: transparent;

    color: #aab1c2;

    font-size: 25px;

    cursor: pointer;
}

#closeExportModal:hover {
    background: #252c43;

    color: #ffffff;
}

.export-form {
    padding: 24px;
}

.export-info {
    margin-bottom: 22px;

    padding: 14px 15px;

    border: 1px solid
        rgba(124, 58, 237, 0.22);

    border-radius: 9px;

    background:
        linear-gradient(
            135deg,
            rgba(124, 58, 237, 0.08),
            rgba(37, 99, 235, 0.06)
        );

    color: #aeb7ca;

    font-size: 12px;

    line-height: 1.6;
}

.export-info strong {
    display: block;

    margin-bottom: 6px;

    color: #c4b5fd;

    font-size: 13px;
}

#exportQualityValue {
    color: #a78bfa;

    font-weight: 700;
}

#exportQuality {
    width: 100%;

    accent-color: #7c3aed;

    cursor: pointer;
}


/* =========================================
   SCROLLBAR
========================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0b0e17;
}

::-webkit-scrollbar-thumb {
    background: #2d3650;

    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a5678;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1100px) {

    .right-panel {
        width: 300px;
    }

    .brand {
        width: 150px;
    }

    .menu button {
        padding: 7px 9px;
    }
}

@media (max-width: 900px) {

    .right-panel {
        width: 250px;
    }

    .toolbar {
        width: 72px;
    }

    .tool {
        width: 46px;
        height: 46px;
    }

    .brand {
        width: 130px;
    }

    .menu button {
        padding: 7px;
    }
}

@media (max-width: 700px) {

    .right-panel {
        width: 220px;
    }

    .toolbar {
        width: 64px;
    }

    .tool {
        width: 42px;
        height: 42px;
    }

    .brand {
        width: 100px;
    }

    .menu button {
        padding: 6px;
        font-size: 12px;
    }
}


/* ==========================================
   KRELYVO - FILE MENU
========================================== */

.file-menu {
    position: fixed;

    top: 58px;
    left: 70px;

    min-width: 220px;

    background: #171a25;

    border: 1px solid #34394d;

    border-radius: 10px;

    padding: 7px;

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.55);

    z-index: 99999;

    display: none;
}

.file-menu.active {
    display: block;
}


/* ==========================================
   FILE MENU ITEM
========================================== */

.file-menu-item {
    position: relative;

    display: flex;

    align-items: center;

    justify-content: space-between;

    min-height: 38px;

    padding: 0 12px;

    color: #e8eaf2;

    font-size: 14px;

    border-radius: 7px;

    cursor: pointer;

    user-select: none;
}

.file-menu-item:hover {
    background: #282d40;

    color: #ffffff;
}

.file-menu-item.disabled {
    color: #666b7d;

    cursor: default;
}

.file-menu-item.disabled:hover {
    background: transparent;
}


/* ==========================================
   ARROW
========================================== */

.file-menu-arrow {
    margin-left: 30px;

    color: #858ba0;
}


/* ==========================================
   SUBMENU
   AYRI KUTU
========================================== */

.file-submenu {
    position: absolute;

    left: 100%;

    top: 0;

    width: 170px;

    min-width: 170px;

    padding: 7px;

    background: #171a25;

    border: 1px solid #34394d;

    border-radius: 10px;

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.55);

    display: none;

    z-index: 100000;
}


/* ==========================================
   SUBMENU OPEN
========================================== */

.file-menu-item.has-submenu:hover > .file-submenu {
    display: block;
}


/* ==========================================
   INVISIBLE BRIDGE
========================================== */

.file-menu-item.has-submenu::after {
    content: "";

    position: absolute;

    top: 0;

    right: -2px;

    width: 4px;

    height: 100%;

    background: transparent;

    z-index: 100001;
}


/* ==========================================
   SUBMENU BUTTONS
========================================== */

.file-submenu button {
    width: 100%;

    height: 38px;

    padding: 0 12px;

    margin: 0;

    border: none;

    outline: none;

    background: transparent;

    color: #e8eaf2;

    font-family: inherit;

    font-size: 14px;

    text-align: left;

    border-radius: 7px;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: flex-start;

    box-sizing: border-box;
}

.file-submenu button:hover {
    background: #282d40;

    color: #ffffff;
}

.file-submenu button:active {
    background: #343a52;
}


/* ==========================================
   DIVIDER
========================================== */

.file-divider {
    height: 1px;

    background: #303548;

    margin: 6px 4px;
}


/* ==========================================
   SHORTCUT
========================================== */

.file-shortcut {
    margin-left: 30px;

    color: #777d91;

    font-size: 12px;
}


/* ==========================================
   MAIN FILE MENU BUTTONS
========================================== */

.file-menu > button {
    width: 100%;

    min-height: 38px;

    padding: 0 12px;

    margin: 0;

    border: none;

    outline: none;

    background: transparent;

    color: #e8eaf2;

    font-family: inherit;

    font-size: 14px;

    text-align: left;

    border-radius: 7px;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: space-between;

    box-sizing: border-box;
}

.file-menu > button:hover {
    background: #282d40;

    color: #ffffff;
}

.file-menu > button:active {
    background: #343a52;
}

.file-menu > .file-divider {
    width: 100%;

    height: 1px;

    margin: 6px 0;

    background: #303548;
}
/* =====================================================
   KRELYVO - NEW DOCUMENT WINDOW
===================================================== */

.new-document-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.72);

    backdrop-filter: blur(8px);
}


.new-document-window {
    width: min(900px, 92vw);
    max-height: 88vh;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            #15182a,
            #0d101c
        );

    border: 1px solid rgba(124, 58, 237, 0.35);

    border-radius: 18px;

    box-shadow:
        0 30px 100px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(124, 58, 237, 0.12);

    color: white;
}


.new-document-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 22px 24px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.08);
}


.new-document-title {
    font-size: 21px;
    font-weight: 700;
}


.new-document-subtitle {
    margin-top: 5px;

    color: #8f96aa;

    font-size: 13px;
}


.new-document-close {
    width: 36px;
    height: 36px;

    border: 0;
    border-radius: 9px;

    background: rgba(255,255,255,0.06);

    color: #b8bfd2;

    font-size: 24px;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.new-document-close:hover {
    background: rgba(239, 68, 68, 0.18);
    color: white;
}


.new-document-content {
    padding: 24px;

    overflow-y: auto;

    max-height: calc(88vh - 90px);
}


.new-document-section-title {
    margin-bottom: 16px;

    color: #c8cce0;

    font-size: 13px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.08em;
}


.new-document-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;
}


.new-document-card {
    min-height: 190px;

    padding: 16px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;

    border-radius: 14px;

    background:
        rgba(255, 255, 255, 0.035);

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    cursor: pointer;

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}


.new-document-card:hover {
    transform: translateY(-4px);

    background:
        rgba(124, 58, 237, 0.10);

    border-color:
        rgba(124, 58, 237, 0.75);

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, 0.3),
        0 0 25px
        rgba(124, 58, 237, 0.12);
}


.document-preview {
    height: 100px;

    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
}


.document-preview div {
    background: white;

    border-radius: 3px;

    box-shadow:
        0 5px 15px
        rgba(0, 0, 0, 0.35);
}


.document-preview.portrait div {
    width: 58px;
    height: 82px;
}


.document-preview.landscape div {
    width: 82px;
    height: 58px;
}


.document-preview.portrait.small div {
    width: 52px;
    height: 74px;
}


.document-preview.landscape.small div {
    width: 74px;
    height: 52px;
}


.document-preview.landscape.wide div {
    width: 88px;
    height: 50px;
}


.document-card-info {
    width: 100%;

    text-align: center;
}


.document-card-info strong {
    display: block;

    color: #f4f5f8;

    font-size: 14px;
}


.document-card-info span {
    display: block;

    margin-top: 5px;

    color: #858ca1;

    font-size: 11px;
}


.custom-document-icon {
    width: 82px;
    height: 100px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #8b7cf6;

    font-size: 48px;
    font-weight: 200;
}


.custom-document-form {
    padding: 20px 5px;
}


.custom-input-row {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 18px;

    margin-top: 24px;
}


.custom-input-group {
    display: flex;
    flex-direction: column;

    gap: 8px;
}


.custom-input-group label {
    color: #aab0c1;

    font-size: 13px;
}


.custom-input-group input {
    width: 100%;

    box-sizing: border-box;

    padding: 13px 14px;

    border: 1px solid
        rgba(255,255,255,0.1);

    border-radius: 9px;

    background: #0a0d16;

    color: white;

    outline: none;

    font-size: 14px;
}


.custom-input-group input:focus {
    border-color: #7c3aed;

    box-shadow:
        0 0 0 3px
        rgba(124, 58, 237, 0.12);
}


.custom-document-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 28px;
}


.custom-document-actions button {
    border: 0;

    border-radius: 9px;

    padding: 11px 18px;

    cursor: pointer;

    font-size: 13px;
}


.custom-cancel-button {
    background:
        rgba(255,255,255,0.07);

    color: #c7cada;
}


.custom-create-button {
    background:
        linear-gradient(
            135deg,
            #7c3aed,
            #4f46e5
        );

    color: white;
}


@media (max-width: 760px) {

    .new-document-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 480px) {

    .new-document-grid {
        grid-template-columns:
            1fr;
    }

}
/* ==========================================
   KRELYVO - LAYERS PANEL BOYUTU
   ========================================== */

.right-panel {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
}

.layers-panel {
    height: 260px;
    min-height: 260px;
    max-height: 260px;
    overflow: hidden;
}

.layers-panel .layers {
    height: 210px;
    max-height: 210px;
    overflow-y: auto;
    overflow-x: hidden;
}

.layers-panel .panel-title {
    height: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.layers-panel .layer {
    min-height: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
}
/* ==========================================
   KRELYVO - MOBİL UYUMLULUK
   ========================================== */

@media (max-width: 768px) {

    html,
    body {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .topbar {
        height: 56px;
        padding: 0 10px;
    }

    .brand-text {
        display: none;
    }

    .brand-icon {
        margin-right: 5px;
    }

    .menu {
        gap: 2px;
        overflow-x: auto;
        flex: 1;
    }

    .menu button {
        padding: 7px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    .top-actions {
        gap: 4px;
    }

    .top-actions .btn-secondary {
        display: none;
    }

    .top-actions .btn-primary {
        padding: 7px 10px;
        font-size: 12px;
    }

    .editor {
        position: relative;
        display: flex;
        height: calc(100vh - 86px);
    }

    .toolbar {
        width: 48px;
        min-width: 48px;
        max-width: 48px;
    }

    .toolbar .tool {
        width: 40px;
        height: 40px;
        margin: 4px auto;
    }

    .workspace {
        min-width: 0;
        flex: 1;
        width: calc(100% - 48px);
    }

    .workspace-top {
        height: 42px;
        padding: 0 8px;
        overflow: hidden;
    }

    .workspace-top > span {
        display: none;
    }

    .zoom {
        margin-left: auto;
    }

    .canvas-area {
        width: 100%;
        height: calc(100% - 42px);
        overflow: auto;
    }

    .canvas-wrapper {
        min-width: 100%;
        min-height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .right-panel {
        display: none;
    }

    .statusbar {
        height: 30px;
        font-size: 11px;
        padding: 0 8px;
    }

    .canvas-modal-box,
    .export-modal-box {
        width: calc(100% - 24px);
        max-width: 420px;
        max-height: calc(100vh - 30px);
        overflow-y: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .form-group {
        width: 100%;
    }

}


/* ==========================================
   KÜÇÜK TELEFONLAR
   ========================================== */

@media (max-width: 480px) {

    .topbar {
        height: 52px;
    }

    .menu button {
        font-size: 11px;
        padding: 6px;
    }

    .top-actions .btn-primary {
        font-size: 11px;
        padding: 6px 8px;
    }

    .toolbar {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
    }

    .workspace {
        width: calc(100% - 44px);
    }

    .toolbar .tool {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

}
/* Layout refinements preserve desktop sizing and expose panels on small screens. */
.editor { height: calc(100dvh - 82px); }
.right-panel { min-width: 220px; max-width: 480px; }
.layers-panel { height: auto; min-height: 260px; max-height: none; overflow: visible; }
.layers-panel .layers { height: auto; min-height: 84px; max-height: 260px; }
.text-properties-panel { padding-top: 16px; }
.text-properties-header, .text-property-group { margin-bottom: 12px; }
.text-property-group label { display: block; margin-bottom: 5px; font-size: 12px; }
.text-property-group input, .text-property-group select { width: 100%; padding: 7px; background: #0c101c; color: #eef1f8; border: 1px solid #303953; border-radius: 5px; }
.text-property-group button { padding: 8px 12px; color: #eef1f8; border: 1px solid #303953; border-radius: 5px; }
.layer-name { overflow: hidden; text-overflow: ellipsis; flex: 1; white-space: nowrap; }
.layer-visibility, .layer-lock { color: #cbd3e6; background: transparent; border: 0; cursor: pointer; }
#layerOpacity { width: 100%; }
#projectTabs { min-width: 0; overflow-x: auto; flex-shrink: 1; }
#projectTabs button { flex-shrink: 0; }
.zoom { flex-shrink: 0; }
#zoomFit { width: 54px; }
.canvas-area { justify-content: flex-start; align-items: flex-start; }
.canvas-wrapper { margin: auto; min-width: 0; min-height: 0; }
#canvas {
    display: block;
    background: #ffffff;
    touch-action: none;
}

.tool-options[hidden] {
    display: none;
}

.brush-tool-options {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    color: #cbd3e6;
    font-size: 12px;
}

.brush-tool-options input {
    width: 64px;
    padding: 5px 7px;
    border: 1px solid #303953;
    border-radius: 5px;
    background: #0c101c;
    color: #eef1f8;
}

.krelyvo-gradient-preview {
    position: fixed;
    z-index: 2147482500;
    height: 2px;
    pointer-events: none;
    transform-origin: 0 50%;
    background: #ffffff;
    box-shadow: 0 0 0 1px #111625, 0 0 6px rgba(0,0,0,.7);
}

.krelyvo-gradient-preview::before,
.krelyvo-gradient-preview::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    border: 1px solid #111625;
    border-radius: 50%;
    background: #ffffff;
    transform: translate(-50%,-50%);
}

.krelyvo-gradient-preview::after { left: 100%; }

.canvas-area.krelyvo-hand-active,
.canvas-area.krelyvo-hand-active #canvas {
    cursor: grab;
}

.canvas-area.krelyvo-hand-panning,
.canvas-area.krelyvo-hand-panning #canvas {
    cursor: grabbing;
    user-select: none;
}

/* Crop overlay uses screen coordinates while document geometry remains in canvas pixels. */
.krelyvo-crop-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
}

.krelyvo-crop-overlay[hidden] {
    display: none;
}

.krelyvo-crop-shade,
.krelyvo-crop-box,
.krelyvo-crop-actions {
    position: fixed;
    box-sizing: border-box;
}

.krelyvo-crop-shade {
    background: rgba(0, 0, 0, 0.58);
}

.krelyvo-crop-box {
    border: 1px solid #ffffff;
    outline: 1px solid rgba(0, 0, 0, 0.9);
    cursor: move;
    pointer-events: auto;
}

.krelyvo-crop-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, transparent 33.333%, rgba(255,255,255,0.55) 33.333%, rgba(255,255,255,0.55) calc(33.333% + 1px), transparent calc(33.333% + 1px), transparent 66.666%, rgba(255,255,255,0.55) 66.666%, rgba(255,255,255,0.55) calc(66.666% + 1px), transparent calc(66.666% + 1px)),
        linear-gradient(to bottom, transparent 33.333%, rgba(255,255,255,0.55) 33.333%, rgba(255,255,255,0.55) calc(33.333% + 1px), transparent calc(33.333% + 1px), transparent 66.666%, rgba(255,255,255,0.55) 66.666%, rgba(255,255,255,0.55) calc(66.666% + 1px), transparent calc(66.666% + 1px));
}

.krelyvo-crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    padding: 0;
    border: 1px solid #111625;
    border-radius: 2px;
    background: #ffffff;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.krelyvo-crop-handle-top-left { left: 0; top: 0; cursor: nwse-resize; }
.krelyvo-crop-handle-top { left: 50%; top: 0; cursor: ns-resize; }
.krelyvo-crop-handle-top-right { left: 100%; top: 0; cursor: nesw-resize; }
.krelyvo-crop-handle-right { left: 100%; top: 50%; cursor: ew-resize; }
.krelyvo-crop-handle-bottom-right { left: 100%; top: 100%; cursor: nwse-resize; }
.krelyvo-crop-handle-bottom { left: 50%; top: 100%; cursor: ns-resize; }
.krelyvo-crop-handle-bottom-left { left: 0; top: 100%; cursor: nesw-resize; }
.krelyvo-crop-handle-left { left: 0; top: 50%; cursor: ew-resize; }

.krelyvo-crop-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: #111625;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    color: var(--text);
    pointer-events: auto;
}

.krelyvo-crop-size {
    min-width: 92px;
    padding: 0 5px;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.krelyvo-crop-actions button {
    padding: 6px 9px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: #191f33;
    color: var(--text);
    cursor: pointer;
}

.krelyvo-crop-actions .krelyvo-crop-apply {
    border-color: transparent;
    background: var(--gradient);
}
#panelsToggle { display: none; }
.panels-hidden .right-panel { display: none; }
.file-menu { max-width: calc(100vw - 16px); }
@media (max-width: 768px) {
    .brand { width: 40px; flex-shrink: 0; }
    .topbar { height: 56px; }
    .editor { height: calc(100dvh - 86px); }
    .toolbar { overflow-y: auto; }
    .toolbar-resizer, .panel-resizer { display: none; }
    #panelsToggle { display: block; padding: 5px; background: #171c2d; color: #fff; border: 1px solid #323b57; border-radius: 5px; }
    .panels-open .right-panel { display: block; position: absolute; right: 0; top: 42px; bottom: 0; width: min(280px,85vw) !important; min-width: 0; z-index: 600; }
    .workspace { width: auto; }
    .canvas-wrapper { display: block; }
    .canvas-area { padding: 20px; }
    .statusbar { gap: 10px; }
    .statusbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .file-submenu { position: static; width: 100%; min-width: 0; box-shadow: none; }
    .file-menu-item.has-submenu { flex-wrap: wrap; }
}

/* ==========================================
   PROFESSIONAL TOOLBAR — PHASE 1
========================================== */

.toolbar {
    width: 82px;
    min-width: 64px;
    display: grid;
    grid-template-columns: repeat(2, 36px);
    grid-auto-rows: 36px;
    align-content: start;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}

.toolbar-symbols {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.toolbar::-webkit-scrollbar {
    display: none;
}

.toolbar .tool {
    width: 36px;
    height: 36px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #aeb7cc;
}

.toolbar .tool svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.toolbar .tool:hover:not(:disabled) {
    background: rgba(124, 58, 237, 0.16);
    border-color: rgba(124, 58, 237, 0.32);
}

.toolbar .tool.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.46), rgba(37, 99, 235, 0.24));
    border-color: rgba(167, 139, 250, 0.62);
    box-shadow: inset 2px 0 0 #a78bfa, 0 0 14px rgba(124, 58, 237, 0.2);
}

.toolbar .tool:focus-visible,
.toolbar-color:focus-within {
    outline: 2px solid var(--purple-light);
    outline-offset: 1px;
}

.toolbar .tool:disabled,
.toolbar .tool[data-placeholder="true"] {
    opacity: 0.38;
    cursor: not-allowed;
    filter: saturate(0.45);
}

.toolbar-separator {
    grid-column: 1 / -1;
    width: calc(100% - 8px);
    height: 1px;
    align-self: center;
    justify-self: center;
    background: linear-gradient(90deg, transparent, rgba(150, 159, 183, 0.34), transparent);
}

.toolbar-colors {
    grid-column: 1 / -1;
    position: relative;
    width: 50px;
    height: 44px;
    justify-self: center;
}

.toolbar-color {
    position: absolute;
    display: block;
    width: 29px;
    height: 29px;
    overflow: hidden;
    border: 2px solid #d8deed;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.toolbar-color-background {
    right: 2px;
    bottom: 1px;
}

.toolbar-color-foreground {
    left: 2px;
    top: 1px;
    z-index: 2;
}

.toolbar-color input[type="color"] {
    width: 40px;
    height: 40px;
    margin: -6px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    .toolbar {
        width: 48px;
        min-width: 48px;
        max-width: 48px;
        grid-template-columns: 36px;
        grid-auto-rows: 36px;
        padding-inline: 6px;
    }

    .toolbar-separator,
    .toolbar-colors {
        grid-column: 1;
    }

    .toolbar-colors {
        transform: scale(0.82);
    }
}

/* ==========================================
   SLICE / SLICE SELECT
========================================== */

.krelyvo-slice-overlay {
    position: fixed;
    inset: 0;
    z-index: 640;
    pointer-events: none;
}

.krelyvo-slice-box {
    position: fixed;
    pointer-events: none;
    border: 1px solid #38bdf8;
    background: rgba(56, 189, 248, 0.055);
    box-shadow: 0 0 0 1px rgba(8, 10, 18, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.krelyvo-slice-overlay.select-mode .krelyvo-slice-box:not(.preview) {
    pointer-events: auto;
    cursor: move;
}

.krelyvo-slice-box.selected {
    z-index: 2;
    border-color: #a78bfa;
    background: rgba(124, 58, 237, 0.1);
    box-shadow: 0 0 0 1px #ffffff, 0 0 14px rgba(124, 58, 237, 0.45);
}

.krelyvo-slice-box.preview {
    z-index: 3;
    pointer-events: none !important;
    border-style: dashed;
    border-color: #ffffff;
    background: rgba(56, 189, 248, 0.12);
}

.krelyvo-slice-label {
    position: absolute;
    top: 0;
    left: 0;
    min-width: 20px;
    height: 19px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 5px 0;
    background: #0ea5e9;
    color: #ffffff;
    font: 700 11px/1 Arial, sans-serif;
    pointer-events: none;
}

.krelyvo-slice-box.selected .krelyvo-slice-label {
    background: #7c3aed;
}

.krelyvo-slice-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid #4c1d95;
    background: #ffffff;
    border-radius: 2px;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.krelyvo-slice-handle-top-left { left: 0; top: 0; cursor: nwse-resize; }
.krelyvo-slice-handle-top { left: 50%; top: 0; cursor: ns-resize; }
.krelyvo-slice-handle-top-right { left: 100%; top: 0; cursor: nesw-resize; }
.krelyvo-slice-handle-right { left: 100%; top: 50%; cursor: ew-resize; }
.krelyvo-slice-handle-bottom-right { left: 100%; top: 100%; cursor: nwse-resize; }
.krelyvo-slice-handle-bottom { left: 50%; top: 100%; cursor: ns-resize; }
.krelyvo-slice-handle-bottom-left { left: 0; top: 100%; cursor: nesw-resize; }
.krelyvo-slice-handle-left { left: 0; top: 50%; cursor: ew-resize; }

.krelyvo-slice-export {
    position: absolute;
    right: 4px;
    top: 4px;
    padding: 4px 7px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 5px;
    background: rgba(12, 16, 28, 0.9);
    color: #ffffff;
    font: 600 10px/1 Arial, sans-serif;
    cursor: pointer;
    pointer-events: auto;
}

.krelyvo-slice-export:hover {
    background: #7c3aed;
}
#krelyvo-lasso-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2147483647;
    pointer-events: none;
    overflow: visible;
}

#krelyvo-lasso-overlay[hidden] {
    display: none;
}

#krelyvo-lasso-overlay path {
    fill: rgba(80, 140, 255, 0.05);
    vector-effect: non-scaling-stroke;
}

#krelyvo-lasso-overlay .krelyvo-lasso-shadow {
    stroke: #000;
    stroke-width: 2;
}

#krelyvo-lasso-overlay .krelyvo-lasso-ants {
    stroke: #fff;
    stroke-width: 1;
    stroke-dasharray: 5 5;
    animation: krelyvo-lasso-march 0.6s linear infinite;
}

@keyframes krelyvo-lasso-march {
    to { stroke-dashoffset: -10; }
}
#krelyvo-magic-wand-overlay {
    position: fixed;
    z-index: 2147483647;
    pointer-events: none;
    overflow: visible;
    transform-origin: center center;
}

#krelyvo-magic-wand-overlay[hidden] {
    display: none;
}

#krelyvo-magic-wand-overlay path {
    fill: none;
    vector-effect: non-scaling-stroke;
}

#krelyvo-magic-wand-overlay .krelyvo-wand-shadow {
    stroke: #000;
    stroke-width: 2;
}

#krelyvo-magic-wand-overlay .krelyvo-wand-ants {
    stroke: #fff;
    stroke-width: 1;
    stroke-dasharray: 5 5;
    animation: krelyvo-wand-march 0.6s linear infinite;
}

@keyframes krelyvo-wand-march {
    to { stroke-dashoffset: -10; }
}
#krelyvo-healing-source-marker {
    position: fixed;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 1px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #000;
    z-index: 2147483647;
    pointer-events: none;
}

#krelyvo-healing-source-marker::before,
#krelyvo-healing-source-marker::after {
    content: "";
    position: absolute;
    background: #fff;
    box-shadow: 0 0 0 1px #000;
}

#krelyvo-healing-source-marker::before {
    left: 7px;
    top: -4px;
    width: 1px;
    height: 22px;
}

#krelyvo-healing-source-marker::after {
    left: -4px;
    top: 7px;
    width: 22px;
    height: 1px;
}

#krelyvo-healing-source-marker[hidden] {
    display: none;
}

#krelyvo-clone-source-marker {
    position: fixed; width: 16px; height: 16px; margin: -8px 0 0 -8px;
    z-index: 10040; pointer-events: none; border: 1px solid #fff;
    border-radius: 50%; box-shadow: 0 0 0 1px #000;
}
#krelyvo-clone-source-marker::before, #krelyvo-clone-source-marker::after {
    content: ""; position: absolute; background: #fff; box-shadow: 0 0 0 1px #000;
}
#krelyvo-clone-source-marker::before { left: 7px; top: -4px; width: 1px; height: 22px; }
#krelyvo-clone-source-marker::after { left: -4px; top: 7px; width: 22px; height: 1px; }
#krelyvo-clone-source-marker[hidden] { display: none; }

/* ==========================================
   QUICK ACTIONS + RESPONSIVE MOBILE SHELL
========================================== */

#mobileMenuToggle,
.mobile-panel-header {
    display: none;
}

.quick-actions-panel {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-actions-heading {
    margin-bottom: 12px;
}

.quick-actions-badge {
    padding: 3px 6px;
    border: 1px solid rgba(167, 139, 250, 0.28);
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.1);
    color: #b9a7ff;
    font-size: 9px;
    letter-spacing: 0.08em;
}

.smart-edit-row {
    display: grid;
    gap: 7px;
    padding: 0 0 12px;
}

.smart-edit-row > label {
    color: #b8bdca;
    font-size: 12px;
    font-weight: 600;
}

.smart-edit-controls {
    display: flex;
    gap: 6px;
}

.smart-edit-controls input,
.quick-modal input,
.quick-modal select {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    min-height: 38px;
    border: 1px solid #454b59;
    border-radius: 7px;
    background: #242832;
    color: #f7f8fb;
    padding: 8px 10px;
    font: inherit;
    color-scheme: dark;
    outline: none;
}

.smart-edit-controls input {
    flex: 1;
}

.smart-edit-controls button,
.quick-modal button {
    box-sizing: border-box;
    appearance: none;
    min-height: 38px;
    border: 1px solid #4d5362;
    border-radius: 7px;
    background: #303541;
    color: #fff;
    padding: 7px 12px;
    cursor: pointer;
    font: inherit;
}

.smart-edit-controls button:hover,
.quick-modal button:hover {
    border-color: #686f80;
    background: #3a404e;
}

.quick-action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 0;
}

.quick-action {
    position: relative;
    min-height: 54px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #3d4350;
    border-radius: 9px;
    background: #252a34;
    color: #f4f6fb;
    padding: 9px 11px;
    text-align: left;
    cursor: pointer;
    appearance: none;
    font: inherit;
}

.quick-action:not(:disabled):hover,
.quick-action:not(:disabled):focus-visible,
.quick-action.is-previewing {
    border-color: #8b5cf6;
    background: #30274a;
}

.quick-action-icon {
    flex: 0 0 22px;
    text-align: center;
    color: #a78bfa;
    font-size: 18px;
    line-height: 1;
}

.quick-action-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.quick-action-copy strong {
    color: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
}

.quick-action small {
    color: #9ca3af;
    font-size: 10px;
    line-height: 1.25;
}

.quick-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.quick-actions-helper {
    margin: 8px 1px 12px;
    color: #929aaa;
    font-size: 10px;
    line-height: 1.4;
}

.quick-actions-coming-soon {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 7px;
    color: #747d90;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.quick-actions-coming-soon::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
}

.quick-action-grid-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-action-grid-secondary .quick-action {
    min-height: 68px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
}

.quick-actions-status {
    min-height: 16px;
    margin: 0;
    padding: 9px 1px 0;
    color: #aeb5c2;
    font-size: 11px;
    line-height: 1.35;
}

.quick-actions-status.is-error {
    color: #fca5a5;
}

.quick-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 7, 12, 0.66);
    backdrop-filter: blur(5px);
}

.quick-modal-window {
    width: min(420px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    display: grid;
    gap: 15px;
    border: 1px solid #464c5a;
    border-radius: 13px;
    background: linear-gradient(145deg, #181d2c, #101521);
    color: #f6f7fa;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
    padding: 20px;
    font-family: inherit;
}

.quick-modal-heading,
.quick-modal-actions,
.quick-size-grid {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-modal-heading {
    justify-content: space-between;
}

.quick-modal-heading h2,
.quick-modal-window p {
    margin: 0;
}

.quick-modal-heading h2 {
    font-size: 19px;
    font-weight: 700;
}

.quick-modal-heading button {
    min-width: 38px;
    padding: 0;
    font-size: 22px;
    background: transparent;
    color: #aab1c2;
}

.quick-modal-heading button:hover {
    border-color: transparent;
    background: #252c43;
    color: #ffffff;
}

.quick-modal-window > label,
.quick-size-grid label {
    flex: 1;
    display: grid;
    gap: 6px;
    color: #c7ccd6;
    font-size: 12px;
}

.quick-modal-window p {
    color: #aeb5c2;
    font-size: 12px;
    line-height: 1.45;
}

.quick-check {
    grid-template-columns: auto 1fr !important;
    align-items: center;
}

.quick-check input {
    width: 18px;
    height: 18px;
    min-height: auto;
    padding: 0;
    accent-color: #7c3aed;
}

.quick-modal-actions {
    justify-content: flex-end;
}

.quick-modal-actions .btn-primary {
    border-color: #7c3aed;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    font-weight: 700;
}

.quick-actions-panel button:focus-visible,
.quick-actions-panel input:focus-visible,
.quick-modal button:focus-visible,
.quick-modal input:focus-visible,
.quick-modal select:focus-visible {
    outline: 2px solid #a78bfa;
    outline-offset: 2px;
}

.social-resize-error {
    margin-top: -5px !important;
    color: #fca5a5 !important;
}

.social-resize-error:empty {
    display: none;
}

@media (max-width: 768px) {
    .topbar {
        position: relative;
        z-index: 700;
        min-height: 56px;
        padding: 0 8px;
    }

    .brand {
        flex: 0 0 auto;
    }

    .menu {
        display: none !important;
        position: absolute;
        top: calc(100% + 4px);
        left: 8px;
        right: 8px;
        z-index: 720;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        border: 1px solid #444a57;
        border-radius: 10px;
        background: #1d212a;
        box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
        padding: 8px;
    }

    body.mobile-menu-open .menu {
        display: grid !important;
    }

    .menu button,
    #mobileMenuToggle,
    .top-actions > button {
        min-width: 44px;
        min-height: 44px;
    }

    #mobileMenuToggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        border: 0;
        background: transparent;
        color: #fff;
        padding: 0 7px;
    }

    #mobileMenuToggle span:last-child {
        font-size: 11px;
    }

    .top-actions {
        margin-left: auto;
        gap: 3px;
    }

    .top-actions .btn-secondary {
        display: inline-flex !important;
    }

    #openButton,
    #exportButton,
    #panelsToggle {
        padding-left: 9px;
        padding-right: 9px;
        font-size: 12px;
    }

    .editor {
        position: relative;
        min-width: 0;
        padding-bottom: 58px;
    }

    .workspace {
        min-width: 0;
        width: 100% !important;
    }

    .workspace-top {
        min-height: 42px;
        overflow-x: auto;
    }

    .canvas-area {
        padding: 12px !important;
        overscroll-behavior: contain;
    }

    .canvas-wrapper {
        max-width: 100%;
        max-height: 100%;
    }

    .toolbar {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        z-index: 650;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 58px !important;
        min-height: 58px;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: flex-start !important;
        align-content: center;
        gap: 3px;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        border-top: 1px solid #414755;
        border-right: 0 !important;
        padding: 5px 7px !important;
        scrollbar-width: thin;
    }

    .toolbar button,
    .tool-button,
    .tool-btn {
        flex: 0 0 44px !important;
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
    }

    .toolbar .tool {
        flex: 0 0 44px !important;
        margin: 0 !important;
    }

    .toolbar-colors {
        flex: 0 0 50px;
        transform: scale(0.82);
    }

    .toolbar-separator {
        flex: 0 0 1px;
        width: 1px !important;
        height: 30px !important;
        margin: 0 3px !important;
    }

    .mobile-panel-header {
        position: sticky;
        top: 0;
        z-index: 3;
        min-height: 48px;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        border-bottom: 1px solid #404654;
        background: #20242d;
        padding: 8px 12px;
    }

    .mobile-panel-grip {
        position: absolute;
        left: 50%;
        top: 5px;
        width: 42px;
        height: 4px;
        border-radius: 3px;
        background: #5c6270;
        transform: translateX(-50%);
    }

    #mobilePanelsClose {
        width: 40px;
        height: 40px;
        border: 0;
        background: transparent;
        color: #fff;
        font-size: 24px;
    }

    body.panels-open .right-panel {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 58px !important;
        z-index: 680 !important;
        width: 100% !important;
        max-width: none !important;
        height: min(62vh, 560px) !important;
        display: block !important;
        overflow-y: auto !important;
        border: 1px solid #444a57;
        border-bottom: 0;
        border-radius: 15px 15px 0 0;
        background: #20242d;
        box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.55);
    }

    .right-panel .panel-resizer {
        display: none !important;
    }

    .quick-action-grid {
        grid-template-columns: 1fr;
    }

    .quick-action-grid-secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-content,
    .export-modal-content,
    .canvas-modal-content,
    .quick-modal-window {
        width: calc(100vw - 16px) !important;
        max-width: 460px !important;
        max-height: calc(100dvh - 16px) !important;
        overflow-y: auto !important;
    }

    .quick-modal {
        align-items: flex-end;
        padding: 0;
    }

    .quick-modal-window {
        border-radius: 15px 15px 0 0;
        padding: 18px 16px max(18px, env(safe-area-inset-bottom));
    }

    .quick-modal input,
    .quick-modal select,
    .quick-modal button {
        min-height: 44px;
    }

    [data-adjustment-dialog="true"] {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: min(46dvh, 430px) !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        border-radius: 15px 15px 0 0 !important;
        padding: 12px 16px max(12px, env(safe-area-inset-bottom)) !important;
    }

    [data-adjustment-drag-handle="true"] {
        cursor: default !important;
        touch-action: auto !important;
        margin-bottom: 8px !important;
        font-size: 18px !important;
    }

    [data-adjustment-dialog="true"] > [data-adjustment-drag-handle="true"] + div {
        margin-bottom: 8px !important;
        font-size: 12px !important;
    }

    [data-adjustment-dialog="true"] > label:has(input[data-adjustment]) {
        gap: 4px 8px !important;
        margin: 7px 0 !important;
    }

    [data-adjustment-dialog="true"] input[data-adjustment] {
        min-height: 30px;
        touch-action: pan-x;
    }

    [data-adjustment-dialog="true"] > div:has([data-adjustment-action]) {
        position: sticky;
        bottom: -12px;
        z-index: 2;
        min-height: 48px;
        margin-top: 8px !important;
        padding: 6px 0 max(6px, env(safe-area-inset-bottom));
        background: #1e1e1e;
    }

    [data-adjustment-dialog="true"] [data-adjustment-action] {
        min-height: 40px;
    }
}

@media (max-width: 390px) {
    .brand-icon {
        width: 34px;
        height: 34px;
    }

    #mobileMenuToggle span:last-child,
    #panelsToggle {
        font-size: 0;
    }

    #panelsToggle::before {
        content: "▤";
        font-size: 19px;
    }

    #openButton,
    #exportButton {
        padding-left: 7px;
        padding-right: 7px;
    }
}
