
/* --- Reset and Base Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9; /* bg-slate-100 */
    color: #1e293b; /* text-slate-800 */
}

button, input, select {
    font-family: inherit;
    vertical-align: middle;
}

/* --- Main App Layout --- */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-header {
    position:relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem; /* py-3 px-4 */
    padding-left:10px;
    border-radius: 10px 10px 0 0;
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-sm */
    border-bottom: 1px solid #e2e8f0; /* border-b border-slate-200 */
    /* Keep below design-template / modal overlays (see .design-tpl-preview-modal). */
    z-index: 10;
}

.app-header h1 {
    font-size: 1.25rem; /* text-xl */
    font-weight: 700; /* font-bold */
    color: #4f46e5; /* text-indigo-600 */
    margin:0px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 5px; /* gap-3 */
}





.header-btn {
    padding: 0.5rem; /* p-2 */
    border-radius: 0.5rem; /* rounded-lg */
    color: #64748b; /* text-slate-500 */
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.header-btn:hover {
    background-color: #f1f5f9; /* hover:bg-slate-100 */
    color: #334155; /* hover:text-slate-700 */
}

.header-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

#clear-canvas-header-btn.header-btn,
.header-btn-clear-canvas.header-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid #fecaca !important;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.18);
}

#clear-canvas-header-btn.header-btn:hover,
.header-btn-clear-canvas.header-btn:hover {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
}

#clear-canvas-header-btn.header-btn svg,
.header-btn-clear-canvas.header-btn svg {
    stroke: #ffffff !important;
    color: #ffffff !important;
}

#clear-canvas-header-btn.header-btn span,
.header-btn-clear-canvas.header-btn span {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    color: #ffffff !important;
}

.btn {
    padding: 0.5rem 1rem; /* px-4 py-2 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    border-radius: 0.5rem; /* rounded-lg */
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary {
    background-color: #ffffff;
    border: 1px solid #cbd5e1; /* border border-slate-300 */
    color: #334155; /* text-slate-700 */
}
.btn-secondary:hover {
    background-color: #f8fafc; /* hover:bg-slate-50 */
}

.btn-primary {
    color: #ffffff;
    background-color: #4f46e5; /* bg-indigo-600 */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-sm */
}
.btn-primary:hover {
    background-color: #4338ca; /* hover:bg-indigo-700 */
}
.google-font-btn {
    font-family: inherit;
    padding: 4px 10px;
    border: 1px solid #ddd;
    background: #fff;
    color: #222;
    cursor: pointer;
}
.btn-close {
     
        margin-left: 0.5rem;
    position: absolute;
    top: -13px;
    right: -12px;
    border: 1px solid white;
    border-radius: 50%;
    padding: 4px;
    background: #ffffff;
    box-shadow: 0px 0px 11px 1px #a19e9e;
}


#closeButton {
    position: relative;
    padding: 5px 10px;
    background-color: transparent;
    color: black;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 30px;
    float: right;
    background: white;
    /* border: 1px solid gray; */
    padding: 7px;
    width: 35px;
    height: 35px;
    display: flex;
    align-content: center;
    align-items: center;
    flex-wrap: wrap;
    border-radius: 50%;
    font-size: 19px;
    justify-content: center;
    box-shadow: 0px 0px 9px 3px #cdcdcd;
}

/* --- Top Contextual Menubar --- */
.app-menubar {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 0.5rem; /* gap-2 */
    padding: 0.5rem 1rem; /* p-2 px-4 */
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    min-height: 53px; /* Set a min-height */
    z-index: 10;
}

.menubar-divider {
    width: 1px;
    height: 1.5rem; /* h-6 */
    background-color: #e2e8f0; /* bg-slate-200 */
    margin: 0 0.25rem; /* mx-1 */
}

/* This holds the contextual properties */
.menubar-properties {
    /* display: none;  */
    display: flex; 
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.menubar-properties.active {
    display: flex;
}

/* This holds the default message */
.menubar-default {
        display: none;
}
.menubar-default.active {
    display: flex;
    align-items: center;
    color: #64748b;
}
    .menubar-default svg {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    }

/* --- Form Elements for Menubar --- */
.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    margin-left: 0.5rem;
    margin-right: 0.25rem;
}

