/* ============================================================================
   Kovac Property Command Center — Reports v2 overlay styles.
   Companion to reports-v2.js. Loaded after index-*.css and redesign-*.css and
   built entirely on their shadcn/ui CSS-variable tokens, so light and dark
   themes and the mobile drawer breakpoint all come along for free.
   ========================================================================== */

/* Compiled React nodes we hide (never remove — React still owns them). */
.rv2-compiled-hidden { display: none !important; }

.rv2 {
  --rv2-gap: 1rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--rv2-gap);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
}

/* ── header ──────────────────────────────────────────────────────────────── */

.rv2-header { display: flex; flex-direction: column; gap: 0.875rem; }
.rv2-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.rv2-title {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}
.rv2-subtitle {
  margin: 0.25rem 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
}

.rv2-controls { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.rv2-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.rv2-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.rv2-select,
.rv2-input {
  appearance: none;
  font: inherit;
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
  min-height: 38px;
  max-width: 100%;
}
.rv2-select {
  padding-right: 1.9rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 14px;
}
.rv2-textarea { min-height: 74px; resize: vertical; width: 100%; }
.rv2-select:focus-visible,
.rv2-input:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 1px;
  border-color: hsl(var(--ring));
}

/* ── review badge ────────────────────────────────────────────────────────── */

.rv2-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.rv2-badge-idle {
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  border-color: hsl(var(--border));
}
.rv2-badge-ok {
  color: hsl(var(--success, 152 68% 27%));
  background: hsl(var(--success-bg, 150 60% 93%));
  border-color: hsl(var(--success, 152 68% 27%) / 0.25);
}
.rv2-badge-warn {
  color: hsl(var(--warning, 36 92% 42%));
  background: hsl(var(--warning-bg, 45 96% 89%));
  border-color: hsl(var(--warning, 36 92% 42%) / 0.35);
  cursor: pointer;
}
.rv2-badge-warn:hover { filter: brightness(0.97); }
.dark .rv2-badge-ok { background: hsl(152 40% 16%); color: hsl(150 55% 68%); }
.dark .rv2-badge-warn { background: hsl(38 45% 16%); color: hsl(40 90% 68%); }

/* ── tabs ────────────────────────────────────────────────────────────────── */

.rv2-tablist {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.rv2-tab {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  padding: 0.45rem 0.95rem;
  min-height: 36px;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.rv2-tab:hover { color: hsl(var(--foreground)); }
.rv2-tab[aria-selected="true"] {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px hsl(165 30% 12% / 0.08);
}
.rv2-tab:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

.rv2-panel { display: flex; flex-direction: column; gap: var(--rv2-gap); }
.rv2-panel:focus { outline: none; }
.rv2-panel[hidden] { display: none; }

/* ── cards ───────────────────────────────────────────────────────────────── */

.rv2-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 0.25rem);
  padding: 1.1rem 1.15rem;
  box-shadow: 0 1px 2px hsl(165 30% 12% / 0.05), 0 2px 8px -4px hsl(165 30% 12% / 0.06);
}
.dark .rv2-card { box-shadow: none; }
.rv2-card-head { margin-bottom: 0.85rem; }
.rv2-card-title {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.rv2-card-sub {
  margin: 0.25rem 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.78125rem;
  line-height: 1.45;
}

/* ── stat strip ──────────────────────────────────────────────────────────── */

.rv2-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.rv2-stat {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 0.25rem);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.rv2-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.rv2-stat-value {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rv2-stat-pos .rv2-stat-value { color: hsl(var(--success, 152 68% 27%)); }
.rv2-stat-neg .rv2-stat-value { color: hsl(var(--destructive, 0 84% 56%)); }
.dark .rv2-stat-pos .rv2-stat-value { color: hsl(150 55% 62%); }

/* ── tables ──────────────────────────────────────────────────────────────── */

.rv2-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.rv2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums lining-nums;
}
.rv2-table th,
.rv2-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid hsl(var(--border) / 0.65);
  vertical-align: top;
}
.rv2-table thead th {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap;
}
.rv2-table tbody tr:last-child th,
.rv2-table tbody tr:last-child td { border-bottom: 0; }

.rv2-num { text-align: right; white-space: nowrap; }
.rv2-num-context { color: hsl(var(--muted-foreground)); }
.rv2-num-none { color: hsl(var(--muted-foreground)); font-style: italic; text-align: right; }

