		
/* HOST OVERRIDES */
/* Page shell */
body.wp-singular {
      height: 100dvh;
      overflow: hidden;
    }

    #main-container {
      height: 100%;
      min-height: 0 !important;
      overflow: hidden !important;
      margin: 0;
      padding: 0;
      width: 100%;
      background: #f9f9f9;
    }

    #main-container .site-main {
      overflow: hidden;
      background: #f5f6f8;
    }

/* ROOT + LAYOUT */
/* App root */
.btm-dsg-root {
        width: 100%;
        max-width: 1600px;
        margin: 0 auto;
        height: 100%;
        display: flex;
        flex-direction: column;
        background: #f5f6f8;
        font-family: Arial, sans-serif;
        box-sizing: border-box;
        padding: 0px 16px 8px 16px;
min-height: 0;
    }
    .btm-dsg-root * {
        box-sizing: inherit;
    }

/* Prevent Vue template flash before mount */
.btm-dsg-app[v-cloak] {
	display: none !important;
}


/* ROOT + LAYOUT */
/* Main layout */
.btm-dsg-main {
        flex: 1;
        display: flex;
        position: relative;
		min-height: 0;
    }


/* Context menu (right click / long press) */
.btm-dsg-context-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999; /* must be above zoom controls / dropdowns */
}

.btm-dsg-context-menu {
    position: absolute;
    min-width: 190px;
    background: #ffffff;
    border: 1px solid rgba(15,23,42,0.12);
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(15,23,42,0.18);
    padding: 6px;
}

.btm-dsg-context-menu-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    font-size: 14px;
    line-height: 1;
    color: #0f172a;
    text-align: left;
}

.btm-dsg-context-menu-btn:hover {
    background: rgba(15,23,42,0.06);
}

.btm-dsg-context-menu-btn.is-danger {
    color: #b42318;
}

.btm-dsg-context-menu-sep {
    height: 1px;
    background: rgba(15,23,42,0.10);
    margin: 6px 4px;
}


/* START SCREEN */
.btm-dsg-start-screen {
	--btm-dsg-left-offset: 84px;
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: var(--btm-dsg-left-offset);
	padding: 16px 16px 24px;
	box-sizing: border-box;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #c8cfdb transparent;
}


.btm-dsg-start-screen::-webkit-scrollbar {
	width: 8px;
}

.btm-dsg-start-screen::-webkit-scrollbar-track {
	background: transparent;
}

.btm-dsg-start-screen::-webkit-scrollbar-thumb {
	background: #c8cfdb;
	border-radius: 999px;
}

.btm-dsg-start-screen::-webkit-scrollbar-thumb:hover {
	background: #b7bfcc;
}

.btm-dsg-start-screen__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 12px 24px;

}

.btm-dsg-start-screen__hero {
	text-align: center;
}

.btm-dsg-start-screen__title {
	margin: 0;
	color: #060b2d;
	font-size: 36px;
	font-weight: 700;
}

.btm-dsg-start-screen__subtitle {
	max-width: 760px;
	margin: 12px auto 0;
	color: #35527b;
	font-size: 18px;
	line-height: 1.6;
}

.btm-dsg-start-screen__main {
	display: flex;
	gap: 20px;
	margin-top: 28px;
}

.btm-dsg-start-upload,
.btm-dsg-start-preview {
	flex: 1 1 0;
	min-width: 0;
}

.btm-dsg-start-upload {
	padding: 28px;
	border: 2px dashed #d4dae6;
	border-radius: 18px;
	background: #ffffff;
}

.btm-dsg-start-upload__icon {
	width: 60px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 16px;
	border: 1px solid #d8dde8;
	background: #f8fafc;
	color: #42536d;
}

.btm-dsg-start-upload__icon svg {
	width: 28px;
	height: 28px;
	display: block;
}

.btm-dsg-start-upload__title {
	margin-top: 22px;
	color: #060b2d;
	font-size: 28px;
	font-weight: 700;
}

.btm-dsg-start-upload__text {
	margin-top: 12px;
	color: #35527b;
	font-size: 16px;
	line-height: 1.6;
}

.btm-dsg-start-upload__actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 42px;
}

.btm-dsg-start-upload__btn,
.btm-dsg-start-upload__secondary {
	padding: 8px 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
	box-sizing: border-box;
}

.btm-dsg-start-upload__btn {
	border: 0;
	background: #373737;
	color: #fff;
	cursor: pointer;
}

.btm-dsg-start-upload__secondary {
	border: 1px solid #d7dce7;
	background: #fff;
	color: #27476f;
}


.btm-dsg-start-preview {
	padding: 0;
	border: 1px solid #e7eaf0;
	border-radius: 18px;
	background: #fff;
}

.btm-dsg-start-preview__image {
	width: 100%;
	height: 100%;
	border-radius: 18px;
	overflow: hidden;
	background: #fff;
}

.btm-dsg-start-preview__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.btm-dsg-start-benefits {
	display: flex;
	gap: 16px;
	margin-top: 20px;
}

.btm-dsg-start-benefit {
    flex: 1 1 0;
    padding: 18px 20px;
    border: 1px solid #d3d3d3;
    border-radius: 18px;
    background: #f8f8f8;
}

.btm-dsg-start-benefit__title {
	color: #060b2d;
	font-size: 16px;
	font-weight: 700;
}

.btm-dsg-start-benefit__text {
	margin-top: 8px;
	color: #35527b;
	font-size: 14px;
	line-height: 1.6;
}

@media (max-width: 900px) {

	.btm-dsg-start-screen {
		left: 0;
	}

	.btm-dsg-start-screen__inner {
		max-width: 650px;
		padding: 10px 0px 70px 0px
	}

	.btm-dsg-start-screen__main,
	.btm-dsg-start-benefits {
		flex-direction: column;
	}

	.btm-dsg-start-preview__placeholder {
		min-height: 240px;
	}
}