.form-input, .form-select {
    padding: 0.375rem 0.75rem; /* py-1.5 px-3 */
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem; /* rounded-md */
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px #c7d2fe;
}

.form-select {
    width: 9rem; /* w-36 */
}
.form-input[type="number"] {
    width: 5rem; /* w-20 */
}

.form-color {
       width: 2.0rem;
    height: 2.0rem;
    padding: 0.05rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    cursor: pointer;
    vertical-align: middle;
}

.form-range {
    width: 8rem; /* w-32 */
    vertical-align: middle;
}

/* Buttons for Menubar */
.btn-menubar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* padding: 0.375rem 0.75rem; */
    padding: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    background: #fff;
    cursor: pointer;
}
.btn-menubar:hover {
    background-color: #f8fafc;
}
.btn-menubar:focus {
    background-color: #eef2ff;
    color: #4338ca;
}
.btn-menubar svg {
    width: 16px; height: 16px;
}

.btn-menubar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
    line-height: 0;
    vertical-align: middle;
    color: #334155;
    border-radius: 0.375rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    margin-top: 6px;
}



.btn-panel-action {
    padding: 5px;
    color: #334155;
    border-radius: 0.375rem;
    /* border: 1px solid #cbd5e1; */
    background: #fff;
    cursor: pointer;
    display: flex
;
    align-items: center;
    justify-content: center;
}

.btn-panel-action :hover {
    /* background-color: #f8fafc; */
}


.btn-panel-action svg {
    width: 16px; height: 16px;
}


.btn-menubar-icon:hover {
    background-color: #f8fafc;
}
.btn-menubar-icon:disabled,
.btn-menubar-icon[aria-disabled="true"] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-menubar-icon.is-active {
    background-color: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}
.btn-menubar-icon.delete-btn {
    color: #dc2626;
    border-color: #fecaca;
}
.btn-menubar-icon.delete-btn:hover {
    background-color: #fee2e2;
}

.fonts-tab-desc{
    color:gray;
}


#canvasNavigatorSidebarIcon {
    border-radius: 3px;
    padding: 3px;
}
#canvasNavigatorSidebarIcon svg{
    fill:#252525;
}


 

#canvasNavigatorSidebarIcon:focus {
    background-color: rgb(19, 38, 244);
}

#canvasNavigatorSidebarIcon svg:focus {
    fill: rgb(255, 255, 255);
}

/* Navigator layer visibility — SVG icons (avoid emoji glyph fallbacks) */
#canvasNavigatorList .navigator-vis-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex-shrink: 0;
}
#canvasNavigatorList .navigator-vis-btn .navigator-vis-icon {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    pointer-events: none;
}

.btn-menubar-icon svg,
.btn-menubar-icon i,
.btn-menubar-icon img {
    width: 18px;
    height: 18px;
    display: block;
    margin: 0;
    flex-shrink: 0;
    pointer-events: none;
}
/* --- End of Menubar Styles --- */


.app-content {
    display: flex;
    flex: 1 1 0%;
    overflow: hidden;
}

/* --- Left Toolbar --- */
.left-toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 4rem; /* w-16 */
    gap: 0.25rem; /* gap-1 */
    padding: 0.5rem; /* p-2 */
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    z-index: 5;
}

/* Higher specificity than WoodMart :is(.btn,.button,button,...) which also scores (0,1,0) */
#designer-popup .left-toolbar .tool-button,
.left-toolbar .tool-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem; /* p-3 */
    border-radius: 0.5rem;
    color: #64748b;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    min-height: 0 !important;
    height: auto !important;
    font-size: inherit !important;
    font-weight: normal !important;
    text-transform: none !important;
    line-height: 1 !important;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

#designer-popup .left-toolbar .tool-button:hover,
.left-toolbar .tool-button:hover {
    background-color: #eef2ff !important; /* hover:bg-indigo-50 */
    color: #4f46e5; /* hover:text-indigo-600 */
}

