/* Story Cast creator: composer hero + script chat page + cast sheet.
   Colors mirror the Story Cast theme tokens (story-cast-shared.css); they are
   re-declared here because the creator page has its own root outside
   .story-cast-page. */

.story-cast-creator-page,
.story-cast-creator-composer,
.story-cast-creator-dramas,
.story-cast-creator-sheet__backdrop {
    --sc-rose: #ff2a7a;
    --sc-hot: #ff5e36;
    --sc-pink: #ffb2d4;
    --sc-ink: #0b040f;
    --sc-copy: rgba(255, 239, 247, 0.72);
    --sc-muted: rgba(255, 239, 247, 0.5);
    --sc-card-bg: rgba(20, 8, 19, 0.92);
    --sc-card-border: rgba(255, 112, 164, 0.42);
}

.story-cast-creator-composer {
    margin: 30px 0 34px;
    color: #f4f1f4;
    /* The composer must never widen its grid column: without inline-size
       containment its intrinsic min-content (option row, spark chips)
       propagates up and blows the mobile template-list open. */
    contain: inline-size;
    /* The heading figure bleeds toward the edge; clip instead of scrolling.
       (clip, not hidden: no scroll container, fixed modals unaffected.) */
    overflow: clip;
}

/* Heading mirrors the acquisition intro: rose eyebrow + serif display title. */
.story-cast-creator-composer__heading {
    position: relative;
    max-width: 860px;
    margin: 0 auto 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.story-cast-creator-composer__eyebrow,
.story-cast-creator-composer__title,
.story-cast-creator-composer__lede {
    position: relative;
    z-index: 1;
}

/* The same glowing cast silhouette the acquisition intro uses, floated
   behind the right side of the heading. Decorative only. */
.story-cast-creator-composer__figure {
    position: absolute;
    top: 55%;
    right: clamp(0px, 4vw, 48px);
    z-index: 0;
    width: clamp(150px, 17vw, 230px);
    aspect-ratio: 1;
    pointer-events: none;
    /* Hang mostly below the heading: the composer clips overflow, so any
       part rising above its top edge would be sliced flat. */
    transform: translateY(-30%) rotate(5deg);
}

.story-cast-creator-composer__figure::before {
    content: '';
    position: absolute;
    /* Stay inside the figure box: anything past it crosses the composer's
       overflow clip and gets hard-cut into a visible straight edge. */
    inset: -4%;
    /* Explicit ellipse extents so the glow finishes fading inside the box —
       a farthest-corner gradient gets hard-cut at the edges on this flat bg. */
    background:
        radial-gradient(ellipse 34% 30% at 58% 36%, rgba(255, 42, 122, 0.32), transparent),
        radial-gradient(ellipse 30% 28% at 34% 68%, rgba(222, 156, 255, 0.2), transparent);
    animation: story-cast-creator-figure-glow 5.5s ease-in-out infinite;
}

.story-cast-creator-composer__figure img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.9;
    /* screen-blend melts the image's own dark panel into the page so only
       the neon silhouette and sparkles survive; the mask feathers the rest. */
    mix-blend-mode: screen;
    /* Crush the image's baked-in dark panel toward true black so screen
       blending adds only the neon silhouette and sparkles. */
    filter: brightness(0.92) contrast(1.5);
    -webkit-mask-image: radial-gradient(ellipse 56% 54% at 50% 46%, #000 40%, transparent 74%);
    mask-image: radial-gradient(ellipse 56% 54% at 50% 46%, #000 40%, transparent 74%);
    animation: story-cast-creator-figure-drift 9s ease-in-out infinite;
}

@keyframes story-cast-creator-figure-glow {
    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.95;
        transform: scale(1.07);
    }
}

@keyframes story-cast-creator-figure-drift {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px);
    }
}

