/* ===========================
   External Links Styles
   =========================== */

.agency-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.external-links-display {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.external-link-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--agency-light-bg);
    border: 1px solid var(--agency-border-color);
    border-radius: var(--agency-radius-small);
    text-decoration: none;
    color: var(--agency-text-color);
    font-size: 14px;
    font-weight: 500;
    transition: var(--agency-transition);
    position: relative;
}

.external-link-item:hover {
    background: var(--agency-primary-color);
    color: white;
    border-color: var(--agency-primary-color);
    transform: translateY(-2px);
    box-shadow: var(--agency-shadow);
}

.external-link-item .link-emoji {
    font-size: 18px;
    line-height: 1;
}

.external-link-item .link-text {
    line-height: 1;
}

.external-link-item .delete-external-link {
    margin-left: 4px;
    padding: 2px 6px;
    background: transparent;
    border: none;
    color: var(--agency-text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: var(--agency-transition);
    border-radius: 4px;
}

.external-link-item .delete-external-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--agency-danger);
}

.external-link-item:hover .delete-external-link {
    color: rgba(255, 255, 255, 0.8);
}

/* Dark theme overrides */
.agency-theme-dark .external-link-item {
    background: #1f2937;
    border-color: #374151;
    color: var(--agency-text-color);
}

.agency-theme-dark .external-link-item:hover {
    background: var(--agency-primary-color);
    color: white;
}

/* Form help text */
.agency-form-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--agency-text-muted);
}

.agency-theme-dark .agency-form-help {
    color: #9ca3af;
}

/* Search bar */
#project-search {
    border-radius: var(--agency-radius) !important;
    flex: 1;
    max-width: 460px;
    min-width: 200px;
}

/* Actions toolbar: backdrop blur on client view search area */
.agency-projects-toolbar .agency-actions {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--agency-radius);
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.agency-theme-dark .agency-projects-toolbar .agency-actions {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.08);
}

/* En mode client seul (sans bouton "Ajouter"), retirer le conteneur pill */
.agency-projects-toolbar .agency-actions.agency-actions--search-only {
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    padding: 0;
    border-radius: 0;
}
.agency-projects-toolbar .agency-actions.agency-actions--search-only #project-search {
    flex: none;
    width: 260px;
    max-width: 100%;
}
/* === Version Tabs === */
.version-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 2rem 0;
    padding: 0;
    border-bottom: 2px solid var(--agency-border-color, #e0e0e0);
}

.version-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    color: var(--agency-text-color, #333);
    font-weight: 600;
    font-size: 1rem;
}

.version-tab:hover {
    background: var(--agency-bg-hover, #f5f5f5);
    color: var(--agency-primary-color, #000);
}

.version-tab.is-active {
    color: var(--agency-primary-color, #000);
    border-bottom-color: var(--agency-primary-color, #000);
}

.version-tab-label {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--agency-text-muted, #666);
}

.version-tab.is-active .version-tab-label {
    color: var(--agency-primary-color, #000);
}

.version-status {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.2s;
}

.version-status:hover {
    opacity: 0.8;
}

.version-delete-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(239, 68, 68, 0.85);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.version-delete-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.version-status-draft { background: #ccc; color: #000; }
.version-status-in_review { background: #ffc107; color: #000; }
.version-status-approved { background: #4caf50; color: #fff; }
.version-status-archived { background: #9e9e9e; color: #fff; }

.version-panel {
    display: none;
    padding: 2rem 0;
}

.version-panel.is-active {
    display: block;
}

.version-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--agency-light-bg);
    border-radius: 8px;
    font-size: 0.95rem;
}

.version-notes {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--agency-light-bg);
    border-left: 4px solid var(--agency-primary-color);
    border-radius: 4px;
    font-size: 0.95rem;
}

.version-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .version-content-grid {
        grid-template-columns: 1fr;
    }
}

.version-media {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.versioned-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.version-comments {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.version-comments h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--agency-text-color, #333);
}

.media-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

/* ===================================
   VIDEO BLOCK STYLES
   =================================== */

/* Video Embeds Section */
.video-embeds {
    margin-bottom: 3rem;
}

.video-embeds h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--agency-text-color);
}

.video-embed-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.video-embed-item {
    position: relative;
    background: var(--agency-secondary-color);
    border-radius: var(--agency-radius-small);
    padding: 1.5rem;
    border: 1px solid var(--agency-border-color);
}

.video-embed-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--agency-border-color);
}

.video-embed-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--agency-radius-small);
    background: #000;
    margin-bottom: 1rem;
}

