:root {
    --white: #1c1c1e;
    --g50: #000000;
    --g100: #000000;
    --g200: rgba(255, 255, 255, 0.08);
    --g300: #3a3a3c;
    --g400: #86868b;
    --g500: #86868b;
    --g600: #aeaeb2;
    --g700: #f5f5f7;
    --g800: #f5f5f7;
    --g900: #1c1c1e;
    --accent: #2997ff;
    --accent-l: #409cff;
    --danger: #ef4444;
    --canvas-bg: transparent;
    --bg-panel: rgba(28, 28, 30, 0.75);
    --topbar-h: 44px;
    --sbar-h: 36px;
    --sidebar-w: 65px;
    --lpanel-w: 260px;
    --r: 8px;
    --rs: 6px;
    --sh: 0 2px 8px rgba(0, 0, 0, 0.04);
    --sh-lg: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.font-preview,
.icon-preview {
    filter: brightness(0) invert(1) !important;
}

.font-item.active .font-preview {
    filter: invert(32%) sepia(78%) saturate(3000%) hue-rotate(243deg) !important;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: var(--g700);
    background: var(--g100);
    -webkit-font-smoothing: antialiased
}

.glass {
    background: var(--bg-panel) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit
}

input,
select {
    font-family: inherit
}

.icon-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--rs);
    color: var(--g500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(134, 134, 139, 0.1);
    color: var(--g800);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 4px 14px;
    border-radius: 14px;
    font-weight: 500;
    gap: 6px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--accent-l);
}

.btn-secondary {
    background: rgba(134, 134, 139, 0.1);
    color: var(--g800);
    padding: 4px 14px;
    border-radius: 14px;
    font-weight: 500;
    gap: 6px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(134, 134, 139, 0.2);
}

::-webkit-scrollbar {
    width: 5px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--g300);
    border-radius: 3px
}

/* TOPBAR */
.topbar {
    display: flex;
    align-items: center;
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--g200);
    padding: 0 16px;
    z-index: 1000;
    position: relative;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0
}

.topbar-center {
    flex: 1;
    text-align: center
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto
}

.brand {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.3px;
    background: linear-gradient(110deg, var(--accent) 0%, var(--accent) 40%, #ffffff 50%, var(--accent) 60%, var(--accent) 100%);
    background-size: 300% 100%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: brandMaskShine 6s infinite linear;
}

@keyframes brandMaskShine {
    0% {
        background-position: 100% 0;
    }

    30% {
        background-position: 0% 0;
    }

    100% {
        background-position: 0% 0;
    }
}

.topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--g200);
    margin: 0 8px
}

.doc-title {
    font-size: 13px;
    color: var(--g500);
    font-weight: 500
}

.tb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--rs);
    color: var(--g500);
    transition: all .15s
}

.tb-icon:hover {
    background: var(--g100);
    color: var(--g700)
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 16px;
    border-radius: var(--r);
    background: var(--accent);
    color: white;
    font-weight: 600;
    font-size: 13px;
    transition: all .15s
}

.btn-export:hover {
    background: var(--accent-l)
}

@media (max-width: 768px) {
    .sb-right {
        display: none !important;
    }
}

/* APP BODY */
.app-body {
    display: flex;
    height: calc(100vh - var(--topbar-h));
    overflow: hidden
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--g200);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    gap: 2px;
    flex-shrink: 0;
    z-index: 50
}

.sb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 40px;
    padding: 10px 0 8px;
    border-radius: var(--r);
    font-size: 9px;
    font-weight: 500;
    transition: all .15s;
    color: var(--g400);
}

.sb-item svg {
    width: 18px;
    height: 18px;
}

/* Each menu = unique color */
.sb-item[data-panel="text"] {
    color: #6366f1 !important;
}

.sb-item[data-panel="icons"] {
    color: #f59e0b !important;
}

.sb-item[data-panel="fonts"] {
    color: #10b981 !important;
}

.sb-item[data-panel="colors"] {
    color: #ec4899 !important;
}

.sb-item[data-panel="saves"] {
    color: #3b82f6 !important;
}

.sb-item[data-panel="quote"] {
    color: #f97316 !important;
}

.sb-item:hover {
    background: var(--g100);
    filter: brightness(1.15);
}

.sb-item.active {
    background: var(--g100);
    filter: brightness(1.1);
    transform: scale(1.05);
}

/* FONT LIST */
#font-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.font-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--rs);
    background: var(--g50);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all .12s;
    overflow: hidden;
}

.font-item:hover {
    background: var(--g100);
    border-color: var(--g200);
}

.font-item.active {
    border-color: var(--accent);
    background: rgba(139, 92, 246, .08);
}

.font-preview {
    height: 22px;
    max-width: 100%;
    object-fit: contain;
}

.font-name {
    font-size: 11px;
    color: var(--g800);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: auto;
    text-align: right;
}

/* LEFT PANEL */
.lpanel {
    width: 0;
    overflow: hidden;
    background: transparent;
    border-right: none;
    flex-shrink: 0;
    transition: width .15s ease;
    z-index: 40
}

