:root {
  --navy-950: var(--amp-navy-950);
  --navy-900: var(--amp-navy-900);
  --navy-700: var(--amp-navy-700);
  --ink: var(--amp-ink);
  --muted: var(--amp-muted);
  --line: var(--amp-line);
  --paper: var(--amp-surface);
  --canvas: var(--amp-canvas);
  --blue-soft: var(--amp-blue-soft);
  --gold: var(--amp-amber);
  --gold-soft: var(--amp-amber-soft);
  --red: #b74433;
  --red-soft: var(--amp-red-soft);
  --green: #14785f;
  --shadow: var(--amp-shadow);
  --radius: var(--amp-radius);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; }

main { width: min(1380px, calc(100% - 48px)); margin: 0 auto; padding: 30px 0 64px; }
.page-heading { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.eyebrow { margin: 0 0 6px; color: var(--navy-700); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.10em; text-transform: uppercase; }
h1, h2 { color: var(--navy-900); font-weight: 750; line-height: 1.12; }
h1 { margin: 0; font-size: clamp(2.25rem, 4vw, 3.65rem); }
h2 { margin: 0; font-size: 1.45rem; }
.lede { margin: 10px 0 0; color: var(--muted); }

.tenant-picker { width: min(390px, 100%); display: grid; gap: 7px; color: var(--ink); font-size: 0.82rem; font-weight: 700; }
.tenant-picker select { background-color: var(--paper); }
.reconciliation-header-actions { display: grid; align-self: end; gap: 14px; justify-items: start; min-width: min(430px, 30vw); }
.header-tenant-picker { width: 100%; min-width: 340px; white-space: normal; }
.header-tenant-picker select { min-height: 43px; }

select, input, textarea {
  width: 100%;
  border: 1px solid #bdcbd7;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea { resize: vertical; min-height: 110px; }
select:focus, input:focus, textarea:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(23, 79, 124, 0.13); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.identity-card { display: flex; justify-content: space-between; gap: 24px; padding: 25px 28px; margin-bottom: 18px; }
.identity-main h2 { font-size: clamp(2rem, 3vw, 3rem); }
.location { margin: 7px 0 0; color: var(--muted); }
.status-block { display: grid; align-content: center; justify-items: end; gap: 7px; }
.status-label { color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

.badge { display: inline-flex; align-items: center; width: fit-content; padding: 6px 10px; border-radius: 999px; color: var(--navy-900); background: var(--blue-soft); font-size: 0.75rem; font-weight: 800; text-transform: capitalize; }
.badge-gold { color: #78560c; background: var(--gold-soft); }
.badge-alert { color: #913627; background: var(--red-soft); }
.badge-success { color: #1d644d; background: #e6f3ed; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.85fr); gap: 18px; align-items: start; }
.editor-panel { padding: 28px; }
.side-stack { display: grid; gap: 18px; }
.side-stack > .panel { padding: 24px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.panel-heading.compact { padding-bottom: 17px; }
.draft-state { color: var(--green); font-size: 0.82rem; font-weight: 800; }
.draft-state.is-dirty { color: #9a6700; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 16px; margin-top: 24px; }
.field { display: grid; align-content: start; gap: 7px; color: var(--ink); font-size: 0.82rem; font-weight: 750; }
.field-wide { grid-column: 1 / -1; }
.field small { color: var(--muted); font-size: 0.75rem; font-weight: 450; }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.button { min-height: 42px; padding: 10px 15px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-weight: 800; }
.button-primary { color: white; background: var(--navy-900); }
.button-secondary { color: var(--navy-900); background: white; border-color: #afbfcc; }
.button-tertiary { color: #76540d; background: var(--gold-soft); border-color: #e2c369; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(23, 79, 124, 0.28); outline-offset: 2px; }
.save-boundary { margin: 14px 0 0; color: var(--muted); font-size: 0.78rem; }

.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; }
.metrics div { min-height: 76px; padding: 11px 12px; border: 1px solid #dce8f0; border-radius: 8px; background: #f6fafc; }
.metrics dt { color: var(--muted); font-size: 0.64rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.04em; }
.metrics dd { margin: 4px 0 0; color: var(--navy-900); font-size: 1.02rem; font-weight: 850; line-height: 1.25; }
.source-note { margin: 15px 0 0; color: var(--muted); font-size: 0.82rem; }

.inbox-panel { overflow: hidden; }
.inbox-header { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.inbox-header h2 { margin: 0; font-size: 1.25rem; }
.inbox-filter { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; color: white; background: var(--navy-900); font-size: 0.68rem; font-weight: 850; }
.inbox-list { display: grid; margin-top: 10px; }
.inbox-item { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.inbox-item:last-child { border-bottom: 0; padding-bottom: 0; }
.inbox-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: white; background: linear-gradient(145deg, var(--navy-700), var(--navy-900)); font-size: 0.8rem; font-weight: 900; }
.inbox-copy { min-width: 0; }
.inbox-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.inbox-meta strong { overflow: hidden; color: var(--navy-900); font-size: 0.82rem; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.inbox-meta time { flex: 0 0 auto; color: var(--muted); font-size: 0.67rem; }
.inbox-item h3 { margin: 2px 0 1px; color: var(--ink); font-size: 0.82rem; line-height: 1.2; }
.inbox-item p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 0.74rem; line-height: 1.28; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.inbox-count { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; color: var(--navy-900); background: var(--blue-soft); font-size: 0.68rem; font-weight: 900; }

.toast { position: fixed; right: 24px; bottom: 24px; max-width: 420px; padding: 14px 17px; color: white; background: var(--navy-900); border-left: 4px solid var(--gold); border-radius: 8px; box-shadow: 0 18px 50px rgba(7, 31, 54, 0.24); font-weight: 750; }

.tenant-card-header {
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto;
  min-height: 52px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.tenant-card-header .amp-page-header__logo { max-width: 240px; }
.tenant-card-header .amp-page-header__copy { padding-left: 18px; }
.tenant-card-header h1 { font-size: clamp(0.95rem, 1.2vw, 1.18rem); letter-spacing: 0; }
.tenant-card-header .amp-page-header__lede { margin-top: 3px; font-size: 0.54rem; line-height: 1.25; }
.tenant-card-header .amp-tm { color: #000; font-size: 0.22em; }
.tenant-card-header .amp-page-header__meta { font-size: 0.62rem; }

.portfolio-overview {
  position: relative;
  display: grid;
  grid-template-columns: minmax(330px, 0.72fr) minmax(0, 1.65fr);
  gap: 1px;
  margin-bottom: 24px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(179, 219, 239, 0.28);
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 14% 18%, rgba(53, 221, 177, 0.2), transparent 28%),
    radial-gradient(circle at 90% 2%, rgba(91, 156, 255, 0.18), transparent 32%),
    #0a2943;
  box-shadow: 0 24px 62px rgba(7, 32, 53, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.portfolio-overview::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 18px 18px;
}
.score-card,
.tenant-map-panel {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(11, 39, 62, 0.72), rgba(14, 48, 73, 0.46));
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}
.score-card { display: flex; align-items: center; gap: 26px; padding: 30px; }
.score-ring {
  --score: 360deg;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 138px;
  height: 138px;
  overflow: hidden;
  border-radius: 50%;
  background: conic-gradient(from 215deg, #20c995 0deg, #72f6d0 var(--score), rgba(161, 196, 216, 0.16) 0);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.045), 0 0 42px rgba(52, 225, 173, 0.18), 0 18px 34px rgba(0, 0, 0, 0.24);
}
.score-ring::before { content: ""; position: absolute; width: 104px; height: 104px; border-radius: 50%; background: linear-gradient(145deg, rgba(9, 38, 61, 0.92), rgba(9, 44, 68, 0.78)); box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.12), inset 0 0 26px rgba(0, 0, 0, 0.2); }
.score-ring::after { content: ""; position: absolute; top: 8px; left: 28px; width: 76px; height: 34px; border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 70%); filter: blur(3px); transform: rotate(-18deg); }
.score-ring > div { position: relative; z-index: 1; display: grid; text-align: center; }
.score-ring strong { font-size: 1.8rem; line-height: 1; letter-spacing: -0.05em; }
.score-ring span { margin-top: 6px; color: #a8bcca; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.score-copy .eyebrow,
.tenant-map-panel .eyebrow { color: #77dfbd; }
.score-copy h2,
.tenant-map-panel h2 { margin: 0; color: #fff; font-size: 1.25rem; letter-spacing: -0.025em; }
.score-copy > p:last-child { margin: 8px 0 0; color: #afc0cd; line-height: 1.45; }
.tenant-map-panel { padding: 28px 30px 30px; border-left: 1px solid rgba(255, 255, 255, 0.1); }
.map-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.map-legend { display: flex; gap: 16px; color: #afc0cd; font-size: 0.72rem; white-space: nowrap; }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend-good { background: #5de6bd; box-shadow: 0 0 0 4px rgba(102, 242, 200, 0.12), 0 0 14px rgba(102, 242, 200, 0.5); }
.legend-work { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 48, 69, 0.16), 0 0 16px rgba(255, 48, 69, 0.58); }
.tenant-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.map-marker {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 11px;
  color: #dbe7ee;
  text-align: left;
  border: 1px solid rgba(210, 235, 247, 0.18);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045));
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 22px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}
.map-marker::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, rgba(255, 255, 255, 0.16), transparent 35%, transparent 72%, rgba(255, 255, 255, 0.06)); }
.map-marker:hover,
.map-marker:focus-visible,
.map-marker.is-selected { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.48); background: linear-gradient(135deg, rgba(255, 255, 255, 0.21), rgba(255, 255, 255, 0.08)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 28px rgba(0, 0, 0, 0.18); outline: none; }
.map-marker span { position: relative; z-index: 1; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; color: #07352c; background: linear-gradient(145deg, #5de6bd, #31dca9); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 5px 14px rgba(32, 185, 139, 0.25); font-size: 0.63rem; font-weight: 900; }
.map-marker.is-needs-work { border-color: rgba(255, 67, 86, 0.34); background: linear-gradient(135deg, rgba(255, 48, 69, 0.18), rgba(255, 255, 255, 0.05)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 24px rgba(255, 30, 55, 0.12); }
.map-marker.is-needs-work span { color: #fff; background: linear-gradient(145deg, #ff6675, var(--red)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52), 0 5px 18px rgba(255, 48, 69, 0.48); }
.map-marker strong { position: relative; z-index: 1; overflow: hidden; font-size: 0.72rem; font-weight: 700; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }

.pulse-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.pulse-button { min-height: 34px; padding: 7px 10px; border: 1px solid #afbfcc; border-radius: 999px; color: #4d5f70; background: white; cursor: pointer; font-size: 0.72rem; font-weight: 900; }
.pulse-button-good.is-active { color: #07352c; border-color: #31dca9; background: #dff9f0; }
.pulse-button-work.is-active { color: #fff; border-color: var(--red); background: var(--red); }

.month-proof-panel { margin-top: 18px; padding: 28px; }
.invoice-builder-panel { padding: 0; overflow: hidden; }
.invoice-builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; }
.invoice-editor { padding: 28px; border-right: 1px solid var(--line); }
.invoice-toolbar { display: grid; grid-template-columns: 0.9fr 0.7fr 0.9fr 0.85fr 0.85fr; gap: 12px; margin-top: 24px; }
.invoice-title-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr); gap: 22px; align-items: stretch; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.invoice-drop-zone { display: grid; place-items: center; min-height: 132px; padding: 18px; border: 1px dashed #b9c7d5; border-radius: 8px; color: var(--navy-900); background: #fbfdff; cursor: pointer; text-align: center; }
.invoice-drop-zone input { display: none; }
.invoice-drop-zone strong { color: var(--navy-900); }
.invoice-drop-zone small { color: var(--muted); }
.invoice-drop-zone.is-dragging,
.invoice-drop-zone.has-file { border-color: var(--navy-900); background: var(--blue-soft); }
.invoice-drop-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 8px; color: white; background: var(--navy-900); border-radius: 50%; font-size: 1.4rem; font-weight: 850; }
.invoice-party-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.invoice-party-grid textarea { min-height: 145px; }
.invoice-lines { display: grid; gap: 10px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.invoice-lines-head,
.invoice-line { display: grid; grid-template-columns: minmax(260px, 1fr) 0.32fr 0.32fr 0.32fr; gap: 10px; align-items: start; }
.invoice-lines-head { color: #4d6680; font-weight: 750; }
.invoice-line textarea { min-height: 70px; margin-top: 8px; }
.invoice-line strong { padding-top: 13px; color: var(--navy-900); text-align: right; white-space: nowrap; }
.invoice-add-line { display: inline-flex; align-items: center; gap: 9px; width: fit-content; margin-top: 14px; padding: 8px 0; border: 0; color: var(--navy-900); background: transparent; cursor: pointer; font-weight: 850; }
.invoice-add-line span { display: grid; place-items: center; width: 25px; height: 25px; color: white; background: var(--navy-900); border-radius: 50%; }
.invoice-bottom-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr); gap: 28px; margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line); }
.invoice-optional-notes { display: grid; gap: 14px; }
.invoice-totals { display: grid; gap: 10px; margin: 0; align-content: start; }
.invoice-totals div { display: flex; justify-content: space-between; gap: 18px; color: var(--navy-900); }
.invoice-totals dt { color: var(--muted); font-weight: 750; }
.invoice-totals dd { margin: 0; font-weight: 850; }
.invoice-total-row { padding-top: 10px; border-top: 1px solid var(--line); }
.invoice-preview-card { display: grid; align-content: start; gap: 12px; padding: 20px; background: #fbfcfe; }
.invoice-preview-card .button { width: 100%; justify-content: center; }
.invoice-preview-card .button-primary { background: var(--navy-900); }
.invoice-paper { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 10px 26px rgba(7, 31, 54, 0.08); }
.invoice-paper h3 { margin: 0; color: var(--navy-900); font-size: 2rem; }
.invoice-preview-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.invoice-preview-meta div,
.invoice-preview-parties div { display: grid; gap: 2px; }
.invoice-preview-meta dt,
.invoice-preview-parties span { color: var(--muted); font-size: 0.72rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.04em; }
.invoice-preview-meta dd { margin: 0; font-weight: 800; }
.invoice-preview-parties { display: grid; gap: 10px; }
.invoice-preview-lines { display: grid; gap: 8px; padding: 12px 0; margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); list-style: none; }
.invoice-preview-lines li,
.invoice-preview-total { display: flex; justify-content: space-between; gap: 14px; }
.invoice-preview-lines span { color: var(--muted); }
.invoice-preview-total strong { color: var(--navy-900); font-size: 1.45rem; }
.reconcile-board { padding: 26px 28px 28px; }
.reconcile-summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.global-summary-strip { margin-top: 0; margin-bottom: 18px; }
.reconcile-account-card { display: grid; gap: 3px; min-height: 104px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: #f7fbfe; box-shadow: 0 2px 8px rgba(7, 31, 54, 0.08); }
.reconcile-account-card:first-child { color: white; background: var(--navy-900); border-color: var(--navy-900); }
.reconcile-account-card:first-child span,
.reconcile-account-card:first-child small,
.reconcile-account-card:first-child strong { color: white; }
.reconcile-account-card span { color: var(--muted); font-size: 0.75rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.04em; }
.reconcile-account-card strong { color: var(--navy-900); font-size: clamp(1.35rem, 2.2vw, 1.85rem); line-height: 1.1; }
.reconcile-account-card small { color: var(--muted); font-size: 0.75rem; }
.reconcile-account-card-difference strong { color: #913627; }
.reconcile-heading { align-items: center; }
.reconcile-filter-row { display: flex; align-items: end; gap: 12px; margin: 20px 0 14px; }
.reconcile-filter-row .field { width: min(300px, 100%); }
.reconcile-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: white; }
.reconcile-table { width: 100%; min-width: 1040px; border-collapse: collapse; }
.reconcile-table th,
.reconcile-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.reconcile-table thead th { color: #4d5f70; background: #f7f9fb; font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.reconcile-table tbody tr.is-selected { background: #f2f8fc; }
.reconcile-table tbody tr:hover { background: #f8fbfd; }
.row-tenant-button { display: grid; gap: 2px; width: 100%; padding: 0; border: 0; color: var(--navy-900); background: transparent; cursor: pointer; text-align: left; font-weight: 850; }
.row-tenant-button small { color: var(--muted); font-weight: 500; }
.table-month-input,
.table-amount-input { min-width: 140px; padding: 8px 9px; border-radius: 6px; font-size: 0.82rem; }
.money-cell { color: var(--navy-900); font-weight: 850; white-space: nowrap; }
.money-cell.is-clear { color: #14785f; }
.money-cell.is-off { color: #b74433; }
.reconcile-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.status-pill { min-height: 34px; padding: 7px 9px; border: 1px solid #afbfcc; border-radius: 999px; color: #4d5f70; background: white; cursor: pointer; font-size: 0.74rem; font-weight: 900; }
.status-pill.is-active { color: white; background: var(--navy-900); border-color: var(--navy-900); }
.section-intro { margin: 8px 0 0; color: var(--muted); }
.review-checkbox { display: flex; align-items: start; gap: 11px; cursor: pointer; }
.review-checkbox input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--navy-700); }
.review-checkbox span { display: grid; gap: 3px; }
.review-checkbox small { color: var(--muted); }
.verification-gate { display: grid; gap: 3px; margin-top: 18px; padding: 16px 18px; color: #5f4917; background: var(--gold-soft); border-left: 4px solid var(--gold); border-radius: 8px; }
.verification-gate span { font-size: 0.83rem; }
.month-proof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 16px; margin-top: 24px; }
.calculated-field { display: grid; align-content: start; gap: 5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--blue-soft); }
.calculated-field > span { font-size: 0.82rem; font-weight: 750; }
.calculated-field strong { color: var(--navy-900); font-size: 1.4rem; }
.calculated-field small { color: var(--muted); font-size: 0.75rem; }
.month-review-checkbox { align-self: center; padding-top: 18px; }
.month-result { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 24px 0 0; }
.month-result div { padding: 14px; border-radius: 9px; background: var(--blue-soft); }
.month-result dt { color: var(--muted); font-size: 0.72rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.04em; }
.month-result dd { margin: 5px 0 0; color: var(--navy-900); font-weight: 800; overflow-wrap: anywhere; }
.rectification-queue { margin-top: 18px; padding: 18px; border: 1px solid #e2c369; border-radius: 9px; background: #fffaf0; }
.rectification-queue ul { display: grid; gap: 8px; margin: 10px 0 0; padding-left: 20px; }
.rectification-queue li { color: #5f4917; }

@media (max-width: 900px) {
  main { width: min(100% - 28px, 720px); padding-top: 28px; }
  .page-heading, .identity-card { align-items: stretch; flex-direction: column; }
  .tenant-picker { min-width: 0; }
  .reconciliation-header-actions { min-width: 0; justify-items: stretch; }
  .header-tenant-picker { min-width: 0; }
  .status-block { justify-items: start; }
  .workspace-grid { grid-template-columns: 1fr; }
  .portfolio-overview { grid-template-columns: 1fr; }
  .tenant-map-panel { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
  .tenant-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-builder-layout { grid-template-columns: 1fr; }
  .invoice-editor { border-right: 0; border-bottom: 1px solid var(--line); }
  .invoice-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-title-row,
  .invoice-party-grid,
  .invoice-bottom-grid { grid-template-columns: 1fr; }
  .invoice-lines-head,
  .invoice-line { grid-template-columns: minmax(220px, 1fr) 120px 90px 110px; }
  .reconcile-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reconcile-filter-row { align-items: stretch; flex-direction: column; }
  .month-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .identity-card, .editor-panel, .side-stack > .panel, .reconcile-board, .invoice-editor, .invoice-preview-card { padding: 20px; }
  .tenant-card-header { grid-template-columns: 1fr; }
  .tenant-card-header .amp-page-header__logo { max-width: 220px; }
  .tenant-card-header .amp-page-header__copy { padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .score-card { padding: 24px; }
  .score-ring { width: 112px; height: 112px; }
  .score-ring::before { width: 84px; height: 84px; }
  .tenant-map-panel { padding: 24px; }
  .map-heading { align-items: start; flex-direction: column; }
  .field-grid, .metrics, .month-proof-grid, .month-result { grid-template-columns: 1fr; }
  .invoice-toolbar,
  .invoice-lines-head,
  .invoice-line { grid-template-columns: 1fr; }
  .invoice-lines-head span:not(:first-child) { display: none; }
  .invoice-line strong { text-align: left; padding-top: 0; }
  .reconcile-summary-strip { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-actions { display: grid; }
  .button { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .button { transition: transform 140ms ease, box-shadow 140ms ease; }
}
