:root {
  --bg: #070b10;
  --panel: #111821;
  --panel-soft: #0c121a;
  --text: #eef4fb;
  --muted: #95a5b8;
  --line: #253343;
  --ink: #f8fafc;
  --red: #ff6078;
  --teal: #2dd4bf;
  --green: #42d37c;
  --amber: #f0b84f;
  --blue: #7aa7ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: dark;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  margin: 0;
  background: linear-gradient(180deg, #0b1118 0%, var(--bg) 360px);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

.icon-defs {
  display: none;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.mobile-nav-toggle,
.mobile-nav-backdrop {
  display: none;
}

.public-login-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.public-login-shell .login-card h1 {
  margin: 0 0 18px;
  font-size: 24px;
  letter-spacing: 0;
}

body.auth-mode .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.auth-mode .sidebar,
body.auth-mode .topbar .top-actions {
  display: none;
}

body.auth-mode .main {
  min-height: 100vh;
}

body.auth-mode .topbar {
  border-bottom: 0;
  justify-content: center;
  text-align: center;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 110px);
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(100%, 430px);
  border: 1px solid rgba(149, 165, 184, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #121b26 0%, #0b1118 100%);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-size: 22px;
}

.login-brand span,
.session-user {
  color: var(--muted);
  font-size: 12px;
}

.session-user {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(149, 165, 184, 0.16);
  border-radius: var(--radius);
  background: rgba(149, 165, 184, 0.08);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-submit {
  min-height: 44px;
  justify-content: center;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.form-alert {
  border: 1px solid rgba(122, 167, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(122, 167, 255, 0.08);
  color: #dbe8ff;
  padding: 10px 12px;
  font-size: 13px;
}

.form-alert.red {
  border-color: rgba(255, 96, 120, 0.34);
  background: rgba(255, 96, 120, 0.09);
  color: #ffd9df;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background: #090f16;
  color: var(--text);
  border-right: 1px solid #182230;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 10px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 96, 120, 0.42);
  border-radius: var(--radius);
  background: #171f2a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #cdd7e4;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  background: #17212d;
  color: #ffffff;
  border-color: rgba(149, 165, 184, 0.2);
}

.nav-button.active {
  box-shadow: inset 3px 0 0 var(--red);
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid rgba(149, 165, 184, 0.16);
  border-radius: var(--radius);
  background: #0d141d;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  text-transform: uppercase;
}

.nav-group-toggle:hover,
.nav-group-toggle.active {
  color: var(--text);
  border-color: rgba(122, 167, 255, 0.3);
  background: #121b26;
}

.nav-group-mark {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  background: rgba(149, 165, 184, 0.1);
  color: var(--text);
}

.nav-group-items {
  display: grid;
  gap: 5px;
  padding-left: 8px;
  border-left: 1px solid rgba(149, 165, 184, 0.14);
}

.nav-group.collapsed .nav-group-items,
.nav-group-items[hidden] {
  display: none !important;
}

.nav-group-items .nav-button {
  min-height: 38px;
  padding-block: 8px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px;
  border: 1px solid rgba(149, 165, 184, 0.18);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
}

.sidebar-footer strong,
.sidebar-footer span {
  display: block;
}

.sidebar-footer strong {
  margin-top: 4px;
  color: var(--text);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 16px 28px;
  background: rgba(7, 11, 16, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.title-block span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.title-block h1 {
  margin: 2px 0 0;
  font-size: 26px;
  line-height: 1.15;
}

.top-actions,
.toolbar,
.row-actions,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d141d;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sync-status small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(149, 165, 184, 0.12);
}

.sync-status.green .sync-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(66, 211, 124, 0.14);
}

.sync-status.blue .sync-dot {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(122, 167, 255, 0.14);
}

.sync-status.amber .sync-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(240, 184, 79, 0.14);
}

.sync-status.red .sync-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 96, 120, 0.14);
}

.row-actions .button {
  min-height: 32px;
  padding: 6px 9px;
}

.view {
  display: grid;
  gap: 18px;
  padding: 22px 28px 36px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.button {
  gap: 8px;
  padding: 8px 12px;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: #405064;
}

.button.primary {
  border-color: #d63b54;
  background: #d63b54;
  color: #ffffff;
}

.button.danger {
  border-color: rgba(255, 96, 120, 0.36);
  color: var(--red);
}

.button.ghost {
  background: transparent;
}

.icon-label span {
  line-height: 1;
}

.view-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: 1 / -1;
}

.panel,
.kpi-card,
.account-card,
.scenario-card,
.task-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  min-width: 0;
  overflow: hidden;
}

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

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 17px;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-body {
  padding: 16px 18px;
}

.liquidity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.liquidity-grid .panel-body + .panel-body {
  border-left: 1px solid var(--line);
}

.liquidity-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.kpi-grid.dashboard-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.quick-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr);
  align-items: end;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(122, 167, 255, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(122, 167, 255, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    #0b121a;
  box-shadow: var(--shadow);
}

.quick-hero h2 {
  margin: 10px 0 6px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.quick-hero p {
  max-width: 680px;
  margin: 0;
  color: #c4d0de;
}

.quick-sync-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(149, 165, 184, 0.18);
  border-radius: var(--radius);
  background: rgba(12, 18, 26, 0.86);
}

.quick-sync-card strong,
.quick-sync-card small {
  overflow-wrap: anywhere;
}

.quick-sync-card strong {
  font-size: 16px;
}

.quick-sync-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quick-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-metric {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.quick-metric span,
.quick-metric small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-metric strong {
  overflow-wrap: anywhere;
  font-size: clamp(20px, 2.3vw, 28px);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.quick-metric.green strong {
  color: var(--green);
}

.quick-metric.blue strong {
  color: var(--blue);
}

.quick-metric.amber strong {
  color: var(--amber);
}

.quick-metric.red strong {
  color: var(--red);
}

.quick-action-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 11, 16, 0.92);
  backdrop-filter: blur(10px);
  -webkit-overflow-scrolling: touch;
}

.quick-action-bar .button {
  flex: 0 0 auto;
  min-height: 42px;
}

.quick-load-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.quick-panel {
  scroll-margin-top: 96px;
}

.quick-panel .panel-header {
  min-height: 82px;
}

.quick-form .field input,
.quick-form .field select {
  min-height: 44px;
  font-size: 16px;
}

.quick-form .button {
  min-height: 46px;
}

.quick-feed-panel {
  grid-column: 1 / -1;
}

.quick-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-feed-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(149, 165, 184, 0.16);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.quick-feed-row div {
  display: grid;
  gap: 2px;
}

.quick-feed-row strong {
  font-size: 13px;
}

.quick-feed-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.quick-feed-row p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #d9e4ef;
  font-size: 13px;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.scenario-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.scenario-summary-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(149, 165, 184, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.08), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    var(--panel);
  box-shadow: var(--shadow);
}

.scenario-summary-card::before {
  width: 38px;
  height: 3px;
  content: "";
  border-radius: 999px;
  background: var(--blue);
}

.scenario-summary-teal::before {
  background: var(--teal);
}

.scenario-summary-amber::before {
  background: var(--amber);
}

.scenario-summary-green::before {
  background: var(--green);
}

.scenario-summary-red::before {
  background: var(--red);
}

.scenario-summary-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(14px, 1.25vw, 20px);
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
}

