/* ─── Tokens ─────────────────────────────────────────────── */
:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --line: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --accent: #16a34a;
    --accent-strong: #15803d;
    --accent-soft: #f0fdf4;
    --danger: #b91c1c;
    --warning: #b07b32;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
    --radius-xl: 1rem;
    --radius-lg: 0.75rem;
    --radius-md: 0.5rem;
    --shell: 1220px;
    --mouse-x: 50%;
    --mouse-y: 30%;
}

/* ─── Reset & base ───────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(
            ellipse 700px 560px at var(--mouse-x) var(--mouse-y),
            rgba(22, 163, 74, 0.06),
            transparent 55%
        ),
        var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

/* ─── Utilities ──────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

.shell {
    width: min(calc(100% - 2rem), var(--shell));
    margin: 0 auto;
}

.page-section {
    padding: 4rem 0;
}

.page-section--compact {
    padding: 2.5rem 0;
}

.content-narrow {
    width: min(100%, 52rem);
    margin: 0 auto;
    padding: clamp(1.6rem, 3vw, 2.5rem);
    display: grid;
    gap: 1.15rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.content-narrow > * {
    margin: 0;
}

.content-narrow h2 {
    font-size: 1.05rem;
    letter-spacing: -0.03em;
}

.content-narrow p,
.content-narrow li {
    color: var(--muted);
    line-height: 1.75;
}

.content-narrow a {
    color: var(--accent-strong);
    text-decoration: underline;
    text-decoration-color: rgba(21, 128, 61, 0.28);
    text-underline-offset: 0.18em;
}

[data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 400ms ease,
        transform 400ms ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Typography ─────────────────────────────────────────── */
