/* ══════════════════════════════════════════════════════
   CONTENT PAGE — Split Panel Layout
   Pure Black · Inter · No colors except white/gray
   ══════════════════════════════════════════════════════ */

/* ── Sub-header ─────────────────────────────────────── */
.content-subheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 44px;
    background: #0a0a0a;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 56px;
    z-index: 100;
}
.content-project-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.2s;
}
.content-project-selector:hover { border-color: rgba(255,255,255,0.18); }
.content-project-name { font-size: 0.82rem; font-weight: 600; color: #e2e4e8; }

/* Project avatar in subheader */
.content-project-avatar {
    width: 24px; height: 24px;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    flex-shrink: 0;
}
.content-subheader-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.content-subheader-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Project dropdown */
.project-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: rgba(18,18,22,0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 6px;
    z-index: 500;
    display: none;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.project-dropdown.open { display: block; }
.content-project-selector { position: relative; }

.project-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.2s;
    color: rgba(255,255,255,0.7);
    font-size: 0.82rem;
}
.project-dropdown-item:hover { background: rgba(255,255,255,0.06); }
.project-dropdown-item.active { background: rgba(255,255,255,0.08); color: #fff; }

.project-dropdown-avatar {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    flex-shrink: 0;
    overflow: hidden;
}
.project-dropdown-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 6px;
}
.project-dropdown-name { flex: 1; }
.project-dropdown-delete {
    background: none; border: none;
    color: rgba(255,255,255,0.2);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}
.project-dropdown-delete:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

.project-dropdown-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    color: rgba(255,255,255,0.35);
    font-size: 0.8rem;
    border-radius: 7px;
    transition: all 0.2s;
}
.project-dropdown-add:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.04); }

/* Knowledge button must be above project dropdown */
#btnOpenKnowledge {
    position: relative;
    z-index: 501;
    cursor: pointer;
}

.content-view-tabs {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 3px;
}
.content-view-tab {
    padding: 4px 14px;
    border-radius: 5px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
}
.content-view-tab:hover { color: rgba(255,255,255,0.75); }
.content-view-tab.active { background: rgba(255,255,255,0.1); color: #fff; }

/* ── Main layout ─────────────────────────────────────── */
.content-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - 100px);
    overflow: hidden;
}

/* ── Left: Chat Panel ────────────────────────────────── */
.content-chat-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.06);
    background: #060606;
    overflow: hidden;
}
.content-chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.content-chat-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.08em;
}
.content-chat-context {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    font-style: italic;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.content-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.content-chat-messages::-webkit-scrollbar { width: 3px; }
.content-chat-messages::-webkit-scrollbar-track { background: transparent; }
.content-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.chat-msg { display: flex; flex-direction: column; max-width: 92%; }
.chat-msg-ai { align-self: flex-start; }
.chat-msg-user { align-self: flex-end; align-items: flex-end; }

.chat-msg-bubble {
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.55;
    color: #e2e4e8;
}
.chat-msg-ai .chat-msg-bubble {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-left: 2px solid rgba(255,255,255,0.15);
}
.chat-msg-user .chat-msg-bubble {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}
.chat-msg-time {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.25);
    margin-top: 3px;
    padding: 0 4px;
}

/* Error state for chat message (R-2: replaces inline style) */
.chat-msg-error {
    color: #ef4444 !important;
}

/* Chat action buttons (inject to card, copy) */
.chat-msg-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}
.chat-msg:hover .chat-msg-actions { opacity: 1; }
.chat-action-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.chat-action-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