.story-cast-creator-composer__eyebrow {
    color: #ff8fbd;
    font: 800 11px / 1 var(--story-sans, inherit);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.story-cast-creator-composer__title {
    margin: 0;
    color: #fff8fb;
    font-family: var(--story-serif, serif);
    font-size: clamp(32px, 3.6vw, 48px);
    font-weight: 500;
    line-height: 0.95;
    letter-spacing: -0.035em;
    text-wrap: balance;
    text-shadow:
        0 10px 34px rgba(0, 0, 0, 0.48),
        0 0 24px rgba(255, 179, 211, 0.14);
}

.story-cast-creator-composer__lede {
    margin: 0;
    color: rgba(255, 239, 246, 0.78);
    font: 650 clamp(14px, 1.2vw, 16px) / 1.45 var(--story-sans, inherit);
}

.story-cast-creator-composer__panel {
    max-width: 860px;
    margin: 0 auto;
    padding: 10px;
    border-radius: 26px;
    border: 1px solid rgba(255, 112, 164, 0.2);
    background: rgba(20, 8, 19, 0.55);
    backdrop-filter: blur(14px);
}

.story-cast-creator-composer__options {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.story-cast-creator-option__button {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 132px;
    padding: 9px 16px 9px 10px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.story-cast-creator-option__button:hover {
    border-color: rgba(255, 112, 164, 0.4);
    background: rgba(255, 255, 255, 0.07);
}

.story-cast-creator-option__button--active {
    border-color: var(--sc-card-border);
}

.story-cast-creator-option__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 10px;
    background: rgba(255, 42, 122, 0.14);
    color: #ffb2d4;
}

.story-cast-creator-option__icon svg {
    width: 16px;
    height: 16px;
}

.story-cast-creator-option__icon {
    overflow: hidden;
}

.story-cast-creator-option__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-cast-creator-option__label {
    display: block;
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 239, 247, 0.5);
}

.story-cast-creator-option__value {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
}

.story-cast-creator-option__button--active .story-cast-creator-option__value {
    color: var(--sc-pink, #ffb2d4);
}

.story-cast-creator-composer__inputbox {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(9, 3, 10, 0.85);
    padding: 14px 16px 12px;
}

.story-cast-creator-composer__input {
    width: 100%;
    min-height: 76px;
    max-height: 160px;
    resize: none;
    border: 0;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
}

.story-cast-creator-composer__input::placeholder {
    color: rgba(244, 241, 244, 0.42);
}

/* Sparks: a separate inspiration block below the input box, so the box
   itself stays unmistakably "type here". */
.story-cast-creator-composer__sparks {
    margin-top: 12px;
    padding: 0 6px;
}

.story-cast-creator-composer__sparks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.story-cast-creator-composer__sparks-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 178, 212, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-cast-creator-composer__sparks-label svg {
    width: 12px;
    height: 12px;
    flex: none;
}

.story-cast-creator-composer__spark-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.story-cast-creator-composer__spark {
    min-width: 0;
    height: 86px;
    overflow: hidden;
    border: 1px dashed rgba(255, 112, 164, 0.28);
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 239, 247, 0.62);
    font-size: 12.5px;
    line-height: 1.4;
    padding: 9px 12px;
    text-align: left;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        color 0.15s ease,
        background 0.15s ease;
}

.story-cast-creator-composer__spark:hover {
    border-color: rgba(255, 112, 164, 0.55);
    border-style: solid;
    background: rgba(255, 42, 122, 0.08);
    color: #fff;
}

.story-cast-creator-composer__shuffle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 239, 247, 0.65);
    cursor: pointer;
    transition:
        color 0.15s ease,
        border-color 0.15s ease,
        transform 0.2s ease;
}

.story-cast-creator-composer__shuffle:hover {
    color: #ffb2d4;
    border-color: rgba(255, 112, 164, 0.45);
    transform: rotate(-16deg) scale(1.05);
}

.story-cast-creator-composer__shuffle svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 720px) {
    /* Two full-width hooks stacked; the third hides. */
    .story-cast-creator-composer__spark-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .story-cast-creator-composer__spark:nth-of-type(3) {
        display: none;
    }
}

.story-cast-creator-composer__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.story-cast-creator-composer__hint {
    flex: 1;
    border: 0;
    background: transparent;
    color: rgba(244, 241, 244, 0.5);
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
    padding: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.story-cast-creator-composer__hint:hover {
    color: rgba(244, 241, 244, 0.85);
}

.story-cast-creator-composer__resume {
    color: #ffb2d4;
    font-weight: 600;
    text-decoration: none;
}

/* Round send button used by the Script Room chat page. */
.story-cast-creator-composer__submit {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sc-hot, #ff5e36), var(--sc-rose, #ff2a7a));
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.story-cast-creator-composer__submit:disabled {
    opacity: 0.4;
    cursor: default;
}

.story-cast-creator-composer__create {
    flex: none;
    border: 0;
    border-radius: 14px;
    padding: 12px 28px;
    background: linear-gradient(120deg, var(--sc-hot, #ff5e36), var(--sc-rose, #ff2a7a));
    color: #fff;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(255, 42, 122, 0.35);
}

.story-cast-creator-composer__create:disabled {
    opacity: 0.4;
    box-shadow: none;
    cursor: default;
}

/* ---------- story setup modal ---------- */

.story-cast-creator-setup__backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 1, 6, 0.72);
    backdrop-filter: blur(6px);
    animation: story-cast-setup-fade 0.16s ease-out;
}

@keyframes story-cast-setup-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.story-cast-creator-setup {
    width: min(700px, 100%);
    max-height: min(580px, 86dvh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255, 112, 164, 0.24);
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(255, 42, 122, 0.09), transparent 60%),
        rgba(15, 5, 14, 0.98);
    color: #f4f1f4;
    box-shadow:
        0 36px 100px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: story-cast-setup-rise 0.2s ease-out;
}

@keyframes story-cast-setup-rise {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-cast-creator-setup__backdrop,
    .story-cast-creator-setup {
        animation: none;
    }
}

.story-cast-creator-setup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.story-cast-creator-setup__header h3 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0;
}

