:root {
    --bg: #0f1115;
    --panel: #171a21;
    --panel-strong: #1d212b;
    --border: #2a2f3a;
    --text: #eceff4;
    --muted: #9aa3b2;
    --accent: #19c37d;
    --accent-hover: #21d48a;
    --danger: #f87171;
    --info: #60a5fa;
    --user-bubble: #2b3442;
    --assistant-bubble: #1d212b;
    --shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    overflow: hidden;
}

body {
    height: 100vh;
    background:
        radial-gradient(circle at top, rgba(25, 195, 125, 0.08), transparent 30%),
        linear-gradient(180deg, #101319 0%, #0b0d12 100%);
}

body.modal-open {
    overflow: hidden;
}

a {
    color: inherit;
}

.flash-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flash-message {
    min-width: 260px;
    max-width: 420px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(17, 20, 27, 0.96);
    box-shadow: var(--shadow);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.flash-message.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.flash-message.error {
    border-color: rgba(248, 113, 113, 0.45);
}

.flash-message.success {
    border-color: rgba(25, 195, 125, 0.45);
}

.flash-message.info {
    border-color: rgba(96, 165, 250, 0.45);
}

.message-bubble.with-preview {
    padding: 12px 14px;
}

.message-preview-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-preview-thumb {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.message-preview-thumb:hover {
    border-color: rgba(25, 195, 125, 0.24);
    transform: translateY(-1px);
}

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

.message-preview-copy {
    min-width: 0;
    line-height: 1.45;
}

.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    position: relative;
    width: 250px;
    flex: 0 0 250px;
    height: 100vh;
    background:
        linear-gradient(180deg, rgba(18, 22, 30, 0.98) 0%, rgba(11, 14, 20, 0.98) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 30px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
    overflow: visible;
    z-index: 20;
}

.sidebar-tools {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: visible;
    align-items: stretch;
}

.sidebar-top {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: visible;
    z-index: 25;
}

.sidebar-brand {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
}

.sidebar-brand:hover {
    color: #ffffff;
}

.projects-panel {
    width: 100%;
    margin-top: 8px;
    margin-bottom: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 6px 0;
}

.sidebar-bottom-links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    color: #f0f4f9;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.sidebar-nav-link:hover {
    border-color: rgba(25, 195, 125, 0.24);
    background: rgba(25, 195, 125, 0.08);
    transform: translateY(-1px);
}

.sidebar-nav-link.active {
    border-color: rgba(25, 195, 125, 0.28);
    background: rgba(25, 195, 125, 0.12);
    color: #e6fff1;
}

.projects-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
}

.projects-header h2 {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.functions-header h2 {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.new-project-button {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.03);
    color: #f1f4f8;
    font: inherit;
    text-align: left;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.new-project-button:hover {
    border-color: rgba(25, 195, 125, 0.28);
    background: rgba(25, 195, 125, 0.08);
    transform: translateY(-1px);
}

.new-project-button.guest-disabled {
    border-color: rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(241, 244, 248, 0.62);
}

.project-list {
    max-height: min(46vh, 420px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 127, 146, 0.45) rgba(255, 255, 255, 0.02);
}

.project-item {
    position: relative;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    color: #e6ebf2;
    font: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 0.92rem;
    font-weight: 500;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.project-item:hover {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.05);
    color: #f3f6fb;
}

.project-item.active {
    border-color: rgba(25, 195, 125, 0.22);
    background: linear-gradient(180deg, rgba(25, 195, 125, 0.14) 0%, rgba(25, 195, 125, 0.08) 100%);
    color: #f6fffb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.project-select-button {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 0 10px 0 14px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    display: flex;
    align-items: center;
    text-align: left;
    cursor: pointer;
}

.project-item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;
    padding-right: 10px;
}

.project-item-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding-right: 10px;
}

.project-menu-button {
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.project-menu-button span {
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
}

.project-item:hover .project-menu-button,
.project-item.active .project-menu-button {
    color: rgba(255, 255, 255, 0.84);
}

.project-menu-button:hover,
.project-menu-button[aria-expanded="true"] {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
    color: #f3f6fb;
    transform: translateY(-1px);
}

.project-popover {
    position: fixed;
    z-index: 1600;
    width: 208px;
    pointer-events: auto;
}

.project-popover[hidden] {
    display: none;
}

.project-popover-surface {
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(23, 26, 33, 0.98) 0%, rgba(14, 17, 23, 0.98) 100%);
    box-shadow:
        0 22px 44px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
}

.project-popover-action {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #edf2f8;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.project-popover-action + .project-popover-action {
    margin-top: 4px;
}

.project-popover-action:hover {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    transform: translateY(-1px);
}

.project-popover-action.danger:hover {
    border-color: rgba(248, 113, 113, 0.18);
    background: rgba(248, 113, 113, 0.08);
    color: #ffd5d5;
}

.project-popover-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(236, 239, 244, 0.82);
}

.project-popover-action.danger .project-popover-icon {
    color: rgba(255, 213, 213, 0.88);
}

.project-popover-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tool-row {
    display: flex;
    gap: 10px;
    overflow: visible;
    justify-content: center;
}

.sidebar-account {
    margin-top: 0;
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 25;
}

.account-menu {
    position: relative;
    z-index: 30;
}

.account-menu summary {
    list-style: none;
}

.account-menu summary::-webkit-details-marker {
    display: none;
}

.account-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(18, 21, 28, 0.92);
    color: #d9fbe8;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.account-dropdown {
    position: absolute;
    left: calc(100% + 12px);
    bottom: 0;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(17, 20, 27, 0.98);
    box-shadow: var(--shadow);
    z-index: 1400;
}