/* typing dots */
.typing-bubble {
    display: flex !important;
    align-items: center;
    gap: 5px;
    padding: 12px 16px !important;
}
.dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    animation: dotPulse 1.2s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.85); }
    40% { opacity: 1; transform: scale(1); }
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.content-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.content-chat-input {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 8px 10px;
    color: #e2e4e8;
    font-size: 0.8rem;
    font-family: var(--font-main);
    resize: none;
    outline: none;
    min-height: 36px;
    max-height: 120px;
    line-height: 1.5;
    transition: border-color 0.2s;
}
.content-chat-input:focus { border-color: rgba(255,255,255,0.18); }
.content-chat-input::placeholder { color: rgba(255,255,255,0.25); }
.content-chat-send {
    width: 34px; height: 34px; flex-shrink: 0;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 7px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.content-chat-send:hover { border-color: rgba(255,255,255,0.4); color: #fff; }

/* ── Right panel ─────────────────────────────────────── */
.content-right-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.content-view {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.content-view.hidden { display: none; }

/* ── Kanban ──────────────────────────────────────────── */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    min-height: 180px;
}
.kanban-col { display: flex; flex-direction: column; gap: 8px; }
.kanban-col-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 4px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.kanban-col-title { font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.35); letter-spacing: 0.06em; text-transform: uppercase; }
.kanban-col-count {
    font-size: 0.65rem; color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.05); border-radius: 10px;
    padding: 1px 7px;
}
.kanban-cards { display: flex; flex-direction: column; gap: 7px; }
.kanban-empty { font-size: 0.75rem; color: rgba(255,255,255,0.18); text-align: center; padding: 20px 8px; }

/* ── Kanban Card ─────────────────────────────────────── */
.kanban-card {
    background: #111;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    position: relative;
}
.kanban-card:hover { border-color: rgba(255,255,255,0.18); background: #161616; transform: translateY(-1px); }
.kanban-card.selected { border-color: rgba(255,255,255,0.4); background: #161616; }

/* Delete button — appears on hover */
.kanban-card-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.35);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    z-index: 2;
    padding: 0;
}
.kanban-card:hover .kanban-card-delete { opacity: 1; }
.kanban-card-delete:hover {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.4);
    color: #ef4444;
}
.kanban-card-title { font-size: 0.82rem; font-weight: 500; color: #e2e4e8; margin-bottom: 6px; line-height: 1.3; }
.kanban-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.kanban-card-tag {
    font-size: 0.65rem; color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 4px; padding: 1px 6px;
}
.kanban-card-stage-dot {
    display: inline-block; width: 5px; height: 5px;
    border-radius: 50%; background: rgba(255,255,255,0.2);
    margin-right: 5px; vertical-align: middle;
}
.kanban-card-stage-dot.done { background: #fff; }
.kanban-card-progress {
    margin-top: 8px; height: 2px;
    background: rgba(255,255,255,0.07); border-radius: 1px; overflow: hidden;
}
.kanban-card-progress-fill { height: 100%; background: rgba(255,255,255,0.35); border-radius: 1px; transition: width 0.4s; }

/* ── Card Detail Panel ───────────────────────────────── */
.card-detail-panel {
    border-top: 1px solid rgba(255,255,255,0.08);
    background: #080808;
    display: flex;
    flex-direction: column;
    height: 55vh;
    flex-shrink: 0;
}
.card-detail-panel.hidden { display: none; }

.card-detail-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.card-detail-title-row {
    display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: nowrap;
    overflow: hidden;
}
.card-detail-title { font-size: 0.95rem; font-weight: 600; color: #e2e4e8; white-space: nowrap; }
.card-detail-meta { display: flex; gap: 5px; flex-shrink: 0; }
.card-meta-badge {
    font-size: 0.65rem; color: rgba(255,255,255,0.45);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px; padding: 2px 7px;
}
.card-detail-close {
    background: transparent; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px; width: 28px; height: 28px;
    color: rgba(255,255,255,0.35); cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0;
    margin-left: 8px;
}
.card-detail-close:hover { color: #fff; border-color: rgba(255,255,255,0.2); }

/* ── Stage Tabs (inside title row) ────────────────────── */
.card-stage-tabs {
    display: flex; gap: 0;
    margin-left: auto;
    flex-shrink: 0;
}
.card-stage-tab {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    background: transparent; border: none; border-bottom: 2px solid transparent;
    color: rgba(255,255,255,0.3); font-size: 0.72rem; font-weight: 500;
    cursor: pointer; transition: all 0.2s; font-family: var(--font-main);
    white-space: nowrap;
    outline: none;
}
.card-stage-tab:focus { outline: none; box-shadow: none; }
.card-stage-tab:hover:not([disabled]) { color: rgba(255,255,255,0.7); }
.card-stage-tab.active { color: #fff; border-bottom-color: rgba(255,255,255,0.6); }
.card-stage-tab.done { color: rgba(255,255,255,0.5); }
.card-stage-tab.done .stage-tab-icon { color: rgba(255,255,255,0.4); }
.card-stage-tab.locked { opacity: 0.35; cursor: not-allowed; }
.stage-lock-icon { opacity: 0.5; flex-shrink: 0; }
.stage-tab-icon { font-size: 0.65rem; }

/* ── Stage Panes ─────────────────────────────────────── */
.card-stage-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.stage-pane { display: flex; flex-direction: column; height: 100%; }
.stage-pane.hidden { display: none; }
.stage-pane-body { flex: 1; overflow-y: auto; padding: 14px 20px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.stage-pane-body::-webkit-scrollbar { width: 3px; }
.stage-pane-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.script-section { display: flex; flex-direction: column; gap: 5px; flex: 1; min-height: 0; }
.script-section-label { font-size: 0.65rem; font-weight: 700; color: rgba(255,255,255,0.3); letter-spacing: 0.1em; text-transform: uppercase; flex-shrink: 0; }
.script-textarea {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 7px; padding: 10px 12px; color: #e2e4e8;
    font-size: 0.82rem; font-family: var(--font-main); line-height: 1.6;
    resize: none; outline: none; flex: 1; min-height: 0; transition: border-color 0.2s;
}
.script-textarea:focus { border-color: rgba(255,255,255,0.18); }
.script-textarea::placeholder { color: rgba(255,255,255,0.2); }

/* ── Stage Footer (Approve button) ──────────────────── */
.stage-pane-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 20px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.stage-ai-hint { font-size: 0.72rem; color: rgba(255,255,255,0.25); font-style: italic; }
.stage-approve-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 18px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 7px;
    color: #fff; font-size: 0.78rem; font-weight: 500;
    cursor: pointer; transition: all 0.2s; font-family: var(--font-main);
}
.stage-approve-btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.6); }
.stage-approve-final { border-color: rgba(255,255,255,0.5); }

/* ── Storyboard 3-button footer ─────────────────────── */
.sb-footer-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.sb-btn-stub {
    opacity: 0.4;
    border-style: dashed;
}
.sb-btn-stub:hover {
    opacity: 0.6;
}

/* ── Storyboard toolbar (model select + add slot) ───── */
.sb-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.sb-model-select {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 5px 24px 5px 8px;
    color: rgba(255,255,255,0.6);
    font-size: 0.72rem;
    font-family: var(--font-main);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    max-width: 200px;
    transition: border-color 0.2s;
}
.sb-model-select:hover { border-color: rgba(255,255,255,0.18); }
.sb-model-select:focus { border-color: rgba(255,255,255,0.25); outline: none; }
.sb-add-slot-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 5px 12px;
    color: rgba(255,255,255,0.5);
    font-size: 0.72rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    outline: none;
}
.sb-add-slot-btn:hover {
    border-color: rgba(255,255,255,0.25);
    color: #fff;
    background: rgba(255,255,255,0.04);
}
.sb-add-slot-btn:focus { outline: none; box-shadow: none; }

/* ── Lightbox (fullscreen image preview) ─────────────── */
.sb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: lightboxFadeIn 0.2s ease;
}
.sb-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(0,0,0,0.6);
}
@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Kill blue outline globally for buttons */
button:focus { outline: none; }
button:focus-visible { outline: 1px solid rgba(255,255,255,0.15); outline-offset: 2px; }

