:root {
    --ink: #172033;
    --muted: #667085;
    --line: #d8deea;
    --surface: #ffffff;
    --soft: #f4f7fb;
    --brand: #2459d3;
    --brand-dark: #1743a8;
    --success-bg: #ecfdf3;
    --success-ink: #166534;
    --error-bg: #fff1f2;
    --error-ink: #9f1239;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(28, 45, 85, 0.12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: linear-gradient(145deg, #eef4ff 0%, #fbfcff 45%, #f5f7fb 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-page { min-height: 100vh; }

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 64px;
}

.narrow-shell { width: min(760px, calc(100% - 32px)); }
.result-shell { width: min(1180px, calc(100% - 32px)); }

.hero { margin-bottom: 28px; }
.hero.compact { margin-bottom: 22px; }
.hero h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.04;
    letter-spacing: -0.045em;
}
.hero.compact h1 { font-size: clamp(2rem, 4vw, 3rem); }
.hero > p:not(.eyebrow) {
    margin: 16px 0 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 1.08rem;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.card,
.preview-panel,
.danger-zone,
.privacy-note {
    border: 1px solid rgba(159, 172, 198, 0.38);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.card { padding: clamp(22px, 5vw, 36px); }
.card h2, .privacy-note h2, .danger-zone h2 { margin-top: 0; }

.stack { display: grid; gap: 22px; }
label { display: block; margin-bottom: 8px; font-weight: 750; }
.optional, .help, .small { color: var(--muted); font-weight: 400; }
.help { margin: 7px 0 0; font-size: 0.9rem; }
.small { font-size: 0.92rem; }

input[type="text"], input[type="password"], input[type="file"], textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    color: var(--ink);
    padding: 13px 14px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(36, 89, 211, 0.14);
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0;
    font-weight: 550;
}
.check-row input { width: 19px; height: 19px; margin-top: 3px; flex: 0 0 auto; }

.primary-button, .secondary-button, .danger-button, .copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 12px;
    padding: 10px 18px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-weight: 800;
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.primary-button { background: var(--brand); color: white; }
.primary-button:hover { background: var(--brand-dark); transform: translateY(-1px); }
.secondary-button { background: white; color: var(--ink); border-color: var(--line); }
.secondary-button:hover { border-color: #aab5c8; transform: translateY(-1px); }
.danger-button { background: var(--danger); color: white; }
.copy-button { background: #eef3ff; color: #173b91; white-space: nowrap; }
.copy-button.copied { background: #dcfce7; color: #166534; }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

.notice {
    margin: 0 0 22px;
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid transparent;
}
.notice.success { background: var(--success-bg); color: var(--success-ink); border-color: #bbf7d0; }
.notice.error { background: var(--error-bg); color: var(--error-ink); border-color: #fecdd3; }

.privacy-note { margin-top: 22px; padding: 24px 28px; box-shadow: none; }
.privacy-note p:last-child { margin-bottom: 0; }

.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.label-line { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; }
#name-count { color: var(--muted); font-size: 0.9rem; }

.output-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.output-card { display: grid; gap: 18px; align-content: space-between; }
.output-card p { margin-bottom: 0; color: var(--muted); }

.copy-field { display: flex; gap: 10px; align-items: stretch; }
.copy-field input, .copy-field textarea { min-width: 0; }
.copy-field-code { align-items: flex-end; }

.preview-panel { margin-top: 22px; padding: clamp(18px, 4vw, 28px); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; }
.spinner-preview {
    display: block;
    width: 100%;
    height: 720px;
    border: 0;
    border-radius: 16px;
    background: #f5f7fb;
}

.danger-zone { margin-top: 22px; padding: 24px 28px; box-shadow: none; border-color: #f0b5b5; }
.danger-zone p { color: var(--muted); }
.centered { text-align: center; margin-top: 28px; }
.text-link { color: var(--brand); font-weight: 750; }

@media (max-width: 760px) {
    .shell { padding-top: 30px; }
    .output-grid { grid-template-columns: 1fr; }
    .copy-field { flex-direction: column; }
    .button-row, .section-heading { align-items: stretch; flex-direction: column; }
    .spinner-preview { height: 760px; }
}