.account-action {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(18, 21, 28, 0.92);
    color: var(--text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.account-action:hover {
    border-color: rgba(25, 195, 125, 0.5);
}

.right-sidebar {
    width: 30%;
    flex: 0 1 30%;
    height: 100vh;
    border-left: 1px solid var(--border);
    border-right: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.panel-label {
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.result-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    color: var(--muted);
    font-size: 0.94rem;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 127, 146, 0.45) rgba(255, 255, 255, 0.02);
}

.result-loading {
    min-height: 180px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #e8edf5;
}

.result-context-panel {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-context-panel.guest-locked {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.result-context-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-context-title {
    color: #f5f8fc;
    font-size: 0.96rem;
    font-weight: 700;
}

.result-context-copy {
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.45;
}

.result-context-guest-note {
    display: inline-flex;
    align-self: flex-start;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    color: #d4dbe6;
    font-size: 0.79rem;
    font-weight: 600;
    line-height: 1.3;
}

.result-group {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-group:first-of-type {
    margin-top: 0;
}

.result-group-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-group-title {
    color: #f5f8fc;
    font-size: 0.95rem;
    font-weight: 700;
}

.result-group-meta {
    color: var(--muted);
    font-size: 0.79rem;
    line-height: 1.4;
}

.result-context-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-context-action,
.result-suggestion-chip {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: #edf2f8;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.result-context-action:hover,
.result-suggestion-chip:hover {
    border-color: rgba(25, 195, 125, 0.22);
    background: rgba(25, 195, 125, 0.1);
    transform: translateY(-1px);
}

.result-context-action.is-disabled,
.result-suggestion-chip.is-disabled {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(237, 242, 248, 0.52);
    cursor: not-allowed;
}

.result-context-action.is-disabled:hover,
.result-suggestion-chip.is-disabled:hover {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    transform: none;
}

.result-suggestion-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.result-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(25, 195, 125, 0.95);
    border-radius: 999px;
    animation: spin 0.85s linear infinite;
}

.timeline-loading,
.timeline-error {
    margin-top: 18px;
}

.timeline-loading-centered {
    min-height: clamp(280px, 56vh, 560px);
    margin-top: 0;
}

.result-loading-skeletons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.result-loading-skeleton {
    min-height: 140px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.03) 0%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 100%
        );
    background-size: 220% 100%;
    animation: shimmer 1.15s linear infinite;
}

.generated-images-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.generated-videos-grid {
    grid-template-columns: minmax(0, 1fr);
}

.generated-image-card {
    position: relative;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.generated-image-card.selected {
    border-color: rgba(25, 195, 125, 0.38);
    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.25),
        0 0 0 2px rgba(25, 195, 125, 0.16);
}

.generated-image-card.score-hovered {
    z-index: 8;
}

.generated-image-media {
    position: relative;
    overflow: visible;
    border-radius: 18px 18px 0 0;
    z-index: 2;
}


.generated-image-selected-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(25, 195, 125, 0.96);
    color: #08120d;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
    z-index: 13;
}

.generated-image-selected-badge svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.generated-image-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.24s ease;
    border-radius: 18px 18px 0 0;
}

.video-result-card {
    width: min(100%, 360px);
    justify-self: center;
}

.video-result-card .generated-image-media {
    aspect-ratio: 9 / 16;
    position: relative;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
    background: #05070b;
}

.generated-video-shell {
    position: absolute;
    inset: 0;
}

.generated-video-player {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px 18px 0 0;
    background: #05070b;
}

.generated-video-instagram-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.video-result-card.instagram-preview-active .generated-video-instagram-overlay {
    opacity: 1;
}

.generated-video-audio-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(5, 10, 18, 0.72);
    color: #f8fbff;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
}

.generated-video-audio-toggle:hover {
    background: rgba(10, 16, 28, 0.86);
}

.generated-video-audio-toggle.is-muted {
    background: rgba(16, 19, 25, 0.78);
    color: rgba(248, 251, 255, 0.92);
}

.generated-video-audio-toggle:focus-visible {
    outline: 2px solid rgba(120, 193, 255, 0.92);
    outline-offset: 2px;
}

.generated-video-audio-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.generated-video-audio-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.generated-video-audio-icon-off {
    display: none;
}

.generated-video-audio-toggle.is-muted .generated-video-audio-icon-on {
    display: none;
}

.generated-video-audio-toggle.is-muted .generated-video-audio-icon-off {
    display: inline-flex;
}

.generated-image-score {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(10px);
    cursor: default;
    z-index: 12;
}

.generated-image-score.low {
    background: rgba(220, 38, 38, 0.92);
}

.generated-image-score.mid {
    background: rgba(202, 138, 4, 0.92);
}

.generated-image-score.high {
    background: rgba(22, 163, 74, 0.92);
}

.generated-image-score-tooltip-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #ffffff;
}

.generated-image-score-tooltip-label {
    margin-top: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #d9fbe8;
}

.generated-image-score-tooltip-copy {
    margin-top: 4px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: rgba(236, 239, 244, 0.82);
}

.score-tooltip-popover {
    position: fixed;
    z-index: 2200;
    width: 220px;
    pointer-events: auto;
}

.score-tooltip-popover[hidden] {
    display: none;
}

.score-tooltip-surface {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(17, 20, 27, 0.98);
    color: #edf2f8;
    text-align: left;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(12px);
}

.generated-image-card.locked img {
    filter: blur(10px);
    transform: scale(1.06);
}

.generated-image-card:hover img {
    transform: scale(1.03);
}

.generated-image-card.locked:hover img {
    transform: scale(1.06);
}

.generated-image-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.generated-image-download,
.generated-image-preview-toggle {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: #edf2f8;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.generated-image-preview-toggle {
    font: inherit;
    cursor: pointer;
}

.generated-image-download:hover {
    border-color: rgba(25, 195, 125, 0.22);
    background: rgba(25, 195, 125, 0.08);
    transform: translateY(-1px);
}

.generated-image-preview-toggle:hover,
.generated-image-preview-toggle.is-active {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.locked-image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(9, 12, 18, 0.62) 0%, rgba(9, 12, 18, 0.82) 100%);
    text-align: center;
}

.locked-image-title {
    color: #f5f8fc;
    font-size: 1rem;
    font-weight: 700;
}

.locked-image-copy {
    color: rgba(236, 239, 244, 0.82);
    font-size: 0.84rem;
    line-height: 1.45;
    max-width: 220px;
}

.locked-image-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.locked-image-button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #edf2f7;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.locked-image-button.primary {
    background: rgba(25, 195, 125, 0.18);
    border-color: rgba(25, 195, 125, 0.28);
    color: #e8fff3;
}

.guest-library-note {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.tool-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(18, 21, 28, 0.92);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
    overflow: visible;
    z-index: 30;
}

.tool-button:hover {
    border-color: rgba(25, 195, 125, 0.5);
    background: rgba(22, 26, 34, 0.96);
    transform: translateY(-1px);
    z-index: 1450;
}

.tool-button::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    width: 220px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(17, 20, 27, 0.98);
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 1500;
}

.tool-button:hover::after {
    opacity: 1;
}

.tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(25, 195, 125, 0.14);
    color: #d9fbe8;
    font-weight: 700;
    font-size: 1rem;
}

.tool-text {
    font-size: 0.95rem;
    font-weight: 600;
}

.square-tool {
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
    flex: 0 0 56px;
}

.project-list::-webkit-scrollbar,
.messages::-webkit-scrollbar,
.result-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.project-list::-webkit-scrollbar-track,
.messages::-webkit-scrollbar-track,
.result-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 999px;
}

.project-list::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb,
.result-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(82, 107, 122, 0.75) 0%, rgba(58, 76, 92, 0.82) 100%);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.project-list::-webkit-scrollbar-thumb:hover,
.messages::-webkit-scrollbar-thumb:hover,
.result-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(104, 138, 158, 0.85) 0%, rgba(69, 96, 114, 0.92) 100%);
}

.chat-column {
    flex: 0 1 70%;
    min-width: 0;
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 24px 28px;
    gap: 20px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.chat-header {
    padding: 6px 6px 0;
}

.chat-header-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.chat-header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.chat-header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.chat-welcome-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    justify-content: center;
    padding: 24px 18px 10px;
    text-align: center;
}

.chat-welcome-panel[hidden] {
    display: none !important;
}

.chat-welcome-copy {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.chat-welcome-copy h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.chat-welcome-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.5;
}

