/* ── Edit Toolbar ── */
.ws-edit-toolbar {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    gap: 0.5rem;
    background: rgba(20, 19, 17, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.4rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ws-edit-toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    font-family: inherit;
}

.ws-edit-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ws-edit-toolbar-btn-active {
    background: #d47d5a;
    color: #fff;
}

.ws-edit-toolbar-btn-active:hover {
    background: #c06e4d;
    color: #fff;
}

.ws-edit-toolbar-link {
    color: rgba(255, 255, 255, 0.5);
}

/* ── Editable Section ── */
.ws-editable {
    position: relative;
    cursor: pointer;
    transition: outline 0.15s ease;
    outline: 2px dashed transparent;
    outline-offset: 4px;
    border-radius: 4px;
}

.ws-editable:hover {
    outline-color: rgba(212, 125, 90, 0.5);
}

.ws-editable:hover > .ws-editable-label {
    opacity: 1;
}

.ws-editable-active {
    outline-color: #d47d5a !important;
    outline-style: solid !important;
}

.ws-editable-label {
    position: absolute;
    top: -10px;
    right: 8px;
    background: #d47d5a;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Edit Panel (Slide-out Drawer) ── */
.ws-edit-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10001;
    animation: ws-fade-in-backdrop 0.15s ease;
}

.ws-edit-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: #1a1917;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    animation: ws-slide-in-panel 0.2s ease;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
}

.ws-edit-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ws-edit-panel-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.ws-edit-panel-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.ws-edit-panel-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ws-edit-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ── Edit Panel Form Fields ── */
.ws-edit-field {
    margin-bottom: 1rem;
}

.ws-edit-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ws-edit-field input,
.ws-edit-field textarea,
.ws-edit-field select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.ws-edit-field input:focus,
.ws-edit-field textarea:focus,
.ws-edit-field select:focus {
    outline: none;
    border-color: #d47d5a;
}

.ws-edit-field textarea {
    resize: vertical;
    min-height: 80px;
}

.ws-edit-save {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    background: #d47d5a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
    margin-top: 0.5rem;
}

.ws-edit-save:hover {
    background: #c06e4d;
}

.ws-edit-saved {
    color: #6ec87a;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.75rem;
}

/* ── List Editor ── */
.ws-edit-list-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.ws-edit-list-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.ws-edit-list-item-header span {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.ws-edit-list-remove {
    background: none;
    border: none;
    color: rgba(255, 100, 100, 0.6);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.ws-edit-list-remove:hover {
    background: rgba(255, 100, 100, 0.1);
    color: rgba(255, 100, 100, 0.9);
}

.ws-edit-list-add {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    margin-top: 0.25rem;
}

.ws-edit-list-add:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.8);
}

.ws-edit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ── Animations ── */
@keyframes ws-fade-in-backdrop {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ws-slide-in-panel {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
