:root {
  --bg: #eef2f6;
  --ink: #172033;
  --muted: #667085;
  --faint: #98a2b3;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #dde5ef;
  --line-soft: #edf1f6;
  --nav: #0c1222;
  --nav-2: #111a2f;
  --primary: #2557d6;
  --primary-2: #173ea3;
  --accent: #10a37f;
  --danger: #d92d20;
  --warning: #c47a0a;
  --shadow: 0 20px 55px rgba(16, 24, 40, .08);
}

body.theme-white {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --nav: #0c1222;
  --nav-2: #111a2f;
}

body.theme-soft-gray {
  --bg: #e8edf3;
  --panel: #ffffff;
  --panel-2: #f4f7fb;
  --nav: #101827;
  --nav-2: #182235;
}

body.theme-ice-blue {
  --bg: #eaf3fb;
  --panel: #ffffff;
  --panel-2: #f3f8fd;
  --nav: #0b1729;
  --nav-2: #13243d;
}

body.theme-black {
  --bg: #05070b;
  --ink: #edf2f7;
  --muted: #aab4c4;
  --panel: #10141d;
  --panel-2: #151b26;
  --line: #283244;
  --line-soft: #202938;
  --nav: #000000;
  --nav-2: #10141d;
  --shadow: 0 20px 55px rgba(0, 0, 0, .32);
}

body.theme-deep-blue {
  --bg: #081326;
  --ink: #eef4ff;
  --muted: #a8b7d0;
  --panel: #10203a;
  --panel-2: #142746;
  --line: #28415f;
  --line-soft: #213653;
  --nav: #020b1c;
  --nav-2: #0b1d38;
  --shadow: 0 20px 55px rgba(0, 0, 0, .28);
}

body.theme-graphite {
  --bg: #111315;
  --ink: #f4f6f8;
  --muted: #b5bdc8;
  --panel: #1b2027;
  --panel-2: #222832;
  --line: #343c48;
  --line-soft: #2b333e;
  --nav: #07090d;
  --nav-2: #171c25;
  --shadow: 0 20px 55px rgba(0, 0, 0, .3);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 "Inter", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: linear-gradient(to right, var(--nav) 0 264px, var(--bg) 264px);
}

.side-nav {
  min-height: 100vh;
  max-height: 100vh;
  overflow: auto;
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 22px 16px;
  background:
    linear-gradient(180deg, rgba(37, 87, 214, .18), transparent 34%),
    var(--nav);
  color: #fff;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #fff;
  text-align: left;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #2f6df6, #12b59a);
  font-weight: 800;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup small {
  color: #9aa8c1;
  margin-top: 2px;
}

.side-nav nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.side-nav nav button {
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 0 12px;
}

.side-nav nav button:hover,
.side-nav nav button.active {
  color: #fff;
  background: var(--nav-2);
}

.side-nav nav button.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-footer {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #22304a;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  color: #dbe7ff;
}

#connection-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9ef0d6;
}

#connection-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.workspace {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow-x: hidden;
}

.workspace-top {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 2.1vw, 30px);
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.workspace-top p,
.modal header p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.workspace-top h1,
.modal h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.workspace-actions,
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

#view {
  display: grid;
  align-content: start;
  gap: clamp(16px, 1.8vw, 24px);
  padding: clamp(16px, 2.1vw, 30px) clamp(16px, 2.1vw, 30px) clamp(24px, 3vw, 40px);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.cockpit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  gap: clamp(16px, 1.8vw, 24px);
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr);
}

.order-flow-panel {
  grid-column: 1 / -1;
}

.flow-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.flow-filters label {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
}

.flow-filters .quote-tool-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.flow-summary {
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
}

.flow-summary .kpi {
  min-height: 76px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  background: var(--panel-2);
}

.flow-summary .kpi strong {
  margin-top: 8px;
  font-size: 24px;
}

.liquidity-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
}

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

.stack {
  display: grid;
  gap: clamp(16px, 1.8vw, 24px);
}