.section-title,
.landing-title,
.auth-title {
    margin: 0;
    font-size: clamp(2rem, 3vw + 1rem, 3.8rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
    font-weight: 700;
    text-wrap: balance;
}

.landing-title {
    background: linear-gradient(135deg, var(--text) 55%, var(--accent-strong) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-copy,
.landing-copy,
.auth-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 1rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.eyebrow--soft {
    background: var(--accent-soft);
}

/* ─── Buttons ────────────────────────────────────────────── */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 2.75rem;
    padding: 0 1.1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition:
        transform 140ms ease,
        border-color 140ms ease,
        background-color 140ms ease,
        color 140ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--primary {
    background: var(--accent);
    color: #ffffff;
}

.button--primary:hover {
    background: var(--accent-strong);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.button--secondary {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
}

.button--secondary:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.button--ghost {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.button--ghost:hover {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.button--full {
    width: 100%;
}

/* ─── Brand ──────────────────────────────────────────────── */
.brand-lockup {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-lockup img {
    height: 28px;
    width: auto;
    display: block;
}

.brand-lockup--compact img {
    height: 28px;
    width: 28px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 700;
}

.status-pill--muted {
    background: var(--accent-soft);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    padding: 0.35rem 0.72rem 0.35rem 0.58rem;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
    transition:
        border-color 140ms ease,
        background-color 140ms ease,
        color 140ms ease,
        transform 140ms ease;
}

.back-link:hover,
.back-link:focus-visible {
    border-color: rgba(22, 163, 74, 0.18);
    background: var(--accent-soft);
    color: var(--accent-strong);
    outline: none;
    transform: translateX(-1px);
}

.back-link__icon {
    line-height: 1;
}

/* ─── Nav ────────────────────────────────────────────────── */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(250, 250, 249, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.site-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
}

.site-nav__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ─── Landing ────────────────────────────────────────────── */
.landing-hero {
    padding: 4rem 0 2rem;
}

.landing-hero__inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 680px;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 1.25rem;
    align-items: start;
}

.section-copy-block {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-stack {
    display: grid;
    gap: 1rem;
}

.feature-item,
.step-card,
.admin-stat {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.feature-item:hover,
.step-card:hover {
    border-color: rgba(22, 163, 74, 0.28);
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.08), 0 8px 24px rgba(22, 163, 74, 0.09);
    transform: translateY(-2px);
}

.feature-item strong,
.step-card h3,
.admin-stat strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 1rem;
    font-weight: 700;
}

.feature-item p,
.step-card p,
.admin-content p,
.empty-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.steps-shell {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.step-card span {
    display: inline-flex;
    margin-bottom: 0.75rem;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.cta-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

/* ─── Login ──────────────────────────────────────────────── */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-panel {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-panel__logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.auth-panel__header {
    margin-bottom: 1.25rem;
}

.auth-panel__header h1 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.04em;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.form-field {
    display: grid;
    gap: 0.4rem;
}

.form-field span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.field-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    padding: 0.75rem 0.9rem;
    outline: none;
    transition:
        border-color 140ms ease,
        box-shadow 140ms ease;
}

.field-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.form-alert {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(185, 28, 28, 0.18);
    background: rgba(254, 242, 242, 0.96);
    color: var(--danger);
    font-size: 0.9rem;
}

.auth-panel__footer {
    display: flex;
    justify-content: center;
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
}

/* ─── Workspace ──────────────────────────────────────────── */
.workspace-page {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr;
}

.workspace-topbar {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.workspace-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
}

.workspace-topbar__left,
.workspace-topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inline-logout-form {
    display: inline-flex;
    margin: 0;
}

.workspace-user {
    color: var(--muted);
    font-size: 0.88rem;
    white-space: nowrap;
}

.workspace-app {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
}

.workspace-app--with-snapshot {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.05fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    gap: 1rem;
    overflow: hidden;
    padding: 1rem 0;
}

.pilot-snapshot {
    display: grid;
    align-content: start;
    gap: 1rem;
    min-height: 0;
    overflow-y: auto;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 10% 0%, rgba(22, 163, 74, 0.1), transparent 28rem),
        var(--surface);
    box-shadow: var(--shadow);
}

.pilot-snapshot__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.pilot-snapshot__header h1 {
    margin: 0.2rem 0 0.35rem;
    font-size: clamp(1.55rem, 2.4vw, 2.35rem);
    letter-spacing: -0.05em;
}

.pilot-snapshot__header p {
    margin: 0;
    max-width: 40rem;
    color: var(--muted);
    line-height: 1.55;
}

.pilot-status {
    min-width: 11rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--bg);
}

.pilot-status span,
.pilot-card span,
.pilot-card small,
.claim-card span,
.claim-card small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.pilot-status strong,
.pilot-card strong {
    display: block;
    margin-top: 0.3rem;
    color: var(--text);
    font-size: 1.1rem;
}

.pilot-status--ready {
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(220, 252, 231, 0.62);
}

.pilot-status--pending {
    border-color: rgba(217, 119, 6, 0.28);
    background: rgba(255, 251, 235, 0.86);
}

.pilot-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.pilot-card,
.pilot-panel,
.claim-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
}

.pilot-card {
    padding: 0.9rem;
}

.pilot-card strong {
    font-size: clamp(1.25rem, 2vw, 1.85rem);
    letter-spacing: -0.05em;
}

.pilot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.pilot-panel {
    padding: 1rem;
}

.pilot-panel--wide {
    display: grid;
    gap: 0.8rem;
}

.pilot-panel h2 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
}

.pilot-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pilot-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 0.32rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.pilot-pill--ok {
    border-color: rgba(22, 163, 74, 0.3);
    background: rgba(220, 252, 231, 0.75);
    color: var(--accent-strong);
}

.pilot-pill--warn {
    border-color: rgba(217, 119, 6, 0.25);
    background: rgba(255, 251, 235, 0.9);
    color: #92400e;
}

.pilot-list {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text);
    line-height: 1.45;
}

.pilot-empty {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.claim-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.claim-card {
    display: grid;
    gap: 0.3rem;
    padding: 0.85rem;
}

.claim-card strong {
    font-size: 0.9rem;
}

.claim-card--available {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(240, 253, 244, 0.75);
}

/* ─── Chat ───────────────────────────────────────────────── */
.chat-stage {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    align-self: stretch;
    box-sizing: border-box;
}

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.chat-empty__card {
    max-width: 22rem;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px dashed var(--line);
    text-align: center;
    color: var(--muted);
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        border-color: var(--line);
        box-shadow: none;
    }
    50% {
        border-color: rgba(22, 163, 74, 0.35);
        box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.06);
    }
}

.chat-empty__card strong {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text);
    font-size: 1rem;
}

.message-row {
    display: flex;
}

.message-row--assistant,
.message-row--error {
    justify-content: flex-start;
}

.message-row--user {
    justify-content: flex-end;
}

.message-bubble {
    max-width: min(100%, 42rem);
    padding: 0.85rem 1rem;
    border-radius: 1.1rem;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.message-row--user .message-bubble {
    border-color: rgba(22, 163, 74, 0.18);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.message-row--error .message-bubble {
    border-color: rgba(185, 28, 28, 0.15);
    background: rgba(254, 242, 242, 0.96);
}

.message-content {
    line-height: 1.7;
    white-space: normal;
    font-size: 0.95rem;
}

.message-content p {
    margin: 0;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.message-channel {
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 700;
}

.message-retry {
    margin-top: 0.75rem;
}

.typing-indicator {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--muted);
    font-size: 0.88rem;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem 0.5rem;
    box-sizing: border-box;
}

.typing-indicator__dots {
    display: inline-flex;
    gap: 0.3rem;
}

.typing-indicator__dots span {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--accent);
    animation: bounce 1.2s infinite ease-in-out;
}

.typing-indicator__dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator__dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.chat-composer-wrap {
    flex: 0 0 auto;
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 0.75rem 1rem 1rem;
}

.chat-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
    max-width: 720px;
    margin: 0 auto;
}

.chat-composer__field {
    min-width: 0;
}

.chat-input {
    width: 100%;
    min-height: 3rem;
    max-height: 12rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg);
    color: var(--text);
    padding: 0.75rem 0.9rem;
    outline: none;
    resize: none;
    line-height: 1.5;
    transition:
        border-color 140ms ease,
        box-shadow 140ms ease;
}