.lpanel.open {
    width: var(--lpanel-w);
    border-right: 1px solid var(--g200);
    background: var(--bg-panel);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.lp-page {
    display: none;
    width: var(--lpanel-w)
}

.lp-page.active {
    display: flex;
    flex-direction: column;
    height: 100%
}

.lp-head {
    padding: 20px 20px 8px
}

.lp-head h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--g800)
}

.lp-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 20px
}

.lp-divider {
    height: 1px;
    background: var(--g200);
    margin: 16px 0
}

.lp-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--g400);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 12px
}

/* Add Text Row */
.add-text-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.add-text-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--g200);
    border-radius: var(--r);
    font-size: 14px;
    font-family: inherit;
    color: var(--g800);
    background: var(--white);
    outline: none;
    transition: border-color .15s;
    resize: vertical;
    line-height: 1.4;
    min-height: 60px;
}

.add-text-input:focus {
    border-color: var(--accent);
}

/* Add Text Button */
.add-text-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: center;
    border: 1.5px solid var(--g200);
    border-radius: var(--r);
    padding: 14px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--g700);
    transition: all .15s;
    background: var(--white)
}

.add-text-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--g50)
}

/* Draw button active: rotating rainbow border */
@keyframes drawBorderRotate {
    0% {
        --draw-angle: 0deg;
    }

    100% {
        --draw-angle: 360deg;
    }
}

@property --draw-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.add-text-btn.draw-active {
    position: relative;
    border: 2px solid transparent;
    background: var(--white);
    background-clip: padding-box;
    color: var(--accent);
    animation: drawBorderRotate 2s linear infinite;
}

.add-text-btn.draw-active::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: conic-gradient(from var(--draw-angle),
            #ff0000, #ff8800, #ffff00, #00ff00, #00d4ff, #8b5cf6, #ff1493, #ff0000);
    z-index: -1;
    animation: drawBorderRotate 2s linear infinite;
}

.add-text-btn.draw-active::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: calc(var(--r) - 2px);
    background: var(--white);
    z-index: -1;
}

/* Draw close button (red X) */
.draw-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 6px auto 0;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.draw-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    transform: scale(1.1);
}

/* Exit Drawing Mode button - floating on canvas top center */
.exit-draw-btn {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 20px;
    background: #ef4444;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    transition: all 0.2s;
    animation: exitDrawBtnIn 0.3s ease-out, exitDrawPulse 2s ease-in-out infinite;
}

.exit-draw-btn:hover {
    background: #dc2626;
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.5);
    transform: translateX(-50%) scale(1.05);
}

@keyframes exitDrawBtnIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes exitDrawPulse {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 4px 28px rgba(239, 68, 68, 0.7), 0 0 40px rgba(239, 68, 68, 0.3);
    }
}

/* Preset Chips */
.preset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.preset-chip {
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--g900);
    color: #0f0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-shadow: 0 0 8px #0f0, 0 0 20px #0f06;
    transition: all .15s;
    border: 1px solid var(--g700)
}

.preset-chip:hover {
    transform: scale(1.05);
    border-color: var(--accent)
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px
}

.cdot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    background: none;
    border: none;
    box-shadow: none;
    transition: all .15s;
    padding: 4px 0
}

.cdot::before {
    content: '';
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--c);
    box-shadow: 0 0 0 1px var(--g200), 0 0 8px var(--c);
    transition: all .15s;
    flex-shrink: 0
}

.cdot:hover::before {
    transform: scale(1.15);
    box-shadow: 0 0 0 1px var(--g300), 0 0 16px var(--c)
}

.cdot-name {
    font-size: 9px;
    color: var(--g500);
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%
}

/* Brand logo */
.brand-logo {
    height: 28px;
    max-width: 140px;
    object-fit: contain
}

/* BG Swatch */
.bg-grid {
    display: flex;
    gap: 10px
}

.bg-sw {
    width: 44px;
    height: 44px;
    border-radius: var(--r);
    border: 2px solid var(--g200);
    transition: all .15s
}

.bg-sw:hover,
.bg-sw.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent)
}

/* WORKSPACE / CANVAS */
.workspace {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: transparent;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

.canvas-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none
}

#neon-canvas {
    position: absolute;
    top: 0;
    left: 0
}

/* FLOATING OBJECT MODAL */
.obj-modal {
    position: fixed;
    z-index: 200;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg-panel);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--g200);
    border-radius: var(--r);
    box-shadow: var(--sh-lg);
    min-width: 300px;
    max-width: 350px;
    transition: opacity .08s ease
}

.obj-modal.open {
    display: flex
}

.obj-modal.overlapping {
    opacity: .4
}

.obj-modal.overlapping:hover,
.obj-modal.overlapping:focus-within {
    opacity: 1
}

@keyframes neonInputPulse {
    0% {
        border-color: var(--g200);
        box-shadow: 0 0 0 transparent;
    }

    40% {
        border-color: var(--accent);
        box-shadow: 0 0 8px var(--accent);
    }

    100% {
        border-color: var(--g200);
        box-shadow: 0 0 0 transparent;
    }
}