#designer-popup .left-toolbar .tool-button.active,
.left-toolbar .tool-button.active {
    background-color: #4f46e5 !important;
    color: #fff !important;
    box-shadow: 0px 0px 9px 3px #c8c8c8 !important;
}

/* Base SVG size — do NOT force fill:none (breaks shapes/clipart/canvas fill icons) */
#designer-popup .left-toolbar .tool-button svg,
.left-toolbar .tool-button svg {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px;
    min-height: 24px;
    margin: 0 auto;
    display: block;
    flex-shrink: 0;
    overflow: visible;
}

/* Feather-style outline icons (no fill / hardcoded stroke on markup) */
#designer-popup .left-toolbar .tool-button#imgUploadTab svg,
#designer-popup .left-toolbar .tool-button#drawing-mode svg,
#designer-popup .left-toolbar .tool-button#qrTab svg,
.left-toolbar .tool-button#imgUploadTab svg,
.left-toolbar .tool-button#drawing-mode svg,
.left-toolbar .tool-button#qrTab svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Fill-based icons — keep visible grey fill under WoodMart */
#designer-popup .left-toolbar .tool-button#shapesTab svg path,
#designer-popup .left-toolbar .tool-button#clipArts svg path,
#designer-popup .left-toolbar .tool-button.tool-canvas svg path,
.left-toolbar .tool-button#shapesTab svg path,
.left-toolbar .tool-button#clipArts svg path,
.left-toolbar .tool-button.tool-canvas svg path {
    fill: #808184;
    stroke: none;
}

/* Stroke icons with inline colors — ensure they stay visible */
#designer-popup .left-toolbar .tool-button.tool-sides svg path,
#designer-popup .left-toolbar .tool-button.tool-text svg path,
.left-toolbar .tool-button.tool-sides svg path,
.left-toolbar .tool-button.tool-text svg path {
    fill: none;
    stroke: #64748b;
}

#designer-popup .left-toolbar .tool-button#effectsTab svg circle,
#designer-popup .left-toolbar .tool-button#effectsTab svg path,
.left-toolbar .tool-button#effectsTab svg circle,
.left-toolbar .tool-button#effectsTab svg path {
    fill: none !important;
    stroke: #37c89f !important;
}

/* Active: white icons on purple */
#designer-popup .left-toolbar .tool-button.active svg,
#designer-popup .left-toolbar .tool-button.active svg path,
#designer-popup .left-toolbar .tool-button.active svg polyline,
#designer-popup .left-toolbar .tool-button.active svg line,
#designer-popup .left-toolbar .tool-button.active svg circle,
#designer-popup .left-toolbar .tool-button.active svg g,
.left-toolbar .tool-button.active svg,
.left-toolbar .tool-button.active svg path,
.left-toolbar .tool-button.active svg polyline,
.left-toolbar .tool-button.active svg line,
.left-toolbar .tool-button.active svg circle,
.left-toolbar .tool-button.active svg g {
    fill: #fff !important;
    stroke: #fff !important;
}

/* Effects stays green when not active (override the fill:none from active siblings N/A) */
#designer-popup .left-toolbar .tool-button#effectsTab:not(.active) svg circle,
#designer-popup .left-toolbar .tool-button#effectsTab:not(.active) svg path,
.left-toolbar .tool-button#effectsTab:not(.active) svg circle,
.left-toolbar .tool-button#effectsTab:not(.active) svg path {
    fill: none !important;
    stroke: #37c89f !important;
}

.toolbar-spacer {
    flex: 1 1 0%;
}

/* --- Properties Panel (Sidebar) --- */
.properties-panel {
    width: 18rem; /* w-72 */
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    z-index: 5;
}

/* Custom scrollbar */
.properties-panel::-webkit-scrollbar {
    width: 6px;
}
.properties-panel::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}
.properties-panel::-webkit-scrollbar-track {
    background-color: #f1f5f9;
}

.panel-content {
    display: none; /* 'hidden' class */
    padding: 1rem; /* p-4 */
    padding-top: 0px;
    max-height: 467px;
    height: 467px;
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: #b6b6b6 #fff;
}

