:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172035;
  background: #f3f6f8;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% 0, #dff4ec 0, transparent 30rem), #f3f6f8; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1rem 4vw; background: rgba(255,255,255,.92); border-bottom: 1px solid #dfe7e6; }
.brand { display: flex; gap: .7rem; align-items: center; color: inherit; text-decoration: none; }
.brand small { display: block; color: #68758a; font-size: .72rem; }
.brand-mark { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: .75rem; background: #087f66; color: white; font-weight: 800; }
nav { display: flex; flex-wrap: wrap; gap: .4rem; }
nav a { color: #48566c; text-decoration: none; padding: .65rem .8rem; border-radius: .6rem; font-size: .92rem; }
nav a:hover { background: #e7f3ef; color: #075e4d; }
main { padding: 8vh 5vw; }
.hero { max-width: 52rem; padding: clamp(2rem, 5vw, 4.5rem); border: 1px solid #dfe7e6; border-radius: 1.5rem; background: rgba(255,255,255,.9); box-shadow: 0 1.5rem 4rem rgba(29, 54, 68, .08); }
.eyebrow { margin: 0 0 .7rem; color: #087f66; font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.3rem, 6vw, 4.8rem); line-height: 1; letter-spacing: -.055em; }
.hero > p:not(.eyebrow) { max-width: 43rem; color: #617086; font-size: 1.08rem; line-height: 1.7; }
.milestone-chip { display: inline-flex; margin-top: 1.4rem; padding: .6rem .85rem; border-radius: 999px; background: #e5f5ef; color: #075e4d; font-weight: 700; font-size: .82rem; }
@media (max-width: 850px) { .site-header { align-items: flex-start; flex-direction: column; } main { padding-top: 3rem; } }
.hidden { display: none !important; }
.page-shell { max-width: 1100px; margin: auto; }
.system-banner { margin-bottom: 1rem; padding: 1rem 1.2rem; border: 1px solid #e3a5a5; border-radius: .8rem; background: #fff0f0; color: #8e2020; font-weight: 700; }
.page-heading { margin-bottom: 2rem; }
.page-heading h1 { font-size: clamp(2.4rem, 5vw, 4.3rem); }
.page-heading > p:last-child, .muted { color: #68758a; }
.wizard-step, .wizard-panel, .live-panel { display: flex; gap: 1.2rem; margin: 1rem 0; padding: 1.35rem; border: 1px solid #dbe5e3; border-radius: 1rem; background: rgba(255,255,255,.94); }
.step-number, .wizard-panel summary b { display: inline-grid; place-items: center; flex: 0 0 2.2rem; width: 2.2rem; height: 2.2rem; border-radius: .7rem; background: #087f66; color: white; }
.step-body { flex: 1; min-width: 0; }
.step-body h2 { margin: 0; }
.drop-zone { display: grid; gap: .25rem; margin: 1rem 0; padding: 1.5rem; border: 1px dashed #7ba99e; border-radius: .8rem; background: #f5fbf9; cursor: pointer; }
.drop-zone input { margin-top: .65rem; }
.button { border: 1px solid #b7c5c2; border-radius: .65rem; padding: .7rem 1rem; background: white; color: #263548; font-weight: 750; cursor: pointer; }
.button.primary { border-color: #087f66; background: #087f66; color: white; }
.button.danger { border-color: #b93838; color: #a22c2c; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.progress-track { height: .55rem; overflow: hidden; border-radius: 999px; background: #dfe8e6; }
.progress-track > div { width: 0; height: 100%; background: #13a37f; transition: width .2s; }
.wizard-panel { display: block; padding: 0; }
.wizard-panel summary { padding: 1.15rem 1.35rem; cursor: pointer; font-size: 1.05rem; }
.wizard-panel summary span { display: flex; align-items: center; gap: .75rem; }
.wizard-panel summary small { color: #718096; }
.table-scroll { max-height: 32rem; overflow: auto; border-top: 1px solid #e2e9e7; }
table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: .82rem; }
th, td { max-width: 24rem; padding: .7rem; border: 1px solid #e3e9e8; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th { position: sticky; top: 0; background: #eef6f3; z-index: 1; }
.mapping-grid { padding: 1rem 1.35rem; }
.mapping-row { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(13rem, 1.4fr) minmax(10rem, .75fr) 5rem; align-items: center; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid #edf1f0; }
select, input { max-width: 100%; border: 1px solid #b9c7c4; border-radius: .55rem; padding: .65rem; background: white; }
.mode-pill { color: #087f66; font-size: .7rem; font-weight: 800; letter-spacing: .06em; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.form-grid label { display: grid; gap: .35rem; color: #536074; font-size: .82rem; font-weight: 700; }
.check-line { display: inline-flex; align-items: center; gap: .5rem; margin-right: .7rem; }
.button-row { display: flex; gap: .75rem; margin-top: 1.2rem; }
.status-line { min-height: 1.25rem; color: #087f66; }
.status-line.error { color: #b22f2f; }
.live-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); align-items: end; }
.live-panel > div:not(.progress-track) { display: grid; gap: .25rem; }
.live-panel span { color: #718096; font-size: .75rem; text-transform: uppercase; }
.live-panel strong { font-size: 1.5rem; }
.live-panel .wide { grid-column: 1 / -2; }
.live-panel .process-status { grid-column: 1 / -1; margin: 0; }
@media (max-width: 750px) { .form-grid, .live-panel { grid-template-columns: 1fr 1fr; } .mapping-row { grid-template-columns: 1fr; } }
.data-card { margin: 1rem 0; overflow: hidden; border: 1px solid #dbe5e3; border-radius: 1rem; background: rgba(255,255,255,.96); box-shadow: 0 .8rem 2rem rgba(29,54,68,.05); }
.data-card .table-scroll { border-top: 0; }
.empty-state { padding: 3rem; color: #68758a; text-align: center; }
.actions { display: flex; gap: .45rem; }
.actions .button { padding: .45rem .65rem; font-size: .75rem; }
.status-badge { display: inline-flex; padding: .3rem .55rem; border-radius: 999px; background: #edf1f2; font-size: .7rem; font-weight: 850; }
.status-badge.completed { background: #dcf5ea; color: #08654f; }
.status-badge.failed { background: #fde5e5; color: #a32929; }
.status-badge.running, .status-badge.queued { background: #fff1c9; color: #785500; }
.status-badge.stopped { background: #edf1f2; color: #48566c; }
.error-note { display: block; max-width: 18rem; margin-top: .35rem; color: #a32929; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dialog { width: min(94vw, 1100px); max-height: 86vh; padding: 0; border: 1px solid #cddbd8; border-radius: 1rem; box-shadow: 0 2rem 5rem #17203540; }
dialog::backdrop { background: #17203588; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid #e3e9e8; }
.dialog-head h2 { margin: 0; }
dialog > .muted { padding: 0 1.25rem; }
.filter-builder { padding: 1.2rem; }
.toolbar, .pager { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; }
.filter-rule { display: grid; grid-template-columns: minmax(10rem,1fr) minmax(10rem,1fr) minmax(12rem,2fr) auto; gap: .7rem; margin-top: .8rem; }
.result-summary { margin: 1.5rem 0 .6rem; }
.result-summary strong { color: #087f66; font-size: 2rem; }
.pager { justify-content: flex-end; padding: 1rem; border-top: 1px solid #e3e9e8; }
@media (max-width: 750px) { .filter-rule { grid-template-columns: 1fr; } .actions { flex-direction: column; } }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.5rem; border: 1px solid #e6a2a2; border-radius: 1rem; background: #fffafa; }
.danger-zone h2 { margin: 0 0 .5rem; }
.danger-zone p { max-width: 48rem; }
.danger-text { color: #a22c2c; }
.button.danger.solid { border-color: #a92e2e; background: #a92e2e; color: white; }
.dialog-body { display: grid; gap: 1rem; padding: 1.25rem; }
.dialog-body label { display: grid; gap: .4rem; }
.warning-box { padding: 1rem; border: 1px solid #e6a2a2; border-radius: .7rem; background: #fff0f0; color: #8e2020; }
@media (max-width: 750px) { .danger-zone { align-items: stretch; flex-direction: column; } }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.settings-card { padding: 1.25rem; }
.settings-card h2 { margin: 0 0 .45rem; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tag-create-row { display: flex; gap: .7rem; margin: 1rem 0; }
.tag-create-row input { flex: 1; }
.tag-list { display: flex; flex-wrap: wrap; gap: .55rem; }
.tag-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .65rem; border-radius: 999px; background: #e8f6f1; color: #075e4d; font-weight: 750; }
.tag-pill button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; }
@media (max-width: 850px) { .settings-grid, .form-grid.two { grid-template-columns: 1fr; } .tag-create-row { flex-direction: column; } }
.heading-with-stat { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.total-data-stat { display: grid; flex: 0 0 auto; min-width: 10rem; padding: 1rem 1.25rem; border: 1px solid #b9ddd3; border-radius: 1rem; background: #eefaf6; text-align: right; }
.total-data-stat span, .total-data-stat small { color: #68758a; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.total-data-stat strong { color: #087f66; font-size: 2rem; line-height: 1.1; }
@media (max-width: 650px) { .heading-with-stat { align-items: stretch; flex-direction: column; } .total-data-stat { text-align: left; } }
.dashboard-page .page-heading { align-items: center; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.metric-card { padding: 1.2rem; border: 1px solid #dbe5e3; border-radius: 1rem; background: rgba(255,255,255,.96); box-shadow: 0 .8rem 2rem rgba(29,54,68,.05); }
.metric-card h2 { margin: 0 0 1rem; font-size: 1rem; color: #253349; }
.total-metric { display: grid; gap: .35rem; margin-bottom: 1rem; }
.total-metric span { color: #68758a; font-size: .8rem; font-weight: 800; text-transform: uppercase; }
.total-metric strong { color: #087f66; font-size: clamp(2.3rem, 7vw, 4.5rem); line-height: 1; }
.metric-list { display: grid; gap: .55rem; }
.metric-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .85rem; border-radius: .75rem; background: #f3f8f7; }
.metric-row span { overflow: hidden; color: #44536a; text-overflow: ellipsis; white-space: nowrap; }
.metric-row strong { color: #172035; }
@media (max-width: 850px) { .dashboard-grid { grid-template-columns: 1fr; } }
.verification-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .7rem; }
.verification-page .metric-row strong { max-width: 24rem; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