@property --border-angle {
    syntax: '<angle>';
    initial-value: 0turn;
    inherits: false;
}
@keyframes bg-spin {
    to { --border-angle: 1turn; }
}

.om-text-wrap {
    width: 100%;
    position: relative;
    border-radius: var(--rs);
}

.om-text-wrap.text-mode::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(
        from var(--border-angle),
        #ff0055, #ff8000, #ffff00, #00ff00, #00ffff, #0000ff, #8000ff, #ff0055
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: bg-spin 3s linear infinite;
    z-index: 10;
}

.om-text {
    width: 100%;
    height: auto;
    min-height: 32px;
    max-height: 80px;
    border: none;
    border-radius: var(--rs);
    padding: 6px 10px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.3;
    color: var(--g800);
    background: rgba(134, 134, 139, 0.08);
    outline: none;
    resize: none;
    overflow-y: auto;
    transition: all .15s;
    display: block;
}

.om-text:focus {
    background: rgba(134, 134, 139, 0.15);
}

.om-text::placeholder {
    color: var(--g500)
}

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

.om-font {
    flex: 1;
    height: 30px;
    border: 1px solid var(--g200);
    border-radius: var(--rs);
    padding: 0 6px;
    font-size: 12px;
    color: var(--g800);
    background: rgba(134, 134, 139, 0.08);
    outline: none;
    cursor: pointer
}

.om-font:focus {
    border-color: var(--accent)
}

.om-font option {
    background: var(--bg-panel);
    color: var(--g800)
}

.om-font-btn-img {
    height: 24px;
    /* Significantly increased size */
    max-width: 70%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.om-font-btn-text {
    font-size: 11px;
    color: var(--g500);
    margin-left: auto;
    /* Push text to the right if space allows or naturally spacing */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.om-size {
    width: 60px;
    height: 30px;
    border: 1px solid var(--g200);
    border-radius: var(--rs);
    padding: 0 6px;
    font-size: 12px;
    color: var(--g800);
    background: rgba(134, 134, 139, 0.08);
    outline: none;
    text-align: center
}

.om-size:focus {
    border-color: var(--accent)
}

.om-unit {
    font-size: 11px;
    color: var(--g400);
    font-weight: 500
}

.om-colors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 6px;
    padding-top: 4px;
}

.om-cdot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: calc(100% / 5 - 6px);
    /* 5 items per row for roughly 3 rows of 13 items */
    background: none;
    border: none;
    box-shadow: none;
    transition: all .15s;
    padding: 2px 0;
    cursor: pointer;
}

.om-cdot::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--c);
    border: none;
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1), 0 0 4px var(--c);
    transition: all .15s;
    flex-shrink: 0;
}

.om-cdot:hover::before {
    transform: scale(1.2)
}

.om-cdot.active::before {
    box-shadow: inset 0 0 0 2px var(--g800), 0 0 8px var(--c);
    transform: scale(1.1);
}

.om-cdot span {
    font-size: 9px;
    color: var(--g500);
    font-weight: 500;
    line-height: 1.1;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
}

/* LAYER LIST */
.layer-list {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--rs);
    background: var(--g50);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all .12s;
    user-select: none
}

.layer-item:hover {
    background: var(--g100)
}

.layer-item.active {
    border-color: var(--accent);
    background: var(--accent-l);
    background: rgba(139, 92, 246, .1)
}

.layer-item.drag-over {
    border-top: 2px solid var(--accent)
}

.layer-drag {
    cursor: grab;
    color: var(--g400);
    flex-shrink: 0;
    display: flex;
    align-items: center
}

.layer-drag:active {
    cursor: grabbing
}

.layer-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px var(--c)
}

.layer-text {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: var(--g700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.layer-size {
    font-size: 10px;
    color: var(--g400);
    flex-shrink: 0
}

/* CONTEXT MENU */
.ctx-menu {
    position: fixed;
    z-index: 1000;
    min-width: 180px;
    background: var(--white);
    border: 1px solid var(--g200);
    border-radius: var(--r);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    padding: 4px;
    display: none
}

.ctx-menu.open {
    display: block
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--rs);
    font-size: 13px;
    color: var(--g700);
    transition: all .1s
}

.ctx-item:hover {
    background: var(--g100)
}

.ctx-item.ctx-danger {
    color: var(--danger)
}

.ctx-item.ctx-danger:hover {
    background: #fef2f2
}

.ctx-arrow {
    margin-left: auto;
    font-size: 10px;
    color: var(--g400)
}

.ctx-divider {
    height: 1px;
    background: var(--g200);
    margin: 4px 0
}

.ctx-font-list,
.ctx-color-list {
    display: none;
    padding: 2px 4px
}

.ctx-font-list.open,
.ctx-color-list.open {
    display: block
}

.ctx-sub-item {
    display: block;
    width: 100%;
    padding: 6px 12px 6px 28px;
    border-radius: var(--rs);
    font-size: 12px;
    color: var(--g600);
    text-align: left;
    transition: all .1s
}

.ctx-sub-item:hover {
    background: var(--g100)
}

.ctx-sub-item.active {
    color: var(--accent);
    font-weight: 600
}

.ctx-color-list {
    display: none;
    padding: 6px 12px;
    flex-wrap: wrap;
    gap: 6px
}

.ctx-color-list.open {
    display: flex
}

.ctx-cdot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--c);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 1px var(--g200);
    transition: all .15s
}