@media (max-width: 600px) {
	.btm-dsg-start-screen {
		padding: 0;
	}

	.btm-dsg-start-screen__inner {
		border-radius: 18px;
	}

	.btm-dsg-start-screen__title {
		font-size: 32px;
	}

	.btm-dsg-start-screen__subtitle {
		font-size: 15px;
	}

	.btm-dsg-start-upload {
		padding: 20px;
		border-radius: 18px;
	}

	.btm-dsg-start-upload__title {
		font-size: 22px;
	}

	.btm-dsg-start-upload__text,
	.btm-dsg-start-benefit__text {
		font-size: 14px;
	}

	.btm-dsg-start-upload__actions {
		flex-direction: column;
		margin-top: 22px;
	}

	.btm-dsg-start-upload__btn,
	.btm-dsg-start-upload__secondary {
		width: 100%;
		height: 46px;
		font-size: 14px;
	}

	.btm-dsg-start-preview__placeholder {
		min-height: 180px;
	}

	.btm-dsg-start-benefit {
		padding: 16px;
	}
}


/* TOP BAR (full-width shell + 1600px inner) */
.btm-dsg-topbar-shell {
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	background: transparent;
	border-bottom: 1px solid #e6e8ef;
}


.btm-dsg-topbar {
	height: 58px;
	max-width: 1550px;     /* same as .btm-dsg-root */
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
}

.btm-dsg-topbar-left,
.btm-dsg-topbar-right {
	display: flex;
	align-items: center;
	gap: 20px;
	min-width: 0;
}

.btm-dsg-topbar-right {
	gap: 8px;
}

