:root {
    --prompt-on-accent: #0A0A0A;
}

.prompt-shell {
    min-height: 620px; /* WHY: hero ma własny rytm, bez sztucznego centrowania w całym ekranie */
    display: flex;
    align-items: flex-start;
    padding-top: 72px; /* WHY: rytm hero zgodny z publicznymi stronami narzędzi AIBIZNESLAB */
    padding-bottom: 72px; /* WHY: oddech przed pełną stopką firmową */
}

.prompt-screen {
    width: 100%;
}

.prompt-screen:not(.active) {
    display: none;
}

.prompt-screen.active {
    display: block;
    animation: prompt-screen-in 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.prompt-screen h1[tabindex="-1"]:focus,
.prompt-screen h2[tabindex="-1"]:focus {
    outline: none;
}

@keyframes prompt-screen-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.start-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    gap: 64px;
    align-items: center;
    width: 100%;
}

.start-copy {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
}

.start-copy h1 {
    max-width: 620px;
    margin: 0;
    font-size: clamp(3rem, 4.6vw, 4rem); /* WHY: trzy linie w lewej kolumnie przy zachowaniu hierarchii hero */
    line-height: 1;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.start-copy .start-lead {
    max-width: 54ch;
    margin: 0;
    font-size: 1.125rem; /* WHY: czytelny lead hero, większy od body narzędzia */
    line-height: 1.6;
    text-wrap: pretty;
}

.start-copy .btn-lg {
    min-height: 56px; /* WHY: główne CTA było wizualnie za małe względem hero */
}

.start-copy .start-micro {
    max-width: 42ch;
    margin: 0;
    font-size: 0.95rem; /* WHY: informacja pomocnicza ma pozostać wtórna wobec CTA */
    color: var(--text-dim);
    line-height: 1.55;
    text-wrap: pretty;
}

.assistant-assembly {
    width: 100%;
    max-width: 580px;
    margin: 0;
}

.assistant-assembly img {
    width: 100%;
    height: auto;
    display: block;
    mix-blend-mode: multiply; /* WHY: neutralne tło PNG stapia się z kanwą #FAFAFA bez ramki */
    -webkit-mask-image: radial-gradient(ellipse at center, #000 68%, transparent 100%);
    mask-image: radial-gradient(ellipse at center, #000 68%, transparent 100%); /* WHY: usuwa prostokątną krawędź tła GPT Image 2 */
}

.gate-wrap,
.builder-wrap {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.result-wrap {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

.gate-wrap {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(420px, 0.75fr);
    gap: 88px;
    align-items: start;
}

.gate-copy {
    padding-top: 8px;
}

.gate-wrap h2 {
    margin: 22px 0 14px;
    max-width: 560px;
    font-size: clamp(2.75rem, 4vw, 4rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.gate-copy > p {
    max-width: 48ch;
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.6;
    text-wrap: pretty;
}

.gate-wrap form {
    padding: 30px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-elev-1);
    text-align: left;
}

.prompt-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text-dim);
    font-size: 1rem;
}

.prompt-consent input {
    margin-top: 3px;
    accent-color: var(--accent);
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.prompt-consent label {
    min-height: 44px;
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    text-wrap: pretty;
}

.prompt-honeypot {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.builder-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-bottom: 10px;
}

.text-button {
    border: 0;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-button:hover,
.text-button:focus-visible {
    color: var(--accent);
}

.builder-progress {
    height: 5px;
    border-radius: 999px;
    background: var(--bg-elev-3);
    overflow: hidden;
    margin-bottom: 52px;
}

.builder-progress-fill {
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: var(--accent);
    transform-origin: left;
    transform: scaleX(0.33333);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.builder-step.active {
    display: grid;
    grid-template-columns: minmax(440px, 0.95fr) minmax(520px, 1.05fr);
    gap: 56px;
    align-items: start;
}

.builder-step-copy {
    padding-top: 6px;
}

.builder-step h2 {
    max-width: 100%;
    margin: 0 0 16px;
    font-size: clamp(2.75rem, 3.6vw, 3.75rem);
    line-height: 1;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.builder-step-copy > p {
    max-width: 38ch;
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.6;
    text-wrap: pretty;
}

.builder-control-panel {
    padding: 24px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-elev-1);
}

.builder-control-panel > .form-group {
    margin-bottom: 18px;
}

.builder-step textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.55;
}

.builder-step textarea::placeholder,
.gate-wrap input::placeholder {
    color: var(--text-dim);
    opacity: 1;
}

.field-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
    color: var(--text-dim);
    font-size: 0.75rem;
}

.format-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.format-option {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(190px, 0.82fr) minmax(0, 1.18fr) 24px;
    gap: 18px;
    align-items: center;
    text-align: left;
    min-height: 72px;
    padding: 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-elev-1);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.format-option::after {
    content: '';
    grid-column: 3;
    grid-row: 1;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: var(--prompt-on-accent);
    font-size: 0.75rem;
    font-weight: 700;
}

.format-option:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.format-option:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.format-option[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.format-option[aria-pressed="true"]::after {
    content: '✓';
    border-color: var(--accent);
    background: var(--accent);
}

.prompt-shell .btn {
    min-height: 44px;
    font-size: 1rem;
}

.format-name {
    font-weight: 600;
}

.format-desc {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.45;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
    box-shadow: none;
}

.result-wrap {
    display: block;
}

.result-intro {
    max-width: 800px;
    margin-bottom: 40px;
}

.result-intro > .eyebrow {
    margin: 0;
}

.result-intro h2 {
    max-width: 760px;
    margin: 22px 0 16px;
    font-size: clamp(2.75rem, 4vw, 4rem);
    line-height: 1;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.result-lead {
    max-width: 64ch;
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.6;
    text-wrap: pretty;
}

.result-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.65fr);
    grid-template-areas: "prompt sidebar";
    gap: 48px;
    align-items: start;
}

.result-sidebar {
    grid-area: sidebar;
    position: sticky;
    top: 104px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.prompt-result {
    grid-area: prompt;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-elev-1);
    overflow: hidden;
}

.prompt-result-top {
    min-height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 600;
}

.prompt-result-label {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 500;
}

.copy-button {
    width: 100%;
    min-height: 44px;
    padding: 9px 13px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--prompt-on-accent);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.copy-button:hover {
    filter: brightness(1.08);
}

.copy-button:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

#assistant-output {
    min-height: 0;
    padding: 28px;
    overflow-wrap: anywhere;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-elev-1);
}

.assistant-prompt-title {
    max-width: 24ch;
    margin: 0 0 26px;
    font-size: 1.5rem;
    line-height: 1.18;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.assistant-prompt-section {
    margin: 34px 0 10px;
    font-size: 1rem;
    line-height: 1.35;
    text-wrap: balance;
}

.assistant-prompt-subsection {
    margin: 18px 0 7px;
    color: var(--accent);
    font-size: 0.8125rem;
    line-height: 1.35;
}

.assistant-prompt-paragraph,
.assistant-prompt-list-item {
    margin: 0;
    text-wrap: pretty;
}

.assistant-prompt-paragraph + .assistant-prompt-paragraph,
.assistant-prompt-paragraph + .assistant-prompt-list-item,
.assistant-prompt-list-item + .assistant-prompt-list-item,
.assistant-prompt-list-item + .assistant-prompt-paragraph {
    margin-top: 8px;
}

.assistant-prompt-list-item {
    padding-left: 22px;
    text-indent: -22px;
}

.copy-status {
    min-height: 20px;
    margin-top: 8px;
    color: var(--text-dim);
    font-size: 0.75rem;
}

.assistant-explainer {
    border-top: 1px solid var(--border-strong);
}

.assistant-explainer h3 {
    margin: 20px 0 8px;
    font-size: 1.5rem;
}

.assistant-explainer > p {
    margin: 0 0 18px;
    color: var(--text-dim);
    line-height: 1.55;
    text-wrap: pretty;
}

.assistant-summary {
    margin: 0;
}

.assistant-summary > div {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.assistant-summary dt {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.assistant-summary dd {
    margin: 0;
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.assistant-explainer details {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.assistant-explainer summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.assistant-explainer summary::-webkit-details-marker {
    display: none;
}

.assistant-explainer summary::after {
    content: "+";
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 500;
}

.assistant-explainer details[open] summary::after {
    content: "×";
}

.assistant-explainer details:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.assistant-explainer details ol {
    margin: 0;
    padding: 0 0 18px 22px;
    color: var(--text-dim);
    font-size: 0.9375rem;
    line-height: 1.55;
}

.assistant-explainer details li + li {
    margin-top: 8px;
}

.usage-steps {
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elev-2);
}

.usage-steps h3 {
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.usage-steps ol {
    padding-left: 22px;
    color: var(--text-dim);
}

.usage-steps li + li {
    margin-top: 8px;
}

.usage-steps .copy-button {
    margin-top: 20px;
}

.result-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}

.result-actions .btn {
    width: 100%;
    justify-content: center;
}

.contact-intent {
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.contact-intent h3 {
    margin: 0 0 8px;
    font-size: 1.125rem;
    line-height: 1.35;
}

.contact-intent p {
    margin: 0 0 16px;
    color: var(--text-dim);
    font-size: 0.9375rem;
    line-height: 1.55;
}

.contact-intent .btn {
    width: 100%;
    justify-content: center;
}

.contact-intent-status {
    min-height: 1.5em;
    margin-top: 8px;
    color: var(--text-dim);
    font-size: 0.875rem;
    line-height: 1.5;
}

.btn-accent {
    color: var(--prompt-on-accent);
}

.prompt-shell .eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: none;
}

.prompt-shell .form-group label {
    font-size: 0.75rem;
}

.prompt-shell .form-error {
    font-size: 1rem;
}

@media (max-width: 1100px) {
    .builder-step.active {
        display: block;
    }

    .builder-step-copy {
        padding-top: 0;
        margin-bottom: 28px;
    }

    .result-intro {
        margin-bottom: 32px;
    }

    .result-workspace {
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    .result-sidebar {
        position: static;
        display: contents;
    }

    .usage-steps {
        order: 1;
    }

    .prompt-result {
        order: 3;
        width: 100%;
    }

    .assistant-explainer {
        order: 4;
    }

    .contact-intent {
        order: 2;
    }

    .result-actions {
        order: 5;
    }
}

@media (max-width: 960px) {
    .header-actions {
        display: none; /* WHY: standardowy mobilny header ma logo i hamburger w jednym rzędzie */
    }

    .prompt-shell {
        min-height: 0;
        align-items: flex-start;
        padding-top: 56px; /* WHY: rytm mobilny zgodny z publicznymi hero AIBIZNESLAB */
        padding-bottom: 64px;
    }

    .start-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .start-copy {
        align-items: center;
        text-align: center;
    }

    .start-copy h1 {
        max-width: 620px;
        font-size: clamp(2.75rem, 10vw, 3.5rem); /* WHY: maksymalnie trzy linie na telefonie bez przepełnienia */
        line-height: 1;
    }

    .start-copy .start-lead,
    .start-copy .start-micro {
        margin-right: auto;
        margin-left: auto;
    }

    .hero-visual {
        width: 100%;
    }

    .gate-wrap,
    .builder-wrap,
    .result-wrap {
        max-width: 650px;
    }

    .gate-wrap {
        display: block;
    }

    .gate-copy {
        padding-top: 0;
        text-align: left;
    }

    .gate-wrap h2,
    .builder-step h2,
    .result-wrap h2 {
        font-size: clamp(2.5rem, 8vw, 3.5rem);
    }

    .gate-wrap form {
        margin-top: 32px;
    }

    .builder-step-copy {
        padding-top: 0;
        margin-bottom: 28px;
    }

    .format-option {
        grid-template-columns: 1fr 24px;
        gap: 5px;
    }

    .format-option::after {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .format-name,
    .format-desc {
        grid-column: 1;
    }

}

@media (max-width: 480px) {
    .prompt-shell {
        padding-left: 18px;
        padding-right: 18px;
        padding-top: 44px;
    }

    .gate-wrap form,
    .builder-control-panel {
        padding: 20px;
    }

    .builder-progress {
        margin-bottom: 34px;
    }

    .builder-step-copy {
        margin-bottom: 24px;
    }

    .builder-step-copy > p,
    .gate-copy > p,
    .result-lead {
        font-size: 1rem;
    }

    .prompt-result-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .start-copy .btn-lg {
        width: 100%;
        justify-content: center;
    }

    .copy-button {
        width: 100%;
    }

    .assistant-summary > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    #assistant-output {
        padding: 20px;
    }

    .prompt-result-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
