*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #FAFAF8;
    --surface: #FFFFFF;
    --surface-hover: #F0EEEA;
    --border: #E0DDD6;
    --text: #1A1A1A;
    --text-muted: #6B6760;
    --accent: #1A1A1A;
    --accent-hover: #333333;
    --danger: #c0392b;
    --radius: 10px;
    --form-w: 720px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* --- View system --- */
.view-auth,
.view-dashboard,
.view-form,
.view-result {
    display: none;
}

.view-auth.active,
.view-dashboard.active,
.view-form.active,
.view-result.active {
    display: block;
}

/* ===========================
   AUTH VIEW
   =========================== */
.auth-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 4rem 1.5rem 3rem;
    text-align: center;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    margin-top: 2rem;
    text-align: left;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 0.65rem 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.auth-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.form-group input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

.auth-error {
    color: var(--danger);
    font-size: 0.82rem;
    min-height: 1.2em;
    margin-bottom: 0.5rem;
}

.auth-success {
    color: #2d8a56;
    font-size: 0.82rem;
    min-height: 1.2em;
    margin-bottom: 0.5rem;
}

.forgot-link {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.82rem;
}
.forgot-link a {
    color: var(--text-muted);
    text-decoration: underline;
}
.forgot-link a:hover {
    color: var(--text);
}
.forgot-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* ===========================
   DASHBOARD VIEW
   =========================== */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 2.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dashboard-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-user {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.dashboard-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 2.5rem;
}

.dashboard-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

.btn-import {
    cursor: pointer;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.projects-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    font-size: 0.95rem;
}

.project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.project-card__info {
    flex: 1;
    min-width: 0;
}

.project-card__name {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card__brief {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card__date {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.project-card__actions {
    display: flex;
    gap: 0.4rem;
    margin-left: 1rem;
    flex-shrink: 0;
}

.btn-small {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}

.btn-small:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

.btn-small--export:hover {
    background: #f0f7ff;
    border-color: #3b82f6;
    color: #2563eb;
}

.btn-small--danger:hover {
    background: #fef2f2;
    border-color: var(--danger);
    color: var(--danger);
}

/* ===========================
   FORM VIEW
   =========================== */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 4rem 3rem;
}

header {
    text-align: center;
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    max-width: var(--form-w);
    margin-left: auto;
    margin-right: auto;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.5rem;
    cursor: pointer;
    user-select: none;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.section-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.upload-section {
    margin-bottom: 1.75rem;
    max-width: var(--form-w);
    margin-left: auto;
    margin-right: auto;
}

.brief-section {
    margin-bottom: 1.75rem;
    max-width: var(--form-w);
    margin-left: auto;
    margin-right: auto;
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent);
    background: var(--surface-hover);
}

.dropzone-content svg {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.dropzone-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dropzone-content .browse {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dropzone-content .hint {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    opacity: 0.5;
}

.previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.preview-item {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}

.preview-item .remove-btn:hover {
    background: var(--danger);
}

textarea {
    width: 100%;
    min-height: 130px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: var(--form-w);
    margin-left: auto;
    margin-right: auto;
    padding: 0.9rem 1.5rem;
    min-height: 48px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s, box-shadow 0.2s;
}

.submit-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.submit-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.submit-btn .btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#loaderText {
    transition: opacity 0.2s ease;
}

.submit-btn .btn-loader[hidden] {
    display: none;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

footer {
    text-align: center;
    margin-top: 3rem;
    max-width: var(--form-w);
    margin-left: auto;
    margin-right: auto;
}

.footer-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.footer-link:hover {
    background: var(--surface-hover);
    color: var(--text);
}

/* ===========================
   RESULT VIEW
   =========================== */
.result-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 2.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.result-header__logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.02em;
}

.result-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-header__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.result-header__btn:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--accent);
}
.result-header__btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.result-header__sep {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 0.15rem;
}

.result-header__back,
.result-header__export {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.result-header__back:hover,
.result-header__export:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

.result-body {
    padding: 2rem 2.5rem 3rem;
}

.result-error {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--danger);
    font-size: 1rem;
}

/* Hero storyboard */
.result-hero {
    margin-bottom: 2.5rem;
}

.result-hero__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.result-hero__content {
    width: 100%;
}

/* Storyboard — big cards */
.storyboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1rem;
}

.shot-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s, opacity 0.2s;
    cursor: grab;
}

.shot-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.shot-card.dragging {
    opacity: 0.35;
    cursor: grabbing;
}

.shot-card.drag-over-before::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: -5px;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    z-index: 3;
}

.shot-card.drag-over-after::after {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    right: -5px;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    z-index: 3;
}

.shot-card__toolbar {
    position: absolute;
    top: -14px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.15s;
}

.shot-card:hover .shot-card__toolbar {
    opacity: 1;
}

.shot-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    padding: 0;
}

.shot-action:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--accent);
}

.shot-action--danger:hover {
    background: #fef2f2;
    color: var(--danger);
    border-color: var(--danger);
}