.ctx-cdot:hover {
    transform: scale(1.15)
}

/* STATUS BAR */
.statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--sbar-h);
    background: var(--white);
    border-top: 1px solid var(--g200);
    padding: 0 12px
}

.sb-left,
.sb-right {
    display: flex;
    align-items: center;
    gap: 6px
}

.sb-left {
    font-size: 11px;
    color: var(--g400)
}

.zm-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rs);
    font-size: 16px;
    font-weight: 600;
    color: var(--g500)
}

.zm-btn:hover {
    background: var(--g100);
    color: var(--g700)
}

.zm-slider {
    width: 100px;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: var(--g200);
    border-radius: 2px
}

.zm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--g400);
    cursor: pointer
}

.zm-val {
    font-size: 12px;
    color: var(--g500);
    min-width: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums
}

/* Cursor states */
.canvas-wrap.pan-mode {
    cursor: grab
}

.canvas-wrap.pan-mode:active {
    cursor: grabbing
}

/* FONT LIST (sidebar) */
.font-list {
    display: flex;
    flex-direction: column;
    gap: 4px
}

.font-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--rs);
    background: var(--g50);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all .12s;
    user-select: none
}

.font-item:hover {
    background: var(--g100)
}

.font-item.active {
    border-color: var(--accent);
    background: rgba(139, 92, 246, .1)
}

.font-preview {
    height: 28px;
    max-width: 100%;
    object-fit: contain;
    filter: brightness(0);
    opacity: 0.7
}

.font-item.active .font-preview {
    opacity: 1;
    filter: invert(32%) sepia(78%) saturate(3000%) hue-rotate(243deg)
}

.font-name {
    font-size: 11px;
    color: var(--g800);
    flex-shrink: 0
}

/* ICON GRID */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px
}

.icon-cell {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: var(--rs);
    background: var(--g50);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all .12s;
    user-select: none
}

.icon-cell:hover {
    background: var(--g100);
    border-color: var(--g300)
}

.icon-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: .7;
    transition: opacity .12s;
    filter: brightness(0);
}

.icon-cell:hover .icon-preview {
    opacity: 1
}

.icon-add-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1
}

.icon-cell:hover .icon-add-btn {
    display: flex
}

/* MODAL FONT DROPDOWN */
.om-font-wrap {
    position: relative;
    flex: 1
}

.om-font-btn {
    width: 100%;
    height: 38px;
    /* Increased height to make room for larger preview */
    border: 1px solid var(--g200);
    /* Matched om-text border */
    border-radius: var(--rs);
    padding: 0 8px;
    font-size: 12px;
    color: var(--g800);
    /* Matched om-text color */
    background: rgba(134, 134, 139, 0.08);
    /* Matched om-text background */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    transition: border-color .15s;
    overflow: hidden;
}

.om-font-btn:hover,
.om-font-btn:focus {
    border-color: var(--accent)
}

.om-font-btn.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, .25);
}

.om-font-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    background: #1c1c1e;
    /* Enforce dark background */
    border: 1px solid #3a3a3c;
    border-radius: var(--rs);
    z-index: 210;
    padding: 4px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.om-font-dropdown.open {
    display: block
}

.om-font-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    background: none;
    transition: background .1s;
    color: #f5f5f7;
    /* Ensure text is light */
}

.om-font-opt:hover {
    background: rgba(255, 255, 255, 0.1);
    /* Subtle white hover */
}

.om-font-opt.active {
    background: rgba(255, 255, 255, 0.15);
}

.om-font-opt-preview {
    height: 28px;
    max-width: 120px;
    object-fit: contain;
    opacity: 0.8;
    filter: brightness(0) invert(1);
}

.om-font-opt-name {
    font-size: 10px;
    flex-shrink: 0;
    margin-left: auto;
    /* Push text to the right side of the flex container */
    text-align: right;
}

.om-spacing-wrap {
    display: flex;
    align-items: center
}

.om-spacing-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--g600);
    border-radius: var(--rs);
    color: var(--g800);
    background: var(--g300);
    flex-shrink: 0;
    transition: border-color .15s;
    cursor: ew-resize;
    touch-action: none;
    user-select: none
}

#om-lineheight-btn {
    cursor: ns-resize;
}

.om-spacing-btn:hover,
.om-spacing-btn.active {
    border-color: var(--accent);
    color: var(--accent)
}

.mobile-only {
    display: none !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.spin {
    animation: spin 1s linear infinite;
}

/* MIRROR BUTTONS */
.om-mirror-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.om-mirror-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--g600);
    border-radius: var(--rs);
    color: var(--g800);
    background: var(--g300);
    flex-shrink: 0;
    transition: all .15s;
    cursor: pointer;
}

