:root {
    --bg-top: #061227;
    --bg-bottom: #0b2f67;
    --panel: rgba(8, 22, 46, 0.9);
    --panel-soft: rgba(15, 41, 86, 0.82);
    --line: rgba(112, 183, 255, 0.24);
    --text: #f8fbff;
    --muted: #bfd4f4;
    --blue: #1991ff;
    --green: #8fe600;
    --yellow: #ffd71a;
    --navy: #04122d;
    --danger: #ff7b54;
    --shadow: 0 22px 60px rgba(1, 10, 28, 0.45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 15% 20%, rgba(25, 145, 255, 0.36), transparent 24%),
        radial-gradient(circle at 82% 22%, rgba(255, 215, 26, 0.26), transparent 18%),
        radial-gradient(circle at 52% 10%, rgba(143, 230, 0, 0.22), transparent 14%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    width: 180px;
    height: 180px;
    border-radius: 36px;
    transform: rotate(16deg);
    opacity: 0.13;
    pointer-events: none;
}

body::before {
    top: 120px;
    right: 8%;
    background: linear-gradient(135deg, var(--yellow), #ff8a00);
}

body::after {
    bottom: 70px;
    left: 6%;
    background: linear-gradient(135deg, var(--blue), #2be0ff);
}

.shell {
    width: min(1220px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 32px 0 52px;
}

.hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.hero-copy,
.upload-card,
.job-card,
.empty-state,
.dialog-shell {
    position: relative;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(8, 22, 46, 0.96), rgba(11, 36, 74, 0.92));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-copy,
.upload-card {
    border-radius: 32px;
    padding: 26px;
}

.hero-copy::before,
.upload-card::before,
.job-card::before,
.dialog-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 40%);
    pointer-events: none;
}

.eyebrow,
.job-status {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: var(--green);
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 0.96;
}

h1 {
    font-size: clamp(2.6rem, 6vw, 5.2rem);
    max-width: 12ch;
    text-shadow: 0 5px 0 rgba(2, 8, 21, 0.65);
}

.brand-line {
    display: inline-block;
    color: var(--yellow);
}

.subtle {
    margin-top: 16px;
    color: var(--muted);
    max-width: 60ch;
    font-size: 1rem;
    line-height: 1.55;
}

.hero-stats {
    margin-top: 22px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-stat {
    min-width: 140px;
    padding: 14px 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(18, 58, 118, 0.95), rgba(8, 29, 63, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.hero-stat strong {
    display: block;
    font-size: 1.5rem;
    color: var(--yellow);
}

.upload-card {
    display: grid;
    gap: 18px;
}

.card-title {
    font-size: 1.4rem;
}

.card-note {
    color: var(--muted);
    line-height: 1.45;
    margin: 0;
}

.login-error {
    color: #ffd6c9;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 123, 84, 0.14);
    border: 1px solid rgba(255, 123, 84, 0.32);
}

form {
    display: grid;
    gap: 12px;
}

label {
    display: grid;
    gap: 6px;
}

label span {
    color: #dbe8ff;
    font-size: 0.92rem;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 18px;
    border: 1px solid rgba(140, 197, 255, 0.22);
    color: var(--text);
    background: rgba(4, 17, 39, 0.88);
}

textarea {
    resize: vertical;
}

button {
    border: 0;
    border-radius: 999px;
    padding: 13px 18px;
    background: linear-gradient(180deg, var(--yellow), #ffb400);
    color: #102240;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(255, 187, 0, 0.24);
}

button:hover {
    transform: translateY(-1px);
}

button.ghost,
.review-button {
    background: linear-gradient(180deg, #2fd0ff, var(--blue));
    color: white;
    box-shadow: 0 8px 18px rgba(0, 120, 255, 0.24);
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 999px;
    padding: 13px 18px;
    font-weight: 800;
}

.jobs {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.analytics-strip {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 18px;
    align-items: start;
}

.analytics-board {
    margin-top: 28px;
}

.analytics-explainer {
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.explainer-card {
    padding: 16px 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(10, 31, 64, 0.95), rgba(7, 24, 49, 0.9));
    border: 1px solid rgba(118, 178, 255, 0.16);
}

.explainer-card strong {
    display: block;
    margin-bottom: 8px;
    color: var(--yellow);
}

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

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 14px;
}

.analytics-grid {
    margin-top: 0;
}

.analytics-card h2 {
    font-size: 1.9rem;
}

.analytics-card header {
    align-items: start;
}

.analytics-takeaway {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.45;
    max-width: 28ch;
}

.analytics-signal-row {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    align-items: start;
}

.analytics-signal-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.signal-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    flex: 0 0 auto;
    margin-top: 4px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

.signal-green {
    background: #8fe600;
}

.signal-yellow {
    background: #ffd71a;
}

.signal-blue {
    background: #2fd0ff;
}

.analytics-takeaway strong {
    color: var(--yellow);
}

.analytics-confidence {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
    min-width: 0;
    max-width: 100%;
}

.confidence-strong {
    background: rgba(143, 230, 0, 0.14);
    color: #c8ff75;
    border: 1px solid rgba(143, 230, 0, 0.3);
}

.confidence-medium {
    background: rgba(255, 215, 26, 0.14);
    color: #ffe876;
    border: 1px solid rgba(255, 215, 26, 0.28);
}

.confidence-light {
    background: rgba(47, 208, 255, 0.12);
    color: #8fe9ff;
    border: 1px solid rgba(47, 208, 255, 0.24);
}

.analytics-footnote {
    margin: 16px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.analytics-next-step {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(118, 178, 255, 0.16);
}

.analytics-next-step strong {
    display: block;
    margin-bottom: 6px;
    color: var(--yellow);
}

.analytics-next-step p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.connector-card {
    border-radius: 28px;
    padding: 20px 22px;
    min-width: 0;
}

.connector-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 16px;
    align-items: start;
}

.connector-head > div,
.connector-meta,
.connector-actions,
.job-meta-row dd {
    min-width: 0;
}

.connector-card h2 {
    font-size: clamp(1.25rem, 1.8vw, 1.7rem);
    line-height: 1.08;
    max-width: 12ch;
    overflow-wrap: anywhere;
}

.connector-card .analytics-confidence {
    justify-self: end;
    width: fit-content;
}

.connector-meta {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.connector-code-row dd {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.connector-code-row code {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

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

.job-card,
.empty-state {
    border-radius: 28px;
    padding: 22px;
}

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

.job-card h2 {
    font-size: 1.65rem;
    max-width: 14ch;
}

.job-meta {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.job-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.job-meta-row dt {
    color: #98bdf4;
}

.job-meta-row dd {
    margin: 0;
    text-align: right;
}

.job-footer {
    margin-top: 16px;
    color: var(--muted);
    line-height: 1.45;
}

.progress-panel {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

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

.progress-meta span {
    color: var(--muted);
}

.progress-bar {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(118, 178, 255, 0.16);
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green), var(--yellow));
}

.card-preview {
    margin-top: 16px;
}

.preview-headline {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.preview-headline strong {
    font-size: 1rem;
    color: white;
}

.preview-headline span {
    color: var(--muted);
    font-size: 0.9rem;
}

.card-preview video {
    width: 100%;
    border-radius: 20px;
    border: 1px solid rgba(118, 178, 255, 0.18);
    background: rgba(4, 17, 39, 0.92);
}

dialog {
    width: min(980px, calc(100vw - 24px));
    border: none;
    padding: 0;
    background: transparent;
}

dialog::backdrop {
    background: rgba(0, 8, 24, 0.72);
}

.dialog-shell {
    border-radius: 32px;
    padding: 26px;
}

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

.dialog-body {
    margin-top: 18px;
    display: grid;
    gap: 14px;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.reel-section {
    display: grid;
    gap: 14px;
}

.section-label h3 {
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.section-label p {
    margin: 0;
    color: var(--muted);
}

.reel-grid {
    display: grid;
    gap: 14px;
}

.reel-card {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(12, 36, 74, 0.92), rgba(7, 25, 51, 0.92));
    border: 1px solid rgba(118, 178, 255, 0.18);
}

.reel-copy,
.reel-preview {
    display: grid;
    gap: 12px;
}

.reel-topline,
.reel-priority-group,
.platform-package-head,
.compare-metrics,
.compare-toolbar,
.compare-grid,
.reel-command-center,
.compare-tray,
.thumbnail-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reel-topline,
.platform-package-head {
    justify-content: space-between;
    align-items: center;
}

.reel-priority-group,
.compare-metrics,
.compare-toolbar,
.compare-grid,
.reel-command-center,
.compare-tray {
    align-items: center;
}

.reel-command-center,
.compare-tray {
    display: grid;
    gap: 14px;
}

.compare-toolbar {
    align-items: stretch;
}

.thumbnail-grid {
    align-items: stretch;
}

.compare-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.compare-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.priority-badge.must-post {
    background: rgba(143, 230, 0, 0.14);
    color: #c8ff75;
    border: 1px solid rgba(143, 230, 0, 0.3);
}

.priority-badge.strong-backup {
    background: rgba(255, 215, 26, 0.14);
    color: #ffe876;
    border: 1px solid rgba(255, 215, 26, 0.28);
}

.priority-badge.optional {
    background: rgba(47, 208, 255, 0.12);
    color: #8fe9ff;
    border: 1px solid rgba(47, 208, 255, 0.24);
}

.post-first-card,
.thumbnail-picker {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(118, 178, 255, 0.16);
}

.thumbnail-option {
    position: relative;
    width: min(180px, 100%);
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(12, 36, 74, 0.92), rgba(7, 25, 51, 0.92));
    border: 1px solid rgba(118, 178, 255, 0.18);
    cursor: pointer;
}

.thumbnail-option input[type="radio"] {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
}

.thumbnail-option img {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(118, 178, 255, 0.18);
    background: rgba(4, 17, 39, 0.92);
}

.thumbnail-option span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.88rem;
}

.reel-preview video,
.video-fallback {
    width: 100%;
    min-height: 520px;
    aspect-ratio: 9 / 16;
    object-fit: contain;
    border-radius: 20px;
    background: rgba(4, 17, 39, 0.92);
    border: 1px solid rgba(140, 197, 255, 0.18);
}

.video-fallback {
    display: grid;
    place-items: center;
    color: var(--muted);
}

.reel-meta,
.scoreline,
.summary-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.reel-quick-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.reel-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(118, 178, 255, 0.16);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.reel-meta {
    justify-content: space-between;
}

.scoreline span {
    color: var(--muted);
}

.summary-pill {
    min-width: 140px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(118, 178, 255, 0.16);
}

.summary-pill strong,
.summary-pill span {
    display: block;
}

.summary-pill span {
    margin-top: 4px;
    color: var(--yellow);
}

.score-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.reel-packages {
    display: grid;
    gap: 12px;
}

.platform-package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.platform-package-card {
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(12, 36, 74, 0.92), rgba(7, 25, 51, 0.92));
    border: 1px solid rgba(118, 178, 255, 0.18);
}

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

.checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.platform-score-card {
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(12, 36, 74, 0.92), rgba(7, 25, 51, 0.92));
    border: 1px solid rgba(118, 178, 255, 0.18);
}

.platform-score-card h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.platform-score-card.mini h3 {
    font-size: 1.2rem;
    margin-bottom: 0;
}

.platform-score-card p:last-child {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.platform-card {
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(12, 36, 74, 0.92), rgba(7, 25, 51, 0.92));
    border: 1px solid rgba(118, 178, 255, 0.18);
}

.platform-card h3 {
    margin-bottom: 10px;
    text-transform: capitalize;
}

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

.compare-card {
    min-width: 220px;
    flex: 1 1 220px;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(12, 36, 74, 0.92), rgba(7, 25, 51, 0.92));
    border: 1px solid rgba(118, 178, 255, 0.18);
}

.compare-card p {
    margin: 0;
}

pre {
    margin: 0;
    padding: 16px;
    overflow: auto;
    border-radius: 18px;
    background: rgba(4, 17, 39, 0.9);
    border: 1px solid rgba(140, 197, 255, 0.18);
    color: #cde1ff;
}

.copy-preview {
    margin-top: 14px;
}

.copy-preview summary {
    cursor: pointer;
    color: var(--yellow);
    font-weight: 800;
    margin-bottom: 10px;
}

code {
    color: var(--yellow);
}

@media (max-width: 880px) {
    .hero {
        grid-template-columns: 1fr;
    }

    h1 {
        max-width: none;
    }

    .job-card header {
        flex-direction: column;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
    }

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

    .analytics-strip {
        grid-template-columns: 1fr;
    }

    .connector-head {
        grid-template-columns: 1fr;
    }

    .connector-card .analytics-confidence {
        justify-self: start;
    }
}

.legal-shell {
    padding-top: 48px;
}

.legal-card {
    max-width: 860px;
}

.legal-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