/* Project dropdown */
.btm-dsg-project-dropdown {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.btm-dsg-project-toggle {
	height: 34px;
	padding: 0 12px;
	border-radius: 8px;
	border: 1px solid #d0d5e0;
	background: #ffffff;
	color: #111827;
	font-size: 16px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.btm-dsg-project-toggle:hover {
	background: #f3f4f7;
}

.btm-dsg-project-toggle-caret {
	width: 16px;
	height: 16px;
	opacity: 0.8;
}

.btm-dsg-project-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 260px;
	background: #ffffff;
	border: 1px solid #dde1ea;
	border-radius: 12px;
	box-shadow: 0 12px 26px rgba(15,23,42,0.14);
	padding: 8px;
	z-index: 400;
}




.btm-dsg-project-menu-item {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 10px;
	border-radius: 10px;
	border: none;
	background: transparent;
	cursor: pointer;
	color: #111827;
	font-size: 13px;
	text-align: left;
}

.btm-dsg-project-menu-item:hover {
	background: #f3f4f7;
}

.btm-dsg-project-menu-item-icon {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	color: #374151;
}

.btm-dsg-project-menu-divider {
	height: 1px;
	background: #e6e8ef;
	margin: 8px 2px;
}


/* Anti-theme overrides (theme often restyles inputs/buttons) */
.btm-dsg-root .btm-dsg-project-name,
.btm-dsg-root .btm-dsg-project-name-menu {
	-webkit-appearance: none !important;
	appearance: none !important;
	box-sizing: border-box !important;

	height: 34px !important;
	line-height: 34px !important;

	/* autosize via wrapper: input takes wrapper width */
	width: 100% !important;
	min-width: 140px !important;
	max-width: 350px !important;

	padding: 0 10px !important;
	margin: 0 !important;

	border-radius: 8px !important;
	border: 1px solid #d3d7e0 !important;

	/* inactive look */
	background: #ffffff !important;
	color: #111827 !important;

	font: inherit !important;
	font-size: 13px !important;

	outline: none !important;
}

.btm-dsg-root .btm-dsg-project-name:hover,
.btm-dsg-root .btm-dsg-project-name-menu:hover {
	background: #ffffff !important;
	border-color: #0073e6 !important;
	box-shadow: 0 0 0 1px rgba(0,115,230,0.12) !important;
}


.btm-dsg-root .btm-dsg-project-name:focus,
.btm-dsg-root .btm-dsg-project-name-menu:focus {
	background: #ffffff !important;
	border-color: #0073e6 !important;
	box-shadow: 0 0 0 1px rgba(0,115,230,0.2) !important;
}

.btm-dsg-root .btm-dsg-project-name::placeholder,
.btm-dsg-root .btm-dsg-project-name-menu::placeholder {
	color: #6b7280 !important;
	opacity: 1 !important;
}

/* Auto-width input without JS: wrapper + hidden sizer */
.btm-dsg-root .btm-dsg-project-name-wrap {
	display: inline-grid !important;
	align-items: center !important;
	max-width: 350px !important;
}

.btm-dsg-root .btm-dsg-project-name-wrap > input,
.btm-dsg-root .btm-dsg-project-name-wrap > .btm-dsg-project-name-sizer {
	grid-area: 1 / 1 !important;
}

.btm-dsg-root .btm-dsg-project-name-sizer {
	visibility: hidden !important;
	white-space: pre !important;

	font: inherit !important;
	font-size: 13px !important;

	height: 34px !important;
	line-height: 34px !important;

	/* must match input padding/border so width matches */
	padding: 0 10px !important;
	border: 1px solid transparent !important;

	/* clamp */
	max-width: 350px !important;
}

/* In dropdown: make project name input full width (disable autoshrink) */
.btm-dsg-root .btm-dsg-project-menu .btm-dsg-project-name-wrap {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
}

.btm-dsg-root .btm-dsg-project-menu .btm-dsg-project-name,
.btm-dsg-root .btm-dsg-project-menu .btm-dsg-project-name-menu {
	width: 100% !important;
	max-width: none !important;
}

.btm-dsg-root .btm-dsg-project-menu .btm-dsg-project-name-sizer {
	display: none !important;
}


.btm-dsg-root .btm-dsg-project-toggle {
	-webkit-appearance: none !important;
	appearance: none !important;
	box-sizing: border-box !important;

	height: 34px !important;
	line-height: 32px !important;

	padding: 0 12px !important;
	margin: 0 !important;

	border-radius: 8px !important;
	border: 1px solid #d0d5e0 !important;

	background: #ffffff !important;
	color: #111827 !important;

	font: inherit !important;
	font-size: 13px !important;
	font-weight: 600 !important;

	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;

	cursor: pointer !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

.btm-dsg-root .btm-dsg-project-toggle:hover {
	background: #f3f4f7 !important;
}



/* Save "Saved" visual (menu item uses same state) */
.btm-dsg-project-menu-item.is-saved {
	background: #e7f0ff;
}
.btm-dsg-project-menu-item.is-saved:hover {
	background: #dbe9ff;
}

/* Right download button (separate style) */
.btm-dsg-topbar-download-btn {
	height: 32px;
	padding: 0 12px;
	border-radius: 8px;
	border: 1px solid #0073e6;
	background: #0073e6;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.btm-dsg-topbar-download-btn:hover {
	background: #005bb8;
}

.btm-dsg-topbar-btn-icon {
	width: 16px;
	height: 16px;
}

/* Download dropdown */
.btm-dsg-download-menu {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.btm-dsg-download-dropdown {
	position: absolute;
	display: flex;
	flex-direction: column;
	gap: 20px;
	right: 0;
	top: calc(100% + 8px);
	width: 280px;
	background: #ffffff;
	border: 1px solid #d7dbe6;
	border-radius: 12px;
	box-shadow: 0 12px 36px rgba(15, 23, 42, 0.14);
	padding: 12px;
	z-index: 2000;
}

.btm-dsg-download-row {
	display: block;
}

.btm-dsg-download-label {
	font-size: 12px;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 8px;
}

.btm-dsg-download-seg {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}

.btm-dsg-download-seg-btn {
	height: 32px;
	border-radius: 8px;
	border: 1px solid #d7dbe6;
	background: #f8fafc;
	color: #0f172a;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	padding: 0 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.btm-dsg-download-seg-btn:hover {
	background: #eef2ff;
	border-color: #c7cdfa;
}

.btm-dsg-download-seg-btn.is-active {
    background: #e5efff;
    border-color: #0073e6;
    color: #000000;
}

.btm-dsg-download-quality {
    display: flex;
    gap: 8px;
    flex-direction: column;
    padding: 2px;
}

.btm-dsg-download-slider {
	max-width: 100% !important;
	margin: 0;
}

.btm-dsg-download-value {
	font-size: 12px;
	color: #0f172a;
}

.btm-dsg-download-help {
	font-size: 12px;
	color: #334155;
	margin-top: 8px;
	line-height: 1.6;
}

.btm-dsg-download-help-muted {
	color: #64748b;

}

.btm-dsg-download-actions {
	display: flex;
	justify-content: center;
	margin-top: 6px;
}

.btm-dsg-download-action-btn {
    width: 100%;
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #0073e6;
    background: #0073e6;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: center;
}

.btm-dsg-download-action-btn:hover {
	background: #005bb8;
}

/* Crown icon badge (free users) */
.btm-dsg-premium-badge {
	margin-left: 8px;
	display: inline-flex;
	align-items: center;
	line-height: 1;
	color: #ffb700; /* icon color via currentColor */
}

.btm-dsg-premium-badge svg {
	width: 19px;
	height: 19px;
	display: block;
}

/* Top bar: Get Premium button */
.btm-dsg-topbar-premium-btn {
	height: 32px;
	padding: 0 12px;
	border-radius: 8px;
	border: 1px solid #f59e0b;
	background: #fff7ed;
	color: #92400e;
	font-size: 13px;
	font-weight: 700;
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: center;
	gap: 6px;
	cursor: pointer;
}

.btm-dsg-topbar-premium-btn:hover {
	background: #ffffff;
}

/* Crown icon inside Get Premium button */
.btm-dsg-topbar-premium-icon {
	padding-bottom: 2px;
	color: #f59e0b; /* controls SVG fill via currentColor */
}

.btm-dsg-topbar-premium-icon svg {
	width: 16px;
	height: 16px;
	display: block;
}


/* Download radio (two-panel mode) */
.btm-dsg-download-radio {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
}

.btm-dsg-download-radio-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border: 1px solid #d7dbe6;
	border-radius: 10px;
	background: #f8fafc;
	cursor: pointer;
	user-select: none;
}

.btm-dsg-download-radio-item:hover {
	background: #eef2ff;
	border-color: #c7cdfa;
}

.btm-dsg-download-radio-input {
	margin: 0;
}

.btm-dsg-download-radio-text {
	font-size: 12px;
	font-weight: 700;
	color: #0f172a;
}


/* Responsive: move project name between topbar and dropdown menu */
@media (max-width: 740px) {
	/* hide desktop name wrapper (next to dropdown) */
	.btm-dsg-root .btm-dsg-topbar-left > .btm-dsg-project-name-wrap {
		display: none !important;
	}

	/* show menu name wrapper */
	.btm-dsg-root .btm-dsg-project-menu .btm-dsg-project-name-wrap {
		display: inline-grid !important;
		padding: 8px;
	}
}

@media (min-width: 741px) {
	/* show desktop name wrapper */
	.btm-dsg-root .btm-dsg-topbar-left > .btm-dsg-project-name-wrap {
		display: inline-grid !important;
	}

	/* hide menu name wrapper completely (prevents taking height) */
	.btm-dsg-root .btm-dsg-project-menu .btm-dsg-project-name-wrap {
		display: none !important;
	}
}



/* FORMAT BAR */
/* Container */
.btm-dsg-format-bar {
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        gap: 8px;
        background: #ffffff;
        border-radius: 10px;
        box-shadow: 0 8px 18px rgba(15,23,42,0.12);
        padding: 6px 10px;
        border: 1px solid #e2e4ec;
        z-index: 240;
    }
    .btm-dsg-format-group {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding-right: 6px;
        margin-right: 4px;
        border-right: 1px solid #e2e4ec;
    }
    .btm-dsg-format-group:last-child {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
    }

/* TOOLS */
/* Tool panels containers */
.btm-dsg-tools-panel {
        position: absolute;
        top: 68px;
        left: 18px;
        z-index: 30;
        background: #ffffff;
        border-radius: 10px;
        border: 1px solid #dde1ea;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
        padding: 10px 6px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 96px;
    }

.btm-dsg-sidepanel {
        position: absolute;
        top: 68px;
        left: 130px;
        z-index: 35;
        background: #ffffff;
        border-radius: 10px;
        border: 1px solid #dde1ea;
        box-shadow: 0 8px 18px rgba(15,23,42,0.12);
        width: 260px;
        padding: 10px 12px 12px;
        font-size: 12px;
    }

/* UI ELEMENTS */
/* Tool buttons */
.btm-dsg-tool-btn {
        width: 100%;
        padding: 6px 4px;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        cursor: pointer;
        border: none;
        background: transparent;
        color: #333;
        font-size: 11px;
    }
    .btm-dsg-tool-btn:hover {
        background: #f2f4f8;
    }
    .btm-dsg-tool-icon {
        width: 26px;
        height: 26px;
        display: inline-block;
        color: #444;
    }
    .btm-dsg-tool-label {
        font-size: 12px;
        line-height: 1.1;
        text-align: center;
    }

/* Pills */

.btm-dsg-pill-button {
        font-size: 12px;
        padding: 4px 8px;
        border-radius: 6px;
        background: #f3f4f7;
        border: 1px solid #e1e3ec;
		white-space: nowrap;	
        cursor: pointer;
		color: #030303;
    }
    .btm-dsg-pill-button:hover {
        background: #e7e9f2;
    }

    .btm-dsg-pill-input {
        font-size: 12px !important;
        padding: 4px 8px !important;
        border-radius: 6px !important;
        border: 1px solid #d3d7e0;
        height: 28px !important;
    }
    .btm-dsg-pill-input:focus {
        outline: none;
        border-color: #0073e6;
        box-shadow: 0 0 0 1px rgba(0,115,230,0.2);
    }

	.btm-dsg-fontsize-input {
		width: 60px !important;
		max-width: 60px;
		text-align: center;
		font-weight: 600 !important;
		font-size: 14px !important;
	}
			  
	
	.btm-dsg-fontsize-input::-webkit-outer-spin-button,
	.btm-dsg-fontsize-input::-webkit-inner-spin-button {
		-webkit-appearance: none;
		margin: 0;
	}

	
	.btm-dsg-fontsize-input[type="number"] {
		-moz-appearance: textfield;
	}			  

/* Font dropdown */
			  
    .btm-dsg-font-dropdown {
        position: relative;
        width: 160px;
        max-width: 220px;
        font-size: 14px;
    }

    .btm-dsg-font-dropdown-toggle {
        width: 100%;
        height: 28px;
        padding: 4px 8px 4px 8px;
        border-radius: 6px;
        border: 1px solid #d3d7e0;
        background: #ffffff;
		color: #171717;
        cursor: pointer;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .btm-dsg-font-dropdown-toggle:hover {
        background: #f0f3f8;
    }

    .btm-dsg-font-dropdown-label {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .btm-dsg-font-dropdown-arrow {
        font-size: 20px;
        color: #6b7280;
        flex-shrink: 0;
    }

    .btm-dsg-font-dropdown-menu {
        position: absolute;
        top: 30px;
        left: 0;
        width: 220px;
        max-height: 260px;
        overflow-y: auto;
        border-radius: 8px;
        border: 1px solid #d3d7e0;
        background: #ffffff;
        box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
        z-index: 60;
    }

    .btm-dsg-font-dropdown-item {
        width: 100%;
        padding: 6px 10px;
        border: none;
        background: transparent;
        text-align: left;
        font-size: 15px;
   		color: #171717;
        cursor: pointer;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .btm-dsg-font-dropdown-item:hover {
        background: #f3f4f7;
    }

    .btm-dsg-font-dropdown-item.is-active {
        background: #eaf3ff;
        border-left: 3px solid #0073e6;
        padding-left: 7px;
    }

/* Format buttons */
			  
			  
    .btm-dsg-format-btn {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        //border: 1px solid #d3d7e0;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
    }
    .btm-dsg-format-btn:hover {
        background: #f0f3f8;
    }
			  
	.btm-dsg-format-btn--active {
		background: #e5efff;
		border-color: #0073e6;
	}





.btm-dsg-format-btn--crop {
    width: auto;
    padding: 0 10px;
    gap: 6px;
    border-radius: 8px;
    border: 1px solid #d3d7e0;
    background: #f8fafc;
    font-size: 12px;
    line-height: 1;
    color: #111827;
    white-space: nowrap;
}

.btm-dsg-format-btn--crop:hover {
    background: #eef2f7;
}

.btm-dsg-format-btn--crop.btm-dsg-format-btn--active {
    background: #e5efff;
    border-color: #0073e6;
    color: #0b3b8a;
}

.btm-dsg-format-btn--crop .btm-dsg-format-icon {
    width: 18px;
    height: 18px;
}

.btm-dsg-format-crop-label {
    font-weight: 600;
    font-size: 12px;
}

/* Format dropdown */
			  
			  

.btm-dsg-format-dropdown {
    position: relative;
    height: 28px;
	display: flex;
    align-items: center;
}

.btm-dsg-format-dropdown-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 42px;
}

.btm-dsg-dropdown-caret {
    color: #646464;
    font-size: 16px;
}

.btm-dsg-format-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    padding: 10px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #d3d7e0;
    box-shadow: 0 8px 18px rgba(15,23,42,0.12);
    display: flex;
    gap: 4px;
    z-index: 50;
}
			  

.btm-dsg-format-dropdown-menu.btm-dsg-format-dropdown-menu--panel {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.btm-dsg-textfill-trigger {
    position: relative;
    overflow: hidden;
	width: 26px;
	height: 22px;
	border: 1px solid #9f9f9f;
}

.btm-dsg-format-dropdown-menu.btm-dsg-format-dropdown-menu--textfill {
    min-width: 260px;
    width: 260px;
}

.btm-dsg-format-tabs {
    display: flex;
    gap: 6px;
}

.btm-dsg-format-tab-btn {
    flex: 1;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f3f4f7;
    color: #111827;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.btm-dsg-format-tab-btn:hover {
    background: #eef2f7;
}

.btm-dsg-format-tab-btn.is-active {
    background: #e5efff;
    border-color: #0073e6;
    color: #0b3b8a;
}

.btm-dsg-textfill-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btm-dsg-textfill-label {
    font-size: 12px;
    color: #4b5563;
}

.btm-dsg-textfill-divider {
    height: 10px;
}

.btm-dsg-slider-input {
    width: 40px !important;
    text-align: right;
    font-size: 12px !important;
    line-height: 1.3 !important;
    padding: 3px 6px !important;
    border-radius: 6px !important;
    border: 1px solid #d3d7e0 !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
    height: 26px !important;
}

.btm-dsg-slider-input:focus {
    outline: none;
    border-color: #0073e6;
    box-shadow: 0 0 0 1px rgba(0,115,230,0.2);
}
				  

.btm-dsg-format-dropdown-item {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.btm-dsg-format-dropdown-item:hover {
    background: #f0f3f8;
}

.btm-dsg-format-dropdown-item.is-active {
    background: #eaf3ff;
}



.btm-dsg-border-style-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
		justify-content: space-between;
}

.btm-dsg-border-style-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 48px !important;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #c8c8c8;
    background: #ffffff;
    cursor: pointer;
    padding: 0;
}

.btm-dsg-border-style-btn:hover {
    background: #f0f3f8;
}

.btm-dsg-border-style-btn.is-active {
    border-color: #0073e6;
    background: #eaf3ff;
}

.btm-dsg-border-style-btn--none {
    width: auto;
    padding: 0 8px;
    justify-content: center;
}

.btm-dsg-border-style-none-label {
    font-size: 11px;
    color: #374151;
}

.btm-dsg-border-style-preview {
    flex: 0 0 20px;
    height: 0;
    border-top-width: 2px;
    border-top-style: solid;
    border-top-color: #4b5563;
}

.btm-dsg-border-style-preview--dashed {
    border-top-style: dashed;
}

.btm-dsg-border-style-preview--dotted {
    border-top-style: dotted;
}


.btm-dsg-border-width-group {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.btm-dsg-border-width-label,
.btm-dsg-border-width-unit {
    color: #4b5563;
}

.btm-dsg-root .btm-dsg-format-bar .btm-dsg-slider-input:focus {
    outline: none !important;
    border-color: #0073e6 !important;
    box-shadow: 0 0 0 1px rgba(0,115,230,0.2) !important;
}

				  

.btm-dsg-root .btm-dsg-sidepanel-background .btm-dsg-slider-input {
    width: 52px;
    text-align: right;
    font-size: 12px !important;
    line-height: 1.3 !important;
    padding: 3px 6px !important;
    border-radius: 6px !important;
    border: 1px solid #d3d7e0 !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
    height: 26px !important;
}

.btm-dsg-root .btm-dsg-sidepanel-background .btm-dsg-slider-input:focus {
    outline: none !important;
    border-color: #0073e6 !important;
    box-shadow: 0 0 0 1px rgba(0,115,230,0.2) !important;
}
				  
				  

.btm-dsg-slider-input::-webkit-outer-spin-button,
.btm-dsg-slider-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btm-dsg-slider-input[type="number"] {
    -moz-appearance: textfield;
}

/* Border controls */
.btm-dsg-slider-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btm-dsg-slider-label {
    font-size: 11px;
    color: #4b5563;
}

.btm-dsg-slider-row {
    display: flex;
    align-items: center;
    gap: 6px;
		justify-content: flex-end;
}

.btm-dsg-slider {
    flex: 1 1 auto;
    min-width: 0;
	max-width: 120px;
    height: 4px;
    border-radius: 999px;
    background: #e5e7eb;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.btm-dsg-slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: #e5e7eb;
}

.btm-dsg-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #0073e6;
    margin-top: -5px;
}

.btm-dsg-slider::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: #e5e7eb;
}

.btm-dsg-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #0073e6;
    border: none;
}

/* Effects */
.btm-dsg-effects-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
}