.om-mirror-btn:hover {
    border-color: var(--accent);
    color: var(--accent)
}

.om-mirror-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(139, 92, 246, .15);
}

/* MIN HEIGHT WARNING */
.min-height-warn {
    position: fixed;
    bottom: 48px;
    right: 16px;
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--r);
    z-index: 300;
    display: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, .3);
    animation: warnPulse 2s infinite
}

.min-height-warn.show {
    display: block
}

@keyframes warnPulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .7
    }
}



/* SIDEBAR DIVIDER */
.sb-divider {
    width: 40px;
    height: 1px;
    background: var(--g200);
    margin: 4px auto
}

/* LANGUAGE SWITCHER */
.lang-switcher {
    position: relative
}

.lang-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--rs);
    font-size: 12px;
    font-weight: 700;
    color: var(--g600);
    background: var(--g100);
    border: 1px solid var(--g200);
    transition: all .15s;
    letter-spacing: .5px
}

.lang-current:hover {
    background: var(--g200);
    color: var(--g700)
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #2a2a2c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--r);
    box-shadow: var(--sh-lg);
    min-width: 160px;
    padding: 4px;
    z-index: 999
}

.lang-dropdown.open {
    display: block
}

.lang-option {
    display: block;
    padding: 8px 12px;
    border-radius: var(--rs);
    font-size: 13px;
    color: var(--g600);
    text-decoration: none;
    transition: all .1s
}

.lang-option:hover {
    background: var(--g100);
    color: var(--g700)
}

.lang-option.active {
    color: var(--accent);
    font-weight: 600
}

/* SHARE BUTTON */
.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 16px;
    border-radius: var(--r);
    background: var(--g100);
    color: var(--g700);
    font-weight: 600;
    font-size: 13px;
    transition: all .15s;
    border: 1px solid var(--g200)
}

.btn-share:hover {
    background: var(--g200);
    color: var(--g800)
}

/* SHARE MODAL OVERLAY */
.share-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 500;
    align-items: center;
    justify-content: center
}

.share-overlay.open {
    display: flex
}

.share-modal {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .2);
    overflow: hidden
}

.share-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--g200)
}

.share-modal-head h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--g800)
}

.share-close {
    font-size: 22px;
    color: var(--g400);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all .15s
}

.share-close:hover {
    background: var(--g100);
    color: var(--g700)
}

.share-modal-body {
    padding: 20px
}

.share-loading {
    display: flex;
    justify-content: center;
    padding: 24px 0
}

.share-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--g200);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .6s linear infinite
}

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

.share-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--g400);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
    display: block
}

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

.share-link-input {
    flex: 1;
    height: 38px;
    border: 1px solid var(--g200);
    border-radius: var(--rs);
    padding: 0 12px;
    font-size: 13px;
    color: var(--g700);
    background: var(--g50);
    outline: none
}

.share-link-wrap {
    margin-bottom: 8px
}

.share-copy-btn {
    height: 38px;
    padding: 0 16px;
    border-radius: var(--rs);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    transition: background .15s
}

.share-copy-btn:hover {
    background: var(--accent-l)
}

.share-copy-btn.copied {
    background: #22c55e
}

.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px
}

.share-wa-btn,
.share-email-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    border-radius: var(--rs);
    font-weight: 600;
    font-size: 13px;
    transition: all .15s
}

.share-wa-btn {
    background: #25d366;
    color: #fff
}

.share-wa-btn:hover {
    background: #22c55e
}

.share-email-btn {
    background: var(--g100);
    color: var(--g700);
    border: 1px solid var(--g200)
}

.share-email-btn:hover {
    background: var(--g200)
}

/* PREVIEW PANEL */
.preview-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--g300);
    border-radius: var(--rm);
    background: var(--g50);
    color: var(--g700);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    position: relative;
    overflow: hidden
}

.preview-toggle-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, .08), rgba(0, 212, 255, .08));
    opacity: 0;
    transition: opacity .15s ease
}

.preview-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, .15)
}

.preview-toggle-btn:hover::after {
    opacity: 1
}

.preview-toggle-btn.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, .12), rgba(0, 212, 255, .08));
    color: var(--primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, .2)
}

.preview-toggle-btn.active svg {
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, .5))
}

.preview-hint {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--g50);
    border-radius: var(--rs);
    font-size: 12px;
    color: var(--g500);
    line-height: 1.5;
    border-left: 3px solid var(--g200)
}

/* SAVE LIST */
.save-list {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.save-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--rs);
    background: var(--g50);
    border: 1px solid transparent;
    transition: all .12s
}

.save-item:hover {
    border-color: var(--g300)
}

.save-thumb {
    width: 64px;
    height: 48px;
    border-radius: 4px;
    background: var(--g900);
    object-fit: cover;
    flex-shrink: 0
}

.save-info {
    flex: 1;
    min-width: 0
}

.save-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--g700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.save-date {
    font-size: 10px;
    color: var(--g400)
}

.save-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0
}

.save-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--g500);
    transition: all .12s
}