/* ── @Mention Autocomplete Dropdown ──────────────────── */
.sb-mention-dropdown {
    z-index: 9999;
    background: rgba(20,20,22,0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 4px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.sb-mention-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
}
.sb-mention-item:hover,
.sb-mention-item.active {
    background: rgba(255,255,255,0.08);
}
.sb-mention-thumb {
    width: 28px; height: 28px;
    border-radius: 5px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.sb-mention-tag {
    color: #8be9fd;
    font-size: 0.78rem;
    font-weight: 500;
}
.sb-mention-name {
    color: rgba(255,255,255,0.35);
    font-size: 0.68rem;
}

/* ── KB Reference Tag Input ──────────────────────────── */
.kb-ref-tag {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    color: #8be9fd;
    font-size: 0.68rem;
    font-family: var(--font-main);
    padding: 3px 6px;
    margin-top: 4px;
    text-align: center;
    transition: border-color 0.2s;
}
.kb-ref-tag:focus {
    outline: none;
    border-color: rgba(139,233,253,0.3);
}
.kb-ref-tag::placeholder {
    color: rgba(255,255,255,0.2);
}

/* ── Storyboard Cards Grid ─────────────────────────────── */
.sb-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
    flex: 1;
    align-items: stretch;
}
.sb-grid::-webkit-scrollbar { height: 4px; }
.sb-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Individual Card (3:4 ratio) ──────────────────────── */
.sb-card {
    flex: 0 0 auto;
    width: clamp(160px, 22vw, 240px);
    aspect-ratio: 3 / 4;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s;
}
.sb-card:hover { border-color: rgba(255,255,255,0.18); }

/* Delete button — top-right, appears on hover */
.sb-card-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.5);
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s;
}
.sb-card:hover .sb-card-delete { opacity: 1; }
.sb-card-delete:hover {
    background: rgba(248,113,113,0.3);
    border-color: rgba(248,113,113,0.5);
    color: #f87171;
}

