/* ============================================================
   CineWriter – Compact Windows-style layout
   ============================================================ */

/* ── Reset & base ───────────────────────────────────────────── */
.cw-app {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    color: #f0f0f0;
    background: #1e1e1e;
    user-select: none;
}
.mud-dialog.cw-project-edit-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
}
.mud-dialog.cw-project-edit-dialog .mud-dialog-content {
    height: calc(100vh - 64px);
    max-height: none;
    overflow: hidden;
    padding: 8px;
}
.cw-project-edit-dialog .cw-tabcontrol,
.cw-project-edit-dialog .cw-tab-page {
    height: 100%;
}
.cw-project-edit-dialog .cw-tab-page {
    overflow: hidden;
}
.cw-scripts-layout {
    display: grid;
    grid-template-columns: minmax(360px, 32%) minmax(0, 1fr);
    gap: 16px;
    height: 100%;
    min-height: 0;
}
.cw-scripts-panel {
    min-width: 0;
    overflow: auto;
    background: #687b8d;
    padding: 16px;
}
.cw-script-grid-wrapper {
    margin-top: 16px;
    overflow: auto;
    background: #75899a;
}
.cw-script-grid {
    width: 100%;
    border-collapse: collapse;
    color: #111;
    background: #e8edf1;
    font-size: .82rem;
}
.cw-script-grid th,
.cw-script-grid td {
    border: 1px solid #8996a1;
    padding: 6px 8px;
    text-align: left;
    white-space: nowrap;
}
.cw-script-grid th {
    background: #c7d9e8;
}
.cw-script-grid tbody tr {
    cursor: pointer;
}
.cw-script-grid tbody tr:hover,
.cw-script-grid tbody tr.selected {
    background: #ffff00;
}
.cw-script-editor-panel {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #d1d1d1;
}
.cw-script-editor-panel .script-editor-container {
    width: 100%;
    height: 100%;
}
.cw-script-editor-empty {
    display: grid;
    place-items: center;
    height: 100%;
    color: #555;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.cw-sidebar {
    display: flex;
    flex-direction: column;
    width: 50px;
    min-width: 50px;
    background: #1a1a2e;
    border-right: 1px solid #3f3f46;
    transition: width 0.25s ease, min-width 0.25s ease;
    overflow: hidden;
    z-index: 100;
    flex-shrink: 0;
}

.cw-sidebar-ai-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 2px solid #f0f0f0;
    border-radius: 50%;
    color: #f0f0f0;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.cw-sidebar.expanded {
    width: 200px;
    min-width: 200px;
}

.cw-sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border-bottom: 1px solid #3f3f46;
    min-height: 48px;
}

.cw-sidebar-logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 4px;
}

.cw-sidebar.expanded .cw-sidebar-logo img {
    width: 120px;
    height: auto;
}

.cw-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    border: none;
    background: #16213e;
    color: #8ab4f8;
    cursor: pointer;
    border-bottom: 1px solid #3f3f46;
    gap: 4px;
    padding: 0;
    position: relative;
}

.cw-sidebar-toggle:hover {
    background: #1e3a5f;
}

.cw-sidebar-toggle .material-icons {
    font-size: 20px;
}

.cw-sidebar-toggle-bar {
    position: absolute;
    right: 8px;
    width: 3px;
    height: 16px;
    background: #8ab4f8;
    border-radius: 2px;
    opacity: 0.5;
}

.cw-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 4px 0;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
}

.cw-sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 40px;
    min-height: 40px;
    border: none;
    background: transparent;
    color: #c0c0c0;
    cursor: pointer;
    padding: 0 13px;
    gap: 12px;
    white-space: nowrap;
    font-size: 13px;
    text-align: left;
    transition: background 0.15s;
}

.cw-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.cw-sidebar-btn .material-icons {
    font-size: 22px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.cw-sidebar-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 2px solid #8ab4f8;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #8ab4f8;
    flex-shrink: 0;
}

.cw-sidebar-label {
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
    overflow: hidden;
}

.cw-sidebar.expanded .cw-sidebar-label {
    opacity: 1;
}

.cw-sidebar-bottom {
    border-top: 1px solid #3f3f46;
    padding: 4px 0;
}

/* ── Content wrapper (right of sidebar) ─────────────────────── */
.cw-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── Toolbar ────────────────────────────────────────────────── */
.cw-toolbar {
    display: flex;
    align-items: center;
    height: 30px;
    min-height: 30px;
    background: #333337;
    border-bottom: 1px solid #3f3f46;
    padding: 0 4px;
    gap: 2px;
}

.cw-toolbar .cw-tb-sep {
    width: 1px;
    height: 18px;
    background: #555;
    margin: 0 4px;
}

.cw-tb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #ddd;
    cursor: pointer;
    border-radius: 3px;
    padding: 0;
    font-size: 16px;
}

.cw-tb-btn.active {
    background: #007acc;
    color: #fff;
}

.cw-tb-count-btn {
    width: 54px;
    gap: 2px;
}

.cw-tb-count {
    font-size: 10px;
    line-height: 1;
}

.cw-tb-btn:hover {
    background: #3e3e42;
    color: #fff;
}

.cw-tb-btn:active {
    background: #094771;
}

.cw-tb-btn img {
    width: 18px;
    height: 18px;
}

.cw-tb-btn .material-icons {
    font-size: 18px;
}

/* Compact label+combo group */
.cw-tb-group {
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 0 2px;
}

.cw-tb-label {
    font-size: 11px;
    color: #c0c0c0;
    white-space: nowrap;
}

.cw-tb-select {
    height: 22px;
    font-size: 11px;
    padding: 0 4px;
    border: 1px solid #555;
    border-radius: 2px;
    background: #3c3c3c;
    color: #f0f0f0;
    outline: none;
    cursor: pointer;
    min-width: 80px;
}

.cw-tb-select:focus {
    border-color: #007acc;
}

.cw-tb-select option {
    background: #2d2d30;
    color: #f0f0f0;
}

/* Status indicator */
.cw-tb-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #c0c0c0;
    margin: 0 4px;
    white-space: nowrap;
}

.cw-tb-status .cw-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
}

.cw-tb-status .cw-status-dot.offline {
    background: #e53935;
}

.cw-tb-status-value {
    color: #4fc3f7;
    font-weight: 600;
}

/* ── Info bar ───────────────────────────────────────────────── */
.cw-infobar {
    display: flex;
    align-items: center;
    height: 24px;
    min-height: 24px;
    background: #252526;
    border-bottom: 1px solid #3f3f46;
    padding: 0 8px;
    gap: 16px;
    font-size: 11px;
}

.cw-info-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #b0b0b0;
    white-space: nowrap;
}

.cw-info-item .cw-info-label {
    color: #b0b0b0;
}

.cw-info-item .cw-info-value {
    color: #4fc3f7;
    font-weight: 600;
    background: rgba(79, 195, 247, 0.1);
    padding: 0 4px;
    border-radius: 2px;
}

/* ── Main content area ──────────────────────────────────────── */
.cw-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* ── Scene panel (left) ─────────────────────────────────────── */
.cw-scene-panel {
    width: 350px;
    min-width: 350px;
    background: #1a1a2e;
    border-right: 1px solid #3f3f46;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cw-scene-header {
    display: flex;
    align-items: center;
    height: 28px;
    min-height: 28px;
    padding: 0 8px;
    background: #16213e;
    border-bottom: 1px solid #3f3f46;
    font-size: 12px;
    font-weight: 600;
    color: #8ab4f8;
}

.cw-scene-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.cw-scene-item {
    padding: 6px 8px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,.06);
    transition: background 0.1s;
}

.cw-scene-item:hover {
    background: rgba(255,255,255,.05);
}

