/* Design tokens */
:root {
    color-scheme: light;
    --bg-body: #f5f7fb;
    --bg-surface: #ffffff;
    --bg-surface-alt: #eef2ff;
    --text-primary: #0f172a;
    --text-secondary: #4b5563;
    --border-muted: #e5e7eb;
    --border-strong: #cbd5e1;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --warning: #f59e0b;
    --danger: #dc2626;
    --success: #16a34a;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.06);
    --shadow-strong: 0 20px 50px rgba(0,0,0,0.12);
    --sidebar-bg-start: #0d1b2a;
    --sidebar-bg-end: #0f2740;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg-body: #0c1220;
    --bg-surface: #10192c;
    --bg-surface-alt: #14213d;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --border-muted: #1f2937;
    --border-strong: #334155;
    --accent: #60a5fa;
    --accent-strong: #3b82f6;
    --warning: #fbbf24;
    --danger: #f87171;
    --success: #34d399;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.4);
    --shadow-strong: 0 20px 50px rgba(0,0,0,0.6);
    --sidebar-bg-start: #0a0f1c;
    --sidebar-bg-end: #0b1729;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
}

.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg-body);
}

.app-main {
    flex: 1;
    margin-left: 240px;
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 54px;
    background: linear-gradient(90deg, var(--sidebar-bg-start) 0%, #123459 80%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1001;
}

.language-switcher select {
    min-width: 120px;
}

.content-area {
    flex: 1;
}

.card,
.modal-content,
.list-group-item {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-muted);
}

.form-control,
.form-select {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-muted);
}

.form-control:focus,
.form-select:focus,
.btn:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: none;
}

.prompt-card {
    border: 1px solid var(--border-muted);
    background: var(--bg-surface);
}

.prompt-accordion {
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: 10px;
    background: var(--bg-surface);
}

.prompt-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-muted);
    border-radius: 10px;
    padding: 12px 14px;
}

.prompt-panel__header {
    border-bottom: 1px dashed #e5e7eb;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.prompt-snippet {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 720px;
}

.prompt-pre {
    white-space: pre-wrap;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.95rem;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.prompt-form {
    border-top: none;
    padding-top: 0;
    margin-bottom: 0;
}

.prompt-groups {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.prompt-category-card {
    border: 1px solid var(--border-muted);
    border-radius: 16px;
    background: var(--bg-surface);
    padding: 18px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.prompt-category-card__header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}

.prompt-category-card__list {
    margin-top: 1rem;
}

.prompt-category-card.is-collapsed .prompt-category-card__list {
    display: none;
}

.prompt-category-toggle {
    min-width: 100px;
}

.prompt-category-card__list .card {
    border-color: #e5e7eb;
}

.prompt-row {
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    background: var(--bg-surface-alt);
}

.prompt-row__meta {
    min-width: 0;
}

.prompt-row__actions .btn {
    min-width: 90px;
}

.prompt-row__actions form .btn {
    min-width: 90px;
    width: 100%;
}

.prompt-inline-edit {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

.prompt-add-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
}

.prompt-add-card .card-body {
    background: transparent;
    padding: 16px;
}

.prompt-view-switch .btn.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.prompt-views {
    position: relative;
}

.prompt-view {
    display: none;
    transition: opacity 0.2s ease;
}

.prompt-view.is-active {
    display: block;
}

.prompt-order-row {
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    background: var(--bg-surface);
}

.projects-hero {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 20% 20%, rgba(111, 170, 255, 0.35), transparent 35%),
                radial-gradient(circle at 80% 0%, rgba(108, 99, 255, 0.35), transparent 30%),
                linear-gradient(135deg, #0d1b2a 0%, #142c44 50%, #1b3e61 100%);
    border-radius: 18px;
    padding: 28px 26px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(15, 30, 50, 0.25);
}

.projects-hero__content {
    max-width: 540px;
    position: relative;
    z-index: 2;
}

.projects-hero__bento {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 18px;
    position: relative;
    z-index: 2;
}

.projects-hero__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(255,255,255,0.18), transparent 50%);
    filter: blur(20px);
    z-index: 1;
}

.bento-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
    backdrop-filter: blur(6px);
}

.bento-card.glassy {
    background: rgba(255, 255, 255, 0.12);
}