/* Supermodern Mac-like scrollbar for Webkit browsers */
.panel-content::-webkit-scrollbar {
    width: 6px;
    background: transparent;
    border-radius: 8px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #e0e0e0 0%, #b6b6b6 100%);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(49,97,83,0.15);
    border: none;
    min-height: 24px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #b6b6b6 0%, #888888 100%);
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 8px;
}

.panel-content.active {
    display: block;
}

.panel-content-flex {
    display: none; /* for default panel */
}

.panel-content-flex.active {
    display: flex;
}

.panel-content > *:not(h2) {
    margin-top: 1rem; /* space-y-4 */
}
.panel-content h2 {
    margin-top: 0;
}


#panel-default {
    text-align: center;
    color: #64748b;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#panel-default svg {
    margin-bottom: 0.75rem;
    color: #94a3b8;
}
#panel-default .font-medium {
    font-weight: 500;
}
#panel-default .text-sm {
    font-size: 0.875rem;
}

/* Panel Form Elements */
.panel-content h2 {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}
.properties-panel .panel-header h2{
     font-size: 1.125rem; /* text-lg */
    font-weight: 600;
    margin:0px;
 
    padding-bottom: 0.5rem;
}

.properties-panel .panel-header{
    display:flex;
    justify-content:space-between;
    padding: 8px;
    position: sticky;
    padding-bottom: 0px;
    border-bottom: 1px solid #e2e8f0;
}

/* Re-using menubar form styles for panel */
.panel-content .form-label {
    display: block;
    margin-left: 0;
    margin-bottom: 0.25rem;
}

.panel-content .form-input,
.panel-content .form-select,
.panel-content .form-color,
.panel-content .form-range {
    width: 100%;
}

.panel-content .form-color {
        height: 2.5rem; /* h-10 */
}

.flex-row {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
}
.flex-row > .flex-1 {
    flex: 1 1 0%;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem; /* gap-2 */
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem; /* gap-3 */
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem; /* gap-1 */
}

.btn-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    width: 100%;
}
.btn-panel:hover {
    background-color: #f8fafc;
}
.btn-panel:focus {
    background-color: #eef2ff;
    color: #4338ca;
}
.btn-panel svg {
    width: 16px; height: 16px;
}

.btn-panel-icon {
    padding: 0.5rem;
    color: #334155;
}
.btn-panel-icon svg {
    margin: 0 auto;
}

.btn-panel-primary {
    width: 100%;
    font-weight: 500;
    color: #ffffff;
    background-color: #4f46e5;
    border: none;
}
.btn-panel-primary:hover {
    background-color: #4338ca;
    color: #ffffff !important;
}

.btn-panel-danger {
    width: 100%;
    font-weight: 500;
    color: #ffffff;
    background-color: #dc2626; /* bg-red-600 */
    border: none;
}
.btn-panel-danger:hover {
    background-color: #b91c1c; /* hover:bg-red-700 */
}

.shape-button {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    height:80px;
}

.properties-panel-collapsed {
    width: 48px !important;
    min-width: 48px !important;
    transition: width 0.3s;
    overflow: hidden;

}
.properties-panel-toggle {
    position: absolute;
    top: 12px;
    left: -18px;
    background: #23272f;
    border-radius: 50%;
    border: 1px solid #37c89f;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(49,97,83,0.10);
}
 
.shape-button:hover {
    background-color: #f1f5f9;
}
.shape-button svg {
    width: 32px;
    height: 32px;
    color: #334155;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.clipart-item {
    aspect-ratio: 1 / 1;
    background-color: #e2e8f0;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.875rem;
    cursor: pointer;
}
.clipart-item:hover {
    box-shadow: 0 0 0 2px #4f46e5; /* hover:ring-2 */
}
/* --- End Sidebar Panel Styles --- */

/* --- Main Canvas Area --- */
.canvas-area {
    flex: 1 1 0%; /* Takes up remaining space */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem; /* p-8 */
    overflow: auto;
    background-color: #f1f5f9;
    position: relative;
}