.rv2-row-label { font-weight: 500; }
.rv2-row-name { display: inline; }
.rv2-row-detail {
  display: block;
  font-weight: 400;
  font-size: 0.71875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.1rem;
}
.rv2-total-row th,
.rv2-total-row td {
  border-top: 2px solid hsl(var(--border));
  font-weight: 700;
  padding-top: 0.6rem;
}
.rv2-row-adjust th, .rv2-row-adjust td { background: hsl(var(--accent) / 0.4); }
.rv2-td-empty {
  color: hsl(var(--muted-foreground));
  font-style: italic;
  padding: 0.9rem 0.65rem;
}
.rv2-col-action { width: 1%; white-space: nowrap; text-align: right; }
.rv2-muted { color: hsl(var(--muted-foreground)); }
.rv2-pos { color: hsl(var(--success, 152 68% 27%)); }
.rv2-neg { color: hsl(var(--destructive, 0 84% 56%)); }
.dark .rv2-pos { color: hsl(150 55% 62%); }
.dark .rv2-neg { color: hsl(0 70% 68%); }

.rv2-table-ledger { min-width: 340px; }
.rv2-table-cover { min-width: 680px; }
.rv2-table-stmts { min-width: 520px; }
.rv2-table-delta { min-width: 480px; }

/* ── net ─────────────────────────────────────────────────────────────────── */

.rv2-net {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-color: hsl(var(--primary) / 0.35);
  background: linear-gradient(135deg, hsl(var(--accent) / 0.55), hsl(var(--card)));
}
.rv2-net-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.rv2-net-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.rv2-net-value {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.rv2-net-formula {
  margin: 0;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}

/* ── KRS gross activity — context, deliberately NOT P&L ──────────────────── */

.rv2-gross {
  border: 1px dashed hsl(var(--muted-foreground) / 0.45);
  border-radius: calc(var(--radius) + 0.25rem);
  background:
    repeating-linear-gradient(
      135deg,
      hsl(var(--muted) / 0.55) 0 10px,
      hsl(var(--muted) / 0.3) 10px 20px
    );
}
.rv2-gross-toggle {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  padding: 0.9rem 1rem;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  border-radius: calc(var(--radius) + 0.25rem);
}
.rv2-gross-toggle:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: -2px; }
.rv2-gross-heading {
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: hsl(var(--muted-foreground));
}
.rv2-gross-chev {
  display: inline-flex;
  transition: transform 0.18s ease;
  color: hsl(var(--muted-foreground));
}
.rv2-gross-chev.rv2-rot { transform: rotate(90deg); }
.rv2-gross-body { padding: 0 1rem 1rem; }
.rv2-gross-body[hidden] { display: none; }
.rv2-gross-note {
  margin: 0 0 0.75rem;
  font-size: 0.78125rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
  max-width: 68ch;
}
.rv2-table-gross { min-width: 380px; }
.rv2-table-gross th,
.rv2-table-gross td { color: hsl(var(--muted-foreground)); }
.rv2-gross-flag {
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground) / 0.85);
  white-space: nowrap;
}

/* ── tags ────────────────────────────────────────────────────────────────── */

.rv2-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6563rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid transparent;
  margin-left: 0.4rem;
  vertical-align: middle;
  white-space: nowrap;
}
.rv2-tag-context,
.rv2-tag-ignored,
.rv2-tag-subtotal {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--border));
}
.rv2-tag-adjust {
  background: hsl(var(--info-bg, 210 80% 94%));
  color: hsl(var(--info, 210 80% 42%));
  border-color: hsl(var(--info, 210 80% 42%) / 0.3);
}
.rv2-tag-ok,
.rv2-tag-cleared {
  background: hsl(var(--success-bg, 150 60% 93%));
  color: hsl(var(--success, 152 68% 27%));
  border-color: hsl(var(--success, 152 68% 27%) / 0.25);
}
.rv2-tag-open,
.rv2-tag-unmapped,
.rv2-tag-rollup {
  background: hsl(var(--warning-bg, 45 96% 89%));
  color: hsl(var(--warning, 36 92% 42%));
  border-color: hsl(var(--warning, 36 92% 42%) / 0.35);
}
.rv2-tag-missing {
  background: hsl(var(--destructive, 0 84% 56%) / 0.12);
  color: hsl(var(--destructive, 0 84% 56%));
  border-color: hsl(var(--destructive, 0 84% 56%) / 0.35);
}
.dark .rv2-tag-adjust { background: hsl(210 45% 18%); color: hsl(210 80% 72%); }
.dark .rv2-tag-ok, .dark .rv2-tag-cleared { background: hsl(152 40% 16%); color: hsl(150 55% 68%); }
.dark .rv2-tag-open, .dark .rv2-tag-unmapped, .dark .rv2-tag-rollup {
  background: hsl(38 45% 16%); color: hsl(40 90% 68%);
}
.dark .rv2-tag-missing { background: hsl(0 40% 18%); color: hsl(0 75% 72%); }

/* ── review list ─────────────────────────────────────────────────────────── */