.shot-card--add {
    border: 2px dashed var(--border);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 120px;
    cursor: pointer;
    color: var(--text-muted);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    user-select: none;
}

.shot-card--add:hover {
    border-color: var(--accent);
    color: var(--text);
    background: var(--surface-hover);
    box-shadow: none;
}

.shot-card--add span {
    font-size: 0.85rem;
    font-weight: 600;
}

.shot-card__header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
}

.shot-card__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.shot-card__title {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.shot-card__duration {
    background: var(--surface-hover);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.shot-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shot-card__row {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.88rem;
    line-height: 1.5;
}

.shot-card__label {
    color: var(--text);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.shot-card__label::after {
    content: "";
}

.shot-card__value {
    color: var(--text);
}

/* Inline editing */
.shot-card__title[contenteditable],
.shot-card__duration[contenteditable],
.shot-card__value[contenteditable] {
    cursor: text;
    border-radius: 4px;
    padding: 1px 3px;
    margin: -1px -3px;
    transition: background 0.15s, box-shadow 0.15s;
}

.shot-card__title[contenteditable]:hover,
.shot-card__duration[contenteditable]:hover,
.shot-card__value[contenteditable]:hover {
    background: var(--surface-hover);
}

.shot-card__title[contenteditable]:focus,
.shot-card__duration[contenteditable]:focus,
.shot-card__value[contenteditable]:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.15);
}

/* Sections grid */
.result-sections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2.5rem;
}

.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.15s;
}

.result-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.result-card__header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.result-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--surface-hover);
    color: var(--text-muted);
    flex-shrink: 0;
}

.result-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.result-card__body {
    font-size: 0.93rem;
    line-height: 1.65;
    color: var(--text-muted);
}

.result-card__body p {
    margin-bottom: 0.5rem;
}

.result-card__body strong {
    color: var(--text);
}

.result-card__body ul,
.result-card__body ol {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.result-card__body li {
    margin-bottom: 0.3rem;
}

.result-card__body h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    color: var(--text);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-result.active .result-body {
    animation: fadeIn 0.3s ease;
}

/* ===========================
   ADMIN PANEL
   =========================== */
.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}

.admin-panel {
    background: var(--surface);
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    padding: 1.75rem;
}

.admin-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.admin-panel__header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    padding: 0;
    border: none;
}

.admin-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.admin-close:hover {
    background: var(--surface-hover);
}

.admin-section {
    margin-bottom: 1.5rem;
}

.admin-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.admin-textarea {
    width: 100%;
    min-height: 220px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem;
    color: var(--text);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.55;
    resize: vertical;
    transition: border-color 0.2s;
}

.admin-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.admin-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.65rem;
}

.admin-btn {
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.admin-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-btn--secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.admin-btn--secondary:hover {
    background: var(--surface-hover);
    box-shadow: none;
}

.admin-status {
    font-size: 0.8rem;
    font-weight: 500;
}

.admin-status--ok {
    color: #2d8a56;
}

.admin-status--err {
    color: var(--danger);
}

.admin-usage__updated {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
    font-style: italic;
}

/* ===========================
   PDF EXPORT
   =========================== */
.exporting-pdf [data-no-pdf] {
    display: none !important;
}

.exporting-pdf .result-hero {
    margin-bottom: 0.5rem;
}

.exporting-pdf .result-hero__title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
}

.exporting-pdf .storyboard {
    display: block;
}

.storyboard-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    page-break-inside: avoid;
    break-inside: avoid;
}

.storyboard-row .shot-card {
    flex: 0 0 calc(25% - 8px);
    min-width: 0;
}

.exporting-pdf .shot-card {
    padding: 0.75rem 0.85rem;
    gap: 0.45rem;
    border-radius: 8px;
    cursor: default;
}

.exporting-pdf .shot-card__toolbar {
    display: none !important;
}

.exporting-pdf .shot-card__header {
    padding-bottom: 0.4rem;
    gap: 0.45rem;
}

.exporting-pdf .shot-card__num {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
}

.exporting-pdf .shot-card__title {
    font-size: 0.82rem;
}

.exporting-pdf .shot-card__duration {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
}

.exporting-pdf .shot-card__body {
    gap: 0.35rem;
}

.exporting-pdf .shot-card__row {
    font-size: 0.78rem;
    line-height: 1.45;
    gap: 0.05rem;
}

.exporting-pdf .shot-card__label {
    font-size: 0.68rem;
}

.exporting-pdf .shot-card--add {
    display: none !important;
}

.exporting-pdf .result-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 0.75rem;
    gap: 6px;
}

.exporting-pdf .result-card {
    padding: 0.65rem;
    border-radius: 6px;
    page-break-inside: avoid;
    break-inside: avoid;
}

.exporting-pdf .result-card__header {
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    gap: 0.35rem;
}

.exporting-pdf .result-card__icon {
    width: 24px;
    height: 24px;
}