/* Canvas navigator sidebar button */
.btn-canvas-navigator {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 5px;
    margin-bottom: -2px;
    border: none;
    background: none;
    /* z-index: 20; */
    transition: box-shadow 0.2s;
}

/* Footer row */
.bnt_row_last {
    display: flex;
    align-items: center;
    justify-content: center;
}

#canvas-wrapper {
    background-color: #ffffff;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); /* shadow-lg */
    position: relative;
    width: 400px;
    height: 600px;
}

#canvas-wrapper .canvas-sidebar-left {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4rem; /* w-16 */
    background-color: #7dd3fc; /* bg-sky-300 */
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
}

#canvas-wrapper .canvas-sidebar-right {
    position: absolute;
    inset: 0 0 0 auto;
    width: 4rem; /* w-16 */
    background-color: #7dd3fc; /* bg-sky-300 */
    border-top-right-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

/* Mock Objects */
#mock-pennant {
    position: absolute;
    cursor: pointer;
    top: 200px;
    left: 60px;
    border: 2px dashed transparent;
    transition: border-color 0.2s;
}

#mock-text {
    position: absolute;
    cursor: pointer;
    padding: 0.5rem; /* p-2 */
    top: 100px;
    left: 100px;
    border: 2px dashed transparent;
    transition: border-color 0.2s;
}

#mock-text span {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700; /* font-bold */
    font-family: 'ABeeZee', sans-serif;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-md */
    border-radius: 0.5rem;
    padding: 0.25rem;
    border: 1px solid #e2e8f0;
    z-index: 5;
}
.zoom-controls button {
    padding: 0.5rem;
    border-radius: 0.25rem;
    color: #334155;
    background: transparent;
    border: none;
    cursor: pointer;
}
.zoom-controls button:hover {
    background-color: #f1f5f9;
}
.zoom-controls button svg {
    width: 18px; height: 18px; display: block;
}
.zoom-controls span {
    padding: 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}



/* navigator css */

/* 
#canvasNavigatorPanel {
    position: fixed;
    top: 80px;
    right: 40px;
    z-index: 999;
    width: 260px;
    min-height: 48px;
    max-height: 420px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0px 1px 11px 4px rgb(49 97 83);
    padding: 0 0 8px 0;
    overflow: auto;
    user-select: none;
    display: none;
    transform: scale(0.2) translateY(-120px) skewY(-18deg) rotateZ(-12deg);
    opacity: 0;
    filter: blur(24px) brightness(1.2);
    transition: transform 0.5s cubic-bezier(.22,1.61,.36,1), opacity 0.4s, filter 0.4s;
}

#canvasNavigatorPanel.opening {
    display: block;
    transform: scale(1.08) translateY(10px) skewY(2deg) rotateZ(2deg);
    opacity: 1;
    filter: blur(0px) brightness(1);
}

#canvasNavigatorPanel.opened {
    transform: scale(1) translateY(0) skewY(0deg) rotateZ(0deg);
}

#canvasNavigatorPanel.closing {
    transform: scale(1.08) translateY(10px) skewY(2deg) rotateZ(2deg);
    opacity: 0.7;
    filter: blur(6px) brightness(1.1);
}

#canvasNavigatorPanel.closed {
    transform: scale(0.2) translateY(-120px) skewY(-18deg) rotateZ(-12deg);
    opacity: 0;
    filter: blur(24px) brightness(1.2);
    display: none;
}

#canvasNavigatorPanel .navigator-drag-handle {
    width: 100%;
    height: 32px;
    cursor: move;
    background: #37c89f;
    border-radius: 14px 14px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

#canvasNavigatorPanel .navigator-drag-handle span {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

#canvasNavigatorPanel .navigator-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    display: flex;
    align-items: center;
}

#canvasNavigatorList {
    padding: 8px 12px;
}

#canvasNavigatorList .navigator-item {
    padding: 7px 0 7px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

#canvasNavigatorList .navigator-item:hover {
    background: #f8fafc;
}

#canvasNavigatorList .navigator-label {
    font-size: 1rem;
    color: #334155;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
} */




#close-button{
    display:none;
}