.story-cast-creator-setup__header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-cast-creator-setup__reset {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 239, 247, 0.75);
    font-size: 12.5px;
    padding: 7px 15px;
    cursor: pointer;
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

.story-cast-creator-setup__reset:hover {
    color: #fff;
    border-color: rgba(255, 112, 164, 0.45);
}

.story-cast-creator-setup__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 239, 247, 0.85);
    cursor: pointer;
    transition: background 0.15s ease;
}

.story-cast-creator-setup__close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.story-cast-creator-setup__close svg {
    width: 16px;
    height: 16px;
}

.story-cast-creator-setup__body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.story-cast-creator-setup__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: none;
    width: 176px;
    padding: 14px 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.22);
}

.story-cast-creator-setup__nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 239, 247, 0.65);
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.story-cast-creator-setup__nav-item:hover {
    color: rgba(255, 239, 247, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.story-cast-creator-setup__nav-item svg {
    width: 16px;
    height: 16px;
    flex: none;
    opacity: 0.8;
}

.story-cast-creator-setup__nav-item--active {
    background: linear-gradient(120deg, rgba(255, 94, 54, 0.16), rgba(255, 42, 122, 0.16));
    color: #ffb2d4;
}

.story-cast-creator-setup__nav-dot {
    margin-left: auto;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--sc-rose, #ff2a7a);
    box-shadow: 0 0 8px rgba(255, 42, 122, 0.8);
}

.story-cast-creator-setup__content {
    flex: 1;
    min-width: 0;
    padding: 20px 22px;
    overflow-y: auto;
}

.story-cast-creator-setup__content h4 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
}

.story-cast-creator-setup__content > p {
    margin: 0 0 18px;
    font-size: 12.5px;
    color: rgba(255, 239, 247, 0.5);
}

.story-cast-creator-setup__choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.story-cast-creator-setup__choice {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 239, 247, 0.85);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        transform 0.15s ease;
}

.story-cast-creator-setup__choice:hover {
    border-color: rgba(255, 112, 164, 0.45);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

/* Media choice cards: the demo clip fills the card, text rides a gradient. */
.story-cast-creator-setup__choice--media,
.story-cast-creator-setup__choice--auto {
    min-height: 150px;
    padding: 0;
    justify-content: flex-end;
    overflow: hidden;
}

.story-cast-creator-setup__choice-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Unselected clips sit dimmed so the chosen card clearly lights up. */
    filter: brightness(0.5) saturate(0.7);
    transition: filter 0.2s ease;
}

.story-cast-creator-setup__choice--media:hover .story-cast-creator-setup__choice-video {
    filter: brightness(0.72) saturate(0.85);
}

.story-cast-creator-setup__choice--selected .story-cast-creator-setup__choice-video {
    filter: none;
}

.story-cast-creator-setup__choice--auto {
    background:
        radial-gradient(90% 100% at 50% 0%, rgba(255, 42, 122, 0.16), transparent 60%),
        rgba(10, 4, 14, 0.9);
}

.story-cast-creator-setup__choice-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 14px 40px 14px 16px;
}

.story-cast-creator-setup__choice--media .story-cast-creator-setup__choice-body {
    padding-top: 34px;
    /* Only enough gradient to keep the caption readable — dimming the clip
       itself is the video filter's job, so the selected card stays bright. */
    background: linear-gradient(180deg, transparent, rgba(4, 1, 6, 0.62) 78%);
}

.story-cast-creator-setup__choice--selected.story-cast-creator-setup__choice--media
    .story-cast-creator-setup__choice-body {
    background: linear-gradient(180deg, transparent 30%, rgba(4, 1, 6, 0.55) 88%);
}

.story-cast-creator-setup__choice--media .story-cast-creator-setup__choice-blurb {
    color: rgba(255, 239, 247, 0.72);
}

.story-cast-creator-setup__choice-name {
    font-size: 14px;
    font-weight: 700;
    text-transform: capitalize;
    line-height: 1.3;
}

.story-cast-creator-setup__choice-blurb {
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 239, 247, 0.55);
}