.bento-card.muted {
    background: rgba(255, 255, 255, 0.08);
}

.bento-card.outline {
    background: rgba(255, 255, 255, 0.04);
}

.bento-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.opacity-85 {
    opacity: 0.85;
}

.project-card {
    display: block;
    padding: 18px 16px;
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0,0,0,0.08);
    border-color: #c7d2fe;
}

.project-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #312e81;
    font-weight: 600;
    font-size: 0.9rem;
}

.project-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #34d399, #0ea5e9);
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12);
}

.project-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.9rem;
    border: 1px solid #e5e7eb;
}

.chat-messages {
    height: 250px;
    overflow-y: auto;
    background: #fff;
}

.prompt-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 16px;
    background: #eef2ff;
    color: #1b2a4a;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    position: relative;
}

.prompt-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.shot-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.shot-version-row {
    background: #f8fafc;
}

.reference-item img {
    max-height: 150px;
    object-fit: cover;
    width: 100%;
}

.timeline-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    background: #f8fafc;
}

.timeline-panel {
    border-top: 1px dashed #d1d5db;
    padding-top: 10px;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
    cursor: grab;
}

.timeline-item.dragging {
    opacity: 0.7;
    border-color: #c7d2fe;
}

.timeline-strip {
    display: flex;
    gap: 6px;
    align-items: center;
    min-height: 34px;
}