.video-embed-wrapper iframe,
.video-embed-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--agency-radius-small);
}

.video-embed-wrapper video {
    object-fit: contain;
}

.video-embed-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--agency-text-color);
}

.video-embed-item .delete-embed {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--agency-transition);
    z-index: 10;
}

.video-embed-item .delete-embed:hover {
    background: var(--agency-danger);
    transform: scale(1.1);
}

.embed-error {
    padding: 2rem;
    text-align: center;
    color: var(--agency-danger);
    background: #f8d7da;
    border-radius: var(--agency-radius-small);
    margin: 0;
}

/* Video Uploads Section */
.video-uploads {
    margin-bottom: 3rem;
}

.video-uploads h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--agency-text-color);
}

.video-upload-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.video-upload-item {
    background: var(--agency-secondary-color);
    border-radius: var(--agency-radius-small);
    padding: 1.5rem;
    border: 1px solid var(--agency-border-color);
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--agency-radius-small);
    background: #000;
    margin-bottom: 1rem;
}

.video-player-wrapper .video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--agency-radius-small);
    object-fit: contain;
}

.video-file-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
}

.video-file-placeholder .file-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.video-file-placeholder .file-name {
    font-size: 1rem;
    opacity: 0.8;
}

.video-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--agency-border-color);
}

.video-notes {
    padding-top: 0.5rem;
}

.asset-notes-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--agency-border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    min-height: 80px;
}

.notes-save-status {
    font-size: 12px;
    display: inline-block;
    transition: var(--agency-transition);
}

.video-comments {
    padding-top: 1rem;
    border-top: 1px solid var(--agency-border-color);
}

.video-comments h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--agency-text-color);
}

.video-description {
    margin-bottom: 12px;
}

/* No content message */
.no-content {
    padding: 3rem;
    text-align: center;
    color: var(--agency-text-muted);
    font-size: 1.1rem;
}

/* Dark theme video styles */
.agency-theme-dark .video-embed-item,
.agency-theme-dark .video-upload-item {
    background: #111827;
    border-color: #374151;
}

.agency-theme-dark .asset-notes-input {
    background: #0b0f14;
    color: var(--agency-text-color);
    border-color: #374151;
}

.agency-theme-dark .video-actions {
    border-bottom-color: #374151;
}

.agency-theme-dark .video-comments {
    border-top-color: #374151;
}

.agency-theme-dark .video-embed-item .delete-embed {
    background: rgba(17, 24, 39, 0.9);
    color: #ffffff;
}

.agency-theme-dark .video-embed-item .delete-embed:hover {
    background: var(--agency-danger);
}

/* ========================================
   COVER IMAGES (client & project)
   ======================================== */

.agency-client-cover,
.agency-project-cover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60vh;
    min-height: 400px;
    background-image: var(--cover-url);
    background-size: cover;
    background-position: center top;
    z-index: 0;
    pointer-events: none;
}

/* Gradient fade to page background at the bottom */
.agency-client-cover::after,
.agency-project-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--agency-light-bg) 80%
    );
}

/* Branding background colour tint on client cover */
.agency-client-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--agency-light-bg, #f8f9fa);
    opacity: 0.20;
    z-index: 1;
}

/* Make wrapper a positioning context so cover is absolute within it */
.agency-wrapper:has(.agency-client-cover),
.agency-wrapper:has(.agency-project-cover) {
    position: relative;
    background: var(--agency-light-bg);
}

/* Ensure all siblings of cover sit above it, except footer */
.agency-wrapper:has(.agency-client-cover) > *:not(.agency-client-cover):not(.agency-footer):not(.agency-manager-sidebar),
.agency-wrapper:has(.agency-project-cover) > *:not(.agency-project-cover):not(.agency-footer):not(.agency-manager-sidebar) {
    position: relative;
    z-index: 1;
}

/* Footer stays beneath cards and keeps the same blurred/glass treatment */
.agency-wrapper:has(.agency-client-cover) .agency-footer,
.agency-wrapper:has(.agency-project-cover) .agency-footer {
    position: relative;
    z-index: 0;
    background: var(--agency-header-bg, rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--agency-border-color);
}

/* Let cover show through agency-main by removing its opaque background */
.agency-wrapper:has(.agency-client-cover) .agency-main,
.agency-wrapper:has(.agency-project-cover) .agency-main {
    background: transparent;
}

/* ========================================
   SEPARATOR BLOCK
   ======================================== */

.agency-separator-block {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 4px 0 !important;
    min-height: unset !important;
    height: auto !important;
    align-self: center;
    grid-column: 1 / -1 !important;
}

