/* =====================================================
   Post Editor — prefix: pe-
   Mobile-first, no Bootstrap classes.
   ===================================================== */

/* ── FAB (Floating Action Button) ── */
.pe-fab {
    position: fixed;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    right: 1.25rem;
    z-index: 900;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ub-primary-gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 16px rgba(22,35,61, 0.4);
    transition: transform var(--ub-transition-fast), box-shadow var(--ub-transition-fast);
    text-decoration: none;
}
.pe-fab:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 24px rgba(22,35,61, 0.5);
}
.pe-fab:active {
    transform: scale(0.96);
}

/* Hide desktop FAB entirely — topbar has a visible "Neuer Beitrag" button now.
   BottomNav handles mobile with a centered plus. */
.pe-fab-desktop { display: none !important; }
@media (max-width: 768px) {
    .pe-nav-create-btn { display: none; }
}
@media (min-width: 769px) {
    .pe-nav-create-btn { display: inline-flex; }
}

/* ── Editor layout ── */
.pe-surface {
    min-height: 100vh;
    background: var(--ub-bg-page);
    display: flex;
    flex-direction: column;
}

.pe-topbar {
    position: sticky;
    top: 0;
    z-index: 800;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ub-gray-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    height: 56px;
    box-shadow: var(--ub-shadow-sm);
}

.pe-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.pe-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pe-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--ub-radius-md);
    border: none;
    background: none;
    color: var(--ub-gray-600);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background var(--ub-transition-fast), color var(--ub-transition-fast);
    text-decoration: none;
    flex-shrink: 0;
}
.pe-back-btn:hover {
    background: var(--ub-gray-100);
    color: var(--ub-gray-900);
}

.pe-save-indicator {
    font-size: 0.78rem;
    color: var(--ub-gray-400);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.pe-save-indicator.pe-saving {
    color: var(--ub-warning);
}
.pe-save-indicator.pe-saved {
    color: var(--ub-success);
}

.pe-topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border-radius: var(--ub-radius-md);
    border: 1.5px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--ub-transition-fast);
    white-space: nowrap;
}
.pe-topbar-btn-outline {
    background: #fff;
    color: var(--ub-gray-700);
    border-color: var(--ub-gray-200);
}
.pe-topbar-btn-outline:hover {
    border-color: var(--ub-primary);
    color: var(--ub-primary);
}
.pe-topbar-btn-primary {
    background: var(--ub-primary-gradient);
    color: #fff;
}
.pe-topbar-btn-primary:hover {
    box-shadow: 0 3px 10px rgba(22,35,61, 0.35);
    transform: translateY(-1px);
}
.pe-topbar-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Body wrapper ── */
.pe-body {
    display: flex;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

.pe-editor-col {
    flex: 1;
    min-width: 0;
}

/* ── Cover zone ── */
.pe-cover-zone {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--ub-radius-xl);
    background: var(--ub-gray-100);
    border: 2px dashed var(--ub-gray-300);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    margin-bottom: 1.5rem;
    transition: border-color var(--ub-transition-fast), background var(--ub-transition-fast);
}
.pe-cover-zone:hover {
    border-color: var(--ub-primary);
    background: #F4F6F9;
}
.pe-cover-zone.pe-drag-over {
    border-color: var(--ub-primary);
    background: #EAEEF5;
    border-style: solid;
}
.pe-cover-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--ub-gray-400);
    pointer-events: none;
}
.pe-cover-hint i {
    font-size: 2rem;
}
.pe-cover-hint span {
    font-size: 0.85rem;
    font-weight: 500;
}
.pe-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pe-cover-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity var(--ub-transition-fast);
}
.pe-cover-zone:hover .pe-cover-remove {
    opacity: 1;
}

/* ── Title input ── */
.pe-title-input {
    width: 100%;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--ub-gray-900);
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    overflow: hidden;
    font-family: inherit;
    padding: 0;
    margin-bottom: 1.25rem;
    box-sizing: border-box;
}
.pe-title-input::placeholder {
    color: var(--ub-gray-300);
}