.scenario-summary-card small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.beta-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.beta-ops-grid .split-row strong {
  max-width: 68%;
  overflow-wrap: anywhere;
}

.dashboard-metric-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(149, 165, 184, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(122, 167, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    var(--panel);
  box-shadow: var(--shadow);
}

.dashboard-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-metric-value {
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: clamp(21px, 1.8vw, 28px);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.dashboard-metric-lines {
  display: grid;
  gap: 7px;
}

.dashboard-metric-lines div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-top: 7px;
  border-top: 1px solid rgba(149, 165, 184, 0.13);
}

.dashboard-metric-lines span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-metric-lines b {
  overflow-wrap: normal;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.commission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.commission-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(149, 165, 184, 0.18);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.commission-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.commission-card strong {
  color: var(--amber);
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1;
}

.commission-card b {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.commission-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.kpi-card {
  display: grid;
  gap: 12px;
  min-height: 132px;
  padding: 16px;
  overflow: hidden;
}

.dashboard-kpi-grid .kpi-card {
  min-height: 128px;
  padding: 14px;
}

.dashboard-kpi-grid .operating-card {
  grid-column: span 2;
  gap: 10px;
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.kpi-value {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(20px, 1.7vw, 26px);
  font-weight: 850;
  line-height: 1.1;
}

.dashboard-kpi-grid .kpi-value {
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: clamp(13px, 1vw, 18px);
  letter-spacing: 0;
}

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

.operating-grid div {
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.operating-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.operating-grid strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: clamp(11px, 0.95vw, 14px);
  line-height: 1.1;
}

.kpi-meta {
  color: var(--muted);
  font-size: 13px;
}

.tone-red {
  color: var(--red);
}

.tone-teal {
  color: var(--teal);
}

.tone-green {
  color: var(--green);
}

.tone-amber {
  color: var(--amber);
}

.tone-blue {
  color: var(--blue);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.recovery-panel {
  display: grid;
  gap: 12px;
}

.recovery-generation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.recovery-generation div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.recovery-generation span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.recovery-generation strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: clamp(13px, 1vw, 15px);
  line-height: 1.12;
}

.stat {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: clamp(15px, 1.35vw, 17px);
  line-height: 1.18;
}

.recovery-strip .stat strong {
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: clamp(13px, 1vw, 15px);
}

.financial-section {
  display: grid;
  gap: 16px;
}

.financial-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(240, 184, 79, 0.26);
  border-radius: var(--radius);
  background: rgba(240, 184, 79, 0.08);
}

.financial-alert strong {
  flex: 0 0 auto;
  color: var(--amber);
}

.financial-alert span {
  min-width: 0;
  color: #d9e2ec;
}

.financial-alert.success {
  border-color: rgba(66, 211, 124, 0.26);
  background: rgba(66, 211, 124, 0.08);
}

.financial-alert.success strong {
  color: var(--green);
}

.financial-alert.warning {
  border-color: rgba(240, 184, 79, 0.26);
  background: rgba(240, 184, 79, 0.08);
}

.financial-metric-group {
  display: grid;
  gap: 10px;
}

.financial-metric-group h3 {
  margin: 0;
  color: #cbd7e4;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.financial-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.financial-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 150px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), var(--panel-soft);
}

.financial-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.financial-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(16px, 1.35vw, 21px);
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.financial-card p {
  margin: 0;
  color: #aebbc9;
  font-size: 12px;
  line-height: 1.35;
}

.stock-coverage-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(122, 167, 255, 0.22);
  border-radius: var(--radius);
  background: #0c131c;
}

.stock-coverage-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.stock-coverage-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.stock-coverage-header p,
.stock-coverage-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.stock-coverage-details {
  background: #101821;
}

.stock-step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.stock-step {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(149, 165, 184, 0.18);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.stock-step h4 {
  margin: 0;
  color: #dce6f2;
  font-size: 13px;
}

.stock-step div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.stock-step span,
.stock-step p {
  color: var(--muted);
  font-size: 12px;
}

.stock-step strong {
  overflow-wrap: anywhere;
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.stock-step p {
  margin: 2px 0 0;
}

.formula-details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c131c;
}

.formula-details summary {
  padding: 12px 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.formula-row {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(149, 165, 184, 0.18);
  border-radius: var(--radius);
  background: #101821;
}

.formula-row span {
  display: block;
  color: #dce6f2;
  font-size: 12px;
  font-weight: 850;
}

.formula-row p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 12px;
}

.formula-row strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.formula-diagnostics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.formula-diagnostics span {
  padding: 5px 8px;
  border: 1px solid rgba(149, 165, 184, 0.2);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table-wrap::-webkit-scrollbar {
  height: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #415166;
}

.real-map-shell {
  overflow: hidden;
  border: 1px solid rgba(122, 167, 255, 0.18);
  border-radius: 18px;
  background: #080d13;
}

.real-map {
  position: relative;
  overflow: hidden;
  min-width: 760px;
  background: #101820;
  cursor: grab;
  touch-action: none;
}

.real-map.dragging {
  cursor: grabbing;
}

.real-map-plane {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.point-sale-row {
  cursor: pointer;
}

.point-sale-row.selected td {
  background: rgba(122, 167, 255, 0.09);
}

.real-map::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 0 0 1px rgba(229, 239, 255, 0.08), inset 0 0 80px rgba(7, 11, 16, 0.18);
}

.real-map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
  filter: saturate(0.92) contrast(0.98) brightness(0.88);
}

.real-map-locality-highlight {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(46, 204, 113, 0.32);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(46, 204, 113, 0.18), rgba(46, 204, 113, 0.04) 62%, transparent 70%);
  color: #dfffea;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  opacity: 0.92;
}

.real-map-locality-highlight span {
  max-width: 110px;
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(7, 11, 16, 0.64);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.real-map-locality-highlight.active {
  z-index: 2;
  border-color: rgba(122, 167, 255, 0.72);
  background: radial-gradient(circle, rgba(122, 167, 255, 0.24), rgba(122, 167, 255, 0.07) 62%, transparent 72%);
  color: #f8fbff;
}

.real-map-marker {
  position: absolute;
  z-index: 5;
  display: grid;
  width: var(--marker-size);
  height: var(--marker-size);
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.real-map-marker-dot {
  width: 100%;
  height: 100%;
  border: 3px solid #f7fff9;
  border-radius: 999px;
  background: #2ecc71;
  box-shadow: 0 0 0 8px rgba(46, 204, 113, 0.18), 0 10px 22px rgba(7, 11, 16, 0.38);
}

.real-map-marker:hover .real-map-marker-dot,
.real-map-marker:focus .real-map-marker-dot,
.real-map-marker.selected .real-map-marker-dot {
  background: #7aa7ff;
  box-shadow: 0 0 0 10px rgba(122, 167, 255, 0.22), 0 12px 24px rgba(7, 11, 16, 0.44);
}

.real-map-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 4;
  width: max-content;
  max-width: 240px;
  padding: 7px 9px;
  border: 1px solid rgba(229, 239, 255, 0.16);
  border-radius: 10px;
  background: rgba(7, 11, 16, 0.9);
  box-shadow: 0 16px 32px rgba(7, 11, 16, 0.34);
  color: #f8fbff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.real-map-marker:hover .real-map-tooltip,
.real-map-marker:focus .real-map-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.real-map-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(229, 239, 255, 0.15);
  border-radius: 999px;
  background: rgba(7, 11, 16, 0.82);
  box-shadow: 0 14px 28px rgba(7, 11, 16, 0.24);
}

.real-map-control,
.real-map-reset {
  display: inline-grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(229, 239, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fbff;
  cursor: pointer;
  font-weight: 850;
}

.real-map-control .icon {
  width: 16px;
  height: 16px;
}

.real-map-reset {
  padding: 0 10px;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.real-map-control:hover,
.real-map-reset:hover {
  border-color: rgba(122, 167, 255, 0.38);
  background: rgba(122, 167, 255, 0.18);
}

.real-map-locality-card {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: min(280px, calc(100% - 220px));
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(229, 239, 255, 0.15);
  border-radius: 14px;
  background: rgba(7, 11, 16, 0.84);
  box-shadow: 0 16px 32px rgba(7, 11, 16, 0.28);
  color: #f8fbff;
}

.real-map-locality-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.real-map-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.real-map-card-head strong {
  margin: 0;
}

.real-map-card-head button {
  border: 1px solid rgba(229, 239, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dce8f8;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.real-map-address {
  margin: -2px 0 8px;
  color: #aebdce;
  font-size: 11px;
  line-height: 1.35;
}

.real-map-selected-detail {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
  color: #cfd9e7;
  font-size: 12px;
}

.real-map-selected-detail b {
  color: #8ff0b4;
}

.real-map-locality-list {
  display: grid;
  gap: 6px;
}

.real-map-link-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.real-map-point-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.real-map-point-copy small {
  min-width: 0;
  overflow: hidden;
  color: #8d9bae;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.real-map-link-row:hover,
.real-map-link-row.active {
  border-color: rgba(122, 167, 255, 0.24);
  background: rgba(122, 167, 255, 0.14);
}

.real-map-link-row em {
  min-width: 0;
  overflow: hidden;
  color: #cfd9e7;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.real-map-link-row b {
  color: #8ff0b4;
  white-space: nowrap;
}

.real-map-badge,
.real-map-attribution {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(229, 239, 255, 0.15);
  border-radius: 999px;
  background: rgba(7, 11, 16, 0.78);
  color: #dce8f8;
  font-size: 11px;
  font-weight: 800;
}

.real-map-badge {
  left: 12px;
  bottom: 12px;
  padding: 7px 9px;
}

.real-map-attribution {
  right: 12px;
  bottom: 12px;
  padding: 6px 8px;
  text-decoration: none;
}

@media (max-width: 760px) {
  .real-map-locality-card {
    top: auto;
    right: 12px;
    bottom: 52px;
    left: 12px;
    width: auto;
    max-height: 160px;
  }

  .real-map-controls {
    top: 10px;
    left: 10px;
  }
}

.pnl-table-wrap {
  overflow: visible;
  padding: 6px 16px 16px;
}

.pnl-table {
  min-width: 0;
  table-layout: fixed;
}

.pnl-table col:nth-child(1) {
  width: 58%;
}

.pnl-table col:nth-child(2) {
  width: 42%;
}

.pnl-table th {
  background: transparent;
}

.pnl-table td {
  padding: 11px 0;
}

.dashboard-commission-wrap {
  padding: 4px 16px 16px;
}

.dashboard-commission-table {
  min-width: 1380px;
}

.dashboard-commission-table th,
.dashboard-commission-table td {
  padding: 10px 8px;
}

.dashboard-commission-table tfoot td {
  border-top: 1px solid rgba(149, 165, 184, 0.32);
  border-bottom: 0;
  background: rgba(45, 212, 191, 0.06);
}

.dashboard-commission-table .muted {
  margin-top: 3px;
  font-size: 11px;
}

.dashboard-channel-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-channel-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(149, 165, 184, 0.17);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(122, 167, 255, 0.08), transparent 52%),
    var(--panel-soft);
}

.dashboard-channel-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-channel-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(18px, 1.45vw, 23px);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.dashboard-channel-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-channel-wrap {
  padding: 0;
}

.dashboard-channel-table,
.dashboard-stale-pos-table,
.price-history-table {
  min-width: 860px;
}

.dashboard-channel-group-row th {
  background: rgba(122, 167, 255, 0.08);
  color: var(--text);
  text-align: center;
}

.dashboard-channel-table tfoot td {
  border-top: 1px solid rgba(149, 165, 184, 0.32);
  background: rgba(45, 212, 191, 0.06);
}

.price-bulk-editor {
  min-width: 0;
}

.price-bulk-wrap {
  width: 100%;
}

.price-bulk-table {
  min-width: 900px;
}

.table-input {
  width: min(150px, 100%);
  min-height: 36px;
  padding: 8px 9px;
  border: 1px solid rgba(149, 165, 184, 0.22);
  border-radius: var(--radius);
  background: #0a1119;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.table-input.num {
  text-align: right;
}

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

.pnl-divider td {
  border-top: 1px solid var(--line);
}

.pnl-child-row .pnl-label {
  padding-left: 14px;
  color: var(--muted);
  font-size: 13px;
}

.pnl-child-row .pnl-label::before {
  content: "";
  width: 6px;
  height: 1px;
  margin-right: 7px;
  background: var(--muted);
}

.pnl-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 850;
  text-align: left;
}

.pnl-toggle-button:hover {
  color: #ffffff;
}

.pnl-toggle-mark {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.pnl-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.pnl-value {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 0;
}

.pnl-value > span:first-child {
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: 14px;
}

.pnl-bar {
  display: block;
  width: min(132px, 100%);
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #202c3a;
}

.pnl-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.source-toolbar {
  align-items: flex-end;
}

.source-select {
  width: min(260px, 100%);
}

.source-table table {
  min-width: 920px;
}

.source-table td {
  max-width: 260px;
  overflow-wrap: anywhere;
}

.wide-table table {
  min-width: 1320px;
}

.date-stack {
  display: grid;
  gap: 3px;
  min-width: 88px;
  font-variant-numeric: tabular-nums;
}

.date-stack span {
  white-space: nowrap;
}

.date-stack small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.journal-table table {
  min-width: 980px;
}

.stock-mini-table {
  min-width: 0;
  table-layout: fixed;
}

.stock-mini-table col:nth-child(1) {
  width: 42%;
}

.stock-mini-table col:nth-child(2),
.stock-mini-table col:nth-child(3) {
  width: 20%;
}

.stock-mini-table col:nth-child(4) {
  width: 18%;
}

.stock-mini-table th,
.stock-mini-table td {
  padding-inline: 8px;
}

.cmv-table table {
  min-width: 1800px;
}

.line-stack {
  display: grid;
  gap: 7px;
}

.line-stack div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.line-stack span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table {
  width: 100%;
  min-width: 920px;
  table-layout: auto;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
}

th {
  background: #151e28;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

.client-row td:first-child {
  box-shadow: inset 4px 0 0 var(--green);
}

.client-row-debt td:first-child {
  box-shadow: inset 4px 0 0 var(--amber);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.strong {
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.icon-pill {
  gap: 5px;
}

.icon-pill .icon {
  width: 13px;
  height: 13px;
}

.pill.green {
  background: rgba(66, 211, 124, 0.14);
  color: #8cf2b1;
}

.pill.red {
  background: rgba(255, 96, 120, 0.14);
  color: #ff9aaa;
}

.pill.amber {
  background: rgba(240, 184, 79, 0.15);
  color: #ffd384;
}

.pill.blue {
  background: rgba(122, 167, 255, 0.15);
  color: #b7ccff;
}

.pill.teal {
  background: rgba(45, 212, 191, 0.14);
  color: #8df0e6;
}

.pill.gray {
  background: rgba(149, 165, 184, 0.13);
  color: #c4ceda;
}

.method-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 8px;
}

.method-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c131c;
  color: var(--text);
  font-size: 13px;
}

.method-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.method-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 190px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.collection-split-editor {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(149, 165, 184, 0.18);
  border-radius: var(--radius);
  background: rgba(15, 23, 32, 0.72);
}

.collection-split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.collection-split-head label {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.collection-split-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.collection-split-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(140px, 1fr) minmax(160px, 1.15fr) minmax(120px, 0.85fr) minmax(92px, 0.65fr) 38px;
  align-items: end;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(149, 165, 184, 0.14);
  border-radius: var(--radius);
  background: rgba(10, 16, 23, 0.78);
}

.collection-split-row .field {
  gap: 4px;
}

.collection-split-remove {
  width: 38px;
  min-width: 38px;
  height: 38px;
}

.sale-collect-now-fields {
  min-width: 0;
}

.debt-open-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.debt-open-actions strong {
  overflow-wrap: anywhere;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

[hidden] {
  display: none !important;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b1118;
  color: var(--text);
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.typeahead-shell {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b1118;
}

.typeahead-shell:focus-within {
  outline: 2px solid rgba(122, 167, 255, 0.22);
  border-color: var(--blue);
}

.typeahead-shell input {
  position: relative;
  z-index: 2;
  border: 0;
  background: transparent;
  outline: 0;
}

.field .typeahead-shell input:focus {
  border-color: transparent;
  outline: 0;
}

.typeahead-ghost {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
  color: rgba(149, 165, 184, 0.58);
  font: inherit;
  line-height: normal;
  pointer-events: none;
  white-space: nowrap;
}

.typeahead-prefix {
  color: transparent;
}

.purchase-items-field {
  gap: 8px;
}

.purchase-items-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.42);
}

.purchase-items-table {
  min-width: 1040px;
  table-layout: fixed;
}

.purchase-items-table th,
.purchase-items-table td {
  padding: 8px;
}

.purchase-items-table th:nth-child(1) {
  width: 130px;
}

.purchase-items-table th:nth-child(2) {
  width: 240px;
}

.purchase-items-table th:nth-child(3) {
  width: 150px;
}

.purchase-items-table th:nth-child(4),
.purchase-items-table th:nth-child(5),
.purchase-items-table th:nth-child(6),
.purchase-items-table th:nth-child(7) {
  width: 130px;
}

.purchase-items-table th:nth-child(8) {
  width: 54px;
}

.purchase-items-table input {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b1118;
  color: var(--text);
}

.purchase-items-table .num-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.purchase-schedule-field {
  gap: 8px;
}

.purchase-schedule-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.42);
}

.purchase-schedule-table {
  min-width: 620px;
  table-layout: fixed;
}

.purchase-schedule-table th,
.purchase-schedule-table td {
  padding: 8px;
}

.purchase-schedule-table th:nth-child(1) {
  width: 76px;
}

.purchase-schedule-table th:nth-child(2) {
  width: 150px;
}

.purchase-schedule-table th:nth-child(3),
.purchase-schedule-table th:nth-child(4) {
  width: 190px;
}

.purchase-schedule-table input {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b1118;
  color: var(--text);
}

.purchase-schedule-table .num-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.field select[multiple] {
  min-height: 132px;
  padding: 6px;
}

.shipping-sale-field {
  align-self: stretch;
  padding: 14px;
  border: 1px solid rgba(54, 72, 93, 0.84);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, rgba(15, 23, 35, 0.88), rgba(9, 14, 21, 0.76));
}

.shipping-sale-picker {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.shipping-sale-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.shipping-sale-picker-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shipping-sale-picker-head strong {
  color: var(--text);
  font-size: 14px;
}

.shipping-sale-picker-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shipping-sale-clear {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 10px;
}

.shipping-sale-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(36, 50, 66, 0.78);
  border-radius: var(--radius);
  background: rgba(6, 10, 16, 0.55);
}

.shipping-sale-filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.shipping-sale-filters span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.shipping-sale-filters input {
  min-height: 36px;
  padding: 8px 9px;
}

.shipping-sale-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 2px;
}

.shipping-sale-meta [data-shipping-sale-count] {
  color: var(--text);
}

.shipping-sale-list {
  display: grid;
  max-height: 310px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 11, 16, 0.58);
}

.shipping-sale-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) minmax(220px, auto);
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(36, 50, 66, 0.7);
  cursor: pointer;
}