.story-cast-creator-setup__choice-check {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: transparent;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.story-cast-creator-setup__choice-check svg {
    width: 13px;
    height: 13px;
}

.story-cast-creator-setup__choice--selected {
    border-width: 2px;
    border-color: transparent;
    background:
        linear-gradient(rgba(24, 8, 20, 0.96), rgba(24, 8, 20, 0.96)) padding-box,
        linear-gradient(120deg, var(--sc-hot, #ff5e36), var(--sc-rose, #ff2a7a)) border-box;
    color: #fff;
}

.story-cast-creator-setup__choice--selected .story-cast-creator-setup__choice-blurb {
    color: rgba(255, 239, 247, 0.75);
}

.story-cast-creator-setup__choice--selected .story-cast-creator-setup__choice-check {
    background: linear-gradient(120deg, var(--sc-hot, #ff5e36), var(--sc-rose, #ff2a7a));
    color: #fff;
}

@media (max-width: 720px) {
    /* All four dimensions visible at once — no horizontal scroll affordance. */
    .story-cast-creator-composer__options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .story-cast-creator-option__button {
        min-width: 0;
        gap: 8px;
        padding: 8px 8px 8px 8px;
    }

    .story-cast-creator-option__value {
        font-size: 12.5px;
    }

    .story-cast-creator-option__meta {
        min-width: 0;
    }

    .story-cast-creator-option__value {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .story-cast-creator-composer__create {
        padding: 11px 20px;
    }

    /* Bottom-sheet layout: sections become a horizontal tab bar. */
    .story-cast-creator-setup__backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .story-cast-creator-setup {
        width: 100%;
        max-height: 82dvh;
        border-radius: 20px 20px 0 0;
        border-bottom: 0;
    }

    .story-cast-creator-setup__body {
        flex-direction: column;
    }

    .story-cast-creator-setup__nav {
        flex-direction: row;
        width: 100%;
        padding: 10px 12px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .story-cast-creator-setup__nav::-webkit-scrollbar {
        display: none;
    }

    .story-cast-creator-setup__nav-item {
        flex: none;
    }

    .story-cast-creator-setup__nav-dot {
        margin-left: 4px;
    }

    .story-cast-creator-setup__content {
        padding: 16px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .story-cast-creator-setup__choices {
        grid-template-columns: 1fr;
    }
}

/* ---------- my dramas cards (official-card look inside the template grid) ---------- */

.story-cast-my-drama-card {
    position: relative;
}

.story-cast-my-drama-card__menu-button {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 239, 247, 0.85);
    cursor: pointer;
    backdrop-filter: blur(6px);
}

.story-cast-my-drama-card__menu-button svg {
    width: 16px;
    height: 16px;
}

.story-cast-my-drama-card__menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 6;
    border: 0;
    background: transparent;
    cursor: default;
}

.story-cast-my-drama-card__menu {
    position: absolute;
    top: 42px;
    right: 8px;
    z-index: 7;
    min-width: 120px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(20, 8, 19, 0.97);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.story-cast-my-drama-card__menu button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: #ff7d9c;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.story-cast-my-drama-card__menu button:hover,
.story-cast-my-drama-card__menu button:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.story-cast-my-drama-card--draft {
    border-style: dashed;
    border-color: rgba(255, 112, 164, 0.4);
}

.story-cast-my-drama-draft {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    min-height: inherit;
    padding: 18px 16px;
    border: 0;
    background:
        radial-gradient(110% 80% at 20% 0%, rgba(255, 42, 122, 0.12), transparent 55%),
        linear-gradient(200deg, rgba(255, 94, 54, 0.05), transparent 45%),
        transparent;
    color: #f4f1f4;
    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
}

.story-cast-my-drama-draft__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 178, 212, 0.35);
    color: rgba(255, 178, 212, 0.9);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.story-cast-my-drama-draft__chip i {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #ffb2d4;
    animation: story-cast-draft-pulse 1.6s ease-in-out infinite;
}

@keyframes story-cast-draft-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-cast-my-drama-draft__chip i {
        animation: none;
    }
}

.story-cast-my-drama-draft__quote {
    position: absolute;
    top: 26px;
    left: 6px;
    font-family: var(--story-serif, serif);
    font-size: 110px;
    line-height: 1;
    color: rgba(255, 112, 164, 0.12);
    pointer-events: none;
}

.story-cast-my-drama-draft__title {
    position: relative;
    font-family: var(--story-serif, serif);
    font-size: 19px;
    font-style: italic;
    font-weight: 500;
    line-height: 1.35;
    color: rgba(255, 248, 251, 0.92);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-cast-my-drama-draft__meta {
    font-size: 11.5px;
    line-height: 1.4;
    color: rgba(255, 239, 247, 0.45);
}

.story-cast-my-drama-draft__cta {
    margin-top: 2px;
    color: #ffb2d4;
    font-size: 12.5px;
    font-weight: 600;
}

/* ---------- cast sheet ---------- */

.story-cast-creator-sheet__backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
}

.story-cast-creator-sheet {
    width: 100%;
    max-width: 520px;
    max-height: 82dvh;
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    border: 1px solid var(--sc-card-border);
    border-bottom: 0;
    background: rgba(18, 7, 17, 0.98);
    color: #f4f1f4;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
}

@media (min-width: 720px) {
    .story-cast-creator-sheet__backdrop {
        align-items: center;
    }

    .story-cast-creator-sheet {
        border-radius: 18px;
        border-bottom: 1px solid var(--sc-card-border);
    }
}

.story-cast-creator-sheet__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 14px;
}

.story-cast-creator-sheet__instruction {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 112, 164, 0.48);
    border-radius: 14px;
    background: rgba(255, 42, 122, 0.13);
    color: #fff8fb;
}

.story-cast-creator-sheet__instruction svg {
    width: 22px;
    height: 22px;
    flex: none;
    color: var(--sc-pink);
}

.story-cast-creator-sheet__instruction span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.story-cast-creator-sheet__instruction strong {
    font-size: 14px;
}

.story-cast-creator-sheet__instruction small {
    color: rgba(255, 239, 247, 0.8);
    font-size: 12px;
    line-height: 1.35;
}

.story-cast-creator-sheet__row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 112, 164, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.055);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.story-cast-creator-sheet__row:hover,
.story-cast-creator-sheet__row:focus-visible {
    border-color: var(--sc-card-border);
    background: rgba(255, 42, 122, 0.08);
}

.story-cast-creator-sheet__chevron {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 22px;
    line-height: 1;
    color: var(--sc-muted);
}

.story-cast-creator-sheet__row:hover .story-cast-creator-sheet__chevron {
    color: var(--sc-pink);
}

.story-cast-creator-sheet__add-look {
    padding: 1px 9px;
    border-radius: 999px;
    border: 1px solid var(--sc-card-border);
    color: var(--sc-pink);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.story-cast-creator-sheet__thumb {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.story-cast-creator-sheet__thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--sc-pink);
}

.story-cast-creator-sheet__thumb--large {
    width: 64px;
    height: 64px;
    border-radius: 12px;
}

.story-cast-creator-sheet__thumb-button {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: none;
    cursor: zoom-in;
}

.story-cast-creator-sheet__thumb-button:focus-visible {
    outline: 2px solid rgba(255, 120, 150, 0.9);
    outline-offset: 2px;
}

.story-cast-creator-sheet__look-preview {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 16px 24px;
    background: rgba(8, 3, 8, 0.88);
    cursor: zoom-out;
}

.story-cast-creator-sheet__look-preview img {
    max-width: min(100%, 520px);
    max-height: 100%;
    border-radius: 16px;
    object-fit: contain;
}

.story-cast-creator-sheet__look-preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
}

.story-cast-creator-sheet__row-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.story-cast-creator-sheet__row-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14.5px;
    font-weight: 700;
}