.rv2-flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.rv2-flag {
  border: 1px solid hsl(var(--border));
  border-left: 3px solid hsl(var(--warning, 36 92% 42%));
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: hsl(var(--background) / 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
/* `restated` outranks the rest — a month already reviewed moved. */
.rv2-flag-restated {
  border-left-color: hsl(var(--destructive, 0 84% 56%));
  background: hsl(var(--destructive, 0 84% 56%) / 0.05);
  box-shadow: inset 0 0 0 1px hsl(var(--destructive, 0 84% 56%) / 0.18);
}
.rv2-flag-priority {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--destructive-foreground, 0 0% 100%));
  background: hsl(var(--destructive, 0 84% 56%));
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}
.rv2-flag-resolved { border-left-color: hsl(var(--border)); opacity: 0.9; }
.rv2-flags-resolved { margin-top: 0.75rem; }
.rv2-flags-resolved[hidden] { display: none; }
.rv2-flag-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.rv2-flag-type { font-weight: 700; font-size: 0.875rem; }
.rv2-flag-head .rv2-tag { margin-left: 0; }
.rv2-flag-prop { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.rv2-flag-label { margin: 0; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.rv2-flag-nums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  background: hsl(var(--muted) / 0.6);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
}
.rv2-flag-num { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.rv2-flag-num-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.rv2-flag-num-value {
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  font-size: 0.9375rem;
}
.rv2-flag-diff .rv2-flag-num-value { color: hsl(var(--warning, 36 92% 42%)); }
.rv2-flag-restated .rv2-flag-diff .rv2-flag-num-value { color: hsl(var(--destructive, 0 84% 56%)); }
.rv2-flag-note { margin: 0; font-size: 0.8125rem; line-height: 1.5; }
.rv2-flag-note-label { font-weight: 700; }
.rv2-flag-meta { margin: 0; font-size: 0.71875rem; color: hsl(var(--muted-foreground)); }
.rv2-flag-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.rv2-disclosure {
  appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.78125rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0;
  cursor: pointer;
}
.rv2-disclosure:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

/* ── buttons ─────────────────────────────────────────────────────────────── */

.rv2-btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.rv2-btn:hover:not(:disabled) { background: hsl(var(--muted)); }
.rv2-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.rv2-btn:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.rv2-btn-sm { min-height: 32px; padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.rv2-btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}
.rv2-btn-primary:hover:not(:disabled) { background: hsl(var(--primary) / 0.9); }
.rv2-btn-ghost { background: transparent; border-color: transparent; color: hsl(var(--muted-foreground)); }
.rv2-btn-ghost:hover:not(:disabled) { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.rv2-btn-danger {
  background: hsl(var(--destructive, 0 84% 56%));
  border-color: hsl(var(--destructive, 0 84% 56%));
  color: hsl(var(--destructive-foreground, 0 0% 100%));
}
.rv2-btn-danger:hover:not(:disabled) { background: hsl(var(--destructive, 0 84% 56%) / 0.9); }
.rv2-btn-danger-ghost { background: transparent; border-color: transparent; color: hsl(var(--destructive, 0 84% 56%)); }
.rv2-btn-danger-ghost:hover:not(:disabled) { background: hsl(var(--destructive, 0 84% 56%) / 0.1); }

.rv2-ico { display: inline-flex; align-items: center; }
.rv2-ico svg { display: block; }

/* ── error / empty / loading ─────────────────────────────────────────────── */

.rv2-error {
  display: flex;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border: 1px solid hsl(var(--destructive, 0 84% 56%) / 0.4);
  background: hsl(var(--destructive, 0 84% 56%) / 0.07);
  border-radius: var(--radius);
}
.rv2-error-icon { color: hsl(var(--destructive, 0 84% 56%)); padding-top: 0.15rem; }
.rv2-error-body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.rv2-error-title { margin: 0; font-weight: 700; font-size: 0.8125rem; }
.rv2-error-msg {
  margin: 0;
  font-size: 0.78125rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
  overflow-wrap: anywhere;
}
.rv2-error .rv2-btn { align-self: flex-start; margin-top: 0.25rem; }

.rv2-empty {
  padding: 1.25rem 0.25rem;
  text-align: center;
}
.rv2-empty-msg { margin: 0; font-size: 0.8125rem; font-weight: 600; }
.rv2-empty-hint {
  margin: 0.3rem 0 0;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.rv2-skel { display: flex; flex-direction: column; gap: 0.5rem; }
.rv2-skel-row {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    hsl(var(--muted)) 0%, hsl(var(--muted) / 0.5) 50%, hsl(var(--muted)) 100%);
  background-size: 200% 100%;
  animation: rv2-shimmer 1.4s ease-in-out infinite;
}
.rv2-skel-row:nth-child(even) { width: 78%; }
@keyframes rv2-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rv2-skel-row { animation: none; }
  .rv2-gross-chev { transition: none; }
}

.rv2-success {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
  font-weight: 600;
  color: hsl(var(--success, 152 68% 27%));
}

/* ── coverage table ──────────────────────────────────────────────────────── */

.rv2-cover-cell { white-space: nowrap; }
.rv2-cover-cell .rv2-tag { margin-left: 0; }
.rv2-cover-by {
  display: block;
  font-size: 0.71875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.2rem;
  white-space: normal;
}
.rv2-row-missing th, .rv2-row-missing td {
  background: hsl(var(--destructive, 0 84% 56%) / 0.06);
}
.rv2-stats-cover .rv2-stat-value { font-size: 1.5rem; }

/* per-property month history */
.rv2-months-row > td { background: hsl(var(--muted) / 0.45); padding: 0.85rem 0.65rem; }
.rv2-months-title {
  margin: 0 0 0.5rem;
  font-size: 0.71875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.rv2-table-months { min-width: 620px; background: hsl(var(--card)); border-radius: var(--radius); }
.rv2-months-corner { width: 11rem; }
.rv2-months-current { color: hsl(var(--primary)) !important; }

/* ── upload ──────────────────────────────────────────────────────────────── */

.rv2-drop {
  border: 2px dashed hsl(var(--input));
  border-radius: calc(var(--radius) + 0.25rem);
  background: hsl(var(--muted) / 0.4);
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: hsl(var(--muted-foreground));
  transition: border-color 0.15s ease, background 0.15s ease;
}
.rv2-drop:hover, .rv2-drop-hot {
  border-color: hsl(var(--primary));
  background: hsl(var(--accent) / 0.5);
}
.rv2-drop:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.rv2-drop-title {
  margin: 0.35rem 0 0;
  font-weight: 700;
  font-size: 0.9375rem;
  color: hsl(var(--foreground));
  overflow-wrap: anywhere;
}
.rv2-drop-hint { margin: 0; font-size: 0.75rem; }
.rv2-file-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.rv2-drop-actions { display: flex; justify-content: flex-end; margin-top: 0.6rem; }

.rv2-detected {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.rv2-detected-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.7rem;
  background: hsl(var(--muted) / 0.55);
  border-radius: var(--radius);
}
.rv2-detected-value { font-weight: 700; font-size: 0.875rem; overflow-wrap: anywhere; }

.rv2-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 0.7rem;
  font-size: 0.71875rem;
  color: hsl(var(--muted-foreground));
}
.rv2-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.rv2-swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
  border: 1px solid hsl(var(--border));
  display: inline-block;
}
.rv2-swatch-ignored { background: hsl(var(--muted)); }
.rv2-swatch-subtotal { background: hsl(var(--secondary)); }
.rv2-swatch-unmapped { background: hsl(var(--warning-bg, 45 96% 89%)); border-color: hsl(var(--warning, 36 92% 42%) / 0.5); }

/* month grid: the YTD Total column is visually severed from the months. */
.rv2-table-grid { min-width: 760px; }
.rv2-table-grid .rv2-col-ytd {
  border-left: 3px double hsl(var(--muted-foreground) / 0.55);
  background: hsl(var(--muted) / 0.5);
  font-weight: 700;
}
.rv2-ytd-head { display: block; }
.rv2-ytd-sub {
  display: block;
  font-size: 0.5938rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: hsl(var(--muted-foreground));
  margin-top: 0.1rem;
  white-space: nowrap;
}
.rv2-sticky-col {
  position: sticky;
  left: 0;
  z-index: 1;
  background: hsl(var(--card));
  min-width: 15rem;
}
.rv2-table-lines tbody tr:hover .rv2-sticky-col { background: hsl(var(--muted) / 0.7); }
.rv2-indent { display: inline-block; }

.rv2-line-ignored th, .rv2-line-ignored td {
  color: hsl(var(--muted-foreground) / 0.7);
  background: hsl(var(--muted) / 0.35);
}
.rv2-line-ignored .rv2-sticky-col { background: hsl(var(--muted) / 0.55); }
.rv2-line-ignored .rv2-row-name { text-decoration: line-through; text-decoration-thickness: 1px; }
.rv2-line-subtotal th, .rv2-line-subtotal td {
  background: hsl(var(--secondary) / 0.5);
  font-weight: 600;
  border-top: 1px solid hsl(var(--border));
}
.rv2-line-subtotal .rv2-sticky-col { background: hsl(var(--secondary) / 0.85); }
.rv2-line-unmapped th, .rv2-line-unmapped td {
  background: hsl(var(--warning-bg, 45 96% 89%) / 0.6);
  box-shadow: inset 2px 0 0 hsl(var(--warning, 36 92% 42%));
}
.dark .rv2-line-unmapped th, .dark .rv2-line-unmapped td { background: hsl(38 45% 14%); }
.rv2-line-unmapped .rv2-sticky-col { background: hsl(var(--warning-bg, 45 96% 89%)); }
.dark .rv2-line-unmapped .rv2-sticky-col { background: hsl(38 45% 16%); }

/* scope picker */
.rv2-select-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.85rem 0 0.5rem;
}
.rv2-select-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  margin-right: auto;
}
.rv2-prop-grid {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.4rem;
}
.rv2-prop-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8125rem;
  min-height: 40px;
}
.rv2-prop-option:hover { background: hsl(var(--muted) / 0.6); }
.rv2-prop-covered { border-style: dashed; }
.rv2-prop-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rv2-prop-option .rv2-tag { margin-left: 0; }
.rv2-checkbox { width: 16px; height: 16px; accent-color: hsl(var(--primary)); flex: none; }
.rv2-hint-note {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.71875rem;
  color: hsl(var(--success, 152 68% 27%));
  margin-top: 0.2rem;
}
.rv2-hint-warn { color: hsl(var(--warning, 36 92% 42%)); display: block; line-height: 1.45; }