.surface {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.surface-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.surface-head > div {
  min-width: 0;
  max-width: 100%;
}

.surface-head h2,
.surface-head p {
  overflow-wrap: anywhere;
}

.surface-head h2 {
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.surface-head p {
  margin: 3px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.analytics-section.is-collapsed .analytics-section-body {
  display: none;
}

.section-toggle {
  min-width: 84px;
}

.account-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--primary);
  font-weight: 800;
  text-align: left;
}

.account-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 0;
}

.account-detail-head h3 {
  margin: 0;
  font-size: 14px;
}

.filter-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.filter-band > * {
  min-width: 0;
}

.filter-band label,
.form-row label {
  display: grid;
  grid-template-columns: 120px minmax(220px, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 650;
  flex: 1 1 320px;
}

.filter-band .actions {
  margin-left: auto;
}

input,
select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: 0;
}

select[multiple] {
  height: auto;
  min-height: 126px;
  padding: 8px 12px;
}

input:focus,
select:focus {
  border-color: #7da0ff;
  box-shadow: 0 0 0 3px rgba(36, 84, 214, .12);
}

.primary,
.danger,
.secondary,
.blue-action,
.round-action,
.plain {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 750;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-2);
}

.danger {
  background: var(--danger);
  color: #fff;
}

.notice {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.notice.warning {
  border-color: rgba(196, 122, 10, 0.28);
  background: rgba(196, 122, 10, 0.08);
  color: var(--warning);
}

.secondary,
.plain {
  background: #eef2f7;
  color: var(--ink);
  border: 1px solid var(--line);
}

.node-card footer button {
  transition: background .12s ease, border-color .12s ease;
}

.side-footer .logout-button {
  min-height: 0;
  width: max-content;
  border: 0;
  background: transparent;
  color: #9aa8c1;
  padding: 0;
}

.side-footer .logout-button:hover {
  color: #fff;
}

.blue-action {
  background: var(--primary);
  color: #fff;
}

.round-action {
  width: 44px;
  padding: 0;
  color: #fff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: clamp(12px, 1.4vw, 18px);
  margin-bottom: 0;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(12px, 1.4vw, 18px);
  margin-bottom: 0;
}

.compact-kpis {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.kpi {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

.kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  margin-top: 12px;
  font-size: 32px;
  line-height: 1;
}

.system-metrics {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.system-kpi {
  min-height: 138px;
}

.system-kpi small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.meter {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.resource-list {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.resource-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-2);
}

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

.resource-row span {
  margin-top: 3px;
  color: var(--muted);
}

.resource-row b {
  color: var(--ink);
}

.resource-row .meter {
  grid-column: 1 / -1;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.surface .empty-state {
  margin: 18px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
}

.empty-state strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(12px, 1.4vw, 18px);
  padding: clamp(14px, 1.5vw, 20px);
}

.lp-card {
  min-height: 154px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f9fbff);
}

.lp-card h3 {
  margin: 0;
  font-size: 15px;
}

.lp-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.lp-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(12px, 1.4vw, 18px);
  padding: clamp(14px, 1.5vw, 20px);
}

.node-card {
  display: grid;
  gap: 14px;
  min-height: 260px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f7fbff);
}

.node-card header,
.node-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.node-card h3,
.node-card p {
  margin: 0;
}

.node-card p {
  color: var(--muted);
}

.node-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.node-card dl div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
}

.node-card dt {
  color: var(--muted);
  font-weight: 750;
}

.node-card dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.standalone {
  margin-top: 18px;
}

.install-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 18px);
  padding: clamp(14px, 1.5vw, 20px);
}

.install-grid-wide {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  border-bottom: 1px solid var(--line-soft);
}

.install-grid h3 {
  margin: 0 0 10px;
}