.btm-dsg-effects-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btm-dsg-effects-row.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.btm-dsg-effects-label {
    font-size: 12px;
    color: #4b5563;
}
				  
.btm-dsg-effects-divider {
    height: 10px;
}
				  

/* Toggle */
.btm-dsg-toggle {
    position: relative;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #e5e7eb;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btm-dsg-toggle-thumb {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15,23,42,0.25);
    left: 2px;
    transition: transform 0.15s ease;
}

.btm-dsg-toggle.is-on {
    background: #0073e6;
    border-color: #0073e6;
}

.btm-dsg-toggle.is-on .btm-dsg-toggle-thumb {
    transform: translateX(14px);
}

/* Icons */
	.btm-dsg-format-icon {
		display: flex;
		width: 20px;
		height: 20px;
		color: #333;
		flex-direction: column;
		justify-content: center;
    }
			  
    .btm-dsg-color-input {
        width: 32px;
        height: 28px;
        border-radius: 6px;
        border: 1px solid #d3d7e0;
        padding: 2px;
        cursor: pointer;
    }

/* Sidepanel controls */
.btm-dsg-sidepanel-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-weight: 600;
        font-size: 15px;
        color: #151515;
        margin-bottom: 15px;
		padding-left: 3px;
    }
    .btm-dsg-sidepanel-close {
        border: none;
        background: transparent;
        cursor: pointer;
        font-size: 20px;
        line-height: 1;
        padding: 2px 4px;
        color: #3f4247;
    }
    .btm-dsg-sidepanel-close:hover {
        color: #111827;
    }
    .btm-dsg-sidepanel-body label {
        font-size: 12px;
        color: #6b7280;
        margin-bottom: 4px;
        display: block;
    }
    .btm-dsg-sidepanel-input {
        width: 100%;
		min-height: 85px !important;
        font-size: 12px;
        padding: 4px 8px;
        border-radius: 6px;
        border: 1px solid #d3d7e0;
        resize: vertical;
		margin-bottom: 10px;
    }
    .btm-dsg-sidepanel-input:focus {
        outline: none;
        border-color: #0073e6;
        box-shadow: 0 0 0 1px rgba(0,115,230,0.2);
    }
    .btm-dsg-sidepanel-btn {
        margin-top: 8px;
        padding: 6px 10px;
        font-size: 12px;
		font-weight: 600;
        border-radius: 6px;
        border: 1px solid #0073e6;
        background: #0073e6;
        color: #ffffff;
        cursor: pointer;
    }
    .btm-dsg-sidepanel-btn:hover {
        background: #005bb8;
    }