/* chips */
.rv2-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.rv2-chip {
  font-size: 0.71875rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}
.rv2-chip-warn {
  background: hsl(var(--warning-bg, 45 96% 89%));
  color: hsl(var(--warning, 36 92% 42%));
  border-color: hsl(var(--warning, 36 92% 42%) / 0.4);
}
.rv2-chip-ok {
  background: hsl(var(--success-bg, 150 60% 93%));
  color: hsl(var(--success, 152 68% 27%));
  border-color: hsl(var(--success, 152 68% 27%) / 0.3);
}
.dark .rv2-chip-warn { background: hsl(38 45% 16%); color: hsl(40 90% 68%); }
.dark .rv2-chip-ok { background: hsl(152 40% 16%); color: hsl(150 55% 68%); }

.rv2-stmt-props { max-width: 340px; }

/* ── commit change summary ───────────────────────────────────────────────── */

.rv2-summary {
  border-color: hsl(var(--primary) / 0.45);
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.09);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.rv2-summary-head { display: flex; gap: 0.65rem; align-items: flex-start; }
.rv2-summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  flex: none;
  border-radius: 999px;
  background: hsl(var(--success, 152 68% 27%));
  color: #fff;
}
.rv2-summary-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
}
.rv2-summary-count {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.45);
}
.rv2-summary-count .rv2-stat-value { font-size: 1.35rem; }
.rv2-summary-count-warn {
  border-color: hsl(var(--warning, 36 92% 42%) / 0.5);
  background: hsl(var(--warning-bg, 45 96% 89%) / 0.55);
}
.dark .rv2-summary-count-warn { background: hsl(38 45% 14%); }
.rv2-summary-months { display: flex; flex-direction: column; gap: 0.2rem; }
.rv2-summary-lead {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 600;
  max-width: 72ch;
}
.rv2-delta {
  border: 1px solid hsl(var(--border));
  border-left: 3px solid hsl(var(--warning, 36 92% 42%));
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
}
.rv2-delta-title {
  margin: 0 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
}
.rv2-old { color: hsl(var(--muted-foreground)); text-decoration: line-through; text-decoration-thickness: 1px; }
.rv2-new { font-weight: 700; }
.rv2-arrow { color: hsl(var(--muted-foreground)); text-align: center; width: 1.5rem; }
.rv2-summary-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── dialog ──────────────────────────────────────────────────────────────── */