/* ── Block list ── */
.pe-block-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Block divider (plus button between blocks) ── */
.pe-block-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    position: relative;
    opacity: 0;
    transition: opacity var(--ub-transition-fast);
}
.pe-block-divider:hover,
.pe-block-list:hover .pe-block-divider {
    opacity: 1;
}
.pe-block-add-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--ub-gray-300);
    background: #fff;
    color: var(--ub-gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all var(--ub-transition-fast);
    font-family: inherit;
    line-height: 1;
    padding: 0;
}
.pe-block-add-btn:hover {
    border-color: var(--ub-primary);
    color: var(--ub-primary);
    background: #F4F6F9;
    transform: scale(1.1);
}

/* Add block button after last block */
.pe-add-block-end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    margin-top: 0.5rem;
}
.pe-add-block-end-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--ub-radius-md);
    border: 1.5px dashed var(--ub-gray-300);
    background: transparent;
    color: var(--ub-gray-400);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--ub-transition-fast);
}
.pe-add-block-end-btn:hover {
    border-color: var(--ub-primary);
    color: var(--ub-primary);
    background: #F4F6F9;
}

/* ── Block wrapper ── */
.pe-block-wrapper {
    position: relative;
    border-radius: var(--ub-radius-md);
    transition: background var(--ub-transition-fast);
}
.pe-block-wrapper:hover {
    background: rgba(22,35,61, 0.025);
}

.pe-block-toolbar {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    display: flex;
    gap: 0.2rem;
    opacity: 0;
    transition: opacity var(--ub-transition-fast);
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--ub-radius-sm);
    padding: 0.2rem;
    border: 1px solid var(--ub-gray-200);
    box-shadow: var(--ub-shadow-sm);
}
.pe-block-wrapper:hover .pe-block-toolbar {
    opacity: 1;
}
.pe-block-tool-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--ub-radius-sm);
    border: none;
    background: none;
    color: var(--ub-gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all var(--ub-transition-fast);
}
.pe-block-tool-btn:hover {
    background: var(--ub-gray-100);
    color: var(--ub-gray-900);
}
.pe-block-tool-btn.pe-tool-delete:hover {
    background: var(--ub-danger-light);
    color: var(--ub-danger);
}

/* ── Block picker ── */
.pe-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: transparent;
}
.pe-picker {
    position: absolute;
    z-index: 1200;
    background: #fff;
    border: 1px solid var(--ub-gray-200);
    border-radius: var(--ub-radius-lg);
    box-shadow: var(--ub-shadow-xl);
    padding: 0.5rem;
    min-width: 200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
}
.pe-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.65rem 0.5rem;
    border-radius: var(--ub-radius-md);
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ub-gray-700);
    transition: all var(--ub-transition-fast);
    text-align: center;
}
.pe-picker-item:hover {
    background: var(--ub-gray-100);
    color: var(--ub-primary);
}
.pe-picker-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--ub-radius-sm);
    background: var(--ub-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--ub-primary);
}

/* ── Individual block styles ── */
.pe-block-content {
    padding: 0.25rem 0.5rem;
}

/* Text block */
.pe-block-text {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    overflow: hidden;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--ub-gray-700);
    background: transparent;
    padding: 0;
    box-sizing: border-box;
    min-height: 48px;
}
.pe-block-text::placeholder {
    color: var(--ub-gray-300);
}

/* Heading block */
.pe-block-heading {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    overflow: hidden;
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ub-gray-900);
    background: transparent;
    padding: 0;
    box-sizing: border-box;
    min-height: 48px;
}
.pe-block-heading::placeholder {
    color: var(--ub-gray-300);
    font-weight: 700;
}

/* Quote block */
.pe-block-quote {
    border-left: 4px solid var(--ub-primary);
    padding-left: 1.25rem;
    margin: 0;
}
.pe-block-quote-text {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    overflow: hidden;
    font-family: inherit;
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--ub-gray-700);
    background: transparent;
    padding: 0;
    box-sizing: border-box;
    min-height: 48px;
}
.pe-block-quote-text::placeholder {
    color: var(--ub-gray-300);
    font-style: italic;
}

