/* Consolidated responsive image rules for all BitStream content */
.bitstream-feed-layout,
.bitstream-feed-layout button,
.bitstream-feed-layout input,
.bitstream-feed-layout textarea,
.bitstream-feed-layout select,
.bitstream-feed-layout summary,
.bitstream-feed-layout label,
.bitstream-feed-layout a,
.bitstream-feed-layout p,
.bitstream-feed-layout span,
.bitstream-feed-layout h1,
.bitstream-feed-layout h2,
.bitstream-feed-layout h3,
.bitstream-feed-layout h4,
.bitstream-feed-layout h5,
.bitstream-feed-layout h6,
.bitstream-feed-layout small,
.bitstream-feed-layout strong,
.bitstream-composer,
.bitstream-composer button,
.bitstream-composer input,
.bitstream-composer textarea,
.bitstream-composer select,
.bitstream-composer summary,
.bitstream-composer label,
.bitstream-composer a,
.bitstream-composer p,
.bitstream-composer span,
.bitstream-composer h1,
.bitstream-composer h2,
.bitstream-composer h3,
.bitstream-composer h4,
.bitstream-composer h5,
.bitstream-composer h6,
.bitstream-composer small,
.bitstream-composer strong {
    font-family: inherit;
}

@media (max-width: 782px) {

    html:has(body.admin-bar .bitstream-feed-layout),
    html:has(body.admin-bar .bitstream-composer),
    html:has(body.admin-bar.bitstream-single-bit) {
        margin-top: 0 !important;
    }

    body.admin-bar:has(.bitstream-feed-layout) #wpadminbar,
    body.admin-bar:has(.bitstream-composer) #wpadminbar,
    body.admin-bar.bitstream-single-bit #wpadminbar {
        display: none !important;
    }
}

.bit-card-content img,
.bit-rebit-preview img,
.bitstream-quoted-preview img,
.bitstream-og-card img {
    max-width: 100% !important;
    max-height: 560px;
    height: auto !important;
    width: auto !important;
    object-fit: contain;
    display: block;
    margin: 0.5em auto;
    border-radius: 15px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    /* Prevent layout shift while images load */
    min-height: 100px;
}

/* WordPress emoji images must stay inline text-size — our !important rules above would otherwise blow them up */
.bit-card-content img.emoji,
.bit-rebit-preview img.emoji,
.bitstream-quoted-preview img.emoji,
.bitstream-og-card img.emoji {
    display: inline !important;
    width: 1em !important;
    height: 1em !important;
    max-width: 1em !important;
    max-height: 1em !important;
    min-height: unset !important;
    margin: 0 0.05em !important;
    vertical-align: -0.1em !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    object-fit: unset !important;
}

/* Twitter & Instagram Rebit card image resets (prevent general card img rules from inflating avatars or forcing min-height) */
.bit-tweet-card img,
.bit-instagram-card img {
    max-width: 100% !important;
    min-height: unset !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.bit-tweet-avatar,
.bit-instagram-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    display: block !important;
    box-shadow: none !important;
}

.bit-instagram-avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
}

/* Constrain video/mediaelement output inside cards */
.bit-card-content video,
.bit-rebit-preview video,
.bitstream-quoted-preview video,
.bitstream-og-card video,
.bit-card-content .wp-video-shortcode,
.bit-rebit-preview .wp-video-shortcode,
.bitstream-quoted-preview .wp-video-shortcode,
.bitstream-og-card .wp-video-shortcode {
    max-width: 100% !important;
    width: auto !important;
    max-height: 560px;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-radius: 15px;
    overflow: hidden;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    background: #fff;
    color-scheme: light;
}

/* Remove default black shadow/gradient overlay from native HTML5 video controls */
.bitstream-feed-layout video::-webkit-media-controls-panel,
.bitstream-composer video::-webkit-media-controls-panel,
.bitstream-composer-modal video::-webkit-media-controls-panel,
.bitstream-lightbox video::-webkit-media-controls-panel {
    background-image: none !important;
    background: transparent !important;
}

/* Card video controls: subtle accent tint on the controls panel */
.bit-card-content video:not(.bitstream-gallery-media)::-webkit-media-controls-panel,
.bit-rebit-preview video:not(.bitstream-gallery-media)::-webkit-media-controls-panel,
.bitstream-quoted-preview video:not(.bitstream-gallery-media)::-webkit-media-controls-panel {
    background-image: none !important;
    background: rgba(44, 110, 73, 0.07) !important;
}

/* Landscape/Square images: same width as card content area */
.bit-card-content img.bit-image-landscape,
.bit-rebit-preview img.bit-image-landscape,
.bitstream-quoted-preview img.bit-image-landscape,
.bitstream-og-card img.bit-image-landscape {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover;
}

/* Portrait/Tall and narrow images: centered, height-bounded, original aspect ratio */
.bit-card-content img.bit-image-portrait,
.bit-rebit-preview img.bit-image-portrait,
.bitstream-quoted-preview img.bit-image-portrait,
.bitstream-og-card img.bit-image-portrait {
    width: auto !important;
    max-width: 100% !important;
    max-height: 560px;
    height: auto !important;
    margin: 0.5em auto !important;
    object-fit: contain;
}

.bit-card-content .wp-video,
.bit-rebit-preview .wp-video,
.bitstream-quoted-preview .wp-video,
.bitstream-og-card .wp-video,
.bit-card-content .mejs-container,
.bit-rebit-preview .mejs-container,
.bitstream-quoted-preview .mejs-container,
.bitstream-og-card .mejs-container {
    max-width: 100% !important;
    width: 100% !important;
    display: block;
    visibility: visible !important;
    opacity: 1 !important;
    border-radius: 15px;
    overflow: hidden;
    background: #000 !important;
}

.bit-card-content .mejs-container video,
.bit-rebit-preview .mejs-container video,
.bitstream-quoted-preview .mejs-container video,
.bitstream-og-card .mejs-container video {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* Remove min-height once image is loaded */
.bit-card-content img[src]:not([src=""]),
.bit-rebit-preview img[src]:not([src=""]),
.bitstream-quoted-preview img[src]:not([src=""]),
.bitstream-og-card img[src]:not([src=""]) {
    min-height: auto;
}

.bit-rebit-preview,
.bitstream-og-card,
.bitstream-og-meta,
.bitstream-og-url {
    min-width: 0;
    max-width: 100%;
}

.bit-rebit-preview a,
.bitstream-og-card a,
.bitstream-og-url a {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

/* ==========================================================================
   FEED LAYOUT
   ========================================================================== */
/* Feed grid layout */
.bitstream-feed-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "top"
        "left"
        "main"
        "right";
    gap: 1rem;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    min-width: 0;
}

.bitstream-feed-main {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

/* Top rail is removed. Quick actions and Composer styles are now handled in the main columns. */

/* ==========================================================================
   COMPOSER
   ========================================================================== */
/* ── Composer (redesigned) ───────────────────────────────────────── */
.bitstream-composer {
    max-width: none;
    margin: 0;
    padding: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 15px;
    background: #fff;
    box-sizing: border-box;
}

.bitstream-composer .bitstream-composer-status {
    margin-top: 0.6rem;
}

.bitstream-composer .bitstream-sidebar-composer-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.bitstream-composer-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 0.55rem 0.65rem;
    font-size: 0.92rem;
    font-family: inherit;
    resize: vertical;
    min-height: 72px;
}

.bitstream-composer-textarea:focus {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    outline: none;
    box-shadow: 0 0 0 2px rgba(44, 110, 73, 0.15);
}

/* Contenteditable Micro-Editor Styles */
.bitstream-composer-textarea[contenteditable],
.bs-edit-textarea[contenteditable] {
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    user-select: text;
    -webkit-user-select: text;
}

.bitstream-composer-textarea[contenteditable]:empty::before,
.bs-edit-textarea[contenteditable]:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
    display: block;
}

.bs-editor-hashtag {
    color: var(--wp--preset--color--accent-1, #2c6e49);
    font-weight: 500;
}

.bs-editor-url {
    color: #2563eb;
    text-decoration: underline;
}

.bs-editor-autocomplete-popup {
    position: absolute;
    z-index: 100001;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    min-width: 180px;
    padding: 4px;
}

.bs-editor-autocomplete-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 0.88rem;
    border-radius: 8px;
    cursor: pointer;
    color: #1a202c;
    transition: background 0.12s ease;
}

.bs-editor-autocomplete-item:hover,
.bs-editor-autocomplete-item.is-active {
    background: #f1f5f9;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bs-editor-autocomplete-item .bs-tag-name {
    font-weight: 500;
}

.bs-editor-autocomplete-item .bs-tag-count {
    font-size: 0.78rem;
    color: #94a3b8;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Action buttons row */
.bitstream-composer-actions-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bitstream-composer-actions-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.bitstream-composer-count-btn {
    width: auto !important;
    height: 2.2rem !important;
    padding: 0 0.55rem !important;
    gap: 0.35rem !important;
    border-radius: 9999px !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    text-decoration: none !important;
    font-size: 0.85rem !important;
}

.bitstream-composer-count-btn:hover {
    background: rgba(44, 110, 73, 0.08) !important;
    border-color: var(--wp--preset--color--accent-1, #2c6e49) !important;
    color: var(--wp--preset--color--accent-1, #2c6e49) !important;
    transform: translateY(-1px);
}

.bitstream-composer-count-btn:active {
    transform: translateY(0);
}

.bitstream-composer-count-btn i {
    font-size: 0.95rem;
    color: inherit;
}

.bitstream-composer-count-btn[hidden] {
    display: none !important;
}

body.dark-mode .bitstream-composer-count-btn,
.dark-theme .bitstream-composer-count-btn {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

body.dark-mode .bitstream-composer-count-btn:hover,
.dark-theme .bitstream-composer-count-btn:hover {
    background: rgba(74, 222, 128, 0.12) !important;
    border-color: #4ade80 !important;
    color: #4ade80 !important;
}

.bitstream-composer-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.bitstream-composer-action-btn:hover {
    background: rgba(44, 110, 73, 0.08);
    color: #1e4d33;
    transform: scale(1.1);
}

.bitstream-composer-action-btn:active {
    transform: scale(0.95);
    background: rgba(44, 110, 73, 0.15);
}

.bitstream-composer-action-btn.is-active {
    background: rgba(44, 110, 73, 0.15);
    color: #1e4d33;
}

.bitstream-composer-action-btn.is-danger {
    color: #c81e1e;
}

.bitstream-composer-action-btn.is-danger:hover {
    background: rgba(200, 30, 30, 0.08);
    color: #a81818;
}

.bitstream-composer-action-btn.is-danger:active {
    background: rgba(200, 30, 30, 0.15);
}

.bitstream-composer-action-btn:disabled,
.bitstream-composer-action-btn.is-disabled {
    opacity: 0.35;
    cursor: not-allowed !important;
    transform: none !important;
    background: transparent !important;
    color: #94a3b8 !important;
}

/* Drag & Drop Visual Cue on Composer */
.bitstream-sidebar-composer-form {
    position: relative;
}

.bitstream-composer-drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 2px dashed var(--wp--preset--color--accent-1, #2c6e49);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(0.98);
    box-shadow: 0 12px 32px rgba(44, 110, 73, 0.14);
}

.bitstream-sidebar-composer-form.bitstream-composer-dragover .bitstream-composer-drop-overlay,
.bitstream-composer-modal-dialog.bitstream-composer-dragover .bitstream-composer-drop-overlay {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: none !important;
}

.bitstream-composer-drop-overlay-content,
.bitstream-composer-drop-overlay-content * {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none !important;
}

.bitstream-composer-drop-overlay-content {
    padding: 1.25rem;
}

.bitstream-composer-drop-icon {
    font-size: 2.4rem;
    line-height: 1;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    margin-bottom: 0.6rem;
    animation: bitstreamDropBounce 1.2s infinite ease-in-out;
}

.bitstream-composer-drop-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.bitstream-composer-drop-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.2;
}

@keyframes bitstreamDropBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Inline Rebit URL Input Bar */
/* Inline Rebit Metadata Editor */
.bitstream-composer-rebit-inline-meta {
    margin-top: 0.75rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: bitstreamFadeIn 0.2s ease-out;
}

.bitstream-rebit-inline-meta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #edf2f7;
}

.bitstream-rebit-inline-meta-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.bitstream-rebit-inline-meta-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.bitstream-rebit-inline-meta-btn-action {
    background: transparent;
    border: none;
    font-size: 0.88rem;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background-color 0.15s;
}

.bitstream-rebit-inline-meta-save {
    color: var(--wp--preset--color--accent-1, #2c6e49);
    background: rgba(44, 110, 73, 0.1);
}

.bitstream-rebit-inline-meta-save:hover {
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #ffffff;
}

.bitstream-rebit-inline-meta-close {
    color: #94a3b8;
}

.bitstream-rebit-inline-meta-close:hover {
    color: #ef4444;
    background-color: #fee2e2;
}

.bitstream-rebit-inline-meta-body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.bitstream-rebit-inline-meta-field label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.bitstream-rebit-inline-meta-field label i {
    font-size: 0.75rem;
    color: #94a3b8;
}

.bitstream-rebit-inline-meta-field input,
.bitstream-rebit-inline-meta-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
    color: #334155;
    background: #ffffff;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bitstream-rebit-inline-meta-field input:focus,
.bitstream-rebit-inline-meta-field textarea:focus {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.12);
    background: #ffffff;
    outline: none;
}

.bitstream-rebit-inline-img-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
}

.bitstream-rebit-inline-img-thumb {
    width: 72px;
    height: 54px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.bitstream-rebit-inline-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bitstream-rebit-inline-img-thumb img[hidden] {
    display: none !important;
}

.bitstream-rebit-inline-img-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #94a3b8;
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 7px;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.bitstream-rebit-inline-img-empty[hidden] {
    display: none !important;
}

.bitstream-rebit-inline-img-empty i {
    font-size: 1.1rem;
    color: #94a3b8;
}

.bitstream-rebit-inline-img-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.bitstream-rebit-inline-img-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: all 0.12s;
}

.bitstream-rebit-inline-img-btn:hover {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    color: var(--wp--preset--color--accent-1, #2c6e49);
    background: rgba(44, 110, 73, 0.08);
}

.bitstream-rebit-inline-img-btn.is-danger {
    color: #dc2626;
}

.bitstream-rebit-inline-img-btn.is-danger:hover {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #ef4444;
}

/* Anchored Popovers */
.bitstream-composer-popover[hidden],
.bitstream-composer-rebit-inline-meta[hidden] {
    display: none !important;
}

.bitstream-composer-popover-anchor {
    position: relative;
    display: inline-flex;
}

.bitstream-composer-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 100010;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: 0.75rem;
    box-sizing: border-box;
    animation: bitstreamModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bitstream-composer-popover-media {
    width: 220px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bitstream-composer-popover-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    background: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
}

.bitstream-composer-popover-option i {
    font-size: 1rem;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    width: 18px;
    text-align: center;
}

.bitstream-composer-popover-option:hover {
    background: rgba(44, 110, 73, 0.08);
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-composer-popover-rebit {
    width: 300px;
}

.bitstream-composer-popover-schedule {
    width: 270px;
}

.bitstream-composer-popover-mood {
    width: 320px;
    max-width: calc(100vw - 24px);
    padding: 10px 12px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    overflow: visible;
    display: block;
    box-sizing: border-box;
}

.bitstream-composer-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #f1f5f9;
}

.bitstream-composer-popover-header h4 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-composer-popover-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
}

.bitstream-composer-popover-close:hover {
    color: #ef4444;
}

.bitstream-schedule-custom-row label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.bitstream-schedule-custom-row input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
    background: #f8fafc;
}

.bitstream-rebit-popover-row label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.bitstream-rebit-popover-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.bitstream-rebit-popover-input-wrap:focus-within {
    background: #fff;
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.12);
}

.bitstream-rebit-popover-icon {
    color: #94a3b8;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.bitstream-rebit-popover-input-wrap input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 0.82rem !important;
    color: #1e293b !important;
    outline: none !important;
    box-shadow: none !important;
}

.bitstream-rebit-popover-status {
    font-size: 0.75rem;
    margin-top: 0.4rem;
    color: #64748b;
}

.bitstream-rebit-popover-status.is-error {
    color: #ef4444;
}

.bitstream-composer-popover-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

.bitstream-composer-popover-btn-clear {
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
}

.bitstream-composer-popover-btn-clear:hover {
    color: #ef4444;
    border-color: #fca5a5;
}

.bitstream-composer-popover-btn-confirm {
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--wp--preset--color--accent-1, #2c6e49);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(44, 110, 73, 0.2);
}

.bitstream-composer-popover-btn-confirm:hover {
    opacity: 0.92;
}

@media (max-width: 1023px) {
    .bitstream-composer-popover {
        max-width: calc(100vw - 32px);
    }
    .bitstream-composer-popover-media {
        width: 200px;
    }
    .bitstream-composer-popover-rebit {
        width: min(300px, calc(100vw - 32px));
    }
    .bitstream-composer-popover-schedule {
        width: min(280px, calc(100vw - 32px));
    }
    .bitstream-composer-popover-mood {
        max-width: calc(100vw - 32px);
    }
}

/* Preview area */
.bitstream-composer-preview-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Carousel container — on desktop it just shows whatever card is visible (no snap) */
.bitstream-composer-preview-carousel {
    position: relative;
    overflow: hidden;
}

/* Dot indicators below the carousel */
.bitstream-composer-preview-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.bitstream-composer-preview-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cdd5d0;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.bitstream-composer-preview-dot.is-active {
    background: var(--wp--preset--color--accent-1, #2c6e49);
    transform: scale(1.35);
}

.bitstream-composer-preview-rebit,
.bitstream-composer-preview-media,
.bitstream-composer-preview-schedule,
.bitstream-composer-preview-draft {
    border: 1px solid #e2e8e4;
    border-radius: 10px;
    background: #fbfdfc;
    padding: 0.55rem;
}

/* Quoted Bit Single Card Preview */
.bitstream-composer-preview-quote {
    position: relative;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    margin: 0;
}

.bitstream-composer-preview-quote .bit-card-quoted-nested {
    margin: 0 !important;
    position: relative;
}

.bitstream-composer-preview-quote .bit-card-quoted-nested .bit-card-header {
    padding-right: 2.2rem;
}

.bitstream-composer-preview-quote .bitstream-composer-quote-remove {
    position: absolute;
    top: 0.95rem;
    right: 0.95rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bitstream-composer-preview-quote .bitstream-composer-quote-remove:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: scale(1.1);
}

/* Composer Edit Mode Banner */
.bitstream-composer-edit-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.65rem;
    animation: bitstreamFadeIn 0.2s ease-out;
}

.bitstream-composer-edit-banner[hidden] {
    display: none !important;
}