body.rv2-dialog-open { overflow: hidden; }
.rv2-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: hsl(168 40% 5% / 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.rv2-dialog {
  background: hsl(var(--popover, var(--card)));
  color: hsl(var(--popover-foreground, var(--foreground)));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 0.35rem);
  box-shadow: 0 24px 60px -20px hsl(165 40% 6% / 0.6);
  width: min(560px, 100%);
  max-height: min(86dvh, 720px);
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
}
.rv2-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.6rem;
}
.rv2-dialog-title {
  margin: 0;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.rv2-dialog-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.rv2-dialog-close:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.rv2-dialog-close:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.rv2-dialog-body {
  padding: 0.25rem 1.15rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.rv2-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid hsl(var(--border));
}
.rv2-dialog-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
}
.rv2-danger-note { color: hsl(var(--destructive, 0 84% 56%)); font-weight: 600; }
.rv2-form-error {
  margin: 0;
  font-size: 0.78125rem;
  font-weight: 600;
  color: hsl(var(--destructive, 0 84% 56%));
}
.rv2-form-error[hidden] { display: none; }
.rv2-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
}
.rv2-plain-list { margin: 0; padding-left: 1.2rem; font-size: 0.8125rem; }

/* ── unallocated P&L row — loud on purpose ───────────────────────────────── */

.rv2-row-unallocated th,
.rv2-row-unallocated td {
  background: hsl(var(--warning-bg, 45 96% 89%) / 0.7);
  box-shadow: inset 3px 0 0 hsl(var(--warning, 36 92% 42%));
}
.dark .rv2-row-unallocated th, .dark .rv2-row-unallocated td { background: hsl(38 45% 14%); }
.rv2-row-unallocated .rv2-row-name { font-weight: 700; color: hsl(var(--warning, 36 92% 42%)); }
.dark .rv2-row-unallocated .rv2-row-name { color: hsl(40 90% 68%); }
.rv2-num-unallocated { font-weight: 700; }
.rv2-unalloc-btn { margin-top: 0.4rem; }

