h1 {
    font-size: 2rem;
    line-height: 1.1;
}
.app-shell {
    height: 100vh;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    background: var(--bs-body-bg);
    overflow: hidden;
}
.app-sidebar {
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border-right: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
}
.sidebar-brand {
    color: var(--bs-body-color);
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.45rem 0.5rem;
}
.sidebar-nav {
    display: grid;
    gap: 0.25rem;
}
.sidebar-nav a,
.sidebar-logout,
.mobile-actions a {
    color: var(--bs-body-color);
    text-decoration: none;
    border-radius: var(--bs-border-radius);
    padding: 0.55rem 0.65rem;
}
.sidebar-nav a:hover,
.sidebar-logout:hover,
.mobile-actions a:hover {
    background: var(--bs-secondary-bg);
}
.sidebar-logout {
    margin-top: auto;
}
.mobile-bar {
    display: none;
}
.app-main {
    min-width: 0;
    height: 100vh;
    overflow: hidden;
    padding: 1.25rem 1.5rem;
}
.content-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}
.content-editor-header h1 {
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}
.content-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 60%) minmax(320px, 40%);
    gap: 1.25rem;
    align-items: start;
    height: calc(100vh - 2.5rem);
    overflow: hidden;
}
.content-editor-main,
.content-editor-side {
    min-width: 0;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 0.35rem;
}
.content-editor-side {
    position: static;
}
.editor-tabs {
    margin-bottom: 1rem;
}
.editor-tabs .nav-link {
    color: var(--bs-body-color);
}
.editor-tab-content {
    min-width: 0;
}
.tab-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.content-list-page {
    height: calc(100vh - 2.5rem);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}