.bitstream-composer-edit-banner-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-composer-edit-cancel-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(200, 30, 30, 0.08);
    color: #c81e1e;
    border: 1px solid rgba(200, 30, 30, 0.2);
    border-radius: 16px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bitstream-composer-edit-cancel-btn:hover {
    background: rgba(200, 30, 30, 0.18);
}

.bitstream-composer-preview-quote-card {
    font-size: 0.85rem;
    line-height: 1.4;
    overflow: hidden;
    margin-top: 0.35rem;
}

.bitstream-composer-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.bitstream-composer-preview-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.bitstream-composer-preview-label i {
    font-size: 0.85rem;
}

.bitstream-composer-preview-actions {
    display: flex;
    gap: 0.35rem;
}

.bitstream-composer-preview-remove,
.bitstream-composer-preview-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border: none;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.bitstream-composer-preview-remove {
    background: rgba(200, 30, 30, 0.1);
    color: #c81e1e;
}

.bitstream-composer-preview-remove:hover {
    background: rgba(200, 30, 30, 0.2);
}

.bitstream-composer-preview-edit {
    background: rgba(44, 110, 73, 0.1);
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-composer-preview-edit:hover {
    background: rgba(44, 110, 73, 0.2);
}

.bitstream-composer-preview-rebit-card {
    font-size: 0.85rem;
    line-height: 1.4;
    overflow: hidden;
}

.bitstream-composer-preview-rebit-card .bitstream-og-card {
    margin: 0;
}

.bitstream-composer-preview-rebit-card .bit-rebit-embed,
.bitstream-composer-rebit-live-preview-card .bit-rebit-embed {
    max-width: 380px;
    margin: 0.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.bitstream-composer-preview-media-thumb {
    position: relative;
    text-align: center;
}

.bitstream-composer-preview-media-thumb img,
.bitstream-composer-preview-media-thumb video {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin: 0;
    overflow: hidden;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

/* Landscape/Square composer preview images */
.bitstream-composer-preview-media-thumb img.bit-image-landscape {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
}

/* Portrait/Tall composer preview images */
.bitstream-composer-preview-media-thumb img.bit-image-portrait {
    width: auto !important;
    max-width: 100% !important;
    max-height: 240px;
    height: auto !important;
    margin: 0.5em auto !important;
    object-fit: contain;
    display: block;
}

/* Specific overrides for uploader grid preview items inside composer preview area to keep them square */
.bitstream-composer-preview-media-thumb .bitstream-media-preview-item img,
.bitstream-composer-preview-media-thumb .bitstream-media-preview-item img.bit-image-landscape,
.bitstream-composer-preview-media-thumb .bitstream-media-preview-item img.bit-image-portrait,
.bitstream-composer-preview-media-thumb .bitstream-media-preview-item video {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    margin: 0 !important;
    display: block !important;
    border-radius: 0 !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}




.bitstream-composer-preview-media-thumb span {
    display: block;
    font-size: 0.82rem;
    color: #4f5d55;
    margin-top: 0.25rem;
    word-break: break-word;
}

.bitstream-composer-preview-schedule-date,
.bitstream-composer-preview-draft-label {
    display: block;
    font-size: 0.82rem;
    color: #3d4a43;
    font-weight: 500;
}

/* Submit button */
.bitstream-composer-submit {
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.bitstream-composer-submit:hover {
    background: #235c3e;
}

.bitstream-composer-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   COMPOSER MODALS
   ========================================================================== */
/* ── Composer Modals (shared — canonical unified style) ──────────────── */
.bitstream-composer-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.bitstream-composer-modal:not([hidden]) {
    display: flex;
}

@keyframes bitstreamFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes bitstreamMobileModalIn {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.bitstream-composer-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: bitstreamFadeIn 0.2s ease-out;
}

.bitstream-composer-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: bitstreamModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bitstream-composer-modal-dialog-wide {
    max-width: 640px;
}

@keyframes bitstreamModalIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bitstream-composer-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid #eef0f2;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 1;
    flex-shrink: 0;
}

.bitstream-composer-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-composer-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    line-height: 1;
}

.bitstream-composer-modal-close:hover {
    color: #333;
    background: #f3f4f6;
}

.bitstream-composer-modal-body {
    padding: 1rem 1.4rem 1.2rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    flex: 1 1 auto;
}

.bitstream-composer-modal-body label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
}

.bitstream-composer-modal-body input[type="text"],
.bitstream-composer-modal-body input[type="url"],
.bitstream-composer-modal-body textarea,
.bitstream-composer-modal-body input[type="datetime-local"] {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
    background: #f8fafc;
    color: #1a202c;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.bitstream-composer-modal-body input:focus,
.bitstream-composer-modal-body textarea:focus {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.13);
}

.bitstream-composer-rebit-image-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bitstream-composer-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    border-top: 1px solid #eef0f2;
    flex-shrink: 0;
}

.bitstream-composer-modal-cancel {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #444;
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
}

.bitstream-composer-modal-cancel:hover {
    background: #f3f4f6;
    border-color: #d0d7e0;
}

.bitstream-composer-modal-confirm {
    border: none;
    border-radius: 10px;
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
    padding: 0.5rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(44, 110, 73, 0.22);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.bitstream-composer-modal-confirm:hover {
    background: #205035;
    box-shadow: 0 6px 18px rgba(44, 110, 73, 0.32);
    transform: translateY(-1px);
}

.bitstream-composer-modal-confirm:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(44, 110, 73, 0.18);
}

.bitstream-composer-modal-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Rebit modal live preview */
.bitstream-composer-rebit-live-preview {
    margin-top: 0.75rem;
    border: 1px solid #e2e8e4;
    border-radius: 10px;
    padding: 0.55rem;
    background: #fbfdfc;
}