/* ── resolution window ───────────────────────────────────────────────────── */

.rv2-overlay-wide { align-items: flex-start; padding: 2.5rem 1rem; overflow-y: auto; }
.rv2-resolver {
  background: hsl(var(--popover, var(--card)));
  color: hsl(var(--popover-foreground, var(--foreground)));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 0.35rem);
  box-shadow: 0 24px 60px -20px hsl(165 40% 6% / 0.6);
  width: min(680px, 100%);
  max-height: calc(100dvh - 5rem);
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
}

.rv2-res-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0 1.15rem 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
}
.rv2-res-progress {
  font-size: 0.75rem;
  font-weight: 700;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}
.rv2-res-jump { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.rv2-res-pip {
  appearance: none;
  min-width: 28px;
  height: 28px;
  padding: 0 0.35rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: 0.71875rem;
  font-weight: 700;
  cursor: pointer;
}
.rv2-res-pip:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.rv2-res-pip-done {
  background: hsl(var(--success-bg, 150 60% 93%));
  color: hsl(var(--success, 152 68% 27%));
  border-color: hsl(var(--success, 152 68% 27%) / 0.4);
}
.rv2-res-pip-block {
  background: hsl(var(--destructive, 0 84% 56%) / 0.12);
  color: hsl(var(--destructive, 0 84% 56%));
  border-color: hsl(var(--destructive, 0 84% 56%) / 0.45);
}
.rv2-res-pip-active {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 1px;
  color: hsl(var(--foreground));
}
.dark .rv2-res-pip-done { background: hsl(152 40% 16%); color: hsl(150 55% 68%); }

.rv2-res-body {
  padding: 0.9rem 1.15rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.rv2-res-kind { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.rv2-res-kind .rv2-tag { margin-left: 0; }
.rv2-res-title {
  margin: 0;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
}
.rv2-res-resolved {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--success, 152 68% 27%));
}
.rv2-res-card { display: flex; flex-direction: column; gap: 0.65rem; }
.rv2-res-lead { margin: 0; font-size: 0.875rem; line-height: 1.5; }
.rv2-res-detail {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.75rem;
  padding: 0.6rem 0.75rem;
  background: hsl(var(--muted) / 0.55);
  border-radius: var(--radius);
  font-size: 0.78125rem;
}
.rv2-res-detail dt {
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  align-self: center;
}
.rv2-res-detail dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.rv2-res-options { display: flex; flex-direction: column; gap: 0.35rem; }
.rv2-res-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1.45;
  min-height: 42px;
}
.rv2-res-option:hover { background: hsl(var(--muted) / 0.6); }
.rv2-res-option:focus-within { border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.25); }
.rv2-radio { width: 16px; height: 16px; margin-top: 0.15rem; accent-color: hsl(var(--primary)); flex: none; }
.rv2-res-extra { display: flex; flex-direction: column; gap: 0.55rem; }

/* the "always map this label" checkbox — consequence spelled out */
.rv2-rule-box {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem;
  border: 2px solid hsl(var(--warning, 36 92% 42%) / 0.5);
  background: hsl(var(--warning-bg, 45 96% 89%) / 0.55);
  border-radius: var(--radius);
  cursor: pointer;
}
.dark .rv2-rule-box { background: hsl(38 45% 13%); }
.rv2-rule-box:focus-within { border-color: hsl(var(--ring)); }
.rv2-rule-box > span { display: flex; flex-direction: column; gap: 0.2rem; }
.rv2-rule-title { font-weight: 700; font-size: 0.8125rem; overflow-wrap: anywhere; }
.rv2-rule-note { font-size: 0.71875rem; line-height: 1.45; color: hsl(var(--muted-foreground)); }

.rv2-res-actions { flex-wrap: wrap; align-items: center; }
.rv2-res-actions .rv2-btn-primary { margin-left: auto; }
.rv2-res-confirm {
  margin: 0 auto 0 0;
  font-size: 0.78125rem;
  font-weight: 600;
  color: hsl(var(--destructive, 0 84% 56%));
  flex: 1 1 100%;
}
.rv2-res-footer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0 1.15rem 1rem;
}
.rv2-res-block-note {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78125rem;
  font-weight: 600;
  color: hsl(var(--destructive, 0 84% 56%));
}
.rv2-res-defer-note { font-size: 0.71875rem; color: hsl(var(--muted-foreground)); }

/* ── commit gating + unresolved summary ──────────────────────────────────── */