/* Card with image */
.sb-card-image {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.sb-card-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

/* Hover overlay on image */
.sb-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}
.sb-card:hover .sb-card-overlay { opacity: 1; }

.sb-card-action {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 5px 16px;
    color: rgba(255,255,255,0.85);
    font-size: 0.7rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.15s;
    min-width: 100px;
    text-align: center;
}
.sb-card-action:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* Prompt text under image */
.sb-card-prompt {
    padding: 6px 10px;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.3;
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
    max-height: 40px;
    overflow: hidden;
}

/* Empty card — prompt textarea */
.sb-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 6px;
}
.sb-card-body--gen {
    align-items: center;
    justify-content: center;
}
.sb-card-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: #e2e4e8;
    font-size: 0.75rem;
    font-family: var(--font-main);
    line-height: 1.45;
    resize: none;
    outline: none;
}
.sb-card-textarea::placeholder { color: rgba(255,255,255,0.2); }

.sb-card-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.sb-ref-btn, .sb-gen-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    padding: 4px 10px;
    color: rgba(255,255,255,0.45);
    font-size: 0.68rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.sb-ref-btn:hover { border-color: rgba(255,255,255,0.25); color: rgba(255,255,255,0.7); }
.sb-gen-btn {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
}
.sb-gen-btn:hover {
    border-color: rgba(255,255,255,0.4);
    color: #fff;
    background: rgba(255,255,255,0.04);
}

/* Reference thumbnail */
.sb-ref-thumb {
    width: 24px; height: 24px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    flex-shrink: 0;
}

/* Generating state */
.sb-card--generating { pointer-events: none; }
.sb-card-spinner {
    width: 24px; height: 24px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: rgba(255,255,255,0.5);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.sb-card-gen-text {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    margin-top: 6px;
}

/* "+" Add card */
.sb-card--add {
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-style: dashed;
    border-color: rgba(255,255,255,0.1);
    min-width: 120px;
}
.sb-card--add:hover {
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.03);
}
.sb-card-add-icon {
    font-size: 2rem;
    color: rgba(255,255,255,0.2);
    transition: color 0.2s;
}
.sb-card--add:hover .sb-card-add-icon { color: rgba(255,255,255,0.5); }

/* ── Generate All button ──────────────────────────────── */
.sb-gen-all-btn {
    align-self: center;
    padding: 8px 16px;
    background: rgba(139,233,253,0.1);
    border: 1px solid rgba(139,233,253,0.25);
    color: #8be9fd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
    min-width: 80px;
}
.sb-gen-all-btn:hover {
    background: rgba(139,233,253,0.2);
    border-color: rgba(139,233,253,0.4);
}

/* ── Version Navigation ──────────────────────────────── */
.sb-version-nav {
    position: absolute;
    bottom: 6px;
    left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 3px;
    z-index: 4;
    pointer-events: none;
}
.sb-version-btn {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.75);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    font-size: 0.55rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    pointer-events: auto;
    transition: all 0.15s;
    padding: 0;
}
.sb-version-btn:hover {
    background: rgba(0,0,0,0.95);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}
.sb-version-counter {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.7);
    border-radius: 10px;
    padding: 1px 8px;
    font-weight: 500;
    pointer-events: auto;
    letter-spacing: 0.02em;
}