.bitstream-composer-rebit-fetch.is-edit-mode {
    background: transparent !important;
    border: 1.5px solid var(--wp--preset--color--accent-1, #2c6e49) !important;
    color: var(--wp--preset--color--accent-1, #2c6e49) !important;
    box-shadow: none !important;
}

.bitstream-composer-rebit-fetch.is-edit-mode:hover {
    background: rgba(44, 110, 73, 0.05) !important;
    color: var(--wp--preset--color--accent-1, #2c6e49) !important;
}

/* Ensure metadata submodal stacks on top of the main Rebit modal */
.bitstream-composer-modal-rebit-meta {
    z-index: 100002 !important;
}

.bitstream-composer-rebit-image-preview-wrapper {
    margin-top: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.35rem;
    background: #f8fafc;
    display: inline-block;
    max-width: 100%;
}

.bitstream-composer-rebit-image-preview-el {
    display: block;
    max-width: 100%;
    max-height: 160px;
    border-radius: 10px;
    object-fit: cover;
}

/* Drafts modal */
.bitstream-composer-drafts-actions {
    margin-bottom: 0.65rem;
}

.bitstream-composer-save-draft-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px dashed #c6d1cb;
    border-radius: 8px;
    background: #f7faf8;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
    width: 100%;
    justify-content: center;
}

.bitstream-composer-save-draft-btn:hover {
    background: #eef6f1;
}

.bitstream-composer-drafts-filter {
    margin-bottom: 0.5rem;
}

.bitstream-composer-draft-item {
    cursor: default;
}

.bitstream-composer-draft-info,
.bitstream-composer-scheduled-info {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.bitstream-composer-draft-info p,
.bitstream-composer-scheduled-info p {
    margin: 0.15rem 0;
    font-size: 0.85rem;
    color: #444;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.bitstream-composer-draft-info small,
.bitstream-composer-scheduled-info small {
    font-size: 0.78rem;
    color: #888;
    display: block;
    margin-top: 0.2rem;
}

.bitstream-composer-item-rebit-preview {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    margin: 0.2rem 0 0.35rem 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
}

.bitstream-composer-item-rebit-preview i {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.bitstream-composer-item-rebit-preview span {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bitstream-composer-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.bitstream-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.35;
}

.bitstream-item-badge-mood {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.bitstream-item-badge-mood img.emoji,
.bitstream-item-badge-mood .bs-badge-emoji {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

.bitstream-item-badge-media {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.bitstream-item-badge-quote {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

@media (prefers-color-scheme: dark) {
    .bitstream-composer-item-rebit-preview {
        background: #1e293b;
        border-color: #334155;
        color: #4ade80;
    }
    .bitstream-item-badge-mood {
        background: #451a03;
        color: #fde68a;
        border-color: #78350f;
    }
    .bitstream-item-badge-media {
        background: #0c4a6e;
        color: #bae6fd;
        border-color: #0284c7;
    }
    .bitstream-item-badge-quote {
        background: #3b0764;
        color: #e9d5ff;
        border-color: #7e22ce;
    }
}

body.dark-mode .bitstream-composer-item-rebit-preview,
.dark-theme .bitstream-composer-item-rebit-preview {
    background: #1e293b;
    border-color: #334155;
    color: #4ade80;
}
body.dark-mode .bitstream-item-badge-mood,
.dark-theme .bitstream-item-badge-mood {
    background: #451a03;
    color: #fde68a;
    border-color: #78350f;
}
body.dark-mode .bitstream-item-badge-media,
.dark-theme .bitstream-item-badge-media {
    background: #0c4a6e;
    color: #bae6fd;
    border-color: #0284c7;
}
body.dark-mode .bitstream-item-badge-quote,
.dark-theme .bitstream-item-badge-quote {
    background: #3b0764;
    color: #e9d5ff;
    border-color: #7e22ce;
}

.bitstream-composer-draft-actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-shrink: 0;
}

.bitstream-composer-drafts-empty {
    text-align: center;
    color: #888;
    font-size: 0.88rem;
    padding: 1rem 0;
}

/* Scheduled posts list modal */
.bitstream-composer-scheduled-filter {
    margin-bottom: 0.5rem;
}

.bitstream-composer-scheduled-item {
    cursor: default;
}

.bitstream-composer-scheduled-info {
    flex: 1 1 auto;
    min-width: 0;
}

.bitstream-composer-scheduled-actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-shrink: 0;
}

.bitstream-composer-scheduled-empty {
    text-align: center;
    color: #888;
    font-size: 0.88rem;
    padding: 1rem 0;
}

/* Schedule modal */
.bitstream-composer-schedule-datetime-input {
    margin-top: 0.5rem;
}

.bitstream-composer-schedule-datetime-input:disabled {
    opacity: 0.4;
}

.bitstream-feed-sidebar-column {
    grid-area: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-content: start;
}

.bitstream-feed-sidebar-column .bitstream-feed-sidebar-intro,
.bitstream-feed-sidebar-column .bitstream-feed-sidebar-left {
    grid-area: auto;
}

.bitstream-feed-sidebar-left {
    grid-area: left;
}

.bitstream-feed-sidebar-intro {
    grid-area: intro;
}

.bitstream-feed-sidebar-right {
    grid-area: right;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bitstream-right-rail-reserved {
    min-height: 1px;
}

.bitstream-feed-main {
    grid-area: main;
}

.bitstream-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 0.65rem;
    border: 1px solid #ddd;
    border-radius: 15px;
    background: #fff;
    padding: 0.55rem;
}

.bitstream-filter-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d5e1da;
    border-radius: 999px;
    padding: 0.26rem 0.6rem;
    font-size: 0.8rem;
    color: #2f3b34;
    background: #f7faf8;
    text-decoration: none;
    transition: all 0.2s ease;
}

a.bitstream-filter-chip:hover {
    background: #eef6f1;
    border-color: #c6d1cb;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-filter-chip-clear {
    border-style: dashed;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-feed-sidebar {
    border: 1px solid #ddd;
    border-radius: 15px;
    background: #fff;
    padding: 0.75rem;
    height: fit-content;
}

.bitstream-intro-text {
    margin: 0;
    color: #3d4a43;
    line-height: 1.45;
    font-size: 0.9rem;
}

.bitstream-filter-box {
    border: 1px solid #e2e6e3;
    border-radius: 12px;
    background: #fff;
    padding: 0.6rem;
}

.bitstream-filter-box+.bitstream-filter-box {
    margin-top: 0.75rem;
}

.bitstream-feed-sidebar-title {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
}

.bitstream-feed-sidebar-panel {
    display: none;
}

.bitstream-feed-sidebar-tabs {
    display: block;
}

.bitstream-composer-container {
    display: block;
}

.bitstream-feed-sidebar-panel {
    min-width: 0;
}

.bitstream-feed-sidebar-panel[open] {
    grid-column: 1 / -1;
}

.hide-on-mobile {
    display: none !important;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION
   ========================================================================== */
/* ── MOBILE BOTTOM NAVIGATION BAR ───────────────────────────────────────────
   Always visible on mobile. All screens/sheets sit above it, never over it.
   ─────────────────────────────────────────────────────────────────────────── */

.bitstream-bottom-nav {
    display: none;
    /* hidden by default; shown only on mobile via @media below */
}

@media (max-width: 1023px) {
    .bitstream-bottom-nav {
        display: grid;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding-bottom: env(safe-area-inset-bottom);
        background: #fff;
        border-top: 1px solid #eef0f2;
        z-index: 100005;
        grid-template-columns: repeat(3, 1fr);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    }

    /* Hide bottom nav completely when composer screen is active */
    body:has(.bitstream-composer:not([hidden])) .bitstream-bottom-nav,
    body.bitstream-composer-open .bitstream-bottom-nav {
        display: none !important;
    }

    body.bitstream-composer-open {
        overflow: hidden !important;
    }

    .bitstream-bottom-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        color: #6b7280;
        font-size: 0.65rem;
        font-weight: 500;
        letter-spacing: 0.01em;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.15s ease;
        position: relative;
    }

    .bitstream-bottom-nav-btn i {
        font-size: 1.2rem;
        line-height: 1;
    }

    .bitstream-bottom-nav-btn:hover,
    .bitstream-bottom-nav-btn.is-active {
        color: var(--wp--preset--color--accent-1, #2c6e49);
    }

    .bitstream-bottom-nav-btn:focus,
    .bitstream-bottom-nav-btn:focus-visible,
    .bitstream-bottom-nav-btn:active {
        outline: none !important;
        border: none !important;
        box-shadow: none !important;
        background: none !important;
    }

    /* Active indicator dot on the Search button when filters are applied */
    .bitstream-bottom-nav[data-filters-active="1"] #bs-nav-search::after {
        content: '';
        position: absolute;
        top: 4px;
        right: calc(50% - 14px);
        width: 7px;
        height: 7px;
        background: var(--wp--preset--color--accent-1, #2c6e49);
        border-radius: 50%;
        border: 1.5px solid #fff;
    }

    /* Compose Floating Action Button (FAB) */
    .bitstream-compose-fab {
        position: fixed;
        bottom: calc(56px + env(safe-area-inset-bottom) + 16px);
        right: 16px;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--wp--preset--color--accent-1, #2c6e49);
        color: #fff;
        border: none;
        box-shadow: 0 4px 14px rgba(44, 110, 73, 0.35);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 100004;
        transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .bitstream-compose-fab i {
        font-size: 1.25rem;
        line-height: 1;
        margin: 0;
        padding: 0;
        color: #fff;
    }

    .bitstream-compose-fab:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(44, 110, 73, 0.45);
    }

    .bitstream-compose-fab:active {
        transform: scale(0.92);
        box-shadow: 0 2px 8px rgba(44, 110, 73, 0.3);
    }

    /* Hide FAB when composer screen, search screen, or more sheet are active */
    body:has(.bitstream-composer:not([hidden])) .bitstream-compose-fab,
    body:has(.bitstream-mobile-screen:not([hidden])) .bitstream-compose-fab,
    body:has(.bitstream-bottom-sheet:not([hidden])) .bitstream-compose-fab,
    body:has(.bitstream-bottom-sheet-backdrop:not([hidden])) .bitstream-compose-fab,
    body:has(#bs-about-modal:not([hidden])) .bitstream-compose-fab,
    .bitstream-composer:not([hidden]) ~ .bitstream-compose-fab,
    .bitstream-mobile-screen:not([hidden]) ~ .bitstream-compose-fab,
    .bitstream-bottom-sheet:not([hidden]) ~ .bitstream-compose-fab,
    .bitstream-bottom-sheet-backdrop:not([hidden]) ~ .bitstream-compose-fab {
        display: none !important;
    }

    /* Feed padding so content doesn't hide behind the nav bar */
    .bitstream-feed-layout {
        padding-bottom: calc(56px + env(safe-area-inset-bottom) + 1rem);
    }

    /* ── MOBILE SCREENS (full-height above nav bar) ────────────────────────── */

    .bitstream-mobile-screen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: calc(56px + env(safe-area-inset-bottom));
        background: #fff;
        z-index: 99996;
        display: flex;
        flex-direction: column;
        animation: bitstreamMobileModalIn 0.28s cubic-bezier(0.32, 0.94, 0.6, 1);
        overscroll-behavior: contain;
    }

    .bitstream-mobile-screen[hidden] {
        display: none;
    }

    .bitstream-mobile-screen-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid #eef0f2;
        flex-shrink: 0;
    }

    .bitstream-mobile-screen-header h2 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--wp--preset--color--accent-1, #2c6e49);
    }

    .bitstream-mobile-screen-close {
        background: none;
        border: none;
        cursor: pointer;
        color: #6b7280;
        font-size: 1.2rem;
        padding: 0.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        -webkit-tap-highlight-color: transparent;
    }

    .bitstream-mobile-screen-body {
        flex: 1;
        overflow-y: auto;
        padding: 1rem 1.25rem;
        overscroll-behavior: contain;
    }

    /* ── BOTTOM SHEET (partial-height, e.g. More) ──────────────────────────── */

    .bitstream-bottom-sheet-backdrop {
        position: fixed;
        inset: 0;
        bottom: calc(56px + env(safe-area-inset-bottom));
        background: rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 99996;
        animation: bitstreamFadeIn 0.2s ease-out;
    }

    .bitstream-bottom-sheet-backdrop[hidden] {
        display: none;
    }

    .bitstream-bottom-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(56px + env(safe-area-inset-bottom));
        max-height: 62vh;
        background: #fff;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
        z-index: 99997;
        display: flex;
        flex-direction: column;
        animation: bitstreamMobileModalIn 0.28s cubic-bezier(0.32, 0.94, 0.6, 1);
        overscroll-behavior: contain;
    }

    .bitstream-bottom-sheet[hidden] {
        display: none;
    }

    .bitstream-bottom-sheet-handle {
        width: 36px;
        height: 4px;
        background: #d1d5db;
        border-radius: 2px;
        margin: 0.65rem auto 0;
        flex-shrink: 0;
    }

    .bitstream-bottom-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.65rem 1.25rem 0.65rem;
        border-bottom: 1px solid #eef0f2;
        flex-shrink: 0;
    }

    .bitstream-bottom-sheet-header h2 {
        margin: 0;
        font-size: 1rem;
        font-weight: 700;
        color: var(--wp--preset--color--accent-1, #2c6e49);
    }

    .bitstream-bottom-sheet-close {
        background: none;
        border: none;
        cursor: pointer;
        color: #6b7280;
        font-size: 1.2rem;
        padding: 0.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        -webkit-tap-highlight-color: transparent;
    }

    .bitstream-bottom-sheet-body {
        flex: 1;
        overflow-y: auto;
        padding: 0.75rem 1.25rem 1rem;
        overscroll-behavior: contain;
    }

    /* More sheet row items */
    .bs-more-row {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.8rem 0;
        color: #374151;
        text-decoration: none;
        font-size: 0.95rem;
        border-bottom: 1px solid #f3f4f6;
        -webkit-tap-highlight-color: transparent;
    }

    .bs-more-row:last-child {
        border-bottom: none;
    }

    .bs-more-row i {
        width: 1.25rem;
        text-align: center;
        color: var(--wp--preset--color--accent-1, #2c6e49);
        font-size: 1rem;
    }

    .bs-more-section {
        margin-top: 1rem;
    }

    .bs-more-section:first-child {
        margin-top: 0;
    }

    .bs-more-section-title {
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #9ca3af;
        margin: 0 0 0.5rem;
    }

    /* ==========================================================================
   SEARCH SCREEN
   ========================================================================== */
/* Search screen sections */
    .bs-search-section {
        margin-bottom: 1.25rem;
    }

    .bs-search-section:last-child {
        margin-bottom: 0;
    }

    .bs-search-section-title {
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #9ca3af;
        margin: 0 0 0.6rem;
    }
}


.bitstream-filter-search {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 0;
}

.bitstream-filter-search input[type="search"] {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 0.5rem 0.65rem;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.88rem;
}

.bitstream-filter-search button {
    border: none;
    border-radius: 12px;
    padding: 0.45rem 0.7rem;
    margin-top: 0.1rem;
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.bitstream-filter-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    text-decoration: none;
    color: #2f3b34;
    font-size: 0.88rem;
    padding: 0.4rem 0.5rem;
    border-radius: 10px;
}

.bitstream-filter-link:hover {
    background: #f4f7f5;
}

.bitstream-filter-link.is-active {
    background: #eef6f1;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    font-weight: 600;
}

.bitstream-filter-link.bitstream-filter-clear {
    margin-top: 0.55rem;
    border: 1px dashed #c6d1cb;
    color: #4f5d55;
}

.bitstream-quick-action-link {
    justify-content: flex-start;
    gap: 0.5rem;
}

.bitstream-quick-action-link i {
    color: var(--wp--preset--color--accent-1, #2c6e49);
    width: 1rem;
    text-align: center;
}

.bitstream-archive-label {
    color: var(--wp--preset--color--accent-1, #2c6e49);
    font-weight: 700;
}

.bitstream-archive-count {
    color: #8a938e;
    font-weight: 500;
}

.bitstream-archive-year {
    margin-top: 0.45rem;
    border: 1px solid #e2e8e4;
    border-radius: 10px;
    background: #fbfdfc;
    overflow: hidden;
}

.bitstream-archive-year-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.38rem 0.5rem;
    cursor: pointer;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    font-size: 0.87rem;
    font-weight: 700;
}

.bitstream-archive-year-summary::after {
    content: "▾";
    color: #7b8780;
    font-size: 0.78rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.bitstream-archive-year[open] .bitstream-archive-year-summary::after {
    transform: rotate(180deg);
}

.bitstream-archive-year-summary::-webkit-details-marker {
    display: none;
}

.bitstream-archive-year-label {
    color: inherit;
}

.bitstream-archive-year-count {
    color: #8a938e;
    font-size: 0.82rem;
    font-weight: 600;
}

.bitstream-archive-months {
    padding: 0.15rem 0.35rem 0.35rem;
}

.bitstream-archive-months .bitstream-filter-link {
    font-size: 0.84rem;
    padding: 0.34rem 0.45rem;
}

.bitstream-feed {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    align-items: start;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    padding: 0 0 1rem;
    box-sizing: border-box;
    z-index: 1;
    overflow: visible;
}

.bitstream-feed .bit-card {
    margin: 0 !important;
}

/* Ensure the feed doesn't interfere with other page elements */
.bitstream-feed::after {
    content: "";
    display: block;
    clear: both;
    height: 2rem;
    /* Add some spacing after the feed */
}

/* Preview grid: compact homepage layout without sidebars */
.bitstream-preview-grid {
    display: block;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    column-fill: balance;
    column-gap: 1rem;
}

.bitstream-preview-grid .bit-card {
    margin: 0 !important;
    height: auto;
    display: block;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 1rem !important;
}

.bitstream-preview-grid .bitstream-quoted-preview,
.bitstream-preview-grid .bit-rebit-preview {
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .bitstream-preview-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .bitstream-preview-grid {
        column-count: 3;
    }
}

@media (min-width: 768px) {
    .bitstream-feed-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "left"
            "main"
            "right";
        gap: 1rem;
        align-items: start;
    }

    .bitstream-feed-sidebar {
        position: static;
    }

    .bitstream-feed-sidebar-panel {
        margin: 0;
    }

    .bitstream-feed {
        padding: 0 0 1.25rem;
    }
}

@media (min-width: 1024px) {
    .bitstream-feed-layout {
        grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) minmax(170px, 210px);
        grid-template-areas:
            "left main right";
        gap: 1rem;
        align-items: start;
    }

    .bitstream-feed-sidebar {
        position: static;
    }

    .bitstream-feed-sidebar-tabs {
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
    }

    .bitstream-feed-sidebar-column,
    .bitstream-feed-sidebar-right {
        position: static;
        top: auto;
    }

    .bitstream-feed-sidebar-summary {
        display: none;
    }

    .bitstream-feed-sidebar-right {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-content: start;
    }

    .mobile-rss-panel {
        display: none !important;
    }



    .hide-on-mobile {
        display: block !important;
    }

    .bitstream-feed-sidebar-panel {
        display: block;
    }

    .hide-on-desktop {
        display: none !important;
    }

    .bitstream-feed-sidebar-tabs .bitstream-feed-sidebar-panel+.bitstream-feed-sidebar-panel {
        margin-top: 1rem;
    }

    .bitstream-feed {
        padding: 0 0 2rem;
    }
}

/* Card styling for grid layout */
.bit-card {
    position: relative;
    width: 100%;
    margin: 0;
    height: auto;
    align-self: start;
    border: 1px solid #ddd !important;
    max-width: none !important;
    box-sizing: border-box;
    z-index: 2;
}

.bit-card.bit-card-delete-pending {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.bit-card.bit-card-delete-fade {
    opacity: 0;
    transform: scale(0.98);
}

.bit-delete-toast {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    color: #2c6e49;
    border: none;
    border-radius: 0;
    padding: 0.9rem 1rem;
}

/* Boost z-index when comments are open to prevent visual layering issues */
.bit-card:has(.bit-comments.open),
.bit-card.comments-open {
    z-index: 10;
    /* Significantly higher than normal cards when comments are open */
}

@media (min-width: 768px) {
    .bit-card {
        width: 100%;
    }
}

/* Date and Edit link: italic, secondary color, clickable, smaller */
.bit-comment-meta a {
    color: var(--wp--preset--color--accent-2, #044389) !important;
    font-style: italic !important;
    font-size: 0.8em !important;
    text-decoration: none !important;
}

/* Nested replies separator: top border on nested comments */
.comment .children .bit-comment {
    border-top: 1px solid var(--wp--preset--color--accent-3, #ccc) !important;
    padding-top: 1em !important;
    margin-top: 0.5em !important;
}

/* Reduce composer name size */
.bit-comment-header .bit-comment-author-name {
    font-size: 0.85em !important;
}




/* ==========================================================================
   ACTION BUTTONS
   ========================================================================== */
/* BitStream Action Icons Styling */
.bit-card-footer-main-actions,
.bit-card-footer-admin-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.bit-card-footer-spacer {
    display: inline-block;
    width: 1px;
    height: 1.1rem;
    margin: 0 0.25rem;
    background: rgba(0, 0, 0, 0.18);
}

.bit-action i {
    color: var(--wp--preset--color--accent-1, #2c6e49);
    transition: color 0.2s ease;
}

@media (hover: hover) {
    .bit-action:hover i {
        color: var(--wp--preset--color--accent-2, #044389);
    }
}

.bit-action:active i {
    color: var(--wp--preset--color--accent-2, #044389);
}

.bit-like .bit-like-count {
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bit-delete i {
    color: #c0392b;
}

.bit-delete:hover i,
.bit-delete:focus i,
.bit-delete.is-active i {
    color: #e74c3c;
}

.bit-edit i {
    color: #044389;
}

.bit-edit:hover i,
.bit-edit:focus i {
    color: #044389;
}

.bit-quote i {
    color: #044389;
}

.bit-quote:hover i,
.bit-quote:focus i {
    color: #044389;
}

/* Liked state */
.bit-like.liked i {
    color: var(--wp--preset--color--accent-2, #044389);
}

/* Pulse animation - single definition */
@keyframes bitstream-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.bit-like.pulse,
.bit-permalink i.pulse,
.bit-share i.pulse,
.bit-edit i.pulse {
    animation: bitstream-pulse 0.3s ease-in-out;
}



.bit-timestamp {
    position: relative;
    cursor: default;
}

.bit-timestamp[data-timestamp-tooltip]::after {
    content: attr(data-timestamp-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 25;
    transition: opacity 0.16s ease, visibility 0.16s ease;
}

.bit-timestamp[data-timestamp-tooltip]::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #111;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 24;
    transition: opacity 0.16s ease, visibility 0.16s ease;
}




/* Like button animation and active state */
.bit-like.liked {
    color: var(--wp--preset--color--primary, #c00);
    font-weight: bold;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.bit-like:hover {
    opacity: 0.8;
}

/* Permalink button hover effect */
.bit-permalink {
    transition: color 0.2s ease;
}

.bit-permalink:focus,
.bit-permalink:hover {
    color: var(--wp--preset--color--primary, #000);
}

/* Share button hover effect */
.bit-share {
    transition: color 0.2s ease;
}

.bit-share:focus,
.bit-share:hover {
    color: var(--wp--preset--color--primary, #000);
}

/* Load More Button Styling */
.bitstream-load-more {
    display: block;
    margin: 2rem auto;
    background-color: var(--wp--preset--color--accent-1, #2c6e49);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border-radius: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s ease;
    width: 100%;
    max-width: 300px;
    position: relative;
    z-index: 10;
    clear: both;
}

.bitstream-load-more:hover,
.bit-comment-form input[type="submit"]:hover {
    background-color: var(--wp--preset--color--accent-2, #044389);
}

.bit-comment-form input[type="submit"],
#respond input[type="submit"] {
    background-color: var(--wp--preset--color--accent-1, #2c6e49);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    border-radius: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s ease;
}

.bit-comment-form input[type="text"],
.bit-comment-form input[type="email"],
.bit-comment-form input[type="url"],
#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"],
.bit-comment-form textarea,
#respond textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    padding: 0.8rem;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.bit-comment-form textarea,
#respond textarea {
    resize: vertical;
    min-height: 120px;
}

#respond .comment-reply-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#cancel-comment-reply-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 15px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-block;
}

#cancel-comment-reply-link:hover {
    background-color: #eee;
    color: #000;
}

.akismet_comment_form_privacy_notice {
    font-size: 0.75rem !important;
    color: #888 !important;
    margin-top: 1rem;
}

.akismet_comment_form_privacy_notice a {
    color: #888 !important;
    text-decoration: underline;
}

.comment-list,
.comment-list ul,
.comment-list ol {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

/* Modern Comment Styling */
.comment-list .children {
    margin-left: 15px;
    border-left: 1px solid #ccc;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .comment-list .children {
        margin-left: 63px;
    }
}

.bit-modern-comment {
    display: flex;
    gap: 15px;
}

/* Thread layout (top-level comment wrappers) */
.comment-list>li {
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.comment-list>li:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

/* Spacing between parent and replies */
.comment-list .children {
    margin-top: 20px;
}

/* Spacing between sibling replies */
.comment-list .children>li {
    margin-top: 20px;
}

.comment-list .children>li:first-child {
    margin-top: 0;
}

.bit-modern-comment-avatar img.avatar {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: block;
}

.bit-modern-comment-content {
    flex: 1;
    min-width: 0;
}

.bit-modern-comment-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.bit-modern-comment-author,
.bit-modern-comment-author a {
    font-weight: 700;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    font-size: 1.05rem;
    font-style: normal;
    text-decoration: none;
}

.bit-modern-comment-author a:hover {
    text-decoration: underline;
}

.bit-modern-comment-date,
.bit-modern-comment-date a {
    color: var(--wp--preset--color--accent-2, #044389);
    font-size: 0.9rem;
    text-decoration: none;
}

.bit-modern-comment-date a:hover {
    text-decoration: underline;
}

.bit-modern-comment-text {
    font-size: 1rem;
    line-height: 1.5;
    color: #222;
    margin-bottom: 12px;
}

.bit-modern-comment-text p {
    margin: 0 0 8px 0;
}

.bit-modern-comment-text p:last-child {
    margin-bottom: 0;
}

.bit-modern-comment-actions {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
}

.bit-modern-comment-actions a {
    color: var(--wp--preset--color--accent-1, #2c6e49);
    text-decoration: underline;
}

.bit-modern-comment-actions a:hover {
    color: var(--wp--preset--color--accent-2, #044389);
}

/* Infinite scroll trigger styling */
.bitstream-scroll-trigger {
    width: 100%;
    clear: both;
    position: relative;
    z-index: 10;
}

/* Enhanced comment animation */
.bit-comments {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out 0.15s, margin-top 0.4s ease-out;
    margin-top: 0;
    position: relative;
    z-index: 1;
    /* Ensure comments appear above other content */
    visibility: hidden;
    /* Initially hidden to prevent layout flash */
}

.bit-comments.open {
    max-height: 2000px;
    opacity: 1;
    margin-top: 1rem;
    background: #fff;
    border-radius: 15px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    z-index: 15;
    visibility: visible;
}

/* Responsive feed adjustments */
@media (max-width: 767px) {
    .bitstream-feed-layout {
        grid-template-columns: minmax(0, 1fr) !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .bitstream-feed-layout,
    .bitstream-feed-main,
    .bitstream-feed {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .bitstream-feed-layout>*,
    .bitstream-feed-main>*,
    .bitstream-feed>* {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .bitstream-feed-layout,
    .bitstream-feed-main {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .bit-card {
        margin: 0 0 1rem 0 !important;
        padding: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        position: relative !important;
        left: 0 !important;
        right: auto !important;
        top: 0 !important;
        transform: none !important;
        z-index: auto !important;
    }

    .bitstream-feed {
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    .bit-card,
    .bit-card-content,
    .bit-card-header,
    .bit-author-info,
    .bit-rebit-preview,
    .bitstream-quoted-preview,
    .bitstream-og-card {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .bit-card-content,
    .bit-card-content * {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .bitstream-feed::after {
        height: 1rem;
        /* Reduce spacing on mobile */
    }
}

/* Ensure embedded content works properly in feed cards */
.bit-rebit-embed {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 15px;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
    /* Safari clip bug fix */
}

.bit-rebit-embed iframe {
    border-radius: 15px;
}

/* Responsive iframe and embed handling */
iframe,
embed,
object,
video {
    max-width: 100% !important;
    height: auto !important;
}

/* Frontend tabbed composer */
.bitstream-composer {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 15px;
    background: #fff;
    box-sizing: border-box;
}

.bitstream-composer-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    padding: 0.65rem 0.75rem;
    margin-bottom: 1rem;
    margin: 0 0 0.75rem;
}

.bitstream-composer-tab {
    border: 1px solid #ccc;
    border-radius: 15px;
    background: #fff;
    color: #222;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    font-weight: 600;
}

.bitstream-composer-tab.is-active {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
}

.bitstream-composer-panel {
    display: none;
}

.bitstream-composer-panel.is-active {
    display: block;
}

.bitstream-composer-quote-preview-compact {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
}

.bitstream-composer-quote-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.bitstream-composer-quote-preview-header p {
    margin: 0;
}

/* Settings Tabs */
.bitstream-composer-quote-preview-time,
.bitstream-composer-quote-preview-link {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--wp--preset--color--secondary, #666);
}

.bitstream-composer-quote-preview-link {
    color: var(--wp--preset--color--accent-1, #2c6e49);
    font-weight: 600;
    text-decoration: none;
}

.bitstream-composer-quote-preview-link:hover {
    text-decoration: underline;
}

.bitstream-composer-quote-preview-excerpt {
    margin: 0;
    color: #30363d;
    font-size: 0.95rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Settings Tabs */
.bitstream-settings {
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1e293b;
    box-sizing: border-box;
}

.bitstream-settings *,
.bitstream-settings *::before,
.bitstream-settings *::after {
    box-sizing: border-box;
}

.bitstream-settings h1,
.bitstream-settings h2,
.bitstream-settings h3 {
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.bitstream-settings h2 {
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
}

.bitstream-settings p {
    font-weight: 400;
    color: #475569;
    margin: 0 0 1rem;
}

/* Premium horizontal scrollable tab list */
.bitstream-settings-tabs {
    display: flex;
    flex-wrap: nowrap;
    border-bottom: 2px solid #e2e8f0;
    gap: 0.2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0px;
    flex-shrink: 0;
    width: 100%;
}

.bitstream-settings-tabs::-webkit-scrollbar {
    display: none;
}

.bitstream-settings-tab {
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #64748b;
    padding: 0.6rem 0.1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
    outline: none !important;
    box-shadow: none !important;
    flex: 1 1 0%;
    min-width: 0;
}

.bitstream-settings-tab:hover {
    color: var(--wp--preset--color--accent-1, #2c6e49);
    border-bottom-color: rgba(44, 110, 73, 0.3) !important;
    background: transparent !important;
}

.bitstream-settings-tab.is-active {
    color: var(--wp--preset--color--accent-1, #2c6e49) !important;
    border: none !important;
    border-bottom: 3px solid var(--wp--preset--color--accent-1, #2c6e49) !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

.bitstream-settings-tab:focus,
.bitstream-settings-tab:active,
.bitstream-settings-tab:focus-visible {
    outline: none !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    box-shadow: none !important;
    background: transparent !important;
}

.bitstream-settings-tab.is-active:focus,
.bitstream-settings-tab.is-active:active,
.bitstream-settings-tab.is-active:focus-visible {
    outline: none !important;
    border: none !important;
    border-bottom: 3px solid var(--wp--preset--color--accent-1, #2c6e49) !important;
    box-shadow: none !important;
    background: transparent !important;
}

.bitstream-settings-panel {
    display: none;
}

.bitstream-settings-panel.is-active {
    display: block;
}

.bitstream-settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1.5px solid #e2e8f0;
}

.bitstream-settings-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.bitstream-settings-section h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.bitstream-settings-section p {
    margin: 0 0 1rem;
    color: #475569;
    font-size: 0.9rem;
}

/* Premium Form Controls matching design tokens */
.bitstream-settings input[type="text"],
.bitstream-settings input[type="url"],
.bitstream-settings input[type="email"],
.bitstream-settings textarea,
.bitstream-settings select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    background: #f8fafc;
    color: #0f172a;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bitstream-settings input[type="text"]:focus,
.bitstream-settings input[type="url"]:focus,
.bitstream-settings textarea:focus,
.bitstream-settings select:focus {
    background: #fff;
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.13);
}

.bitstream-settings-field {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bitstream-settings-field label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

/* Override WP admin .wrap inside settings panels */
.bitstream-settings .wrap {
    margin: 0;
    padding: 0;
    max-width: none;
    width: auto;
}

.bitstream-settings .wrap>h1:first-child,
.bitstream-settings .wrap>h1:first-child+p.description {
    display: none;
}

/* Buttons matching design tokens */
.bitstream-settings button[type="submit"],
.bitstream-settings input[type="submit"],
.bitstream-settings .button-primary,
.bitstream-settings .bitstream-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(44, 110, 73, 0.22);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.bitstream-settings button[type="submit"]:hover,
.bitstream-settings input[type="submit"]:hover,
.bitstream-settings .button-primary:hover,
.bitstream-settings .bitstream-copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(44, 110, 73, 0.28);
    opacity: 0.95;
}

.bitstream-settings button[type="submit"]:active,
.bitstream-settings input[type="submit"]:active,
.bitstream-settings .button-primary:active,
.bitstream-settings .bitstream-copy-btn:active {
    transform: translateY(0);
}

/* Secondary Button design tokens */
.bitstream-settings .button-secondary,
.bitstream-settings .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    background: #fff;
    color: #475569 !important;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bitstream-settings .button-secondary:hover,
.bitstream-settings .button:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a !important;
}

/* Specific view link button (RSS Feeds) */
.bitstream-settings a[target="_blank"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 1.25rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    background: #fff;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
}

.bitstream-settings a[target="_blank"]:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

/* Small tag styling for Service links (Feedly, Pocket etc.) */
.bitstream-settings a[href*="feedly.com"],
.bitstream-settings a[href*="inoreader.com"],
.bitstream-settings a[href*="newsblur.com"],
.bitstream-settings a[href*="getpocket.com"] {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Preset Quick Add styling */
.bitstream-presets-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.bitstream-presets-select-wrap {
    flex: 1;
    min-width: 200px;
}

.bitstream-presets-select-wrap label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #475569;
    display: inline-block;
    margin-bottom: 0.25rem;
}

.bitstream-presets-select-wrap br {
    display: none;
}

.bitstream-presets-btn-wrap {
    flex: 0 0 auto;
}

/* Cards inside settings */
.bitstream-settings .card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: none;
}

.bitstream-settings .card .title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

/* Flex containers in layouts */
.bitstream-settings .flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.bitstream-settings .flex-item {
    flex: 1;
    min-width: 280px;
}

/* Mapping rows */
.bitstream-settings .mapping-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.01);
}

.bitstream-settings .mapping-field {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.bitstream-settings .mapping-field label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
}

.bitstream-settings .mapping-field.preview-field {
    flex: 1.5 1 200px;
}

.bitstream-settings .mapping-field.actions-field {
    flex: 0 0 auto;
    justify-content: flex-end;
    align-self: flex-end;
}

/* Remove button in mappings */
.bitstream-settings .mapping-field.actions-field .button-link-delete {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border: 1.5px solid #fca5a5 !important;
    border-radius: 10px !important;
    padding: 0.55rem 1.15rem !important;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bitstream-settings .mapping-field.actions-field .button-link-delete:hover {
    background: #fecaca !important;
    border-color: #f87171 !important;
    color: #b91c1c !important;
}

/* Mapping preview badge */
.bitstream-settings .mapping-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #0f172a;
    height: 38px;
}

.bitstream-settings .mapping-preview i {
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-settings .mappings-container {
    width: 100%;
}

.bitstream-settings #mappings-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

@media (min-width: 1024px) {
    .bitstream-settings #mappings-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Tables inside settings (debug logs) */
.bitstream-settings table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.bitstream-settings table th,
.bitstream-settings table td {
    padding: 0.6rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.bitstream-settings table th {
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
}

/* Notices and Alerts */
.bitstream-settings .notice,
.bitstream-settings .updated,
.bitstream-settings .error,
.bitstream-settings-welcome {
    padding: 1rem;
    margin-bottom: 1.25rem;
    border-radius: 12px;
    border: none;
    border-left: 4px solid var(--wp--preset--color--accent-1, #2c6e49);
    background: #f0f9f4;
    color: #14532d;
}

.bitstream-settings-welcome h3 {
    margin-top: 0;
    margin-bottom: 0.35rem;
    color: #14532d;
}

.bitstream-settings .notice-success,
.bitstream-settings .updated {
    border-left-color: #2c6e49;
    background: #f0f9f4;
    color: #14532d;
}

.bitstream-settings .notice-error,
.bitstream-settings .error {
    border-left-color: #dc3545;
    background: #fff5f5;
    color: #7f1d1d;
}

.bitstream-settings .notice-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1e3a8a;
}

/* Description text */
.bitstream-settings .description,
.bitstream-settings small.description {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 400;
}

/* Form table */
.bitstream-settings .form-table {
    width: 100%;
    border-collapse: collapse;
}

.bitstream-settings .form-table th {
    text-align: left;
    vertical-align: top;
    padding: 0.75rem 0.5rem 0.75rem 0;
    font-weight: 600;
    width: 30%;
}

.bitstream-settings .form-table td {
    padding: 0.75rem 0;
}

/* Icon picker input container */
.bitstream-settings .icon-input-container {
    position: relative;
}

.bitstream-settings .icon-picker-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    height: 28px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: all 0.2s ease;
}

.bitstream-settings .icon-picker-button:hover {
    background: #cbd5e1;
    color: #0f172a;
}

/* Mobile responsive modifications */
@media (max-width: 1023px) {
    .bitstream-settings-tabs {
        gap: 1rem;
    }

    .bitstream-settings-tab {
        padding: 0.65rem 0.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 767px) {
    .bitstream-settings-tabs {
        display: flex !important;
        gap: 0 !important;
        width: 100% !important;
    }

    .bitstream-settings-tab {
        font-size: 0;
        padding: 0.75rem 0.5rem;
        gap: 0;
        flex: 1 !important;
        justify-content: center !important;
    }

    .bitstream-settings-tab i {
        font-size: 1.25rem;
    }

    .bitstream-settings .button,
    .bitstream-settings .button-primary,
    .bitstream-settings .button-secondary,
    .bitstream-settings button[type="submit"],
    .bitstream-settings input[type="submit"],
    .bitstream-settings a[target="_blank"] {
        width: 100%;
        text-align: center;
    }
}

/* Custom dialog width for settings modal on desktop */
@media (min-width: 1024px) {
    section.bitstream-composer div.bitstream-composer-modal-settings>div.bitstream-composer-modal-dialog.bitstream-composer-modal-dialog-wide {
        max-width: min(95vw, 780px) !important;
    }
}

/* ── Icon Picker Modal Styling ─────────────────────────────────────── */
#icon-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45) !important;
    /* Slate dark transparent backdrop */
    backdrop-filter: blur(4px) !important;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

#icon-picker-modal.show {
    display: flex !important;
}

.icon-picker-content {
    background: #fff !important;
    border-radius: 20px !important;
    width: 90% !important;
    max-width: 600px !important;
    max-height: 80vh !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18) !important;
    overflow: hidden !important;
    animation: bitstreamModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.icon-picker-header {
    padding: 1.25rem 1.5rem !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.icon-picker-header h3 {
    margin: 0 !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.icon-picker-close {
    background: none !important;
    border: none !important;
    font-size: 1.5rem !important;
    color: #64748b !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

.icon-picker-close:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

.icon-picker-search {
    padding: 1rem 1.5rem !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
}

.icon-picker-search input {
    width: 100% !important;
    padding: 0.65rem 0.85rem !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    font-size: 0.95rem !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

.icon-picker-search input:focus {
    background: #fff !important;
    border-color: var(--wp--preset--color--accent-1, #2c6e49) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.13) !important;
}

.icon-picker-tabs {
    padding: 0.75rem 1.5rem !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
    display: flex !important;
    gap: 0.5rem !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
}

.icon-picker-tabs::-webkit-scrollbar {
    display: none !important;
}

.icon-category {
    padding: 0.45rem 1rem !important;
    background: #f1f5f9 !important;
    border: 1.5px solid transparent !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.icon-category:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

.icon-category.active {
    background: var(--wp--preset--color--accent-1, #2c6e49) !important;
    color: #fff !important;
}

#icon-grid {
    padding: 1.5rem !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
    gap: 0.75rem !important;
    max-height: 380px !important;
    overflow-y: auto !important;
}

.icon-option {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.75rem !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    text-align: center !important;
    background: #fff !important;
    transition: all 0.2s ease !important;
}

.icon-option:hover {
    background: #f8fafc !important;
    border-color: var(--wp--preset--color--accent-1, #2c6e49) !important;
}

.icon-option i {
    font-size: 1.5rem !important;
    margin-bottom: 0.4rem !important;
    color: var(--wp--preset--color--accent-1, #2c6e49) !important;
    display: block !important;
}

.icon-option small {
    font-size: 0.75rem !important;
    color: #64748b !important;
    word-break: break-all !important;
    font-weight: 500 !important;
}

/* Spinner and loading */
.icon-loading {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 3rem 1.5rem !important;
    text-align: center !important;
    color: #64748b !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
}

.icon-loading-spinner {
    width: 32px !important;
    height: 32px !important;
    border: 3.5px solid #f1f5f9 !important;
    border-top: 3.5px solid var(--wp--preset--color--accent-1, #2c6e49) !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
    margin-bottom: 0.75rem !important;
}

.bitstream-composer-editing-banner {
    margin: 0 0 0.75rem;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    background: rgba(4, 67, 137, 0.08);
    border: 1px solid rgba(4, 67, 137, 0.35);
    color: #044389;
    font-size: 0.9rem;
    font-weight: 600;
}

.bitstream-composer-form {
    display: grid;
    gap: 0.65rem;
}

.bitstream-composer-form input[type="text"],
.bitstream-composer-form input[type="url"],
.bitstream-composer-form textarea {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 15px;
    padding: 0.65rem 0.8rem;
    box-sizing: border-box;
    font-family: inherit;
}

.bitstream-rebit-url-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
}

.bitstream-fetch-og,
.bitstream-composer-rebit-fetch,
.bitstream-rebit-edit-preview,
.bitstream-media-select,
.bitstream-media-remove,
.bitstream-composer-submit {
    border: none;
    border-radius: 15px;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.bitstream-fetch-og.is-loading::before,
.bitstream-composer-rebit-fetch.is-loading::before,
.bitstream-rebit-editor-save.is-loading::before {
    content: "\f110";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 0.45rem;
    display: inline-block;
    animation: bitstream-fetch-spin 1s linear infinite;
}

@keyframes bitstream-fetch-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.bitstream-fetch-og,
.bitstream-composer-rebit-fetch,
.bitstream-rebit-edit-preview,
.bitstream-media-select,
.bitstream-composer-submit {
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
}

.bitstream-rebit-preview-actions {
    display: flex;
    justify-content: flex-start;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

.bitstream-rebit-preview-actions .bitstream-rebit-edit-preview,
.bitstream-rebit-preview-actions .bitstream-rebit-refresh-preview {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    border-radius: 15px;
}

.bitstream-rebit-preview-actions .bitstream-rebit-refresh-preview {
    border: none;
    background: #044389;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.bitstream-rebit-live-preview {
    margin-top: 0.4rem;
}

.bitstream-rebit-live-preview-label {
    margin: 0 0 0.55rem;
}

.bitstream-rebit-live-preview-loading {
    margin: 0 0 0.55rem;
    font-size: 0.88rem;
    color: #5b5b5b;
}

.bitstream-rebit-live-preview-card {
    border-radius: 15px;
    overflow: hidden;
}

.bitstream-media-control-icon.is-hidden {
    display: none !important;
}

.bitstream-media-controls {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
    align-items: center;
}

.bitstream-media-control-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: #f0f0f0;
    color: #555;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.bitstream-media-control-icon:hover {
    background: #e0e0e0;
    color: #222;
}

.bitstream-media-control-icon.bitstream-media-remove {
    background: rgba(200, 30, 30, 0.1);
    color: #c81e1e;
}

.bitstream-media-control-icon.bitstream-media-remove:hover {
    background: rgba(200, 30, 30, 0.2);
}

.bitstream-media-dropzone {
    border: 2px dashed #cbd5d1;
    border-radius: 15px;
    padding: 1rem;
    text-align: center;
    color: #51615a;
    background: #f8faf9;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    margin-bottom: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.bitstream-media-dropzone-icon {
    font-size: 1.5rem;
    line-height: 1;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-media-dropzone.has-media>span {
    display: none;
}

.bitstream-media-dropzone.has-media>.bitstream-media-dropzone-icon {
    display: none;
}

.bitstream-media-dropzone:not(.has-media) .bitstream-media-preview {
    display: none;
    margin-top: 0;
}

.bitstream-media-dropzone.is-dragover {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    background: #eef6f1;
}

.bitstream-media-file {
    display: none !important;
}

/* Ensure modal composer actions are spaced and aligned */
.bitstream-composer-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.bitstream-media-preview {
    margin-top: 0.2rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.bitstream-media-preview img {
    max-width: 100%;
    max-height: 240px;
    border-radius: 15px;
    border: 1px solid #ddd;
    object-fit: contain;
}

.bitstream-media-preview video {
    max-width: 100%;
    border-radius: 15px;
    border: 1px solid #ddd;
    overflow: hidden;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}



.bitstream-media-progress {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
    max-height: 60px;
    opacity: 1;
    overflow: hidden;
    transition: opacity 0.25s ease, max-height 0.25s ease, margin 0.25s ease;
}

.bitstream-media-progress.is-hidden {
    opacity: 0;
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    pointer-events: none;
}

.bitstream-media-progress-track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
}

.bitstream-media-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--wp--preset--color--accent-1, #2c6e49);
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border-radius: 15px;
}

.bitstream-media-progress-text {
    font-size: 0.82rem;
    font-weight: 500;
    color: #475569;
}

/* ==========================================================================
   CROPPER
   ========================================================================== */
.bitstream-cropper-modal {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bitstream-cropper-modal:not([hidden]) {
    opacity: 1;
    visibility: visible;
}

.bitstream-cropper-modal[hidden] {
    display: none;
}



.bitstream-rebit-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bitstream-rebit-editor-modal[hidden] {
    display: none;
}



.bitstream-rebit-editor-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 20, 0.6);
}



.bitstream-rebit-editor-dialog {
    position: relative;
    width: min(620px, 92vw);
    max-height: 90vh;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    z-index: 1;
}



.bitstream-rebit-editor-header,
.bitstream-rebit-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e6e6e6;
}



.bitstream-rebit-editor-header {
    justify-content: flex-start;
}

.bitstream-rebit-editor-footer {
    border-bottom: none;
    border-top: 1px solid #e6e6e6;
}



.bitstream-rebit-editor-header h3 {
    margin: 0;
    font-size: 1rem;
}



.bitstream-rebit-editor-body {
    padding: 1rem;
    display: grid;
    gap: 0.75rem;
    overflow: auto;
}



.bitstream-rebit-editor-body label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}



.bitstream-rebit-editor-body input,
.bitstream-rebit-editor-body textarea {
    border: 1px solid #ccc;
    border-radius: 15px;
    padding: 0.55rem 0.7rem;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    width: 100%;
}

.bitstream-rebit-editor-body .bitstream-media-field {
    margin-top: 0.25rem;
}

.bitstream-rebit-editor-image {
    display: grid;
    gap: 0.7rem;
}

.bitstream-rebit-editor-image-preview {
    width: 100%;
    max-height: 240px;
    border-radius: 15px;
    border: 1px solid #ddd;
    object-fit: contain;
    background: #fafafa;
}

.bitstream-rebit-editor-image-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.bitstream-rebit-editor-image-buttons button {
    border: none;
    border-radius: 15px;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.bitstream-rebit-editor-image-select,
.bitstream-rebit-editor-image-crop {
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
}

.bitstream-rebit-editor-image-clear {
    background: #ff9900;
    color: #fff;
}

#bitstream-rebit-media-preview {
    display: none;
}



.bitstream-rebit-editor-image-select,
.bitstream-rebit-editor-image-crop,
.bitstream-rebit-editor-save {
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(44, 110, 73, 0.2);
    transition: all 0.2s ease;
}

.bitstream-rebit-editor-image-select:hover,
.bitstream-rebit-editor-image-crop:hover,
.bitstream-rebit-editor-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(44, 110, 73, 0.3);
    filter: brightness(1.1);
}

.bitstream-cropper-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.bitstream-cropper-dialog {
    position: relative;
    width: min(720px, 95vw);
    max-height: 90vh;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    z-index: 1;
    transform: scale(0.96) translateY(12px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bitstream-cropper-modal:not([hidden]) .bitstream-cropper-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.bitstream-cropper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid #eef0f2;
    background: #fff;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}

.bitstream-cropper-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-cropper-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    font-size: 1rem;
    color: #888;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    line-height: 1;
}

.bitstream-cropper-close:hover {
    color: #333;
    background: #f3f4f6;
}

.bitstream-cropper-cancel,
.bitstream-audio-tags-footer .bitstream-audio-tags-close,
.bitstream-rebit-editor-footer .bitstream-rebit-editor-close {
    background: #fff;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bitstream-cropper-cancel:hover,
.bitstream-audio-tags-close:hover,
.bitstream-rebit-editor-close:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #ccc;
}

.bitstream-cropper-body {
    padding: 1.5rem;
    overflow: auto;
    background: #fdfdfd;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.bitstream-cropper-stage {
    position: relative;
    background: #1a1a1a;
    border-radius: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    overflow: hidden;
    min-height: 200px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.bitstream-cropper-image {
    max-width: 100%;
    max-height: 60vh;
    display: block;
}

.bitstream-cropper-selection {
    position: absolute;
    border: 2px solid #fff;
    box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.6);
    cursor: move;
    touch-action: none;
}

.bitstream-cropper-selection::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.bitstream-cropper-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid #4c9ffe;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: transform 0.15s ease;
}

.bitstream-cropper-handle:hover {
    transform: scale(1.3);
    background: #4c9ffe;
}

.bitstream-cropper-handle.handle-nw {
    top: -7px;
    left: -7px;
    cursor: nwse-resize;
}

.bitstream-cropper-handle.handle-ne {
    top: -7px;
    right: -7px;
    cursor: nesw-resize;
}

.bitstream-cropper-handle.handle-sw {
    bottom: -7px;
    left: -7px;
    cursor: nesw-resize;
}

.bitstream-cropper-handle.handle-se {
    bottom: -7px;
    right: -7px;
    cursor: nwse-resize;
}

.bitstream-cropper-handle.handle-n {
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.bitstream-cropper-handle.handle-s {
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.bitstream-cropper-handle.handle-e {
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.bitstream-cropper-handle.handle-w {
    left: -7px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.bitstream-cropper-modal.is-square-mode .bitstream-cropper-handle.handle-n,
.bitstream-cropper-modal.is-square-mode .bitstream-cropper-handle.handle-e,
.bitstream-cropper-modal.is-square-mode .bitstream-cropper-handle.handle-s,
.bitstream-cropper-modal.is-square-mode .bitstream-cropper-handle.handle-w {
    display: none;
}

.bitstream-cropper-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid #eee;
}

.bitstream-cropper-help {
    margin: 0;
    color: #555;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bitstream-cropper-help i {
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-cropper-size {
    margin: 0;
    font-size: 0.85rem;
    color: #1a1a1a;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bitstream-cropper-size span {
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-cropper-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.bitstream-cropper-cancel {
    background: #fff;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bitstream-cropper-cancel:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #ccc;
}

.bitstream-cropper-apply {
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(44, 110, 73, 0.2);
    transition: all 0.2s ease;
}

.bitstream-cropper-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(44, 110, 73, 0.3);
    filter: brightness(1.1);
}

.bitstream-cropper-apply:active {
    transform: translateY(0);
}

body.bitstream-cropper-open {
    overflow: hidden;
}

.bitstream-rebit-preview-card {
    border: 1px solid #ddd;
    border-radius: 15px;
    overflow: hidden;
    background: #fafafa;
}

.bitstream-rebit-preview-image {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.bitstream-rebit-preview-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
}

.bitstream-rebit-preview-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.bitstream-rebit-preview-content {
    padding: 0.75rem;
}

.bitstream-rebit-preview-title {
    margin: 0 0 0.35rem;
}

.bitstream-rebit-preview-description {
    margin: 0;
    color: #555;
}

.bitstream-composer-status {
    margin-top: 0.85rem;
    font-size: 0.95rem;
}

.bitstream-composer-status.is-error {
    color: #b42318;
}

.bitstream-composer-status.is-success {
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-modal-status {
    margin-top: 0 !important;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    display: none;
    box-sizing: border-box;
}

.bitstream-modal-status.is-error {
    display: block;
    background-color: #fef3f2;
    border: 1.5px solid #fee4e2;
    color: #b42318;
}

.bitstream-modal-status.is-success {
    display: block;
    background-color: #edf7ed;
    border: 1.5px solid #c2e0c2;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-composer-quote-preview {
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    padding: 0.75rem;
    background: #fafafa;
    margin-top: 0.75rem;
    overflow: visible;
    box-sizing: border-box;
}

.bitstream-composer-quote-preview>p {
    margin: 0 0 0.7rem;
}

.bitstream-composer-quote-preview .bit-card-quoted-nested,
.bs-edit-quote-preview .bit-card-quoted-nested {
    position: static !important;
    width: 100% !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.bitstream-post-options {
    border: 1px solid #ddd;
    border-radius: 15px;
    padding: 0.65rem 0.8rem;
    background: #fafafa;
}

.bitstream-post-options summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 0.65rem;
}

.bitstream-post-options-section-title {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
}

.bitstream-schedule-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 600px) {
    .bitstream-schedule-options {
        grid-template-columns: 1fr;
    }
}

.bitstream-schedule-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    border-radius: 15px;
    transition: background 0.2s ease;
}

.bitstream-schedule-radio:hover {
    background: #f0f0f0;
}

.bitstream-schedule-radio input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin: 0;
}

.bitstream-schedule-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.bitstream-schedule-datetime {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 15px;
    padding: 0.55rem 0.7rem;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.95rem;
}

.bitstream-schedule-datetime:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bitstream-scheduled-filter {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.bitstream-scheduled-filter-btn {
    border: 1px solid #ccc;
    border-radius: 15px;
    background: #fff;
    color: #333;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    font-weight: 600;
}

.bitstream-scheduled-filter-btn.is-active {
    background: var(--wp--preset--color--accent-1, #2c6e49);
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
}

.bitstream-scheduled-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

.bitstream-scheduled-item {
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    padding: 0.85rem 1.1rem;
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    align-items: flex-start;
    box-sizing: border-box;
    max-width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bitstream-scheduled-item.is-filtered-out {
    display: none;
}

.bitstream-scheduled-item.is-highlighted,
.bitstream-highlight-target {
    border-color: var(--wp--preset--color--accent-1, #2c6e49) !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 4px rgba(44, 110, 73, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1) !important;
    background: #f8fbf9 !important;
    position: relative;
    z-index: 10;
    animation: bitstream-highlight-pulse 2s ease-in-out 3;
}

@keyframes bitstream-highlight-pulse {
    0% {
        box-shadow: 0 0 0 0px rgba(44, 110, 73, 0.4), 0 8px 16px rgba(0, 0, 0, 0.1);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(44, 110, 73, 0), 0 8px 16px rgba(0, 0, 0, 0.1);
    }

    100% {
        box-shadow: 0 0 0 0px rgba(44, 110, 73, 0), 0 8px 16px rgba(0, 0, 0, 0.1);
    }
}

.bitstream-scheduled-item p,
.bitstream-scheduled-item small {
    margin: 0.25rem 0 0;
}

.bitstream-scheduled-actions {
    display: flex;
    flex-direction: row;
    gap: 0.55rem;
    align-items: center;
}

.bitstream-scheduled-actions a,
.bitstream-scheduled-delete {
    text-decoration: none;
    background: none;
    color: inherit;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.bitstream-scheduled-edit i,
.bitstream-scheduled-preview i {
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-scheduled-delete {
    color: #ff9900;
}

.bitstream-scheduled-delete:disabled {
    opacity: 0.7;
    cursor: wait;
}

.bitstream-scheduled-actions i {
    font-size: 0.95rem;
    line-height: 1;
}

/* Poster action buttons row */
.bitstream-composer-actions {
    display: flex;
    gap: 0.65rem;
}

.bitstream-composer-actions .bitstream-composer-submit,
.bitstream-composer-actions .bitstream-composer-save-draft {
    flex: 1;
    text-align: center;
}

/* Save to Drafts button */
.bitstream-composer-save-draft {
    border: 1.5px solid #b0b8b4;
    border-radius: 15px;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    background: #fff;
    color: #444;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.bitstream-composer-save-draft:hover {
    border-color: #7a8580;
    background: #f5f7f6;
    color: #222;
}

.bitstream-composer-save-draft:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Draft items reuse scheduled item styles */
.bitstream-draft-item small {
    color: #7a8580;
}

/* Filter empty-state message */
.bitstream-filter-empty {
    color: #7a8580;
    font-size: 0.9rem;
    margin: 0.5rem 0 0;
}

@media (max-width: 640px) {
    .bitstream-rebit-url-row {
        grid-template-columns: 1fr;
    }

    .bitstream-scheduled-item {
        flex-direction: column;
    }

    .bitstream-composer-actions {
        flex-direction: column;
    }

    .bitstream-composer-actions .bitstream-composer-submit,
    .bitstream-composer-actions .bitstream-composer-save-draft {
        flex: 1 1 100%;
        text-align: center;
    }
}

/* ── Composer Header Top Bar & Action Pills (Drafts / Scheduled) ── */
@media (min-width: 1024px) {
    .bitstream-composer-top-bar {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin-bottom: 0.65rem;
    }
}

@media (max-width: 1023px) {
    .bitstream-composer-top-bar {
        display: none !important;
    }
}

.bitstream-composer-top-bar .bitstream-feed-sidebar-title {
    margin: 0 !important;
    line-height: 1.2;
}


.bitstream-composer-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    background: rgba(44, 110, 73, 0.07);
    border: 1px solid rgba(44, 110, 73, 0.18);
    border-radius: 9999px;
    cursor: pointer;
    line-height: 1.3;
    text-decoration: none;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.bitstream-composer-pill-btn i {
    font-size: 0.78rem;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    opacity: 0.9;
}

.bitstream-composer-pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9999px;
    line-height: 1;
}

.bitstream-composer-pill-btn:hover {
    background: rgba(44, 110, 73, 0.14);
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    color: var(--wp--preset--color--accent-1, #2c6e49);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(44, 110, 73, 0.12);
}

.bitstream-composer-pill-btn:active {
    transform: translateY(0);
}

.bitstream-composer-pill-btn[hidden] {
    display: none !important;
}

body.dark-mode .bitstream-composer-pill-btn,
.dark-theme .bitstream-composer-pill-btn {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.25);
    color: #4ade80;
}

body.dark-mode .bitstream-composer-pill-btn i,
.dark-theme .bitstream-composer-pill-btn i {
    color: #4ade80;
}

body.dark-mode .bitstream-composer-pill-count,
.dark-theme .bitstream-composer-pill-count {
    background: #4ade80;
    color: #1a1a1a;
}

body.dark-mode .bitstream-composer-pill-btn:hover,
.dark-theme .bitstream-composer-pill-btn:hover {
    background: rgba(74, 222, 128, 0.18);
    border-color: #4ade80;
    color: #4ade80;
}

/* Twitter / X Embed Container & Native Tweet Card */
.bit-rebit-embed-twitter {
    position: relative;
    padding-bottom: 0 !important;
    height: auto !important;
    overflow: hidden !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0.5rem 0 0.5rem 0;
}

.bit-tweet-card {
    background: #ffffff;
    border: 1px solid #cfd9de;
    border-radius: 16px;
    padding: 1rem 1.15rem 0.85rem;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bit-tweet-card:hover {
    border-color: #bcc6cc;
    background: #fafbfb;
}

.bit-tweet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.bit-tweet-user-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    min-width: 0;
    max-width: calc(100% - 40px);
    flex: 1;
    overflow: hidden;
}

.bit-tweet-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #eff3f4;
    flex-shrink: 0;
}

.bit-tweet-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0f1419;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.bit-tweet-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.bit-tweet-author {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f1419;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    display: block;
}

.bit-tweet-user-link:hover .bit-tweet-author {
    text-decoration: underline;
}

.bit-tweet-handle {
    font-size: 0.85rem;
    color: #536471;
    line-height: 1.25;
    margin-top: 1px;
}

.bit-tweet-x-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f1419;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: 0.5rem;
    padding: 4px;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.bit-tweet-x-logo:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.bit-tweet-x-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.bit-tweet-body {
    margin: 0.25rem 0 0.65rem 0;
}

.bit-tweet-text {
    font-size: 0.95rem;
    line-height: 1.45;
    color: #0f1419;
    margin: 0;
    word-break: break-word;
}

.bit-tweet-text a,
.bit-tweet-link,
.bit-tweet-mention,
.bit-tweet-hashtag {
    color: #1d9bf0;
    text-decoration: none;
    word-break: break-word;
}

.bit-tweet-text a:hover,
.bit-tweet-link:hover,
.bit-tweet-mention:hover,
.bit-tweet-hashtag:hover {
    text-decoration: underline;
}

/* Twitter / X Tweet Media & Galleries */
.bit-tweet-media {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    margin: 0.65rem 0 0.5rem 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #000000;
}

.bit-tweet-media-link {
    display: block;
    position: relative;
    width: 100%;
    text-decoration: none;
    overflow: hidden;
}

.bit-tweet-thumb {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.bit-tweet-media-link:hover .bit-tweet-thumb {
    opacity: 0.95;
}

.bit-tweet-gallery {
    display: grid;
    gap: 4px;
    border-radius: 14px;
    overflow: hidden;
    margin: 0.65rem 0 0.5rem 0;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #000000;
}

.bit-tweet-gallery-2 {
    grid-template-columns: 1fr 1fr;
    aspect-ratio: 16 / 9;
}

.bit-tweet-gallery-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 16 / 9;
}

.bit-tweet-gallery-3 .bit-tweet-gallery-item:first-child {
    grid-row: span 2;
}

.bit-tweet-gallery-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 16 / 9;
}

.bit-tweet-gallery-item {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background-color: #000000;
}

.bit-tweet-gallery-item .bit-tweet-media-link {
    height: 100%;
}

.bit-tweet-gallery-item img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0 !important;
    object-fit: cover !important;
    display: block !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    transition: opacity 0.2s ease;
}

.bit-tweet-gallery-item:hover img {
    opacity: 0.92;
}

.bit-tweet-timestamp {
    margin-top: 0.5rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #eff3f4;
    font-size: 0.85rem;
    color: #536471;
}

.bit-tweet-timestamp a {
    color: #536471;
    text-decoration: none;
}

.bit-tweet-timestamp a:hover {
    text-decoration: underline;
}

.bit-tweet-footer {
    padding-top: 0.65rem;
}

.bit-tweet-pill-btn {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #cfd9de;
    border-radius: 9999px;
    color: #0f1419;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    background: #ffffff;
    transition: background 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
}

.bit-tweet-pill-btn:hover {
    background: #eff3f4;
    border-color: #bcc6cc;
}

/* Twitter Card Dark Mode Overrides */
body.dark-mode .bit-tweet-card,
.dark-theme .bit-tweet-card {
    background: #000000;
    border-color: #2f3336;
}

body.dark-mode .bit-tweet-card:hover,
.dark-theme .bit-tweet-card:hover {
    background: #080808;
    border-color: #3e4144;
}

body.dark-mode .bit-tweet-author,
.dark-theme .bit-tweet-author {
    color: #e7e9ea;
}

body.dark-mode .bit-tweet-handle,
.dark-theme .bit-tweet-handle {
    color: #71767b;
}

body.dark-mode .bit-tweet-x-logo,
.dark-theme .bit-tweet-x-logo {
    color: #e7e9ea;
}

body.dark-mode .bit-tweet-text,
.dark-theme .bit-tweet-text {
    color: #e7e9ea;
}

body.dark-mode .bit-tweet-text a,
.dark-theme .bit-tweet-text a,
body.dark-mode .bit-tweet-link,
.dark-theme .bit-tweet-link,
body.dark-mode .bit-tweet-mention,
.dark-theme .bit-tweet-mention,
body.dark-mode .bit-tweet-hashtag,
.dark-theme .bit-tweet-hashtag {
    color: #1d9bf0;
}

body.dark-mode .bit-tweet-timestamp,
.dark-theme .bit-tweet-timestamp {
    border-bottom-color: #2f3336;
    color: #71767b;
}

body.dark-mode .bit-tweet-timestamp a,
.dark-theme .bit-tweet-timestamp a {
    color: #71767b;
}

body.dark-mode .bit-tweet-media,
.dark-theme .bit-tweet-media,
body.dark-mode .bit-tweet-gallery,
.dark-theme .bit-tweet-gallery {
    border-color: #2f3336;
}

body.dark-mode .bit-tweet-pill-btn,
.dark-theme .bit-tweet-pill-btn {
    background: #000000;
    border-color: #536471;
    color: #eff3f4;
}

body.dark-mode .bit-tweet-pill-btn:hover,
.dark-theme .bit-tweet-pill-btn:hover {
    background: #181919;
    border-color: #71767b;
}

/* Native Instagram Card */
.bit-rebit-embed-instagram {
    position: relative;
    padding-bottom: 0 !important;
    height: auto !important;
    overflow: hidden !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0.5rem 0 0.5rem 0;
}

.bit-instagram-card {
    background: #ffffff;
    border: 1px solid #dbdbdb;
    border-radius: 16px;
    padding: 1rem 1.15rem 0.85rem;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bit-instagram-card:hover {
    border-color: #c7c7c7;
    background: #fafafa;
}

.bit-instagram-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.bit-instagram-user-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    min-width: 0;
    max-width: calc(100% - 40px);
    flex: 1;
    overflow: hidden;
}

.bit-instagram-avatar-ring {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 2px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.bit-instagram-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #ffffff;
    border: 1.5px solid #ffffff;
    box-sizing: border-box;
}

.bit-instagram-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #f0f2f5;
    color: #262626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    border: 1.5px solid #ffffff;
    box-sizing: border-box;
}

.bit-instagram-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.bit-instagram-author {
    font-size: 0.95rem;
    font-weight: 700;
    color: #262626;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    display: block;
}

.bit-instagram-user-link:hover .bit-instagram-author {
    text-decoration: underline;
}

.bit-instagram-badge {
    font-size: 0.8rem;
    color: #8e8e8e;
    line-height: 1.25;
    margin-top: 1px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.bit-instagram-ig-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #e1306c;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: 0.5rem;
    padding: 4px;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.bit-instagram-ig-logo:hover {
    transform: scale(1.1);
    opacity: 0.85;
}

.bit-instagram-media {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin: 0.5rem 0 0.65rem 0;
    background: #000000;
}

.bit-instagram-media-story {
    background: linear-gradient(135deg, #2b1055 0%, #7597de 100%);
    border-radius: 14px;
}

.bit-instagram-story-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.25rem 1rem;
    text-decoration: none;
    background: linear-gradient(145deg, rgba(240, 148, 51, 0.15) 0%, rgba(220, 39, 67, 0.18) 50%, rgba(188, 24, 136, 0.22) 100%);
    transition: background 0.2s ease, transform 0.15s ease;
}

.bit-instagram-story-cover:hover {
    background: linear-gradient(145deg, rgba(240, 148, 51, 0.22) 0%, rgba(220, 39, 67, 0.26) 50%, rgba(188, 24, 136, 0.3) 100%);
}

.bit-instagram-story-ring-large {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 3px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    margin-bottom: 0.75rem;
}

.bit-instagram-story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #ffffff;
    border: 2px solid #ffffff;
    box-sizing: border-box;
}

.bit-instagram-story-initial {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #ffffff;
    color: #262626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.bit-instagram-story-label {
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.bit-instagram-media-link {
    display: block;
    position: relative;
    width: 100%;
    text-decoration: none;
}

.bit-instagram-thumb {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.bit-instagram-media-link:hover .bit-instagram-thumb {
    opacity: 0.95;
}

.bit-instagram-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    padding-left: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bit-instagram-body {
    margin: 0.35rem 0 0.65rem 0;
}

.bit-instagram-text {
    font-size: 0.93rem;
    line-height: 1.45;
    color: #262626;
    margin: 0;
    word-break: break-word;
}

.bit-instagram-text a,
.bit-instagram-text .bit-tweet-link,
.bit-instagram-text .bit-tweet-mention,
.bit-instagram-text .bit-tweet-hashtag {
    color: #0095f6;
    text-decoration: none;
    word-break: break-word;
}

.bit-instagram-text a:hover,
.bit-instagram-text .bit-tweet-link:hover,
.bit-instagram-text .bit-tweet-mention:hover,
.bit-instagram-text .bit-tweet-hashtag:hover {
    text-decoration: underline;
}

.bit-instagram-timestamp {
    margin-top: 0.5rem;
    margin-bottom: 0.65rem;
    font-size: 0.85rem;
    color: #737373;
    line-height: 1.3;
}

.bit-instagram-timestamp a {
    color: #737373;
    text-decoration: none;
}

.bit-instagram-timestamp a:hover {
    text-decoration: underline;
}

.bit-instagram-footer {
    padding-top: 0.65rem;
    border-top: 1px solid #efefef;
    margin-top: 0.5rem;
}

.bit-instagram-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #dbdbdb;
    border-radius: 9999px;
    color: #262626;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    background: #ffffff;
    transition: background 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
}

.bit-instagram-pill-btn i {
    color: #e1306c;
    font-size: 1rem;
}

.bit-instagram-pill-btn:hover {
    background: #efefef;
    border-color: #c7c7c7;
}

/* Specific YouTube embed fixes */
iframe[src*="youtube.com"],
iframe[src*="youtu.be"],
iframe[src*="youtube-nocookie.com"] {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16/9;
    height: auto !important;
    border-radius: 15px;
}

/* Generic responsive embed container */
.embed-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.embed-container iframe,
.embed-container object,
.embed-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Mobile-specific embed fixes */
@media (max-width: 768px) {

    iframe,
    embed,
    object,
    video {
        max-width: calc(100vw - 40px) !important;
        width: 100% !important;
    }

    iframe[src*="youtube.com"],
    iframe[src*="youtu.be"] {
        max-width: calc(100vw - 40px) !important;
        width: 100% !important;
        height: auto !important;
    }

    /* WordPress embed containers */
    .wp-embedded-content,
    .wp-block-embed,
    .wp-embed {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* BitStream specific containers */
    .bit-content,
    .bit-rebit-content {
        overflow-x: hidden !important;
        word-wrap: break-word !important;
    }
}

/* Quoted preview styles */
.bitstream-quoted-preview {
    margin-top: 0.9rem;
    padding: 0.75rem;
    border-radius: 15px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
    overflow: visible;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.bitstream-quoted-preview[data-permalink] {
    cursor: pointer;
}

.bitstream-quoted-preview[data-permalink]:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.bitstream-quoted-preview .bit-card-quoted-nested {
    position: static !important;
    width: 100% !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.bitstream-quoted-preview .bit-card-quoted-nested .bit-card-content {
    margin-bottom: 0 !important;
}

.bitstream-quoted-preview .bit-card-quoted-nested .bit-card-header,
.bitstream-composer-quote-preview .bit-card-quoted-nested .bit-card-header,
.bs-edit-quote-preview .bit-card-quoted-nested .bit-card-header {
    margin-bottom: 0.45rem !important;
}

.bitstream-quoted-preview .bit-card-quoted-nested .bit-card-footer,
.bitstream-quoted-preview .bit-card-quoted-nested .bit-comments,
.bitstream-quoted-preview .bit-card-quoted-nested hr {
    display: none !important;
}

.bitstream-quoted-preview * {
    max-width: 100%;
    box-sizing: border-box;
}

.bitstream-quoted-preview img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.5em 0;
    border-radius: 15px;
}

.bitstream-quoted-preview a,
.bitstream-quoted-preview p,
.bitstream-quoted-preview div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}



/* Remove focus outline on action buttons and icons */
.bit-like:focus,
.bit-permalink:focus,
.bit-action:focus,
.bit-like i:focus,
.bit-permalink i:focus,
.bit-action i:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Responsive typography adjustments */
@media (max-width: 767px) {
    .bit-card-footer {
        flex-wrap: wrap !important;
        gap: 0.75rem !important;
    }

    .bit-card-footer-main-actions {
        gap: 0.5rem !important;
    }

    .bit-meta {
        font-size: 0.8rem !important;
    }
}

/* Ensure proper spacing for single column on very small screens */
@media (max-width: 480px) {
    .bitstream-feed {
        padding: 0.25rem;
        height: auto !important;
    }

    .bit-card {
        padding: 0.75rem !important;
        border-radius: 15px !important;
        margin: 0 0 0.75rem 0 !important;
        width: 100% !important;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
    }
}

/* Floating QuickBit Button */
#bitstream-floating-quickbit {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.quickbit-menu {
    position: relative;
}

.quickbit-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #2c6e49;
    color: white;
    border-radius: 15px;
    border: none;
    box-shadow: 0 4px 12px rgba(44, 110, 73, 0.25);
    transition: all 0.3s ease;
    font-size: 24px;
    cursor: pointer;
}

.quickbit-toggle:hover {
    transform: scale(1.1);
    background: #1f4d35;
    box-shadow: 0 6px 20px rgba(44, 110, 73, 0.35);
}

.quickbit-toggle:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.quickbit-dropdown {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.quickbit-dropdown a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.quickbit-dropdown a:first-child {
    border-bottom: 1px solid #eee;
}

.quickbit-dropdown a:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.quickbit-dropdown a i {
    margin-right: 8px;
    color: #2c6e49;
    width: 16px;
    text-align: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #bitstream-floating-quickbit {
        bottom: 20px;
        right: 20px;
    }

    .quickbit-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .quickbit-dropdown {
        bottom: 60px;
        min-width: 140px;
    }

    .quickbit-dropdown a {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Ensure it doesn't interfere with admin bar */
.admin-bar #bitstream-floating-quickbit {
    bottom: 62px;
    /* Account for WordPress admin bar height */
}

@media screen and (max-width: 782px) {
    .admin-bar #bitstream-floating-quickbit {
        bottom: 76px;
        /* Adjust for mobile admin bar */
    }
}

/* Hashtag link styling in bit content */
.bitstream-hashtag-link {
    color: var(--wp--preset--color--accent-1, #2c6e49);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.bitstream-hashtag-link:hover {
    color: var(--wp--preset--color--accent-2, #044389);
    text-decoration: underline;
}

/* Sidebar hashtag list */
.bitstream-hashtag-list {
    max-height: none;
    overflow: visible;
}

.bitstream-hashtag-sidebar-link {
    min-width: 0;
    gap: 0.35rem;
}

.bitstream-hashtag-sidebar-tag {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.bitstream-hashtag-sidebar-link .bitstream-archive-count {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Hashtag Autocomplete Inline Panel */
/* ==========================================================================
   HASHTAG AUTOCOMPLETE
   ========================================================================== */
.bitstream-hashtag-autocomplete-inline {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 8px;
    margin-bottom: 8px;
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 4px;
    box-sizing: border-box;
    animation: bitstreamModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bs-hashtag-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.bs-hashtag-item:hover,
.bs-hashtag-item.is-active {
    background: #f1f5f9;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bs-hashtag-symbol {
    color: #94a3b8;
    font-weight: 600;
    margin-right: 2px;
}

.bs-hashtag-name {
    font-weight: 500;
    flex-grow: 1;
}

.bs-hashtag-count {
    font-size: 0.75rem;
    color: #94a3b8;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 6px;
}

.bs-hashtag-item:hover .bs-hashtag-count,
.bs-hashtag-item.is-active .bs-hashtag-count {
    background: #e2e8f0;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

@media (max-width: 1023px) {
    /* ==========================================================================
   HASHTAG AUTOCOMPLETE
   ========================================================================== */
.bitstream-hashtag-autocomplete-inline {
        max-height: 140px;
        margin-top: 6px;
        margin-bottom: 6px;
    }
    .bs-hashtag-item {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
}

/* Timeline Edit Modal Premium Styling */
/* ── Dedicated Timeline Edit Modal (.bs-edit-modal) ──────────────────────── */

.bs-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.bs-edit-modal[hidden],
.bs-edit-modal [hidden] {
    display: none !important;
}

.bs-edit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.bs-edit-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    animation: bitstreamModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bs-edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem 0.75rem;
    border-bottom: 1px solid #eef0f2;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 1;
}

.bs-edit-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bs-edit-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
    line-height: 1;
}

.bs-edit-modal-close:hover {
    color: #333;
    background: #f3f4f6;
}

.bs-edit-modal-body {
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    flex: 1 1 auto;
}

/* Loading state */
.bs-edit-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    min-height: 220px;
    color: #64748b;
    font-size: 0.95rem;
}

.bs-edit-modal-loading i {
    font-size: 2rem;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

/* Error state */
.bs-edit-modal-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    color: #c0392b;
    font-size: 0.9rem;
    text-align: center;
}

.bs-edit-modal-error i {
    font-size: 1.6rem;
}

/* Form base */
.bs-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bs-edit-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bs-edit-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
    letter-spacing: 0.01em;
}

.bs-edit-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1a202c;
    background: #f8fafc;
    resize: vertical;
    min-height: 110px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.bs-edit-textarea:focus {
    outline: none;
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.13);
}

/* URL row (Rebit) */
.bs-edit-url-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    flex-wrap: wrap;
}

.bs-edit-url-input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: #1a202c;
    background: #f8fafc;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bs-edit-url-input:focus {
    outline: none;
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.13);
}

.bs-edit-refetch-btn {
    flex-shrink: 0;
    border: 1.5px solid var(--wp--preset--color--accent-1, #2c6e49);
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
    border-radius: 12px;
    padding: 0 0.9rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

.bs-edit-refetch-btn:hover {
    background: #205035;
    color: #fff;
    transform: translateY(-1px);
}

.bs-edit-refetch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bs-edit-link-meta-open {
    background: transparent;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    box-shadow: none;
    border-style: solid;
}

.bs-edit-link-meta-open:hover {
    background: rgba(44, 110, 73, 0.08);
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bs-edit-link-meta-open:disabled {
    background: transparent;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bs-edit-link-meta-modal .bs-edit-field {
    gap: 0.55rem;
}

.bs-edit-link-meta-modal .bs-edit-field+.bs-edit-field {
    margin-top: 0.75rem;
}

.bs-edit-link-meta-modal .bs-edit-url-row {
    margin-top: 0.1rem;
}

.bs-edit-link-meta-modal .bs-edit-label {
    margin-bottom: 0.05rem;
}

.bs-edit-link-meta-refetch {
    min-width: 7rem;
}

/* OG preview card */
.bs-edit-og-preview {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    overflow: hidden;
}

.bs-edit-og-preview-image-wrap {
    position: relative;
    flex-shrink: 0;
}

.bs-edit-og-preview-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: block;
}

.bs-edit-og-remove-image {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.bs-edit-og-remove-image {
    background: #c0392b;
}

.bs-edit-og-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.bs-edit-og-preview-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a202c;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bs-edit-og-preview-url {
    font-size: 0.78rem;
    color: #888;
}

.bs-edit-og-image-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.bs-edit-og-image-icon-btn {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--wp--preset--color--accent-1, #2c6e49);
    border-radius: 999px;
    background: transparent;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.bs-edit-og-image-icon-btn:hover {
    background: rgba(44, 110, 73, 0.08);
    color: var(--wp--preset--color--accent-1, #2c6e49);
    transform: translateY(-1px);
}

.bs-edit-og-image-icon-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.13);
}

.bs-edit-og-image-clear {
    border-color: #c0392b;
    color: #c0392b;
}

.bs-edit-og-image-clear:hover {
    background: rgba(192, 57, 43, 0.08);
    color: #c0392b;
}

.bs-edit-og-image-crop {
    background: transparent;
}

.bs-edit-og-image-crop:hover {
    background: rgba(44, 110, 73, 0.08);
}

.bs-edit-link-meta-modal .bs-edit-og-preview {
    margin-top: 0.8rem;
}

.bs-edit-link-meta-modal .bs-edit-og-image-actions {
    margin-top: 0.85rem;
}

/* Media area */
.bs-edit-media {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.bs-edit-media[hidden] {
    display: none !important;
}



/* Actions row (inside footer) */
.bs-edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    border-top: 1px solid #eef0f2;
    flex-shrink: 0;
    background: #fff;
    border-radius: 0 0 20px 20px;
}

.bs-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.bs-edit-quote-preview {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #eef0f2;
    border-radius: 14px;
    background: #f8fafc;
}

.bs-edit-quote-preview-card {
    margin-top: 0.75rem;
}

.bs-edit-submit {
    border: none;
    border-radius: 14px;
    background: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.65rem 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(44, 110, 73, 0.22);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.bs-edit-submit:hover {
    background: var(--wp--preset--color--accent-1-hover, #205035);
    box-shadow: 0 6px 18px rgba(44, 110, 73, 0.32);
    transform: translateY(-1px);
}

.bs-edit-submit:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(44, 110, 73, 0.18);
}

.bs-edit-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Mobile Composer Modal & Desktop Inline Restructuring ── */
@media (max-width: 1023px) {

    /* Full-screen mobile modal layout — applies to top-level modals only (bs-edit, cropper)
       Nested sub-modals inside .bitstream-composer use popup style (overridden below). */
    .bs-edit-modal,
    /* ==========================================================================
   CROPPER
   ========================================================================== */
.bitstream-cropper-modal {
        padding: 0 !important;
        align-items: flex-start !important;
    }

    .bs-edit-modal-backdrop,
    .bitstream-cropper-backdrop {
        display: none !important;
    }

    .bs-edit-modal-dialog,
    .bitstream-cropper-dialog {
        width: 100% !important;
        max-width: 100% !important;
        height: calc(100% - 56px - env(safe-area-inset-bottom)) !important;
        max-height: calc(100vh - 56px - env(safe-area-inset-bottom)) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        animation: bitstreamMobileModalIn 0.28s cubic-bezier(0.32, 0.94, 0.6, 1) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .bs-edit-modal-header,
    .bitstream-cropper-header {
        border-radius: 0 !important;
    }

    .bs-edit-modal-footer,
    .bitstream-cropper-footer {
        border-radius: 0 !important;
    }

    .bs-edit-submit {
        width: 100% !important;
        text-align: center;
    }

    /* ── Main Composer wrapper (full-screen on mobile) ── */
    .bitstream-composer {
        position: fixed !important;
        inset: 0 !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 100000 !important;
        display: none !important;
        align-items: flex-start !important;
        justify-content: center !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        border: none !important;
        border-radius: 0 !important;
        background: #fff !important;
        max-width: none !important;
        margin: 0 !important;
    }

    body.dark-mode .bitstream-composer,
    .dark-theme .bitstream-composer {
        background: #18181b !important;
    }

    .bitstream-composer:not([hidden]) {
        display: flex !important;
    }

    .bitstream-composer[data-from-edit-modal="true"]>.bitstream-composer-modal-dialog,
    .bitstream-composer:has(.bitstream-composer-modal-settings:not([hidden]))>.bitstream-composer-modal-dialog {
        display: none !important;
    }

    .bitstream-composer>.bitstream-composer-modal-backdrop {
        display: none !important;
    }

    .bitstream-composer>.bitstream-composer-modal-dialog {
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        height: var(--bs-viewport-height, 100dvh) !important;
        max-height: 100% !important;
        max-height: 100dvh !important;
        max-height: var(--bs-viewport-height, 100dvh) !important;
        background: #fff;
        border-radius: 0 !important;
        box-shadow: none !important;
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
        animation: bitstreamMobileModalIn 0.28s cubic-bezier(0.32, 0.94, 0.6, 1) !important;
        z-index: 2;
        border: none !important;
    }

    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.4rem;
        border-bottom: 1px solid #eef0f2;
        position: sticky;
        top: 0;
        background: #fff;
        border-radius: 0 !important;
        z-index: 1;
        flex-shrink: 0;
    }

    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body {
        padding: 1rem 1.4rem calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        position: relative !important;
    }

    /* ── Nested sub-modals (media, rebit, schedule, drafts…) → popup style on mobile ── */
    .bitstream-composer .bitstream-composer-modal,
    .bs-edit-modal .bitstream-composer-modal {
        /* Re-use the standard modal backdrop/centering so they float above the full-screen composer */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 100001 !important;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 1rem !important;
        box-sizing: border-box;
        background: transparent;
    }

    .bitstream-composer .bitstream-composer-modal:not([hidden]),
    .bs-edit-modal .bitstream-composer-modal:not([hidden]) {
        display: flex !important;
    }

    /* Show the backdrop for nested sub-modals */
    .bitstream-composer .bitstream-composer-modal>.bitstream-composer-modal-backdrop,
    .bs-edit-modal .bitstream-composer-modal>.bitstream-composer-modal-backdrop {
        display: block !important;
        /* position:absolute keeps it contained within the already-fixed parent.
           position:fixed would let backdrop-filter composite against the entire
           viewport stack, blurring the main page behind the composer. */
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.50);
        z-index: 0;
    }

    /* Popup dialog style for nested sub-modals on mobile */
    .bitstream-composer .bitstream-composer-modal>.bitstream-composer-modal-dialog,
    .bs-edit-modal .bitstream-composer-modal>.bitstream-composer-modal-dialog {
        position: relative;
        z-index: 1;
        width: 100% !important;
        max-width: 480px !important;
        height: auto !important;
        /* Cap at the available viewport above the bottom nav, minus 1rem breathing room */
        max-height: calc(100svh - 56px - env(safe-area-inset-bottom) - 1rem) !important;
        border-radius: 20px !important;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18) !important;
        display: flex !important;
        flex-direction: column !important;
        background: #fff;
        overflow: hidden;
        animation: bitstreamModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    .bitstream-composer .bitstream-composer-modal>.bitstream-composer-modal-dialog>.bitstream-composer-modal-header,
    .bs-edit-modal .bitstream-composer-modal>.bitstream-composer-modal-dialog>.bitstream-composer-modal-header {
        border-radius: 20px 20px 0 0 !important;
    }

    .bitstream-composer .bitstream-composer-modal>.bitstream-composer-modal-dialog>.bitstream-composer-modal-footer,
    .bs-edit-modal .bitstream-composer-modal>.bitstream-composer-modal-dialog>.bitstream-composer-modal-footer {
        border-radius: 0 0 20px 20px !important;
    }

    .bitstream-composer .bitstream-composer-modal>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body,
    .bs-edit-modal .bitstream-composer-modal>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body {
        overflow-y: auto;
        flex: 1 1 auto;
    }

    /* Wide dialog variant */
    .bitstream-composer .bitstream-composer-modal>.bitstream-composer-modal-dialog.bitstream-composer-modal-dialog-wide,
    .bs-edit-modal .bitstream-composer-modal>.bitstream-composer-modal-dialog.bitstream-composer-modal-dialog-wide {
        max-width: min(90vw, 600px) !important;
    }

    /* ── Drafts & Scheduled List → SCREEN pattern on mobile ────────────────────
       These are task-entry points (not configuration pickers), so they take over
       the full viewport like the main composer and edit-bit screens.
       The parent .bitstream-composer acts as a transparent host; closing these
       screens also closes the composer host (handled in JS closeModal). */
    .bitstream-composer .bitstream-composer-modal-drafts,
    .bitstream-composer .bitstream-composer-modal-scheduled-list,
    .bitstream-composer .bitstream-composer-modal-settings {
        padding: 0 !important;
        align-items: flex-start !important;
    }

    .bitstream-composer .bitstream-composer-modal-drafts>.bitstream-composer-modal-backdrop,
    .bitstream-composer .bitstream-composer-modal-scheduled-list>.bitstream-composer-modal-backdrop,
    .bitstream-composer .bitstream-composer-modal-settings>.bitstream-composer-modal-backdrop {
        display: none !important;
    }

    .bitstream-composer .bitstream-composer-modal-drafts>.bitstream-composer-modal-dialog,
    .bitstream-composer .bitstream-composer-modal-drafts>.bitstream-composer-modal-dialog.bitstream-composer-modal-dialog-wide,
    .bitstream-composer .bitstream-composer-modal-scheduled-list>.bitstream-composer-modal-dialog,
    .bitstream-composer .bitstream-composer-modal-scheduled-list>.bitstream-composer-modal-dialog.bitstream-composer-modal-dialog-wide,
    .bitstream-composer .bitstream-composer-modal-settings>.bitstream-composer-modal-dialog,
    .bitstream-composer .bitstream-composer-modal-settings>.bitstream-composer-modal-dialog.bitstream-composer-modal-dialog-wide {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        animation: bitstreamMobileModalIn 0.28s cubic-bezier(0.32, 0.94, 0.6, 1) !important;
    }

    /* Composer on mobile: form is a flex column filling the modal body.
       Textarea starts at a fixed height (JS can grow it), buttons are anchored to the
       bottom, and the textarea shrinks automatically if the preview area appears. */
    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body {
        display: flex !important;
        flex-direction: column !important;
    }

    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body .bitstream-composer-form {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.65rem !important;
    }

    /* flex: 0 1 160px — starts at 160px, grows as user types (via JS flex-basis), and shrinks to 80px if previews are added. */
    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body .bs-textarea-container {
        flex: 0 1 160px !important;
        min-height: 80px !important;
        display: flex !important;
    }

    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body .bitstream-composer-textarea {
        flex: 1 1 auto !important;
        height: 100% !important;
        min-height: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
        resize: none !important;
    }

    /* Preview area displays fully without internal scrollbars. Textarea shrinks to accommodate it. */
    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body .bitstream-composer-preview-area {
        flex: 0 0 auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Carousel: horizontal scroll-snap on mobile/tablet only */
    .bitstream-composer-preview-carousel {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: scroll !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch !important;
        /* Hide scrollbar visually */
        scrollbar-width: none !important;
    }

    .bitstream-composer-preview-carousel::-webkit-scrollbar {
        display: none !important;
    }

    /* Each card takes the full width of the carousel slot */
    .bitstream-composer-preview-carousel>.bitstream-composer-preview-rebit,
    .bitstream-composer-preview-carousel>.bitstream-composer-preview-media,
    .bitstream-composer-preview-carousel>.bitstream-composer-preview-mood,
    .bitstream-composer-preview-carousel>.bs-edit-quote-preview {
        flex: 0 0 100% !important;
        min-width: 0 !important;
        scroll-snap-align: start !important;
        /* Cards are always in the DOM flow; hidden ones are excluded by JS via display:none */
        box-sizing: border-box !important;
    }

    /* Cap standard link/OG preview images slightly on mobile so they don't consume unnecessary vertical space */
    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body .bitstream-composer-preview-rebit .bitstream-og-card img,
    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body .bitstream-composer-preview-rebit .bit-rebit-preview>img {
        max-height: 120px !important;
        width: 100% !important;
        object-fit: cover !important;
    }

    /* Tweet media thumbnail inside mobile composer: keep aspect ratio without cropping into slivers */
    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body .bit-tweet-thumb {
        max-height: 180px !important;
        width: 100% !important;
        object-fit: contain !important;
        background: #000000;
    }

    /* Anchor action buttons + Post Bit to the bottom regardless of textarea height */
    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body .bitstream-composer-actions-row {
        margin-top: auto !important;
        flex-shrink: 0 !important;
    }

    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body .bitstream-composer-submit-row {
        flex-shrink: 0 !important;
    }

    /* Status message is now inside the form — hide it when empty so it takes no space */
    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body .bitstream-sidebar-composer-status:empty {
        display: none !important;
    }

    /* Edit Bit modal */
    .bs-edit-form {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .bs-edit-field:has(.bs-edit-textarea) {
        flex: 0 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .bs-edit-field:has(.bs-edit-textarea) .bs-textarea-container {
        flex: 1 1 auto !important;
        display: flex !important;
    }

    .bs-edit-textarea {
        flex: 1 1 auto !important;
        height: 100% !important;
        min-height: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
        resize: none !important;
    }

    .bs-edit-media {
        flex: 0 0 auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .bs-edit-modal .bitstream-composer-preview-area {
        flex: 0 0 auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .bs-edit-modal-footer {
        margin-top: auto !important;
    }
}


@media (min-width: 1024px) {
    .bitstream-composer[hidden] {
        display: block !important;
    }

    .bitstream-composer>.bitstream-composer-modal-backdrop {
        display: none !important;
    }

    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-header {
        display: none !important;
    }

    .bitstream-composer>.bitstream-composer-modal-dialog {
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        display: block !important;
        max-height: none !important;
        max-width: none !important;
        overflow: visible !important;
        animation: none !important;
        position: static !important;
        width: auto !important;
        border: none !important;
    }

    .bitstream-composer>.bitstream-composer-modal-dialog>.bitstream-composer-modal-body {
        padding: 0 !important;
        overflow: visible !important;
        display: block !important;
    }
}

.bitstream-composer-modal-confirm.is-delete {
    background: #d32f2f;
    box-shadow: 0 4px 14px rgba(211, 47, 47, 0.22);
}

.bitstream-composer-modal-confirm.is-delete:hover {
    background: #b71c1c;
    box-shadow: 0 6px 18px rgba(211, 47, 47, 0.32);
}

.bitstream-composer-modal-confirm.is-delete:active {
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.18);
}

/* BitStream Media Gallery Grid Styles */
.bitstream-gallery {
    display: grid;
    gap: 6px;
    border-radius: 14px;
    overflow: hidden;
    margin-top: 0.75rem;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.bitstream-gallery-2 {
    grid-template-columns: 1fr 1fr;
    aspect-ratio: 16 / 9;
}

.bitstream-gallery-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 16 / 9;
}

.bitstream-gallery-3 .bitstream-gallery-item:first-child {
    grid-row: span 2;
}

.bitstream-gallery-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 16 / 9;
}

.bitstream-gallery-item {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background-color: #f1f5f9;
}

.bitstream-gallery-item img,
.bitstream-gallery-item video,
.bitstream-gallery-item img.bit-image-landscape,
.bitstream-gallery-item img.bit-image-portrait,
.bit-card-content .bitstream-gallery-item img.bit-image-landscape,
.bit-card-content .bitstream-gallery-item img.bit-image-portrait,
.bitstream-quoted-preview .bitstream-gallery-item img.bit-image-landscape,
.bitstream-quoted-preview .bitstream-gallery-item img.bit-image-portrait {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0 !important;
    object-fit: cover !important;
    display: block !important;
    cursor: pointer;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    transition: transform 0.25s ease;
}

.bitstream-gallery-item img:hover,
.bitstream-gallery-item video:hover {
    transform: scale(1.02);
}

.bitstream-gallery-video-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.bitstream-gallery-video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
    font-size: 2.25rem;
    pointer-events: none;
    transition: background 0.2s ease;
}

.bitstream-gallery-item:hover .bitstream-gallery-video-play-overlay {
    background: rgba(0, 0, 0, 0.35);
}

.bitstream-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    pointer-events: none;
}

.bitstream-gallery-overlay span {
    font-size: 1.85rem;
    font-weight: 700;
}

/* ── Z-INDEX LADDER ─────────────────────────────────────────────────────────
   Keep this table up to date whenever a new layer is introduced.
   Mobile composer sub-modals sit above the composer but below cropper/lightbox.

   999 999   .bitstream-lightbox              (media viewer — always topmost)
   100 010   .bitstream-cropper-modal         (image cropper — above everything except lightbox)
   100 005   .bitstream-bottom-nav            (mobile bottom nav bar)
   100 004   .bitstream-compose-fab           (mobile compose floating action button)
   100 001   composer sub-modal (mobile)      (.bitstream-composer .bitstream-composer-modal, mobile only)
   100 000   .bitstream-composer (mobile)     (full-screen composer / host for Drafts & Scheduled screens)
    99 990   .bs-edit-modal                   (Edit Bit screen)
    99 997   .bitstream-bottom-sheet          (More sheet drawer)
    99 996   .bitstream-mobile-screen         (Search screen — full-height above nav)
             .bitstream-bottom-sheet-backdrop (More sheet backdrop)
    10 000   .bitstream-rebit-editor-modal    (Admin-only Rebit editor — WP dashboard use only)
     9 999   tooltips / dropdowns             (in-page overlays)
   ─────────────────────────────────────────────────────────────────────────── */

/* Lightbox Styling */
/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.bitstream-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bitstream-lightbox.is-open {
    opacity: 1;
}

.bitstream-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.bitstream-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.bitstream-lightbox-stage {
    position: relative;
    width: 90vw;
    height: 80vh;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

.bitstream-lightbox-media {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: block;
    transform: scale(0.96);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bitstream-lightbox.is-open .bitstream-lightbox-media {
    transform: scale(1);
}

.bitstream-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
}

.bitstream-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.05);
}

.bitstream-lightbox-nav-prev {
    left: 20px;
}

.bitstream-lightbox-nav-next {
    right: 20px;
}

.bitstream-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
}

/* Composer / Edit Previews */
.bitstream-media-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    box-sizing: border-box;
}

.bitstream-media-preview-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
}

/* Video play-icon overlay inside composer preview grid */
.bitstream-media-preview-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    pointer-events: none;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.18);
}

/* Dark placeholder so the play icon is visible before the video frame loads */
.bitstream-media-preview-item.is-video-item {
    background: #1a1a2e;
}

.bitstream-media-preview-item img,
.bitstream-media-preview-item video {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    margin: 0 !important;
    display: block !important;
    border-radius: 0 !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}

.bitstream-media-preview-remove-item {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    border: none;
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}

.bitstream-media-preview-remove-item:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.bitstream-media-preview-remove-item:active,
.bitstream-media-preview-crop-item:active {
    transform: scale(0.95);
}

.bitstream-media-preview-crop-item {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    border: none;
    font-size: 9px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
    z-index: 2;
}

.bitstream-media-preview-crop-item:hover {
    background: var(--wp--preset--color--accent-1, #2c6e49);
    transform: scale(1.1);
}

.bitstream-media-dropzone.has-media .bitstream-media-preview {
    display: block !important;
    margin-top: 0;
}

.bitstream-media-dropzone.has-media .bitstream-media-preview-grid {
    margin-top: 0;
}

/* Single Media Hover/Pointer Styles */
.bit-card-content img:not(.emoji):not(.bitstream-gallery-media),
.bit-rebit-preview img:not(.emoji):not(.bitstream-gallery-media),
.bitstream-quoted-preview img:not(.emoji):not(.bitstream-gallery-media) {
    cursor: pointer;
    transition: transform 0.25s ease;
}

.bit-card-content img:not(.emoji):not(.bitstream-gallery-media):hover,
.bit-rebit-preview img:not(.emoji):not(.bitstream-gallery-media):hover,
.bitstream-quoted-preview img:not(.emoji):not(.bitstream-gallery-media):hover {
    transform: scale(1.02);
}

.bit-card-content video:not(.bitstream-gallery-media),
.bit-rebit-preview video:not(.bitstream-gallery-media),
.bitstream-quoted-preview video:not(.bitstream-gallery-media) {
    cursor: pointer;
}

/* ==============================================
   SHARE AS IMAGE — Capture & Share Modal Styles
   ============================================== */

/* Card capturing state */
.bit-card.bit-card-capturing {
    background-color: #ffffff !important;
    border: 1px solid #eef0f2 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
    padding: 1.5rem !important;
    border-radius: 15px !important;
    width: 500px !important;
    min-width: 500px !important;
    max-width: 500px !important;
    box-sizing: border-box !important;
}

.bit-card.bit-card-capturing hr,
.bit-card.bit-card-capturing .bit-card-footer,
.bit-card.bit-card-capturing .bit-comments {
    display: none !important;
}

.bit-card.bit-card-capturing .bit-card-quoted-nested .bit-card-footer,
.bit-card.bit-card-capturing .bit-card-quoted-nested hr {
    display: none !important;
}

.bit-card.bit-card-capturing .bit-timestamp-relative {
    display: none !important;
}

.bit-card.bit-card-capturing .bit-timestamp-full {
    display: inline !important;
}

.bit-card.bit-card-capturing .bit-timestamp-separator {
    display: none !important;
}

.bit-card.bit-card-capturing .bit-card-watermark {
    display: flex !important;
}

/* ── Share Options Popover ── */
.bitstream-share-popover {
    position: fixed;
    z-index: 9999;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-sizing: border-box;
    opacity: 0;
    transform: scale(0.94) translateY(6px);
    transform-origin: top right;
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.bitstream-share-popover.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.bitstream-share-popover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.14s ease;
}

.bitstream-share-popover-item:hover {
    background: #f1f5f9;
}

.bitstream-share-popover-item i {
    font-size: 1rem;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    width: 18px;
    flex-shrink: 0;
    text-align: center;
}

.bitstream-share-popover-detail {
    display: flex;
    flex-direction: column;
}

.bitstream-share-popover-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
    line-height: 1.2;
}

.bitstream-share-popover-desc {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 1px;
    line-height: 1.3;
}

/* Dark mode */
body.dark-mode .bitstream-share-popover,
.dark-theme .bitstream-share-popover {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
}

body.dark-mode .bitstream-share-popover-item:hover,
.dark-theme .bitstream-share-popover-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

body.dark-mode .bitstream-share-popover-label,
.dark-theme .bitstream-share-popover-label {
    color: #f1f5f9;
}


/* Share image preview (fallback modal, second stage) */
.bitstream-share-image-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.bitstream-share-image-preview img {
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid #eef0f2;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.bitstream-share-image-actions {
    display: flex;
    gap: 0.65rem;
    width: 100%;
    justify-content: flex-end;
}

/* ==========================================================================
   Mood Feature Styles
   ========================================================================== */

/* ── Mood Reactions Bar (WhatsApp / iMessage style) ── */
.bitstream-mood-reactions-bar[hidden],
.bitstream-mood-creator[hidden] {
    display: none !important;
}

.bitstream-mood-reactions-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.bitstream-mood-reactions-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
}

.bitstream-mood-reactions-list::-webkit-scrollbar {
    display: none;
}

.bitstream-mood-reaction-btn {
    background: transparent;
    border: none;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.15s ease;
    flex-shrink: 0;
    font-size: 1.35rem;
    line-height: 1;
    color: inherit;
    position: relative;
    box-sizing: border-box;
}

.bitstream-mood-reaction-btn:hover {
    transform: scale(1.22);
    background-color: rgba(0, 0, 0, 0.05);
    z-index: 2;
}

/* Crisp, inset green ring that stays perfectly circular and NEVER clips or breaks layout */
.bitstream-mood-reaction-btn.is-active {
    background-color: rgba(44, 110, 73, 0.12);
    box-shadow: inset 0 0 0 2.5px var(--wp--preset--color--accent-1, #2c6e49);
}

.bitstream-mood-reaction-btn.is-active:hover {
    transform: scale(1.15);
}

.bitstream-mood-reaction-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bitstream-mood-reaction-emoji img.emoji {
    width: 24px;
    height: 24px;
}

.bitstream-mood-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid #f1f5f9;
    margin-top: 2px;
}

.bitstream-mood-actions-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bitstream-mood-add-btn,
.bitstream-mood-edit-btn {
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.85rem;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.bitstream-mood-add-btn {
    border-style: dashed;
}

.bitstream-mood-add-btn:hover {
    background: var(--wp--preset--color--accent-1, #2c6e49);
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    border-style: solid;
    color: #ffffff;
    transform: scale(1.08);
}

.bitstream-mood-edit-btn:hover {
    background: #e2e8f0;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    transform: scale(1.08);
}

/* Edit mode active state */
.bitstream-mood-edit-btn.is-active {
    background: var(--wp--preset--color--accent-1, #2c6e49);
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    color: #ffffff;
}

.bitstream-mood-edit-btn.is-active:hover {
    opacity: 0.88;
    transform: scale(1.05);
}

/* Edit hint text */
.bitstream-mood-edit-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    font-style: italic;
}

/* ── Edit mode: delete badge on each emoji ── */
.bitstream-mood-reaction-btn .mood-delete-badge {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    border: 1.5px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 0.6rem;
    line-height: 1;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.bitstream-mood-reactions-list.is-edit-mode .bitstream-mood-reaction-btn .mood-delete-badge {
    display: inline-flex;
}

.bitstream-mood-reaction-btn .mood-delete-badge:hover {
    transform: scale(1.2);
}

/* In edit mode: tap body of emoji to open edit form; suppress normal active ring */
.bitstream-mood-reactions-list.is-edit-mode .bitstream-mood-reaction-btn {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.bitstream-mood-reactions-list.is-edit-mode .bitstream-mood-reaction-btn:hover {
    transform: scale(1.08);
    background-color: rgba(44, 110, 73, 0.08);
    cursor: pointer;
}

.bitstream-mood-reactions-list.is-edit-mode .bitstream-mood-reaction-btn.is-active {
    box-shadow: none;
    background-color: transparent;
}

/* Drag states */
.bitstream-mood-reaction-btn.is-dragging {
    opacity: 0.95;
    transform: scale(1.3) translateY(-40px) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    background-color: #ffffff;
    z-index: 1000;
    transition: none !important;
}

body.dark-mode .bitstream-mood-reaction-btn.is-dragging,
.dark-theme .bitstream-mood-reaction-btn.is-dragging {
    background-color: #1e293b;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}

.bitstream-mood-reaction-btn.is-drag-over {
    transform: scale(1.18) !important;
    outline: 2.5px solid var(--wp--preset--color--accent-1, #2c6e49);
    outline-offset: 3px;
    background-color: rgba(44, 110, 73, 0.15);
    box-shadow: 0 0 12px rgba(44, 110, 73, 0.25);
    z-index: 10;
}

/* ── Undo toast ── */
.bitstream-mood-undo-toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #1e293b;
    color: #f8fafc;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.82rem;
    margin-top: 6px;
    animation: bitstreamFadeIn 0.18s ease;
}

.bitstream-mood-undo-toast[hidden] {
    display: none;
}

.bitstream-mood-undo-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #f8fafc;
    border-radius: 8px;
    padding: 3px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.bitstream-mood-undo-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ── Inline Custom Mood Creator ── */
.bitstream-mood-creator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px;
    animation: bitstreamFadeIn 0.15s ease;
    width: 100%;
    min-width: 270px;
    box-sizing: border-box;
}

.bitstream-mood-creator-emoji-btn {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    box-sizing: border-box;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.bitstream-mood-creator-emoji-btn:hover {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    transform: scale(1.08);
}

.bitstream-mood-creator-emoji-btn img.emoji {
    width: 22px;
    height: 22px;
}

.bitstream-composer-form .bitstream-mood-creator-input,
.bitstream-mood-creator-input {
    height: 34px !important;
    border: 1.5px solid #e2e8f0;
    border-radius: 17px;
    padding: 0 12px;
    font-size: 0.88rem;
    background: #f8fafc;
    outline: none;
    min-width: 140px !important;
    width: 140px;
    max-width: 240px;
    flex: 1 1 auto;
    color: #1e293b;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background-color 0.15s ease, width 0.12s ease;
}

.bitstream-composer-form .bitstream-mood-creator-input:focus,
.bitstream-mood-creator-input:focus {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(44, 110, 73, 0.12);
}

.bitstream-mood-creator-confirm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--wp--preset--color--accent-1, #2c6e49);
    border: none;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
}

.bitstream-mood-creator-confirm:hover {
    transform: scale(1.08);
    opacity: 0.95;
}

.bitstream-mood-creator-back {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: color 0.15s ease;
}

.bitstream-mood-creator-back:hover {
    color: #475569;
}

/* Dark mode overrides for reaction bar and creator */
body.dark-mode .bitstream-composer-popover-mood,
.dark-theme .bitstream-composer-popover-mood {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode .bitstream-mood-reaction-btn:hover,
.dark-theme .bitstream-mood-reaction-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .bitstream-mood-add-btn,
.dark-theme .bitstream-mood-add-btn,
body.dark-mode .bitstream-mood-edit-btn,
.dark-theme .bitstream-mood-edit-btn {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

body.dark-mode .bitstream-mood-edit-btn.is-active,
.dark-theme .bitstream-mood-edit-btn.is-active {
    background: var(--wp--preset--color--accent-1, #2c6e49);
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    color: #fff;
}

body.dark-mode .bitstream-mood-actions-row,
.dark-theme .bitstream-mood-actions-row {
    border-top-color: #334155;
}

body.dark-mode .bitstream-mood-edit-hint,
.dark-theme .bitstream-mood-edit-hint {
    color: #475569;
}

body.dark-mode .bitstream-mood-undo-toast,
.dark-theme .bitstream-mood-undo-toast {
    background: #0f172a;
    border: 1px solid #334155;
}

body.dark-mode .bitstream-mood-creator-emoji-btn,
.dark-theme .bitstream-mood-creator-emoji-btn {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .bitstream-mood-creator-input,
.dark-theme .bitstream-mood-creator-input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-mode .bitstream-mood-creator-input:focus,
.dark-theme .bitstream-mood-creator-input:focus {
    background: #1e293b;
}

/* Predefined Mood buttons inside modal */
.bitstream-mood-btn {
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}

.bitstream-mood-btn:hover {
    border-color: #cbd5e1;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bitstream-mood-btn.is-active {
    border-color: var(--wp--preset--color--accent-1, #2c6e49) !important;
    background-color: rgba(44, 110, 73, 0.08) !important;
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(44, 110, 73, 0.08);
}

/* Manage mode vertical list */
.bitstream-saved-moods-edit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    background: #f8fafc;
    box-sizing: border-box;
}

.bitstream-mood-manage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.bitstream-mood-manage-item:hover {
    border-color: #cbd5e1;
}

.bitstream-mood-manage-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
}

.bitstream-mood-manage-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bitstream-mood-sort-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bitstream-mood-sort-btn:hover:not(:disabled) {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
}

.bitstream-mood-sort-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.bitstream-mood-delete-btn {
    background: none;
    border: 1px solid #fee2e2;
    border-radius: 6px;
    color: #ef4444;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bitstream-mood-delete-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* Dynamic preview badges inside composer */
.bitstream-composer-preview-mood {
    border: 1px solid #eef0f2;
    border-radius: 12px;
    background: #f8fafc;
    padding: 0.55rem 0.85rem;
    box-sizing: border-box;
}

.bitstream-composer-preview-mood-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    gap: 4px;
    text-align: center;
}

.bitstream-composer-preview-mood-emoji {
    font-size: 2.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bitstream-composer-preview-mood-emoji img.emoji {
    width: 2.8rem !important;
    height: 2.8rem !important;
    vertical-align: middle;
}

.bitstream-composer-preview-mood-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: #475569;
}

.bitstream-composer-preview-mood-text strong {
    color: var(--wp--preset--color--accent-1, #2c6e49);
    font-weight: 700;
}

body.dark-mode .bitstream-composer-preview-mood,
.dark-theme .bitstream-composer-preview-mood {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .bitstream-composer-preview-mood-text,
.dark-theme .bitstream-composer-preview-mood-text {
    color: #cbd5e1;
}

/* Edit timeline modal mood row transitions */
.bs-edit-mood-btn {
    transition: all 0.2s ease;
}

.bs-edit-mood-btn:hover {
    border-color: #cbd5e1 !important;
    background: #fff !important;
    color: #1e293b !important;
}

.bs-edit-mood-row button {
    font-family: inherit;
}

/* Twemoji inline image sizing */
img.emoji {
    height: 1.15em;
    width: 1.15em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
    display: inline-block;
}

/* Prevent flash of native system emojis before Twemoji parsing runs */
.bit-card:not([data-emoji-parsed]) .bit-mood-status,
.bit-card:not([data-emoji-parsed]) .bit-card-pure-mood {
    opacity: 0 !important;
}

.bit-card[data-emoji-parsed] .bit-mood-status,
.bit-card[data-emoji-parsed] .bit-card-pure-mood {
    opacity: 1 !important;
    transition: opacity 0.15s ease-in-out;
}

/* =====================================================
   EMOJI PICKER
   ===================================================== */

/* ==========================================================================
   EMOJI PICKER
   ========================================================================== */
.bs-emoji-picker {
    position: fixed;
    z-index: 100010;
    width: 320px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #eef0f2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: bitstreamModalIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.bs-emoji-picker[hidden] {
    display: none;
}

/* ── Top bar: search + tone toggle ── */

.bs-emoji-picker-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 0;
}

.bs-emoji-picker-search {
    flex: 1;
    height: 34px;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 0 12px;
    font-size: 0.85rem;
    background: #f8fafc;
    outline: none;
    color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bs-emoji-picker-search:focus {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.13);
}

.bs-emoji-tone-toggle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: border-color 0.15s, transform 0.15s;
}

.bs-emoji-tone-toggle:hover {
    border-color: #94a3b8;
    transform: scale(1.1);
}

/* ── Skin tone swatch row ── */

.bs-emoji-tone-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px 0;
}

.bs-emoji-tone-row[hidden] {
    display: none;
}

.bs-tone-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.12s, border-color 0.12s;
}

.bs-tone-swatch:hover {
    transform: scale(1.2);
}

.bs-tone-swatch.is-active {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    transform: scale(1.1);
}

/* ── Category tabs ── */

.bs-emoji-picker-tabs {
    display: flex;
    padding: 8px 6px 0;
    gap: 2px;
    border-bottom: 1px solid #eef0f2;
    overflow-x: auto;
    scrollbar-width: none;
}

.bs-emoji-picker-tabs::-webkit-scrollbar {
    display: none;
}

.bs-emoji-tab {
    flex: 1;
    max-width: 50px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #94a3b8;
    padding: 0;
    transition: background 0.12s, color 0.12s;
}

.bs-emoji-tab img.emoji {
    width: 17px;
    height: 17px;
    pointer-events: none;
}

.bs-emoji-tab:hover {
    background: #f1f5f9;
    color: #475569;
}

.bs-emoji-tab.is-active {
    background: #f0fdf4;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

/* ── Scrollable body ── */

.bs-emoji-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    min-height: 180px;
    max-height: 272px;
    overscroll-behavior: contain;
}

/* ── Emoji grid ── */

.bs-emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 4px;
    justify-items: center;
}

.bs-emoji-grid[hidden] {
    display: none;
}

.bs-emoji-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.2rem;
    transition: background 0.08s, transform 0.08s;
    -webkit-tap-highlight-color: transparent;
}

.bs-emoji-btn img.emoji {
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.bs-emoji-btn:hover {
    background: #f1f5f9;
    transform: scale(1.18);
}

.bs-emoji-btn:active {
    transform: scale(0.92);
}

/* ── Status views (loading / empty / error) ── */

.bs-emoji-picker-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    color: #94a3b8;
    font-size: 0.875rem;
    gap: 8px;
    text-align: center;
    padding: 1rem;
}

.bs-emoji-picker-status[hidden] {
    display: none;
}

.bs-emoji-picker-status p {
    margin: 0;
}

.bs-emoji-retry-btn {
    padding: 6px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.85rem;
    color: #475569;
    transition: background 0.12s, border-color 0.12s;
}

.bs-emoji-retry-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* ── Trigger button shared style ── */

.bs-emoji-trigger:hover {
    border-color: var(--wp--preset--color--accent-1, #2c6e49) !important;
    background: #f0fdf4 !important;
}

/* ── Mobile adjustments ── */

@media (max-width: 1023px) {
    /* ==========================================================================
   EMOJI PICKER
   ========================================================================== */
.bs-emoji-picker {
        width: min(320px, calc(100vw - 2rem));
    }
}

/* Fix text overflow for very long bits, ensuring card and highlight boundary wraps correctly */
.bit-card-content,
.bit-card-pure-mood,
.bitstream-quoted-preview {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Collapsible Media Uploader in Edit Modal */
.bs-edit-modal .bitstream-media-field {
    min-height: 0;
}

.bs-edit-modal .bitstream-media-dropzone {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    cursor: default !important;
    min-height: 0 !important;
    pointer-events: none !important;
}

.bs-edit-modal .bitstream-media-preview {
    pointer-events: auto !important;
}

.bs-edit-modal .bitstream-media-dropzone-icon,
.bs-edit-modal .bitstream-media-dropzone > span,
.bs-edit-modal .bitstream-media-controls {
    display: none !important;
}

/* When expanded */
.bs-edit-modal .media-uploader-open .bitstream-media-dropzone {
    border: 1.5px dashed #cbd5e1 !important;
    background: #f8fafc !important;
    padding: 1rem 0.85rem !important;
    cursor: pointer !important;
    min-height: 90px !important;
    pointer-events: auto !important;
}

.bs-edit-modal .media-uploader-open .bitstream-media-dropzone-icon {
    display: block !important;
    margin-bottom: 0.25rem;
}

.bs-edit-modal .media-uploader-open .bitstream-media-dropzone > span {
    display: inline !important;
    font-size: 0.82rem;
}

.bs-edit-modal .media-uploader-open .bitstream-media-controls {
    display: flex !important;
    margin-top: 0.5rem;
}

/* Collapsible Rebit picker in Edit Modal */
.bs-edit-rebit {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bs-edit-rebit-preview {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #eef0f2;
    border-radius: 14px;
    background: #f8fafc;
}

.bs-edit-rebit-preview-card {
    margin-top: 0.75rem;
}

.bs-edit-rebit-preview-card .bitstream-og-card,
.bs-edit-rebit-live-preview-card .bitstream-og-card {
    margin: 0;
}

.bs-edit-rebit-setup {
    display: none;
}

.bs-edit-rebit.rebit-picker-open .bs-edit-rebit-setup {
    display: block;
}

.bs-edit-rebit-live-preview {
    margin-top: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #eef0f2;
    border-radius: 14px;
    background: #fff;
}

.bs-edit-rebit-fetch.is-edit-mode {
    background: #f8fafc;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    border: 1.5px solid var(--wp--preset--color--accent-1, #2c6e49);
}

/* Prevent downloading/copying of images */
.bitstream-lightbox img,
.bitstream-lightbox-media,
.bit-card-content img:not(.emoji),
.bit-rebit-preview img:not(.emoji),
.bitstream-quoted-preview img:not(.emoji),
.bitstream-gallery-item img,
.bitstream-media-preview-item img {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* ==========================================================================
   CONSOLIDATED COMPONENT STYLES (REFACTOR PLAN STEPS 4 - 9)
   ========================================================================== */

/* ── Step 4: Card Component Styles ── */
.bit-card {
    margin: 0;
    padding: 1.5rem;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    border: 1px solid #eee;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.bit-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.bit-avatar {
    width: 48px;
    height: 48px;
    margin-right: 0.75rem;
    border-radius: 15px;
    overflow: hidden;
    flex-shrink: 0;
}

.bit-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bit-meta {
    font-size: 0.875rem;
    color: var(--wp--preset--color--secondary, #666);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bit-author-line {
    font-weight: 600;
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bit-mood-status {
    font-weight: normal;
    color: #666;
    margin-left: 0.25rem;
}

.bit-mood-status strong {
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bit-timestamp {
    cursor: pointer;
}

.bit-card-content {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.bit-card-pure-mood {
    font-size: 1.4rem;
    line-height: 1.4;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1.5px dashed #e2e8f0;
    border-radius: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bit-pure-mood-emoji {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.bit-pure-mood-text {
    font-weight: 500;
    color: #475569;
}

.bit-pure-mood-text strong {
    color: var(--wp--preset--color--accent-1, #2c6e49);
}

.bit-card-watermark {
    display: none;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 0.75rem;
    font-weight: 500;
    font-family: inherit;
}

.bit-card-watermark img {
    width: 16px;
    height: 16px;
    filter: grayscale(100%);
    opacity: 0.5;
    display: block;
}

.bit-card-footer {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.bit-action {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.bit-action:hover {
    color: var(--wp--preset--color--accent-1, #2c6e49);
}


/* ── Step 5: Nested Quoted Cards ── */
.bit-card-quoted-nested {
    margin: 0;
    padding: 1.2rem;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.bit-card-quoted-unavailable {
    padding: 1rem;
}

.bit-card-quoted-nested .bit-card-header {
    margin-bottom: 0.75rem;
}

.bit-card-quoted-nested .bit-meta {
    font-size: 0.82rem;
    gap: 1px;
}

.bit-card-quoted-nested .bit-card-pure-mood {
    font-size: 1.1rem;
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 12px;
    gap: 6px;
}

.bit-card-quoted-nested .bit-pure-mood-emoji {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}


/* ── Step 6: Rebit Section & Embeds ── */
.bit-rebit-label {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #333;
}

.bit-rebit-label i {
    margin-right: 0.5rem;
}

.bit-rebit-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1rem 0;
    border-radius: 15px;
}

.bit-rebit-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
}

.bit-rebit-preview {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.bit-rebit-preview img {
    width: 100%;
    display: block;
}

.bit-rebit-preview-body {
    padding: 0.75rem;
}

.bit-rebit-twitter {
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1.25rem;
    background: #fafafa;
}

.bit-rebit-twitter-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bit-rebit-twitter-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bit-rebit-twitter-meta {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


/* ── Step 7: OG Preview Cards ── */
.bitstream-og-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 14px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.09);
    padding: 14px;
}

.bitstream-og-thumb {
    min-width: 72px;
    width: 72px;
    height: 72px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.bitstream-og-thumb img {
    width: 100%;
    height: auto;
    max-height: 72px;
    object-fit: cover;
    display: block;
}

.bitstream-og-meta {
    flex: 1 1 0%;
}

.bitstream-og-title {
    font-weight: 600;
    font-size: 1em;
    line-height: 1.25;
    margin-bottom: 4px;
}

.bitstream-og-title a {
    color: inherit;
    text-decoration: none;
}

.bitstream-og-desc {
    font-size: 0.97em;
    line-height: 1.5;
    color: #444;
    margin-top: 2px;
}

.bitstream-og-url {
    font-size: 0.92em;
    color: var(--wp--preset--color--accent-1, #2c6e49);
    overflow-wrap: anywhere;
    word-break: break-all;
    margin-top: 6px;
}

.bitstream-og-url a {
    color: var(--wp--preset--color--accent-1, #2c6e49);
    text-decoration: underline;
    word-break: break-all;
}


/* ── Step 8: Single Bit View Styles ── */
.bitstream-single-bit .entry-footer:not(.bitstream-single-wrapper .entry-footer),
.bitstream-single-bit .post-navigation,
.bitstream-single-bit .author-info {
    display: none !important;
}

.bitstream-single-bit .entry-header {
    margin-bottom: 2rem !important;
    border-bottom: 1px solid #eee !important;
    padding-bottom: 1rem !important;
}

.bitstream-single-bit .entry-title,
.bitstream-single-bit .entry-header .entry-title {
    display: block !important;
    font-size: 1.8rem !important;
    margin-bottom: 0.5rem !important;
    color: #333 !important;
    line-height: 1.3 !important;
}

.bitstream-single-bit .entry-meta,
.bitstream-single-bit .entry-header .entry-meta {
    display: block !important;
}

.bitstream-single-bit .post-meta,
.bitstream-single-bit .wp-block-post-author,
.bitstream-single-bit .wp-block-post-terms {
    display: none !important;
}

.bitstream-single-bit .wp-block-post-date {
    display: block !important;
}

.bitstream-single-bit .entry-content > p:empty,
.bitstream-single-bit .entry-content > div:empty:not(.bitstream-single-wrapper) {
    display: none !important;
}

.bitstream-single-bit .entry-content {
    min-height: auto;
}

.bitstream-single-bit .site-main,
.bitstream-single-bit .main-content {
    padding-top: 2rem;
}

.bitstream-single-wrapper { 
    max-width: 800px; 
    margin: 2rem auto; 
    padding: 0 1rem; 
    display: block !important;
    visibility: visible !important;
}

.bitstream-back-link { 
    display: inline-block; 
    margin-bottom: 2rem; 
    padding: 0.5rem 1rem; 
    background: var(--wp--preset--color--accent-1, #2c6e49); 
    color: white; 
    text-decoration: none; 
    border-radius: 8px; 
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

.bitstream-back-link:hover { 
    background: var(--wp--preset--color--accent-2, #044389); 
    color: white; 
    text-decoration: none;
}

.bitstream-single-wrapper .bit-card {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e1e1e1;
    display: block !important;
    visibility: visible !important;
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    transform: none !important;
    left: auto !important;
    top: auto !important;
}

.bitstream-single-bit .content-area {
    max-width: none;
}

.bitstream-single-bit article:not(.bit-card) {
    margin: 0;
    padding: 0;
}

.bitstream-single-bit .entry-content .bitstream-single-wrapper {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}


/* ── Step 9: Mood Modal Buttons & Form ── */
.bitstream-mood-grid,
.bitstream-saved-moods-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.bitstream-mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 0.5rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bitstream-mood-btn:hover {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.bitstream-mood-btn.is-selected {
    border-color: var(--wp--preset--color--accent-1, #2c6e49);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44,110,73,0.15);
}

.bitstream-mood-btn-emoji {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.bitstream-mood-btn-label {
    font-size: 0.825rem;
    font-weight: 500;
    color: #475569;
}