.story-cast-creator-sheet__row-action {
    align-self: flex-start;
    margin-top: 2px;
    color: #ffc1dd;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.story-cast-creator-sheet__row:hover .story-cast-creator-sheet__row-action,
.story-cast-creator-sheet__row:focus-visible .story-cast-creator-sheet__row-action {
    color: #fff;
}

.story-cast-creator-sheet__row-desc {
    font-size: 12.5px;
    color: rgba(244, 241, 244, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-cast-creator-sheet__editor {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.story-cast-creator-sheet__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.story-cast-creator-sheet__label {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(244, 241, 244, 0.55);
}

.story-cast-creator-sheet__input {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    font: inherit;
    font-size: 14.5px;
    padding: 9px 12px;
    outline: none;
}

.story-cast-creator-sheet__input--area {
    resize: none;
    line-height: 1.5;
}

.story-cast-creator-sheet__upload-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.story-cast-creator-sheet__note {
    font-size: 13px;
    color: rgba(244, 241, 244, 0.6);
    margin: 0;
}

.story-cast-creator-sheet__error {
    font-size: 12.5px;
    color: #ff8a8a;
    margin: 6px 0 0;
}

/* ---------- episode fix banner ---------- */

.story-cast-creator-fix {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 70;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    padding: 16px 18px;
    border: 1px solid var(--sc-card-border);
    border-radius: 14px;
    background: rgba(18, 7, 17, 0.97);
    color: #fff;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
    --sc-rose: #ff2a7a;
    --sc-hot: #ff5e36;
    --sc-pink: #ffb2d4;
    --sc-card-border: rgba(255, 112, 164, 0.42);
}

/* Primary/quiet actions are full-width with a 44px minimum touch target so a
   blocked-episode repair is never a tiny tap target on mobile. */
.story-cast-creator-fix__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.story-cast-creator-fix__primary,
.story-cast-creator-fix__secondary,
.story-cast-creator-fix__ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-sizing: border-box;
}

.story-cast-creator-fix__primary {
    border: 0;
    background: linear-gradient(90deg, var(--sc-hot), var(--sc-rose));
    color: #fff;
}

.story-cast-creator-fix__primary:disabled {
    opacity: 0.5;
    cursor: default;
}

.story-cast-creator-fix__secondary {
    border: 1px solid rgba(255, 112, 164, 0.42);
    background: rgba(255, 255, 255, 0.04);
    color: var(--sc-pink);
}

.story-cast-creator-fix__ghost {
    border: 0;
    background: transparent;
    color: rgba(255, 239, 247, 0.6);
    font-weight: 600;
}

.story-cast-creator-fix__textarea {
    width: 100%;
    min-height: 200px;
    margin-top: 10px;
    resize: vertical;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(20, 8, 19, 0.92);
    color: #f4f1f4;
    font-size: 13px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    line-height: 1.55;
    padding: 12px;
    box-sizing: border-box;
}

.story-cast-creator-fix__textarea:focus {
    outline: none;
    border-color: rgba(255, 112, 164, 0.55);
}

.story-cast-creator-fix__error {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: #ff8a8a;
}

.story-cast-creator-fix__hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: rgba(244, 241, 244, 0.55);
    word-break: break-word;
}

/* ---------- chat page ---------- */

.story-cast-creator-page {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--sc-ink);
    color: #f4f1f4;
}

.story-cast-creator-page__bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(11, 4, 15, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.story-cast-creator-page__back {
    display: inline-flex;
    align-items: center;
    /* Comfortable touch target without shifting the visual position. */
    min-height: 44px;
    padding: 0 12px;
    margin-left: -12px;
    color: rgba(244, 241, 244, 0.75);
    text-decoration: none;
    font-size: 14px;
}

.story-cast-creator-page__title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.story-cast-creator-page__stream {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 120px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Scroll target for the newest content: clear the fixed input bar so the
   latest card is never left underneath it. */
.story-cast-creator-page__stream-end {
    scroll-margin-bottom: calc(112px + env(safe-area-inset-bottom));
}

.story-cast-creator-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.story-cast-creator-bubble--user {
    align-self: flex-end;
    background: rgba(255, 42, 122, 0.14);
    border: 1px solid rgba(255, 112, 164, 0.35);
}

.story-cast-creator-bubble--assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.story-cast-creator-card {
    align-self: stretch;
    border: 1px solid var(--sc-card-border);
    border-radius: 16px;
    background: var(--sc-card-bg);
    padding: 16px 18px;
}

.story-cast-creator-card--superseded {
    opacity: 0.55;
    border-color: rgba(255, 255, 255, 0.12);
}

.story-cast-creator-card__eyebrow {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sc-pink);
    margin-bottom: 6px;
}

.story-cast-creator-card__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
}

.story-cast-creator-card__logline {
    font-size: 13.5px;
    color: rgba(244, 241, 244, 0.75);
    margin: 0 0 10px;
}

.story-cast-creator-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.story-cast-creator-card__tag {
    font-size: 11.5px;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(244, 241, 244, 0.75);
}

.story-cast-creator-card__section {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(244, 241, 244, 0.5);
    margin: 12px 0 6px;
}

.story-cast-creator-card__character {
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0 0 6px;
}

.story-cast-creator-card__episode {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 13.5px;
    line-height: 1.5;
}

.story-cast-creator-card__episode:last-of-type {
    border-bottom: 0;
}

.story-cast-creator-card__episode-no {
    color: var(--sc-pink);
    font-weight: 700;
}

.story-cast-creator-card__hook {
    color: rgba(244, 241, 244, 0.55);
    font-size: 12.5px;
}

.story-cast-creator-card__footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.story-cast-creator-card__cta {
    display: inline-block;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sc-hot), var(--sc-rose));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 20px;
    cursor: pointer;
    text-decoration: none;
}

