:root {
  --ground: #f6f7fb;
  --paper: #ffffff;
  --ink: #182230;
  --muted: #667085;
  --subtle: #8b95a5;
  --line: #e4e8ef;
  --line-strong: #d4dae4;
  --fill: #f0f3f7;
  --accent: #176f7d;
  --accent-dark: #105864;
  --accent-soft: #e9f4f5;
  --bar: #21879a;
  --ok: #26734d;
  --ok-bg: #e9f6ef;
  --warn: #9a6200;
  --warn-bg: #fff5df;
  --danger: #b13c3c;
  --danger-bg: #fcecec;
  --shadow-sm: 0 1px 2px rgba(20, 33, 51, .04);
  --shadow-card: 0 8px 24px rgba(20, 33, 51, .06);
  --shadow-float: 0 18px 48px rgba(20, 33, 51, .16);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --font: "Segoe UI Variable", Aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { max-width: 1240px; margin: 0 auto; padding: 38px 28px 88px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible { outline: 3px solid rgba(23, 111, 125, .2); outline-offset: 2px; }

/* App header */
header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(212, 218, 228, .8);
  backdrop-filter: blur(14px);
}
.header-inner { max-width: 1360px; margin: 0 auto; display: flex; align-items: center; gap: 24px; min-height: 66px; padding: 10px 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, #23899a, #155d6b);
  color: #fff;
  font-size: 17px;
  font-weight: 750;
  box-shadow: 0 5px 12px rgba(23, 111, 125, .22);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { font-size: 14px; letter-spacing: -.01em; }
.brand-copy small { margin-top: 3px; color: var(--subtle); font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.crumbs { color: var(--subtle); font-size: 12.5px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.global-upload { white-space: nowrap; }
.upload-icon { font-size: 17px; line-height: 1; margin-right: 2px; }
.account-menu { position: relative; }
.account-menu > summary { list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 9px 4px 5px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
}
.account-trigger:hover { background: var(--fill); border-color: var(--line); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #e9edf3; color: #344054; font-weight: 750; }
.account-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  width: 230px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-float);
}
.account-identity { display: flex; flex-direction: column; padding: 8px 10px 10px; }
.account-identity span, .menu-label { color: var(--muted); font-size: 11px; }
.menu-label { padding: 6px 10px 3px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.language-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px 8px 9px; }
.language-switch button { padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); font: 650 12px var(--font); cursor: pointer; }
.language-switch button.active { border-color: #aad1d6; background: var(--accent-soft); color: var(--accent-dark); }
.menu-divider { height: 1px; margin: 2px 0 5px; background: var(--line); }
.account-panel > a, .menu-button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--ink); text-align: left; font: 13px var(--font); cursor: pointer; }
.account-panel > a:hover, .menu-button:hover { background: var(--fill); color: var(--ink); }
.account-panel form { margin: 0; }

/* Page hierarchy */
.flashes { max-width: 1184px; margin: 16px auto 0; padding: 0 28px; }
.flash { margin-bottom: 8px; padding: 12px 15px; border: 1px solid #c5e1e4; border-radius: 10px; background: var(--accent-soft); color: #184f57; font-size: 14px; box-shadow: var(--shadow-sm); }
h1, h2, h3 { color: var(--ink); }
h1 { margin: 0; font-size: clamp(28px, 3vw, 36px); line-height: 1.15; font-weight: 720; letter-spacing: -.035em; text-wrap: balance; }
h2 { margin: 28px 0 12px; font-size: 19px; line-height: 1.3; font-weight: 700; letter-spacing: -.015em; }
.page-heading { display: flex; flex-direction: column; gap: 3px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.sub { max-width: 68ch; margin: 8px 0 22px; color: var(--muted); font-size: 15px; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 26px; }
.topbar .campaign-heading { margin-right: 4px; }
.spacer { flex: 1; }
.freshness-group { display: flex; flex-wrap: wrap; gap: 6px; }
.campaign-topbar .freshness-group { order: 3; width: 100%; margin-top: -3px; }
.campaign-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Buttons and statuses */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
  color: #344054;
  font: 650 13.5px var(--font);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); border-color: #bfc7d3; color: var(--ink); box-shadow: 0 4px 10px rgba(20, 33, 51, .07); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 5px 13px rgba(23, 111, 125, .18); }
.btn.primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); color: #fff; }
.btn.quiet { border-color: var(--line); color: #475467; box-shadow: none; }
.btn-large { min-height: 46px; padding: 10px 21px; font-size: 14.5px; }
.btn-block { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; line-height: 1.2; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.mute { background: var(--fill); color: var(--muted); }
.chip.neutral { background: #eef1f5; color: #445166; }
.status-dot-inline { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.status-dot-inline.ok { background: #39a56e; box-shadow: 0 0 0 3px #e1f3e9; }
.status-dot-inline.warn { background: #d79a2b; box-shadow: 0 0 0 3px #fff1d3; }
.status-dot-inline.mute { background: #aeb7c5; box-shadow: 0 0 0 3px #edf0f4; }

/* Cards and grids */
.grid { display: grid; gap: 16px; }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.two-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 15px; color: #667085; font-size: 12px; font-weight: 720; letter-spacing: .025em; text-transform: none; }
.kpis .card { position: relative; min-height: 118px; overflow: hidden; }
.kpis .card::after { content: ""; position: absolute; right: -24px; bottom: -35px; width: 90px; height: 90px; border-radius: 50%; background: var(--accent-soft); opacity: .65; }
.kpi { position: relative; z-index: 1; color: #172b3a; font-size: 30px; font-weight: 720; line-height: 1.12; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.hub-card { display: flex; min-height: 184px; flex-direction: column; padding: 22px; color: inherit; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.hub-card:hover { transform: translateY(-3px); border-color: #cbd3df; color: inherit; box-shadow: var(--shadow-card); }
.hub-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hub-card h3 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card-arrow { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: var(--fill); color: var(--accent); font-size: 16px; transition: transform .15s ease, background .15s ease; }
.hub-card:hover .card-arrow { transform: translateX(2px); background: var(--accent-soft); }
.hub-card .kpi { margin-top: 24px; font-size: 34px; }
.hub-card .kpi small { display: inline; margin-left: 3px; font-size: 13px; }
.hub-card-status { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 18px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.data-table-card { padding: 8px 18px; }
.row-link { font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { padding: 13px 12px 10px 0; border-bottom: 1px solid var(--line-strong); color: #768195; text-align: left; font-size: 10.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 12px 12px 0; border-bottom: 1px solid #edf0f4; color: #344054; }
tbody tr { transition: background .1s ease; }
tbody tr:hover { background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.tablewrap { overflow-x: auto; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }

/* Charts */
.hbar { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 12.5px; }
.hbar .t { width: 190px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .b { height: 9px; min-width: 2px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #35a1b2); }
.hbar .v { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
svg rect.mk { transition: opacity .12s ease; }
svg rect.mk:hover { opacity: .78; }
.legend { display: flex; gap: 18px; margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.vbars-cap { margin-top: 6px; color: var(--muted); font-size: 11px; }

/* Forms */
form.stack { display: grid; gap: 16px; max-width: 460px; }
label { display: inline-block; margin-bottom: 6px; color: #344054; font-size: 13px; font-weight: 650; }
input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: 14px var(--font);
  transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { min-height: 80px; resize: vertical; }
input[type="text"]:focus, input[type="password"]:focus, select:focus, textarea:focus { border-color: #79afb7; box-shadow: 0 0 0 3px rgba(23, 111, 125, .1); outline: 0; }
.form-card { margin-top: 22px; padding: 24px; }
.auth-shell { max-width: 390px; margin: 66px auto 0; }
.auth-heading { margin-bottom: 20px; text-align: center; }
.auth-heading .eyebrow { display: block; margin-bottom: 6px; }
.auth-heading h1 { font-size: 32px; }
.auth-card { max-width: none !important; padding: 25px; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.dropzone { padding: 36px 22px; border: 1.5px dashed #aeb7c5; border-radius: var(--radius); background: var(--paper); color: var(--muted); text-align: center; }
.dropzone input { margin-top: 12px; }

/* Notices and dashboard controls */
.callout { max-width: 82ch; margin: 16px 0; padding: 13px 16px; border: 1px solid #c5e1e4; border-radius: 10px; background: var(--accent-soft); color: #28565d; font-size: 13.5px; }
.receipt-line { display: flex; align-items: baseline; gap: 8px; margin: 6px 0; font-size: 13.5px; flex-wrap: wrap; }
details summary { color: var(--accent); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.source-filter-bar { display: flex; align-items: center; gap: 14px; margin: -6px 0 18px; padding: 12px 14px; border: 1px solid #d5e9eb; border-radius: 11px; background: var(--accent-soft); }
.source-filter-bar form { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.source-filter-bar label { margin: 0; white-space: nowrap; }
.source-filter-bar select { width: auto; min-width: 260px; max-width: 480px; background: #fff; }
.source-filter-bar a { font-size: 12.5px; font-weight: 700; }
.filter-scope { margin-left: auto; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .72); color: #57717a; font-size: 11px; font-weight: 650; white-space: nowrap; }
.scope-tag { display: block; margin-top: 4px; color: var(--accent); font-size: 9.5px; font-weight: 700; letter-spacing: .02em; }
.source-performance tr.source-selected td { background: var(--accent-soft); }
.source-name { font-weight: 700; white-space: nowrap; }
.source-status-detail { margin-top: 4px; }
.source-status-detail summary { color: var(--muted); font-size: 11px; font-weight: 600; }
.source-status-detail > div { display: flex; min-width: 260px; max-width: 520px; padding: 7px 0 3px; flex-wrap: wrap; gap: 5px; }
.source-status-detail span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: var(--fill); color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.source-status-detail b { color: var(--ink); }

/* Guided uploader */
.wizard-steps { display: flex; max-width: 760px; margin: 0 0 28px; color: var(--muted); font-size: 12px; font-weight: 650; }
.wizard-steps span { position: relative; display: flex; flex: 1; align-items: center; gap: 8px; }
.wizard-steps span:not(:last-child)::after { content: ""; height: 1px; margin: 0 12px; background: var(--line-strong); flex: 1; }
.wizard-steps b { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--paper); font-size: 11px; flex: none; }
.wizard-steps .active { color: var(--ink); }
.wizard-steps .active b { border-color: var(--accent); background: var(--accent); color: #fff; }
.wizard-steps .done { color: var(--ok); }
.wizard-steps .done b { border-color: #9dceb1; background: var(--ok-bg); }
.guided-dropzone { display: flex; max-width: 760px; min-height: 270px; padding: 38px; border: 1.5px dashed #aab4c2; border-radius: var(--radius-lg); background: var(--paper); flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.guided-dropzone:hover, .guided-dropzone.dragging { transform: translateY(-2px); border-color: var(--accent); background: #fbfefe; box-shadow: var(--shadow-card); }
.guided-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.guided-dropzone .drop-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 14px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); font-size: 27px; }
.guided-dropzone strong { color: var(--ink); font-size: 20px; letter-spacing: -.015em; }
.guided-dropzone > span:not(.drop-icon) { margin-top: 3px; color: var(--muted); font-size: 14px; }
.guided-dropzone small { margin-top: 14px; color: var(--subtle); font-size: 12px; font-weight: 500; }
.chosen-files { display: grid; max-width: 760px; margin-top: 10px; gap: 7px; }
.chosen-file { padding: 9px 12px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); font-size: 13px; }
.wizard-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 0; z-index: 2; padding: 14px 0; border-top: 1px solid var(--line); background: rgba(246, 247, 251, .94); backdrop-filter: blur(8px); }

/* Upload review cards */
.report-card { max-width: 920px; margin: 0 0 16px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
.report-card.report-error { border-color: #e5c987; border-left: 4px solid #d49018; background: #fffdfa; }
.report-heading { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; }
.report-heading > div { display: flex; min-width: 0; gap: 12px; align-items: flex-start; }
.report-heading h2 { margin: 0 0 3px; overflow-wrap: anywhere; font-size: 17px; }
.report-heading p { margin: 0; color: var(--muted); font-size: 12.5px; }
.status-dot { display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; font-weight: 750; flex: none; }
.status-dot.good { background: var(--ok-bg); color: var(--ok); }
.status-dot.ready { background: var(--accent-soft); color: var(--accent); }
.status-dot.bad { background: var(--warn-bg); color: var(--warn); }
.plain-error, .plain-warning, .safety-check { display: flex; margin-top: 14px; padding: 11px 13px; border-radius: 9px; flex-direction: column; font-size: 13px; }
.plain-error { position: relative; padding: 13px 14px 13px 46px; border: 1px solid #ead19a; background: var(--warn-bg); color: #704c08; }
.plain-error::before { content: "!"; position: absolute; top: 13px; left: 14px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #d18a19; color: #fff; font-weight: 750; }
.plain-warning, .safety-check.warning { background: var(--warn-bg); color: #704d00; }
.plain-error span, .plain-warning span, .safety-check span { margin-top: 2px; }
.answer-block { max-width: 700px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.answer-block > label, .answer-block > strong { display: block; font-size: 14px; }
.answer-block > p { margin: 2px 0 9px; color: var(--muted); font-size: 12.5px; }
.answer-block select, .answer-block input[type="text"] { max-width: 560px; }
.answer-block.answered { padding: 11px 13px; border: 0; border-radius: 9px; background: var(--ok-bg); color: #245f3f; }
.route-list { display: flex; margin-top: 7px; gap: 7px; flex-wrap: wrap; }
.route-list span { padding: 5px 8px; border-radius: 7px; background: #fff; font-size: 12px; }
.route-list small { margin-left: 4px; color: var(--muted); }
.new-campaign-fields { margin-top: 11px; padding: 13px; border-radius: 9px; background: var(--fill); }
.field-grid { display: grid; margin-top: 8px; grid-template-columns: 1fr 1fr; gap: 13px; }
.field-grid label { display: block; }
.review-summary { display: flex; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); gap: 30px; flex-wrap: wrap; }
.review-summary div { display: flex; flex-direction: column; }
.review-summary strong { font-size: 18px; }
.review-summary span { color: var(--muted); font-size: 11.5px; }
.review-summary .warn-stat strong { color: var(--warn); }
.safety-check.danger { border-left: 4px solid var(--danger); background: var(--danger-bg); color: #7d2929; }
.review-card details { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.preview-details summary { font-weight: 650; }
.preview-details .tablewrap { margin-top: 10px; }
.danger-confirm { display: flex; max-width: 920px; padding: 14px; border: 1px solid #dda8a8; border-radius: 10px; background: var(--danger-bg); color: #702525; gap: 11px; align-items: flex-start; }
.danger-confirm input { margin-top: 4px; transform: scale(1.15); }
.danger-confirm span { display: flex; font-weight: 450; flex-direction: column; }
.completion-banner { display: flex; max-width: 920px; margin-bottom: 18px; padding: 20px 22px; border: 1px solid #b4d9c3; border-radius: var(--radius); background: var(--ok-bg); gap: 14px; align-items: flex-start; }
.completion-banner > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--ok); color: #fff; font-size: 20px; font-weight: 750; }
.completion-banner h1 { margin: 0; font-size: 22px; }
.completion-banner p { margin: 4px 0 0; color: #355e45; font-size: 13px; }
.completed-actions { display: flex; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); gap: 8px; align-items: center; flex-wrap: wrap; }
.completed-actions form { margin: 0; }
.sheet-role-grid { display: grid; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); grid-template-columns: repeat(3, 1fr); gap: 13px; }
.sheet-role { padding: 13px; border-radius: 9px; background: var(--fill); }
.sheet-role label { display: block; min-height: 40px; line-height: 1.35; }
.sheet-role select { width: 100%; }
.mapper-suggestion { display: block; margin-top: 7px; color: var(--ok); font-size: 11.5px; }
.sheet-inventory { margin-top: 15px; }
.sheet-list { display: grid; margin-top: 10px; gap: 7px; }
.sheet-list > div { display: flex; padding: 9px 11px; border-radius: 8px; background: var(--fill); flex-direction: column; }
.sheet-list strong { font-size: 13px; }
.sheet-list span { color: var(--muted); font-size: 11.5px; }
.sheet-list small { margin-top: 3px; overflow: hidden; color: var(--muted); font: 11px var(--mono); text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .two, .two-even { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar .freshness-group { order: 3; width: 100%; }
}

@media (max-width: 760px) {
  main { padding: 26px 16px 70px; }
  .header-inner { min-height: 60px; padding: 9px 14px; gap: 10px; flex-wrap: wrap; }
  .crumbs { order: 3; width: 100%; padding-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-copy small, .account-name { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .global-upload { min-height: 36px; padding: 6px 10px; font-size: 12.5px; }
  .upload-icon { display: none; }
  h1 { font-size: 29px; }
  .topbar { align-items: flex-end; margin-bottom: 22px; }
  .campaign-actions { width: 100%; justify-content: flex-start; order: 2; }
  .campaign-topbar .spacer { display: none; }
  .cards-4 { grid-template-columns: 1fr; }
  .hub-card { min-height: 158px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .card { min-height: 108px; padding: 17px; }
  .kpi { font-size: 27px; }
  .source-filter-bar { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .source-filter-bar form { align-items: stretch; }
  .source-filter-bar label { width: 100%; }
  .source-filter-bar select { width: 100%; min-width: 0; }
  .filter-scope { margin-left: 0; justify-self: start; }
  .wizard-steps { font-size: 0; }
  .wizard-steps span { gap: 4px; }
  .wizard-steps span:not(:last-child)::after { margin: 0 6px; }
  .guided-dropzone { min-height: 225px; padding: 26px 16px; }
  .report-card { padding: 17px; }
  .field-grid, .sheet-role-grid { grid-template-columns: 1fr; }
  .sheet-role label { min-height: 0; }
  .review-summary { gap: 17px; }
  .source-status-detail > div { min-width: 220px; }
  input[type="text"], input[type="password"], select, textarea { font-size: 16px; }
}

@media (max-width: 440px) {
  .header-actions { gap: 4px; }
  .brand-copy { display: none; }
  .kpis { grid-template-columns: 1fr; }
  .account-trigger { padding-right: 5px; }
  .topbar > .btn { min-height: 36px; padding: 6px 10px; }
  .auth-shell { margin-top: 32px; }
}

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