.btm-dsg-sidepanel-tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 18px;
}

.btm-dsg-sidepanel-tabs .btm-dsg-sidepanel-btn {
	flex: 1;
	margin-top: 0;
	background: #e5e7eb;
	border-color: #d1d5db;
	color: #111827;
}

.btm-dsg-sidepanel-tabs .btm-dsg-sidepanel-btn.is-active {
	background: #0073e6;
	border-color: #0073e6;
	color: #ffffff;
}

    .btm-dsg-sidepanel-note {
        font-size: 11px;
        color: #6b7280;
        margin-top: 14px;
    }


/* Image library grid (Tools -> Add image) */
.btm-dsg-image-library-grid {
        margin-top: 10px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
}
.btm-dsg-image-library-item {
        width: 100%;
        aspect-ratio: 1 / 1;
        border: 1px solid #d3d7e0;
        border-radius: 8px;
        overflow: hidden;
        background: #f3f4f6;
        cursor: pointer;
}
.btm-dsg-image-library-item:hover {
        border-color: #111827;
}

.btm-dsg-image-library-thumb {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
}


/* Layer list */
    .btm-dsg-layer-list {
        margin-top: 6px;
		padding-right: 6px;
        max-height: 260px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;

    }

    body.btm-dsg-layer-reorder-active {
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    .btm-dsg-layer-item {
        position: relative;
        display: flex;
        align-items: center;
        padding: 6px 8px;
        margin-bottom: 4px;
        border-radius: 8px;
        background: #f3f4f7;
        border: 1px solid transparent;
        cursor: pointer;
        will-change: transform;
    }

    .btm-dsg-layer-item--selected {
        border-color: #0073e6;
        background: #eaf3ff;
    }

    /* “взяли карточку” — другой цвет */
    .btm-dsg-layer-item--dragging {
        border-color: #f59e0b;
        background: #fff3d6;
        z-index: 5;
    }

    /* плавное “раздвигание” соседей */
    .btm-dsg-layer-item--reorder-anim {
        transition: transform 190ms ease;
    }

    .btm-dsg-layer-item-type {
        font-size: 10px;
        text-transform: uppercase;
        color: #6b7280;
        margin-right: 6px;
        flex: 0 0 auto;
    }

    .btm-dsg-layer-item-label {
        flex: 1 1 auto;
        font-size: 12px;
        color: #111827;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-right: 6px;
    }

    /* drag только по хендлу (широкий hit-area, touch-friendly) */
    .btm-dsg-layer-item-handle-btn {
        flex: 0 0 auto;
        width: 34px;
        height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 0;
        border-radius: 8px;
        color: #252525;
        cursor: grab;
        font-size: 16px;
        line-height: 1;
        touch-action: none;
        user-select: none;
    }

    .btm-dsg-layer-item-handle-btn:active {
        cursor: grabbing;
    }

    @media (pointer: coarse) {
        .btm-dsg-layer-list {
            max-height: 40vh;
        }

        .btm-dsg-layer-item {
            padding: 12px 12px;
            border-radius: 10px;
        }

        .btm-dsg-layer-item-type {
            font-size: 11px;
            margin-right: 8px;
        }

        .btm-dsg-layer-item-label {
            font-size: 14px;
        }

        .btm-dsg-layer-item-handle-btn {
            width: 48px;
            height: 38px;
            font-size: 18px;
        }
    }


/* Color controls */
	.btm-dsg-color-wrapper {
		position: relative;
		width: 25px;
		height: 22px;
		border-radius: 6px;
		border: 1px solid #989898;
		background: #ffffff;
		cursor: pointer;
		overflow: hidden;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		margin-top: 2px;
		padding: 0;
appearance: none;
-webkit-appearance: none;

	}

	.btm-dsg-color-wrapper:hover {
		background: #f0f3f8;
	}

.btm-dsg-color-wrapper--lg {
	width: 35px;
	height: 30px;
	border-radius: 8px;
}

/* Background gradient stops */
.btm-dsg-bg-stops-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: flex-start;
	margin-top: 6px;
}