.rv2-unres { display: flex; flex-direction: column; gap: 0.7rem; }
.rv2-unres-open, .rv2-review-open { align-self: flex-start; margin-bottom: 0.6rem; }
.rv2-summary-count-block {
  border-color: hsl(var(--destructive, 0 84% 56%) / 0.5);
  background: hsl(var(--destructive, 0 84% 56%) / 0.08);
}
.rv2-summary-count-block .rv2-stat-value { color: hsl(var(--destructive, 0 84% 56%)); }
.rv2-chip-block {
  background: hsl(var(--destructive, 0 84% 56%) / 0.12);
  color: hsl(var(--destructive, 0 84% 56%));
  border-color: hsl(var(--destructive, 0 84% 56%) / 0.4);
}

.rv2-commit-block,
.rv2-commit-advisory {
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}
.rv2-commit-block {
  border: 1px solid hsl(var(--destructive, 0 84% 56%) / 0.45);
  background: hsl(var(--destructive, 0 84% 56%) / 0.07);
}
.rv2-commit-advisory {
  border: 1px solid hsl(var(--warning, 36 92% 42%) / 0.45);
  background: hsl(var(--warning-bg, 45 96% 89%) / 0.5);
}
.dark .rv2-commit-advisory { background: hsl(38 45% 13%); }
.rv2-commit-block-title,
.rv2-commit-advisory-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.rv2-commit-block-title { color: hsl(var(--destructive, 0 84% 56%)); }
.rv2-commit-advisory-title { color: hsl(var(--warning, 36 92% 42%)); }
.dark .rv2-commit-advisory-title { color: hsl(40 90% 68%); }
.rv2-commit-block .rv2-plain-list { margin: 0; font-size: 0.78125rem; }

.rv2-table-rules { min-width: 460px; }

/* ── provisional + override markers ──────────────────────────────────────── */

.rv2-marks { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; margin-left: 0.4rem; }
.rv2-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  vertical-align: middle;
  white-space: nowrap;
  margin-left: 0.35rem;
}
.rv2-mark-provisional {
  background: repeating-linear-gradient(
    -45deg,
    hsl(var(--warning-bg, 45 96% 89%)) 0 5px,
    hsl(var(--warning, 36 92% 42%) / 0.22) 5px 10px);
  color: hsl(var(--warning, 36 92% 42%));
  border: 1px dashed hsl(var(--warning, 36 92% 42%) / 0.7);
  font: inherit;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: help;
}
button.rv2-mark-provisional { cursor: pointer; }
button.rv2-mark-provisional:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 1px; }
.dark .rv2-mark-provisional {
  background: repeating-linear-gradient(-45deg, hsl(38 45% 15%) 0 5px, hsl(38 60% 24%) 5px 10px);
  color: hsl(40 90% 70%);
}
.rv2-mark-override {
  background: hsl(var(--info-bg, 210 80% 94%));
  color: hsl(var(--info, 210 80% 42%));
  border: 1px solid hsl(var(--info, 210 80% 42%) / 0.5);
}
.dark .rv2-mark-override { background: hsl(210 45% 18%); color: hsl(210 80% 72%); }
.rv2-mark-revert {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.rv2-mark-revert:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.rv2-num-marked { font-style: italic; }

.rv2-provisional-banner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border: 1px solid hsl(var(--warning, 36 92% 42%) / 0.55);
  background: hsl(var(--warning-bg, 45 96% 89%) / 0.65);
  border-radius: calc(var(--radius) + 0.25rem);
  color: hsl(var(--warning, 36 92% 42%));
}
.dark .rv2-provisional-banner { background: hsl(38 45% 13%); color: hsl(40 90% 70%); }
.rv2-provisional-banner > div { flex: 1 1 260px; }
.rv2-provisional-banner .rv2-btn { flex: none; }
.rv2-provisional-title { margin: 0; font-weight: 700; font-size: 0.8125rem; }
.rv2-provisional-note {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: hsl(var(--muted-foreground));
}
.rv2-net-provisional { border-style: dashed; }

.rv2-overrides-card { border-color: hsl(var(--info, 210 80% 42%) / 0.45); }
.rv2-table-overrides { min-width: 560px; }

/* ── split disclosure ─────────────────────────────────────────────────────────
   A statement contributing less than its face value is correct but surprising,
   so it reads as information rather than an error: the `info` token, not the
   destructive one. It sits above the totals for the same reason the provisional
   banner does — found later, it looks like a discrepancy. */

.rv2-split-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border: 1px solid hsl(var(--info, 210 80% 42%) / 0.5);
  background: hsl(var(--info-bg, 210 80% 94%) / 0.6);
  border-radius: calc(var(--radius) + 0.25rem);
  color: hsl(var(--info, 210 80% 42%));
}
.dark .rv2-split-banner { background: hsl(210 45% 14%); color: hsl(210 80% 74%); }
.rv2-split-banner > div { flex: 1 1 260px; min-width: 0; }
.rv2-split-title { margin: 0; font-weight: 700; font-size: 0.8125rem; }
.rv2-split-note {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: hsl(var(--muted-foreground));
}
.rv2-split-item {
  margin-top: 0.55rem;
  padding-left: 0.65rem;
  border-left: 2px solid hsl(var(--info, 210 80% 42%) / 0.4);
}
.rv2-split-item-note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: hsl(var(--foreground));
  overflow-wrap: anywhere;
}
.rv2-split-figures {
  margin: 0.15rem 0 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}