/* Image block */
.pe-block-image-zone {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--ub-radius-lg);
    background: var(--ub-gray-100);
    border: 2px dashed var(--ub-gray-300);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--ub-transition-fast), background var(--ub-transition-fast);
}
.pe-block-image-zone:hover {
    border-color: var(--ub-primary);
    background: #F4F6F9;
}
.pe-block-image-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--ub-gray-400);
    pointer-events: none;
}
.pe-block-image-hint i {
    font-size: 1.75rem;
}
.pe-block-image-hint span {
    font-size: 0.8rem;
    font-weight: 500;
}
.pe-block-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pe-block-image-caption {
    width: 100%;
    border: none;
    border-top: 1px solid var(--ub-gray-200);
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--ub-gray-500);
    background: var(--ub-gray-50);
    padding: 0.5rem 0.75rem;
    box-sizing: border-box;
}
.pe-block-image-caption::placeholder {
    color: var(--ub-gray-300);
}

/* List block */
.pe-block-list-item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.pe-block-list-item-row i {
    color: var(--ub-primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.pe-block-list-item {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ub-gray-700);
    background: transparent;
    padding: 0;
}
.pe-block-list-item::placeholder {
    color: var(--ub-gray-300);
}
.pe-block-list-add-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.35rem;
}
.pe-block-list-add-btn {
    background: none;
    border: none;
    color: var(--ub-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.pe-block-list-remove {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--ub-gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all var(--ub-transition-fast);
}
.pe-block-list-remove:hover {
    background: var(--ub-danger-light);
    color: var(--ub-danger);
}

/* Rating block */
.pe-block-rating {
    background: var(--ub-gray-50);
    border-radius: var(--ub-radius-lg);
    padding: 1rem;
    border: 1px solid var(--ub-gray-200);
}
.pe-block-rating-title {
    width: 100%;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ub-gray-900);
    background: transparent;
    padding: 0;
    margin-bottom: 0.6rem;
}
.pe-block-rating-title::placeholder {
    color: var(--ub-gray-300);
}
.pe-stars {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}
.pe-star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0;
    line-height: 1;
    transition: transform var(--ub-transition-fast);
    color: var(--ub-gray-300);
}
.pe-star-btn:hover {
    transform: scale(1.15);
}
.pe-star-btn.pe-star-filled {
    color: #fbbf24;
}
.pe-block-rating-body {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    overflow: hidden;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--ub-gray-600);
    background: transparent;
    padding: 0;
    box-sizing: border-box;
}
.pe-block-rating-body::placeholder {
    color: var(--ub-gray-300);
}

/* ── Mobile bottom bar (replaces sidebar on mobile) ── */
.pe-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 700;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--ub-gray-200);
    padding: 0.6rem 1rem;
    padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
}
.pe-mobile-bar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pe-mobile-meta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--ub-radius-md);
    border: 1.5px solid var(--ub-gray-200);
    background: #fff;
    color: var(--ub-gray-700);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--ub-transition-fast);
}
.pe-mobile-meta-btn:hover {
    border-color: var(--ub-primary);
    color: var(--ub-primary);
}
.pe-mobile-publish-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--ub-radius-md);
    border: none;
    background: var(--ub-primary-gradient);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--ub-transition-fast);
}
.pe-mobile-publish-btn:hover {
    box-shadow: 0 4px 12px rgba(22,35,61, 0.35);
}
.pe-mobile-publish-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Meta sidebar ── */
.pe-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.pe-sidebar-card {
    background: var(--ub-bg-card);
    border-radius: var(--ub-radius-lg);
    border: 1px solid var(--ub-gray-200);
    padding: 1rem;
    box-shadow: var(--ub-shadow-sm);
}
.pe-sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ub-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem;
}
.pe-sidebar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ub-gray-700);
    margin-bottom: 0.35rem;
    display: block;
}
.pe-sidebar-input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--ub-gray-200);
    border-radius: var(--ub-radius-md);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--ub-gray-700);
    background: #fff;
    box-sizing: border-box;
    transition: border-color var(--ub-transition-fast);
}
.pe-sidebar-input:focus {
    outline: none;
    border-color: var(--ub-primary);
    box-shadow: var(--ub-focus-ring);
}
.pe-sidebar-group {
    margin-bottom: 0.75rem;
}
.pe-sidebar-group:last-child {
    margin-bottom: 0;
}

