.prompt-builder {
    position: relative;
    min-height: calc(100svh - 77px);
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(9, 13, 21, 0.96), rgba(18, 24, 38, 0.94)),
        radial-gradient(circle at 78% 14%, rgba(15, 118, 110, 0.24), transparent 34%);
    color: var(--surface-warm);
}

.prompt-builder::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 82%);
    pointer-events: none;
}

.prompt-builder .signal-field--prompt {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.24;
    mix-blend-mode: screen;
}

.prompt-builder__inner {
    position: relative;
    z-index: 1;
    max-width: 1320px;
    margin: 0 auto;
    padding: clamp(44px, 6vw, 78px) 24px clamp(54px, 6vw, 82px);
}

.prompt-builder__header {
    max-width: 840px;
    margin-bottom: 28px;
}

.prompt-builder__header .section-tag {
    color: rgba(251, 250, 246, 0.58);
}

.prompt-builder__header h1 {
    /* Sizing comes from the shared .display-h1 rule in site.css for site-wide consistency. */
    margin: 8px 0 14px;
    max-width: 780px;
    color: #ffffff;
}

.prompt-builder__header p {
    max-width: 690px;
    margin: 0;
    color: rgba(251, 250, 246, 0.78);
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.58;
}

.prompt-builder__links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.prompt-resource-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid rgba(110, 231, 183, 0.38);
    border-radius: var(--radius-lg);
    background: rgba(110, 231, 183, 0.12);
    color: #ffffff;
    font-weight: 800;
}

.prompt-resource-link span {
    color: #b7f7df;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.prompt-resource-link:hover {
    color: #ffffff;
    border-color: rgba(159, 184, 255, 0.62);
    background: rgba(159, 184, 255, 0.15);
    transform: translateY(-1px);
}

.prompt-builder__shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) minmax(360px, 0.78fr);
    gap: 16px;
    align-items: stretch;
}

.prompt-builder__rail,
.prompt-wizard,
.prompt-output {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.075);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.prompt-builder__rail {
    border-radius: var(--radius-xl);
    padding: 18px;
}

.prompt-builder__progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    margin-bottom: 18px;
}

.prompt-builder__progress-bar {
    display: block;
    width: 20%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #9fb8ff, #6ee7b7);
    transition: width 180ms ease;
}

.prompt-steps {
    list-style: none;
    display: grid;
    gap: 9px;
    padding: 0;
    margin: 0;
}

.prompt-steps li {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: rgba(251, 250, 246, 0.62);
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.prompt-steps li span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    font-family: var(--font-mono);
    font-size: 12px;
}

.prompt-steps li strong {
    font-size: 13px;
}

.prompt-steps li.is-active,
.prompt-steps li.is-complete {
    color: #ffffff;
    border-color: rgba(159, 184, 255, 0.42);
    background: rgba(159, 184, 255, 0.12);
}

.prompt-steps li.is-complete span {
    background: rgba(110, 231, 183, 0.18);
}

.prompt-wizard,
.prompt-output {
    border-radius: var(--radius-xl);
    padding: clamp(18px, 2.4vw, 28px);
}

.prompt-panel {
    display: none;
}

.prompt-panel.is-active {
    display: block;
}

.prompt-panel__head {
    margin-bottom: 22px;
}

