:root {
    color-scheme: light;
    --ink: #162235;
    --muted: #5e6878;
    --line: #d7dde6;
    --soft: #f3f6f9;
    --brand: #276b72;
    --brand-dark: #17484e;
    --warning: #fff5d9;
    --warning-line: #d8aa32;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #eef2f5; line-height: 1.5; }
a { color: var(--brand-dark); }
code { padding: .12rem .3rem; border-radius: .25rem; background: #e9edf2; }
.shell { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.shell.narrow { width: min(900px, calc(100% - 2rem)); }
.masthead { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.masthead h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.035em; }
.eyebrow { margin: 0 0 .35rem; color: var(--brand); font-weight: 800; font-size: .78rem; letter-spacing: .14em; }
.subtitle, .muted { color: var(--muted); }
.subtitle { margin: .25rem 0 0; font-size: 1.05rem; }
.panel { border: 1px solid var(--line); border-radius: .8rem; background: white; padding: 1.5rem; box-shadow: 0 10px 30px rgba(25, 43, 57, .06); }
.panel h2 { margin-top: 0; }
.panel.soft { background: var(--soft); box-shadow: none; }
.panel.warning { background: var(--warning); border-color: var(--warning-line); }
.login-grid, .two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.hero { display: flex; justify-content: space-between; gap: 2rem; align-items: flex-start; margin-bottom: 1.25rem; }
.status-pill { border-radius: 999px; background: #d9f2e4; color: #12522c; padding: .45rem .8rem; font-weight: 800; }
.stacked-form { display: grid; gap: 1rem; }
.stacked-form label { display: grid; gap: .35rem; font-weight: 700; }
.stacked-form small { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid #aeb8c6; border-radius: .4rem; padding: .72rem .8rem; color: var(--ink); background: white; font: inherit; }
input:focus, select:focus { outline: 3px solid rgba(39,107,114,.22); border-color: var(--brand); }
.button { display: inline-block; border: 1px solid var(--brand-dark); border-radius: .4rem; background: var(--brand-dark); color: white; padding: .65rem .9rem; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.button.secondary { background: white; color: var(--brand-dark); }
.button.danger { border-color: #9b261f; background: #9b261f; }
.button.small { padding: .42rem .62rem; font-size: .88rem; }
.logout-form { display: flex; align-items: center; gap: .75rem; }
.form-error { border-left: 4px solid #b42318; background: #fff1f0; padding: .7rem .8rem; }
.health-list { margin: 0; }
.health-list div { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.health-list div:last-child { border-bottom: 0; }
.health-list dt { font-weight: 700; }
.health-list dd { margin: 0; color: var(--muted); text-align: right; }
.three-column { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.stacked-form.compact { gap: .7rem; }
.app-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin: -1rem 0 1.25rem; }
.app-nav a { padding: .5rem .75rem; border-radius: .35rem; color: var(--ink); text-decoration: none; font-weight: 700; }
.app-nav a:hover, .app-nav a[aria-current="page"] { background: white; box-shadow: inset 0 0 0 1px var(--line); }
.notice { margin: 0 0 1rem; border: 1px solid #8ac6a3; border-radius: .5rem; background: #e8f7ee; padding: .8rem 1rem; }
.notice.warning { border-color: var(--warning-line); background: var(--warning); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.status-pill.neutral, .mini-pill { background: #e7edf3; color: #344256; }
.mini-pill { display: inline-block; border-radius: 999px; padding: .2rem .48rem; font-size: .78rem; font-weight: 800; text-transform: capitalize; }
.status-pending_approval, .status-pending_email { background: #fff0c2; color: #654a00; }
.status-active { background: #d9f2e4; color: #12522c; }
.status-suspended, .status-rejected, .status-disabled { background: #f8dedd; color: #7b201a; }
.table-panel { margin-top: 1.25rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--soft); color: #344256; font-size: .86rem; }
.inline-action { display: grid; gap: .4rem; margin-bottom: .5rem; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; }
.stat { display: grid; gap: .2rem; text-decoration: none; color: var(--ink); }
.stat strong { font-size: 1.8rem; }
.search-row { display: flex; align-items: end; gap: .65rem; margin: .75rem 0; }
.search-row .grow { flex: 1; }
.record-list { display: grid; margin-top: .75rem; }
.record-list > a, .record-list > div { display: grid; gap: .15rem; padding: .75rem .25rem; border-bottom: 1px solid var(--line); text-decoration: none; }
.record-list span { color: var(--muted); font-size: .9rem; }
.record-list.compact { margin-bottom: 1rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.check { width: auto; margin-right: .35rem; }
.record-columns { align-items: start; }
.pipeline-board { display: grid; grid-template-columns: repeat(4,minmax(220px,1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.pipeline-column { min-width: 220px; border-radius: .6rem; background: var(--soft); padding: .8rem; }
.pipeline-column h3 { margin: 0 0 .7rem; font-size: .95rem; }
.pipeline-column h3 small { color: var(--muted); }
.pipeline-card { display: grid; gap: .3rem; margin-bottom: .6rem; border: 1px solid var(--line); border-radius: .45rem; background: white; padding: .7rem; color: var(--ink); text-decoration: none; }
.pipeline-card span { color: var(--muted); font-size: .82rem; }
.stage-dot { display: inline-block; width: .7rem; height: .7rem; margin-right: .45rem; border-radius: 50%; }
.timeline { display: grid; gap: 1rem; }
.timeline article { border-left: 3px solid var(--brand); padding: .2rem 0 .7rem 1rem; }
.timeline article h3 { margin: .2rem 0; }
.timeline article p { margin: .45rem 0; }
.mapping-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.status-valid, .status-imported, .status-updated, .status-replied, .status-sent { background: #d9f2e4; color: #12522c; }
.status-duplicate, .status-queued, .status-in_progress { background: #fff0c2; color: #654a00; }
.status-error, .status-bounced, .status-opted_out, .status-skipped { background: #f8dedd; color: #7b201a; }

@media (max-width: 720px) {
    .login-grid, .two-column, .three-column, .stat-grid, .field-grid, .mapping-grid { grid-template-columns: 1fr; }
    .search-row { align-items: stretch; flex-direction: column; }
    .pipeline-board { grid-template-columns: repeat(8,minmax(220px,1fr)); }
    .masthead, .hero { flex-direction: column; }
    .logout-form { width: 100%; justify-content: space-between; }
}

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