.install-steps {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.8;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.surface .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.quote-list-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.quote-list-tools label {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
}

.quote-list-tools input,
.quote-list-tools select {
  min-width: 150px;
}

.quote-tool-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.quote-tool-actions button {
  min-height: 40px;
}

.quote-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.mini {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
}

.pin-dot {
  color: #2454d6;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  max-width: none;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table th,
.admin-table td {
  height: 54px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-table th {
  background: var(--panel-2);
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-table tbody tr:hover {
  background: #f7faff;
}

.market-panel .admin-table {
  min-width: 820px;
}

.market-panel .admin-table th:nth-child(1),
.market-panel .admin-table td:nth-child(1),
.topbook-panel .admin-table th:nth-child(1),
.topbook-panel .admin-table td:nth-child(1) {
  width: 128px;
}

.market-panel .admin-table th:nth-child(2),
.market-panel .admin-table td:nth-child(2),
.market-panel .admin-table th:nth-child(3),
.market-panel .admin-table td:nth-child(3),
.topbook-panel .admin-table th:nth-child(2),
.topbook-panel .admin-table td:nth-child(2),
.topbook-panel .admin-table th:nth-child(3),
.topbook-panel .admin-table td:nth-child(3) {
  width: 118px;
}

.market-panel .admin-table th:nth-child(6),
.market-panel .admin-table td:nth-child(6),
.topbook-panel .admin-table th:nth-child(4),
.topbook-panel .admin-table td:nth-child(4) {
  width: 72px;
}

.market-panel .admin-table th:last-child,
.market-panel .admin-table td:last-child {
  width: 138px;
}

.flow-panel .admin-table,
.node-readiness-panel .admin-table,
.topbook-panel .admin-table {
  min-width: 620px;
}

.system-grid .admin-table,
.report-grid .admin-table {
  min-width: 680px;
}

.connection-grid .table-wrap,
.system-grid .table-wrap,
.report-grid .table-wrap,
.dashboard-grid .table-wrap,
.liquidity-grid .table-wrap {
  max-width: 100%;
}

.market-panel,
.flow-panel,
.node-readiness-panel,
.topbook-panel,
.system-grid > *,
.report-grid > *,
.connection-grid > *,
.dashboard-grid > *,
.liquidity-grid > * {
  min-width: 0;
  max-width: 100%;
}

.admin-table code,
.admin-table pre,
.log-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dealing-ticket {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  justify-content: stretch;
  min-height: 0;
}

.dealing-ticket label {
  grid-template-columns: 1fr;
  flex: initial;
  flex-basis: auto;
  gap: 8px;
  grid-column: span 3;
}

.dealing-ticket label:nth-of-type(2),
.dealing-ticket label:nth-of-type(4) {
  grid-column: span 2;
}

.dealing-ticket .actions {
  grid-column: span 2;
  justify-content: flex-end;
}

.dealing-ticket + pre {
  min-height: 96px;
  max-height: 180px;
}

.password-form {
  max-width: none;
  padding: 18px;
}

.password-form label {
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  flex-basis: 100%;
}

.password-form button {
  width: min(100%, 360px);
  margin-left: min(220px, 30vw);
}

.quote-price {
  display: inline-flex;
  min-width: 78px;
  justify-content: flex-end;
  padding: 5px 8px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  transition: background .18s ease, color .18s ease;
}

.quote-price.up {
  color: #087d63;
  background: #dff8ef;
}

.quote-price.down {
  color: #b42318;
  background: #ffe4e0;
}

.status-ok,
.status-bad {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 750;
}

.status-ok {
  color: #087d63;
}

.status-bad {
  color: var(--danger);
}

.status-ok::before,
.status-bad::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.tag,
.domain {
  display: inline-block;
  margin: 3px 2px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.tag {
  background: #e8efff;
  color: #2146a5;
}

.domain {
  background: #e5f7f1;
  color: #087d63;
}

.switch {
  width: 44px;
  height: 24px;
  display: inline-block;
  border-radius: 999px;
  background: #d0d5dd;
  position: relative;
  vertical-align: middle;
  transition: background .16s ease;
}

.switch-button {
  border: 0;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.switch::after {
  content: "";
  width: 20px;
  height: 20px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px #0002;
  transition: left .16s ease;
}

.switch.on {
  background: var(--accent);
}

.switch.on::after {
  left: 22px;
}

.switch-field {
  cursor: pointer;
}

.switch-field input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-field input[type="checkbox"]:checked + .switch {
  background: var(--accent);
}

.switch-field input[type="checkbox"]:checked + .switch::after {
  left: 22px;
}

.subtabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  background: #e9eef6;
  border-radius: 12px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.subtabs button {
  min-height: 46px;
  min-width: 126px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
}

.subtabs button.active {
  background: var(--panel);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(16, 24, 40, .12);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
}

.filter-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.arrow-up {
  color: #079455;
  font-weight: 900;
}

.arrow-down {
  color: #d92d20;
  font-weight: 900;
}

.arrow-flat {
  color: var(--muted);
  font-weight: 900;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.radio-row {
  display: grid;
  gap: 12px;
  margin: 16px 0 28px;
}

.radio-row label {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.time-input {
  width: 132px;
  text-align: center;
}

.circle {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.circle.add {
  background: var(--primary);
}

.circle.remove {
  background: #98a2b3;
}

pre {
  margin: 0;
  padding: 16px;
  background: #0b1020;
  color: #d7e3ff;
  border-radius: 14px;
  overflow: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 32, .62);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none;
}

.login-body {
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(20, 95, 160, .24), transparent 32%),
    linear-gradient(290deg, rgba(12, 163, 127, .18), transparent 36%),
    #080d18;
  overflow-x: hidden;
}

.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, .9), transparent 78%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 500px) minmax(360px, 1fr);
  align-items: center;
  gap: clamp(36px, 7vw, 96px);
  padding: clamp(24px, 6vw, 72px);
}

.login-panel {
  display: grid;
  gap: 30px;
  padding: clamp(28px, 4vw, 42px);
  background: rgba(250, 252, 255, .96);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 20px;
  box-shadow: 0 34px 120px rgba(0, 0, 0, .36);
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.login-brand .brand-mark {
  box-shadow: 0 14px 34px rgba(37, 87, 214, .28);
}

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

.login-brand small {
  margin-top: 2px;
  color: var(--muted);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f5f8fc;
}

.language-switch button {
  min-height: 30px;
  border: 0;
  border-radius: 9px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.language-switch button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(16, 24, 40, .08);
}

.theme-picker {
  display: grid;
  gap: 6px;
  color: #dbe7ff;
  font-size: 12px;
  font-weight: 750;
}

.theme-picker select {
  width: 100%;
  height: 36px;
  border: 1px solid #33425f;
  border-radius: 10px;
  padding: 0 10px;
  color: #172033;
  background: #eef4ff;
}

.login-copy p {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-copy h1 {
  margin: 0;
  max-width: 460px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.12;
}

.login-copy span {
  display: block;
  margin-top: 14px;
  max-width: 440px;
  color: var(--muted);
  font-size: 15px;
}

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

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.login-form input {
  height: 48px;
  border-radius: 12px;
  background: #fff;
}

.login-form button {
  height: 48px;
  border-radius: 12px;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  color: var(--danger);
  background: #fff1f0;
  border: 1px solid #ffd0cc;
  border-radius: 10px;
  font-weight: 700;
}

.login-context {
  position: relative;
  color: #fff;
  max-width: 720px;
}

.login-context span {
  display: inline-flex;
  margin-bottom: 14px;
  color: #9ef0d6;
  font-weight: 800;
  text-transform: uppercase;
}

.login-context strong {
  display: block;
  max-width: 760px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: .95;
}

.login-context p {
  max-width: 520px;
  margin: 22px 0 0;
  color: #b7c3d8;
  font-size: 17px;
}

.login-orbit {
  width: min(72vw, 480px);
  height: 168px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.login-orbit span {
  height: 88px;
  display: grid;
  place-items: center;
  margin: 0;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
  font-size: 20px;
  font-weight: 900;
  text-transform: none;
}

.login-orbit span:nth-child(2) {
  transform: translateY(-22px);
  background: rgba(16, 163, 127, .16);
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
  margin-top: 34px;
}

.login-stats div {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
}

.login-stats b,
.login-stats small {
  display: block;
}

.login-stats b {
  color: #fff;
  font-size: 20px;
}

.login-stats small {
  margin-top: 4px;
  color: #aebbd1;
}

.modal {
  width: min(94vw, 1180px);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
}

.install-modal,
.install-modal * {
  user-select: text;
}

.install-modal button,
.install-modal button * {
  user-select: none;
}

.modal header,
.modal footer {
  min-height: 72px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal footer {
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  min-width: 92px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.tabs button.active {
  background: #e8efff;
  color: var(--primary);
}

#symbol-form {
  padding: 24px 20px;
  min-height: 360px;
}

.form-row {
  display: grid;
  gap: 14px;
  max-width: 960px;
}

.stepper {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
}

.stepper button,
.stepper input {
  border-radius: 0;
}

.stepper button {
  cursor: pointer;
}

.table-input {
  width: 92px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.log-preview {
  max-width: 680px;
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.depth-table .admin-table {
  min-width: 980px;
}

.depth-line {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 170px;
  padding: 7px 10px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

.depth-stack {
  display: grid;
  gap: 6px;
}

.depth-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  min-width: 128px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
}

.depth-toggle span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.depth-toggle[aria-expanded="true"] {
  border-color: rgba(37, 99, 235, .32);
  background: rgba(37, 99, 235, .12);
  color: var(--primary);
}

.depth-line.bid {
  background: rgba(20, 184, 166, .16);
  color: #047857;
}

.depth-line.ask {
  background: rgba(248, 113, 113, .18);
  color: #b91c1c;
}

.depth-line small {
  color: inherit;
  opacity: .8;
}

.depth-card-list {
  display: none;
}

.depth-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.depth-card header,
.depth-card-meta,
.depth-card-grid,
.depth-card-level {
  display: grid;
  grid-template-columns: minmax(82px, .7fr) minmax(130px, 1fr) minmax(130px, 1fr);
  gap: 10px;
  align-items: center;
}

.depth-card header {
  grid-template-columns: 1fr auto;
}

.depth-card header div {
  display: grid;
  gap: 4px;
}

.depth-card header span,
.depth-card header small,
.depth-card-meta {
  color: var(--muted);
}

.depth-card-meta {
  grid-template-columns: 1fr 1fr;
  font-size: 13px;
}

.depth-card > .depth-toggle {
  width: 100%;
}

.depth-card-grid {
  grid-template-columns: minmax(82px, .7fr) minmax(130px, 1fr) minmax(130px, 1fr);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.depth-card-grid::before {
  content: "";
}

.fix-log-table .admin-table {
  min-width: 1380px;
}

.fix-log-table .admin-table td:last-child {
  min-width: 620px;
}

.fix-message-preview {
  width: min(920px, 74vw);
  max-width: none;
  max-height: 420px;
  white-space: pre;
  word-break: normal;
}

@media (max-width: 980px) {
  .depth-table {
    display: none;
  }

  .depth-card-list {
    display: grid;
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .depth-card {
    padding: 14px;
  }

  .depth-card-level {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .depth-card-grid {
    display: none;
  }

  .depth-line {
    width: 100%;
    justify-content: space-between;
  }
}

.quick-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(6px);
}

.quick-editor {
  width: min(720px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
}

.quick-editor header,
.quick-editor footer {
  min-height: 68px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-editor h2 {
  margin: 0;
  font-size: 22px;
}

.quick-editor footer {
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.quick-form {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.quick-form label {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.quick-error {
  margin: 0 20px 16px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 38, 38, .28);
  border-radius: 12px;
  background: rgba(254, 226, 226, .8);
  color: #991b1b;
  font-weight: 800;
}

.quick-form input,
.quick-form select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.quick-form input[readonly] {
  background: #eef3fa;
}

.quick-form .quick-check input {
  width: 22px;
  min-height: 22px;
  justify-self: start;
}

@media (max-width: 1700px) {
  .dashboard-grid,
  .liquidity-grid,
  .connection-grid,
  .system-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .cockpit-grid {
    gap: 16px;
  }

  .kpis,
  .metric-grid,
  .system-metrics {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .flow-panel .admin-table,
  .node-readiness-panel .admin-table,
  .topbook-panel .admin-table,
  .system-grid .admin-table,
  .report-grid .admin-table {
    min-width: 620px;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    background: var(--bg);
  }

  .side-nav {
    position: static;
    min-height: auto;
    max-height: none;
  }

  .side-nav nav {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .side-footer {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: center;
  }

  .cockpit-grid,
  .dashboard-grid,
  .liquidity-grid,
  .connection-grid,
  .system-grid,
  .report-grid,
  .schedule-layout,
  .install-grid {
    grid-template-columns: 1fr;
  }

  .workspace-top {
    min-height: 88px;
  }

  .filter-panel {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .flow-filters {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

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

  .dealing-ticket label,
  .dealing-ticket label:nth-of-type(2),
  .dealing-ticket label:nth-of-type(4),
  .dealing-ticket .actions {
    grid-column: span 3;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 13px;
  }

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

  .flow-filters label {
    grid-template-columns: 1fr;
  }

  .side-nav {
    gap: 12px;
    padding: 12px;
  }

  .brand-lockup {
    min-height: 48px;
  }

  .side-nav nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .side-nav nav button {
    flex: 0 0 auto;
    min-width: 128px;
    text-align: center;
  }

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

  .side-footer {
    grid-template-columns: 1fr;
  }

  #view,
  .workspace-top {
    padding-left: 16px;
    padding-right: 16px;
  }

  #view {
    gap: 16px;
  }

  .workspace-top {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-actions {
    width: 100%;
  }

  .workspace-actions button,
  .actions button {
    flex: 1 1 140px;
  }

  .surface-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-band label,
  .form-row label {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .filter-band {
    align-items: stretch;
  }

  .filter-band .actions {
    margin-left: 0;
  }

  .filter-band input,
  .filter-band select {
    width: 100%;
  }

  .filter-band .actions {
    width: 100%;
  }

  .filter-band .actions button {
    flex: 1;
    min-height: 48px;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar > *,
  .toolbar .actions {
    width: 100%;
  }

  .filter-actions,
  .filter-actions button {
    width: 100%;
  }

  .subtabs {
    margin-left: -2px;
    margin-right: -2px;
  }

  .subtabs button {
    min-width: 132px;
    min-height: 50px;
  }

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

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

  .quote-list-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-list-tools label {
    grid-template-columns: 1fr;
  }

  .quote-tool-actions {
    width: 100%;
  }

  .quote-tool-actions button {
    flex: 1 1 120px;
  }

  .pager {
    align-items: stretch;
    flex-direction: column;
  }

  .dealing-ticket,
  .dealing-ticket label,
  .dealing-ticket label:nth-of-type(2),
  .dealing-ticket label:nth-of-type(4),
  .dealing-ticket .actions {
    display: grid;
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .dealing-ticket .actions {
    display: flex;
    justify-content: stretch;
  }

  .password-form label {
    grid-template-columns: 1fr;
  }

  .password-form button {
    width: 100%;
    margin-left: 0;
  }

  .kpi {
    min-height: 104px;
  }

  .kpi strong {
    font-size: 28px;
  }

  .admin-table {
    min-width: 680px;
  }

  .quick-editor-backdrop,
  .modal-backdrop {
    align-items: stretch;
    padding: 10px;
  }

  .quick-editor-backdrop {
    place-items: stretch;
  }

  .quick-editor,
  .modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 16px;
  }

  .modal header,
  .modal footer {
    align-items: stretch;
    flex-direction: column;
  }

  .modal footer button {
    width: 100%;
  }

  .tabs {
    overflow-x: auto;
    padding: 0 12px 10px;
    -webkit-overflow-scrolling: touch;
  }

  .tabs button {
    flex: 0 0 auto;
  }

  .quick-form label {
    grid-template-columns: 1fr;
  }

  .quote-list-tools,
  .pager {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-list-tools label,
  .quote-list-tools input,
  .quote-list-tools select,
  .quote-tool-actions,
  .quote-tool-actions button,
  .pager button {
    width: 100%;
  }

  .login-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .login-context {
    order: -1;
  }

  .login-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .language-switch {
    width: 100%;
  }

  .language-switch button {
    flex: 1;
  }

  .login-orbit {
    width: 100%;
    height: auto;
  }

  .login-orbit span,
  .login-orbit span:nth-child(2) {
    height: 64px;
    transform: none;
  }

  .login-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .workspace-top h1,
  .modal h2 {
    font-size: 22px;
  }

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

  .admin-table {
    min-width: 620px;
  }

  .primary,
  .danger,
  .secondary,
  .blue-action,
  .round-action,
  .plain {
    min-height: 44px;
  }

  .node-card dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.depth-line {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 2px 0;
  padding: 4px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent), transparent 88%);
  color: var(--ink);
  white-space: nowrap;
}

.depth-line.ask {
  background: color-mix(in srgb, #ef4444, transparent 88%);
}