/* Category chips */
.pe-cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}
.pe-cat-chip {
    padding: 0.3rem 0.75rem;
    border-radius: var(--ub-radius-full);
    border: 1.5px solid var(--ub-gray-200);
    background: #fff;
    color: var(--ub-gray-600);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--ub-transition-fast);
    white-space: nowrap;
}
.pe-cat-chip:hover {
    border-color: var(--ub-primary);
    color: var(--ub-primary);
    background: #F4F6F9;
}
.pe-cat-chip--active {
    background: var(--ub-primary);
    border-color: var(--ub-primary);
    color: #fff;
}
.pe-cat-chip--active:hover {
    background: var(--ub-primary-dark);
    border-color: var(--ub-primary-dark);
}

/* ── Bottom Sheet (Mobile Meta) ── */
.pe-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.45);
    animation: pe-fade-in 0.2s ease;
}
.pe-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 0 1.25rem 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    max-height: 85vh;
    overflow-y: auto;
    animation: pe-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.pe-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--ub-gray-300);
    margin: 0.75rem auto 1rem;
}
.pe-sheet-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ub-gray-900);
    margin: 0 0 1.25rem;
}

/* ── Privacy hint (shown when user is private) ── */
.pe-privacy-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #EAEEF5;
    border: 1px solid #FBE3AD;
    border-radius: var(--ub-radius-lg);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #93650A;
}
.pe-privacy-hint i {
    font-size: 1.1rem;
    color: #16233D;
    flex-shrink: 0;
    margin-top: 0.15rem;
}
.pe-privacy-hint strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 2px;
}
.pe-privacy-hint span {
    display: block;
    font-size: 0.8rem;
    color: #6b21a8;
    line-height: 1.5;
}
.pe-privacy-hint a { color: #B97F08; font-weight: 600; text-decoration: underline; }
.pe-privacy-hint a:hover { color: #93650A; }

/* ── Onboarding tip ── */
.pe-onboarding-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #F4F6F9;
    border: 1px solid #bfdbfe;
    border-radius: var(--ub-radius-lg);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}
.pe-onboarding-tip i {
    font-size: 1.1rem;
    color: var(--ub-primary);
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.pe-onboarding-tip p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--ub-gray-700);
    line-height: 1.5;
}
.pe-onboarding-dismiss {
    background: none;
    border: none;
    color: var(--ub-gray-400);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    flex-shrink: 0;
    margin-top: 0.1rem;
    transition: color var(--ub-transition-fast);
}
.pe-onboarding-dismiss:hover {
    color: var(--ub-gray-700);
}

/* ── Error / loading ── */
.pe-error-banner {
    background: var(--ub-danger-light);
    border: 1px solid #fca5a5;
    border-radius: var(--ub-radius-lg);
    padding: 0.75rem 1rem;
    color: #b91c1c;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pe-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.pe-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ub-gray-200);
    border-top-color: var(--ub-primary);
    border-radius: 50%;
    animation: pe-spin 0.8s linear infinite;
}
.pe-loading-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ub-gray-600);
}

/* ── Animations ── */
@keyframes pe-spin {
    to { transform: rotate(360deg); }
}
@keyframes pe-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes pe-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .pe-topbar {
        padding: 0 0.75rem;
    }
    .pe-topbar-btn span {
        display: none;
    }
    .pe-topbar-btn {
        padding: 0.45rem 0.65rem;
    }
    .pe-body {
        flex-direction: column;
        padding: 0.75rem 0.75rem 100px;
        gap: 1rem;
    }
    .pe-sidebar {
        display: none;
    }
    .pe-mobile-bar {
        display: flex;
    }
    .pe-save-indicator {
        display: none;
    }
    .pe-title-input {
        font-size: 1.4rem;
    }
    .pe-cover-zone {
        aspect-ratio: 16 / 9;
    }
    .pe-picker {
        left: 0.75rem !important;
        right: 0.75rem;
        min-width: unset;
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 769px) {
    .pe-mobile-bar {
        display: none;
    }
}