.story-cast-creator-card__cta:disabled {
    opacity: 0.45;
    cursor: default;
}

.story-cast-creator-card__hint {
    font-size: 12.5px;
    color: rgba(244, 241, 244, 0.55);
}

.story-cast-creator-card__collapsed {
    font-size: 13px;
    color: rgba(244, 241, 244, 0.6);
}

.story-cast-creator-page__input {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(11, 4, 15, 0.94);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}

.story-cast-creator-page__input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 720px;
    margin: 0 auto;
}

.story-cast-creator-page__textarea {
    flex: 1;
    min-height: 42px;
    max-height: 120px;
    resize: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    font: inherit;
    font-size: 14.5px;
    line-height: 1.5;
    padding: 9px 12px;
    outline: none;
}

.story-cast-creator-page__status {
    max-width: 720px;
    margin: 0 auto 8px;
    font-size: 13px;
    color: rgba(244, 241, 244, 0.72);
    display: flex;
    align-items: center;
    gap: 10px;
}

.story-cast-creator-page__retry {
    border: 0;
    background: transparent;
    color: var(--sc-pink);
    font-size: 12.5px;
    cursor: pointer;
    padding: 0;
}

/* In the chat error row, Retry / Sign in is the only way forward: make it a
   clear pill button instead of inline link text. */