.separator-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 4px;
}

.separator-inner::before,
.separator-inner::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--agency-border-color);
}

.separator-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--agency-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    min-width: 40px;
    text-align: center;
}

.separator-label[contenteditable="true"] {
    outline: none;
    cursor: text;
    padding: 2px 6px;
    border-radius: 4px;
}

.separator-label[contenteditable="true"]:focus {
    background: var(--agency-light-bg);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* ========================================
   BLOCK SUBTITLE
   ======================================== */

.agency-block-subtitle {
    font-size: 15px;
    font-weight: 400;
    color: var(--agency-text-muted);
    margin: -16px 0 20px 0;
    line-height: 1.5;
    text-align: center;
}

.agency-block-subtitle--editable {
    cursor: text;
    outline: none;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s;
    padding: 4px 8px;
    border-radius: 4px;
}

.agency-block-subtitle--editable:hover,
.agency-block-subtitle--editable:focus {
    border-color: var(--agency-border-color);
    background: var(--agency-light-bg);
}

/* ========================================
   PROJECT LABELS — BADGES ON CARDS
   ======================================== */

.project-label-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.project-label-badge {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* When on a non-image card (no .has-project-bg) */
.agency-project-card:not(.has-project-bg) .project-label-badge {
    background: var(--agency-secondary-color);
    border-color: var(--agency-secondary-color);
    color: var(--agency-primary-color);
    opacity: 0.9;
}

/* ========================================
   LABEL FILTERS (client-view toolbar)
   ======================================== */

.agency-projects-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.agency-label-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.agency-label-filter {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--agency-border-color);
    border-radius: 20px;
    background: var(--agency-secondary-color);
    color: var(--agency-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--agency-transition);
}

.agency-label-filter:hover {
    background: var(--agency-primary-color);
    color: #ffffff;
    border-color: var(--agency-primary-color);
}

.agency-label-filter.active {
    background: var(--agency-primary-color);
    color: #ffffff;
    border-color: var(--agency-primary-color);
}

.agency-label-filter--archived {
    border-style: dashed;
}

.agency-label-filter--archived.active {
    background: #6b7280;
    border-color: #6b7280;
    border-style: solid;
}

.agency-archived-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--agency-text-muted);
    margin: 24px 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--agency-border-color);
}

/* ========================================
   LABEL TOGGLES (create/edit project modal)
   ======================================== */

.agency-labels-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.agency-label-toggle {
    padding: 4px 14px;
    border: 1px solid var(--agency-border-color);
    border-radius: 20px;
    background: var(--agency-secondary-color);
    color: var(--agency-text-color);
    font-size: 13px;
    cursor: pointer;
    transition: var(--agency-transition);
}

.agency-label-toggle:hover {
    border-color: var(--agency-primary-color);
    color: var(--agency-primary-color);
}

.agency-label-toggle.selected {
    background: var(--agency-primary-color);
    border-color: var(--agency-primary-color);
    color: #ffffff;
}

/* ========================================
   LINK BLOCK VIEW
   ======================================== */

/* Two-column wrapper (left: link content, right: comments) */
.block-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 24px;
}

.block-column-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (max-width: 900px) {
    .block-columns {
        grid-template-columns: 1fr;
    }
}

/* Manager URL panel */
.agency-link-manager-panel {
    background: var(--agency-light-bg);
    border: 1px solid var(--agency-border-color);
    border-radius: var(--agency-radius);
    padding: 20px 24px;
}

/* Client-facing link display card */
.agency-link-display {
    background: var(--agency-secondary-color);
    border: 1px solid var(--agency-border-color);
    border-radius: var(--agency-radius);
    padding: 48px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.agency-link-display.has-block-bg {
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.agency-link-display.has-block-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

.agency-link-display-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.agency-link-display .link-icon {
    font-size: 48px;
    line-height: 1;
}

.agency-link-display .link-label {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.agency-link-open-btn {
    font-size: 16px;
    padding: 14px 32px;
}

.agency-link-empty {
    padding: 32px;
    text-align: center;
    color: var(--agency-text-muted);
    background: var(--agency-light-bg);
    border-radius: var(--agency-radius);
    border: 1px dashed var(--agency-border-color);
}

/* ========================================
   STORYBOARD — VERSIONING UI
   ======================================== */

.storyboard-slide-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

/* Poignée de drag dédiée (managers) : le drag ne démarre que depuis cette
   poignée, pour éviter que la textarea voix-off perde le focus en rafale
   pendant le tri (cf. frontend.js initStoryboardSortable) */
.storyboard-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    margin: -6px 0 -6px -8px;
    color: var(--agency-text-muted);
    cursor: grab;
    touch-action: none;
    border-radius: var(--agency-radius-small);
    transition: var(--agency-transition);
}

.storyboard-drag-handle:hover {
    color: var(--agency-text-color);
    background: var(--agency-light-bg);
}

.storyboard-drag-handle:active {
    cursor: grabbing;
}

.storyboard-slide-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--agency-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Override .version-badge for inline display in storyboard slide header */
.storyboard-slide-header .version-badge {
    position: static;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--agency-primary-color);
    color: #ffffff;
}

/* Insert-row between slides */
.storyboard-insert-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
}