.cw-scene-item.selected {
    background: rgba(0,122,204,.2);
    border-left: 3px solid #007acc;
}

.cw-scene-item .cw-scene-title {
    font-size: 11px;
    font-weight: 600;
    color: #e8c84a;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-scene-item .cw-scene-meta {
    font-size: 10px;
    color: #a0a0a0;
    margin-bottom: 2px;
}

.cw-scene-item .cw-scene-desc {
    font-size: 10px;
    color: #b0b0b0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-scene-empty {
    padding: 16px 8px;
    font-size: 11px;
    color: #888;
    text-align: center;
}

/* Info icon */
.cw-scene-item .cw-scene-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2196f3;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-right: 6px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* ── Editor area (right) ────────────────────────────────────── */
.cw-editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f5f5f5;
}

.cw-editor-canvas {
    flex: 1;
    overflow: auto;
    padding: 0;
    background: #e8e8e8;
}

/* Loading/error states */
.cw-editor-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    gap: 8px;
}

.cw-editor-error {
    padding: 16px;
    background: #b32121;
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    margin: 16px;
}

/* ── Search bar (bottom) ────────────────────────────────────── */
.cw-searchbar {
    display: flex;
    align-items: center;
    height: 32px;
    min-height: 32px;
    flex-shrink: 0;
    background: #333337;
    border-top: 1px solid #3f3f46;
    padding: 0 6px;
    gap: 6px;
}

.cw-searchbar label {
    font-size: 11px;
    color: #c0c0c0;
    white-space: nowrap;
}

.cw-searchbar input[type="text"] {
    height: 22px;
    font-size: 11px;
    padding: 0 6px;
    border: 1px solid #555;
    border-radius: 2px;
    background: #3c3c3c;
    color: #f0f0f0;
    outline: none;
    min-width: 120px;
}

.cw-searchbar input[type="text"]:focus {
    border-color: #007acc;
}

.cw-searchbar input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
    cursor: pointer;
}

.cw-search-chk-label {
    font-size: 11px;
    color: #c0c0c0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.cw-search-btn {
    height: 22px;
    padding: 0 10px;
    font-size: 11px;
    border: 1px solid #555;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
}

.cw-search-btn.primary {
    background: #4caf50;
    color: #fff;
    border-color: #388e3c;
}

.cw-search-btn.primary:hover {
    background: #43a047;
}

.cw-search-btn.warn {
    background: #ff9800;
    color: #fff;
    border-color: #e65100;
}

.cw-search-btn.warn:hover {
    background: #fb8c00;
}

.cw-search-btn.default {
    background: #3c3c3c;
    color: #f0f0f0;
    border-color: #555;
}

.cw-search-btn.default:hover {
    background: #4a4a4a;
}

.cw-searchbar .cw-search-sep {
    width: 1px;
    height: 18px;
    background: #555;
    margin: 0 2px;
}

.cw-searchbar .cw-spacer {
    flex: 1;
}

.cw-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #a0a0a0;
    cursor: pointer;
    border-radius: 2px;
    font-size: 14px;
}

.cw-search-msg {
    font-size: 11px;
    color: #ffcc00;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    margin-left: 6px;
}

.cw-search-close:hover {
    background: #3e3e42;
    color: #fff;
}

/* ── Scrollbar styling ──────────────────────────────────────── */
.cw-scene-list::-webkit-scrollbar {
    width: 8px;
}

.cw-scene-list::-webkit-scrollbar-track {
    background: #1a1a2e;
}

.cw-scene-list::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 4px;
}

.cw-scene-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ── Multiidioma button ─────────────────────────────────────── */
.cw-tb-toggle {
    height: 22px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #555;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
}

.cw-tb-toggle.active {
    background: #007acc;
    color: #fff;
    border-color: #005a9e;
}

.cw-tb-toggle.inactive {
    background: #3c3c3c;
    color: #b0b0b0;
    border-color: #555;
}

/* ── Autosave indicator ─────────────────────────────────────── */
.cw-autosave {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #c0c0c0;
    white-space: nowrap;
    height: 22px;
    padding: 0 8px;
    border: 1px solid #555;
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
}

.cw-autosave .cw-check {
    color: #4caf50;
    font-size: 14px;
}

.cw-autosave.inactive .cw-check {
    color: #f44336;
}

/* ============================================================
   CineWriter – Light mode (.cw-app.light)
   ============================================================ */

/* ── Base ────────────────────────────────────────────────────── */
.cw-app.light {
    color: #222;
    background: #f5f5f5;
}

/* ── Sidebar (light) ─────────────────────────────────────────── */
.cw-app.light .cw-sidebar {
    background: #e8ecf2;
    border-right: 1px solid #c8c8cc;
}

.cw-app.light .cw-sidebar-toggle {
    background: #dce3ed;
    color: #2c5aa0;
}

.cw-app.light .cw-sidebar-toggle:hover {
    background: #cdd8e8;
}

.cw-app.light .cw-sidebar-toggle-bar {
    background: #2c5aa0;
}

.cw-app.light .cw-sidebar-btn {
    color: #444;
}

.cw-app.light .cw-sidebar-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #111;
}

.cw-app.light .cw-sidebar-icon-box {
    border-color: #2c5aa0;
    color: #2c5aa0;
}

.cw-app.light .cw-sidebar-bottom {
    border-top: 1px solid #c8c8cc;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.cw-app.light .cw-toolbar {
    background: #eaeaee;
    border-bottom: 1px solid #c8c8cc;
}

.cw-app.light .cw-toolbar .cw-tb-sep {
    background: #bbb;
}

.cw-app.light .cw-tb-btn {
    color: #555;
}

.cw-app.light .cw-tb-btn:hover {
    background: #d0d0d5;
    color: #222;
}

.cw-app.light .cw-tb-btn:active {
    background: #b3d7ff;
}

.cw-app.light .cw-tb-btn.active {
    background: #0078d4;
    color: #fff;
}

.cw-app.light .cw-tb-label {
    color: #666;
}

.cw-app.light .cw-tb-select {
    border: 1px solid #bbb;
    background: #fff;
    color: #333;
}

.cw-app.light .cw-tb-select:focus {
    border-color: #0078d4;
}

.cw-app.light .cw-tb-select option {
    background: #fff;
    color: #333;
}

.cw-app.light .cw-tb-status {
    color: #666;
}

.cw-app.light .cw-tb-status-value {
    color: #0078d4;
}

/* ── Info bar ────────────────────────────────────────────────── */
.cw-app.light .cw-infobar {
    background: #e0e0e4;
    border-bottom: 1px solid #c8c8cc;
}

.cw-app.light .cw-info-item {
    color: #555;
}

.cw-app.light .cw-info-item .cw-info-label {
    color: #666;
}

.cw-app.light .cw-info-item .cw-info-value {
    color: #0078d4;
    background: rgba(0, 120, 212, 0.08);
}

/* ── Scene panel ─────────────────────────────────────────────── */
.cw-app.light .cw-scene-panel {
    background: #e8ecf2;
    border-right: 1px solid #c8c8cc;
}

.cw-app.light .cw-scene-header {
    background: #dce3ed;
    border-bottom: 1px solid #c8c8cc;
    color: #2c5aa0;
}