/* Ensure no sticky nav overlap in editor mode */
.pe-editor-page .ub-layout > main {
    padding-top: 0;
}

/* ── Tag Chip Input ── */
.pe-tag-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    min-height: 38px;
    padding: 4px 8px;
    border: 1.5px solid var(--ub-gray-200);
    border-radius: var(--ub-radius-md);
    background: #fff;
    cursor: text;
    transition: border-color var(--ub-transition-fast);
    box-sizing: border-box;
}
.pe-tag-chip-wrap:focus-within {
    border-color: var(--ub-primary);
    box-shadow: var(--ub-focus-ring);
}
.pe-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 2px 8px 2px 10px;
    background: #F4F6F9;
    color: #16233D;
    border-radius: var(--ub-radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #bfdbfe;
}
.pe-tag-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: none;
    background: none;
    color: #16233D;
    cursor: pointer;
    padding: 0;
    font-size: 0.55rem;
    border-radius: 50%;
    transition: background var(--ub-transition-fast), color var(--ub-transition-fast);
    font-family: inherit;
}
.pe-tag-chip-remove:hover {
    background: #bfdbfe;
    color: #16233D;
}
.pe-tag-input {
    flex: 1;
    min-width: 100px;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--ub-gray-700);
    background: transparent;
    padding: 2px 0;
}
.pe-tag-input::placeholder {
    color: var(--ub-gray-300);
}
.pe-tag-limit-hint {
    font-size: 0.72rem;
    color: var(--ub-gray-400);
    margin: 0.25rem 0 0;
}

/* ── Draft recovery banner ── */
.pe-draft-recovery-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: var(--ub-radius-lg);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: #92400e;
    flex-wrap: wrap;
}
.pe-draft-recovery-banner i {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.pe-draft-recovery-banner p {
    margin: 0;
    flex: 1;
}
.pe-draft-recovery-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.pe-draft-recovery-btn {
    padding: 5px 14px;
    border-radius: var(--ub-radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--ub-transition-fast);
}
.pe-draft-recovery-btn-yes {
    background: var(--ub-primary, #16233D);
    color: #fff;
    border: none;
}
.pe-draft-recovery-btn-yes:hover {
    background: #11203B;
}
.pe-draft-recovery-btn-no {
    background: #fff;
    color: #374151;
    border: 1px solid #E7E2D8;
}
.pe-draft-recovery-btn-no:hover {
    background: #F3F0EA;
}

/* ── Creator CTA banner ── */
.pe-creator-cta {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #fff;
    border: 2px solid transparent;
    border-radius: var(--ub-radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    background-clip: padding-box;
    box-shadow: 0 0 0 2px var(--ub-primary, #16233D), 0 4px 16px rgba(22,35,61,0.12);
}
.pe-creator-cta-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.pe-creator-cta-body {
    flex: 1;
    min-width: 0;
}
.pe-creator-cta-body p {
    margin: 0 0 0.6rem;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
}
.pe-creator-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 7px 16px;
    background: linear-gradient(135deg, var(--ub-primary, #16233D), var(--ub-primary-hover, #11203B));
    color: #fff;
    border-radius: var(--ub-radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--ub-transition-fast);
}
.pe-creator-cta-link:hover {
    box-shadow: 0 3px 10px rgba(22,35,61,0.35);
    transform: translateY(-1px);
    color: #fff;
}
.pe-creator-cta-dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--ub-gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: var(--ub-radius-sm);
    transition: background var(--ub-transition-fast), color var(--ub-transition-fast);
}
.pe-creator-cta-dismiss:hover {
    background: var(--ub-gray-100);
    color: var(--ub-gray-700);
}