.storyboard-insert-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px dashed var(--agency-border-color);
    background: var(--agency-secondary-color);
    color: var(--agency-text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--agency-transition);
    opacity: 0;
}

/* Show insert button on hover of surrounding area */
.storyboard-insert-row:hover .storyboard-insert-btn,
.storyboard-item:hover + .storyboard-insert-row .storyboard-insert-btn {
    opacity: 1;
}

.storyboard-insert-btn:hover {
    background: var(--agency-primary-color);
    border-color: var(--agency-primary-color);
    color: #ffffff;
    opacity: 1;
}

/* Version history collapsible */
.version-history {
    margin-top: 8px;
}

.version-history-toggle {
    background: none;
    border: none;
    color: var(--agency-text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline dotted;
    transition: color 0.2s;
}

.version-history-toggle:hover {
    color: var(--agency-primary-color);
}

.version-history-list {
    margin-top: 8px;
    padding: 12px;
    background: var(--agency-light-bg);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.version-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--agency-border-color);
}

.version-item:last-child {
    border-bottom: none;
}

.version-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--agency-primary-color);
    min-width: 28px;
}

.version-thumb {
    width: 50px;
    height: 38px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--agency-border-color);
}

.version-filename {
    font-size: 12px;
    color: var(--agency-text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Client suggestion zone */
.slide-suggestion-zone {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--agency-border-color);
}

.suggest-slide-form {
    margin-top: 10px;
    padding: 12px;
    background: var(--agency-light-bg);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggest-text-input {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--agency-border-color);
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
}



/* ============================================================
   Règles rapatriées depuis _overrides.css (dissolution du patch layer)
   ============================================================ */

/* === Google Slides Embed (v0.9.11) === */
.agency-google-slides-container {
    margin-top: 24px;
}

.agency-google-slides-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.agency-google-slides-cta svg {
    vertical-align: middle;
    margin-right: 6px;
}

.agency-google-slides-embed {
    position: relative;
    width: 100%;
    /* Aspect 16/9 + extra space for the Google Slides navigation bar at the bottom */
    padding-bottom: calc(56.25% + 40px);
    height: 0;
    border-radius: var(--agency-radius);
    overflow: visible;
    box-shadow: var(--agency-shadow-strong);
}

.agency-google-slides-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--agency-radius);
}

.agency-google-slides-setup {
    padding: 20px;
    border: 2px dashed var(--agency-border-color);
    border-radius: var(--agency-radius);
    margin-top: 24px;
}

.agency-google-slides-hint {
    color: var(--agency-text-muted);
    font-size: 0.9em;
    margin: 0 0 12px;
}

.agency-google-slides-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.agency-google-slides-input-row .agency-input {
    flex: 1;
    min-width: 0;
}

/* ========================================
   DESIGN SYSTEM OVERHAUL — Laravel-inspired
   Consistency across client/project/block views
   ======================================== */
/* --- 1. no-comments: collapse grid when comment column is hidden --- */
.block-two-column-layout.no-comments,
.version-content-grid.no-comments {
    grid-template-columns: 1fr;
}

.storyboard-item.no-comments {
    grid-template-columns: 1fr;
}

/* --- 5. Block view: left-aligned title, cleaner sizing --- */
.agency-block-view .agency-title {
    font-size: 22px;
    text-align: left;
    padding: 8px 0 14px;
    margin-bottom: 8px;
}

/* --- 8. Dark mode: version panel & tabs --- */
.agency-theme-dark .version-tab {
    color: var(--agency-text-color);
}

.agency-theme-dark .version-tab:hover {
    background: rgba(255, 255, 255, 0.06);
}

.agency-theme-dark .version-tabs {
    border-bottom-color: var(--agency-border-color);
}

