:root {
    color-scheme: light;
    --bg: #f6f7fb;
    --ink: #152033;
    --muted: #5f6b7a;
    --panel: #ffffff;
    --line: #dfe4ea;
    --accent: #155eef;
    --accent-dark: #0f45b8;
    --warning: #8a5200;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto;
    display: grid;
    gap: 18px;
}

.header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0 0 10px;
    line-height: 1.15;
}

h1 {
    font-size: 34px;
}

h2 {
    font-size: 20px;
}

p {
    margin: 0 0 10px;
}

.intro,
.author,
.panel p,
.status-grid {
    color: var(--muted);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    justify-content: flex-end;
}

label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

select,
input,
button,
textarea {
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

select,
input,
button {
    min-height: 42px;
    padding: 0 12px;
}

button {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    cursor: pointer;
    font-weight: 800;
}

button:hover {
    background: var(--accent-dark);
}

button:disabled {
    background: #8b96a8;
    border-color: #8b96a8;
    cursor: not-allowed;
}

.danger-button {
    margin-top: 12px;
    background: #8b2525;
    border-color: #8b2525;
}

.suppression-form {
    margin-top: 12px;
}

.header-links {
    display: flex;
    gap: 16px;
}

.panel,
.card {
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(21, 32, 51, 0.06);
}

.product-panel {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.status-grid,
.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-grid span,
.meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef3ff;
    color: #1d3f86;
    font-size: 12px;
    font-weight: 800;
}

.warning {
    border-color: #ffd899;
}

.warning p {
    color: var(--warning);
}

.results {
    display: grid;
    gap: 14px;
}

.result-card {
    margin: 10px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

.result-card p {
    margin: 8px 0;
}

.lead-pool {
    margin: 18px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

.lead-pool-heading {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 18px;
}

.lead-pool-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
    align-items: end;
}

.lead-pool-reset {
    align-self: center;
}

.lead-pool-table {
    min-width: 1040px;
}

.lead-pool-table td:first-child {
    min-width: 210px;
}

.lead-pool-table td:nth-child(2),
.lead-pool-table td:nth-child(3) {
    min-width: 220px;
}

.lead-pool-table details {
    margin-top: 8px;
}

.lead-pool-badge {
    display: inline-flex;
    margin-top: 7px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.lead-pool-badge-eligible {
    background: #e6f6ed;
    color: #17633a;
}

.lead-pool-badge-consent_required,
.lead-pool-badge-policy_review {
    background: #fff4df;
    color: #7a4a00;
}

.lead-pool-badge-suppressed {
    background: #f5e8e8;
    color: #8b2525;
}

.lead-pool-reason {
    margin-top: 6px;
    color: var(--warning);
    font-size: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.wide {
    grid-column: 1 / -1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-label input {
    width: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.validation-send-form {
    padding-bottom: 76px;
}

.validation-send-action-bar {
    position: fixed;
    z-index: 20;
    right: 50%;
    bottom: 12px;
    display: flex;
    width: min(1144px, calc(100% - 32px));
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 10px 30px rgba(21, 32, 51, 0.18);
    transform: translateX(50%);
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.validation-send-selected-count {
    color: var(--ink);
    font-size: 14px;
    white-space: nowrap;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.lead-table {
    min-width: 1300px;
}

.autosend-table {
    min-width: 1220px;
}

.pitch-cell {
    min-width: 360px;
}

.pitch-cell pre {
    margin: 0;
    white-space: pre-wrap;
    font: inherit;
}

.narrow-page {
    width: min(680px, calc(100% - 32px));
}

.table th,
.table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.inline-import {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.inline-import button {
    width: 100%;
}

.discovery-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.discovery-counts span {
    padding: 7px 10px;
    border-radius: 8px;
    background: #eef1f6;
    color: var(--ink);
    font-size: 13px;
}

.discovery-group-row th {
    background: #f7f9fc;
    color: var(--ink);
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
}

.discovery-secondary-row {
    display: none;
}

.discovery-secondary-visible .discovery-secondary-row {
    display: table-row;
}

.discovery-secondary-toggle {
    margin: 12px 0 0;
}

.reason-cell {
    min-width: 280px;
    max-width: 420px;
    line-height: 1.45;
}

.evidence-list {
    margin: 10px 0 0;
    padding-left: 20px;
    line-height: 1.5;
}

.recommendation {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.recommendation-contact-now {
    background: #e6f6ed;
    color: #17633a;
}

.recommendation-review-manually {
    background: #fff4df;
    color: #7a4a00;
}

.recommendation-do-not-contact {
    background: #f5e8e8;
    color: #8b2525;
}

.history-label {
    display: inline-flex;
    margin-top: 6px;
    padding: 3px 7px;
    border-radius: 6px;
    background: #eef1f6;
    color: #465365;
    font-size: 11px;
    font-weight: 800;
}

.card {
    display: grid;
    gap: 12px;
}

.reply {
    color: var(--ink);
}

textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px;
    color: var(--ink);
    background: #fbfcff;
    resize: vertical;
}

.link {
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
}

code {
    background: #eef1f6;
    border-radius: 6px;
    padding: 2px 5px;
}

.transcript {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 14px;
    border-radius: 8px;
    background: #f7f9fc;
    color: var(--ink);
    line-height: 1.55;
}

.emily-header {
    align-items: stretch;
}

.emily-profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.emily-profile-card > div {
    min-width: 0;
}

.emily-profile-avatar {
    flex: 0 0 auto;
    width: 132px;
    height: 132px;
    border: 1px solid #cdd7e7;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 14px 30px rgba(19, 39, 74, 0.18);
}

.emily-empty-state {
    display: flex;
    align-items: center;
    gap: 20px;
}

.emily-empty-state h2 {
    margin-top: 0;
}

.emily-empty-avatar {
    flex: 0 0 auto;
    width: 112px;
    height: 140px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(19, 39, 74, 0.14);
}

.browser-test-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.browser-test-status-grid p {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 14px;
    border-radius: 8px;
    background: #f7f9fc;
}

.browser-test-status-grid span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.browser-test-actions {
    display: flex;
    gap: 10px;
}

.browser-test-error {
    color: var(--danger);
    font-weight: 800;
}

.browser-test-transcript {
    min-height: 180px;
    max-height: 380px;
    overflow-y: auto;
}

.browser-test-transcript p {
    margin: 0 0 8px;
}

.browser-test-transcript .transcript-partial {
    color: var(--muted);
}

@media (max-width: 760px) {
    .header,
    .product-panel {
        display: grid;
    }

    .toolbar,
    .toolbar label,
    .toolbar select,
    .toolbar button,
    .form-grid {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .emily-profile-card,
    .emily-empty-state {
        align-items: flex-start;
    }

    .emily-profile-card {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .emily-header .header-links {
        flex-wrap: wrap;
    }

    .emily-profile-avatar {
        width: 88px;
        height: 88px;
        border-radius: 16px;
    }

    .emily-empty-avatar {
        width: 80px;
        height: 100px;
    }

    .browser-test-status-grid {
        grid-template-columns: 1fr;
    }

    .lead-pool-heading {
        display: grid;
    }

    .lead-pool-filters {
        grid-template-columns: 1fr;
    }

    .validation-send-form {
        padding-bottom: 70px;
    }

    .validation-send-action-bar {
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        padding: 8px;
        transform: none;
        gap: 8px;
    }

    .validation-send-action-bar button {
        min-width: 0;
        padding: 0 10px;
        flex: 1 1 auto;
    }

    .validation-send-selected-count {
        flex: 0 0 auto;
        font-size: 12px;
    }
}
