:root {
    --ink: #000;
    --muted: rgba(0, 0, 0, 0.62);
    --paper: #fff;
    --surface: #fff;
    --line: rgba(0, 0, 0, 0.16);
    --brand: #4a5d4a;
    --code: #000;
    --error: #000;
    --success: #4a5d4a;
    --radius: 18px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.5;
}

button,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

.clipboard-helper {
    position: fixed;
    top: 0;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.site-header,
.site-footer,
.page-shell {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.13);
}

.client-brand {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: 160px;
    height: 42px;
    object-fit: contain;
}

.product-tag {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.page-shell {
    padding-block: 32px 56px;
}

.intro {
    width: 100%;
    margin-bottom: 24px;
}

.eyebrow,
.panel-kicker {
    margin: 0 0 10px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 1.05;
}

.intro-copy {
    max-width: none;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 18px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.prompt-panel,
.output-panel {
    min-width: 0;
    padding: 34px;
}

.prompt-panel {
    border-right: 1px solid var(--line);
}

.field-heading,
.output-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.field-heading label {
    font-size: 18px;
    font-weight: 400;
}

#characterCount,
.output-note {
    color: var(--muted);
    font-size: 12px;
}

textarea {
    display: block;
    width: 100%;
    min-height: 300px;
    margin: 16px 0 26px;
    padding: 18px;
    resize: vertical;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    line-height: 1.6;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(74, 93, 74, 0.2);
}

textarea::placeholder {
    color: rgba(0, 0, 0, 0.42);
}

.primary-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 17px;
    color: #fff;
    background: var(--brand);
    border: 0;
    border-radius: 10px;
    font-weight: 400;
    transition: background 150ms ease, transform 150ms ease;
}

.primary-button:hover:not(:disabled) {
    background: var(--brand);
    opacity: 0.9;
    transform: translateY(-1px);
}

.primary-button.is-loading {
    opacity: 0.78;
}

.status-message {
    min-height: 22px;
    margin: 13px 0 0;
    font-size: 13px;
}

.status-message.is-error {
    color: var(--error);
}

.status-message.is-success {
    color: var(--success);
}

.status-message.is-working {
    color: var(--muted);
}

.output-panel {
    color: #fff;
    background: var(--code);
}

.output-toolbar h2 {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 15px;
    font-weight: 700;
}

.copy-button {
    flex: none;
    padding: 8px 12px;
    color: #fff;
    background: #4a5d4a;
    border: 1px solid #4a5d4a;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 400;
}

.copy-button:disabled {
    opacity: 0.45;
}

.code-wrap {
    position: relative;
    min-height: 350px;
    margin-top: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 12px;
}

pre {
    height: 350px;
    margin: 0;
    padding: 20px;
    overflow: auto;
    color: rgba(255, 255, 255, 0.82);
    font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    tab-size: 4;
    white-space: pre;
}

.empty-state {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    color: rgba(255, 255, 255, 0.52);
    background: var(--code);
    pointer-events: none;
}

.empty-state[hidden] {
    display: none;
}

.ring-icon {
    width: 52px;
    height: 52px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.ring-icon::before {
    display: block;
    width: 13px;
    height: 13px;
    margin: -10px auto 0;
    content: "";
    border: 2px solid var(--brand);
    transform: rotate(45deg);
}

.output-note {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.56);
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 38px;
}

.steps article {
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.18);
}

.steps span {
    color: var(--brand);
    font-size: 12px;
    font-weight: 400;
}

.steps h2 {
    margin: 7px 0 2px;
    font: 700 22px "Montserrat", sans-serif;
}

.steps p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 88px;
    color: var(--muted);
    border-top: 1px solid rgba(0, 0, 0, 0.13);
    font-size: 12px;
}

.powered-by {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 8px;
}

.provider-logo {
    width: auto;
    max-width: 110px;
    height: 24px;
    object-fit: contain;
}

@media (max-width: 820px) {
    .page-shell {
        padding-top: 28px;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .prompt-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 560px) {
    .site-header,
    .site-footer,
    .page-shell {
        width: min(100% - 28px, 1180px);
    }

    .product-tag {
        display: none;
    }

    .page-shell {
        padding-block: 26px 42px;
    }

    h1 {
        font-size: 38px;
    }

    .prompt-panel,
    .output-panel {
        padding: 24px 18px;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