/* ── Storyboard Drag & Drop ──────────────────────────── */
.sb-card[draggable="true"] { cursor: grab; }
.sb-card[draggable="true"]:active { cursor: grabbing; }
.sb-dragging {
    opacity: 0.3;
    transform: scale(0.95);
    transition: all 0.15s;
}
.sb-drag-over {
    outline: 2px dashed rgba(255,255,255,0.3);
    outline-offset: -2px;
    background: rgba(255,255,255,0.04) !important;
}

/* ── Video Badge ─────────────────────────────────────── */
.sb-video-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 5;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    pointer-events: none;
}
.sb-video-badge--done {
    pointer-events: auto;
    cursor: pointer;
    border-color: rgba(255,255,255,0.5);
}
.sb-video-badge--done:hover {
    background: rgba(0,0,0,0.95);
    border-color: #fff;
    transform: scale(1.15);
    transition: all 0.15s;
}
.sb-video-badge--gen {
    animation: sb-pulse 1.2s ease-in-out infinite;
}
@keyframes sb-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Storyboard Loading Line (shimmer) ───────────────── */
.sb-loading-line {
    width: 100%;
    height: 2px;
    background: transparent;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    transition: height 0.2s;
}
.sb-loading-line.active {
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    background-size: 200% 100%;
    animation: sb-shimmer 1.5s infinite linear;
}
@keyframes sb-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ── Assets grid ─────────────────────────────────────── */
.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.assets-grid:empty::after {
    content: 'Нажми «↓ Из раскадровки» чтобы перенести готовые кадры';
    display: block;
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: rgba(255,255,255,0.18);
    font-size: 0.8rem;
}
.asset-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.07);
    cursor: pointer;
    transition: border-color 0.2s;
}
.asset-item:hover { border-color: rgba(255,255,255,0.2); }
.asset-item img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.asset-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 3px;
    opacity: 0;
    transition: opacity 0.2s;
}
.asset-item:hover .asset-actions { opacity: 1; }
.asset-action-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}
.asset-action-btn:hover {
    color: #fff;
    background: rgba(0,0,0,0.9);
}
.asset-action-btn--delete:hover {
    color: #f87171;
}
.storyboard-scene {
    aspect-ratio: 16/9; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; color: rgba(255,255,255,0.25);
    position: relative; overflow: hidden; cursor: pointer; transition: border-color 0.2s;
}
.storyboard-scene:hover { border-color: rgba(255,255,255,0.2); }
.storyboard-scene-num {
    position: absolute; top: 5px; left: 7px;
    font-size: 0.6rem; color: rgba(255,255,255,0.2); font-weight: 600;
}

/* ── Editing ─────────────────────────────────────────── */
.editing-status { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px; }
.editing-status-text { font-size: 0.85rem; color: rgba(255,255,255,0.5); }
.editing-launch-btn {
    padding: 8px 20px; border: 1px solid rgba(255,255,255,0.2);
    border-radius: 7px; background: transparent; color: rgba(255,255,255,0.7);
    font-family: var(--font-main); font-size: 0.8rem; cursor: pointer; transition: all 0.2s;
}
.editing-launch-btn:hover { border-color: rgba(255,255,255,0.5); color: #fff; }

/* ── Publish layout ──────────────────────────────────── */
.publish-layout {
    display: grid;
    grid-template-columns: 180px 1fr 1fr;
    gap: 20px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.publish-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.publish-col--meta {
    padding-right: 16px;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.publish-col--media {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    overflow: hidden;
}
.publish-col--caption {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    overflow: hidden;
}

.publish-field { display: flex; flex-direction: column; gap: 5px; }
.publish-label { font-size: 0.68rem; font-weight: 600; color: rgba(255,255,255,0.3); letter-spacing: 0.06em; text-transform: uppercase; }
.publish-datetime {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 7px; padding: 8px 12px; color: #e2e4e8;
    font-size: 0.82rem; font-family: var(--font-main); outline: none;
    transition: border-color 0.2s; color-scheme: dark;
}
.publish-datetime:focus { border-color: rgba(255,255,255,0.18); }
.publish-platforms { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.platform-check { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; color: rgba(255,255,255,0.5); cursor: pointer; }
.platform-check input[type=checkbox] {
    -webkit-appearance: none;
    appearance: none;
    width: 14px; height: 14px;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
    flex-shrink: 0;
}
.platform-check input[type=checkbox]:checked {
    border-color: rgba(255,255,255,0.7);
    background: transparent;
}
.platform-check input[type=checkbox]:checked::after {
    content: '✓';
    position: absolute;
    top: -1px; left: 1px;
    font-size: 0.6rem;
    color: #fff;
    font-weight: 700;
}

/* Status badge */
.publish-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    transition: all 0.2s;
}
.publish-status-badge[data-status="draft"] {
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.4);
}
.publish-status-badge[data-status="scheduled"] {
    border-color: rgba(255,255,255,0.35);
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.06);
}
.publish-status-badge[data-status="published"] {
    border-color: rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.08);
}