.chat-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
    background: var(--surface);
}

/* ─── Surface panel (admin) ──────────────────────────────── */
.surface-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.surface-panel__body {
    display: grid;
    gap: 1rem;
}

.surface-panel__header {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.surface-panel__title {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

.surface-panel__subtitle {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

/* ─── Admin ──────────────────────────────────────────────── */
.admin-page {
    display: grid;
    gap: 1rem;
    padding-bottom: 1.5rem;
}

.admin-hero {
    display: grid;
    gap: 1rem;
    padding: 1.8rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.admin-stat span {
    color: var(--muted);
    font-size: 0.84rem;
}

.admin-stat strong {
    margin-top: 0.45rem;
    font-size: 1.7rem;
    letter-spacing: -0.05em;
}

.admin-grid {
    display: grid;
    gap: 1rem;
}

.admin-feed {
    display: grid;
    gap: 0.75rem;
}

.admin-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: var(--surface);
}

.admin-dot {
    width: 0.65rem;
    height: 0.65rem;
    margin-top: 0.4rem;
    border-radius: 999px;
    background: var(--accent);
}

.admin-dot--danger {
    background: var(--danger);
}

.admin-dot--warning {
    background: var(--warning);
}

.admin-content {
    min-width: 0;
}

.admin-content strong {
    display: block;
    margin-bottom: 0.2rem;
}

.row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
}

/* ─── Lead form ──────────────────────────────────────────── */
.pilot-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.pilot-metric-grid article {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
}

.pilot-metric-grid span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pilot-metric-grid strong {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

.pilot-metric-grid small {
    color: var(--muted);
    line-height: 1.45;
}

.lead-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.1rem 0 0.25rem;
    text-align: left;
}

.lead-form label {
    display: grid;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--muted);
}

.lead-form button {
    grid-column: 1 / -1;
    justify-self: start;
}

.lead-form input,
.lead-form select {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.lead-form input:focus,
.lead-form select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.form-success {
    width: fit-content;
    margin: 0;
    padding: 0.75rem 0.95rem;
    border: 1px solid rgba(22, 163, 74, 0.22);
    border-radius: var(--radius-lg);
    background: rgba(240, 253, 244, 0.88);
    color: var(--accent-strong);
    font-weight: 700;
    line-height: 1.45;
}

/* ─── Responsive ─────────────────────────────────────────── */
.pilot-snapshot .pilot-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pilot-snapshot .pilot-card strong {
    font-size: clamp(1.25rem, 2vw, 1.85rem);
}

@media (max-width: 980px) {
    .content-grid,
    .admin-stats {
        grid-template-columns: 1fr;
    }

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

    .pilot-snapshot .pilot-metric-grid,
    .claim-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workspace-app--with-snapshot {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .pilot-snapshot {
        overflow: visible;
    }

    .workspace-app--with-snapshot .chat-stage {
        flex: 0 0 auto;
        min-height: 560px;
    }
}

@media (max-width: 720px) {
    .shell {
        width: min(calc(100% - 1rem), var(--shell));
    }

    .site-nav__actions {
        display: none;
    }

    .chat-composer {
        grid-template-columns: 1fr;
    }

    .button--primary,
    .button--secondary,
    .button--ghost {
        width: 100%;
    }

    .landing-actions {
        flex-direction: column;
    }

    .workspace-user {
        display: none;
    }

    .content-narrow {
        padding: 1.25rem;
        gap: 1rem;
    }

    .pilot-metric-grid {
        grid-template-columns: 1fr;
    }

    .pilot-snapshot__header {
        display: grid;
    }

    .pilot-grid,
    .claim-grid,
    .pilot-snapshot .pilot-metric-grid {
        grid-template-columns: 1fr;
    }
}

/* Legal footer — LGPD compliance surface on public pages. Intentionally
   minimal so it blends with existing page aesthetics. */
.legal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4rem;
    padding: 1.75rem 0 2.5rem;
    font-size: 0.875rem;
    opacity: 0.78;
}

.legal-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
    justify-content: space-between;
}

.legal-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.legal-footer__nav a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.legal-footer__nav a:hover {
    border-bottom-color: currentColor;
}

.legal-footer__dpo {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.legal-footer__label {
    font-weight: 600;
}

.legal-footer__dpo a {
    color: inherit;
}

/* ─── Workspace nav (dashboard + chat) ───────────────────── */
.workspace-topbar__nav {
    display: flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.06);
    border: 1px solid rgba(22, 163, 74, 0.1);
}

.workspace-topbar__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease;
}