.story-cast-creator-page__status .story-cast-creator-page__retry {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(120deg, var(--sc-hot, #ff5e36), var(--sc-rose, #ff2a7a));
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(255, 42, 122, 0.35);
}

.story-cast-creator-page__status .story-cast-creator-page__retry:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.story-cast-creator-typing {
    display: inline-block;
    animation: story-cast-creator-pulse 1.2s ease-in-out infinite;
}

@keyframes story-cast-creator-pulse {
    0%,
    100% {
        opacity: 0.35;
    }
    50% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-cast-creator-typing {
        animation: none;
    }
}

@media (max-width: 720px) {
    .story-cast-creator-composer {
        margin: 14px 0 20px;
        padding: 14px 14px;
    }

    .story-cast-creator-composer__figure {
        top: 30%;
        right: -10vw;
        width: clamp(150px, 46vw, 210px);
    }

    .story-cast-creator-bubble {
        max-width: 92%;
    }
}

/* ---------- play/script segment + full-script panel ---------- */

.story-cast-script-switch {
    display: inline-flex;
    width: fit-content;
    justify-self: start;
    gap: 2px;
    padding: 3px;
    margin: 0;
    border: 1px solid rgba(255, 112, 164, 0.35);
    border-radius: 999px;
    background: rgba(11, 4, 15, 0.85);
    backdrop-filter: blur(10px);
}

/* On desktop the Play/Script switch is centered inside the header row
   (StoryCastHeader centerSlot), so it no longer needs its own row or the
   extra watch-layout offset. */

.story-cast-script-panel__switch {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

/* Mobile player: the top bar is fixed, so an in-flow slot would sit under the
   brand. Pin the switch to the free row between the top bar and the player,
   left-aligned opposite "More stories" (same top and height). */
.story-cast-mobile-header-slot {
    position: fixed;
    top: calc(max(18px, env(safe-area-inset-top)) + 58px);
    left: 18px;
    z-index: 9;
    display: flex;
    align-items: center;
    min-height: 34px;
}

/* A floating route-back button takes the left end of the same row. */
.story-cast-mobile-page.has-floating-route-back .story-cast-mobile-header-slot {
    left: 68px;
}

/* Short landscape screens move the player up to the top bar; center the
   switch inside the top bar row instead. */
@media (orientation: landscape) and (max-height: 500px) {
    .story-cast-mobile-header-slot {
        top: calc(max(10px, env(safe-area-inset-top)) + 14px);
        left: 50%;
        transform: translateX(-50%);
    }

    .story-cast-mobile-page.has-floating-route-back .story-cast-mobile-header-slot {
        left: 50%;
    }
}

.story-cast-mobile-header-slot .story-cast-script-switch {
    margin: 0;
}

/* Doubled class specificity: the play page's shared stylesheets restyle bare
   `button` descendants (padding, borders), and the pill must win. */
.story-cast-script-switch .story-cast-script-switch__tab.story-cast-script-switch__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 239, 247, 0.65);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 5px 16px;
    cursor: pointer;
}

.story-cast-script-switch .story-cast-script-switch__tab.story-cast-script-switch__tab--active {
    background: linear-gradient(120deg, #ff5e36, #ff2a7a);
    color: #fff;
}

.story-cast-script-panel {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    background: #0b040f;
    color: #f4f1f4;
}

.story-cast-script-panel__inner {
    flex: 1;
    overflow-y: auto;
    padding: calc(12px + env(safe-area-inset-top)) 20px 110px;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}

.story-cast-script-panel__header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.story-cast-script-panel__header p {
    font-size: 13px;
    color: rgba(255, 239, 247, 0.6);
    line-height: 1.5;
    margin-bottom: 18px;
}

.story-cast-script-panel__status {
    padding: 24px 0;
    font-size: 14px;
    color: rgba(255, 239, 247, 0.7);
}

.story-cast-script-panel__retry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 10px;
    border: 1px solid rgba(255, 112, 164, 0.42);
    border-radius: 999px;
    background: transparent;
    color: #ffb2d4;
    font-size: 14px;
    padding: 10px 20px;
    cursor: pointer;
}

.story-cast-script-panel__episode {
    margin-bottom: 22px;
}

.story-cast-script-panel__episode h3 {
    font-size: 14.5px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #ffb2d4;
}

.story-cast-script-panel__episode > p {
    font-size: 12.5px;
    color: rgba(255, 239, 247, 0.55);
    line-height: 1.5;
    margin-bottom: 8px;
}

.story-cast-script-panel__textarea {
    width: 100%;
    resize: vertical;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(20, 8, 19, 0.92);
    color: #f4f1f4;
    font-size: 13px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    line-height: 1.55;
    padding: 12px 14px;
    outline: none;
}

.story-cast-script-panel__textarea:focus {
    border-color: rgba(255, 112, 164, 0.55);
}

.story-cast-script-panel__error {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #ff7d9c;
}

.story-cast-script-panel__textarea.story-cast-script-panel__textarea--invalid {
    border-color: #ff5c86;
    box-shadow: 0 0 0 2px rgba(255, 92, 134, 0.35);
}

.story-cast-script-panel__footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(11, 4, 15, 0.96);
    backdrop-filter: blur(10px);
}