.clip-block {
    background: linear-gradient(135deg, #e0f2fe, #cbd5e1);
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 70px;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.clip-label {
    font-weight: 700;
    font-size: 0.9rem;
}

.timeline-track-main {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    overflow-x: auto;
    padding: 6px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    background: #f8fafc;
}

.clip-segment {
    position: relative;
    min-width: 90px;
    max-width: 100%;
    flex: 0 0 auto;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    background: linear-gradient(135deg, #e0f2fe, #cbd5e1);
    cursor: grab;
    padding: 8px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.clip-segment.dragging {
    opacity: 0.7;
    border-color: #818cf8;
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.clip-segment.used-in-cut {
    border: 2px solid #22c55e;
    box-shadow: 0 6px 14px rgba(34,197,94,0.2);
}

.clip-segment.alternative {
    border: 2px solid #3b82f6;
    box-shadow: 0 6px 14px rgba(59,130,246,0.2);
}

.clip-segment.unset {
    border: 2px solid #ef4444;
    box-shadow: 0 6px 14px rgba(239,68,68,0.2);
}

.clip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 6px;
}

.clip-body {
    position: relative;
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
    min-height: 80px;
}

.clip-thumb {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.clip-thumb-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

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

.clip-filename {
    max-width: 55%;
}

.js-shot-timeline-clip.is-hidden {
    display: none;
}

.clip-state-group .btn {
    padding: 2px 6px;
    line-height: 1.1;
    font-size: 0.75rem;
}

.clip-state-group .btn-check:checked + .btn {
    color: #fff;
}

.clip-handle {
    position: absolute;
    top: 0;
    width: 8px;
    height: 100%;
    background: rgba(255,255,255,0.4);
    cursor: ew-resize;
    touch-action: none;
    user-select: none;
}

.clip-handle-left {
    left: 0;
    border-left: 3px solid #0ea5e9;
}

.clip-handle-right {
    right: 0;
    border-right: 3px solid #0ea5e9;
}

.preview-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

.timeline-track {
    position: relative;
    padding: 6px 0;
}

.timeline-range {
    width: 100%;
}

.prompt-chip .prompt-badge {
    background: #0d6efd;
    color: #fff;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.75rem;
}

.prompt-tooltip {
    position: absolute;
    left: 0;
    top: 125%;
    z-index: 10;
    min-width: 260px;
    max-width: 520px;
    background: #111827;
    color: #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.85rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
    white-space: pre-wrap;
}

.prompt-chip:hover .prompt-tooltip {
    opacity: 1;
    pointer-events: auto;
}

.prompt-copy {
    margin-left: auto;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.prompt-collapse {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    background: #f8fafc;
}

.prompt-body {
    border: 1px dashed #d7dce3;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
}

.prompt-body.is-collapsed {
    display: none;
}

.prompt-text {
    white-space: pre-wrap;
    line-height: 1.45;
}

.asset-video-preview {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #000;
}

.sidebar {
    width: 240px;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    color: #e5e7eb;
    padding: 24px 18px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1002;
    overflow-y: auto;
    scrollbar-width: thin;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px 10px 16px;
    margin-bottom: 6px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sidebar .nav-link .sidebar-indicator {
    width: 4px;
    height: 24px;
    border-radius: 8px;
    background: transparent;
    position: absolute;
    left: 4px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    outline: 2px solid rgba(255, 255, 255, 0.15);
    outline-offset: 2px;
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 600;
}

.sidebar .nav-link.active .sidebar-indicator {
    background: var(--accent);
}

.sidebar-brand {
    color: #fff;
}

.sidebar .brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.content-area {
    min-height: 100vh;
}

.sidebar-section {
    margin-bottom: 1rem;
}

.sidebar-section-header {
    padding: 10px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sidebar-section-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-subheader {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 8px 2px;
    color: #9ca3af;
}

.sidebar-submenu .nav-link {
    padding-left: 12px;
}

.sidebar-collapse {
    display: none;
}

.sidebar-collapse.show {
    display: block;
}

.caret {
    font-size: 0.8rem;
    opacity: 0.8;
}

.nav-link.tiny {
    font-size: 0.78rem;
    padding-top: 4px;
    padding-bottom: 4px;
}

.topbar .btn,
.topbar .form-select {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.topbar .btn:hover,
.topbar .form-select:focus {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
}

.toast-container {
    z-index: 1100;
}

.reduced-motion * {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
}

.command-palette-list .list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.command-palette-list .list-group-item.active,
.command-palette-list .list-group-item:hover {
    background: var(--bg-surface-alt);
    border-color: var(--border-strong);
}

.app-shell.sidebar-open .sidebar {
    left: 0;
}

@media (max-width: 992px) {
    .app-main {
        margin-left: 0;
    }
    .sidebar {
        transform: translateX(-260px);
        transition: transform 0.2s ease;
    }
    .app-shell.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    }
    .content-area {
        padding-top: 1.25rem;
    }
}

.shot-board {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 12px;
    align-items: start;
}

@media (max-width: 992px) {
    .shot-board {
        grid-template-columns: 1fr;
    }
}

.shot-board-exposes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shot-board-master {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shot-board-image-wrap {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

.shot-board-image-wrap--expose {
    border: 4px solid #ef4444;
}

.shot-board-image-wrap--master {
    border: 4px solid #22c55e;
}

.shot-board-image-wrap--setting {
    border: 4px solid #ec4899;
}

.shot-board-placeholder {
    display: grid;
    place-items: center;
    min-height: 240px;
    background: #f8fafc;
}

.shot-board-media {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    background: #0b1220;
}

.shot-board-scene-text {
    border: 4px solid #3b82f6;
    border-radius: 12px;
    background: #dbeafe;
    padding: 12px 14px;
    font-weight: 600;
    white-space: pre-wrap;
    color: #0f172a;
}

.character-expose-card {
    border-color: #dc2626 !important;
}

.scene-image-card {
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.scene-image-card img {
    max-height: 150px;
    object-fit: cover;
}
/* Design tokens */
:root {
    color-scheme: light;
    --bg-body: #f5f7fb;
    --bg-surface: #ffffff;
    --bg-surface-alt: #eef2ff;
    --text-primary: #0f172a;
    --text-secondary: #4b5563;
    --border-muted: #e5e7eb;
    --border-strong: #cbd5e1;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --warning: #f59e0b;
    --danger: #dc2626;
    --success: #16a34a;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.06);
    --shadow-strong: 0 20px 50px rgba(0,0,0,0.12);
    --sidebar-bg-start: #0d1b2a;
    --sidebar-bg-end: #0f2740;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg-body: #0c1220;
    --bg-surface: #10192c;
    --bg-surface-alt: #14213d;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --border-muted: #1f2937;
    --border-strong: #334155;
    --accent: #60a5fa;
    --accent-strong: #3b82f6;
    --warning: #fbbf24;
    --danger: #f87171;
    --success: #34d399;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.4);
    --shadow-strong: 0 20px 50px rgba(0,0,0,0.6);
    --sidebar-bg-start: #0a0f1c;
    --sidebar-bg-end: #0b1729;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
}