.shipping-sale-option[hidden],
.shipping-sale-option.is-hidden,
.shipping-sale-empty[hidden] {
  display: none;
}

.shipping-sale-option:last-child {
  border-bottom: 0;
}

.shipping-sale-option:hover {
  background: rgba(122, 167, 255, 0.08);
}

.shipping-sale-option input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin-top: 2px;
  accent-color: var(--green);
}

.shipping-sale-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shipping-sale-copy strong,
.shipping-sale-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipping-sale-copy small,
.shipping-sale-empty {
  color: var(--muted);
  font-size: 11px;
}

.shipping-sale-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.shipping-sale-facts span {
  padding: 4px 7px;
  border: 1px solid rgba(54, 72, 93, 0.82);
  border-radius: 999px;
  background: rgba(13, 20, 29, 0.9);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.shipping-sale-empty {
  padding: 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(122, 167, 255, 0.22);
  border-color: var(--blue);
}

.field-2 {
  grid-column: span 2;
}

.field-3 {
  grid-column: span 3;
}

.field-4 {
  grid-column: span 4;
}

.field-5 {
  grid-column: span 5;
}

.field-6 {
  grid-column: span 6;
}

.field-8 {
  grid-column: span 8;
}

.field-12 {
  grid-column: 1 / -1;
}

.form-actions {
  align-self: end;
  grid-column: span 2;
}

.form-actions .button {
  width: 100%;
}

.compact-select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b1118;
  color: var(--text);
}

