:root {
    --bg: #050509;
    --bg-soft: #0c0c13;
    --panel: rgba(18,18,27,0.9);
    --panel-solid: #12121b;
    --panel-soft: #1b1b27;
    --text: #fff7fb;
    --muted: #b8a9b2;
    --line: rgba(255,255,255,0.1);
    --accent: #a9004f;
    --accent-2: #d31368;
    --accent-soft: rgba(169,0,79,0.18);
    --danger: #fb7185;
    --success: #34d399;
    --warning: #fbbf24;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(169,0,79,0.28), transparent 34rem),
        radial-gradient(circle at bottom right, rgba(211,19,104,0.16), transparent 28rem),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}
a { color: #ff7ab2; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, .button-link {
    border: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    padding: 0.9rem 1.05rem;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    box-shadow: 0 12px 34px rgba(169,0,79,0.28);
}
button:hover, .button-link:hover { opacity: .94; text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
.secondary { background: rgba(255,255,255,0.08); color: var(--text); box-shadow: none; }
.link-button { background: transparent; color: #ff7ab2; padding: 0; border-radius: 0; font-weight: 700; box-shadow: none; }
.link-button.danger { color: var(--danger); }

.login-body { display: grid; place-items: center; padding: 1.5rem; }
.login-card {
    width: min(100%, 500px);
    background: rgba(18,18,27,0.88);
    border: 1px solid var(--line);
    border-radius: 1.6rem;
    padding: 2rem;
    box-shadow: 0 26px 90px rgba(0,0,0,0.45);
    backdrop-filter: blur(18px);
}
.login-card h1 { margin: 1.6rem 0 .6rem; font-size: clamp(2.2rem, 8vw, 4rem); line-height: .95; letter-spacing: -0.06em; }
.login-card p { color: var(--muted); font-size: 1.02rem; line-height: 1.6; }
.login-brand { margin-bottom: 1rem; }
.small-link { display: block; margin-top: 1.25rem; color: var(--muted); }

.app-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.3rem 0;
}
.brand { color: var(--text); display: inline-flex; align-items: center; gap: .85rem; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-logo {
    width: clamp(190px, 24vw, 310px);
    max-width: 52vw;
    height: auto;
    display: block;
    object-fit: contain;
}
.brand-text { display: none; }
.brand small { display: block; color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.topbar nav {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: .35rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
}
.topbar nav a { color: var(--muted); font-weight: 750; padding: .55rem .75rem; border-radius: 999px; }
.topbar nav a:hover { color: var(--text); background: rgba(255,255,255,0.06); text-decoration: none; }
.main { padding: 1rem 0 3rem; }

.hero-card, .panel, .card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 1.35rem;
    box-shadow: 0 18px 70px rgba(0,0,0,0.25);
    backdrop-filter: blur(18px);
}
.hero-card { padding: clamp(1.4rem, 4vw, 2.7rem); margin-bottom: 1rem; }
.hero-split { display: grid; grid-template-columns: 1fr minmax(220px, 300px); gap: 1rem; align-items: end; }
.hero-card h1, .page-head h1 { margin: 0 0 .65rem; font-size: clamp(2.2rem, 6vw, 5rem); line-height: .9; letter-spacing: -0.07em; }
.hero-card p, .page-head p { color: var(--muted); max-width: 780px; line-height: 1.6; }
.eyebrow { color: #ff7ab2 !important; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; font-size: .76rem; }
.page-head { margin-bottom: 1rem; }
.status-card { background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 1.1rem; padding: 1rem; }
.status-card span, .status-card small { color: var(--muted); display: block; }
.status-card strong { display: block; font-size: 2rem; margin: .2rem 0; }

.grid { display: grid; gap: 1rem; }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1rem; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { padding: 1.25rem; }
.card span { color: var(--muted); display: block; margin-bottom: .5rem; }
.card strong { font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: -0.04em; }
.panel { padding: 1.25rem; margin-bottom: 1rem; }
.panel h2 { margin-top: 0; }
.action-panel { color: var(--text); display: block; }
.action-panel:hover { text-decoration: none; border-color: rgba(211,19,104,0.6); }
.muted { color: var(--muted); }

.form-stack { display: grid; gap: .8rem; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.span-2 { grid-column: span 2; }
label { display: grid; gap: .45rem; color: var(--muted); font-weight: 700; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    padding: .9rem 1rem;
    border-radius: .95rem;
    outline: none;
}
textarea { resize: vertical; }
select option { color: #111827; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(211,19,104,0.18); }
.copy-box { display: flex; gap: .75rem; }
.copy-box input { flex: 1; }
.flash { padding: .9rem 1rem; border-radius: .95rem; margin-bottom: 1rem; border: 1px solid var(--line); }
.flash-error { background: rgba(251,113,133,0.14); color: #fecdd3; }
.flash-success { background: rgba(52,211,153,0.14); color: #bbf7d0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .84rem; text-transform: uppercase; letter-spacing: .08em; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: .35rem .72rem; background: rgba(255,255,255,0.08); color: var(--text); font-size: .82rem; font-weight: 850; }
.pill-published { background: rgba(52,211,153,0.14); color: #bbf7d0; }
.pill-scheduled { background: rgba(251,191,36,0.14); color: #fde68a; }
.pill-draft { background: rgba(184,169,178,0.14); color: #f5d9e5; }
.actions { display: flex; gap: .8rem; align-items: center; }
.actions form { margin: 0; }
pre { white-space: pre-wrap; background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; }

@media (max-width: 900px) {
    .topbar { align-items: flex-start; flex-direction: column; }
    .topbar nav { justify-content: flex-start; border-radius: 1.1rem; }
    .brand-logo { max-width: min(84vw, 320px); }
    .hero-split, .cards-4, .cards-3, .two-col, .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .copy-box { flex-direction: column; }
}

/* CasterConnex v1.3 */
.podcast-profile {
    display: grid;
    grid-template-columns: minmax(150px, 220px) 1fr;
    gap: 1.25rem;
    align-items: start;
}
.podcast-artwork,
.episode-artwork,
.episode-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 1.25rem;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.06);
}
.placeholder-art {
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 900;
    color: var(--muted);
}
.meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}
.meta-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.meta-grid span {
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    padding: .85rem;
    border-radius: 1rem;
    color: var(--muted);
}
.meta-grid strong {
    display: block;
    color: var(--text);
    margin-bottom: .2rem;
}
.platform-links {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
}
.episode-list {
    display: grid;
    gap: 1rem;
}
.episode-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 1.15rem;
    background: rgba(255,255,255,0.035);
}
.episode-row:not(:has(.episode-thumb)) {
    grid-template-columns: 1fr;
}
.episode-row h2 {
    margin: .55rem 0 .35rem;
}
.episode-thumb {
    border-radius: .95rem;
}
.episode-detail {
    display: grid;
    grid-template-columns: minmax(140px, 190px) 1fr;
    gap: 1rem;
    align-items: start;
}
.episode-detail:not(:has(.episode-artwork)) {
    grid-template-columns: 1fr;
}
.rich-text {
    color: var(--text);
    line-height: 1.7;
    white-space: normal;
}
.notice-box {
    border: 1px solid rgba(211,19,104,0.35);
    background: rgba(211,19,104,0.12);
    border-radius: 1rem;
    padding: .9rem 1rem;
    color: var(--text);
}
.contact-card p {
    line-height: 1.6;
}

@media (max-width: 900px) {
    .podcast-profile,
    .episode-detail,
    .episode-row,
    .meta-grid,
    .meta-grid.compact {
        grid-template-columns: 1fr;
    }
    .podcast-artwork,
    .episode-artwork,
    .episode-thumb {
        max-width: 220px;
    }
}
