#curve-text-slideout-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: min(355px, 100vw);
    height: 100vh;
    background: #fff;
    box-shadow: 0 0 7px rgba(15, 23, 42, .18);
    transform: translateX(-100%);
    transition: transform 220ms ease;
    visibility: hidden;
    pointer-events: none;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(148, 163, 184, .22);
    font-family: Poppins, Arial, sans-serif;
}

#curve-text-slideout-panel.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.curve-text-panel__header {
    height: 42px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background: #41434b;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.curve-text-panel__close {
    appearance: none;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.curve-text-panel__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 12px;
    color: #1f2a37;
}

.curve-text-panel__preview-wrap {
    min-height: 230px;
    border: 1px solid #e3e8ef;
    border-radius: 16px;
    background-color: #aeb8c5;
    background-image: linear-gradient(45deg, rgba(255, 255, 255, .18) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .18) 75%),
        linear-gradient(45deg, rgba(255, 255, 255, .18) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .18) 75%);
    background-position: 0 0, 8px 8px;
    background-size: 16px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

#curve-text-preview {
    width: 100%;
    height: 230px;
    display: block;
    object-fit: contain;
}

.curve-text-panel__empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

.curve-text-panel__control {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #e3e8ef;
    border-radius: 16px;
    background: #fff;
}

.curve-text-panel__control-heading,
.curve-text-panel__scale {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.curve-text-panel__control-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.curve-text-panel__control-heading {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
}

#curve-text-slider,
#curve-text-letter-spacing {
    width: 100%;
    accent-color: #087bd1;
}

.curve-text-panel__scale {
    color: #64748b;
    font-size: 11px;
}

.curve-text-panel__reset {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: #087bd1;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.curve-text-panel__presets {
    margin: 14px 0;
}

.curve-text-panel__preset-label {
    margin: 0 2px 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}

.curve-text-panel__preset-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.curve-text-panel__preset {
    appearance: none;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 8px 6px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    cursor: pointer;
}

.curve-text-panel__preset:hover,
.curve-text-panel__preset.is-active {
    border-color: #087bd1;
    background: #eef7ff;
    color: #087bd1;
}

.curve-text-panel__options {
    display: grid;
    gap: 10px;
    margin: 14px 2px;
    color: #334155;
    font-size: 13px;
}

.curve-text-panel__options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.curve-text-panel__options input {
    accent-color: #087bd1;
}

.curve-text-panel__hint {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
    margin: 14px 2px;
}

.curve-text-panel__actions {
    display: flex;
    gap: 10px;
}

.curve-text-panel__actions button {
    appearance: none;
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    flex: 1 1 0;
}

.curve-text-panel__actions .curve-text-panel__save {
    border-color: #087bd1;
    background: #087bd1;
    color: #fff;
}

#textEdit-slideout-panel #text-edit-container .curve-text-open {
    appearance: none;
    width: 100%;
    border: 1px solid #087bd1;
    background: #fff;
    color: #087bd1;
    cursor: pointer;
}

#textEdit-slideout-panel #text-edit-container .curve-text-open:hover,
#textEdit-slideout-panel #text-edit-container .curve-text-open:focus-visible {
    background: #eef7ff;
}

@media (max-width: 640px) {
    #curve-text-slideout-panel {
        width: 100vw;
    }
}