.btm-dsg-bg-stop-tile {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.btm-dsg-bg-stop-add {
	width: 35px;
	height: 30px;
	border-radius: 8px;
	border: 1px dashed #cbd5e1;
	background: #f8fafc;
	color: #111827;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 1;
	font-size: 14px;
}

.btm-dsg-bg-stop-add:hover {
	background: #eef2f7;
}

.btm-dsg-bg-stop-remove {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 16px;
	height: 16px;
	border-radius: 999px;
	border: 1px solid #d1d5db;
	background: #ffffff;
	color: #111827;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	font-size: 12px;
}

.btm-dsg-bg-stop-remove:hover {
	background: #f3f4f6;
}

	.btm-dsg-color-swatch {
		position: absolute;
		inset: 0px;
		border-radius: 4px;
	}

	.btm-dsg-color-input {
		position: absolute;
		inset: 0;
		opacity: 0;
		border: 0;
		margin: 0;
		padding: 0;
		cursor: pointer;
	}


/* Background image preview */
.btm-dsg-bg-image-row {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-top: 6px;
}

.btm-dsg-bg-image-thumb {
	width: 100px;
	height: 100px;
	border-radius: 12px;
	border: 1px solid #d1d5db;
	background: #f3f4f6;
	object-fit: cover;
	display: block;
}

.btm-dsg-bg-image-thumb--placeholder {
	border-style: dashed;
	color: #6b7280;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 8px;
}


.btm-dsg-bg-image-actions {
	display: flex;
	flex-direction: column; 
	gap: 6px;
}



/* Shapes panel */
.btm-dsg-shapes-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 2px;
}

.btm-dsg-shapes-row {
    display: flex;
    flex-wrap: wrap;              
    gap: 8px;
}

.btm-dsg-shapes-item {
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    outline: none;
    padding: 5px;
}

.btm-dsg-shapes-item:focus-visible {
    outline: 2px solid rgba(0,115,230,0.35);
    outline-offset: 1px;
}

.btm-dsg-shapes-item:hover {
    background: #eef2ff;
    border-color: #d1d5db;
}

.btm-dsg-shapes-icon {
    display: block;
    color: #9ca3af; 
    pointer-events: none;
	width: 100%; 
	height: 100%;
    flex: 0 0 auto;
}

.btm-dsg-shapes-item:hover .btm-dsg-shapes-icon {
    color: #6b7280;
}

/* CANVAS ELEMENTS */
/* Canvas area */
.btm-dsg-canvas-area {
        flex: 1;
        position: relative;
        padding: 64px 30px 34px 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        max-width: 100%;
        max-height: 100%;
		min-height: 0;
    }

	.btm-dsg-canvas-frame {
		width: 100%;
		height: 100%;
		min-width: 0;
		min-height: 0;
		position: relative;
		box-sizing: border-box;
		overflow: hidden;
	}

	.btm-dsg-canvas-inner {
		width: 100%;
		height: 100%;
		min-width: 0;
		min-height: 0;
		display: flex;
		justify-content: center;
		align-items: center;
		overflow: hidden;
		touch-action: none;
		overscroll-behavior: none;

	}


    .btm-dsg-canvas-placeholder {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #999;
        font-size: 14px;
        pointer-events: none;
    }


