:root {
  --purple: #5f40b0;
  --purple-deep: #4e328f;
  --purple-soft: #eee9fa;
  --workspace: #f2f0f7;
  --surface: #fff;
  --surface-subtle: #f8f7fa;
  --ink: #261f31;
  --muted: #675f72;
  --divider: #ddd7e5;
  --success: #26714f;
  --success-soft: #e8f5ee;
  --warning: #8a4b09;
  --warning-soft: #fff4dc;
  --danger: #a72c35;
  --danger-soft: #fbecee;
  --upload: #19766f;
  --focus: #8466da;
  --header-height: 64px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--workspace);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; max-width: 100%; overflow-x: clip; background: var(--workspace); }

body {
  min-height: 100vh;
  max-width: 100%;
  margin: 0;
  overflow-x: clip;
  background: var(--workspace);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }
svg { display: block; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 55%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 9px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--purple-deep);
  font-weight: 700;
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-header {
  height: var(--header-height);
  background: var(--purple);
  color: #fff;
}

.header-inner {
  width: min(1440px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .12em;
}

.brand svg,
.account-menu svg,
.method-note svg,
.report-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgb(255 255 255 / .13);
  border-radius: 12px;
  background: rgb(53 29 111 / .16);
}

.primary-nav a {
  min-width: 116px;
  padding: 7px 18px;
  border-radius: 8px;
  color: rgb(255 255 255 / .77);
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  transition: color 150ms ease, background-color 150ms ease;
}

.primary-nav a:hover { color: #fff; background: rgb(255 255 255 / .08); }
.primary-nav a.active { color: var(--purple-deep); background: #fff; }

.account-menu { position: relative; justify-self: end; }
.account-menu summary {
  display: flex;
  align-items: center;
  gap: 9px;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-initial {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgb(255 255 255 / .32);
  border-radius: 50%;
  background: rgb(255 255 255 / .12);
}
.account-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 12px);
  right: 0;
  width: 230px;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 8px rgb(35 29 47 / .14);
}
.account-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 13px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
}
.account-label, .account-identity { margin: 0; }
.account-label { color: var(--muted); font-size: 12px; }
.account-identity { margin: 2px 0 12px; font-weight: 700; overflow-wrap: anywhere; }
.account-popover a,
.account-popover button {
  display: block;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid var(--divider);
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.app-main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 36px 32px 64px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--purple-deep);
  font-size: 13px;
  font-weight: 750;
}
h1, h2, h3, p { overflow-wrap: break-word; }
h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: -.025em;
}
h2, h3 { margin: 0; line-height: 1.35; }
h2 { font-size: 17px; letter-spacing: -.01em; }
h3 { font-size: 16px; }
.page-description { max-width: 670px; margin: 7px 0 0; color: var(--muted); }