.workspace-topbar__nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.5);
}

.workspace-topbar__nav-link--active {
    background: var(--surface);
    color: var(--accent-strong);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ─── Dashboard (solo snapshot, no chat alongside) ───────── */
.workspace-app--dashboard {
    padding: clamp(1rem, 2vw, 1.5rem) 0 3rem;
}

.workspace-app--dashboard .pilot-snapshot {
    overflow: visible;
    padding: clamp(1rem, 2vw, 1.45rem);
    border-color: rgba(229, 231, 235, 0.86);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pilot-cta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(22, 163, 74, 0.2);
    border-radius: var(--radius-lg);
    background: rgba(240, 253, 244, 0.75);
}

.pilot-cta-row__hint {
    color: var(--muted);
    font-size: 0.88rem;
}

/* ─── Chat page layout (sidebar + stage) ─────────────────── */
.workspace-app--chat {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem 0;
    min-height: calc(100vh - 64px);
}

.chat-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow-y: auto;
}

.chat-sidebar__section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.chat-sidebar__section--muted {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
    color: var(--muted);
}

.chat-sidebar__title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.chat-sidebar__hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.chat-sidebar__link {
    color: var(--accent-strong);
    font-weight: 600;
    border-bottom: 1px solid rgba(22, 163, 74, 0.3);
}

.chat-sidebar__chips {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.suggestion-chip {
    appearance: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text);
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}

.suggestion-chip:hover {
    border-color: rgba(22, 163, 74, 0.35);
    background: var(--accent-soft);
}

.suggestion-chip:active {
    transform: scale(0.99);
}

/* Chat page: stretch stage to full height */
.workspace-app--chat .chat-stage {
    height: 100%;
    min-height: 0;
}

/* Dashboard: widen metric grid since chat isn't sharing the space */
.workspace-app--dashboard .pilot-snapshot .pilot-metric-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.workspace-app--dashboard .pilot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .workspace-app--dashboard .pilot-snapshot .pilot-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .workspace-app--dashboard .pilot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workspace-app--chat {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    .workspace-topbar__nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .workspace-topbar__inner {
        flex-wrap: wrap;
    }

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

    .chat-sidebar {
        max-height: 280px;
    }

    .workspace-app--dashboard .pilot-snapshot .pilot-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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