/* The two states where the netted figure still needs a human decision. */
.rv2-split-warn {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: hsl(var(--warning, 36 92% 42%));
  overflow-wrap: anywhere;
}
.dark .rv2-split-warn { color: hsl(40 90% 70%); }

.rv2-mark-split {
  background: hsl(var(--info-bg, 210 80% 94%));
  color: hsl(var(--info, 210 80% 42%));
  border: 1px solid hsl(var(--info, 210 80% 42%) / 0.5);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: help;
}
.dark .rv2-mark-split { background: hsl(210 45% 18%); color: hsl(210 80% 72%); }

/* ── conflict card — a three-way decision ────────────────────────────────── */

.rv2-flag-conflict { border-left-color: hsl(var(--warning, 36 92% 42%)); }
.rv2-flag-conflict .rv2-flag-priority {
  background: hsl(var(--warning, 36 92% 42%));
  color: hsl(0 0% 100%);
}
.rv2-cf-rows { display: flex; flex-direction: column; gap: 0.4rem; }
.rv2-cf-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 52px;
}
.rv2-cf-row:hover { background: hsl(var(--muted) / 0.55); }
.rv2-cf-row:focus-within { border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.25); }
.rv2-cf-body { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; }
.rv2-cf-label { font-weight: 700; font-size: 0.8125rem; }
.rv2-cf-source {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
  overflow-wrap: anywhere;
}
.rv2-cf-value {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
}
.rv2-cf-value-new { color: hsl(var(--primary)); }
.rv2-cf-input { width: 8.5rem; flex: none; text-align: right; }
.rv2-cf-warn {
  margin: 0;
  font-size: 0.71875rem;
  line-height: 1.45;
  color: hsl(var(--warning, 36 92% 42%));
  font-weight: 600;
}

/* ── a11y helper ─────────────────────────────────────────────────────────── */

.rv2-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── responsive — matches the app's 860px drawer breakpoint ──────────────── */

@media (max-width: 860px) {
  .rv2 { padding: 1rem 0.875rem calc(2rem + env(safe-area-inset-bottom)); }
  .rv2-title { font-size: 1.35rem; }
  .rv2-header-top { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .rv2-badge { align-self: flex-start; }
  .rv2-controls > .rv2-field { flex: 1 1 140px; }
  .rv2-tablist { width: 100%; }
  .rv2-tab { flex: 1; }
  .rv2-card { padding: 0.9rem; border-radius: var(--radius); }
  .rv2-stats { grid-template-columns: 1fr; }
  .rv2-stat { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .rv2-flag-nums { grid-template-columns: 1fr; gap: 0.35rem; }
  .rv2-flag-num { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .rv2-net-value { font-size: 1.4rem; }
  .rv2-prop-grid { grid-template-columns: 1fr; }
  /* iOS zooms any control below 16px on focus */
  .rv2-select, .rv2-input { font-size: 16px; }
  /* sticky first column costs more than it gives on a phone */
  .rv2-sticky-col { position: static; min-width: 12rem; }
  /* a two-column ledger needs no minimum — let it fit the phone */
  .rv2-table-ledger, .rv2-table-gross { min-width: 0; }
  .rv2-table-gross .rv2-gross-flag { display: none; }
  .rv2-cf-row { flex-wrap: wrap; }
  .rv2-cf-value, .rv2-cf-input { margin-left: 1.6rem; }
  .rv2-cf-input { width: 100%; }
  .rv2-provisional-banner .rv2-btn { width: 100%; }
  .rv2-res-strip { padding: 0 0.9rem 0.6rem; }
  .rv2-res-body { padding: 0.75rem 0.9rem; }
  .rv2-res-footer { padding: 0 0.9rem 0.9rem; }
  .rv2-res-actions .rv2-btn { flex: 1 1 auto; }
  .rv2-res-actions .rv2-btn-primary { margin-left: 0; flex-basis: 100%; }
  .rv2-overlay-wide { align-items: flex-end; padding: 0; }
  .rv2-resolver {
    width: 100%;
    max-height: 94dvh;
    border-radius: calc(var(--radius) + 0.35rem) calc(var(--radius) + 0.35rem) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .rv2-overlay { align-items: flex-end; padding: 0; }
  .rv2-dialog {
    width: 100%;
    max-height: 92dvh;
    border-radius: calc(var(--radius) + 0.35rem) calc(var(--radius) + 0.35rem) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
}