.save-btn:hover {
    background: var(--g200);
    color: var(--g700)
}

.save-btn.danger:hover {
    color: var(--danger);
    background: #fef2f2
}

.save-empty {
    font-size: 12px;
    color: var(--g400);
    text-align: center;
    padding: 20px 0
}

.save-feedback {
    font-size: 12px;
    color: #22c55e;
    text-align: center;
    padding: 6px 0;
    opacity: 0;
    transition: opacity .3s
}

.save-feedback.show {
    opacity: 1
}

/* QUOTE TABS */
.quote-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    background: var(--g100);
    border-radius: var(--r);
    padding: 3px
}

.quote-tab {
    flex: 1;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--g500);
    border-radius: var(--rs);
    transition: all .15s
}

.quote-tab:hover {
    color: var(--g700)
}


.quote-tab.active {
    background: var(--white);
    color: var(--accent);
    box-shadow: var(--sh)
}

.quote-tab-content {
    display: none
}

.quote-tab-content.active {
    display: block
}

/* QUOTE FORM */
.qf-row {
    margin-bottom: 12px
}

.qf-row label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--g400);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px
}

.qf-row input,
.qf-row textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--g200);
    border-radius: var(--rs);
    font-size: 13px;
    color: var(--g700);
    background: var(--white);
    outline: none;
    font-family: inherit;
    resize: vertical;
    transition: border-color .15s
}

.qf-row input:focus,
.qf-row textarea:focus {
    border-color: var(--accent)
}

.qf-link-input {
    background: var(--g50) !important;
    color: var(--g500) !important;
    font-size: 11px !important
}

.qf-submit {
    margin-top: 8px
}

.qf-message {
    font-size: 12px;
    text-align: center;
    padding: 8px 0;
    min-height: 28px
}

.qf-message.success {
    color: #22c55e
}

.qf-message.error {
    color: var(--danger)
}

/* WHATSAPP ORDER */
.wa-section {
    text-align: center;
    padding: 16px 0
}

.wa-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    background: #25d366;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--r);
    transition: background .15s;
    margin-top: 12px
}

.wa-order-btn:hover {
    background: #22c55e
}

.hidden {
    display: none !important
}

.mobile-delete-btn {
    display: none;
}

/* Default: hide mobile-only textarea on desktop */
.mobile-text-input {
    display: none;
}

/* ═══════════════════════════════════════════
   MOBILE RESPONSIVE (≤768px)
   Sidebar → bottom toolbar, panels slide up
   ═══════════════════════════════════════════ */