.content-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.content-list {
    display: grid;
    gap: 0.75rem;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.35rem;
    align-content: start;
}
.content-row {
    display: grid;
    grid-template-columns: minmax(10rem, 10rem) minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 0.75rem;
    background: var(--bs-body-bg);
}
.content-row-thumb {
    width: 100%;
    min-width: 10rem;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--bs-border-radius);
    background: var(--bs-secondary-bg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
    image-rendering: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
}
.content-row-thumb.has-image span {
    display: none;
}
.content-row-main {
    min-width: 0;
}
.content-row-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.content-row-title h3 {
    min-width: 0;
    margin-bottom: 0;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.content-row-title a {
    color: var(--bs-body-color);
    text-decoration: none;
}
.content-row-topic {
    margin: 0.2rem 0;
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.content-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--bs-secondary-color);
    font-size: 0.82rem;
}
.content-row-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.content-row-actions form {
    display: inline;
}
.status-badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--bs-border-radius);
    background: var(--bs-primary);
    color: #fff;
    text-transform: uppercase;
    font-weight: 600;
}
.topic-field {
    min-height: 64px;
    height: 64px;
    resize: vertical;
}
.prompt-field {
    min-height: 220px;
    resize: vertical;
}
.content-body-field {
    height: 800px;
    min-height: 800px;
}
.generated-preview-panel {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 1rem;
    background: var(--bs-tertiary-bg);
}
.template-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.template-picker button {
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: var(--bs-border-radius);
    padding: 0.45rem 0.55rem;
    font-size: 0.85rem;
}
.template-picker button.active {
    border-color: var(--bs-primary);
    background: var(--bs-primary);
    color: #fff;
}
.generated-preview {
    position: relative;
    display: grid;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.12);
    width: 100%;
}
.preview-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.82rem;
}
.preview-media {
    position: relative;
    overflow: hidden;
    background: var(--bs-secondary-bg);
}
.preview-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.preview-image-empty {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
}
.image-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}
.image-modal-body img {
    max-height: 70vh;
    object-fit: contain;
}
.preview-copy {
    min-width: 0;
}
.preview-copy h2 {
    font-size: 1rem;
    line-height: 1.2;
    margin: 0 0 0.4rem;
}
.preview-copy p {
    margin: 0;
    white-space: pre-line;
    overflow: hidden;
}
.preview-actions {
    display: flex;
    gap: 0.4rem;
}
.preview-actions span {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
}
.generated-preview-instagram {
    aspect-ratio: 4 / 5;
    border-radius: 8px;
    grid-template-rows: auto 52% minmax(0, 1fr) auto;
}
.generated-preview-instagram .preview-topbar,
.generated-preview-instagram .preview-copy,
.generated-preview-instagram .preview-actions {
    padding: 0.7rem;
}
.generated-preview-instagram .preview-copy p {
    max-height: 8.5rem;
    font-size: 0.82rem;
}
.generated-preview-facebook {
    aspect-ratio: 1.91 / 1;
    border-radius: 8px;
    grid-template-columns: 45% 55%;
    grid-template-rows: auto minmax(0, 1fr);
}
.generated-preview-facebook .preview-topbar {
    grid-column: 1 / -1;
    padding: 0.55rem 0.7rem;
}
.generated-preview-facebook .preview-media {
    min-height: 0;
}
.generated-preview-facebook .preview-copy {
    padding: 0.65rem;
}
.generated-preview-facebook .preview-copy p {
    max-height: 5.4rem;
    font-size: 0.78rem;
}
.generated-preview-facebook .preview-actions {
    display: none;
}
.generated-preview-tiktok {
    aspect-ratio: 9 / 16;
    border-radius: 18px;
    background: #050505;
    color: #fff;
}
.generated-preview-tiktok .preview-topbar {
    position: absolute;
    inset: 0.8rem 0.8rem auto;
    z-index: 2;
}
.generated-preview-tiktok .preview-media {
    position: absolute;
    inset: 0;
}
.generated-preview-tiktok .preview-copy {
    position: absolute;
    left: 0;
    right: 2.6rem;
    bottom: 0;
    z-index: 2;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.86));
}
.generated-preview-tiktok .preview-copy h2 {
    font-size: 0.95rem;
}
.generated-preview-tiktok .preview-copy p {
    max-height: 8rem;
    font-size: 0.76rem;
}
.generated-preview-tiktok .preview-actions {
    position: absolute;
    right: 0.7rem;
    bottom: 1rem;
    z-index: 3;
    flex-direction: column;
    color: #fff;
}
.generated-preview-linkedin {
    aspect-ratio: 1.91 / 1;
    border-radius: 8px;
    grid-template-columns: 42% 58%;
    grid-template-rows: auto minmax(0, 1fr);
    background: #fff;
    color: #1f2937;
}
.generated-preview-linkedin .preview-topbar {
    grid-column: 1 / -1;
    padding: 0.55rem 0.7rem;
    color: #0a66c2;
    border-bottom: 1px solid #e5e7eb;
}
.generated-preview-linkedin .preview-copy {
    padding: 0.75rem;
}
.generated-preview-linkedin .preview-copy h2 {
    color: #111827;
}
.generated-preview-linkedin .preview-copy p {
    max-height: 5.6rem;
    font-size: 0.78rem;
}
.generated-preview-linkedin .preview-actions {
    display: none;
}
.generation-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 2000;
}
.generation-overlay.htmx-request {
    display: flex;
}
.generation-overlay-card {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: calc(var(--bs-border-radius) * 1.5);
    padding: 1.5rem 1.75rem;
    min-width: 280px;
    text-align: center;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25);
}
@media (max-width: 991.98px) {
    .app-shell {
        display: block;
    }
    .app-sidebar {
        display: none;
    }
    .mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--bs-border-color);
        background: var(--bs-tertiary-bg);
    }
    .mobile-actions {
        display: flex;
        gap: 0.25rem;
        font-size: 0.9rem;
    }
    .app-main {
        height: calc(100vh - 58px);
        padding: 1rem;
        overflow: hidden;
    }
    .content-list-page {
        height: calc(100vh - 90px);
    }
    .content-list-header {
        align-items: flex-start;
    }
    .content-editor-header {
        display: block;
    }
    .content-editor-header .d-flex {
        margin-top: 1rem;
    }
    .content-row {
        grid-template-columns: minmax(10rem, 10rem) minmax(0, 1fr);
        align-items: start;
    }
    .content-row-thumb {
        width: 100%;
        min-width: 10rem;
        aspect-ratio: 16 / 9;
    }
    .content-row-actions {
        grid-column: 2;
    }
    .content-editor-grid {
        grid-template-columns: 1fr;
        height: calc(100vh - 6rem);
        overflow-y: auto;
    }
    .content-editor-main {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
    .content-editor-side {
        position: static;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
    .content-body-field {
        height: 800px;
        min-height: 800px;
    }
    .generated-preview {
        max-width: 420px;
    }
}