.period-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.field-action { display: flex; gap: 8px; }
select,
.field input {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
input:hover, select:hover { border-color: #b8adc8; }
input:focus, select:focus { border-color: var(--purple); outline: 3px solid rgb(132 102 218 / .23); }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.button-primary { background: var(--purple); color: #fff; }
.button-primary:hover { background: var(--purple-deep); }
.button:disabled { cursor: wait; opacity: .72; }
.button-secondary { border-color: var(--divider); background: #fff; color: var(--ink); }
.button-secondary:hover, .button-quiet:hover { border-color: #b8adc8; color: var(--purple-deep); }
.button-quiet { min-height: 36px; padding: 7px 11px; border-color: var(--divider); background: transparent; color: var(--purple-deep); white-space: nowrap; }

.surface {
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--surface);
}
.surface-heading {
  min-height: 74px;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--divider);
}
.surface-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.legend { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot-download { color: var(--purple); }
.dot-upload { color: var(--upload); }
.line-key { width: 20px; height: 3px; border-radius: 2px; background: currentColor; }
.line-download { color: var(--purple); }
.line-upload { color: var(--upload); }

.table-scroll { overflow-x: auto; }
.usage-table { width: 100%; border-collapse: collapse; min-width: 1040px; }
.usage-table th, .usage-table td {
  padding: 16px 18px;
  border-bottom: 1px solid #ece8f0;
  text-align: left;
  vertical-align: middle;
}
.usage-table thead th {
  padding-top: 11px;
  padding-bottom: 11px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.usage-table tbody tr:last-child > * { border-bottom: 0; }
.usage-table tbody tr:hover { background: #fbfafd; }
.usage-table tbody th { font-size: 14px; }
.customer-link { color: var(--ink); text-decoration-color: transparent; text-underline-offset: 3px; }
.customer-link:hover { color: var(--purple-deep); text-decoration-color: currentColor; }
.row-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.metric-cell strong { display: block; color: var(--purple-deep); font-size: 16px; }
.metric-cell > span { color: var(--muted); font-size: 11px; }
.metric-cell.upload-value strong { color: var(--upload); }
.row-action { text-align: right !important; }
.row-actions { display: flex; justify-content: flex-end; gap: 7px; }
.muted { color: var(--muted); }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
}
.status-success { background: var(--success-soft); color: var(--success); }
.status-warning { background: var(--warning-soft); color: var(--warning); }
.status-danger { background: var(--danger-soft); color: var(--danger); }
.status-neutral { background: var(--purple-soft); color: var(--purple-deep); }

.empty-state { padding: 64px 24px; text-align: center; }
.empty-state p { margin: 6px auto 0; color: var(--muted); }
.method-note {
  max-width: 900px;
  margin: 16px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.method-note svg { flex: 0 0 auto; margin-top: 1px; color: var(--purple); }
.method-note p { margin: 0; }
.method-note strong { color: var(--ink); }

.breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--purple-deep); text-underline-offset: 3px; }
.detail-heading { align-items: center; }
.toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.compact-period-form { display: flex; }
.alert { margin: -8px 0 20px; padding: 12px 15px; border-radius: 8px; font-size: 13px; }
.alert-warning { background: var(--warning-soft); color: #693a08; }
.alert-neutral { background: var(--purple-soft); color: var(--purple-deep); }

.result-band {
  display: grid;
  grid-template-columns: minmax(230px, .75fr) 2fr;
  gap: 0;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: #fff;
}
.result-primary { padding: 22px 24px; background: var(--purple-soft); }
.result-primary .metric-label { display: block; color: var(--purple-deep); font-size: 12px; font-weight: 750; }
.result-primary strong { display: inline-block; margin-top: 5px; color: var(--purple-deep); font-size: 30px; letter-spacing: -.03em; }
.result-primary > span:last-child { display: block; color: var(--muted); font-size: 12px; }
.result-list { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.result-list > div { padding: 20px; border-left: 1px solid var(--divider); display: flex; flex-direction: column; justify-content: center; }
.result-list dt, .evidence-list dt { color: var(--muted); font-size: 12px; font-weight: 650; }
.result-list dd { margin: 5px 0 0; font-size: 16px; font-weight: 750; }

.chart-surface { margin-bottom: 20px; }
.chart-wrap { position: relative; min-height: 350px; padding: 18px 20px 12px; }
#traffic-chart { display: block; width: 100%; height: 320px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); }
.chart-empty[hidden] { display: none; }

.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }
.evidence-list { margin: 0; padding: 4px 20px 12px; }
.evidence-list > div { min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid #ece8f0; }
.evidence-list > div:last-child { border-bottom: 0; }
.evidence-list dd { margin: 0; text-align: right; font-size: 13px; font-weight: 700; }
.methodology { padding: 0 20px; }
.methodology summary { padding: 17px 0; cursor: pointer; font-weight: 700; }
.methodology > div { padding: 0 0 17px; color: var(--muted); font-size: 13px; }
.methodology p { max-width: 88ch; margin: 0 0 10px; }
.methodology code { color: var(--ink); overflow-wrap: anywhere; }

.report-list { padding: 0 20px; }
.report-row { min-height: 90px; display: grid; grid-template-columns: auto minmax(240px, 1fr) auto auto; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid #ece8f0; }
.report-row:last-child { border-bottom: 0; }
.report-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--purple-soft); color: var(--purple-deep); }
.report-name h2 { font-size: 15px; }
.report-name p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.report-actions { display: flex; gap: 8px; }

.messages { margin-bottom: 16px; }
.message { margin: 0; padding: 12px 15px; border-radius: 8px; background: var(--purple-soft); color: var(--purple-deep); }

/* Plan catalog and read-only reconciliation */
.source-strip {
  margin-bottom: 20px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--surface);
}
.source-strip h2 { margin-top: 2px; }
.source-strip p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.source-label { color: var(--purple-deep); font-size: 12px; font-weight: 750; }
.source-facts { margin: 0; display: flex; align-items: stretch; }
.source-facts > div { min-width: 140px; padding: 2px 18px; border-left: 1px solid var(--divider); }
.source-facts dt { color: var(--muted); font-size: 11px; font-weight: 650; }
.source-facts dd { margin: 5px 0 0; font-size: 13px; font-weight: 750; }

.plan-table { min-width: 0; table-layout: fixed; }
.plan-table th:nth-child(1) { width: 9%; }
.plan-table th:nth-child(2) { width: 9%; }
.plan-table th:nth-child(3),
.plan-table th:nth-child(4) { width: 14%; }
.plan-table th:nth-child(5) { width: 17%; }
.plan-table th:nth-child(6) { width: 26%; }
.plan-table th:nth-child(7) { width: 11%; }
.plan-table th, .plan-table td { padding-inline: 14px; overflow-wrap: anywhere; }
.direction-pair strong { display: block; color: var(--ink); font-size: 14px; }
.catalog-details { margin-top: 20px; overflow: hidden; }
.catalog-details > summary {
  min-height: 72px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  list-style-position: inside;
}
.catalog-details > summary span:first-child { display: inline-flex; flex-direction: column; }
.catalog-details > summary small { margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.catalog-details > summary span:last-child { color: var(--purple-deep); font-size: 12px; font-weight: 750; }
.catalog-details[open] > summary { border-bottom: 1px solid var(--divider); }
.catalog-table { width: 100%; min-width: 1100px; border-collapse: collapse; }
.catalog-table th, .catalog-table td { padding: 13px 16px; border-bottom: 1px solid #ece8f0; text-align: left; vertical-align: middle; }
.catalog-table thead th { background: var(--surface-subtle); color: var(--muted); font-size: 12px; white-space: nowrap; }
.catalog-table tbody th { font-size: 13px; }
.catalog-table tbody td { font-size: 12px; }
.catalog-table tbody tr:last-child > * { border-bottom: 0; }

.reconciliation-intro {
  margin-bottom: 20px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--surface);
}
.reconciliation-intro h2 { margin-top: 9px; }
.reconciliation-intro p { max-width: 72ch; margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.read-only-lock {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: var(--purple-deep) !important;
  font-weight: 700;
}
.read-only-lock svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.evidence-list dd small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.evidence-notes { margin: 0 20px 18px; padding: 13px 15px; border-radius: 8px; background: var(--warning-soft); color: #693a08; font-size: 12px; }
.evidence-notes ul { margin: 6px 0 0; padding-left: 18px; }
.evidence-notes li + li { margin-top: 4px; }
.compact-empty { padding-block: 42px; }
.target-surface { margin-bottom: 20px; }
.target-list { padding: 0 20px; }
.target-row { min-height: 108px; padding: 18px 0; display: grid; grid-template-columns: minmax(180px, .65fr) minmax(0, 2fr); align-items: center; gap: 24px; border-bottom: 1px solid #ece8f0; }
.target-row:last-child { border-bottom: 0; }
.target-row > div > strong { display: block; font-size: 15px; }
.target-row > div > span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.target-row dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.target-row dl > div { min-width: 0; }
.target-row dt { color: var(--muted); font-size: 11px; font-weight: 650; }
.target-row dd { margin: 5px 0 0; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.target-row dd small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }

/* Authentication */
.login-body { background: #fff; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.05fr) minmax(430px, .95fr); }
.login-brand {
  min-height: 100vh;
  padding: clamp(34px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--purple);
  color: #fff;
}
.login-wordmark { align-self: flex-start; }
.login-brand > div { max-width: 590px; }
.login-eyebrow { margin: 0 0 12px; color: rgb(255 255 255 / .72); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.login-brand h1 { max-width: 590px; color: #fff; font-size: clamp(34px, 5vw, 58px); line-height: 1.03; letter-spacing: -.035em; }
.login-brand > div > p:last-child { max-width: 590px; margin: 22px 0 0; color: rgb(255 255 255 / .82); font-size: 17px; }
.login-footnote { margin: 0; color: rgb(255 255 255 / .75); font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 40px; background: #fff; }
.login-form-wrap { width: min(420px, 100%); }
.login-form-wrap h2 { font-size: 28px; letter-spacing: -.025em; }
.login-intro { margin: 7px 0 26px; color: var(--muted); }
.login-messages { margin: -8px 0 18px; }
.form-error { margin-bottom: 18px; padding: 11px 13px; border-radius: 8px; background: var(--danger-soft); color: #86242c; font-size: 13px; }
.login-form { display: grid; gap: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.field input { width: 100%; }
.login-submit { width: 100%; margin-top: 4px; }
.support-note { margin: 24px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.session-error-action { width: 100%; }

@media (max-width: 1060px) {
  .header-inner { grid-template-columns: auto 1fr auto; }
  .account-name { display: none; }
  .result-band { grid-template-columns: 1fr; }
  .result-list > div:first-child { border-left: 0; }
  .report-row { grid-template-columns: auto 1fr auto; }
  .report-row .status { justify-self: end; }
  .report-actions { grid-column: 2 / -1; }
  .source-strip { align-items: flex-start; }
  .source-facts > div { min-width: 120px; padding-inline: 14px; }
  .plan-table { min-width: 1080px; }
  .target-row { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 760px) {
  :root { --header-height: auto; }
  .header-inner { min-height: 112px; padding: 14px 18px; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 10px; }
  .brand { font-size: 16px; }
  .primary-nav { grid-row: 2; grid-column: 1 / -1; width: 100%; }
  .primary-nav a { flex: 1; min-width: 0; }
  .account-menu { grid-column: 2; grid-row: 1; }
  .app-main { padding: 25px 16px 48px; }
  h1 { font-size: 26px; }
  .page-heading { display: block; }
  .period-form { margin-top: 20px; }
  .field-action select { flex: 1; min-width: 0; }
  .data-surface .table-scroll { overflow: visible; }
  .data-surface .usage-table { display: block; min-width: 0; table-layout: auto; }
  .data-surface .usage-table th { width: auto; }
  .data-surface .usage-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .data-surface .usage-table tbody { display: block; }
  .data-surface .usage-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 18px;
    padding: 18px;
    border-bottom: 1px solid #ece8f0;
  }
  .data-surface .usage-table tbody tr:last-child { border-bottom: 0; }
  .data-surface .usage-table tbody tr:hover { background: transparent; }
  .data-surface .usage-table tbody th,
  .data-surface .usage-table tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }
  .data-surface .usage-table tbody th,
  .data-surface .usage-table .plan-cell,
  .data-surface .usage-table .row-action { grid-column: 1 / -1; }
  .data-surface .usage-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }
  .data-surface .usage-table .row-action { text-align: left !important; }
  .data-surface .usage-table .row-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .data-surface .usage-table .row-action .button { width: 100%; }
  .detail-heading .toolbar { margin-top: 20px; justify-content: flex-start; }
  .detail-heading .toolbar .button-primary { width: 100%; }
  .result-list { grid-template-columns: repeat(2, 1fr); }
  .result-list > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--divider); }
  .result-list > div:nth-child(4) { border-top: 1px solid var(--divider); }
  .detail-grid { grid-template-columns: 1fr; }
  .chart-wrap { min-height: 280px; padding-inline: 8px; }
  #traffic-chart { height: 260px; }
  .chart-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .report-row { grid-template-columns: auto 1fr; }
  .report-row .status { grid-column: 2; justify-self: start; }
  .report-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .source-strip { display: block; }
  .source-facts { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--divider); }
  .source-facts > div:first-child { padding-left: 0; border-left: 0; }
  .reconciliation-intro { display: block; }
  .read-only-lock { margin-top: 16px !important; }
  .plan-detail-grid { grid-template-columns: 1fr; }
  .target-row dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-shell { display: block; }
  .login-brand { min-height: auto; padding: 28px 24px 32px; gap: 56px; }
  .login-brand h1 { font-size: 36px; }
  .login-footnote { display: none; }
  .login-panel { min-height: 56vh; padding: 36px 24px 52px; place-items: start center; }
}

@media (max-width: 480px) {
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .compact-period-form select { width: 100%; }
  .toolbar .compact-period-form { grid-column: 1 / -1; }
  .toolbar .button { width: 100%; }
  .result-list { grid-template-columns: 1fr; }
  .result-list > div { border-left: 0; border-top: 1px solid var(--divider); }
  .surface-heading { padding-inline: 15px; }
  .evidence-list { padding-inline: 15px; }
  .evidence-list > div { align-items: flex-start; flex-direction: column; gap: 2px; padding: 11px 0; }
  .evidence-list dd { text-align: left; }
  .report-list { padding-inline: 15px; }
  .report-actions { grid-template-columns: 1fr; }
  .data-surface .usage-table .row-actions { grid-template-columns: 1fr; }
  .source-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
  .source-facts > div { min-width: 0; padding: 0; border-left: 0; }
  .source-facts > div:last-child { grid-column: 1 / -1; }
  .target-list { padding-inline: 15px; }
  .target-row dl { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .app-header, .toolbar, .period-form, .breadcrumb, .method-note { display: none !important; }
  .app-main { max-width: none; padding: 0; }
  .surface, .result-band { break-inside: avoid; }
}