.menubar-header{
    display:none;
}
/* --- Shortcuts Modal --- */
.shortcuts-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    display: none; /* Changed from display: flex !important */
    justify-content: center !important;
    align-items: center !important;
    z-index: 10000000 !important;
}

.shortcuts-modal.show {
    display: flex !important;
}

.shortcuts-modal-content {
    background-color: #ffffff !important;
    width: 90% !important;
    max-width: 600px !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    animation: modalFadeIn 0.3s ease-out !important;
    position: relative !important;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.shortcuts-modal-header {
    padding: 1.25rem 1.5rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background-color: #f8fafc !important;
}

.shortcuts-modal-header h2 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #4f46e5 !important;
    margin: 0 !important;
}

.close-modal-btn {
    background: none !important;
    border: none !important;
    font-size: 2.5rem !important;
    color: #64748b !important;
    cursor: pointer !important;
    line-height: 1 !important;
}

.close-modal-btn:hover {
    color: #1e293b !important;
}

.shortcuts-modal-body {
    padding: 1.5rem !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
}

.shortcut-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
}

.shortcut-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.75rem !important;
    background-color: #f1f5f9 !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
}

.shortcut-key {
    font-weight: 700 !important;
    color: #4f46e5 !important;
    background-color: #fff !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    border-bottom: 2px solid #cbd5e1 !important;
    font-size: 0.85rem !important;
    font-family: monospace !important;
}

.shortcut-label {
    font-size: 0.9rem !important;
    color: #334155 !important;
}

@media (max-width: 640px) {
    .shortcut-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Jetpack Boost Image Guide badges: keep below #designer-popup (z-index: 999). */
.guide.svelte-6tsow1,
.guide.show.svelte-6tsow1,
.guide.small.svelte-6tsow1,
.guide.small.svelte-6tsow1 {
    z-index: 100 !important;
}

/* Text stroke / shadow menubar controls */
#menubar-text-properties .form-input-sm {
    width: 3.5rem;
    padding: 0.375rem 0.4rem;
}

/* Text templates panel */
.text-templates-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.text-templates-section .form-label {
    display: block;
    margin: 0 0 0.75rem;
}

.text-templates-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.text-template-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-template-item:hover {
    border-color: #94a3b8;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.text-template-preview {
    font-size: 0.95rem;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
}

.text-template-thumb {
    max-width: 100%;
    max-height: 48px;
    object-fit: contain;
}

/* Design templates panel */
.design-templates-section {
    margin-top: 0.25rem;
}

.design-templates-section .form-label {
    display: block;
    margin: 0 0 0.75rem;
}

.design-templates-search {
    width: 100%;
    margin-bottom: 0.65rem;
}

.design-templates-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.design-tpl-cat-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    cursor: pointer;
    line-height: 1.3;
}

.design-tpl-cat-btn.is-active,
.design-tpl-cat-btn:hover {
    border-color: #37c89f;
    color: #0f172a;
    background: #ecfdf5;
}

.design-templates-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.design-template-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 88px;
    min-width: 0;
    padding: 0.65rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.design-template-item[hidden] {
    display: none !important;
}

.design-template-item:hover {
    border-color: #94a3b8;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.design-template-preview {
    font-size: 0.85rem;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    color: #334155;
}

.design-template-thumb {
    max-width: 100%;
    max-height: 56px;
    object-fit: contain;
    object-position: center center;
    margin: 0 auto;
    display: block;
}

.design-template-thumb-canvas {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 72px;
    aspect-ratio: 14 / 9;
    margin-inline: auto;
    object-fit: contain;
    object-position: center center;
    background: #ffffff;
    border-radius: 0.25rem;
    pointer-events: none;
}

.design-template-item-title {
    font-size: 0.68rem;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.design-templates-empty {
    font-size: 0.75rem;
    text-align: center;
    color: #64748b;
    margin: 0.75rem 0;
}

.design-templates-load-more {
    width: 100%;
    margin-top: 0.65rem;
}

/* Material Icons: grid scrolls; Load more stays pinned above panel footer */
#panel-material-icons.panel-content.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-y: hidden !important;
    min-height: 0;
}