/* Media preview area */
.publish-media-preview {
    flex: 1;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.02);
    position: relative;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
/* Delete button */
.publish-media-delete {
    position: absolute;
    top: 6px; right: 6px;
    width: 22px; height: 22px;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    color: rgba(255,255,255,0.5);
    font-size: 0.7rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    z-index: 5;
    padding: 0;
    line-height: 1;
}
.publish-media-delete:hover {
    background: rgba(180,40,40,0.8);
    border-color: rgba(255,80,80,0.4);
    color: #fff;
}
.publish-media-preview video,
.publish-media-preview img {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}
.publish-media-preview video:focus,
.publish-media-preview video:focus-visible,
.publish-media-preview video::-webkit-media-controls-panel {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}
.publish-media-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
    color: rgba(255,255,255,0.15);
    font-size: 0.78rem;
}
.publish-media-empty svg { stroke: rgba(255,255,255,0.1); }
.publish-media-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.publish-media-action-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 6px 14px;
    color: rgba(255,255,255,0.4);
    font-size: 0.72rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.15s;
}
.publish-media-action-btn:hover {
    border-color: rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.03);
}


.publish-carousel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.publish-carousel-track {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.publish-carousel-slide {
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 6px;
    box-sizing: border-box;
}
.publish-carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}
.publish-carousel-slide video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}
.publish-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.publish-carousel-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.5);
    font-size: 0.6rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.publish-carousel-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}
.publish-carousel-counter {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

/* Upload button — hidden, replaced by overlay inside media preview */
.publish-upload-row { display: none; }

/* Caption wrapper — shared border container */
.publish-caption-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    overflow: hidden;
}
.publish-caption-textarea {
    flex: 1;
    min-height: 0;
    background: transparent;
    border: none;
    padding: 12px 14px;
    color: #e2e4e8;
    font-size: 0.82rem;
    font-family: var(--font-main);
    line-height: 1.55;
    resize: none;
    outline: none;
}
.publish-caption-textarea::placeholder { color: rgba(255,255,255,0.18); }
.publish-caption-counter {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.2);
    text-align: right;
    padding: 4px 14px 8px;
    flex-shrink: 0;
}
.publish-caption-counter.warn { color: #f87171; }

/* Footer */
.publish-footer-actions {
    display: flex;
    gap: 8px;
}

/* ── Add Idea Modal ──────────────────────────────────── */
.content-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px); z-index: 3000;
    display: flex; align-items: center; justify-content: center;
}
.content-modal-overlay.hidden { display: none; }
.content-modal {
    background: #0e0e0e; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; width: 480px; max-width: 95vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity:0; transform: scale(0.96) translateY(8px); } }
.content-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 0;
}
.content-modal-header h3 { font-size: 0.95rem; font-weight: 600; color: #e2e4e8; }
.content-modal-close {
    background: transparent; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px; width: 28px; height: 28px;
    color: rgba(255,255,255,0.35); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.content-modal-close:hover { color: #fff; }
.content-modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-field { display: flex; flex-direction: column; gap: 6px; }
.modal-label { font-size: 0.68rem; font-weight: 600; color: rgba(255,255,255,0.3); letter-spacing: 0.06em; text-transform: uppercase; }
.modal-input {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px; padding: 8px 12px; color: #e2e4e8;
    font-size: 0.82rem; font-family: var(--font-main); outline: none; transition: border-color 0.2s;
}
.modal-input:focus { border-color: rgba(255,255,255,0.2); }
.modal-type-btns { display: flex; gap: 7px; }
.modal-type-btn {
    padding: 6px 14px; border: 1px solid rgba(255,255,255,0.08); border-radius: 6px;
    background: transparent; color: rgba(255,255,255,0.45); font-size: 0.78rem;
    font-family: var(--font-main); cursor: pointer; transition: all 0.2s;
}
.modal-type-btn:hover { border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); }
.modal-type-btn.active { border-color: rgba(255,255,255,0.5); color: #fff; background: rgba(255,255,255,0.06); }
.modal-platforms { display: flex; flex-wrap: wrap; gap: 10px; }
.content-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.modal-btn-cancel {
    padding: 7px 16px; background: transparent;
    border: 1px solid rgba(255,255,255,0.08); border-radius: 7px;
    color: rgba(255,255,255,0.4); font-size: 0.8rem; font-family: var(--font-main); cursor: pointer;
}
.modal-btn-confirm {
    padding: 7px 18px; background: transparent;
    border: 1px solid rgba(255,255,255,0.4); border-radius: 7px;
    color: #fff; font-size: 0.8rem; font-weight: 500; font-family: var(--font-main); cursor: pointer; transition: all 0.2s;
}
.modal-btn-confirm:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.7); }

/* ── Drag & Drop ─────────────────────────────────────── */
.kanban-card.dragging { opacity: 0.4; transform: scale(0.97); cursor: grabbing; }
.kanban-cards.drag-over {
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    outline: 1px dashed rgba(255,255,255,0.2);
}
.kanban-card-date {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.2);
    margin-top: 5px;
}