.story-cast-script-panel__dirty {
    font-size: 12.5px;
    color: rgba(255, 239, 247, 0.6);
}

.story-cast-script-panel__save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(120deg, #ff5e36, #ff2a7a);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    cursor: pointer;
}

.story-cast-script-panel__save:disabled {
    opacity: 0.45;
    cursor: default;
}

.story-cast-script-confirm__backdrop {
    position: fixed;
    inset: 0;
    z-index: 96;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 1, 6, 0.72);
}

.story-cast-script-confirm {
    width: min(400px, 100%);
    border: 1px solid rgba(255, 112, 164, 0.35);
    border-radius: 16px;
    background: rgba(20, 8, 19, 0.98);
    padding: 20px;
}

.story-cast-script-confirm h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.story-cast-script-confirm p {
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255, 239, 247, 0.7);
    margin-bottom: 16px;
}

.story-cast-script-confirm__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.story-cast-script-confirm__cancel {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 239, 247, 0.8);
    font-size: 13.5px;
    padding: 8px 16px;
    cursor: pointer;
}

.story-cast-script-confirm__ok {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(120deg, #ff5e36, #ff2a7a);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
}

.story-cast-script-confirm__ok:disabled,
.story-cast-script-confirm__cancel:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ---------- my dramas page ---------- */

.story-cast-my-dramas-view-all {
    color: #ffb2d4;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.story-cast-my-dramas-view-all:hover {
    color: #fff;
}

/* The mobile list stacks section headings; My dramas keeps its title and
   View all on one row. */
.story-cast-template-list--mobile .story-cast-my-dramas-section .story-cast-template-section-heading {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.story-cast-my-dramas-page__tabs {
    display: flex;
    gap: 4px;
    width: fit-content;
    margin: 16px auto 4px;
    padding: 3px;
    border: 1px solid rgba(255, 112, 164, 0.3);
    border-radius: 999px;
    background: rgba(11, 4, 15, 0.8);
}

.story-cast-my-dramas-page__tab {
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 239, 247, 0.65);
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    cursor: pointer;
}

.story-cast-my-dramas-page__tab--active {
    background: linear-gradient(120deg, var(--sc-hot, #ff5e36), var(--sc-rose, #ff2a7a));
    color: #fff;
}

.story-cast-my-dramas-page__content {
    max-width: 1080px;
    width: 100%;
    margin: 12px auto 0;
    padding: 0 18px 48px;
}

/* The tabs already carry their own spacing; the inherited template-list top
   margin stacked on top of it and left too much air before the drama cards.
   The mobile list also reserves ~104px for the Story Cast top bar, which this
   page does not have, and repeats the content's side padding. */
.story-cast-my-dramas-page__content .story-cast-template-list,
.story-cast-my-dramas-page__content .story-cast-template-list--mobile {
    margin-top: 0;
    padding: 0;
}

.story-cast-my-dramas-page__status {
    padding: 40px 0;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 239, 247, 0.6);
}

/* Collapsed shot-by-shot beat plan inside the outline card. */
.story-cast-creator-card__beats {
    margin-top: 4px;
}

.story-cast-creator-card__beats summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 178, 212, 0.55);
    cursor: pointer;
    list-style: none;
}

.story-cast-creator-card__beats summary::-webkit-details-marker {
    display: none;
}

.story-cast-creator-card__beats summary::after {
    content: '▸';
    font-size: 10px;
    transition: transform 0.15s ease;
}

.story-cast-creator-card__beats[open] summary::after {
    transform: rotate(90deg);
}

.story-cast-creator-card__beats summary:hover {
    color: rgba(255, 178, 212, 0.9);
}

.story-cast-creator-card__beats ol {
    margin: 6px 0 2px;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.story-cast-creator-card__beats li {
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 239, 247, 0.6);
}