.agency-theme-dark .version-meta,
.agency-theme-dark .version-notes {
    background: rgba(255, 255, 255, 0.04);
    color: var(--agency-text-color);
    border-color: var(--agency-border-color);
}

.agency-theme-dark .version-panel {
    color: var(--agency-text-color);
}

.agency-theme-dark .version-tab-label {
    color: var(--agency-text-muted);
}

.agency-theme-dark .version-tab.is-active .version-tab-label {
    color: var(--agency-primary-color);
}

/* --- 9. Dark mode: form inputs in block views --- */
.agency-theme-dark .asset-comment-input,
.agency-theme-dark .asset-voiceover-input,
.agency-theme-dark .agency-google-slides-input {
    background: rgba(255, 255, 255, 0.05);
    color: var(--agency-text-color);
    border-color: var(--agency-border-color);
}

/* --- 17. Block header: consistent spacing --- */
.agency-block-view .block-header-full {
    margin-bottom: 24px;
}

/* --- 18. Dark mode: video notes label color --- */
.agency-theme-dark .video-notes label,
.agency-theme-dark .storyboard-voiceover label {
    color: var(--agency-text-muted);
}

/* --- 19. Version content: ensure media fills space when no comments --- */
.version-content-grid.no-comments .version-media {
    max-width: 100%;
}

/* --- 22. Dark mode: script toolbar --- */
.agency-theme-dark .script-toolbar {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--agency-border-color);
}

.agency-theme-dark .script-toolbar .toolbar-btn {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--agency-border-color);
    color: var(--agency-text-color);
}

.agency-theme-dark .script-toolbar .toolbar-btn:hover {
    background: var(--agency-primary-color);
    color: #ffffff;
    border-color: var(--agency-primary-color);
}

/* --- 23. Dark mode: version status badges contrast fix --- */
.agency-theme-dark .version-status-draft { background: #4b5563; color: #e5e7eb; }

.agency-theme-dark .version-status-in_review { background: #92400e; color: #fef3c7; }

.agency-theme-dark .version-status-approved { background: #065f46; color: #d1fae5; }

.agency-theme-dark .version-status-archived { background: #374151; color: #9ca3af; }

/* Fix 6 — agency-title: keep centered in block views (revert left-align from previous pass) */
.agency-block-view .agency-title {
    text-align: center;
}

.block-header-full .agency-links + .agency-actions {
    margin-top: 12px;
}

/* Fix C — Description contenteditable focus: fix white-on-white in dark mode */
.agency-theme-dark .block-description[contenteditable="true"]:focus,
.agency-theme-dark .script-description[contenteditable="true"]:focus {
    background: var(--agency-light-bg);
    color: var(--agency-text-color);
}

.agency-projects-toolbar input[type="search"]:focus,
.agency-projects-toolbar input[type="text"]:focus,
.agency-project-search:focus,
.project-search:focus,
#project-search:focus,
.agency-form-input:focus {
    border-color: var(--agency-primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--agency-primary-color) 22%, transparent);
    outline: none;
}

.agency-theme-dark .agency-form-input,
.agency-theme-dark #project-search,
.agency-theme-dark input.agency-form-input,
.agency-theme-dark textarea.agency-form-input,
.agency-theme-dark select.agency-form-input {
    background: rgba(255, 255, 255, 0.10);
    color: var(--agency-text-color);
    border-color: rgba(255, 255, 255, 0.18);
}

.agency-theme-dark .agency-form-input::placeholder,
.agency-theme-dark #project-search::placeholder {
    color: rgba(255, 255, 255, 0.55);
}


/* ============ INFO-BOX (hint contextuel, ex-styles inline storyboard) ============ */

.agency-info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-radius: var(--agency-radius-xs);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.agency-info-box-warning {
    background: var(--agency-warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.agency-info-box-icon {
    flex-shrink: 0;
    display: inline-flex;
    color: var(--agency-warning);
}

.agency-info-box-text {
    margin: 0;
    font-size: 13px;
    flex: 1;
}

.agency-info-box-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: inherit;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

/* ============ VOIX-OFF (ex-styles inline storyboard) ============ */

.storyboard-voiceover-label {
    display: block;
    margin: 8px 0 6px;
    font-size: 13px;
    color: var(--agency-text-muted);
}

.storyboard-voiceover .save-voiceover-btn {
    margin-top: 6px;
}

.voiceover-save-status {
    margin-left: 8px;
    font-size: 12px;
}

.voiceover-save-status.success { color: var(--agency-success); }
.voiceover-save-status.error   { color: var(--agency-danger); }