/* Canvas zoom controls */
.btm-dsg-canvas-zoom-controls {
	position: fixed;
	left: 50%;
	bottom: 12px;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 200;
	padding: 6px 10px;
	border-radius: 10px;
	background: rgba(255,255,255,0.92);
	border: 1px solid #d1d5db;
	box-shadow: 0 6px 18px rgba(15,23,42,0.12);
	backdrop-filter: blur(6px);
}

.btm-dsg-canvas-zoom-button {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	/* border: 1px solid #d1d5db; */
	background: #ffffff;
	color: #4e4e4e;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.btm-dsg-canvas-zoom-button:hover {
	background: #f3f4f6;
}

.btm-dsg-canvas-zoom-button.is-active {
	background: rgb(151 151 151 / 12%);
	/* border-color: rgba(0, 115, 230, 0.55); */
	/* color: #0073e6; */
}

.btm-dsg-canvas-zoom-label {
	min-width: 44px;
	text-align: center;
	font-size: 13px;
	color: #111827;
	font-weight: 600;
	user-select: none;
}

.btm-dsg-canvas-zoom-dropdown {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.btm-dsg-canvas-zoom-dropdown-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid transparent;
	background: transparent;
	padding: 0;
	cursor: pointer;
}

.btm-dsg-canvas-zoom-dropdown-button:hover .btm-dsg-canvas-zoom-label {
	color: #0073e6;
}

.btm-dsg-canvas-zoom-dropdown-caret {
	font-size: 22px;
	line-height: 1;
	color: #6b7280;
	user-select: none;
}

.btm-dsg-canvas-zoom-dropdown-menu {
	position: absolute;
	left: 50%;
	bottom: 42px;
	transform: translateX(-50%);
	min-width: 100px;
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 12px;
	box-shadow: 0 10px 28px rgba(15,23,42,0.18);
	padding: 6px;
	z-index: 60;
}

.btm-dsg-canvas-zoom-dropdown-item {
	width: 100%;
	text-align: left;
	border: 1px solid transparent;
	background: transparent;
	padding: 8px 10px;
	border-radius: 10px;
	cursor: pointer;
	font-size: 13px;
	color: #111827;
}

.btm-dsg-canvas-zoom-dropdown-item:hover {
	background: #f3f4f6;
}

.btm-dsg-canvas-zoom-dropdown-item.is-active {
	background: rgba(0,115,230,0.12);
	border-color: rgba(0,115,230,0.35);
	color: #0073e6;
}

.btm-dsg-canvas-zoom-dropdown-divider {
	height: 1px;
	background: #e5e7eb;
	margin: 6px 4px;
	border-radius: 999px;
}