/* ── Calendar ────────────────────────────────────────── */
.calendar-panel { padding: 16px 20px; }
.cal-header { margin-bottom: 14px; }
.cal-month { font-size: 0.88rem; font-weight: 600; color: rgba(255,255,255,0.7); text-transform: capitalize; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.cal-dow {
    font-size: 0.65rem; font-weight: 600; color: rgba(255,255,255,0.25);
    text-align: center; padding: 4px 0; letter-spacing: 0.04em;
}
.cal-day {
    min-height: 64px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 5px;
    padding: 4px 5px;
    display: flex; flex-direction: column; gap: 2px;
}
.cal-day-empty { background: transparent; border-color: transparent; }
.cal-day-today { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.04); }
.cal-day-num { font-size: 0.68rem; color: rgba(255,255,255,0.3); font-weight: 500; }
.cal-day-today .cal-day-num { color: #fff; }
.cal-event {
    font-size: 0.62rem; color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.07);
    border-radius: 3px; padding: 1px 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: pointer; transition: background 0.15s;
}
.cal-event:hover { background: rgba(255,255,255,0.13); }

/* ── List View ───────────────────────────────────────── */
.list-panel { padding: 0; overflow-x: auto; }
.list-empty { padding: 32px; font-size: 0.82rem; color: rgba(255,255,255,0.2); text-align: center; }
.list-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.8rem;
}
.list-table thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.65rem; font-weight: 600; letter-spacing: 0.07em;
    color: rgba(255,255,255,0.25); text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}
.list-row {
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}
.list-row:hover { background: rgba(255,255,255,0.03); }
.list-title { padding: 10px 16px; color: #e2e4e8; font-weight: 500; }
.list-cell { padding: 10px 16px; color: rgba(255,255,255,0.4); white-space: nowrap; }
.list-stage-badge {
    padding: 2px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 500;
    border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.5);
}
.list-stage-done { border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.7); }
.list-progress-bar {
    width: 80px; height: 3px;
    background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden;
}
.list-progress-fill { height: 100%; background: rgba(255,255,255,0.35); border-radius: 2px; transition: width 0.4s; }

/* ── Assets grid ─────────────────────────────────────── */
.assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); gap: 8px; }