@media(max-width:768px) {
    :root {
        --topbar-h: 44px;
        --mob-toolbar-h: 52px;
        --sbar-h: 0px
    }

    /* ── Compact topbar ── */
    .topbar {
        height: 44px;
        padding: 0 8px
    }

    .brand {
        font-size: 13px
    }

    .topbar-divider {
        height: 16px;
        margin: 0 4px
    }

    .tb-icon {
        width: 28px;
        height: 28px
    }

    .tb-icon svg {
        width: 15px;
        height: 15px
    }

    .topbar-right {
        gap: 4px
    }

    .btn-label {
        display: none
    }

    .btn-share {
        height: 30px;
        padding: 0 8px;
        gap: 0;
        min-width: 30px;
        justify-content: center
    }

    .btn-export {
        height: 30px;
        padding: 0 10px;
        gap: 0;
        font-size: 0
    }

    .btn-export svg {
        width: 14px;
        height: 14px
    }

    .lang-current {
        height: 28px;
        padding: 0 6px;
        font-size: 10px
    }

    .lang-dropdown {
        min-width: 140px
    }

    .lang-option {
        padding: 6px 10px;
        font-size: 12px
    }

    /* ── App body: column layout ── */
    .app-body {
        flex-direction: column;
        height: calc(100dvh - 44px)
    }

    .desktop-only {
        display: none !important;
    }

    button.sb-item.mobile-only {
        display: flex !important;
    }

    .mobile-only {
        display: block !important;
    }

    /* ── Hide desktop statusbar ── */
    .statusbar {
        display: none
    }

    /* ── Sidebar → horizontal bottom toolbar ── */
    .sidebar {
        order: 2;
        width: 100%;
        height: var(--mob-toolbar-h);
        flex-direction: row;
        justify-content: space-evenly;
        border-right: none;
        border-top: 1px solid var(--g200);
        padding: 2px 4px;
        gap: 0;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
        z-index: 70
    }

    .sidebar::-webkit-scrollbar {
        display: none
    }

    .sidebar {
        padding-bottom: env(safe-area-inset-bottom, 0px)
    }

    .sb-item {
        width: auto;
        min-width: 0;
        flex: 1;
        padding: 4px 1px 2px;
        flex-shrink: 1;
        border-radius: var(--rs)
    }

    .sb-item svg {
        width: 18px;
        height: 18px
    }

    .sb-item span {
        font-size: 9px
    }

    .sb-item[data-panel="colors"],
    .sb-item[data-panel="bg"] {
        display: none !important;
    }

    .sb-divider {
        width: 1px;
        height: 28px;
        margin: auto 2px
    }

    /* ── Canvas fills middle ── */
    .workspace {
        order: 1;
        flex: 1;
        min-height: 0
    }

    /* ── Left panel → bottom slide-up panel ── */
    .lpanel {
        position: fixed;
        bottom: calc(var(--mob-toolbar-h) + env(safe-area-inset-bottom, 0px));
        left: 0;
        right: 0;
        width: 100% !important;
        height: 0 !important;
        max-height: 55dvh;
        border-right: none !important;
        border-top: 1px solid var(--g200);
        z-index: 65;
        transition: height .15s cubic-bezier(.32, .72, 0, 1);
        overflow: hidden
    }

    .lpanel.open {
        width: 100% !important;
        height: 260px !important;
        background: var(--white)
    }

    .lp-page {
        width: 100% !important
    }

    .lp-head {
        padding: 10px 14px 4px
    }

    .lp-head h3 {
        font-size: 14px
    }

    .lp-body {
        padding: 8px 14px 14px
    }

    .lp-label {
        font-size: 10px;
        margin-bottom: 8px
    }

    .lp-divider {
        margin: 8px 0
    }

    /* ── Text panel compact ── */
    .add-text-row {
        gap: 4px;
        margin-bottom: 4px
    }

    .add-text-input {
        padding: 8px 10px;
        font-size: 13px
    }

    .add-text-btn {
        padding: 10px;
        font-size: 12px;
        gap: 6px;
        margin-bottom: 4px
    }

    /* ── Color grid compact ── */
    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
        gap: 4px
    }

    .cdot {
        padding: 2px 0
    }

    .cdot::before {
        width: 26px;
        height: 26px;
        border-width: 2px
    }

    .cdot-name {
        font-size: 7px
    }

    .brand-logo {
        height: 22px;
        max-width: 100px
    }

    /* ── Font list compact ── */
    .font-list {
        gap: 3px
    }

    .font-item {
        padding: 8px 10px;
        gap: 8px
    }

    .font-preview {
        height: 22px
    }

    .font-name {
        font-size: 10px
    }

    /* ── Icon grid: 8 columns ── */
    .icon-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 4px
    }

    .icon-cell {
        padding: 5px
    }

    .icon-add-btn {
        width: 16px;
        height: 16px
    }

    .icon-cell.touch-active {
        background: var(--g100);
        border-color: var(--accent);
    }

    .icon-cell.touch-active .icon-add-btn {
        opacity: 1 !important;
        transform: translate(30%, -30%) scale(1.3);
    }

    /* ── Save list compact ── */
    .save-item {
        padding: 6px;
        gap: 8px
    }

    .save-thumb {
        width: 52px;
        height: 38px
    }

    .save-name {
        font-size: 11px
    }

    .save-date {
        font-size: 9px
    }

    .save-btn {
        width: 24px;
        height: 24px
    }

    /* ── Quote form compact ── */
    .quote-tabs {
        margin-bottom: 10px;
        padding: 2px
    }

    .quote-tab {
        padding: 6px;
        font-size: 11px
    }

    .qf-row {
        margin-bottom: 8px
    }

    .qf-row label {
        font-size: 10px;
        margin-bottom: 2px
    }

    .qf-row input,
    .qf-row textarea {
        padding: 6px 8px;
        font-size: 12px
    }

    .wa-order-btn {
        height: 40px;
        font-size: 13px;
        gap: 8px;
        margin-top: 8px
    }

    /* ── Settings compact ── */
    .bg-grid {
        gap: 8px
    }

    .bg-sw {
        width: 36px;
        height: 36px
    }

    /* ── Object modal → compact bottom bar ── */
    .obj-modal {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: calc(var(--mob-toolbar-h) + env(safe-area-inset-bottom, 0px)) !important;
        top: auto !important;
        max-width: none;
        min-width: 0;
        padding: 6px 10px;
        border-radius: 0;
        border-top: 1px solid rgba(255, 255, 255, .1);
        border-left: none;
        border-right: none;
        border-bottom: none;
        background: rgba(15, 23, 42, .97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 200;
        gap: 5px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, .4)
    }

    /* When an object is selected on mobile, force-hide lpanel to prevent overlap */
    body.mob-obj-selected .lpanel {
        height: 0 !important;
        overflow: hidden !important;
        border-top-color: transparent !important
    }

    .om-text {
        height: auto;
        min-height: 60px;
        max-height: 120px;
        font-size: 13px;
        padding: 6px 10px;
        border-radius: 6px;
        font-family: inherit;
        line-height: 1.3;
        overflow-y: auto;
    }

    /* Row of controls: font, spacing, mirror — all inline */
    .om-row {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap
    }

    .om-font-btn {
        height: 26px;
        font-size: 10px;
        padding: 0 8px;
        min-width: 0;
        flex-shrink: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 120px
    }

    .om-spacing-btn {
        width: 26px;
        height: 26px;
        flex-shrink: 0
    }

    .om-mirror-btn {
        width: 26px;
        height: 26px;
        padding: 0;
        flex-shrink: 0
    }

    /* Colors: horizontal scrollable row */
    .om-colors {
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap !important;
        gap: 5px !important;
        padding: 2px 0;
        scrollbar-width: none;
        -ms-overflow-style: none
    }

    .om-colors::-webkit-scrollbar {
        display: none
    }

    .om-cdot {
        width: 20px;
        height: 20px;
        flex-shrink: 0
    }

    /* Font dropdown opens UPWARD on mobile */
    .om-font-dropdown {
        top: auto;
        bottom: 100%;
        margin-top: 0;
        margin-bottom: 4px;
        max-height: 40vh
    }


    /* ── Share modal compact ── */
    .share-modal {
        width: 94%;
        max-width: 380px
    }

    .share-modal-head {
        padding: 12px 16px
    }

    .share-modal-head h3 {
        font-size: 14px
    }

    .share-modal-body {
        padding: 14px 16px
    }

    .share-link-input {
        height: 34px;
        font-size: 12px
    }

    .share-copy-btn {
        height: 34px;
        font-size: 12px;
        padding: 0 12px
    }

    .share-wa-btn,
    .share-email-btn {
        height: 36px;
        font-size: 12px
    }

    .share-buttons {
        margin-top: 12px;
        gap: 8px
    }

    /* ── Context menu compact ── */
    .ctx-menu {
        min-width: 150px
    }

    .ctx-item {
        padding: 6px 10px;
        font-size: 12px
    }

    /* ── Min height warn ── */
    .min-height-warn {
        bottom: calc(var(--mob-toolbar-h) + env(safe-area-inset-bottom, 0px) + 8px);
        right: 8px;
        left: 8px;
        text-align: center
    }

    /* ── Font list 2 columns on mobile ── */
    #font-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .font-item {
        flex-direction: column;
        padding: 6px;
        text-align: center;
    }

    .font-preview {
        height: 28px;
    }

    .font-name {
        font-size: 9px;
    }

    /* ── Mobile Delete Button ── */
    .mobile-delete-btn {
        display: flex;
        position: fixed;
        right: 12px;
        top: 60px;
        width: 44px;
        height: 44px;
        background: var(--danger);
        color: white;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        z-index: 150;
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
        opacity: 0;
        pointer-events: none;
        transform: scale(0.8);
        transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .mobile-delete-btn.show {
        opacity: 1;
        pointer-events: auto;
        transform: scale(1);
    }
}