.btm-dsg-canvas-pan-controls {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.btm-dsg-canvas-zoom-separator {
	width: 1px;
	height: 18px;
	background: #d1d5db;
	margin: 0 2px;
	border-radius: 999px;
}

.btm-dsg-canvas-pan-icon {
	width: 18px;
	height: 18px;
	display: block;
}

@media (max-width: 900px) {
	.btm-dsg-canvas-zoom-controls {
		bottom: calc(var(--btm-dsg-mobile-tools-h) + 12px + env(safe-area-inset-bottom));
		z-index: 210;
	}	
}

/* Mobile: keep only percent + dropdown */
@media (max-width: 600px) {
	/* Hide Select/Pan group */
	.btm-dsg-canvas-pan-controls {
		display: none;
	}

	/* Hide +/- buttons (they are direct children of .btm-dsg-canvas-zoom-controls) */
	.btm-dsg-canvas-zoom-controls > .btm-dsg-canvas-zoom-button {
		display: none;
	}

	/* Hide separator */
	.btm-dsg-canvas-zoom-separator {
		display: none;
	}

	/* Tighten spacing since only dropdown remains */
	.btm-dsg-canvas-zoom-controls {
		gap: 0;
		padding: 6px 10px;
	}

	/* Canvas zoom controls: above tools, right side */
	.btm-dsg-canvas-zoom-controls {
		left: auto;
		right: 12px;
		transform: none;

	}

}




/* CANVAS ELEMENTS */
/* Inline text editor */
.btm-dsg-inline-edit-input {
    position: absolute;
    z-index: 45;
    font-size: 14px;
    line-height: 1.3;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #0073e6;
    box-shadow: 0 4px 10px rgba(15,23,42,0.18);
    display: block;
    background-color: #ffffff !important;
    color: #111827;
    min-height: 56px;
    resize: vertical;
    overflow: auto;
}

    .btm-dsg-inline-edit-input:focus {
        outline: none;
        box-shadow: 0 0 0 1px rgba(0,115,230,0.35), 0 4px 10px rgba(15,23,42,0.18);
    }

.btm-dsg-inline-edit-input::-webkit-scrollbar {
    width: 6px;
}

.btm-dsg-inline-edit-input::-webkit-scrollbar-track {
    background: transparent;
}

.btm-dsg-inline-edit-input::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.btm-dsg-inline-edit-input::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.btm-dsg-inline-edit-input {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* LEFTOVERS / MISC */
.btm-dsg-app:not(.btm-dsg-ready) .btm-dsg-tools-panel,
.btm-dsg-app:not(.btm-dsg-ready) .btm-dsg-sidepanel,
.btm-dsg-app:not(.btm-dsg-ready) .btm-dsg-format-bar,
.btm-dsg-app:not(.btm-dsg-ready) .btm-dsg-canvas-zoom-controls {
    visibility: hidden;
}
				  
				  
				  

/* ==========================================================================
   MOBILE LAYOUT (<= 900px) — Step 1: Tools bottom bar + zoom above + panels above tools
   ========================================================================== */
@media (max-width: 900px) {

	:root {
		/* Height of bottom tools bar (used by zoom + panels offsets) */
		--btm-dsg-mobile-tools-h: 62px;
	}

	/* iOS Safari: prevent viewport zoom on focus (font-size must be >= 16px) */
	.btm-dsg-inline-edit-input,
	.btm-dsg-sidepanel-input {
		font-size: 16px;
	}


/* Format bar: wrap + fixed bottom (mobile) */
	.btm-dsg-format-bar {
		position: fixed;
		top: auto;
		bottom: 10px;

		left: 0;
		right: 0;
		margin: 0 auto;

		width: fit-content;
		max-width: calc(100% - 20px);
        min-height: 80px;

		transform: none;

		/* wrap instead of scroll */
		flex-wrap: wrap;

		/* do not clip dropdowns */
		overflow: visible;

		/* small breathing room + safe area */
		padding-bottom: calc(6px + env(safe-area-inset-bottom));
	}
	
	.btm-dsg-format-btn--clear-selection {
		position: absolute;
    	right: 3px;
    	top: -30px;  
		border-radius: 999px;
		width: 24px;
		height: 24px;
		box-shadow: 0 0 2px 0px rgb(0 0 0 / 55%);
	}

	input.btm-dsg-pill-input.btm-dsg-fontsize-input {
		width: 40px !important;
	}

	.btm-dsg-font-dropdown {
		width: 120px;
	}


	/* Prevent groups from shrinking too much while scrolling */
	.btm-dsg-format-group {
		flex: 0 0 auto;
	}

/* Mobile dropdowns (format + fonts): open above format bar (wrap-safe) */
	.btm-dsg-format-dropdown-menu,
	.btm-dsg-font-dropdown-menu {
		position: fixed;
		top: auto;

		/* centered like current mobile behavior */
		left: 50%;
		transform: translateX(-50%);

		/* always above whole format bar (dynamic height) */
		bottom: calc(var(--btm-dsg-format-bar-h, 0px) + 12px + 10px);

		margin-top: 0;
		z-index: 240 !important;

		max-width: calc(100vw - 24px);
	}


	/* Comfortable width for panel-like dropdowns on mobile */
	.btm-dsg-format-dropdown-menu.btm-dsg-format-dropdown-menu--panel,
	.btm-dsg-format-dropdown-menu.btm-dsg-format-dropdown-menu--textfill,
	.btm-dsg-font-dropdown-menu {
		width: min(300px, calc(100vw - 24px));
	}

	/* Font menu should be taller on mobile */
	.btm-dsg-font-dropdown-menu {
		max-height: 55dvh;
	}


	/* Tools: fixed bottom bar, edge-to-edge, buttons centered */
	.btm-dsg-tools-panel {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;

		width: auto;
		height: calc(var(--btm-dsg-mobile-tools-h) + env(safe-area-inset-bottom));

		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		gap: 6px;

		padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
		background: #ffffff;

		/* no floating style */
		border-radius: 0;
		box-shadow: none;
		border: none;
		border-top: 1px solid #dde1ea;

		z-index: 220;
	}

	/* Tool buttons: do not stretch, stay grouped in center */
	.btm-dsg-tool-btn {
		width: auto;
		flex: 0 0 auto;
		padding: 4px 4px;
	}

	.btm-dsg-tool-icon {
		width: 26px;
		height: 26px;
	}

	.btm-dsg-tool-label {
		font-size: 12px;
		white-space: nowrap;
	}


	/* Side panels: temporarily show above tools bar, centered, max 300px */
	.btm-dsg-sidepanel {
		position: fixed;
		left: 50%;
		right: auto;
		transform: translateX(-50%);

		top: auto;
		bottom: calc(var(--btm-dsg-mobile-tools-h) + 12px + env(safe-area-inset-bottom));

		width: min(300px, calc(100vw - 24px));
		max-height: 55dvh;
		overflow: auto;

		z-index: 230;
	}

	/* Mobile: when a normal element is selected (text/image/shape), hide tools + side panels + zoom */
	.btm-dsg-root.btm-dsg-mobile-has-selection .btm-dsg-tools-panel,
	.btm-dsg-root.btm-dsg-mobile-has-selection .btm-dsg-sidepanel,
	.btm-dsg-root.btm-dsg-mobile-has-selection .btm-dsg-canvas-zoom-controls {
		display: none !important;
	}




	/* Make sure canvas area is not hidden under bottom tools bar */
	.btm-dsg-canvas-area {
		padding-left: 12px;
		padding-right: 12px;
        padding-top: 10px;
		padding-bottom: calc(var(--btm-dsg-mobile-tools-h) + 18px + env(safe-area-inset-bottom));
	}





}


@media (max-width: 600px) {
	.btm-dsg-canvas-area {
		padding-left: 0px;
		padding-right: 0px;
		padding-top: 10px;
        padding-bottom: 65px;
	}
}

/* Touch devices: prevent double-tap zoom on UI buttons/controls */
@media (hover: none) and (pointer: coarse) {
	.btm-dsg-topbar-btn,
	.btm-dsg-tool-btn,
	.btm-dsg-sidepanel-btn,
	.btm-dsg-sidepanel-close,
	.btm-dsg-upload-btn,

	.btm-dsg-format-btn,
	.btm-dsg-format-dropdown-button,
	.btm-dsg-textfill-trigger,
	.btm-dsg-format-tab-btn,
	.btm-dsg-format-dropdown-item,

	.btm-dsg-font-dropdown-toggle,
	.btm-dsg-font-dropdown-item,

	.btm-dsg-canvas-zoom-button,
	.btm-dsg-canvas-zoom-dropdown-button,
	.btm-dsg-canvas-zoom-dropdown-item,

	.btm-dsg-shapes-item,
	.btm-dsg-toggle,
	.btm-dsg-pill-button,

	.btm-dsg-bg-stop-add,
	.btm-dsg-border-style-btn,

	/* slider controls */
	.btm-dsg-slider,
	.btm-dsg-slider-input {
		touch-action: manipulation;
	}
}

/* Touch slider UX (bigger hit area + bigger thumb) */
@media (any-pointer: coarse) {
    .btm-dsg-slider {
        max-width: none;
        height: 28px;          /* bigger tap/drag area */
        background: transparent;
        touch-action: none;    /* prevent scroll while dragging */
        -webkit-tap-highlight-color: transparent;
    }

    .btm-dsg-slider::-webkit-slider-runnable-track {
        height: 4px;           /* keep thin track */
        border-radius: 999px;
        background: #e5e7eb;
    }

    .btm-dsg-slider::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
        border-radius: 999px;
        background: #0073e6;
        margin-top: -8px;      /* (thumb 20 - track 4) / 2 */
    }

    .btm-dsg-slider::-moz-range-thumb {
        width: 20px;
        height: 20px;
        border-radius: 999px;
        background: #0073e6;
        border: none;
    }
}