.prompt-panel__head span {
    color: #9fb8ff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.prompt-panel__head h2,
.prompt-output__head h2 {
    margin: 6px 0 8px;
    color: #ffffff;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.08;
    font-weight: 760;
}

.prompt-panel__head p {
    max-width: 650px;
    margin: 0;
    color: rgba(251, 250, 246, 0.66);
}

.field-stack {
    display: grid;
    gap: 18px;
}

.prompt-field {
    display: grid;
    gap: 7px;
}

.prompt-field span,
.choice-group__label {
    color: rgba(251, 250, 246, 0.72);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.prompt-field input,
.prompt-field select,
.prompt-field textarea,
.prompt-output__text {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-lg);
    background: rgba(5, 8, 14, 0.72);
    color: #ffffff;
    font: inherit;
    padding: 13px 14px;
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.prompt-field textarea,
.prompt-output__text {
    resize: vertical;
    line-height: 1.55;
}

.prompt-field input::placeholder,
.prompt-field textarea::placeholder {
    color: rgba(251, 250, 246, 0.38);
}

.prompt-field input:focus,
.prompt-field select:focus,
.prompt-field textarea:focus,
.prompt-output__text:focus {
    border-color: rgba(159, 184, 255, 0.76);
    box-shadow: 0 0 0 3px rgba(159, 184, 255, 0.16);
    background: rgba(5, 8, 14, 0.86);
}

.choice-group {
    display: grid;
    gap: 9px;
}

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

.choice-card,
.choice-pill {
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(251, 250, 246, 0.76);
    background: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.choice-card {
    min-height: 92px;
    display: grid;
    align-content: start;
    gap: 5px;
    padding: 14px;
    text-align: left;
}

.choice-card strong {
    color: #ffffff;
    font-size: 16px;
}

.choice-card span {
    color: rgba(251, 250, 246, 0.58);
    font-size: 13px;
}

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

.choice-pill {
    min-height: 40px;
    padding: 9px 13px;
    font-weight: 700;
}

.choice-card:hover,
.choice-pill:hover,
.choice-card.is-selected,
.choice-pill.is-selected {
    color: #ffffff;
    border-color: rgba(110, 231, 183, 0.52);
    background: rgba(110, 231, 183, 0.13);
    transform: translateY(-1px);
}

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

.prompt-check {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 10px;
    align-items: start;
    min-height: 74px;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(251, 250, 246, 0.76);
}

.prompt-check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #6ee7b7;
}

.prompt-wizard__actions,
.prompt-output__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.prompt-output__cta {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    padding: 15px;
    border: 1px solid rgba(110, 231, 183, 0.28);
    border-radius: var(--radius-lg);
    background: rgba(110, 231, 183, 0.1);
}

.prompt-output__cta span {
    color: #b7f7df;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.prompt-output__cta p {
    margin: 0;
    color: rgba(251, 250, 246, 0.72);
    font-size: 13px;
    line-height: 1.5;
}

.prompt-output__cta a {
    color: #ffffff;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.prompt-output__cta a:hover {
    color: #b7f7df;
}

.prompt-wizard__actions .btn-ghost,
.prompt-output__actions .btn-ghost {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
}

.prompt-wizard__actions .btn-ghost:hover,
.prompt-output__actions .btn-ghost:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.prompt-output {
    display: flex;
    flex-direction: column;
}

.prompt-output__head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 14px;
}

.prompt-output__head .section-tag {
    color: rgba(251, 250, 246, 0.58);
}

.prompt-output__score {
    flex: 0 0 auto;
    border: 1px solid rgba(110, 231, 183, 0.36);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(110, 231, 183, 0.12);
    color: #b7f7df;
    font-size: 12px;
    font-weight: 800;
}

.prompt-output__text {
    min-height: 430px;
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    color: rgba(251, 250, 246, 0.9);
}

.prompt-quality {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
}

.prompt-quality__item {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 5px 9px;
    color: rgba(251, 250, 246, 0.52);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.prompt-quality__item.is-met {
    border-color: rgba(110, 231, 183, 0.42);
    background: rgba(110, 231, 183, 0.12);
    color: #b7f7df;
}

.prompt-checklist-page {
    min-height: calc(100svh - 77px);
}

.prompt-checklist-hero {
    max-width: 940px;
}

.prompt-checklist-layout {
    display: grid;
    grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.prompt-checklist-card,
.prompt-lesson,
.prompt-checklist-example {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.075);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.prompt-checklist-card {
    position: sticky;
    top: 100px;
    padding: 22px;
}

.prompt-checklist-card .section-tag,
.prompt-checklist-example .section-tag {
    color: rgba(251, 250, 246, 0.58);
}

.prompt-checklist-card h2,
.prompt-checklist-example h2 {
    margin: 8px 0 18px;
    color: #ffffff;
    font-size: clamp(25px, 2.8vw, 36px);
    line-height: 1.08;
    font-weight: 760;
}

.prompt-checklist-score {
    list-style: none;
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
}

.prompt-checklist-score li {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    color: rgba(251, 250, 246, 0.78);
    background: rgba(5, 8, 14, 0.34);
    font-weight: 800;
}

.prompt-checklist-score li span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(159, 184, 255, 0.28), rgba(110, 231, 183, 0.18));
    color: #ffffff;
}

.prompt-checklist-main {
    display: grid;
    gap: 12px;
}

.prompt-lesson {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 18px;
    padding: clamp(18px, 2.4vw, 26px);
}

.prompt-lesson__index {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(110, 231, 183, 0.38);
    border-radius: var(--radius-lg);
    background: rgba(110, 231, 183, 0.12);
    color: #b7f7df;
    font-size: 24px;
    font-weight: 800;
}

.prompt-lesson h2 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: clamp(22px, 2.2vw, 30px);
    line-height: 1.14;
    font-weight: 760;
}

