/* --- 꾸미기 툴바 --- */
#mobile-toolbar {
    background: white;
    border-radius: 25px 25px 0 0;
    padding: 7px 20px 10px 20px;
    /* 하단 패딩 20px -> 10px 축소 */
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 3px solid #15273f;
    border-bottom: none;
}

.toolbar-handle {
    width: 100%;
    height: 24px;
    /* 높이 30px -> 24px 축소 */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-bottom: 2px;
    padding-top: 2px;
    gap: 10px;
    color: #0B1026;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.toolbar-handle::before,
.toolbar-handle::after {
    content: "";
    height: 1.5px;
    width: 35px;
    background-color: #0B1026;
    border-radius: 2px;
}

#toolbar-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 262px;
    max-height: 34vh;
    overflow: hidden;
    opacity: 1;
    transition: height 0.4s, max-height 0.4s, opacity 0.3s;
}

#toolbar-content::-webkit-scrollbar {
    display: none;
}

#mobile-toolbar.collapsed #toolbar-content {
    height: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.palette-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, 52px);
    justify-content: space-between;
    gap: 10px 12px;
    padding: 6px 8px;
}

.drawer-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 18px;
    padding: 2px 8px 7px;
    border-bottom: 1px solid rgba(21, 39, 63, 0.16);
}

.drawer-tab {
    border: none;
    background: transparent;
    color: rgba(21, 39, 63, 0.46);
    border-radius: 0;
    min-height: 24px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.drawer-tab.active {
    color: #15273f;
    font-weight: 900;
}

.drawer-item-grid {
    min-height: 0;
    max-height: 126px;
    align-content: start;
    align-items: start;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    overflow-anchor: none;
}

.drawer-item-grid::-webkit-scrollbar {
    display: none;
}

.drawer-set-row {
    position: relative;
    display: block;
    padding: 6px 0 4px;
    border-bottom: 1px solid rgba(21, 39, 63, 0.16);
}

.drawer-set-scroll {
    display: flex;
    gap: 12px;
    min-height: 62px;
    max-height: 62px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-behavior: smooth;
    padding: 0 8px;
}

.drawer-set-scroll::-webkit-scrollbar {
    display: none;
}

.drawer-set-nav {
    position: absolute;
    top: 6px;
    width: 22px;
    height: 52px;
    border: none;
    background: transparent;
    color: rgba(21, 39, 63, 0.58);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    z-index: 2;
}

.drawer-set-nav-prev {
    left: 0;
}

.drawer-set-nav-next {
    right: 0;
}

.drawer-set-nav:disabled {
    opacity: 0.18;
    cursor: default;
}

.drawer-set-nav[hidden] {
    display: none;
}

.drawer-item-scroll {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding-top: 1px;
    overflow: hidden;
    overflow-anchor: none;
}

.drawer-item-grid[hidden] {
    display: none;
}

.drawer-item-grid .palette-add-btn {
    align-self: start;
}

.drawer-set-thumb {
    font-size: 18px;
    font-weight: 900;
    color: #15273f;
    text-transform: lowercase;
    border: 2px solid transparent;
    padding: 0;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.sticker-origin.drawer-my-thumb {
    font-size: 13px;
    line-height: 1;
}

.drawer-set-thumb.active {
    border-color: #15273f;
    box-shadow: 0 0 0 2px rgba(21, 39, 63, 0.1);
}

.drawer-empty-text {
    grid-column: 1 / -1;
    color: #87909a;
    font-size: 12px;
    font-weight: 700;
    padding: 18px 4px;
    text-align: center;
}

.drawer-limit-text {
    color: rgba(21, 39, 63, 0.58);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    padding: 1px 0 0;
    text-align: right;
}

.drawer-footer-row {
    display: flex;
    align-items: center;
    flex: 0 0 18px;
    justify-content: space-between;
    gap: 8px;
    padding: 0 8px;
}

.drawer-footer-row[hidden] {
    display: none;
}

.drawer-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: none;
    background: transparent;
    color: rgba(255, 107, 107, 0.82);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    padding: 2px 0;
    cursor: pointer;
}

.drawer-clear-btn img {
    width: 12px;
    height: 12px;
    object-fit: contain;
    pointer-events: none;
}

.drawer-clear-btn:hover {
    opacity: 1;
}

.sticker-origin {
    font-size: 32px;
    cursor: pointer;
    user-select: none;
    width: 52px;
    height: 52px;
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    background-color: var(--bg-color);
    position: relative;
}

.sticker-origin img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    border-radius: 8px;
}

.color-btn {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    background-size: cover;
    background-position: center;
}

/* 기본 스티커·배경 버튼 규칙 뒤에서 추가 버튼의 중립 외형을 확정한다. */
.palette-add-btn {
    width: 52px;
    height: 52px;
    box-sizing: border-box;
    padding: 8px;
    border: none;
    background: none;
    box-shadow: none;
    cursor: pointer;
}

.palette-add-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 1;
}

.delete-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
}


#sticker-upload-input,
#bg-upload-input {
    display: none;
}