/* BEZIER TUTORIAL ANIMATION */
.tutorial-container {
    position: relative;
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--g200);
    border-radius: var(--r);
    overflow: hidden;
    margin-top: 15px;
}

.tutorial-canvas-bg {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--g200) 1px, transparent 1px);
    background-size: 15px 15px;
}

.tutorial-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tutorial-cursor {
    position: absolute;
    width: 18px;
    height: 18px;
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: tutor-move-cursor 6s infinite ease-in-out;
    transform-origin: 0 0;
}

.tutorial-cursor svg {
    display: block;
    width: 100%;
    height: 100%;
}

.tutorial-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ff0055;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
}

#tutor-p1 {
    animation: tutor-show-p1 6s infinite;
}

#tutor-p2 {
    animation: tutor-show-p2 6s infinite;
}

#tutor-path {
    stroke: #ff0055;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    animation: tutor-animate-path 6s infinite ease-in-out;
}

@keyframes tutor-move-cursor {
    0% {
        left: 20%;
        top: 69%;
    }

    10% {
        left: 20%;
        top: 69%;
        scale: 0.8;
    }

    15% {
        left: 20%;
        top: 69%;
        scale: 1;
    }

    35% {
        left: 80%;
        top: 40%;
    }

    45% {
        left: 80%;
        top: 40%;
        scale: 0.8;
    }

    50% {
        left: 80%;
        top: 40%;
        scale: 1;
    }

    70% {
        left: 50%;
        top: 20%;
    }

    80% {
        left: 50%;
        top: 20%;
        scale: 0.8;
    }

    85% {
        left: 50%;
        top: 20%;
        scale: 1;
        opacity: 1;
    }

    95% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

@keyframes tutor-animate-path {

    0%,
    15% {
        d: path("M 20 69 Q 20 69 20 69");
        opacity: 0;
    }

    16% {
        opacity: 1;
    }

    35% {
        d: path("M 20 69 Q 50 54.5 80 40");
    }

    /* Straight line (PC at mid) */
    45% {
        d: path("M 20 69 Q 50 54.5 80 40");
    }

    /* Hold at P2 */
    70%,
    85% {
        d: path("M 20 69 Q 50 20 80 40");
    }

    /* Curve shaping */
    95% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes tutor-show-p1 {

    0%,
    9% {
        opacity: 0;
    }

    10%,
    90% {
        opacity: 1;
    }

    95%,
    100% {
        opacity: 0;
    }
}

@keyframes tutor-show-p2 {

    0%,
    44% {
        opacity: 0;
    }

    45%,
    90% {
        opacity: 1;
    }

    95%,
    100% {
        opacity: 0;
    }
}