.exporting-pdf .result-card__icon svg {
    width: 14px;
    height: 14px;
}

.exporting-pdf .result-card__title {
    font-size: 0.78rem;
}

.exporting-pdf .result-card__body {
    font-size: 0.7rem;
    line-height: 1.45;
}

.exporting-pdf .result-card__body li {
    margin-bottom: 0.1rem;
}

.exporting-pdf .result-body {
    padding: 0.75rem 1rem;
}

/* ===========================
   RESPONSIVE — Tablette
   =========================== */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1.5rem 2.5rem;
    }

    header {
        padding-bottom: 1.5rem;
        margin-bottom: 2rem;
    }

    .site-title {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .dropzone {
        padding: 1.5rem;
    }

    .result-header {
        padding: 0.75rem 1.25rem;
    }

    .result-body {
        padding: 1.5rem 1.25rem 2.5rem;
    }

    .result-sections {
        grid-template-columns: 1fr;
    }

    .storyboard {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .shot-card__toolbar {
        opacity: 1;
    }

    .dashboard-header {
        padding: 0.75rem 1.25rem;
    }

    .dashboard-body {
        padding: 1.5rem 1.25rem;
    }

    .project-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .project-card__actions {
        margin-left: 0;
    }
}

/* ===========================
   RESPONSIVE — Mobile
   =========================== */
@media (max-width: 480px) {
    .container {
        padding: 1rem 1rem 2rem;
    }

    header {
        padding-bottom: 1rem;
        margin-bottom: 1.25rem;
    }

    .site-title {
        font-size: 1.25rem;
    }

    .tagline {
        font-size: 0.85rem;
    }

    .section-label {
        font-size: 0.85rem;
    }

    .dropzone {
        padding: 1.25rem 0.75rem;
    }

    .dropzone-content svg {
        width: 28px;
        height: 28px;
    }

    .dropzone-content p {
        font-size: 0.82rem;
    }

    .dropzone-content .hint {
        font-size: 0.75rem;
    }

    .previews {
        gap: 0.5rem;
    }

    .preview-item {
        width: 60px;
        height: 60px;
    }

    textarea {
        min-height: 100px;
        font-size: 16px;
        padding: 0.75rem;
    }

    .submit-btn {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }

    .result-header {
        padding: 0.65rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .result-header__logo {
        font-size: 1rem;
    }

    .result-header__actions {
        gap: 0.35rem;
        flex-wrap: wrap;
    }

    .result-header__back,
    .result-header__export {
        font-size: 0.78rem;
        padding: 0.4rem 0.75rem;
    }

    .result-body {
        padding: 1rem 1rem 2rem;
    }

    .shot-card__toolbar {
        opacity: 1;
    }

    .shot-action {
        width: 26px;
        height: 26px;
    }

    .result-hero__title {
        font-size: 1.1rem;
    }

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

    .shot-card.drag-over-before::before {
        top: -5px;
        bottom: auto;
        left: 8px;
        right: 8px;
        width: auto;
        height: 3px;
    }

    .shot-card.drag-over-after::after {
        bottom: -5px;
        top: auto;
        left: 8px;
        right: 8px;
        width: auto;
        height: 3px;
    }

    .shot-card {
        padding: 1rem;
    }

    .shot-card__num {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .shot-card__title {
        font-size: 0.88rem;
    }

    .shot-card__row {
        font-size: 0.82rem;
    }

    .shot-card__label {
        font-size: 0.66rem;
    }

    .result-sections {
        grid-template-columns: 1fr;
    }

    .result-card {
        padding: 1.15rem;
    }

    .result-card__body {
        font-size: 0.87rem;
    }

    .auth-container {
        padding: 2rem 1rem;
    }

    .dashboard-header {
        padding: 0.65rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .dashboard-body {
        padding: 1rem;
    }

    .dashboard-actions {
        flex-direction: column;
    }
}

/* ===========================
   SEARCH BAR
   =========================== */
.result-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 2.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}
.result-search input {
    flex: 1;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text);
    outline: none;
}
.result-search input::placeholder { color: var(--text-muted); }
.result-search__count {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.shot-card.search-hidden { display: none; }
.shot-card.search-highlight {
    box-shadow: 0 0 0 2px var(--accent);
}

@media (max-width: 600px) {
    .result-search { padding: 0.5rem 1rem; }
}

/* ===========================
   AUTOSAVE INDICATOR
   =========================== */
.autosave-indicator {
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: opacity 0.3s;
}

/* ===========================
   CAMERA
   =========================== */
.btn-camera {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.65rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-camera:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

.camera-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.camera-modal {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    max-width: 520px;
    text-align: center;
}
.camera-modal h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}
.camera-modal video {
    width: 100%;
    border-radius: 8px;
    background: #000;
}
.camera-modal canvas { display: none; }
.camera-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}
.camera-actions .submit-btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.88rem;
}
.camera-actions .btn-secondary {
    padding: 0.5rem 1.5rem;
    font-size: 0.88rem;
}