#panel-material-icons .material-icons-panel-hint,
#panel-material-icons .material-icons-style-controls {
    flex-shrink: 0;
}

#panel-material-icons .material-icons-section {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 1rem;
}

#panel-material-icons .material-icons-search {
    flex-shrink: 0;
}

#panel-material-icons .material-icons-results {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-top: 0;
}

#panel-material-icons .material-icons-load-more:not([hidden]) {
    flex-shrink: 0;
    margin-top: 0.65rem;
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #ffffff;
    box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.08);
}

.material-icons-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.material-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 76px;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.material-icon-item:hover {
    border-color: #94a3b8;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.material-icon-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    pointer-events: none;
}

.material-icon-item-title {
    font-size: 0.62rem;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-icons-empty {
    font-size: 0.75rem;
    text-align: center;
    color: #64748b;
    margin: 0.75rem 0;
}

.material-icons-load-more {
    width: 100%;
    margin-top: 0.65rem;
}

.material-icons-search {
    margin-bottom: 0.75rem;
}

.material-icons-style-controls {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    padding: 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.material-icons-color-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.material-icons-color-label .material-icons-color,
.material-icons-color-label .form-color {
    width: 2.25rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    background: #fff;
    cursor: pointer;
}

/* Clip art Images / SVGs tabs + per-part colors */
.clipart-type-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.clipart-type-tab {
    flex: 1;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.clipart-type-tab:hover {
    background: #e2e8f0;
}

.clipart-type-tab.is-active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

.clipart-svg-parts-bar {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.clipart-svg-parts-rows {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.clipart-svg-part-row {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.clipart-svg-part-row input[type="color"] {
    width: 2rem;
    height: 1.5rem;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    cursor: pointer;
}

.clipart-load-more {
    width: 100%;
    margin-top: 0.65rem;
}

.ext-clipart-grid .liarts {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ext-clipart-grid .liarts img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    object-fit: contain;
}

/* SVG clip arts: equal thumb size (PNG thumbs and raw SVG fallbacks). */
#panel-clipart .ext-clipart-grid .liarts[data-clipart-type="svg"] img,
#panel-clipart .ext-clipart-grid img[data-clipart-type="svg"] {
    width: 88px;
    height: 88px;
    max-width: 88px;
    object-fit: contain;
}

.ext-clipart-empty {
    padding: 0.75rem;
    color: #64748b;
    font-size: 0.875rem;
}

.design-tpl-preview-modal[hidden] {
    display: none !important;
}

.design-tpl-preview-modal {
    position: fixed;
    inset: 0;
    /* Above navigator (100120), pricing/hints, and app-header stacking. */
    z-index: 100200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.design-tpl-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.design-tpl-preview-dialog {
    position: relative;
    width: min(360px, 92vw);
    background: #fff;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
}

.design-tpl-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.design-tpl-preview-close {
    border: none;
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}

.design-tpl-preview-body {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

#design-tpl-preview-canvas {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 200px;
}

.design-tpl-preview-body img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    object-position: center center;
}

.design-tpl-preview-actions {
    display: flex;
    gap: 0.5rem;
}

.design-tpl-preview-actions .btn-panel {
    flex: 1;
}

.design-tpl-preview-note {
    margin: 0.65rem 0 0;
    font-size: 0.7rem;
    color: #64748b;
    text-align: center;
    line-height: 1.35;
}

/* Hide legacy Woo gallery source list (used only as JS image sources) */
.ext-pd-gallery-sources {
	display: none !important;
}
.ext-pd-gallery-sources li {
	list-style: none !important;
}

/* Template personalization field panel */
.ext-personalization-hidden {
	display: none !important;
}
.ext-template-fields-form .ext-tpl-field {
	margin-bottom: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e2e8f0;
}
.ext-template-fields-form .ext-tpl-field label {
	display: block;
	margin-bottom: 4px;
	font-size: 0.85rem;
}
.ext-template-fields-form .ext-tpl-field-error {
	color: #dc2626;
	font-size: 0.75rem;
	margin-top: 4px;
}
.ext-template-fields-form .required {
	color: #dc2626;
}