.compact-input {
  width: min(260px, 100%);
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b1118;
  color: var(--text);
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(130px, 2fr) minmax(86px, auto);
  align-items: center;
  gap: 12px;
}

.bar-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bar-label span {
  color: var(--muted);
  font-size: 12px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #202c3a;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
}

.tone-bg-red {
  background: linear-gradient(90deg, #ff6078, #ff8a9b);
}

.tone-bg-teal {
  background: linear-gradient(90deg, #2dd4bf, #7de8da);
}

.tone-bg-green {
  background: linear-gradient(90deg, #42d37c, #8ff0b0);
}

.tone-bg-amber {
  background: linear-gradient(90deg, #f0b84f, #ffd384);
}

.tone-bg-blue {
  background: linear-gradient(90deg, #7aa7ff, #b7ccff);
}

.stock-meter {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.meter-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #202c3a;
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.meter-fill.low {
  background: var(--red);
}

.account-grid,
.task-grid,
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.account-card,
.scenario-card,
.task-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  box-shadow: none;
}

.account-head,
.task-head,
.scenario-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-card strong,
.scenario-card strong,
.task-card strong {
  font-size: 16px;
}

.scenario-card .account-head {
  align-items: start;
}

.scenario-card .account-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.scenario-card .icon-button,
.scenario-comparison-table .icon-button {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
}

.scenario-card .stat-strip {
  gap: 8px;
}

.scenario-card .stat {
  padding: 9px 8px;
}

.scenario-card .stat span {
  font-size: 11px;
}

.scenario-card .stat strong {
  overflow-wrap: anywhere;
  font-size: clamp(11px, 0.92vw, 13px);
  font-variant-numeric: tabular-nums;
  line-height: 1.14;
}

.scenario-card-foot {
  min-width: 0;
}

.scenario-card-foot .muted {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.account-balance {
  font-size: 22px;
  font-weight: 850;
}

.split-list {
  display: grid;
  gap: 10px;
}

.split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.split-row > * {
  min-width: 0;
}

.split-row strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.split-row > strong {
  flex: 0 0 auto;
  max-width: 48%;
  overflow-wrap: normal;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.split-row:last-child {
  border-bottom: 0;
}

.dashboard-debt-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-debt-summary-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(149, 165, 184, 0.16);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.dashboard-debt-summary-grid span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.dashboard-debt-summary-grid strong {
  color: var(--text);
  font-size: clamp(12px, 1vw, 15px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.dashboard-due-date-list {
  gap: 0;
}

.dashboard-due-date-row {
  align-items: flex-start;
}

.dashboard-due-date-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dashboard-due-date-title strong {
  text-align: left;
}

.dashboard-due-date-amount {
  display: grid;
  justify-items: end;
  gap: 2px;
  flex: 0 0 auto;
  max-width: 42%;
  min-width: 118px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dashboard-due-date-amount strong {
  white-space: nowrap;
  overflow-wrap: normal;
}

.dashboard-due-date-amount span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dashboard-debt-more {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}

.cash-donut-layout {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 16px;
}

.cash-donut {
  position: relative;
  width: min(190px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.cash-donut::after {
  position: absolute;
  inset: 22%;
  content: "";
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.cash-donut div {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  text-align: center;
}

.cash-donut span,
.unit-hero span,
.waterfall-label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cash-donut strong {
  max-width: 110px;
  overflow-wrap: anywhere;
  font-size: clamp(14px, 1.5vw, 18px);
}

.cash-legend .split-row {
  padding: 8px 0;
}

.cash-legend .split-row > strong {
  max-width: none;
  font-size: 14px;
}

.cash-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: 1px;
}

.pie-chart {
  display: grid;
  grid-template-columns: minmax(150px, 0.75fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 18px;
}

.pie-visual {
  position: relative;
  width: min(210px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 18px 50px rgba(0, 0, 0, 0.22);
}

.pie-visual::after {
  position: absolute;
  inset: 23%;
  content: "";
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.pie-visual div {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  max-width: 112px;
  text-align: center;
}

.pie-visual span,
.pie-legend small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pie-visual strong {
  overflow-wrap: normal;
  font-size: clamp(13px, 1.2vw, 17px);
  line-height: 1.12;
}

.pie-legend {
  display: grid;
  gap: 9px;
}

.pie-legend-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.pie-legend-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.pie-legend-row div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.pie-legend-row b {
  white-space: nowrap;
  font-size: 13px;
}

.income-mix-layout {
  display: grid;
  gap: 16px;
}

.compact-table-wrap {
  padding: 0;
}

.income-mix-table {
  min-width: 820px;
}

.income-mix-table th,
.income-mix-table td {
  padding: 9px 8px;
}

.income-mix-table tfoot td,
.dashboard-samples-table tfoot td {
  border-top: 1px solid rgba(149, 165, 184, 0.32);
  background: rgba(122, 167, 255, 0.06);
}

.commercial-insight-grid,
.sample-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sample-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
}

.commercial-insight-card,
.sample-metric-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(149, 165, 184, 0.17);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.07), transparent 48%),
    var(--panel-soft);
}

.commercial-insight-card span,
.sample-metric-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.commercial-insight-card strong,
.sample-metric-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(19px, 1.6vw, 25px);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.commercial-insight-card p,
.sample-metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-samples-wrap {
  padding: 0;
}

.dashboard-samples-table {
  min-width: 980px;
}

.availability-list {
  display: grid;
  gap: 10px;
}

.availability-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(149, 165, 184, 0.16);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.availability-row.positive {
  box-shadow: inset 3px 0 0 rgba(66, 211, 124, 0.7);
}

.availability-row.negative {
  box-shadow: inset 3px 0 0 rgba(255, 96, 120, 0.7);
}

.availability-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.availability-row strong {
  color: var(--text);
  font-size: 13px;
}

.availability-row span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.availability-row b {
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: clamp(12px, 1vw, 15px);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.commercial-dollar-estimate {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: var(--radius);
  background: rgba(18, 29, 43, 0.78);
}

.commercial-dollar-estimate-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.commercial-dollar-estimate-head > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.commercial-dollar-estimate strong {
  color: var(--text);
  font-size: 12px;
}

.commercial-dollar-estimate span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.commercial-dollar-estimate-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.commercial-dollar-estimate-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(149, 165, 184, 0.14);
  border-radius: 10px;
  background: rgba(8, 13, 20, 0.42);
}

.commercial-dollar-estimate-grid strong {
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: clamp(12px, 1vw, 14px);
  font-variant-numeric: tabular-nums;
}

.cash-source-balances {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cash-source-balances-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cash-source-balances-title strong {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cash-source-balance-list {
  display: grid;
  gap: 8px;
}

.cash-source-balance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(149, 165, 184, 0.14);
  border-radius: 12px;
  background: rgba(12, 18, 26, 0.68);
}

.cash-source-balance-row div {
  display: grid;
  min-width: 0;
}

.cash-source-balance-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cash-source-balance-row b {
  white-space: nowrap;
  font-size: clamp(11px, 0.9vw, 13px);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.waterfall-chart {
  display: grid;
  gap: 12px;
}

.waterfall-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(180px, 1.5fr) minmax(120px, auto);
  align-items: center;
  gap: 14px;
}

.waterfall-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.waterfall-track {
  height: 12px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: #202c3a;
}

.waterfall-track.negative {
  justify-content: flex-end;
}

.waterfall-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.unit-economics {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: center;
}

.unit-economics-stack {
  display: grid;
  gap: 14px;
}

.unit-economics-group {
  display: grid;
  gap: 9px;
}

.unit-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.unit-group-title strong {
  font-size: 14px;
}

.unit-group-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.unit-economics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.unit-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.unit-card span,
.unit-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.unit-card strong {
  display: block;
  margin: 8px 0 6px;
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: clamp(14px, 1.18vw, 18px);
  line-height: 1.1;
}

.unit-hero {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.unit-hero strong {
  overflow-wrap: anywhere;
  color: var(--green);
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1.05;
}

.unit-hero small {
  color: var(--muted);
}

.scenario-preview,
.scenario-preview-rich {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.scenario-preview-rich {
  grid-template-columns: 1fr;
  gap: 14px;
}

.scenario-editor-panel .panel-header,
.scenario-result-panel .panel-header {
  align-items: start;
}

.scenario-editor-panel .panel-header .button {
  flex: 0 0 auto;
  min-width: 0;
  padding-inline: 10px;
  white-space: nowrap;
}

.scenario-result-pill {
  max-width: 150px;
  overflow-wrap: anywhere;
  text-align: right;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
}

.scenario-form {
  display: grid;
  gap: 12px;
}

.scenario-form-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(149, 165, 184, 0.14);
  border-radius: var(--radius);
  background: rgba(13, 20, 29, 0.72);
}

.scenario-form-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(149, 165, 184, 0.12);
}

.scenario-form-section-title strong {
  color: #e7edf5;
  font-size: 13px;
}

.scenario-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.scenario-form-footer {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.scenario-form-footer .button {
  width: min(240px, 100%);
  min-height: 42px;
  white-space: nowrap;
}

.scenario-form .field label {
  min-height: 28px;
  display: flex;
  align-items: end;
  line-height: 1.15;
}

.scenario-form .field input {
  min-height: 40px;
  font-variant-numeric: tabular-nums;
}

.scenario-focus {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.scenario-focus > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(149, 165, 184, 0.18);
  border-radius: var(--radius);
  background: #0d141d;
}

.scenario-focus span,
.scenario-focus small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.scenario-focus strong {
  overflow-wrap: anywhere;
  font-size: clamp(15px, 1.35vw, 22px);
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
}

.scenario-preview-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.scenario-preview-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.scenario-preview-group h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.scenario-calc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(102px, auto);
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(149, 165, 184, 0.12);
}

.scenario-calc-row:last-child {
  border-bottom: 0;
}

.scenario-calc-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.2;
}

.scenario-calc-row strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.18;
}

.scenario-comparison-table th,
.scenario-comparison-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.scenario-comparison-table {
  min-width: 1260px;
  table-layout: fixed;
}

.scenario-table-wrap table {
  min-width: 1260px;
}

.scenario-comparison-table .scenario-col-product {
  width: 13%;
}

.scenario-comparison-table .scenario-col-supplier,
.scenario-comparison-table .scenario-col-platform {
  width: 9%;
}

.scenario-comparison-table .scenario-col-units,
.scenario-comparison-table .scenario-col-weight,
.scenario-comparison-table .scenario-col-rate {
  width: 7%;
}

.scenario-comparison-table .scenario-col-money {
  width: 8%;
}

.scenario-comparison-table .scenario-col-money-wide {
  width: 9%;
}

.scenario-comparison-table .scenario-col-status {
  width: 8%;
}

.scenario-comparison-table .scenario-col-actions {
  width: 46px;
}

.scenario-comparison-table th,
.scenario-comparison-table td {
  padding: 10px 7px;
  font-size: 11.5px;
  line-height: 1.22;
}

.scenario-comparison-table td.num {
  overflow-wrap: normal;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.scenario-comparison-table th.num {
  overflow-wrap: anywhere;
  white-space: normal;
  font-variant-numeric: tabular-nums;
}

.scenario-comparison-table td:last-child,
.scenario-comparison-table th:last-child {
  text-align: center;
}

.scenario-comparison-table .pill {
  max-width: 100%;
  white-space: normal;
  line-height: 1.15;
}

.scenario-comparison-matrix {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.scenario-comparison-group {
  padding: 14px;
}

.scenario-comparison-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.82fr) repeat(var(--scenario-count), minmax(190px, 1fr));
  width: max-content;
  min-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(149, 165, 184, 0.14);
  border-radius: var(--radius);
  background: rgba(8, 13, 19, 0.5);
}

.scenario-comparison-cell {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border-right: 1px solid rgba(149, 165, 184, 0.12);
  border-bottom: 1px solid rgba(149, 165, 184, 0.12);
}

.scenario-comparison-corner,
.scenario-comparison-head {
  min-height: 116px;
  background:
    linear-gradient(135deg, rgba(122, 167, 255, 0.1), transparent 48%),
    #0d141d;
}

.scenario-comparison-corner,
.scenario-comparison-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 850;
  line-height: 1.2;
}

.scenario-comparison-head {
  align-content: start;
  gap: 8px;
}

.scenario-comparison-head strong {
  display: block;
  overflow-wrap: anywhere;
  color: #edf3fb;
  font-size: 13px;
  line-height: 1.15;
}

.scenario-comparison-head span,
.scenario-comparison-head small {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.scenario-comparison-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.scenario-comparison-head .pill {
  min-height: 22px;
  padding: 4px 7px;
  white-space: normal;
  line-height: 1.1;
}

.scenario-comparison-head .row-actions {
  justify-content: flex-start;
  gap: 6px;
}

.scenario-comparison-total {
  border-left: 1px solid rgba(240, 184, 79, 0.34);
  background:
    linear-gradient(135deg, rgba(240, 184, 79, 0.14), transparent 54%),
    #111820;
}

.scenario-comparison-total strong {
  color: var(--amber);
}

.scenario-total-caption {
  width: fit-content;
  padding: 4px 7px;
  border: 1px solid rgba(240, 184, 79, 0.22);
  border-radius: 999px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 850;
}

.scenario-comparison-value {
  justify-content: end;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.18;
  text-align: right;
}

.scenario-comparison-total-value {
  border-left: 1px solid rgba(240, 184, 79, 0.22);
  background: rgba(240, 184, 79, 0.045);
  color: #ffe2a7;
}

.scenario-comparison-label {
  background: rgba(13, 20, 29, 0.56);
}

.chat-shell {
  min-height: calc(100vh - 128px);
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.chat-shell-direct {
  max-width: 920px;
}

.chat-topline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.chat-topline h2 {
  margin: 0;
  font-size: 24px;
}

.chat-topline p {
  margin: 4px 0 0;
  color: var(--muted);
}

.chat-layout {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(460px, 1fr) auto;
  gap: 14px;
}

.chat-toolbar {
  display: flex;
  justify-content: flex-end;
}

.chat-thread {
  display: grid;
  align-content: end;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 8px 4px 4px;
}

.chat-loading {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.75rem 0;
}

.chat-message {
  max-width: min(760px, 88%);
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.24);
}

.chat-message.user {
  justify-self: end;
  background: rgba(122, 167, 255, 0.12);
  border-color: rgba(122, 167, 255, 0.34);
}

.chat-message p {
  margin: 5px 0 0;
  line-height: 1.5;
  white-space: pre-line;
}

.chat-composer {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.chat-composer textarea {
  width: 100%;
  min-height: 118px;
  max-height: 300px;
  padding: 14px 14px 4px;
  border: 0;
  border-radius: 20px;
  outline: 0;
  resize: vertical;
  color: var(--text);
  background: transparent;
  font-size: 16px;
  line-height: 1.5;
}

.chat-composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.chat-send-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #ffffff);
  color: #061018;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(122, 167, 255, 0.28);
}

.chat-send-button .icon {
  width: 21px;
  height: 21px;
  stroke-width: 2.8;
}

.chat-send-button:focus-visible {
  outline: 2px solid rgba(122, 167, 255, 0.85);
  outline-offset: 3px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.66);
}

.editor-modal {
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.modal-header h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.editor-form {
  overflow: auto;
  padding: 18px 20px 20px;
}

.empty-state {
  display: grid;
  min-height: 140px;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101820;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .kpi-grid,
  .account-grid,
  .task-grid,
  .scenario-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-grid.dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-hero,
  .quick-load-grid {
    grid-template-columns: 1fr;
  }

  .quick-kpi-grid,
  .quick-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scenario-hero-grid,
  .scenario-focus,
  .scenario-preview-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 6;
  }

  .recovery-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recovery-generation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .financial-metric-grid,
  .formula-grid,
  .stock-step-grid,
  .sample-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    height: auto;
    gap: 10px;
    padding: 10px 12px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    min-width: 0;
    padding: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand span {
    display: none;
  }

  .nav {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .nav-group {
    flex: 0 0 auto;
    min-width: max-content;
    scroll-snap-align: start;
  }

  .nav-group-toggle {
    min-height: 38px;
    white-space: nowrap;
  }

  .nav-group-items {
    display: flex;
    width: max-content;
    padding-left: 0;
    border-left: 0;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    position: relative;
    align-items: flex-start;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    padding: 16px;
  }

  .view {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    padding: 16px;
  }

  .main,
  .title-block,
  .top-actions {
    min-width: 0;
  }

  .title-block h1 {
    overflow-wrap: anywhere;
  }

  .kpi-grid,
  .quick-kpi-grid,
  .quick-feed,
  .kpi-grid.dashboard-kpi-grid,
  .dashboard-summary-grid,
  .scenario-hero-grid,
  .scenario-focus,
  .scenario-preview-columns,
  .beta-ops-grid,
  .commission-grid,
  .account-grid,
  .liquidity-grid,
  .cash-donut-layout,
  .task-grid,
  .scenario-grid,
  .stat-strip,
  .recovery-strip,
  .unit-economics,
  .scenario-preview,
  .commercial-insight-grid,
  .dashboard-channel-summary-grid,
  .sample-summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-debt-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .collection-split-remove {
    justify-self: end;
  }

  .debt-open-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .dashboard-kpi-grid .operating-card {
    grid-column: span 1;
  }

  .quick-hero {
    align-items: start;
    padding: 16px;
  }

  .quick-hero p {
    font-size: 14px;
  }

  .quick-action-bar {
    margin-inline: -2px;
    border-radius: 0;
    border-right: 0;
    border-left: 0;
  }

  .quick-panel {
    scroll-margin-top: 80px;
  }

  .recovery-generation,
  .unit-economics-grid,
  .financial-metric-grid,
  .formula-grid,
  .stock-step-grid {
    grid-template-columns: 1fr;
  }

  .financial-alert {
    align-items: flex-start;
    flex-direction: column;
  }

  .unit-group-title {
    display: grid;
  }

  .unit-group-title span {
    text-align: left;
  }

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

  .liquidity-grid .panel-body + .panel-body {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: 1 / -1;
  }

  .field-2,
  .field-3,
  .field-4,
  .field-5,
  .field-6,
  .field-8,
  .field-12,
  .form-actions {
    grid-column: 1 / -1;
  }

  .chat-shell {
    min-height: auto;
    max-width: none;
  }

  .chat-message {
    max-width: 96%;
  }

  .chat-composer-actions {
    align-items: center;
    flex-direction: row;
    justify-content: flex-end;
  }

  .shipping-sale-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shipping-sale-picker-head {
    display: grid;
  }

  .shipping-sale-clear {
    justify-self: start;
  }

  .shipping-sale-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .shipping-sale-option {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .shipping-sale-facts {
    grid-column: 2;
    justify-content: flex-start;
  }

  .modal-backdrop {
    align-items: end;
    padding: 12px;
  }

  .editor-modal {
    max-height: calc(100vh - 24px);
  }
}

@media (max-width: 560px) {
  .topbar {
    display: grid;
  }

  .top-actions {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .top-actions .button {
    flex: 0 0 auto;
  }

  .sync-status {
    flex: 0 0 auto;
  }

  .dashboard-debt-summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-due-date-row {
    display: grid;
  }

  .dashboard-due-date-amount {
    max-width: none;
    justify-items: start;
    text-align: left;
  }

  .panel-header {
    display: grid;
  }

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

  .quick-action-bar .button {
    min-width: 116px;
  }

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

  .shipping-sale-filters {
    grid-template-columns: 1fr;
  }

  .commercial-dollar-estimate-head {
    grid-template-columns: 1fr;
  }
}

/* Hardy configuration center */
.hardy-config-shell {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.hardy-config-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0 2px;
}

.hardy-config-hero > div {
  min-width: 0;
}

.hardy-config-hero > div > span,
.hardy-config-code {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hardy-config-hero h2 {
  margin: 4px 0 2px;
  font-size: 28px;
  letter-spacing: 0;
}

.hardy-config-hero p,
.hardy-config-detail .panel-header p,
.section-heading p {
  margin: 0;
  color: var(--muted);
}

.hardy-config-kpis,
.hardy-config-preview-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hardy-config-kpis article,
.hardy-config-preview-kpis article {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 96px;
  padding: 15px;
  border: 1px solid rgba(149, 165, 184, 0.18);
  border-radius: var(--radius);
  background: #0d141d;
}

.hardy-config-kpis span,
.hardy-config-preview-kpis span,
.hardy-config-row-date span,
.hardy-config-value span,
.hardy-config-detail-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.hardy-config-kpis strong,
.hardy-config-preview-kpis strong {
  overflow-wrap: anywhere;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.hardy-config-kpis small,
.hardy-config-preview-kpis small,
.hardy-config-row small {
  color: var(--muted);
}

.hardy-config-filters {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(3, minmax(140px, 0.8fr)) auto auto;
  gap: 10px;
  align-items: end;
}

.hardy-config-filters label,
.hardy-config-edit-form label,
.hardy-config-operation label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.hardy-config-filters label > span,
.hardy-config-edit-form label > span,
.hardy-config-operation label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hardy-config-filters input,
.hardy-config-filters select,
.hardy-config-edit-form input,
.hardy-config-edit-form select,
.hardy-config-edit-form textarea,
.hardy-config-operation textarea {
  width: 100%;
  min-width: 0;
}

.hardy-config-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.hardy-config-row {
  display: grid;
  grid-template-columns: minmax(230px, 2fr) minmax(150px, 0.9fr) minmax(150px, 0.8fr) minmax(120px, 0.7fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(149, 165, 184, 0.14);
  border-radius: var(--radius);
  background: #0c121a;
}

.hardy-config-row.has-warning {
  border-color: rgba(240, 184, 79, 0.34);
}

.hardy-config-row-main {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.hardy-config-row-main strong,
.hardy-config-value strong,
.hardy-config-row-date strong {
  overflow-wrap: anywhere;
}

.hardy-config-row-main > span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.hardy-config-value,
.hardy-config-row-date,
.hardy-config-row > div:nth-of-type(2) {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.hardy-config-warning {
  grid-column: 1 / -1;
  color: var(--amber);
  font-size: 12px;
}

.hardy-config-detail .panel-header {
  align-items: start;
}

.hardy-config-detail .panel-header > div {
  min-width: 0;
}

.hardy-config-detail .panel-header h2 {
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.hardy-config-detail-meta {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: 8px;
}

.hardy-config-detail-meta > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 11px;
  border-left: 2px solid rgba(45, 212, 191, 0.5);
  background: #0c121a;
}

.hardy-config-detail-meta strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.hardy-config-actions,
.hardy-config-components > div,
.hardy-config-operation .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hardy-config-actions {
  margin: 16px 0;
}

.hardy-config-editor,
.hardy-config-operation,
.hardy-config-preview,
.hardy-config-history,
.hardy-config-comparison,
.hardy-config-components {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(149, 165, 184, 0.16);
}

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

.section-heading h3,
.hardy-config-components h3 {
  margin: 0;
  font-size: 16px;
}

.hardy-config-parameter-grid,
.hardy-config-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hardy-config-meta-grid {
  margin-top: 10px;
}

.hardy-config-justification {
  margin-top: 10px;
}

.hardy-config-edit-form .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hardy-config-operation {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(122, 167, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(122, 167, 255, 0.06);
}

.hardy-config-detail .table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.hardy-config-detail table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.hardy-config-detail th,
.hardy-config-detail td {
  padding: 9px;
  border-bottom: 1px solid rgba(149, 165, 184, 0.12);
  text-align: left;
  vertical-align: top;
}

.hardy-config-detail th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.loading-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .hardy-config-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hardy-config-row {
    grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(130px, 1fr));
  }

  .hardy-config-detail-meta,
  .hardy-config-parameter-grid,
  .hardy-config-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .hardy-config-hero h2 {
    font-size: 24px;
  }

  .hardy-config-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .hardy-config-hero .button {
    align-self: start;
  }

  .hardy-config-kpis,
  .hardy-config-preview-kpis,
  .hardy-config-filters,
  .hardy-config-parameter-grid,
  .hardy-config-meta-grid {
    grid-template-columns: 1fr;
  }

  .hardy-config-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hardy-config-row-main {
    grid-column: 1 / -1;
  }

  .hardy-config-row-date {
    display: none;
  }

  .hardy-config-detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hardy-config-actions .button,
  .hardy-config-edit-form .form-actions .button,
  .hardy-config-operation .form-actions .button {
    flex: 1 1 150px;
  }
}

@media (max-width: 430px) {
  .hardy-config-kpis,
  .hardy-config-preview-kpis {
    grid-template-columns: 1fr;
  }

  .hardy-config-row,
  .hardy-config-detail-meta {
    grid-template-columns: 1fr;
  }

  .hardy-config-row > div:nth-of-type(2) {
    align-items: center;
    grid-template-columns: auto 1fr;
  }
}

@media (max-width: 860px) {
  body {
    scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .mobile-nav-toggle {
    display: inline-grid;
    width: 44px;
    height: 44px;
    min-width: 44px;
    place-items: center;
    padding: 0;
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 19;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: min(86vw, 320px);
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    gap: 14px;
    padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 18px 0 50px rgba(0, 0, 0, 0.42);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    overscroll-behavior: contain;
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar .brand {
    padding: 0 8px 10px;
  }

  .sidebar .brand span,
  .sidebar-footer {
    display: block;
  }

  .nav {
    display: grid;
    width: 100%;
    max-width: none;
    gap: 6px;
    overflow-x: hidden;
    overflow-y: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .nav-button,
  .nav-group,
  .nav-group-items {
    width: 100%;
    min-width: 0;
  }

  .nav-button {
    min-height: 44px;
    white-space: normal;
  }

  .nav-group {
    display: grid;
  }

  .nav-group-toggle {
    min-height: 44px;
    white-space: normal;
  }

  .nav-group-items {
    display: grid;
    padding-left: 8px;
    border-left: 1px solid rgba(149, 165, 184, 0.14);
  }

  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left));
  }

  .top-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .view {
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
  }

  .button,
  button:not(.mobile-nav-backdrop),
  .nav-button,
  .nav-group-toggle,
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    min-height: 44px;
  }

  .field input,
  .field select,
  .field textarea,
  .compact-select,
  .method-check,
  .row-actions .button {
    min-height: 44px;
  }

  .table-wrap,
  .wide-table,
  .source-table,
  .compact-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
  }

  .modal-backdrop {
    min-height: 100dvh;
    padding: 10px max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .editor-modal {
    width: 100%;
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overscroll-behavior: contain;
  }

  .login-shell,
  .public-login-shell {
    min-height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .login-card {
    padding: 20px;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .top-actions {
    grid-column: 1 / -1;
  }

  .title-block h1 {
    font-size: 22px;
  }

  .login-card {
    padding: 18px;
  }
}