.prompt-lesson p {
    max-width: 820px;
    margin: 0;
    color: rgba(251, 250, 246, 0.72);
    line-height: 1.62;
}

.prompt-builder-map {
    display: grid;
    gap: 4px;
    margin-top: 16px;
    padding: 13px 14px;
    border: 1px solid rgba(159, 184, 255, 0.26);
    border-radius: var(--radius-lg);
    background: rgba(159, 184, 255, 0.1);
}

.prompt-builder-map strong {
    color: #ffffff;
}

.prompt-builder-map span {
    color: rgba(251, 250, 246, 0.7);
}

.prompt-checklist-example {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(360px, 1fr);
    gap: 20px;
    margin-top: 18px;
    padding: clamp(20px, 2.6vw, 30px);
    align-items: start;
}

.prompt-checklist-example p {
    margin: 0;
    max-width: 620px;
    color: rgba(251, 250, 246, 0.72);
    line-height: 1.62;
}

.prompt-checklist-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.prompt-checklist-actions .btn-ghost {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
}

.prompt-checklist-actions .btn-ghost:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.prompt-anatomy {
    margin: 0;
    min-height: 100%;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-lg);
    background: rgba(5, 8, 14, 0.76);
    color: rgba(251, 250, 246, 0.86);
    padding: 18px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 1120px) {
    .prompt-builder__shell {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .prompt-output {
        grid-column: 1 / -1;
    }

    .prompt-checklist-layout,
    .prompt-checklist-example {
        grid-template-columns: 1fr;
    }

    .prompt-checklist-card {
        position: static;
    }
}

@media (max-width: 760px) {
    .prompt-builder {
        min-height: calc(100svh - 122px);
    }

    .prompt-builder__inner {
        padding-left: 18px;
        padding-right: 18px;
    }

    .prompt-builder__shell {
        grid-template-columns: 1fr;
    }

    .prompt-builder__rail {
        padding: 12px;
    }

    .prompt-steps {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
    }

    .prompt-steps li {
        grid-template-columns: 1fr;
        justify-items: center;
        min-height: 70px;
        gap: 5px;
        padding: 7px 4px;
    }

    .prompt-steps li strong {
        font-size: 11px;
    }

    .choice-grid,
    .check-grid {
        grid-template-columns: 1fr;
    }

    .prompt-output__head {
        display: grid;
    }

    .prompt-output__text {
        min-height: 340px;
    }

    .prompt-lesson {
        grid-template-columns: 1fr;
    }

    .prompt-lesson__index {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .prompt-checklist-score li {
        grid-template-columns: 36px 1fr;
    }

    .prompt-checklist-score li span {
        width: 32px;
        height: 32px;
    }
}