/* ── Status dot states ─────────────────────────────── */
.gs-status-dot.generating {
    background: rgba(255,255,255,0.5);
    animation: dotBlink 1s ease-in-out infinite;
}
.gs-status-dot.error {
    background: #ef4444;
}
@keyframes dotBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Knowledge Base Modal ────────────────────────── */
.kb-modal {
    max-width: 580px;
    max-height: 82vh;
    overflow-y: auto;
}
.kb-tabs {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 3px;
    margin: 0 20px 16px;
}
.kb-tab {
    flex: 1;
    padding: 6px 10px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
}
.kb-tab:hover { color: rgba(255,255,255,0.6); }
.kb-tab.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.kb-tab-content {
    padding: 0 20px 16px;
}
.kb-field {
    margin-bottom: 14px;
}
.kb-field label {
    display: block;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.kb-input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px;
    padding: 8px 12px;
    color: #e2e4e8;
    font-size: 0.82rem;
    font-family: var(--font-main);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.kb-input:focus { border-color: rgba(255,255,255,0.2); }
.kb-textarea { resize: vertical; min-height: 48px; }
.kb-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.kb-avatar-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.kb-avatar-preview {
    width: 56px; height: 56px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: rgba(255,255,255,0.25);
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.08);
}
.kb-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.kb-avatar-btn {
    cursor: pointer;
    font-size: 0.78rem;
    padding: 5px 12px;
}
.kb-hint {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.25);
}
.kb-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.kb-platforms label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}
.kb-platforms input[type="checkbox"] {
    accent-color: rgba(255,255,255,0.5);
}

/* KB references grid */
.kb-refs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.kb-refs-header span {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
    font-weight: 500;
}
.kb-refs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.kb-ref-item {
    position: relative;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.02);
    transition: border-color 0.2s;
}
.kb-ref-item:hover { border-color: rgba(255,255,255,0.18); }
.kb-ref-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 7px 7px 0 0;
    display: block;
}
.kb-ref-delete {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(0,0,0,0.7);
    border: none;
    color: rgba(255,255,255,0.6);
    width: 20px; height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.kb-ref-item:hover .kb-ref-delete { opacity: 1; }
.kb-ref-delete:hover { color: #ef4444; }

/* KB divider */
.kb-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 16px 0;
}

/* KB palette */
.kb-palette-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.kb-palette-row .kb-textarea {
    flex: 1;
    margin: 0;
}
.kb-palette-preview {
    width: 90px;
    min-width: 90px;
    border-radius: 8px;
    border: 1px dashed rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.02);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s;
}
.kb-palette-preview:hover {
    border-color: rgba(255,255,255,0.3);
}
.kb-palette-placeholder {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.2);
}

/* KB competitors */
.kb-competitor-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 28px;
    gap: 6px;
    margin-bottom: 6px;
    align-items: center;
}

/* KB products */
.kb-product-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    position: relative;
}
.kb-product-row .kb-input {
    width: 100%;
}
.kb-product-row .kb-comp-delete {
    position: absolute;
    top: 8px;
    right: 8px;
}
.kb-product-row .kb-textarea {
    min-height: 100px;
    font-size: 0.8rem;
    line-height: 1.4;
}
.kb-comp-delete {
    background: none;
    border: none;
    color: rgba(255,255,255,0.2);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    border-radius: 4px;
    transition: color 0.2s;
    text-align: center;
}
.kb-comp-delete:hover { color: #ef4444; }
.kb-empty {
    color: rgba(255,255,255,0.2);
    font-size: 0.8rem;
    padding: 16px;
    text-align: center;
}

/* ── Audit fixes: replace inline styles ─────── */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.kanban-card-desc {
    font-size: 11px;
    color: #888;
    margin: 4px 0;
    line-height: 1.3;
}

.kanban-card-tag--source {
    opacity: 0.5;
}

.gs-header-btn--disabled {
    opacity: 0.5;
    pointer-events: none;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sync-spinner {
    display: inline-block;
    font-size: 14px;
}

#btnSyncIdeas {
    margin-right: 8px;
}

.kb-product-fields {
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kb-products-hint {
    margin-top: 4px;
    margin-bottom: 12px;
}

/* Input modal (inputModal utility) */
.im-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 7px;
    padding: 9px 12px;
    color: #e2e4e8;
    font-size: 0.85rem;
    font-family: var(--font-main);
    outline: none;
    margin-top: 4px;
    margin-bottom: 4px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.im-input:focus { border-color: rgba(255,255,255,0.3); }
.im-input::placeholder { color: rgba(255,255,255,0.25); }

/* Textarea variant for multiline prompts */
.im-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}
.cm-panel--wide { min-width: 420px; max-width: 540px; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 1100px) {
    .content-layout {
        grid-template-columns: 280px 1fr;
    }
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    .content-chat-panel {
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .kanban-board {
        grid-template-columns: 1fr;
    }
    .content-subheader {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 16px;
        gap: 8px;
    }
}
