@font-face {
  font-family: "Manrope";
  src: url("./assets/manrope-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("./assets/manrope-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("./assets/manrope-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #eef1f4;
  --panel: #fbfcfd;
  --panel-soft: #f5f7f9;
  --ink: #111315;
  --muted: #59626b;
  --muted-light: #626b74;
  --line: #dfe3e8;
  --blue: #1762ff;
  --blue-soft: #e8f0ff;
  --green: #1fbf65;
  --pink: #f74c9b;
  --orange: #ff9747;
  --radius: 16px;
  --shadow: 0 22px 46px -38px rgb(22 30 44 / 50%);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 14px;
  text-rendering: optimizeLegibility;
}

body.panel-open {
  overflow: hidden;
}

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

button,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:not(:disabled),
select {
  cursor: pointer;
}

::selection {
  background: var(--blue);
  color: #f8fbff;
}

* {
  scrollbar-color: #aeb6c1 transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #aeb6c1;
  background-clip: content-box;
}

:focus-visible {
  outline: 3px solid rgb(23 98 255 / 32%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 40;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: 10px;
  background: var(--ink);
  color: #f8fbff;
  text-decoration: none;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 76px;
  padding: 12px clamp(18px, 3vw, 48px);
  gap: clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgb(238 241 244 / 92%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.wordmark-mark {
  position: relative;
  width: 28px;
  height: 28px;
  border: 3px solid var(--blue);
  border-radius: 8px;
}

.wordmark-mark::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--blue);
}

.primary-nav {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.primary-nav::-webkit-scrollbar {
  display: none;
}

.nav-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav-item.is-active {
  background: var(--ink);
  box-shadow: 0 12px 24px -18px rgb(17 19 21 / 80%);
  color: #f8fbff;
}

.nav-item[aria-disabled="true"] {
  cursor: help;
  opacity: 0.62;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-flag {
  padding: 8px 12px;
  border: 1px solid #cbd7ee;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #305ca8;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.user-chip {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-shell {
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: 26px clamp(18px, 3vw, 48px) 44px;
}

.overview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  min-height: 92px;
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(42px, 4.4vw, 68px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.96;
}

.status-line {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.filters {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.filters label,
.field {
  display: grid;
  gap: 6px;
}

.filters label > span,
.field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

select,
input,
textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

select {
  min-width: 154px;
  padding: 0 34px 0 12px;
}

input {
  width: 100%;
  padding: 0 12px;
  caret-color: var(--blue);
}

textarea {
  width: 100%;
  padding: 11px 12px;
  resize: vertical;
  caret-color: var(--blue);
}

select:hover,
input:hover,
textarea:hover {
  border-color: #bdc5ce;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(23 98 255 / 10%);
  outline: 0;
}

.reset-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 120ms ease;
}

.reset-button:hover {
  background: var(--panel);
  color: var(--ink);
}

.reset-button.is-armed {
  border-color: #e8b5b5;
  background: #fff0f0;
  color: #a62d2d;
}

.top-grid,
.bottom-grid {
  display: grid;
  gap: 14px;
}

.top-grid {
  grid-template-columns: minmax(0, 1.68fr) minmax(320px, 0.72fr);
  margin-bottom: 14px;
}

.bottom-grid {
  grid-template-columns: minmax(270px, 0.9fr) minmax(360px, 1.24fr) minmax(290px, 0.84fr);
  align-items: stretch;
}

.panel,
.insight-panel {
  min-width: 0;
  border-radius: var(--radius);
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.funnel-panel,
.revenue-panel,
.receivables-panel,
.mini-panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.panel-header h2,
.insight-panel h2,
.case-panel h2,
.payment-dialog h2 {
  margin-bottom: 5px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.panel-header p,
.case-panel p,
.payment-dialog p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.panel-header.compact {
  align-items: center;
}

.panel-header.compact h2 {
  font-size: 17px;
}

.panel-header.compact > strong {
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.payment-button,
.submit-payment,
.insight-action {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  background: var(--ink);
  color: #f8fbff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background-color 180ms ease,
    transform 120ms ease;
}

.payment-button:hover,
.submit-payment:hover {
  background: var(--blue);
}

.payment-button:active,
.submit-payment:active,
.insight-action:active,
.reset-button:active,
.secondary-button:active,
.close-panel:active,
.dialog-close:active {
  transform: translateY(1px);
}

.payment-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.funnel-chart {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  height: 250px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
}

.funnel-scroll-hint {
  display: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.funnel-stage {
  position: relative;
  display: flex;
  height: 100%;
  align-items: flex-end;
  padding: 0;
  overflow: visible;
  border-right: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.funnel-stage:last-child {
  border-right: 0;
}

.stage-copy {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: grid;
  padding: 8px 12px 10px;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.stage-copy span {
  min-height: 28px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
}

.stage-copy strong {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stage-copy small {
  color: var(--muted-light);
  font-size: 9px;
}

.stage-bar {
  width: 100%;
  height: var(--bar-height);
  min-height: 18px;
  background: color-mix(in srgb, var(--blue) var(--stage-strength), #edf3ff);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 52%);
  transform-origin: bottom;
  transition:
    filter 180ms ease,
    transform 260ms var(--ease);
}

.funnel-stage:hover .stage-bar,
.funnel-stage:focus-visible .stage-bar {
  filter: saturate(1.08);
  transform: scaleY(1.025);
}

.stage-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bar-height) + 10px);
  z-index: 5;
  width: max-content;
  max-width: 220px;
  padding: 9px 11px;
  transform: translate(-50%, 7px);
  border-radius: 9px;
  background: var(--ink);
  box-shadow: 0 14px 28px -18px rgb(17 19 21 / 90%);
  color: #f8fbff;
  font-size: 9px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 180ms var(--ease);
}

.funnel-stage:hover .stage-tooltip,
.funnel-stage:focus-visible .stage-tooltip {
  transform: translate(-50%, 0);
  opacity: 1;
}

.analysis-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  padding: 10px 14px;
  gap: 14px;
  border: 1px solid #cad9fa;
  border-radius: 11px;
  background: linear-gradient(90deg, #eef4ff, #f8fbff);
  color: inherit;
  text-align: left;
  transition:
    border-color 180ms ease,
    background-color 180ms ease;
}

.analysis-strip:hover {
  border-color: #9db9f2;
}

.analysis-strip span {
  color: #54709c;
  font-size: 9px;
  font-weight: 700;
}

.analysis-strip strong {
  font-size: 11px;
  font-weight: 600;
}

.delta {
  padding: 7px 9px;
  border-radius: 999px;
  background: #edf9f1;
  color: #267746;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.delta.is-negative {
  background: #fff0f4;
  color: #a63865;
}

.delta.is-neutral {
  background: var(--panel-soft);
  color: var(--muted);
}

.revenue-total {
  display: block;
  margin: 30px 0 34px;
  font-size: clamp(42px, 4.1vw, 64px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.channel-list {
  display: grid;
  gap: 22px;
}

.channel-row {
  display: grid;
  width: 100%;
  padding: 0;
  gap: 8px;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.channel-row:hover .channel-copy strong,
.channel-row:focus-visible .channel-copy strong {
  color: var(--blue);
}

.channel-copy {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.channel-copy strong {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.channel-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f3;
}

.channel-fill {
  display: block;
  width: var(--channel-width);
  height: 100%;
  border-radius: inherit;
  background: var(--channel-color);
}

.receivables-panel,
.insight-panel {
  min-height: 316px;
}

.trend-chart {
  height: 224px;
  margin-top: 20px;
}

.trend-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.trend-grid-line {
  stroke: #e8e9ed;
  stroke-width: 1;
}

.trend-area {
  fill: url(#receivables-fill);
}

.trend-line {
  fill: none;
  stroke: var(--pink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.trend-point {
  fill: var(--panel);
  stroke: var(--pink);
  stroke-width: 3;
}

.trend-label {
  fill: var(--muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 9px;
}

.mini-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}

.mini-panel {
  min-height: 151px;
}

.dot-plot {
  display: grid;
  grid-template-columns: repeat(12, 24px);
  align-content: end;
  justify-content: center;
  min-height: 66px;
  margin-top: 12px;
  gap: 2px;
}

.dot {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
}

.dot::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #bbdfc9;
  content: "";
  transform: translate(-50%, -50%);
  transition:
    transform 220ms var(--ease),
    background-color 220ms ease;
}

.dot.is-strong::before {
  background: var(--green);
}

.dot.is-credit::before {
  background: var(--orange);
}

.dot-plot.accounts .dot::before {
  background: #bbd3ff;
}

.dot-plot.accounts .dot.is-strong::before {
  background: var(--blue);
}

.dot:hover::before,
.dot:focus-visible::before {
  transform: translate(-50%, -50%) scale(1.3);
}

.dot-empty {
  grid-column: 1 / -1;
  align-self: center;
  color: var(--muted);
  font-size: 10px;
}

.insight-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 22px;
  background:
    linear-gradient(150deg, rgb(255 255 255 / 22%), transparent 38%),
    linear-gradient(138deg, #d7e9ff 3%, #faab7e 44%, #f3c0b1 57%, #1964cb 100%);
  box-shadow: 0 28px 58px -36px rgb(21 77 155 / 70%);
  color: #10233c;
}

.insight-panel::before {
  content: "";
  position: absolute;
  top: -24%;
  right: -23%;
  width: 82%;
  aspect-ratio: 1;
  border: 34px solid rgb(255 255 255 / 68%);
  border-radius: 40% 60% 52% 48%;
  transform: rotate(23deg);
}

.insight-panel > * {
  position: relative;
  z-index: 1;
}

.insight-label {
  align-self: flex-start;
  margin-bottom: auto;
  padding: 7px 10px;
  border: 1px solid rgb(16 35 60 / 22%);
  border-radius: 999px;
  background: rgb(255 255 255 / 22%);
  font-size: 9px;
  font-weight: 700;
}

.insight-figure {
  display: block;
  margin-bottom: 10px;
  font-size: 66px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
}

.insight-panel h2 {
  max-width: 13ch;
  margin-bottom: 8px;
  font-size: 20px;
}

.insight-panel p {
  max-width: 34ch;
  margin-bottom: 16px;
  color: #244364;
  font-size: 10px;
  line-height: 1.5;
}

.insight-action {
  align-self: flex-start;
  border: 1px solid rgb(16 35 60 / 26%);
  background: rgb(255 255 255 / 74%);
  color: #132c4b;
}

.insight-action:hover {
  background: #f8fbff;
}

.interactive-panel {
  position: relative;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.panel-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  padding: 0;
  border-radius: inherit;
  background: transparent;
}

.interactive-panel > :not(.panel-hit) {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.interactive-panel .channel-row,
.interactive-panel .dot,
.interactive-panel .insight-action {
  pointer-events: auto;
}

.interactive-panel:has(.panel-hit:hover),
.interactive-panel:has(.panel-hit:focus-visible) {
  border-color: #b9c8e6;
  box-shadow: 0 24px 48px -34px rgb(22 30 44 / 62%);
}

.interactive-panel:has(.panel-hit:active) {
  box-shadow: 0 12px 28px -28px rgb(22 30 44 / 58%);
}

.panel-scrim {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgb(18 24 34 / 24%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.panel-scrim[hidden],
.case-panel[hidden] {
  display: none;
}

.case-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(440px, 100vw);
  height: 100dvh;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -24px 0 62px -42px rgb(17 19 21 / 58%);
}

.case-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.case-panel-header span,
.payment-dialog header span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.case-panel-header h2,
.payment-dialog header h2 {
  margin: 0;
  font-size: 25px;
}

.close-panel,
.dialog-close,
.secondary-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 120ms ease;
}

.close-panel:hover,
.dialog-close:hover,
.secondary-button:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.case-panel-body {
  overflow-y: auto;
  padding: 18px 22px 36px;
}

.case-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  gap: 16px;
}

.case-summary strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.case-summary span {
  color: var(--muted);
  font-size: 10px;
}

.case-list {
  display: grid;
  gap: 9px;
}

.case-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  padding: 13px;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  text-align: left;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms var(--ease);
}

.case-row:hover {
  border-color: #b9c8e6;
  background: #f6f9ff;
  transform: translateY(-1px);
}

.case-row strong,
.invoice-detail strong {
  font-weight: 700;
}

.case-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.case-row > span {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-content: center;
  padding: 24px;
  text-align: center;
}

.empty-state strong {
  margin-bottom: 6px;
}

.invoice-detail {
  display: grid;
  gap: 18px;
}

.back-button {
  width: fit-content;
  padding: 0 0 5px;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.invoice-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.invoice-title h3 {
  margin: 0 0 5px;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.status-badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #315ba8;
  font-size: 9px;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.detail-grid div {
  min-height: 72px;
  padding: 12px;
  background: var(--panel);
}

.detail-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
}

.detail-grid strong {
  font-size: 11px;
  line-height: 1.4;
}

.detail-note {
  padding: 12px;
  border-radius: 11px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.invoice-detail .payment-button {
  justify-self: start;
}

.payment-dialog {
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 30px 80px -24px rgb(17 19 21 / 46%);
}

.payment-dialog::backdrop {
  background: rgb(18 24 34 / 35%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.payment-dialog form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.payment-dialog header,
.payment-dialog footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.payment-dialog footer {
  justify-content: flex-end;
  align-items: center;
  padding-top: 4px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.invoice-context {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  gap: 14px;
  border-radius: 11px;
  background: var(--panel-soft);
  font-size: 10px;
}

.invoice-context strong {
  font-variant-numeric: tabular-nums;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: #a72845 !important;
  font-size: 10px !important;
  font-weight: 600;
}

/* Phase 2 workspaces inherit the approved Operational Ledger language. */
.workspace-shell {
  --workspace-panel-inset: 20px;
  min-height: calc(100dvh - 76px);
}

.workspace-shell[hidden] {
  display: none;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 92px;
  margin-bottom: 24px;
  gap: 24px;
}

.workspace-header h1 {
  max-width: 16ch;
  font-size: clamp(42px, 4vw, 62px);
}

.workspace-boundary {
  padding: 9px 12px;
  border: 1px solid #cad9fa;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #305ca8;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 14px;
  gap: 20px;
}

.workspace-toolbar > span {
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.workspace-filters {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.workspace-filters label {
  display: grid;
  gap: 6px;
}

.workspace-filters label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.workspace-feedback {
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 1px solid #c8d8f8;
  border-radius: 11px;
  background: #eef4ff;
  color: #264c89;
  font-size: 11px;
  font-weight: 600;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 16px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0 0 5px;
  letter-spacing: -0.025em;
}

.section-heading h2 {
  font-size: 20px;
}

.section-heading h3 {
  font-size: 16px;
}

.section-heading p,
.account-identity p,
.invoice-paper-head p,
.case-conversation header p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.section-heading > strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.account-workspace,
.billing-workspace,
.collections-workspace,
.service-workspace {
  display: grid;
  align-items: start;
  gap: 14px;
}

.account-workspace {
  grid-template-columns: minmax(330px, 0.75fr) minmax(0, 1.35fr);
}

.account-index,
.account-sheet,
.billing-rail,
.invoice-paper,
.tariff-ledger,
.open-ledger,
.receipt-ledger,
.portal-documents,
.portal-readings,
.portal-support,
.service-board,
.case-conversation,
.region-analysis,
.aging-analysis,
.import-workbench,
.event-ledger {
  padding: var(--workspace-panel-inset);
}

.account-index,
.billing-rail {
  max-height: 720px;
  overflow: auto;
}

.ledger-list {
  border-top: 1px solid var(--line);
}

.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 11px 10px;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background-color 180ms ease;
}

.ledger-row:hover,
.ledger-row.is-selected {
  background: var(--blue-soft);
}

.ledger-row > span:last-child {
  text-align: right;
}

.ledger-row strong,
.ledger-row small {
  display: block;
}

.ledger-row strong {
  font-size: 11px;
}

.ledger-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.account-identity,
.invoice-paper-head,
.case-conversation > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.account-identity h2,
.invoice-paper-head h2,
.case-conversation h2 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.identity-grid,
.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
  gap: 1px;
}

.identity-grid div,
.case-meta div {
  min-width: 0;
  padding: 13px;
  background: var(--panel);
}

.identity-grid dt,
.case-meta dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.identity-grid dd,
.case-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.meter-strip {
  padding-top: 4px;
}

.reading-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.reading-timeline > div {
  padding: 15px 12px;
  border-right: 1px solid var(--line);
}

.reading-timeline > div:last-child {
  border-right: 0;
}

.reading-timeline span,
.reading-timeline strong,
.reading-timeline small {
  display: block;
}

.reading-timeline span,
.reading-timeline small {
  color: var(--muted);
  font-size: 9px;
}

.reading-timeline strong {
  margin: 6px 0;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.operation-form {
  display: grid;
  margin-top: 22px;
  padding-top: 20px;
  gap: 13px;
  border-top: 1px solid var(--line);
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.locked-note,
.document-note,
.empty-copy {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.locked-note {
  margin: 22px 0 0;
  padding: 12px;
  border-radius: 11px;
  background: var(--panel-soft);
}

.billing-workspace {
  grid-template-columns: minmax(310px, 0.67fr) minmax(0, 1.6fr);
}

.billing-main {
  display: grid;
  gap: 14px;
}

.compact-list .ledger-row {
  min-height: 56px;
}

.charge-equation {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  margin: 26px 0 20px;
  padding: 20px 0;
  gap: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.charge-equation div {
  display: grid;
  gap: 8px;
}

.charge-equation span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.charge-equation strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.charge-equation .equation-mark {
  color: var(--muted-light);
  font-size: 18px;
  font-weight: 400;
}

.charge-equation .equation-total {
  padding: 13px;
  border-radius: 11px;
  background: var(--ink);
  color: #f8fbff;
}

.charge-equation .equation-total span {
  color: #c8d0da;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
  gap: 8px;
}

.text-action,
.table-link,
.text-button,
.file-list a {
  color: #174fbe;
  font-size: 10px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-action {
  display: inline-block;
  margin-top: 10px;
}

.table-link,
.text-button {
  padding: 4px 0;
  background: transparent;
}

.credit-form {
  display: grid;
  grid-template-columns: 0.55fr 1.3fr auto;
  align-items: end;
  margin-top: 18px;
  padding-top: 18px;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.tariff-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.tariff-table > div {
  display: grid;
  padding: 12px 10px;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}

.tariff-table span,
.tariff-table small {
  color: var(--muted);
  font-size: 9px;
}

.tariff-table strong {
  font-size: 11px;
}

.compact-form {
  margin-top: 16px;
}

.collections-workspace {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.75fr);
}

.data-table {
  min-width: 0;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.table-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(118px, 0.8fr) minmax(90px, 0.55fr) auto;
  align-items: center;
  min-width: 650px;
  min-height: 58px;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.table-row span strong,
.table-row span small {
  display: block;
}

.table-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.table-head {
  min-height: 38px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.reminder-form {
  margin-top: 24px;
}

.saved-drafts {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.draft-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.draft-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  text-align: left;
}

.draft-row:hover,
.draft-row.is-selected {
  border-color: #b9c8e6;
  background: var(--blue-soft);
}

.draft-row span:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.draft-row strong,
.draft-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-row small,
.draft-row > span:last-child {
  color: var(--muted);
  font-size: 9px;
}

.receipt-list {
  max-height: 820px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.table-scroll-hint {
  display: none;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.receipt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 60px;
  padding: 9px 0;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.receipt-row div:nth-child(2) {
  text-align: right;
}

.receipt-row strong,
.receipt-row small {
  display: block;
}

.receipt-row strong {
  font-size: 10px;
}

.receipt-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.receipt-row.is-reversed {
  opacity: 0.58;
}

.receipt-row.is-reversed strong {
  text-decoration: line-through;
}

.inline-correction {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 12px;
  gap: 9px;
  background: var(--panel-soft);
}

.portal-role-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 18px;
  gap: 20px;
  border-radius: 14px;
  background: var(--ink);
  color: #f8fbff;
}

.portal-role-strip > div {
  display: grid;
  gap: 4px;
}

.portal-role-strip strong {
  font-size: 12px;
}

.portal-role-strip span {
  color: #c8d0da;
  font-size: 9px;
}

.portal-role-strip label {
  display: grid;
  gap: 5px;
}

.portal-role-strip select {
  min-width: 270px;
  border-color: #49505a;
  background: #23272c;
  color: #f8fbff;
}

.portal-balance {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 180px;
  padding: 26px;
  border-radius: 16px;
  background: var(--blue);
  color: #f8fbff;
}

.portal-balance h2 {
  max-width: 16ch;
  margin: 0 0 8px;
  font-size: 38px;
  letter-spacing: -0.04em;
}

.portal-balance p,
.portal-balance span,
.portal-balance small {
  margin: 0;
  color: #f8fbff;
  font-size: 10px;
}

.portal-balance > div:last-child {
  display: grid;
  text-align: right;
}

.portal-balance > div:last-child strong {
  margin: 8px 0;
  font-size: 46px;
  font-weight: 500;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.portal-columns {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  margin: 14px 0;
  gap: 14px;
}

.document-list {
  border-top: 1px solid var(--line);
}

.document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 62px;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.document-row strong,
.document-row small {
  display: block;
}

.document-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.document-row > span {
  display: flex;
  gap: 9px;
}

.reading-bars {
  display: grid;
  gap: 18px;
}

.reading-bars > div {
  display: grid;
  grid-template-columns: 58px minmax(70px, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.reading-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf1;
}

.reading-bar i {
  display: block;
  width: var(--reading-width);
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.reading-bars strong {
  color: var(--ink);
  font-size: 10px;
}

.portal-support {
  margin-top: 0;
}

.service-workspace {
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
}

.room-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.room-switch span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.case-queue {
  border-top: 1px solid var(--line);
}

.case-ticket {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 10px;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.case-ticket:hover,
.case-ticket.is-selected {
  background: var(--blue-soft);
}

.case-ticket strong,
.case-ticket small {
  display: block;
}

.case-ticket strong {
  font-size: 11px;
}

.case-ticket small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.service-create {
  margin-top: 22px;
}

.case-meta {
  grid-template-columns: 1fr;
  margin: 20px 0;
}

.message-thread {
  display: grid;
  max-height: 310px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.message-thread article {
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

.message-thread strong,
.message-thread p,
.message-thread small {
  display: block;
  margin: 0;
}

.message-thread strong {
  font-size: 10px;
}

.message-thread p {
  margin: 6px 0;
  font-size: 11px;
  line-height: 1.5;
}

.message-thread small {
  color: var(--muted);
  font-size: 9px;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  margin: 14px 0;
  gap: 10px;
}

.note-composer {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.bi-workspace {
  display: grid;
  gap: 14px;
}

.reconciliation-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0;
  overflow: hidden;
}

.reconciliation-band > div {
  display: grid;
  min-height: 132px;
  align-content: center;
  padding: 20px;
  gap: 6px;
  border-right: 1px solid var(--line);
}

.reconciliation-band > div:last-child {
  border-right: 0;
}

.reconciliation-band span,
.reconciliation-band small {
  color: var(--muted);
  font-size: 9px;
}

.reconciliation-band strong {
  font-size: 28px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.bi-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 14px;
}

.region-bars {
  display: grid;
  gap: 18px;
}

.region-bars > div {
  display: grid;
  grid-template-columns: 110px minmax(120px, 1fr) 170px;
  align-items: center;
  gap: 14px;
  font-size: 10px;
}

.region-bars > div > strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dual-bar {
  display: grid;
  gap: 4px;
}

.dual-bar i,
.dual-bar b {
  display: block;
  width: var(--bar);
  height: 7px;
  border-radius: 999px;
}

.dual-bar i {
  background: var(--blue);
}

.dual-bar b {
  background: var(--green);
}

.chart-key {
  display: flex;
  margin-top: 18px;
  gap: 16px;
  color: var(--muted);
  font-size: 9px;
}

.chart-key span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-key i {
  width: 14px;
  height: 6px;
  border-radius: 999px;
}

.key-invoice {
  background: var(--blue);
}

.key-collected {
  background: var(--green);
}

.aging-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  height: 190px;
  gap: 10px;
}

.aging-columns > div {
  display: grid;
  height: 100%;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  text-align: center;
}

.aging-columns strong,
.aging-columns small {
  font-size: 9px;
}

.aging-columns small {
  color: var(--muted);
}

.aging-column {
  display: flex;
  align-items: end;
  overflow: hidden;
  border-radius: 8px 8px 2px 2px;
  background: var(--panel-soft);
}

.aging-column i {
  display: block;
  width: 100%;
  height: var(--aging-height);
  background: var(--pink);
}

.import-workbench form {
  display: grid;
  gap: 10px;
}

.import-workbench textarea {
  min-height: 116px;
  font-variant-numeric: tabular-nums;
}

.import-summary {
  display: flex;
  margin: 15px 0 8px;
  gap: 8px;
}

.import-summary > * {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  font-size: 9px;
}

.import-rows,
.event-list {
  border-top: 1px solid var(--line);
}

.import-rows > div,
.event-list > div {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr auto;
  align-items: center;
  min-height: 42px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}

.import-ready {
  color: #167344;
}

.import-duplicate,
.import-invalid {
  color: #9f3651;
}

.event-list span,
.event-list small {
  color: var(--muted);
}

.account-index .ledger-list,
.billing-rail .ledger-list,
.reading-timeline,
.charge-equation,
.tariff-table,
.data-table,
.receipt-list,
.document-list,
.case-queue,
.message-thread,
.import-rows,
.event-list {
  margin-inline: calc(var(--workspace-panel-inset) * -1);
}

.ledger-row,
.reading-timeline > div,
.charge-equation,
.tariff-table > div,
.table-row,
.receipt-row,
.document-row,
.case-ticket,
.message-thread article,
.import-rows > div,
.event-list > div {
  padding-inline: var(--workspace-panel-inset);
}

.empty-state.inline {
  min-height: 190px;
}

@media (max-width: 1100px) {
  .account-workspace,
  .billing-workspace,
  .collections-workspace,
  .service-workspace,
  .portal-columns,
  .bi-grid {
    grid-template-columns: 1fr;
  }

  .account-index,
  .billing-rail {
    max-height: 410px;
  }

  .identity-grid {
    grid-template-columns: 1fr 1fr;
  }

  .case-meta {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .workspace-shell {
    --workspace-panel-inset: 14px;
  }

  .workspace-header,
  .workspace-toolbar,
  .portal-role-strip,
  .portal-balance {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-toolbar > span {
    padding: 0;
    text-align: left;
  }

  .workspace-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .workspace-filters label:last-child:nth-child(3) {
    grid-column: 1 / -1;
  }

  .workspace-filters select,
  .portal-role-strip select {
    width: 100%;
    min-width: 0;
  }

  .form-grid.three,
  .form-grid.four,
  .credit-form,
  .tariff-table {
    grid-template-columns: 1fr;
  }

  .charge-equation {
    grid-template-columns: 1fr auto 1fr;
  }

  .charge-equation .equation-total {
    grid-column: 1 / -1;
  }

  .portal-balance > div:last-child {
    text-align: left;
  }

  .case-meta,
  .reconciliation-band {
    grid-template-columns: 1fr 1fr;
  }

  .case-meta {
    grid-template-columns: 1fr;
  }

  .table-scroll-hint {
    display: block;
  }

  .document-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-block: 9px;
  }

  .document-row > span {
    grid-column: 1 / -1;
  }

  .reconciliation-band > div:nth-child(2) {
    border-right: 0;
  }

  .reconciliation-band > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .region-bars > div {
    grid-template-columns: 90px 1fr;
  }

  .region-bars > div > strong {
    grid-column: 1 / -1;
    text-align: left;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .panel,
  .insight-panel {
    animation: panel-arrival 520ms var(--ease) both;
  }

  .top-grid > :nth-child(2) {
    animation-delay: 70ms;
  }

  .bottom-grid > :nth-child(1) {
    animation-delay: 120ms;
  }

  .bottom-grid > :nth-child(2) {
    animation-delay: 170ms;
  }

  .bottom-grid > :nth-child(3) {
    animation-delay: 220ms;
  }

  .case-panel:not([hidden]) {
    animation: panel-in 320ms var(--ease) both;
  }
}

@keyframes panel-arrival {
  from {
    clip-path: inset(0 0 12% 0 round var(--radius));
    filter: blur(5px);
    opacity: 0.68;
  }
  to {
    clip-path: inset(0 round var(--radius));
    filter: blur(0);
    opacity: 1;
  }
}

@keyframes panel-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@media (max-width: 1180px) {
  .overview-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    width: 100%;
  }

  .filters label {
    flex: 1 1 0;
  }

  .filters select {
    width: 100%;
    min-width: 0;
  }

  .bottom-grid {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .insight-panel {
    grid-column: 1 / -1;
    min-height: 260px;
  }
}

@media (max-width: 900px) {
  .topbar {
    gap: 20px;
  }

  .topbar-meta .demo-flag {
    display: none;
  }

  .top-grid {
    grid-template-columns: 1fr;
  }

  .bottom-grid {
    grid-template-columns: 1fr 1fr;
  }

  .receivables-panel {
    min-height: 300px;
  }

  .insight-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 68px;
    padding: 10px 14px;
    gap: 14px;
  }

  .wordmark {
    font-size: 18px;
  }

  .wordmark-mark {
    width: 24px;
    height: 24px;
    border-width: 2px;
  }

  .topbar-meta {
    display: none;
  }

  .nav-item {
    min-height: 44px;
    padding: 0 12px;
    font-size: 11px;
  }

  .dashboard-shell {
    padding: 22px 12px 34px;
  }

  .overview-header {
    min-height: 0;
    margin-bottom: 18px;
  }

  h1 {
    font-size: 46px;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .filters label:nth-child(3) {
    grid-column: 1 / -1;
  }

  .filters select,
  .reset-button {
    width: 100%;
  }

  .funnel-panel,
  .revenue-panel,
  .receivables-panel,
  .mini-panel {
    padding: 16px;
  }

  .funnel-panel .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .payment-button {
    width: 100%;
  }

  .payment-button,
  .submit-payment,
  .insight-action,
  .reset-button,
  .close-panel,
  .dialog-close,
  .secondary-button,
  .back-button,
  .filters select,
  .field select,
  .field input {
    min-height: 44px;
  }

  .funnel-scroll-hint {
    display: block;
    margin: 13px 0 -5px;
  }

  .funnel-chart {
    grid-template-columns: repeat(5, minmax(116px, 1fr));
    height: 250px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .funnel-stage {
    scroll-snap-align: start;
  }

  .dot-plot {
    grid-template-columns: repeat(10, 24px);
    gap: 4px;
  }

  .draft-list {
    grid-template-columns: 1fr;
  }

  .receipt-row small,
  .table-row small,
  .case-ticket small,
  .draft-row small,
  .draft-row > span:last-child {
    font-size: 10px;
  }

  .stage-tooltip {
    display: none;
  }

  .analysis-strip {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .insight-panel {
    grid-column: auto;
    min-height: 320px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .payment-dialog form {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar {
    background: var(--canvas);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .panel-scrim,
  .payment-dialog::backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