.chat-welcome-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.inline-billing-alert {
    width: min(820px, 100%);
    padding: 18px 20px;
    border: 1px solid rgba(248, 113, 113, 0.18);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(58, 20, 20, 0.92) 0%, rgba(24, 15, 18, 0.98) 100%);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.inline-billing-alert strong {
    font-size: 1.1rem;
}

.inline-billing-alert p {
    margin: 0;
    color: #f3d6d6;
    line-height: 1.5;
}

.inline-billing-kicker {
    color: #ffb4b4;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.inline-billing-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.welcome-action {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.welcome-action.primary {
    background: var(--accent);
    border-color: transparent;
    color: #08120d;
}

.welcome-action.secondary {
    background: rgba(18, 21, 28, 0.92);
    color: var(--text);
}

.welcome-action:hover {
    transform: translateY(-1px);
}

.feature-button-grid {
    width: min(820px, 100%);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.feature-launch-button {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 16px 14px;
    background: linear-gradient(180deg, rgba(28, 33, 42, 0.94) 0%, rgba(18, 22, 29, 0.96) 100%);
    color: var(--text);
    font: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.feature-launch-button:hover {
    transform: translateY(-2px);
    border-color: rgba(25, 195, 125, 0.24);
    background: linear-gradient(180deg, rgba(32, 39, 50, 0.98) 0%, rgba(20, 25, 33, 1) 100%);
    box-shadow: 0 20px 36px rgba(0, 0, 0, 0.22);
}

.feature-launch-icon {
    min-width: 52px;
    height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(25, 195, 125, 0.14);
    color: #d9fbe8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.feature-launch-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feature-launch-text strong {
    font-size: 0.98rem;
}

.feature-launch-text span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.credit-pill,
.user-pill,
.logout-link,
.guest-pill,
.auth-top-link {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(18, 21, 28, 0.9);
    font-size: 0.92rem;
    text-decoration: none;
}

.credit-pill {
    color: #d9fbe8;
}

.credit-pill-link {
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.credit-pill-link:hover {
    border-color: rgba(25, 195, 125, 0.5);
    background: rgba(25, 195, 125, 0.08);
    transform: translateY(-1px);
}

.guest-pill {
    color: var(--muted);
}

.logout-link {
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.logout-link:hover,
.auth-top-link:hover {
    border-color: rgba(25, 195, 125, 0.5);
    transform: translateY(-1px);
}

.auth-top-link.primary {
    background: var(--accent);
    border-color: transparent;
    color: #08120d;
}

.messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 127, 146, 0.45) rgba(255, 255, 255, 0.02);
}

.message {
    display: flex;
}

.message.user {
    justify-content: flex-end;
}

.message-bubble {
    max-width: min(760px, 92%);
    padding: 14px 16px;
    border-radius: 18px;
    line-height: 1.5;
    box-shadow: var(--shadow);
    white-space: pre-wrap;
    word-break: break-word;
}

.message-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-start;
}

.upload-flow-stepper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.upload-flow-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.upload-flow-step.active {
    border-color: rgba(59, 158, 255, 0.24);
    background: rgba(59, 158, 255, 0.08);
}

.upload-flow-step.completed {
    border-color: rgba(25, 195, 125, 0.24);
    background: rgba(25, 195, 125, 0.08);
}

.upload-flow-step-index {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f4f7fb;
    font-size: 0.8rem;
    font-weight: 800;
    flex-shrink: 0;
}

.upload-flow-step.active .upload-flow-step-index {
    border-color: rgba(59, 158, 255, 0.3);
    background: rgba(59, 158, 255, 0.18);
}

.upload-flow-step.completed .upload-flow-step-index {
    border-color: rgba(25, 195, 125, 0.3);
    background: rgba(25, 195, 125, 0.18);
}

.upload-flow-step.upcoming .upload-flow-step-index {
    color: rgba(244, 247, 251, 0.72);
}

.upload-flow-step-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.upload-flow-step-title {
    color: #f4f7fb;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
}

.upload-flow-summary-card {
    margin-top: 14px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(13, 17, 23, 0.88);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.upload-flow-summary-image {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.upload-flow-summary-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.upload-flow-summary-eyebrow {
    color: #9fe6c1;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.upload-flow-summary-title {
    color: #f4f7fb;
    font-size: 0.94rem;
    font-weight: 700;
}

.upload-flow-summary-copy {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.upload-flow-summary-button {
    align-self: center;
}

.image-source-picker {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.image-source-picker-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.image-source-picker-title {
    color: #f4f7fb;
    font-size: 0.96rem;
    font-weight: 700;
}

.image-source-picker-copy {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.image-source-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.image-source-option {
    min-height: 88px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(14, 17, 23, 0.78);
    color: #edf2f8;
    font: inherit;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.image-source-option:hover {
    border-color: rgba(25, 195, 125, 0.22);
    background: rgba(25, 195, 125, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.image-source-option-title {
    font-size: 0.93rem;
    font-weight: 700;
}

.image-source-option-copy {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.upload-action-button {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    background: rgba(25, 195, 125, 0.12);
    color: #e8fff3;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.upload-action-button:hover {
    border-color: rgba(25, 195, 125, 0.36);
    background: rgba(25, 195, 125, 0.18);
    transform: translateY(-1px);
}

.upload-action-button:disabled {
    cursor: default;
    color: rgba(232, 255, 243, 0.72);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    transform: none;
}

.upload-preview {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-preview img {
    width: 100%;
    max-width: 280px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    object-fit: cover;
}

.upload-success {
    color: #d9fbe8;
    font-size: 0.92rem;
}

.voiceover-settings-card {
    margin-top: 14px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at top right, rgba(25, 195, 125, 0.14), transparent 38%),
        linear-gradient(180deg, rgba(14, 18, 24, 0.96), rgba(10, 13, 19, 0.96));
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.voiceover-settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.voiceover-settings-title {
    color: #f4f7fb;
    font-size: 0.98rem;
    font-weight: 700;
}

.voiceover-settings-copy {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.voiceover-settings-badge {
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(25, 195, 125, 0.12);
    border: 1px solid rgba(25, 195, 125, 0.22);
    color: #d8ffeb;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.voiceover-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.voiceover-settings-footer {
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.voiceover-action-button,
.voiceover-generate-button {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.voiceover-action-button {
    background: rgba(255, 255, 255, 0.05);
    color: #f3f7fb;
}

.voiceover-generate-button {
    background: linear-gradient(135deg, rgba(25, 195, 125, 0.92), rgba(59, 158, 255, 0.9));
    color: #07110d;
    border-color: rgba(25, 195, 125, 0.3);
}

.voiceover-generate-button-primary {
    width: 100%;
    justify-content: center;
    min-height: 46px;
}

.voiceover-action-button:hover,
.voiceover-generate-button:hover {
    transform: translateY(-1px);
}

.voiceover-action-button:disabled,
.voiceover-generate-button:disabled {
    cursor: default;
    opacity: 0.68;
    transform: none;
}

.voiceover-section-label {
    color: #f3f7fb;
    font-size: 0.86rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.voiceover-custom-wrap .voiceover-section-label,
.voiceover-own-voice-wrap .voiceover-section-label {
    margin-bottom: 2px;
}

.voiceover-custom-wrap .voiceover-custom-caption,
.voiceover-own-voice-wrap .voiceover-custom-caption {
    margin-bottom: 4px;
}

.voiceover-ideas-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.voiceover-idea-card {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #eef4fa;
    font: inherit;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 7px;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.voiceover-idea-card:hover,
.voiceover-idea-card.selected {
    border-color: rgba(25, 195, 125, 0.3);
    background: rgba(25, 195, 125, 0.08);
    transform: translateY(-1px);
}

.voiceover-idea-tone {
    color: #d8ffeb;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.voiceover-idea-text {
    font-size: 0.87rem;
    line-height: 1.5;
}

.voiceover-empty-state,
.voiceover-custom-caption,
.voiceover-priority-copy {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.voiceover-custom-wrap,
.voiceover-own-voice-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ugc-persona-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ugc-persona-textarea {
    min-height: 84px;
}

.ugc-persona-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ugc-persona-card {
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #eef4fa;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.ugc-persona-card:hover,
.ugc-persona-card.selected {
    border-color: rgba(25, 195, 125, 0.3);
    background: rgba(25, 195, 125, 0.08);
    transform: translateY(-1px);
}

.ugc-persona-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.ugc-persona-card-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}

.ugc-persona-card-title {
    color: #f4f7fb;
    font-size: 0.81rem;
    font-weight: 700;
}

.ugc-persona-card-copy {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.voiceover-custom-textarea {
    width: 100%;
    min-height: 92px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #eef4fa;
    font: inherit;
    resize: vertical;
}

.voiceover-custom-textarea:focus {
    outline: none;
    border-color: rgba(25, 195, 125, 0.34);
    box-shadow: 0 0 0 3px rgba(25, 195, 125, 0.12);
}

.voiceover-meta-row {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.voiceover-character-counter {
    color: #d8ffeb;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.voiceover-inline-error,
.voiceover-warning-item {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.83rem;
    line-height: 1.45;
}

.voiceover-inline-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #ffd6d6;
}

.voiceover-warning-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voiceover-warning-item {
    background: rgba(248, 185, 55, 0.1);
    border: 1px solid rgba(248, 185, 55, 0.16);
    color: #ffe6a8;
}

.voiceover-own-voice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.voiceover-recording-status {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(59, 158, 255, 0.16);
    background: rgba(59, 158, 255, 0.08);
    color: #dcebff;
    font-size: 0.82rem;
    line-height: 1.45;
}

.voiceover-audio-preview {
    width: 100%;
    min-height: 42px;
    filter: saturate(0.92);
}

.reel-style-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reel-style-picker-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reel-style-picker-title {
    color: #f4f7fb;
    font-size: 0.96rem;
    font-weight: 700;
}

.reel-style-picker-copy {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.reel-style-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.reel-style-card {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(14, 17, 23, 0.84);
    color: #edf2f8;
    font: inherit;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.reel-style-card:hover,
.reel-style-card.selected {
    border-color: rgba(25, 195, 125, 0.28);
    background: rgba(25, 195, 125, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.22);
}

.reel-style-card.disabled {
    cursor: not-allowed;
    opacity: 0.52;
    transform: none;
    box-shadow: none;
}

.reel-style-card.disabled:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(14, 17, 23, 0.84);
    transform: none;
    box-shadow: none;
}

.reel-style-visual {
    position: relative;
    display: block;
    aspect-ratio: 9 / 16;
    border-radius: 14px;
    overflow: hidden;
    background: #10141c;
}

.reel-style-frame,
.reel-style-accent,
.reel-style-glow {
    position: absolute;
    border-radius: 999px;
}

.reel-style-frame {
    inset: 16% 18% 14% 18%;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.reel-style-accent {
    width: 58%;
    height: 24%;
    left: 10%;
    top: 12%;
    filter: blur(8px);
}

.reel-style-glow {
    width: 44%;
    height: 44%;
    right: 8%;
    bottom: 10%;
    filter: blur(26px);
    opacity: 0.9;
}

.reel-style-cinematic .reel-style-visual {
    background: linear-gradient(180deg, #16110f 0%, #090c12 100%);
}

.reel-style-cinematic .reel-style-accent {
    background: linear-gradient(135deg, rgba(255, 175, 92, 0.95), rgba(255, 111, 58, 0.5));
}

.reel-style-cinematic .reel-style-glow {
    background: radial-gradient(circle, rgba(255, 210, 132, 0.88), rgba(255, 210, 132, 0));
}

.reel-style-ugc .reel-style-visual {
    background: linear-gradient(180deg, #12211b 0%, #0a1215 100%);
}

.reel-style-ugc .reel-style-accent {
    background: linear-gradient(135deg, rgba(90, 232, 162, 0.92), rgba(42, 178, 255, 0.42));
}

.reel-style-ugc .reel-style-glow {
    background: radial-gradient(circle, rgba(112, 255, 191, 0.8), rgba(112, 255, 191, 0));
}

.reel-style-mix .reel-style-visual {
    background: linear-gradient(180deg, #171320 0%, #0a1016 100%);
}

.reel-style-mix .reel-style-accent {
    background: linear-gradient(135deg, rgba(255, 146, 104, 0.9), rgba(93, 185, 255, 0.48));
}

.reel-style-mix .reel-style-glow {
    background: radial-gradient(circle, rgba(150, 198, 255, 0.82), rgba(150, 198, 255, 0));
}

.reel-style-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.reel-style-title {
    font-size: 0.92rem;
    font-weight: 700;
}

.reel-style-copy {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.reel-style-button {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: #eff7ff;
    font-size: 0.8rem;
    font-weight: 700;
}

@media (max-width: 860px) {
    .voiceover-settings-header,
    .voiceover-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .voiceover-ideas-grid {
        grid-template-columns: 1fr;
    }

    .ugc-persona-grid {
        grid-template-columns: 1fr;
    }

    .reel-style-grid {
        grid-template-columns: 1fr;
    }
}

.structured-bubble {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.structured-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.structured-section strong {
    color: #d9fbe8;
    font-size: 0.95rem;
}

.message.assistant .message-bubble {
    background: var(--assistant-bubble);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.message.user .message-bubble {
    background: var(--user-bubble);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(18, 21, 28, 0.96);
    box-shadow: var(--shadow);
}

.chat-input-area textarea {
    flex: 1;
    resize: none;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    max-height: 180px;
}

.chat-input-area textarea::placeholder {
    color: #7e8795;
}

.chat-input-area button,
.auth-form button,
.oauth-button {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    background: var(--accent);
    color: #08120d;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.18s ease, transform 0.18s ease;
}

.chat-input-area button:hover,
.auth-form button:hover,
.oauth-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.chat-input-area button:active,
.auth-form button:active,
.oauth-button:active {
    transform: translateY(0);
}

.oauth-button {
    display: block;
    width: 100%;
}

.oauth-button.disabled {
    background: #2a2f3a;
    color: #9097a5;
    cursor: not-allowed;
    transform: none;
}

.auth-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.auth-modal.open {
    display: flex;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 10, 0.72);
    backdrop-filter: blur(8px);
}

.auth-modal-card {
    position: relative;
    width: min(460px, calc(100% - 32px));
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: rgba(17, 20, 27, 0.97);
    box-shadow: var(--shadow);
}

.library-picker-modal-card {
    width: min(860px, calc(100% - 32px));
}

.library-picker-loading,
.library-picker-empty {
    margin-top: 22px;
    min-height: 240px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.025);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    padding: 24px;
}

.library-picker-loading[hidden],
.library-picker-grid[hidden],
.library-picker-empty[hidden] {
    display: none !important;
}

.library-picker-empty {
    flex-direction: column;
    gap: 10px;
}

.library-picker-empty h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.1rem;
}

.library-picker-empty p {
    margin: 0;
}

.library-picker-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    max-height: 56vh;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 127, 146, 0.45) rgba(255, 255, 255, 0.02);
}

.library-picker-card {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    background: rgba(12, 15, 21, 0.86);
    overflow: hidden;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.library-picker-card:hover {
    border-color: rgba(25, 195, 125, 0.22);
    background: rgba(17, 21, 28, 0.96);
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.24);
}

.library-picker-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.03);
}

.library-picker-card-body {
    padding: 12px 13px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.library-picker-card-title {
    color: #f4f7fb;
    font-size: 0.9rem;
    font-weight: 700;
}

.library-picker-card-meta {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.auth-modal-card h2 {
    margin: 0;
    font-size: 1.5rem;
}

.auth-modal-card p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.auth-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 22px;
}

.auth-modal-link {
    border-radius: 14px;
    padding: 12px 18px;
    background: var(--accent);
    color: #08120d;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.auth-modal-link.secondary {
    background: rgba(18, 21, 28, 0.96);
    color: var(--text);
    border: 1px solid var(--border);
}

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(460px, 100%);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: rgba(17, 20, 27, 0.94);
    box-shadow: var(--shadow);
}

.profile-card {
    width: min(860px, 100%);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: rgba(17, 20, 27, 0.94);
    box-shadow: var(--shadow);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.library-shell {
    height: 100vh;
    min-height: 0;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
}

.library-top {
    flex: 0 0 auto;
}

.library-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.library-eyebrow {
    margin: 0 0 8px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
}

.library-header h1 {
    margin: 0;
    font-size: 2rem;
}

.library-header p {
    margin: 10px 0 0;
    color: var(--muted);
}

.library-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.library-back-link.primary {
    background: var(--accent);
    border-color: transparent;
    color: #08120d;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
    gap: 18px;
    justify-content: start;
    align-content: start;
}

.library-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.library-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 127, 146, 0.45) rgba(255, 255, 255, 0.02);
}

.library-filter-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: #d6dde7;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.library-filter-tab:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #f5f8fc;
    transform: translateY(-1px);
}

.library-filter-tab.active {
    border-color: rgba(25, 195, 125, 0.22);
    background: linear-gradient(180deg, rgba(25, 195, 125, 0.16) 0%, rgba(25, 195, 125, 0.08) 100%);
    color: #eafff3;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.library-card {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    overflow: hidden;
    background: rgba(17, 20, 27, 0.92);
    box-shadow: var(--shadow);
}

.library-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.library-card-media img,
.library-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.library-card-media.is-video {
    background: #05070b;
}

.library-card-media.is-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top, rgba(25, 195, 125, 0.18), transparent 58%),
        linear-gradient(180deg, rgba(12, 16, 23, 0.98) 0%, rgba(8, 11, 16, 0.98) 100%);
}

.library-card-media.is-video img,
.library-card-media.is-video video {
    position: absolute;
    inset: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.library-card-media.is-video img {
    opacity: 1;
}

.library-card-video-preview {
    opacity: 0;
    pointer-events: none;
    background: #05070b;
}

.library-card-media.is-video.is-playing img {
    opacity: 0;
    transform: scale(1.03);
}

.library-card-media.is-video.is-playing .library-card-video-preview {
    opacity: 1;
}

.library-card-audio-art {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 40px);
    height: calc(100% - 40px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(11, 15, 21, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.library-card-audio-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(25, 195, 125, 0.14);
    color: #eafff3;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.library-audio-preview {
    width: 100%;
}

.library-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.library-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.library-type-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(25, 195, 125, 0.12);
    color: #d9fbe8;
    font-size: 0.83rem;
    font-weight: 700;
}

.library-date,
.library-project,
.library-prompt {
    color: var(--muted);
    font-size: 0.9rem;
}

.library-card-body h2 {
    margin: 0;
    font-size: 1.05rem;
}

.library-prompt {
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.library-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.library-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.library-action-button.danger {
    color: #ffd6d6;
}

.library-empty {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    background: rgba(17, 20, 27, 0.82);
}

.library-filter-empty {
    min-height: 320px;
}

.library-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.library-scroll-area::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 999px;
}

.library-scroll-area::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(82, 107, 122, 0.75) 0%, rgba(58, 76, 92, 0.82) 100%);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.library-scroll-area::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(104, 138, 158, 0.85) 0%, rgba(69, 96, 114, 0.92) 100%);
}

.calendar-app-shell {
    background:
        radial-gradient(circle at top left, rgba(25, 195, 125, 0.08), transparent 24%),
        linear-gradient(180deg, #101319 0%, #0b0d12 100%);
}

.calendar-sidebar {
    z-index: 10;
}

.calendar-sidebar-note {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.calendar-sidebar-note-kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b3f5d2;
}

.calendar-sidebar-note p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.calendar-main {
    flex: 1 1 auto;
    min-width: 0;
    height: 100vh;
    overflow: auto;
    padding: 28px;
}

.calendar-main-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calendar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.calendar-header h1 {
    margin: 0;
    font-size: 2rem;
}

.calendar-header p {
    margin: 10px 0 0;
    color: var(--muted);
}

.calendar-toolbar-card,
.calendar-board {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    background: rgba(18, 22, 29, 0.9);
    box-shadow: var(--shadow);
}

.calendar-toolbar-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
}

.calendar-toolbar-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.calendar-nav-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.calendar-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #eef2f7;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.calendar-nav-button:hover {
    border-color: rgba(25, 195, 125, 0.24);
    background: rgba(25, 195, 125, 0.08);
    transform: translateY(-1px);
}

.calendar-nav-button.is-primary {
    background: rgba(25, 195, 125, 0.16);
    border-color: rgba(25, 195, 125, 0.26);
    color: #e8fff3;
}

.calendar-month-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f3f7fb;
}

.calendar-toolbar-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    width: min(520px, 100%);
}

.calendar-stat-card {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-stat-card strong {
    font-size: 1.25rem;
    font-weight: 800;
    color: #f5f7fb;
}

.calendar-stat-label {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.calendar-board {
    flex: 1 1 auto;
    min-height: 0;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.calendar-board-head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.calendar-weekday {
    padding: 0 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.calendar-board-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(138px, 1fr);
    gap: 10px;
}

.calendar-day-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
    position: relative;
}

.calendar-day-card:hover,
.calendar-day-card:focus-visible {
    outline: none;
    border-color: rgba(25, 195, 125, 0.24);
    background: rgba(25, 195, 125, 0.05);
    transform: translateY(-1px);
}

.calendar-day-card.is-outside {
    background: rgba(255, 255, 255, 0.015);
    color: rgba(236, 239, 244, 0.45);
}

.calendar-day-card.is-today {
    border-color: rgba(25, 195, 125, 0.3);
    box-shadow: inset 0 0 0 1px rgba(25, 195, 125, 0.12);
}

.calendar-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.calendar-day-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.calendar-day-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-day-action-button {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #eef2f7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.calendar-day-action-button svg {
    width: 14px;
    height: 14px;
    display: block;
}

.calendar-day-action-button:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
}

.calendar-day-action-button.is-primary {
    background: rgba(25, 195, 125, 0.16);
    border-color: rgba(25, 195, 125, 0.26);
    color: #ddffeb;
}

.calendar-day-number {
    font-size: 1rem;
    font-weight: 700;
    color: inherit;
}

.calendar-today-marker {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(25, 195, 125, 0.14);
    color: #dffded;
    font-size: 0.72rem;
    font-weight: 700;
}

.calendar-day-items {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-entry-chip {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: #eef2f7;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.calendar-entry-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.14);
}

.calendar-entry-chip.status-draft {
    background: rgba(148, 163, 184, 0.1);
}

.calendar-entry-chip.status-scheduled {
    background: rgba(96, 165, 250, 0.13);
}

.calendar-entry-chip.status-published {
    background: rgba(34, 197, 94, 0.13);
}

.calendar-entry-chip.status-failed {
    background: rgba(248, 113, 113, 0.13);
}

.calendar-entry-platform,
.calendar-meta-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.calendar-entry-platform {
    flex: 0 0 auto;
    width: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
}

.calendar-platform-pill {
    gap: 6px;
}

.calendar-platform-icon {
    width: 14px;
    height: 14px;
    display: block;
    flex: 0 0 auto;
}

.calendar-entry-platform.platform-instagram,
.calendar-meta-pill.platform-instagram {
    background: rgba(232, 121, 249, 0.18);
    color: #f6c2ff;
}

.calendar-entry-platform.platform-facebook,
.calendar-meta-pill.platform-facebook {
    background: rgba(96, 165, 250, 0.18);
    color: #cae3ff;
}

.calendar-entry-platform.platform-tiktok,
.calendar-meta-pill.platform-tiktok {
    background: rgba(125, 211, 252, 0.18);
    color: #ccf0ff;
}

.calendar-entry-platform.platform-linkedin,
.calendar-meta-pill.platform-linkedin {
    background: rgba(56, 189, 248, 0.18);
    color: #d1f4ff;
}

.calendar-entry-platform.platform-other,
.calendar-meta-pill.platform-other {
    background: rgba(255, 255, 255, 0.12);
    color: #e8edf4;
}

.calendar-meta-pill.status-draft {
    background: rgba(148, 163, 184, 0.14);
    color: #dbe4ee;
}

.calendar-meta-pill.status-scheduled {
    background: rgba(96, 165, 250, 0.16);
    color: #d8ebff;
}

.calendar-meta-pill.status-published {
    background: rgba(34, 197, 94, 0.16);
    color: #d8ffea;
}

.calendar-meta-pill.status-failed {
    background: rgba(248, 113, 113, 0.16);
    color: #ffe1e1;
}

.calendar-entry-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.84rem;
    font-weight: 600;
}

.calendar-entry-time {
    flex: 0 0 auto;
    color: rgba(236, 239, 244, 0.78);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.calendar-day-empty {
    margin-top: auto;
    color: rgba(154, 163, 178, 0.72);
    font-size: 0.82rem;
}

.calendar-day-more {
    color: #d7fbe8;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
}

.calendar-entry-hovercard {
    position: fixed;
    z-index: 1200;
    width: min(280px, calc(100vw - 32px));
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(15, 18, 25, 0.98);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.36);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    pointer-events: none;
}

.calendar-entry-hovercard.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.calendar-entry-hovercard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.calendar-entry-hovercard-head strong {
    font-size: 0.95rem;
    line-height: 1.4;
}

.calendar-hovercard-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #eef2f7;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.calendar-entry-hovercard-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.calendar-entry-hovercard-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.calendar-entry-hovercard-description {
    margin: 12px 0 0;
    color: #dfe6ef;
    font-size: 0.86rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.calendar-modal-card {
    width: min(760px, calc(100% - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.calendar-modal-meta {
    margin-top: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.calendar-item-form {
    margin-top: 18px;
}

.calendar-platform-picker {
    margin-bottom: 18px;
}

.calendar-platform-picker-label {
    display: block;
    margin-bottom: 10px;
    color: #eef2f7;
    font-size: 0.9rem;
    font-weight: 700;
}

.calendar-platform-button-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.calendar-platform-choice {
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #eef2f7;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.calendar-platform-choice:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
}

.calendar-platform-choice.is-active {
    border-color: rgba(25, 195, 125, 0.42);
    background: rgba(25, 195, 125, 0.14);
    color: #f4fff8;
    box-shadow: inset 0 0 0 1px rgba(25, 195, 125, 0.16);
}

.calendar-form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.calendar-form-row-platform {
    margin-top: 12px;
}

.calendar-form-field {
    min-width: 0;
}

.calendar-form-field-span-2 {
    grid-column: span 2;
}

.calendar-option-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-option-choice {
    flex: 1 1 140px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #eef2f7;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.calendar-option-choice:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
}

.calendar-option-choice.is-active {
    border-color: rgba(25, 195, 125, 0.42);
    background: rgba(25, 195, 125, 0.14);
    color: #f4fff8;
    box-shadow: inset 0 0 0 1px rgba(25, 195, 125, 0.16);
}

.calendar-option-choice:disabled {
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.025);
    color: rgba(238, 242, 247, 0.45);
    transform: none;
    box-shadow: none;
}

.calendar-field-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.calendar-asset-selector {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.calendar-asset-selector-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.calendar-asset-selector-head label {
    display: block;
    margin: 0;
}

.calendar-asset-selector-copy {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.calendar-selected-asset {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 100px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(12, 15, 21, 0.55);
}

.calendar-selected-asset.is-empty {
    grid-template-columns: minmax(0, 1fr);
}

.calendar-selected-asset img {
    display: block;
    width: 88px;
    height: 88px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.03);
}

.calendar-selected-asset-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-selected-asset-body strong {
    color: #f4f7fb;
    font-size: 0.92rem;
    line-height: 1.4;
}

.calendar-selected-asset-body span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
    word-break: break-word;
}

.calendar-selected-asset-placeholder {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.calendar-asset-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-asset-actions .secondary-button {
    min-width: 0;
}

.calendar-platform-toggle-group {
    margin: 16px 0 0;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.calendar-platform-toggle-group legend {
    padding: 0 8px;
    color: #eef2f7;
    font-size: 0.86rem;
    font-weight: 700;
}

.calendar-toggle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.calendar-toggle-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #eef2f7;
}

.calendar-toggle-option input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.calendar-modal-actions {
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.calendar-submit-button {
    min-width: 124px;
    padding: 11px 16px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #08120d;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.calendar-submit-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.form-field-error {
    margin: 6px 0 0;
    color: #fca5a5;
    font-size: 0.84rem;
}

.calendar-day-page-header {
    gap: 20px;
}

.calendar-day-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.calendar-day-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.calendar-day-summary-card,
.calendar-day-timeline-panel,
.calendar-day-sidebar-panel {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    background: rgba(18, 22, 29, 0.9);
    box-shadow: var(--shadow);
}

.calendar-day-summary-card {
    padding: 18px 20px;
}

.calendar-day-summary-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.6rem;
}

.calendar-day-summary-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

.calendar-day-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
    gap: 16px;
}

.calendar-day-timeline-panel,
.calendar-day-sidebar-panel {
    padding: 20px;
}

.calendar-day-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.calendar-day-panel-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.calendar-day-panel-header span {
    color: var(--muted);
    font-size: 0.9rem;
}

.calendar-day-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calendar-timeline-item {
    display: grid;
    grid-template-columns: 88px 24px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.calendar-timeline-time-block {
    padding-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.calendar-timeline-time {
    font-size: 1rem;
    font-weight: 800;
    color: #f6f9fc;
}

.calendar-timeline-time-date {
    color: var(--muted);
    font-size: 0.78rem;
}

.calendar-timeline-line {
    position: relative;
    display: flex;
    justify-content: center;
}

.calendar-timeline-line::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: -16px;
    width: 2px;
    background: rgba(255, 255, 255, 0.08);
}

.calendar-timeline-item:last-child .calendar-timeline-line::before {
    bottom: 0;
}

.calendar-timeline-node {
    position: relative;
    z-index: 1;
    width: 12px;
    height: 12px;
    margin-top: 10px;
    border-radius: 999px;
    background: rgba(25, 195, 125, 0.9);
    box-shadow: 0 0 0 4px rgba(25, 195, 125, 0.12);
}

.calendar-timeline-item.status-published .calendar-timeline-node {
    background: rgba(34, 197, 94, 0.95);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.calendar-timeline-item.status-failed .calendar-timeline-node {
    background: rgba(248, 113, 113, 0.95);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.14);
}

.calendar-timeline-item.status-draft .calendar-timeline-node {
    background: rgba(148, 163, 184, 0.95);
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14);
}

.calendar-timeline-card {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.calendar-timeline-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.calendar-timeline-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.calendar-timeline-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.calendar-timeline-delete-form {
    margin: 0;
}

.calendar-timeline-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #eef2f7;
    text-decoration: none;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.calendar-timeline-action-button:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
}

.calendar-timeline-action-button.danger {
    color: #ffd7d7;
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.16);
}

.calendar-timeline-card h3 {
    margin: 14px 0 8px;
    font-size: 1rem;
}

.calendar-timeline-card p {
    margin: 0;
    color: #dce5ee;
    line-height: 1.6;
    white-space: pre-wrap;
}

.calendar-timeline-copy-block {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.calendar-timeline-copy-block.is-secondary {
    background: rgba(255, 255, 255, 0.02);
}

.calendar-timeline-copy-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.calendar-timeline-detail-sections {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.calendar-timeline-detail-section {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.calendar-timeline-detail-section h4 {
    margin: 0 0 10px;
    color: #eef2f7;
    font-size: 0.84rem;
}

.calendar-timeline-detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.calendar-timeline-detail-row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
}

.calendar-timeline-detail-row dt {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.calendar-timeline-detail-row dd {
    margin: 0;
    color: #eef2f7;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.calendar-timeline-detail-row dd a {
    color: var(--accent);
    text-decoration: none;
}

.calendar-timeline-detail-row dd a:hover {
    text-decoration: underline;
}

.calendar-platform-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calendar-platform-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.calendar-platform-breakdown-label {
    min-width: 0;
}

.calendar-day-empty-panel {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

.calendar-day-empty-panel h2 {
    margin: 0;
    font-size: 1.2rem;
}

.calendar-day-empty-panel p,
.calendar-day-sidebar-empty {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.profile-section {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    background: rgba(12, 15, 21, 0.55);
}

.profile-section h2 {
    margin: 0 0 14px;
    font-size: 1.05rem;
}

.profile-note {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.5;
}

.profile-billing-strip {
    margin-top: 22px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    background: rgba(12, 15, 21, 0.76);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.profile-billing-strip strong {
    display: block;
    font-size: 1rem;
}

.profile-billing-strip p {
    margin: 6px 0 0;
    color: var(--muted);
}

.generation-confirm-card {
    width: min(520px, calc(100% - 32px));
}

.generation-confirm-summary {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(12, 15, 21, 0.7);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.generation-confirm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
}

.generation-confirm-row strong {
    color: var(--text);
    text-align: right;
}

.generation-confirm-note {
    margin-top: 16px !important;
    color: #d9fbe8 !important;
    line-height: 1.55;
}

.generation-confirm-button {
    min-width: 160px;
    padding: 11px 18px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: var(--accent) !important;
    color: #08120d !important;
    font: inherit !important;
    font-weight: 800 !important;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.generation-confirm-button:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px);
}

.generation-confirm-button:disabled {
    cursor: default;
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(236, 239, 244, 0.6) !important;
    transform: none;
}

.billing-shell {
    min-height: 100vh;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
}

.billing-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.billing-header h1 {
    margin: 0;
    font-size: 2rem;
}

.billing-header p {
    margin: 10px 0 0;
    color: var(--muted);
}

.billing-header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.billing-eyebrow {
    margin: 0 0 8px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
}

.billing-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.billing-summary-card,
.billing-callout,
.pricing-card,
.billing-activity-item,
.billing-activity-empty {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    background: rgba(17, 20, 27, 0.9);
    box-shadow: var(--shadow);
}

.billing-summary-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.billing-summary-card strong {
    font-size: 1.8rem;
    line-height: 1;
}

.billing-summary-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.billing-summary-label {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.billing-callout {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(180deg, rgba(22, 28, 38, 0.96) 0%, rgba(13, 17, 24, 0.98) 100%);
}

.billing-callout.danger {
    border-color: rgba(248, 113, 113, 0.18);
    background: linear-gradient(180deg, rgba(58, 20, 20, 0.92) 0%, rgba(24, 15, 18, 0.98) 100%);
}

.billing-callout h2 {
    margin: 0;
    font-size: 1.45rem;
}

.billing-callout p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.billing-callout.danger p {
    color: #f1cccc;
}

.billing-callout-kicker {
    color: #d9fbe8;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.billing-callout.danger .billing-callout-kicker {
    color: #ffb4b4;
}

.billing-callout-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.billing-inline-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    background: var(--accent);
    color: #08120d;
}

.billing-inline-link.secondary {
    background: rgba(18, 21, 28, 0.92);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.billing-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.billing-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.billing-section-header h2 {
    margin: 0;
    font-size: 1.45rem;
}

.billing-section-header p {
    margin: 0;
    color: var(--muted);
    max-width: 420px;
    line-height: 1.5;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.pricing-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pricing-card.featured {
    border-color: rgba(25, 195, 125, 0.22);
    background: linear-gradient(180deg, rgba(16, 33, 28, 0.94) 0%, rgba(13, 18, 24, 0.98) 100%);
}

.pricing-card.active {
    border-color: rgba(25, 195, 125, 0.28);
    box-shadow: 0 0 0 1px rgba(25, 195, 125, 0.12), var(--shadow);
}

.pricing-card h3 {
    margin: 0;
    font-size: 1.3rem;
}

.pricing-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.pricing-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pricing-badge,
.pricing-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pricing-badge {
    background: rgba(255, 255, 255, 0.05);
    color: #dfe6ef;
}

.pricing-status {
    background: rgba(25, 195, 125, 0.14);
    color: #d9fbe8;
}

.pricing-credit-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.pricing-credit-copy {
    color: var(--muted);
    font-size: 0.92rem;
}

.pricing-cta {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    background: var(--accent);
    color: #08120d;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.pricing-cta:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.pricing-cta:disabled {
    cursor: default;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(236, 239, 244, 0.6);
    transform: none;
}

.pricing-note {
    margin-top: auto;
    font-size: 0.83rem;
}

.billing-activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.billing-activity-item,
.billing-activity-empty {
    padding: 18px 20px;
}

.billing-activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.billing-activity-item strong,
.billing-activity-empty h3 {
    display: block;
    margin: 0;
    font-size: 1rem;
}

.billing-activity-item p,
.billing-activity-empty p {
    margin: 6px 0 0;
    color: var(--muted);
}

.billing-activity-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    text-align: right;
}

.billing-activity-values span {
    font-size: 1rem;
    font-weight: 800;
}

.billing-activity-values span.positive {
    color: #9bf0c8;
}

.billing-activity-values span.negative {
    color: #ffb4b4;
}

.billing-activity-values small {
    color: var(--muted);
    font-size: 0.82rem;
}

.auth-brand h1 {
    margin: 0;
    font-size: 1.8rem;
}

.auth-brand p {
    margin: 10px 0 0;
    color: var(--muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.auth-form label {
    font-size: 0.95rem;
    color: #d8dee9;
}

.auth-form input {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 14px;
    background: rgba(12, 15, 21, 0.95);
    color: var(--text);
    font: inherit;
    outline: none;
}

.auth-form input:focus {
    border-color: rgba(25, 195, 125, 0.6);
}

.auth-form textarea,
.auth-form select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 14px;
    background: rgba(12, 15, 21, 0.95);
    color: var(--text);
    font: inherit;
    outline: none;
}

.auth-form textarea {
    resize: vertical;
    min-height: 96px;
}

.auth-form select {
    min-height: 50px;
}

.auth-form textarea:focus,
.auth-form select:focus {
    border-color: rgba(25, 195, 125, 0.6);
}

.auth-help-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: -2px;
}

.auth-inline-link {
    color: #d9fbe8;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
}

.auth-inline-link:hover {
    color: #ffffff;
}

.auth-note {
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.auth-note strong {
    color: var(--text);
}

.project-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    justify-content: flex-end;
}

.secondary-button {
    min-width: 92px;
    padding: 11px 16px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    color: #eef2f7 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}

.danger-button {
    min-width: 92px;
    padding: 11px 16px !important;
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.92) 100%) !important;
    color: white !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.2);
}

.danger-button:hover {
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.98) 0%, rgba(220, 38, 38, 0.96) 100%) !important;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 22px 0 18px;
    color: var(--muted);
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border);
}

.auth-divider span {
    position: relative;
    padding: 0 12px;
    background: rgba(17, 20, 27, 0.94);
}

.auth-footer {
    margin: 18px 0 0;
    color: var(--muted);
    text-align: center;
}

.auth-footer a {
    color: #d9fbe8;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.calendar-accounts-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(11, 15, 22, 0.9);
}

.calendar-connect-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.calendar-accounts-list {
    display: grid;
    gap: 14px;
}

.calendar-account-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.calendar-account-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.calendar-account-card-title {
    display: grid;
    gap: 8px;
}

.calendar-account-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.calendar-account-status-stack {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.calendar-account-card-body p,
.calendar-account-error {
    margin: 0;
}

.calendar-account-error {
    color: #fda4af;
}

.calendar-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.calendar-account-actions form {
    margin: 0;
}

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

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@media (max-width: 1100px) {
    .sidebar {
        display: none;
    }

    .chat-column {
        flex: 1 1 auto;
        padding: 18px;
    }
}

@media (max-width: 720px) {
    .upload-flow-stepper {
        grid-template-columns: 1fr;
    }

    .upload-flow-summary-card {
        grid-template-columns: 1fr;
    }

    .upload-flow-summary-image {
        width: 100%;
        max-width: 112px;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .upload-flow-summary-button {
        width: 100%;
    }

    .image-source-options {
        grid-template-columns: 1fr;
    }

    .chat-header-bar {
        flex-direction: column;
    }

    .chat-meta {
        justify-content: flex-start;
    }

    .auth-card {
        padding: 24px;
    }

    .profile-card {
        padding: 24px;
    }

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

    .profile-billing-strip,
    .billing-header,
    .billing-section-header,
    .billing-activity-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .generation-confirm-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .billing-summary-grid,
    .pricing-grid,
    .pricing-grid.compact {
        grid-template-columns: 1fr;
    }

    .billing-shell {
        padding: 20px;
    }

    .calendar-main {
        padding: 20px;
    }

    .calendar-header,
    .calendar-toolbar-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .calendar-day-page-actions {
        justify-content: flex-start;
    }

    .calendar-toolbar-stats {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-day-summary-grid,
    .calendar-day-layout {
        grid-template-columns: 1fr;
    }

    .calendar-connect-button-row,
    .calendar-account-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-board {
        overflow: auto;
    }

    .calendar-board-head,
    .calendar-board-grid {
        min-width: 840px;
    }

    .calendar-form-row {
        grid-template-columns: 1fr;
    }

    .calendar-form-field-span-2 {
        grid-column: auto;
    }

    .calendar-platform-button-group,
    .calendar-option-button-group,
    .calendar-toggle-grid,
    .calendar-timeline-detail-row {
        grid-template-columns: 1fr;
    }

    .calendar-selected-asset {
        grid-template-columns: 1fr;
    }

    .calendar-selected-asset img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .calendar-timeline-item {
        grid-template-columns: 1fr;
    }

    .calendar-timeline-time-block {
        align-items: flex-start;
        padding-top: 0;
    }

    .calendar-timeline-line {
        display: none;
    }

    .chat-welcome-copy h2 {
        font-size: 1.6rem;
    }

    .feature-button-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}