.cw-app.light .cw-scene-item {
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.cw-app.light .cw-scene-item:hover {
    background: rgba(0,0,0,.04);
}

.cw-app.light .cw-scene-item.selected {
    background: rgba(0, 120, 212, 0.1);
    border-left: 3px solid #0078d4;
}

.cw-app.light .cw-scene-item .cw-scene-title {
    color: #8a6d1b;
}

.cw-app.light .cw-scene-item .cw-scene-meta {
    color: #888;
}

.cw-app.light .cw-scene-item .cw-scene-desc {
    color: #666;
}

.cw-app.light .cw-scene-empty {
    color: #999;
}

.cw-app.light .cw-scene-item .cw-scene-icon {
    background: #0078d4;
}

/* ── Editor area ─────────────────────────────────────────────── */
.cw-app.light .cw-editor-area {
    background: #fff;
}

.cw-app.light .cw-editor-canvas {
    background: #f0f0f0;
}

.cw-app.light .cw-editor-loading {
    color: #999;
}

.cw-app.light .cw-editor-error {
    background: #d32f2f;
}

/* ── Search bar ──────────────────────────────────────────────── */
.cw-app.light .cw-searchbar {
    background: #eaeaee;
    border-top: 1px solid #c8c8cc;
}

.cw-app.light .cw-searchbar label {
    color: #555;
}

.cw-app.light .cw-searchbar input[type="text"] {
    border: 1px solid #bbb;
    background: #fff;
    color: #333;
}

.cw-app.light .cw-searchbar input[type="text"]:focus {
    border-color: #0078d4;
}

.cw-app.light .cw-search-chk-label {
    color: #555;
}

.cw-app.light .cw-search-btn.primary {
    background: #0078d4;
    color: #fff;
    border-color: #005a9e;
}

.cw-app.light .cw-search-btn.primary:hover {
    background: #106ebe;
}

.cw-app.light .cw-search-btn.warn {
    background: #f57c00;
    color: #fff;
    border-color: #e65100;
}

.cw-app.light .cw-search-btn.warn:hover {
    background: #ef6c00;
}

.cw-app.light .cw-search-btn.default {
    background: #e0e0e0;
    color: #333;
    border-color: #bbb;
}

.cw-app.light .cw-search-btn.default:hover {
    background: #d5d5d5;
}

.cw-app.light .cw-searchbar .cw-search-sep {
    background: #bbb;
}

.cw-app.light .cw-search-close {
    color: #888;
}

.cw-app.light .cw-search-close:hover {
    background: #d0d0d5;
    color: #333;
}

.cw-app.light .cw-search-msg {
    color: #b36b00;
}

/* ── Scrollbar (light) ───────────────────────────────────────── */
.cw-app.light .cw-scene-list::-webkit-scrollbar-track {
    background: #e8ecf2;
}

.cw-app.light .cw-scene-list::-webkit-scrollbar-thumb {
    background: #c0c0c0;
}

.cw-app.light .cw-scene-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ── Toggle / Autosave (light) ───────────────────────────────── */
.cw-app.light .cw-tb-toggle.active {
    background: #0078d4;
    color: #fff;
    border-color: #005a9e;
}

.cw-app.light .cw-tb-toggle.inactive {
    background: #e0e0e0;
    color: #666;
    border-color: #bbb;
}

.cw-app.light .cw-autosave {
    color: #666;
}

.cw-app.light .cw-sidebar-ai-icon {
    color: #1f2937;
    border-color: #1f2937;
}

.cw-autosave {
    border: 0;
    cursor: pointer;
}

.cw-autosave.active .cw-check { color: #22c55e; }
.cw-autosave.inactive .cw-check { color: #ef4444; }

.cw-background-status {
    margin-left: auto;
    color: #fff;
    font-weight: 600;
}

.cw-app.light .cw-background-status { color: #1f2937; }

.mud-dialog.cw-pdf-dialog {
    position: relative;
    z-index: 1500;
    width: min(1050px, 92vw);
    pointer-events: auto;
    opacity: 1;
    background: #3a3a3d;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 6px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
.mud-dialog.cw-pdf-dialog * { pointer-events: auto; }
.mud-dialog.cw-pdf-dialog .mud-dialog-title {
    background: #2d2d30;
    color: #e0e0e0;
    font-weight: 600;
    border-bottom: 1px solid #555;
    padding: 12px 16px;
}
.mud-dialog.cw-pdf-dialog .mud-dialog-content { background: #3a3a3d; padding: 16px; }
.mud-dialog.cw-pdf-dialog .mud-dialog-actions { background: #2d2d30; border-top: 1px solid #555; padding: 10px 16px; }
.cw-pdf-viewer {
    width: 100%;
    height: 72vh;
    border: 1px solid #3f3f46;
    background: #fff;
    opacity: 1;
    border-radius: 3px;
}

/* ── Project Gallery ─────────────────────────────────────────── */
.cw-project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 16px;
}

.cw-project-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
    background: #2d2d30;
}

.cw-project-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
    transform: translateY(-2px);
}

.cw-project-image {
    width: 100%;
    height: 140px;
    background: #1e1e1e;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cw-project-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.cw-project-info {
    padding: 10px 12px 4px;
}

.cw-project-name {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cw-project-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 4px 8px 8px;
    gap: 2px;
}

.cw-icon-btn {
    background: transparent;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cw-icon-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* ── MudDialog overlay fix (above canvas) ───────────────────── */
.mud-overlay {
    z-index: 1300 !important;
}

.mud-dialog-container {
    z-index: 1400 !important;
}

/* Els missatges oberts des d'un altre diàleg han de quedar sempre al davant. */
.mud-dialog-container:has(.cw-message-dialog),
.mud-overlay:has(+ .mud-dialog-container .cw-message-dialog) {
    z-index: 2000 !important;
}

.mud-dialog.cw-message-dialog {
    background: #3a3a3d;
    border: 2px solid #6a6a6e;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .65);
    color: #fff;
    min-width: 360px;
    overflow: hidden;
    position: relative;
    z-index: 2001;
    pointer-events: auto;
}

.mud-dialog.cw-message-dialog * {
    pointer-events: auto;
}

.mud-dialog.cw-message-dialog .mud-dialog-title {
    background: #252529;
    border-bottom: 1px solid #555;
    color: #fff;
    padding: 12px 16px;
}

.mud-dialog.cw-message-dialog .mud-dialog-title .mud-typography {
    color: #fff;
}

.mud-dialog.cw-message-dialog .mud-dialog-content {
    background: #3a3a3d;
    color: #f2f2f2;
    padding: 24px 20px;
}

.mud-dialog.cw-message-dialog .mud-dialog-content .mud-typography {
    color: #f2f2f2;
}

.mud-dialog.cw-message-dialog .mud-dialog-actions {
    align-items: center;
    background: #3a3a3d;
    border-top: 1px solid #555;
    justify-content: center;
    padding: 12px 16px 16px;
}

.mud-dialog.cw-project-dialog {
    background: #3a3a3d;
    border: 2px solid #6a6a6e;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    max-height: 80vh;
    overflow: hidden;
    color: #e0e0e0;
    position: relative;
    z-index: 1500;
    pointer-events: auto;
}
.mud-dialog.cw-project-dialog * { pointer-events: auto; }

.mud-dialog.cw-project-dialog .mud-dialog-title {
    background: #2d2d30;
    color: #e0e0e0;
    font-weight: 600;
    border-bottom: 1px solid #555;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mud-dialog.cw-project-dialog .mud-dialog-title .mud-dialog-close-button {
    color: #e0e0e0 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.mud-dialog.cw-project-dialog .mud-dialog-title .mud-dialog-close-button:hover {
    color: #ff6b6b !important;
}

.mud-dialog.cw-project-dialog .mud-dialog-content {
    background: #3a3a3d;
    overflow-y: auto;
    max-height: 60vh;
    padding: 0;
}

.mud-dialog.cw-project-dialog .mud-dialog-actions {
    background: #2d2d30;
    border-top: 1px solid #555;
}

/* ── Config dialog (shell) ─────────────────────────────────── */
.mud-dialog.cw-config-dialog {
    background: #3a3a3d;
    border: 2px solid #6a6a6e;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    max-height: 85vh;
    overflow: hidden;
    color: #e0e0e0;
    position: relative;
    z-index: 1500;
    pointer-events: auto;
}
.mud-dialog.cw-config-dialog * { pointer-events: auto; }

.mud-dialog.cw-config-dialog .mud-dialog-title {
    background: #2d2d30;
    color: #e0e0e0;
    font-weight: 600;
    border-bottom: 1px solid #555;
    padding: 12px 16px;
}
.mud-dialog.cw-config-dialog .mud-dialog-content {
    background: #3a3a3d;
    color: #e0e0e0;
    overflow-y: auto;
    max-height: 70vh;
    padding: 16px;
}
.mud-dialog.cw-config-dialog .mud-dialog-actions {
    background: #2d2d30;
    border-top: 1px solid #555;
}

/* ── TabControl estil WinForms ────────────────────────────── */
.cw-tabcontrol {
    display: flex;
    flex-direction: column;
}
.cw-tab-strip {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #666;
    padding: 0 4px;
}
.cw-tab-btn {
    background: #2d2d30;
    color: #999;
    border: 1px solid #555;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 6px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    position: relative;
    top: 2px;
    transition: background .15s, color .15s;
}
.cw-tab-btn:hover { background: #444; color: #ccc; }
.cw-tab-btn.active {
    background: #4a4a4e;
    color: #fff;
    border-color: #666;
    font-weight: 600;
    z-index: 1;
}
.cw-tab-page {
    background: #4a4a4e;
    border: 1px solid #666;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 16px;
    min-height: 300px;
}

/* ── Fieldset / GroupBox ──────────────────────────────────── */
.cw-config-dialog .cw-group {
    border: 1px solid #666;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 12px;
}
.cw-config-dialog .cw-group legend {
    color: #8cb4d8;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 6px;
}

/* ── Camps de formulari natius ────────────────────────────── */
.cw-config-dialog .cw-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
}
.cw-config-dialog .cw-field > span {
    color: #bbb;
    font-size: 0.78rem;
    margin-bottom: 2px;
}
.cw-config-dialog .cw-field > input,
.cw-config-dialog .cw-field > select {
    background: #5c5c60;
    color: #f0f0f0;
    border: 1px solid #777;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
}
.cw-config-dialog .cw-field > input:focus,
.cw-config-dialog .cw-field > select:focus {
    border-color: #64b5f6;
    box-shadow: 0 0 0 1px #64b5f680;
}
.cw-config-dialog .cw-field > input[readonly] {
    background: #505054;
    color: #ccc;
    cursor: default;
}

/* ── Checkbox natiu ───────────────────────────────────────── */
.cw-config-dialog .cw-native-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
}
.cw-config-dialog .cw-native-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #42a5f5;
    cursor: pointer;
}
.cw-config-dialog .cw-native-check span {
    color: #e0e0e0;
    font-size: 0.88rem;
    user-select: none;
}

.cw-project-create {
    appearance: none;
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
    border: 1px dashed #6c9bd2;
    background: rgba(55, 125, 190, .10);
}

.cw-project-create .cw-project-image {
    display: grid;
    place-items: center;
}

.cw-project-create .cw-project-image .material-icons { font-size: 54px; color: #6c9bd2; }
.cw-project-create-hint { margin-top: 4px; color: #888; font-size: .82rem; }
.cw-new-project-script { grid-column: 1 / -1; }
.cw-new-project-script textarea { min-height: 170px; resize: vertical; }

.cw-technical-dialog .mud-dialog-content { padding: 0 18px 18px; }
.cw-technical-toolbar { display: flex; align-items: center; gap: 16px; padding: 10px 0; }
.cw-technical-toolbar .cw-btn { display: inline-flex; align-items: center; gap: 6px; }
.cw-technical-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 155px); border: 1px solid var(--cw-border, #555); border-radius: 7px; overflow: hidden; }
.cw-technical-scenes { padding: 8px; overflow-y: auto; background: rgba(0,0,0,.16); border-right: 1px solid var(--cw-border, #555); }
.cw-technical-scene { width: 100%; display: grid; grid-template-columns: 32px 1fr; gap: 7px; align-items: start; padding: 9px; border: 0; border-radius: 5px; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.cw-technical-scene:hover, .cw-technical-scene.selected { background: rgba(80,145,210,.25); }
.cw-technical-scene span { overflow: hidden; text-overflow: ellipsis; }
.cw-technical-workspace { padding: 14px; overflow: auto; }
.cw-technical-scene-editor { margin-bottom: 12px; padding: 10px; border: 1px solid var(--cw-border, #555); border-radius: 6px; }
.cw-technical-scene-editor summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.cw-form-grid.three-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cw-form-grid .span-2 { grid-column: span 2; }
.cw-form-grid .span-3 { grid-column: 1 / -1; }
.cw-technical-plan-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cw-technical-plan-tabs { display: flex; gap: 5px; overflow-x: auto; }
.cw-technical-plan-tabs button { border: 1px solid #666; border-radius: 5px; padding: 6px 10px; background: transparent; color: inherit; cursor: pointer; white-space: nowrap; }
.cw-technical-plan-tabs button.selected { background: #3679b8; color: white; border-color: #3679b8; }
.cw-dialog-inline-actions { display: flex; gap: 8px; margin: 12px 0; }
.cw-btn-danger { background: #a83e3e; color: white; }
.cw-technical-lower-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; border-top: 1px solid #555; padding-top: 12px; }
.cw-subplan-row { display: grid; grid-template-columns: 64px 110px minmax(120px, 1fr) 36px 36px; gap: 6px; margin-bottom: 6px; }
.cw-subplan-row input { min-width: 0; }
.cw-icon-btn.danger { color: #ef6a6a; }
.cw-technical-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; margin-top: 10px; }
.cw-technical-images img { width: 100%; height: 90px; object-fit: cover; border-radius: 5px; border: 1px solid #666; }
@media (max-width: 900px) {
    .cw-technical-layout { grid-template-columns: 175px minmax(0, 1fr); }
    .cw-form-grid.three-cols, .cw-technical-lower-grid { grid-template-columns: 1fr; }
    .cw-form-grid .span-2, .cw-form-grid .span-3 { grid-column: auto; }
}

.cw-project-view-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 10px 14px 0;
}

.cw-project-view-toolbar .cw-icon-btn.active {
    color: #fff;
    background: #1976d2;
}

.cw-project-gallery.list-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cw-project-gallery.list-view .cw-project-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 66px;
}

.cw-project-gallery.list-view .cw-project-image { display: none; }
.cw-project-gallery.list-view .cw-project-info { padding: 12px 16px 4px; }
.cw-project-gallery.list-view .cw-project-actions { grid-column: 1 / -1; padding: 0 10px 9px; justify-content: flex-start; }

.cw-character-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1600;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .62);
}

.cw-character-dialog {
    width: min(480px, calc(100% - 32px));
    color: #e8e8e8;
    background: #3a3a3d;
    border: 2px solid #6a6a6e;
    border-radius: 10px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, .65);
    overflow: hidden;
}

.cw-character-title {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 16px;
    background: #2d2d30;
    border-bottom: 1px solid #555;
    font-weight: 600;
}

.cw-character-content { padding: 16px; }
.cw-character-content .cw-field { display: flex; flex-direction: column; margin-bottom: 10px; }
.cw-character-content .cw-field span { color: #bbb; font-size: .8rem; margin-bottom: 3px; }
.cw-character-content input { background: #5c5c60; color: #fff; border: 1px solid #777; border-radius: 3px; padding: 7px 9px; }
.cw-character-content input:focus { outline: 1px solid #64b5f6; border-color: #64b5f6; }
.cw-character-content .cw-form-row { display: flex; gap: 12px; }
.cw-character-content .cw-form-row > * { flex: 1; }
.cw-character-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; background: #2d2d30; border-top: 1px solid #555; }
.cw-character-error { color: #ff8a80; margin: 4px 0 0; }

.cw-session-status {
    margin-left: auto;
    padding: 0 12px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--cw-text, #222);
    white-space: nowrap;
}

.cw-app.dark .cw-session-status { color: #fff; }

.cw-demo-welcome { padding: 8px 4px 2px; }
.cw-demo-welcome h2 { margin: 10px 0 8px; font-size: 1.3rem; }
.cw-demo-welcome p { line-height: 1.5; }
.cw-demo-welcome ul { margin: 14px 0 0; padding-left: 22px; }
.cw-demo-welcome li { margin: 6px 0; }

/* ── Layouts de columnes ──────────────────────────────────── */
.cw-config-dialog .cw-form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.cw-config-dialog .cw-form-row > * {
    flex: 1;
    min-width: 120px;
}
.cw-config-dialog .cw-columns-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.cw-config-dialog .cw-columns-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* ── Botons globals de diàleg ──────────────────────────────── */
.cw-btn {
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: #555;
}
.cw-btn:hover { background: #666; }

/* Verd — accions: Guardar, Nou, Importar, Actualitzar */
.cw-btn-action  { background: #4caf50; color: #fff; }
.cw-btn-action:hover { background: #43a047; }

/* Carbassa — navegació: Sortir, Enrere, Tancar, Per defecte */
.cw-btn-nav     { background: #e8a735; color: #222; }
.cw-btn-nav:hover { background: #d4952e; }

/* Vermell — destructiu: Desactivar, Esborrar */
.cw-btn-danger  { background: #d32f2f; color: #fff; }
.cw-btn-danger:hover { background: #b71c1c; }

/* Botó petit */
.cw-btn-sm { padding: 3px 10px; font-size: 0.78rem; }

/* ── Color row (input + preview + button inline) ──────────── */
.cw-color-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cw-color-preview {
    display: inline-block;
    width: 32px;
    height: 22px;
    border: 1px solid #888;
    border-radius: 3px;
    flex-shrink: 0;
}
.cw-color-input {
    width: 90px;
    padding: 2px 4px;
    font-size: 0.82rem;
}
.cw-size-input {
    width: 50px;
    padding: 2px 4px;
    font-size: 0.82rem;
    text-align: center;
}

/* ── Taula d'estils ───────────────────────────────────────── */
.cw-style-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.cw-style-table th {
    text-align: left;
    padding: 4px 6px;
    border-bottom: 1px solid #666;
    color: #ccc;
    font-weight: 600;
    font-size: 0.78rem;
}
.cw-style-table td {
    padding: 3px 6px;
    border-bottom: 1px solid #444;
    vertical-align: middle;
}
.cw-style-table td.cw-center {
    text-align: center;
}
.cw-style-table input[type="text"],
.cw-style-table input[type="number"] {
    background: #2a2a2d;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
}

/* ── Layout disseny (taula + viewer) ──────────────────────── */
.cw-design-layout {
    display: flex;
    gap: 16px;
}
.cw-design-left {
    flex: 1;
    min-width: 0;
}
.cw-design-right {
    flex: 0 0 320px;
    min-height: 300px;
    background: #fff;
    border: 1px solid #888;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cw-viewer-placeholder {
    text-align: center;
    padding: 16px;
}

/* ── Color picker popup ───────────────────────────────────── */
.cw-color-picker-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cw-color-picker {
    background: #3a3a3d;
    border: 2px solid #6a6a6e;
    border-radius: 8px;
    padding: 16px;
    min-width: 340px;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    pointer-events: auto;
}
.cw-color-picker-title {
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 10px;
    font-size: 0.9rem;
}
.cw-color-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}
.cw-color-swatch {
    width: 32px;
    height: 24px;
    border: 1px solid #888;
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
}
.cw-color-swatch:hover {
    border: 2px solid #fff;
    transform: scale(1.15);
}
.cw-color-picker input[type="text"] {
    background: #2a2a2d;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* ══════════ DOCUMENT DIALOG ══════════ */
.mud-dialog.cw-document-dialog {
    position: relative;
    z-index: 1500;
    pointer-events: auto;
    background: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 6px;
    min-width: 700px;
    max-width: 900px;
}

.mud-dialog.cw-document-dialog *,
.mud-dialog.cw-document-dialog .ql-toolbar *,
.mud-dialog.cw-document-dialog .ql-editor {
    pointer-events: auto;
}

.mud-dialog.cw-document-dialog .mud-dialog-title {
    background: #2d2d30;
    color: #e0e0e0;
    padding: 8px 16px;
    font-size: 0.95rem;
}

.mud-dialog.cw-document-dialog .mud-dialog-content {
    background: #1e1e1e;
    padding: 12px 16px;
    overflow: visible;
}

.cw-document-dialog .cw-editor-container {
    min-height: 300px;
    margin-top: 8px;
    background: #fff;
    border-radius: 4px;
    position: relative;
    z-index: 10;
}

.cw-document-dialog .ql-toolbar {
    background: #f0f0f0;
    border-radius: 4px 4px 0 0;
    border: 1px solid #ccc;
    z-index: 11;
    position: relative;
}

.cw-document-dialog .ql-toolbar button,
.cw-document-dialog .ql-toolbar select {
    pointer-events: auto !important;
    cursor: pointer;
}

.cw-document-dialog .ql-container {
    min-height: 250px;
    font-family: 'Calibri', sans-serif;
    font-size: 11pt;
    border: 1px solid #ccc;
    border-top: none;
}

.cw-document-dialog .ql-editor {
    min-height: 250px;
    color: #000;
    background: #fff;
    cursor: text;
}

.cw-document-dialog .ql-editor.ql-blank::before {
    color: #999;
    font-style: italic;
}

/* ══════════ SIDEBAR SUBMENU ══════════ */
.cw-doc-submenu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1200;
    background: transparent;
}

.cw-doc-submenu {
    position: fixed;
    background: #fff;
    border: 1px solid #c8c8c8;
    border-radius: 4px;
    box-shadow: 2px 4px 12px rgba(0,0,0,0.6);
    z-index: 1201;
    min-width: 170px;
    padding: 4px 0;
}

.cw-submenu-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    color: #202124;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

.cw-submenu-item:hover {
    background: #e9eef5;
    color: #111;
}

/* ══════════ SINOPSI CURTA DIALOG ══════════ */
.mud-dialog.cw-sinopsi-dialog {
    position: relative;
    z-index: 1500;
    pointer-events: auto;
    background: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 6px;
    min-width: 800px;
    max-width: 1000px;
}

.mud-dialog.cw-sinopsi-dialog * {
    pointer-events: auto;
}

.mud-dialog.cw-sinopsi-dialog .mud-dialog-title {
    background: #2d2d30;
    color: #e0e0e0;
    padding: 8px 16px;
    font-size: 0.95rem;
}

.mud-dialog.cw-sinopsi-dialog .mud-dialog-content {
    background: #1e1e1e;
    padding: 12px 16px;
    overflow: visible;
}

.cw-sinopsi-dialog .cw-form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.cw-sinopsi-dialog .cw-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.cw-sinopsi-dialog .cw-field > span {
    color: #bbb;
    font-size: 0.78rem;
    margin-bottom: 2px;
}

.cw-sinopsi-dialog .cw-field > input,
.cw-sinopsi-dialog .cw-field > select,
.cw-sinopsi-dialog .cw-field > textarea {
    background: #2a2a2d;
    color: #f0f0f0;
    border: 1px solid #666;
    border-radius: 3px;
    padding: 6px 8px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
}

.cw-sinopsi-dialog .cw-field > input:focus,
.cw-sinopsi-dialog .cw-field > select:focus,
.cw-sinopsi-dialog .cw-field > textarea:focus {
    border-color: #64b5f6;
    box-shadow: 0 0 0 1px #64b5f680;
}

.cw-sinopsi-dialog .cw-frase-field {
    margin-top: 8px;
}

.cw-sinopsi-dialog .cw-frase-input {
    min-height: 110px;
    resize: vertical;
}

.cw-sinopsi-dialog .cw-quill-wrapper {
    margin-top: 8px;
    background: #fff;
    border-radius: 4px;
    min-height: 300px;
    position: relative;
    z-index: 10;
}

.cw-sinopsi-dialog .ql-toolbar {
    background: #f0f0f0;
    border-radius: 4px 4px 0 0;
    border: 1px solid #ccc;
    z-index: 11;
    position: relative;
}

.cw-sinopsi-dialog .ql-toolbar button,
.cw-sinopsi-dialog .ql-toolbar select,
.cw-sinopsi-dialog .ql-toolbar .ql-picker {
    pointer-events: auto !important;
    cursor: pointer;
}

.cw-sinopsi-dialog .ql-container {
    min-height: 250px;
    font-family: 'Calibri', sans-serif;
    font-size: 11pt;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.cw-sinopsi-dialog .ql-editor {
    min-height: 250px;
    color: #000;
    background: #fff;
    cursor: text;
}

.cw-sinopsi-dialog .ql-editor.ql-blank::before {
    color: #999;
    font-style: italic;
}

/* L'editor actual és contenteditable propi, no Quill. Aquesta regla redueix
   realment Sinopsi i Tractament 100 px respecte dels 540 px generals. */
.mud-dialog.cw-sinopsi-dialog .rich-editor-content {
    min-height: 440px;
    max-height: 440px;
}

/* ── Diàlegs d'Utilitats ── */
.mud-dialog.cw-utility-dialog,
.mud-dialog.cw-localization-dialog { max-width: 1120px; }

.cw-utility-layout {
    display: grid;
    grid-template-columns: minmax(245px, .75fr) minmax(420px, 1.7fr);
    gap: 14px;
    min-height: 410px;
}
.cw-utility-list-panel,
.cw-utility-detail-panel {
    border: 1px solid #666;
    border-radius: 5px;
    background: #444448;
    padding: 10px;
    overflow: auto;
}
.cw-utility-panel-title { color: #8cb4d8; font-weight: 600; margin-bottom: 8px; }
.cw-utility-row {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    text-align: left;
    padding: 9px 10px;
    margin-bottom: 5px;
    background: #353538;
    color: #e6e6e6;
    border: 1px solid #5b5b60;
    border-radius: 4px;
    cursor: pointer;
}
.cw-utility-row small { grid-column: 2; color: #aaa; }
.cw-utility-row:hover { background: #4c4c51; }
.cw-utility-row.selected { border-color: #64b5f6; background: #3d5366; }
.cw-utility-number { color: #8cb4d8; font-weight: 700; }
.cw-utility-empty { color: #aaa; padding: 18px 10px; text-align: center; }
.cw-utility-preview textarea { min-height: 300px; resize: vertical; font-family: "Courier New", monospace; }
.cw-utility-create { margin-top: 14px; }

.cw-localization-filters .cw-field { min-width: 240px; }
.cw-localization-grid {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(380px, 2fr) auto;
    gap: 7px;
    align-items: center;
    max-height: 52vh;
    overflow-y: auto;
    padding: 10px;
    background: #444448;
    border: 1px solid #666;
    border-radius: 5px;
}
.cw-localization-grid input {
    width: 100%;
    background: #5c5c60;
    color: #f0f0f0;
    border: 1px solid #777;
    border-radius: 3px;
    padding: 6px 8px;
}
.cw-localization-grid input[readonly] { background: #505054; color: #ccc; }
.cw-localization-header { color: #8cb4d8; font-weight: 600; }
.cw-localization-new { margin-top: 14px; }

@media (max-width: 760px) {
    .cw-utility-layout { grid-template-columns: 1fr; }
    .cw-localization-grid { grid-template-columns: 1fr; }
}

/* ══════════ IMPORT / EXPORT DIALOG ══════════ */
.mud-dialog.cw-import-export-dialog {
    position: relative;
    z-index: 1500;
    pointer-events: auto;
    background: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 6px;
    min-width: 780px;
    max-width: 1000px;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
}

.mud-dialog.cw-import-export-dialog * {
    pointer-events: auto;
}

.mud-dialog.cw-import-export-dialog .mud-dialog-title {
    background: #2d2d30;
    color: #e0e0e0;
    padding: 8px 16px;
    font-size: 0.95rem;
    border-bottom: 1px solid #444;
}

.mud-dialog.cw-import-export-dialog .mud-dialog-content {
    background: #1e1e1e;
    color: #e0e0e0;
    padding: 12px 16px;
    overflow: visible;
}

.cw-import-export-dialog .cw-form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.cw-import-export-dialog .cw-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.cw-import-export-dialog .cw-field > span {
    color: #bbb;
    font-size: 0.78rem;
    margin-bottom: 2px;
}

.cw-import-export-dialog .cw-field > input,
.cw-import-export-dialog .cw-field > select,
.cw-import-export-dialog .cw-field > textarea {
    background: #2a2a2d;
    color: #f0f0f0;
    border: 1px solid #666;
    border-radius: 3px;
    padding: 6px 8px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
}

.cw-import-export-dialog .cw-field > input:focus,
.cw-import-export-dialog .cw-field > select:focus,
.cw-import-export-dialog .cw-field > textarea:focus {
    border-color: #64b5f6;
    box-shadow: 0 0 0 1px #64b5f680;
}

.cw-import-export-dialog .cw-field > textarea {
    resize: vertical;
    white-space: pre-wrap;
}

.cw-import-export-dialog .cw-export-summary {
    background: #2a2a2d;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 12px;
    line-height: 1.7;
    min-height: 120px;
}

.cw-import-export-dialog .cw-export-help {
    margin-top: 10px;
    color: #c8d8f0;
}

.cw-import-export-dialog input[type="file"] {
    cursor: pointer;
}

.cw-import-export-dialog .cw-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* Gestió de plans, reproducció funcional de la finestra Avant. */
.mud-dialog.cw-technical-avant-dialog {
    position: relative;
    z-index: 1500;
    pointer-events: auto;
}

.mud-dialog.cw-technical-avant-dialog * {
    pointer-events: auto;
}

.cw-technical-avant-dialog .mud-dialog-content{padding:0!important;overflow:hidden}.cw-tech-shell{position:relative;display:grid;grid-template-columns:minmax(760px,3.35fr) minmax(300px,1fr);height:calc(100vh - 64px);min-height:620px;background:#111421;color:#f4f5f8}.cw-tech-main{min-width:0;display:grid;grid-template-rows:auto auto minmax(0,1fr);padding:14px 16px 16px;border-right:4px solid #0a0d17}.cw-tech-header{background:#232632;padding:10px 14px 8px}.cw-tech-project{display:flex;align-items:center;gap:28px;margin-bottom:10px;font-size:.95rem}.cw-tech-project span,.cw-tech-search-row label,.cw-tech-scene-row label{color:#d8e4ff;font-size:.77rem}.cw-tech-project strong{font-size:1rem}.cw-tech-search-row,.cw-tech-scene-row{display:flex;align-items:center;gap:10px;min-width:0}.cw-tech-search-row{margin-bottom:8px}.cw-tech-search-row select,.cw-tech-scene-row input{height:30px;border:1px solid #4a4e5d;border-radius:5px;background:#3a3d47;color:#fff;padding:0 10px}.cw-tech-search-row select:first-of-type{width:300px;max-width:36%}.cw-tech-search-row select:nth-of-type(2){width:150px}.cw-tech-scene-row input{width:90px}.cw-tech-scene-row input.number{width:40px}.cw-tech-scene-row input.location{flex:1;min-width:130px}.cw-tech-scene-row .spacer{flex:1}.cw-tech-navigation{display:flex;gap:7px;margin-left:10px}.cw-tech-navigation button{width:36px;height:28px;border:0;background:#343845;color:#fff;cursor:pointer}.cw-tech-btn{min-width:94px;height:30px;padding:0 14px;border:0;border-radius:6px;color:#fff;font-weight:700;cursor:pointer}.cw-tech-btn:disabled,.cw-tech-btn.disabled{opacity:.4;cursor:default}.cw-tech-btn.cyan{background:#31a9c2}.cw-tech-btn.green{background:#3ab250}.cw-tech-btn.red{background:#df3348}.cw-tech-btn.amber{background:#f5ad35;color:#111}.cw-tech-plan-actions{display:flex;gap:10px;padding:10px 12px;margin-top:9px;background:#272a37}.cw-tech-grid-wrap{min-height:0;margin-top:7px;overflow:auto;background:#fffdeb;border:1px solid #575b69}.cw-tech-grid{width:100%;border-collapse:collapse;color:#111;font-size:.74rem;background:#fffdeb}.cw-tech-grid th{position:sticky;top:0;z-index:1;background:#fff;font-weight:400;text-align:left;white-space:nowrap}.cw-tech-grid th,.cw-tech-grid td{min-width:80px;padding:7px 8px;border-right:1px solid #777;border-bottom:1px solid #bbb}.cw-tech-grid th:nth-child(3),.cw-tech-grid td:nth-child(3){min-width:250px}.cw-tech-grid th:first-child,.cw-tech-grid td:first-child{min-width:28px;width:28px}.cw-tech-grid tbody tr{cursor:pointer}.cw-tech-grid tbody tr:hover{background:#f2edcf}.cw-tech-grid tbody tr.selected{background:#cde6ff}.cw-tech-grid .selector{font-size:1.2rem;font-weight:800}
.cw-tech-side{min-width:0;display:grid;grid-template-rows:minmax(190px,1fr) 135px 92px minmax(220px,1.45fr);gap:7px;padding:0 7px 7px 10px;background:#f5f5f5;color:#111}.cw-tech-side section{min-height:0;display:flex;flex-direction:column}.cw-tech-section-title{min-height:36px;display:flex;align-items:center;gap:10px;padding:4px;background:#202330;color:#78b5ff;font-weight:700}.cw-tech-section-title>span{margin-right:auto}.cw-tech-section-title .cw-tech-btn{min-width:60px;height:24px;padding:0 10px;font-size:.72rem}.cw-tech-script-paper{flex:1;overflow:auto;padding:18px 10px;background:#fff;font-family:"Courier New",monospace;font-size:.78rem;line-height:1.35}.cw-tech-paragraph{margin:0 0 9px;white-space:pre-wrap}.cw-tech-paragraph.character{margin-left:38%;text-transform:uppercase}.cw-tech-paragraph.dialogue{margin-left:20%;margin-right:13%}.cw-tech-paragraph.parenthetical{margin-left:28%;margin-right:18%}.cw-tech-paragraph.transition{text-align:right;text-transform:uppercase}.cw-tech-paragraph.shot{font-weight:700;text-transform:uppercase}.cw-tech-paragraph.comment{color:#64748b;font-style:italic}.cw-tech-paragraph.episode{font-weight:700;text-align:center}.cw-tech-image-list{flex:1;overflow:auto;padding:5px;background:#171a26}.cw-tech-image-list button{display:block;width:100%;padding:6px 8px;border:0;background:transparent;color:#fff;text-align:left;cursor:pointer}.cw-tech-image-list button.selected{background:#2c75a8}.cw-tech-description-panel textarea{flex:1;min-height:0;resize:none;border:0;padding:7px;font:inherit}.cw-tech-preview-panel h4{margin:0;padding:3px 4px 9px;color:#78b5ff}.cw-tech-preview{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#d3b184}.cw-tech-preview img{width:100%;height:100%;object-fit:contain}.file-button{display:inline-flex;align-items:center;justify-content:center}.file-button input{display:none}.cw-tech-busy{position:absolute;inset:0;display:grid;place-items:center;background:rgba(10,13,23,.45);z-index:20}@media(max-width:1100px){.cw-tech-shell{grid-template-columns:minmax(650px,2.5fr) minmax(270px,1fr)}.cw-tech-btn{min-width:78px;padding:0 8px}.cw-tech-search-row select:first-of-type{width:240px}}

/* Dimensions fixes del diàleg tècnic: el nombre de plans no pot modificar l'alçada de la pantalla. */
.mud-dialog.cw-technical-avant-dialog {
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
}

.cw-technical-avant-dialog .mud-dialog-content {
    height: 100% !important;
    max-height: none !important;
}

.cw-tech-shell {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.cw-tech-main {
    min-height: 0;
    overflow: hidden;
    grid-template-rows: auto auto 600px;
}

.cw-tech-grid-wrap {
    height: 600px;
    max-height: 600px;
    overflow: auto;
}

.cw-tech-side {
    grid-template-rows: 220px 105px 80px 300px;
    height: 100%;
    overflow-y: auto;
}

.cw-tech-script-paper {
    height: 184px;
    max-height: 184px;
    flex: 0 0 184px;
}

.cw-tech-image-list {
    min-height: 0;
}

.cw-tech-preview-panel {
    min-height: 300px !important;
    height: 300px;
}

.cw-tech-preview {
    height: 260px;
    flex: 0 0 260px;
}

/* Panells laterals del guió tècnic: regles explícites per mantenir les alçades. */
.cw-tech-scene-text {
    height: 220px;
    min-height: 220px;
    max-height: 220px;
    overflow: hidden;
}

.cw-tech-images-panel {
    height: 105px;
    min-height: 105px;
    max-height: 105px;
    overflow: hidden;
}

.cw-tech-description-panel {
    height: 80px;
    min-height: 80px;
    max-height: 80px;
    overflow: hidden;
}

.cw-tech-preview-panel {
    height: 300px;
    min-height: 300px !important;
    max-height: 300px;
    overflow: hidden;
}

.cw-tech-scene-text .cw-tech-section-title,
.cw-tech-images-panel .cw-tech-section-title,
.cw-tech-description-panel .cw-tech-section-title {
    height: 28px;
    min-height: 28px;
}

.cw-tech-scene-text .cw-tech-script-paper {
    height: 192px;
    min-height: 0;
    max-height: 192px;
    overflow: auto;
}

.cw-tech-images-panel .cw-tech-image-list,
.cw-tech-description-panel textarea {
    min-height: 0;
    overflow: auto;
}

@media (max-height: 850px) {
    .cw-tech-main {
        grid-template-rows: auto auto minmax(420px, 1fr);
        overflow-y: auto;
    }

    .cw-tech-grid-wrap {
        height: auto;
        max-height: none;
    }
}

/* Ajust final de densitat del guió tècnic. El viewport el gestiona FullScreen de MudBlazor,
   igual que l’Storyboard: no s’ha de reposicionar el contenidor del diàleg manualment. */

.cw-tech-main {
    padding: 10px 12px 12px;
}

.cw-tech-header {
    padding: 7px 10px 6px;
}

.cw-tech-project {
    gap: 20px;
    margin-bottom: 7px;
    font-size: .82rem;
}

.cw-tech-project span,
.cw-tech-search-row label,
.cw-tech-scene-row label {
    font-size: .68rem;
}

.cw-tech-search-row,
.cw-tech-scene-row {
    gap: 7px;
}

.cw-tech-search-row {
    margin-bottom: 6px;
}

.cw-tech-search-row select,
.cw-tech-scene-row input {
    height: 24px !important;
    padding: 0 7px !important;
    font-size: .72rem !important;
}

.cw-tech-search-row select:first-of-type {
    width: 225px;
}

.cw-tech-search-row select:nth-of-type(2) {
    width: 112px;
}

.cw-tech-scene-row input {
    width: 68px;
}

.cw-tech-scene-row input.number {
    width: 30px;
}

.cw-tech-navigation {
    gap: 5px;
    margin-left: 7px;
}

.cw-tech-navigation button {
    width: 27px;
    height: 23px;
}

.cw-tech-btn {
    min-width: 70px !important;
    height: 24px !important;
    padding: 0 10px !important;
    font-size: .72rem !important;
}

.cw-tech-plan-actions {
    gap: 7px;
    padding: 7px 9px;
    margin-top: 6px;
}

.cw-tech-grid-wrap {
    margin-top: 5px;
}

.cw-tech-grid {
    font-size: .65rem;
}

.cw-tech-grid th,
.cw-tech-grid td {
    min-width: 60px !important;
    padding: 5px 6px !important;
}

.cw-tech-grid th:nth-child(3),
.cw-tech-grid td:nth-child(3) {
    min-width: 188px;
}

.cw-tech-grid th:first-child,
.cw-tech-grid td:first-child {
    min-width: 21px;
    width: 21px;
}

/* Mateix model de diàleg que Storyboard. */
.mud-dialog.cw-technical-avant-dialog {
    position: relative !important;
    z-index: 1500;
    pointer-events: auto;
    background: #20232d;
    color: #f2f4f8;
}

.cw-technical-avant-dialog > .mud-dialog-title {
    flex: 0 0 auto;
    padding: 7px 14px !important;
}

.cw-technical-avant-dialog > .mud-dialog-content {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.cw-technical-avant-dialog .cw-tech-shell {
    height: calc(100vh - 64px) !important;
    min-height: 620px !important;
}

.cw-technical-avant-dialog .cw-tech-main {
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
}

.cw-technical-avant-dialog .cw-tech-grid-wrap {
    height: auto;
    max-height: none;
    min-height: 0;
}

.cw-technical-avant-dialog .cw-tech-side {
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(170px, 1fr) 105px 80px minmax(230px, 1.35fr);
    overflow: hidden;
}

/* Mateix tractament visual que els camps de Configuració General. */
.cw-technical-avant-dialog .cw-tech-search-row select {
    box-sizing: border-box;
    height: 28px !important;
    padding: 4px 8px !important;
    border: 1px solid #777 !important;
    border-radius: 3px !important;
    outline: none;
    background: #5c5c60 !important;
    color: #f0f0f0 !important;
    font-family: inherit;
    font-size: .78rem !important;
    color-scheme: dark;
}

.cw-technical-avant-dialog .cw-tech-search-row select:focus {
    border-color: #64b5f6 !important;
    box-shadow: 0 0 0 1px #64b5f680;
}

/* Graella compacta: files baixes, columnes controlades i text truncat. */
.cw-technical-avant-dialog .cw-tech-grid {
    width: 100%;
    min-width: 930px;
    table-layout: fixed;
    font-size: .63rem;
    line-height: 1.1;
}

.cw-technical-avant-dialog .cw-tech-grid th,
.cw-technical-avant-dialog .cw-tech-grid td {
    box-sizing: border-box;
    min-width: 0 !important;
    height: 23px;
    padding: 2px 4px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-technical-avant-dialog .cw-tech-grid th:nth-child(1),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(1) { width: 20px !important; }
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(2),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(2) { width: 52px; }
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(3),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(3) { width: 145px; min-width: 0 !important; }
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(4),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(4) { width: 68px; }
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(5),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(5) { width: 90px; }
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(6),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(6) { width: 100px; }
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(7),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(7) { width: 60px; }
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(8),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(8) { width: 55px; }
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(9),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(9),
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(10),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(10) { width: 95px; }
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(11),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(11) { width: 42px; text-align: center; }
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(12),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(12) { width: 36px; text-align: center; }
.cw-technical-avant-dialog .cw-tech-grid th:nth-child(13),
.cw-technical-avant-dialog .cw-tech-grid td:nth-child(13) { width: 72px; }

/* Storyboard */
.mud-dialog.cw-storyboard-dialog{position:relative;z-index:1500;pointer-events:auto;background:#20232d;color:#f2f4f8}
.mud-dialog.cw-storyboard-dialog *{pointer-events:auto}
.cw-storyboard-dialog .mud-dialog-content{padding:0!important;overflow:hidden}
.cw-stb-shell{display:grid;grid-template-rows:auto auto minmax(0,1fr);height:calc(100vh - 64px);min-height:620px;background:#171a24}
.cw-stb-toolbar,.cw-stb-navigation{display:flex;align-items:center;gap:12px;padding:10px 16px;background:#252936;border-bottom:1px solid #424755}
.cw-stb-choice{display:flex;align-items:center;gap:5px}.cw-stb-choice>span{margin-right:5px;color:#b8c4d8;font-size:.82rem}
.cw-stb-choice button,.cw-stb-navigation button{height:32px;border:1px solid #51586a;border-radius:5px;background:#343947;color:#e8ebf2;padding:0 12px;cursor:pointer}
.cw-stb-choice button.selected{background:#2b83c6;border-color:#55a9e8;color:#fff}.cw-stb-spacer{flex:1}
.cw-stb-toolbar .cw-btn{display:inline-flex;align-items:center;gap:6px}.cw-stb-toolbar .material-icons{font-size:18px}
.cw-stb-navigation{background:#1f222c;padding-block:8px}.cw-stb-navigation select{flex:1;max-width:900px;height:34px;border:1px solid #565d6f;border-radius:5px;background:#343947;color:#fff;padding:0 10px}.cw-stb-counter{min-width:70px;color:#aeb9ca;text-align:center}
.cw-stb-content{min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:14px;padding:14px}
.cw-stb-card{min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden;border:1px solid #414758;border-radius:7px;background:#10131a}
.cw-stb-image{min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#0c0f15}.cw-stb-image img{width:100%;height:100%;object-fit:contain}
.cw-stb-empty{display:flex;flex-direction:column;align-items:center;gap:10px;color:#778194}.cw-stb-empty .material-icons{font-size:64px}
.cw-stb-caption{max-height:190px;overflow:auto;padding:13px 17px;background:#f2ead8;color:#24211d}.cw-stb-caption h3{margin:0 0 7px;font-size:1rem}.cw-stb-caption p{margin:0;white-space:pre-wrap;line-height:1.35}
.cw-stb-controls{display:flex;flex-direction:column;gap:12px;padding:18px;border:1px solid #414758;border-radius:7px;background:#252936}.cw-stb-controls h3{margin:0;font-size:1.05rem}.cw-stb-help{margin:0;color:#aeb9ca;font-size:.82rem;line-height:1.35}.cw-stb-controls label{display:flex;flex-direction:column;gap:6px}.cw-stb-controls textarea{width:100%;resize:vertical;min-height:150px;border:1px solid #5a6275;border-radius:5px;background:#171a24;color:#fff;padding:9px}.cw-stb-controls .cw-btn{display:flex;align-items:center;justify-content:center;gap:7px}.cw-stb-generate{min-height:44px}.cw-stb-controls small{color:#aeb9ca}
.cw-stb-busy{position:absolute;inset:0;z-index:30;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:rgba(10,12,18,.78);color:#fff}
@media(max-width:900px){.cw-stb-toolbar{flex-wrap:wrap}.cw-stb-content{grid-template-columns:1fr;overflow:auto}.cw-stb-card{min-height:520px}.cw-stb-controls{min-height:360px}}
