:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #66727a;
  --line: #d9e0e5;
  --line-soft: #eef2f5;
  --green: #087f5b;
  --green-soft: #e7f6ef;
  --red: #c92a2a;
  --red-soft: #fff0f0;
  --amber: #b7791f;
  --ink: #263238;
  --focus: #1f6feb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.topbar {
  min-height: 82px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 16px 20px;
  background: var(--ink);
  color: #fff;
}

.topbar-right {
  display: flex;
  gap: 14px;
  align-items: center;
}

.topnav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.topnav a {
  min-width: 92px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #dce5e1;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.topnav a:hover,
.topnav a:focus-visible,
.topnav a[aria-current="page"] {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.logout-button {
  min-width: 70px;
  height: 34px;
  border-color: rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #dce5e1;
  font-size: 12px;
  font-weight: 800;
}

.logout-button:hover,
.logout-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

.admin-only {
  display: none !important;
}

.admin-role .admin-only {
  display: inline-flex !important;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 720;
  letter-spacing: 0;
}

#connection {
  margin-top: 4px;
  color: #c8d2ce;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 10px;
  min-width: 460px;
}

.metrics div {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 9px 12px;
}

.metrics span {
  display: block;
  color: #c8d2ce;
  font-size: 12px;
}

.metrics strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
}

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

.workbench,
.side section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(120px, 0.56fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input,
select {
  height: 36px;
}

textarea {
  min-height: 70px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

.toggle {
  grid-template-columns: auto auto;
  align-items: center;
  gap: 7px;
  height: 36px;
  color: var(--text);
}

.toggle input {
  width: 16px;
  height: 16px;
  padding: 0;
}

button {
  height: 36px;
  border: 1px solid #2f3d43;
  border-radius: 6px;
  padding: 0 14px;
  background: #2f3d43;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: #3c4e55;
}

.danger-button {
  border-color: #9b2226;
  background: #c92a2a;
}

.danger-button:hover {
  background: #a61e22;
}

button:disabled {
  cursor: default;
  opacity: 0.58;
}

.table-title {
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.table-title h2 {
  font-size: 16px;
}

.table-title span,
.legend {
  color: var(--muted);
  font-size: 12px;
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.spread-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.spread-title-actions .legend {
  min-width: 0;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}

.long-dot {
  background: var(--green);
}

.short-dot {
  background: var(--red);
}

.table-shell {
  overflow: auto;
  max-height: calc(100vh - 182px);
}

.trading-panel {
  border-top: 1px solid var(--line);
  background: #fff;
}

.status-pill {
  min-width: 86px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  background: #f8fafb;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.success {
  border-color: rgba(8, 127, 91, 0.28);
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.danger {
  border-color: rgba(201, 42, 42, 0.28);
  color: var(--red);
  background: var(--red-soft);
}

.status-pill.ok {
  border-color: rgba(8, 127, 91, 0.28);
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.blocked {
  border-color: rgba(201, 42, 42, 0.28);
  color: var(--red);
  background: var(--red-soft);
}

.status-pill.warning {
  border-color: rgba(185, 121, 20, 0.28);
  color: #9a6100;
  background: #fff6df;
}

.trading-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1fr) minmax(300px, 1fr);
  border-top: 1px solid var(--line-soft);
}

.trading-block {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--line-soft);
}

.trading-block:last-child {
  border-right: 0;
}

.trading-block.wide-block {
  grid-column: span 2;
}

.trading-block h3 {
  margin: 0 0 10px;
  color: #43505a;
  font-size: 12px;
  font-weight: 820;
}

.trading-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.trading-block-title h3,
.trading-runtime .trading-block-title h3 {
  margin: 0;
}

.trading-block-title button {
  min-height: 28px;
  padding: 5px 9px;
}

.account-list {
  display: grid;
  gap: 8px;
}

.account-item {
  display: grid;
  gap: 7px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.account-item strong {
  display: block;
  font-size: 14px;
  font-weight: 820;
}

.account-item span,
.account-warning {
  color: var(--muted);
  font-size: 12px;
}

.account-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.account-metrics span {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 6px;
  color: #43505a;
  background: #f8fafb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.account-warning {
  padding: 8px 0 0;
  color: var(--amber);
}

.account-error {
  margin: 0;
  color: var(--red);
  font-size: 12px;
}

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

.mini-table-shell {
  overflow: auto;
  max-height: 210px;
  border: 1px solid var(--line-soft);
}

.mini-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.mini-table th,
.mini-table td {
  position: static;
  height: 34px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-soft);
  box-shadow: none;
  background: #fff;
  text-align: left;
  font-size: 12px;
}

.mini-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #43505a;
  background: #f4f6f8;
}

.mini-table td {
  color: #263238;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.mini-table a {
  color: #1f6feb;
  text-decoration: none;
}

.mini-table a:hover,
.mini-table a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mini-table .empty-cell {
  color: var(--muted);
  font-family: inherit;
  text-align: center;
}

.decisions-shell {
  max-height: 260px;
}

.decisions-table {
  min-width: 760px;
}

.decision-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  height: 22px;
  border-radius: 5px;
  padding: 0 7px;
  background: #f1f4f6;
  color: #5d6a73;
  font-family: inherit;
  font-size: 11px;
  font-weight: 820;
}

.decision-status.ready {
  background: var(--green-soft);
  color: var(--green);
}

.decision-status.dry_ready {
  background: #eef6ff;
  color: var(--focus);
}

.decision-status.blocked {
  background: var(--red-soft);
  color: var(--red);
}

.pnl-positive {
  color: var(--green);
  font-weight: 820;
}

.pnl-negative {
  color: var(--red);
  font-weight: 820;
}

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

.spread-table {
  width: 100%;
  min-width: 1272px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.col-symbol {
  width: 232px;
}

.col-side {
  width: 88px;
}

.col-pct {
  width: 108px;
}

.col-price {
  width: 150px;
}

.col-leverage {
  width: 86px;
}

.col-limit {
  width: 112px;
}

.col-volume {
  width: 112px;
}

th,
td {
  height: 46px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #eef2f5;
  color: #43505a;
  font-size: 12px;
  font-weight: 760;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--panel);
  box-shadow: 1px 0 0 var(--line);
}

th:first-child {
  z-index: 5;
  background: #eef2f5;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
}

.sortable-header:hover {
  color: var(--text);
}

.sort-indicator {
  display: inline-block;
  width: 10px;
  margin-left: 3px;
  color: #87949e;
  font-size: 10px;
  opacity: 0;
  text-align: center;
}

.sortable-header:hover .sort-indicator,
.sortable-header.active .sort-indicator {
  color: var(--text);
  opacity: 1;
}

tbody tr:hover td {
  background: #f8fafb;
}

tbody tr:hover td:first-child {
  background: #f8fafb;
}

table.mini-table th,
table.mini-table td {
  height: 34px;
  padding: 7px 8px;
  background: #fff;
  box-shadow: none;
  text-align: left;
  white-space: nowrap;
}

table.mini-table th {
  position: sticky;
  top: 0;
  left: auto;
  z-index: 1;
  background: #f4f6f8;
}

table.mini-table td,
table.mini-table td:first-child {
  position: static;
  left: auto;
}

table.mini-table th:first-child,
table.mini-table td:first-child,
table.mini-table th:nth-child(2),
table.mini-table td:nth-child(2) {
  text-align: left;
  box-shadow: none;
}

.signal-row.long-signal-row td {
  background: var(--green-soft);
}

.signal-row.long-signal-row td:first-child {
  background: var(--green-soft);
}

.signal-row.short-signal-row td {
  background: var(--red-soft);
}

.signal-row.short-signal-row td:first-child {
  background: var(--red-soft);
}

.symbol strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.symbol-layout {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.symbol-details {
  min-width: 0;
}

.favorite-button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #8a949b;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.favorite-button:hover,
.favorite-button:focus-visible {
  border-color: var(--line);
  background: #f6f8fa;
  color: var(--amber);
  outline: none;
}

.favorite-button.active {
  color: var(--amber);
}

.chart-button {
  flex: 0 0 auto;
  min-width: 50px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  color: #43505a;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.chart-button:hover,
.chart-button:focus-visible {
  border-color: var(--focus);
  color: var(--focus);
  outline: none;
}

.symbol-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.symbol-link:hover strong,
.symbol-link:focus-visible strong {
  color: var(--focus);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.symbol span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.direction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 24px;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.direction.long {
  background: var(--green);
}

.direction.short {
  background: var(--red);
}

.direction.none {
  background: #8a949b;
}

.pct,
.price,
.leverage,
.position-limit,
.volume,
.muted-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.pct {
  font-size: 14px;
  font-weight: 800;
}

.price {
  color: #14232b;
  font-size: 13px;
  font-weight: 650;
}

.fair {
  color: #31444f;
}

.leverage,
.position-limit {
  color: #243640;
  font-size: 12px;
  font-weight: 740;
}

.volume,
.muted-cell {
  color: var(--muted);
  font-size: 12px;
}

.long-signal {
  color: var(--green);
}

.short-signal {
  color: var(--red);
}

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

.stale {
  color: var(--amber);
  font-weight: 800;
}

.side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.side section {
  min-height: 220px;
  overflow: hidden;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.title-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

h2 {
  font-size: 15px;
  letter-spacing: 0;
}

.log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow: auto;
}

.log li {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.log strong {
  display: block;
  margin-bottom: 2px;
}

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

.compact li {
  font-size: 12px;
}

.trading-page .topbar,
.signals-page .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
}

.signals-layout {
  width: min(1180px, calc(100vw - 28px));
  margin: 14px auto;
}

.signal-settings-panel {
  min-height: calc(100vh - 110px);
}

.trading-layout {
  display: grid;
  grid-template-columns: minmax(560px, 0.88fr) minmax(560px, 1.12fr);
  gap: 14px;
  padding: 14px;
}

.trading-settings,
.trading-runtime {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.settings-panel,
.trading-runtime .trading-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.settings-grid label:has(textarea) {
  grid-column: span 3;
}

.signal-toggle-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.danger-toggle {
  color: var(--red);
  font-weight: 800;
}

.telegram-rules {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.telegram-rule-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.7fr) minmax(110px, 0.6fr) minmax(170px, 1.4fr);
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.telegram-trading-rules {
  padding-top: 0;
}

.trading-telegram-row {
  border-top-color: var(--line);
}

.trading-telegram-row input[readonly] {
  color: var(--text);
  background: #f7fafc;
  font-weight: 800;
}

.telegram-toggle-field {
  align-content: start;
}

.inline-toggle {
  min-height: 38px;
  margin-top: 4px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.account-editor-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(360px, 1.2fr);
  min-height: 520px;
}

.account-editor-layout.settings-closed {
  grid-template-columns: 1fr;
  min-height: 0;
}

.account-picker {
  gap: 0;
  overflow: auto;
  max-height: 680px;
  border-right: 1px solid var(--line-soft);
}

.account-editor-layout.settings-closed .account-picker {
  border-right: 0;
}

.account-picker-item {
  width: 100%;
  display: grid;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.account-picker-item:hover,
.account-picker-item:focus-visible,
.account-picker-item.active {
  background: #f3f8fb;
  outline: none;
}

.account-card-main {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(230px, 1.15fr) auto;
  gap: 10px;
  align-items: center;
}

.account-select-button {
  display: grid;
  gap: 2px;
  height: auto;
  justify-content: stretch;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.account-select-button:hover,
.account-select-button:focus-visible {
  background: transparent;
  color: var(--text);
  outline: none;
}

.account-status-badges,
.account-actions,
.account-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.account-status-badges .account-status-badge,
.account-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  background: #f7fafc;
  color: #53616d;
  font-size: 12px;
  font-weight: 780;
}

.account-status-badges .account-status-badge.success {
  border-color: #b6e2d4;
  background: #e8f8f0;
  color: var(--green);
}

.account-status-badges .account-status-badge.danger {
  border-color: #f2c1c1;
  background: #fff0f0;
  color: var(--red);
}

.account-action {
  height: 30px;
  border-color: var(--line);
  background: #fff;
  color: #2f3d43;
  padding: 0 10px;
}

.account-action:hover,
.account-action:focus-visible {
  background: #edf3f6;
  color: #2f3d43;
}

.account-action.success-soft {
  border-color: #9fd9c5;
  background: #e8f8f0;
  color: var(--green);
}

.account-action.success-soft:hover,
.account-action.success-soft:focus-visible {
  background: #d8f1e6;
}

.account-action.danger-soft {
  border-color: #efb4b4;
  background: #fff0f0;
  color: var(--red);
}

.account-action.danger-soft:hover,
.account-action.danger-soft:focus-visible {
  background: #ffe4e4;
}

.account-settings-panel {
  min-width: 0;
  border-left: 1px solid var(--line-soft);
}

.account-settings-panel.collapsed {
  display: none;
}

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

.account-settings-header h3 {
  margin: 0;
  color: #43505a;
  font-size: 13px;
  font-weight: 860;
}

.account-settings-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

.account-form label:has(textarea),
.account-form .danger-button {
  grid-column: span 2;
}

.trading-runtime .trading-block {
  padding: 12px;
  border-right: 1px solid var(--line);
}

.trading-runtime .trading-block h3 {
  margin: 0 0 10px;
  color: #43505a;
  font-size: 12px;
  font-weight: 820;
}

.mini-table-shell.tall {
  max-height: 300px;
}

.trading-log {
  max-height: 260px;
  border: 1px solid var(--line-soft);
}

html:has(body.chart-page) {
  background: #0b0e13;
}

html[data-chart-theme="light"]:has(body.chart-page) {
  background: #f6f8fb;
}

body.chart-page {
  --chart-bg: #0b0e13;
  --chart-panel: #131722;
  --chart-panel-soft: #171b24;
  --chart-line: #2a2e39;
  --chart-line-soft: #20242e;
  --chart-text: #d1d4dc;
  --chart-muted: #787b86;
  --chart-blue: #2962ff;
  --chart-blue-contrast: #7ea1ff;
  --chart-button-bg: #131722;
  --chart-button-soft: #171b24;
  --chart-button-hover: #1b2030;
  --chart-tooltip-bg: rgba(19, 23, 34, 0.96);
  --chart-shadow: 0 14px 40px rgba(0, 0, 0, 0.36);
  --green: #22ab94;
  --red: #f23645;
  min-height: 100vh;
  background: var(--chart-bg);
  color: var(--chart-text);
  color-scheme: dark;
}

html[data-chart-theme="light"] body.chart-page {
  --chart-bg: #f6f8fb;
  --chart-panel: #ffffff;
  --chart-panel-soft: #f3f6f9;
  --chart-line: #d9e1e8;
  --chart-line-soft: #edf1f5;
  --chart-text: #172026;
  --chart-muted: #66727a;
  --chart-blue: #1f6feb;
  --chart-blue-contrast: #1f6feb;
  --chart-button-bg: #ffffff;
  --chart-button-soft: #f7f9fb;
  --chart-button-hover: #edf3ff;
  --chart-tooltip-bg: rgba(255, 255, 255, 0.97);
  --chart-shadow: 0 14px 34px rgba(23, 32, 38, 0.16);
  --green: #087f5b;
  --red: #c92a2a;
  color-scheme: light;
}

.chart-topbar {
  min-height: 84px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--chart-line);
  background: var(--chart-panel);
}

.chart-heading {
  display: flex;
  min-width: 0;
  gap: 14px;
  align-items: center;
}

.chart-back,
.chart-nav,
.chart-theme-toggle {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--chart-line);
  border-radius: 6px;
  color: var(--chart-text);
  background: var(--chart-button-soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 760;
}

.chart-back {
  width: 72px;
}

.chart-nav {
  min-width: 118px;
  padding: 0 12px;
}

.chart-theme-toggle {
  min-width: 86px;
  padding: 0 12px;
}

.chart-back:hover,
.chart-back:focus-visible,
.chart-nav:hover,
.chart-nav:focus-visible,
.chart-theme-toggle:hover,
.chart-theme-toggle:focus-visible {
  border-color: var(--chart-blue);
  color: var(--chart-text);
  background: var(--chart-button-hover);
  outline: none;
}

.chart-market {
  color: var(--chart-muted);
  font-size: 12px;
  font-weight: 760;
}

.chart-topbar h1 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 2px;
  font-size: 24px;
  line-height: 1.15;
}

#chart-status {
  margin-top: 4px;
  color: var(--chart-muted);
  font-size: 12px;
}

.chart-direction {
  height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.chart-direction.long {
  background: rgba(34, 171, 148, 0.14);
  color: var(--green);
}

.chart-direction.short {
  background: rgba(242, 54, 69, 0.14);
  color: var(--red);
}

.chart-direction.neutral {
  background: var(--chart-line-soft);
  color: var(--chart-muted);
}

.chart-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
}

.chart-terminal {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.chart-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--chart-line);
  border-radius: 8px;
  background: var(--chart-line);
}

.chart-summary div {
  min-width: 0;
  background: var(--chart-panel);
  padding: 10px 12px;
}

.chart-summary span {
  display: block;
  color: var(--chart-muted);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
}

.chart-summary strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--chart-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-panel {
  border: 1px solid var(--chart-line);
  border-radius: 8px;
  background: var(--chart-panel);
  overflow: hidden;
}

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

.chart-title h2 {
  color: var(--chart-text);
  font-size: 15px;
  font-weight: 800;
}

.chart-title span {
  color: var(--chart-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.chart-title-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
}

.chart-range-buttons,
.chart-mode-buttons,
.chart-candle-buttons {
  display: inline-flex;
  height: 28px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--chart-line);
  border-radius: 6px;
  background: var(--chart-button-bg);
}

.chart-candle-buttons[hidden] {
  display: none;
}

.chart-range-button {
  width: auto;
  height: 28px;
  border: 0;
  border-right: 1px solid var(--chart-line);
  border-radius: 0;
  padding: 0 9px;
  background: transparent;
  color: var(--chart-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 820;
}

.chart-range-button:last-child {
  border-right: 0;
}

.chart-range-button:hover,
.chart-range-button:focus-visible,
.chart-range-button.active {
  background: var(--chart-button-hover);
  color: var(--chart-text);
  outline: none;
}

.chart-tool-button {
  width: 32px;
  height: 28px;
  border: 1px solid var(--chart-line);
  border-radius: 6px;
  padding: 0;
  background: var(--chart-button-bg);
  color: var(--chart-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 820;
}

.chart-tool-button.wide {
  width: 44px;
}

.chart-tool-button:hover,
.chart-tool-button:focus-visible {
  border-color: var(--chart-blue);
  background: var(--chart-button-hover);
  outline: none;
}

.chart-tool-button:disabled {
  cursor: default;
  opacity: 0.36;
}

.chart-tool-button:disabled:hover {
  border-color: var(--chart-line);
  background: var(--chart-button-bg);
}

.chart-live {
  height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(34, 171, 148, 0.28);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--green) !important;
  background: rgba(34, 171, 148, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 12px;
  font-weight: 800;
}

.chart-live.history {
  border-color: rgba(41, 98, 255, 0.32);
  color: var(--chart-blue-contrast) !important;
  background: rgba(41, 98, 255, 0.1);
}

.chart-canvas-wrap {
  position: relative;
  height: min(42vh, 470px);
  min-height: 310px;
  background: var(--chart-panel);
}

#spread-chart,
#price-chart {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

#spread-chart.dragging,
#price-chart.dragging {
  cursor: grabbing;
}

.combined-price-panel {
  min-width: 0;
}

.price-chart-panel .chart-title {
  min-height: 48px;
}

.price-canvas-wrap {
  height: min(28vh, 300px);
  min-height: 230px;
}

.price-legend {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.price-badge {
  min-width: 136px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 6px;
  padding: 0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace !important;
  font-size: 12px !important;
  font-weight: 820;
}

.price-badge b {
  color: inherit;
  font: inherit;
}

.price-badge.last {
  border: 1px solid rgba(34, 171, 148, 0.28);
  background: rgba(34, 171, 148, 0.1);
  color: var(--green) !important;
}

.price-badge.fair {
  border: 1px solid rgba(41, 98, 255, 0.32);
  background: rgba(41, 98, 255, 0.1);
  color: var(--chart-blue-contrast) !important;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  width: 210px;
  border: 1px solid var(--chart-line);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--chart-tooltip-bg);
  box-shadow: var(--chart-shadow);
  color: var(--chart-text);
  pointer-events: none;
}

.chart-tooltip strong,
.chart-tooltip span,
.chart-tooltip b,
.chart-tooltip small {
  display: block;
}

.chart-tooltip strong {
  font-size: 13px;
  font-weight: 820;
}

.chart-tooltip span,
.chart-tooltip small {
  color: var(--chart-muted);
  font-size: 11px;
}

.chart-tooltip b {
  margin: 7px 0 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 18px;
  font-weight: 820;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--chart-muted);
  font-weight: 800;
  pointer-events: none;
}

.chart-empty[hidden],
.chart-tooltip[hidden] {
  display: none;
}

@media (max-width: 1220px) {
  .topbar,
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .metrics {
    min-width: 0;
  }

  .topbar-right {
    justify-content: space-between;
  }

  .layout {
    display: block;
  }

  .trading-layout {
    grid-template-columns: 1fr;
  }

  .account-editor-layout {
    grid-template-columns: 1fr;
  }

  .account-card-main {
    grid-template-columns: 1fr;
  }

  .account-picker {
    max-height: 360px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .account-settings-panel {
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }

  .side {
    margin-top: 14px;
    grid-template-columns: 1fr 1fr;
  }

  .table-shell {
    max-height: 62vh;
  }

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

  .trading-block.wide-block {
    grid-column: auto;
  }

  .trading-block {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .trading-block:last-child {
    border-bottom: 0;
  }

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

  .chart-canvas-wrap {
    min-height: 390px;
  }

  .price-canvas-wrap {
    min-height: 230px;
  }
}

@media (max-width: 760px) {
  .topbar {
    display: block;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 14px;
  }

  .topbar-right,
  .topnav,
  .title-actions {
    flex-wrap: wrap;
    margin-top: 10px;
  }

  .trading-layout {
    padding: 10px;
  }

  .settings-grid,
  .account-form,
  .telegram-rule-row {
    grid-template-columns: 1fr;
  }

  .settings-grid label:has(textarea),
  .account-form label:has(textarea),
  .account-form .danger-button {
    grid-column: auto;
  }

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

  .toolbar button {
    grid-column: span 2;
  }

  .table-title {
    display: block;
  }

  .legend {
    justify-content: flex-start;
    margin-top: 8px;
  }

  .spread-title-actions {
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 8px;
  }

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

  .chart-actions {
    margin-top: 14px;
  }

  .chart-topbar {
    display: block;
  }

  .chart-heading {
    align-items: flex-start;
  }

  .chart-topbar h1 {
    font-size: 20px;
  }

  .chart-title {
    align-items: flex-start;
  }

  .chart-title-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

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

  .price-legend {
    justify-content: flex-start;
  }

  .chart-canvas-wrap {
    height: 42vh;
    min-height: 300px;
  }

  .price-canvas-wrap {
    height: 260px;
    min-height: 230px;
  }
}

html:has(body.chart-page) {
  height: 100%;
  overflow: hidden;
}

body.chart-page {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.chart-page .chart-topbar {
  min-height: 66px;
  flex: 0 0 auto;
  padding: 10px 14px;
}

body.chart-page .chart-topbar h1 {
  font-size: 20px;
}

body.chart-page .chart-terminal {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 8px;
  padding: 8px;
  overflow: hidden;
}

body.chart-page .chart-summary {
  flex: 0 0 auto;
}

body.chart-page .chart-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.chart-page .chart-title {
  flex: 0 0 auto;
}

body.chart-page .chart-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

body.chart-page .price-chart-panel {
  min-height: 0;
}

body.chart-page .price-canvas-wrap {
  min-height: 0;
  height: auto;
}

@media (max-width: 760px) {
  html:has(body.chart-page) {
    height: auto;
    overflow: auto;
  }

  body.chart-page {
    height: auto;
    min-height: 100vh;
    display: block;
    overflow: auto;
  }

  body.chart-page .chart-terminal {
    display: grid;
    overflow: visible;
  }

  body.chart-page .chart-canvas-wrap {
    height: 42vh;
    min-height: 300px;
  }

  body.chart-page .price-canvas-wrap {
    height: 260px;
    min-height: 230px;
  }
}

.scanner-page {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scanner-page .topbar {
  min-height: 58px;
  flex: 0 0 auto;
  padding: 10px 14px;
}

.scanner-page h1 {
  font-size: 18px;
}

.scanner-page #connection {
  margin-top: 2px;
  font-size: 12px;
}

.scanner-page .topbar-right {
  margin-left: auto;
}

.scanner-page .layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  padding: 10px;
}

.scanner-page .workbench {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scanner-page .toolbar,
.scanner-page .table-title {
  flex: 0 0 auto;
}

.scanner-page .table-shell {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef2f5;
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 32, 38, 0.12);
  overflow: hidden;
}

.login-brand {
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
}

.login-brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-brand h1 {
  margin-top: 6px;
  color: var(--text);
}

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

.login-form button {
  width: 100%;
  margin-top: 4px;
}

.login-error {
  padding: 9px 10px;
  border: 1px solid #ffd4d4;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.admin-page {
  min-height: 100vh;
  background: var(--bg);
}

.system-page,
.logs-page,
.markets-page,
.profile-page {
  min-height: 100vh;
  background: var(--bg);
}

.system-layout,
.logs-layout,
.markets-layout,
.profile-layout {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.system-panel,
.logs-panel,
.markets-panel,
.profile-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.system-panel .section-title span,
.logs-panel .section-title span,
.markets-panel .section-title span,
.profile-panel .section-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.profile-layout {
  grid-template-columns: repeat(2, minmax(340px, 1fr));
  align-items: start;
}

.profile-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.profile-message {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.profile-message.error {
  color: var(--red);
}

.system-metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
}

.system-metric {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
}

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

.system-metric strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 820;
}

.system-components-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
  padding: 14px;
}

.system-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.system-card.ok {
  border-color: rgba(8, 127, 91, 0.28);
}

.system-card.warning {
  border-color: rgba(185, 121, 20, 0.3);
}

.system-card.error {
  border-color: rgba(201, 42, 42, 0.3);
}

.system-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.system-card h3 {
  margin: 0;
  font-size: 14px;
}

.system-card p {
  min-height: 48px;
  padding: 10px 12px;
  color: var(--text);
  border-bottom: 1px solid var(--line-soft);
}

.system-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--line-soft);
}

.system-card dl div {
  min-width: 0;
  padding: 8px 10px;
  background: #fbfcfd;
}

.system-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.system-card dd {
  margin: 2px 0 0;
  color: var(--text);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.system-detail-empty {
  grid-column: 1 / -1;
  padding: 10px 12px;
  color: var(--muted);
  background: #fbfcfd;
  font-weight: 800;
}

.system-errors-shell {
  max-height: 380px;
  overflow: auto;
}

.system-errors-table {
  min-width: 980px;
}

.logs-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 1.6fr) repeat(3, minmax(130px, 1fr)) repeat(4, minmax(120px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfd;
}

.logs-toolbar label {
  min-width: 0;
}

.logs-table-shell {
  height: calc(100vh - 245px);
  min-height: 420px;
  overflow: auto;
}

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

.logs-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.logs-table td {
  vertical-align: top;
}

.logs-time {
  white-space: nowrap;
}

.logs-row.danger td {
  background: #fff5f5;
}

.logs-row.warning td {
  background: #fffaf0;
}

.logs-table strong {
  display: block;
  color: var(--text);
  font-family: inherit;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.logs-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.markets-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(3, minmax(150px, 1fr)) minmax(112px, 0.6fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfd;
}

.markets-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.markets-table-shell {
  height: calc(100vh - 300px);
  min-height: 420px;
  overflow: auto;
}

.markets-table {
  min-width: 1260px;
}

.markets-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.markets-table td {
  white-space: nowrap;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.4fr) minmax(360px, 0.8fr);
  gap: 14px;
  padding: 14px;
}

.admin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.admin-panel .section-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-users-shell {
  max-height: calc(100vh - 170px);
  overflow: auto;
}

.admin-users-table {
  min-width: 880px;
}

.admin-users-table tr {
  cursor: pointer;
}

.admin-users-table tr:hover td,
.admin-users-table tr.selected td {
  background: #eef5f8;
}

.admin-users-table strong,
.admin-audit-table strong {
  display: block;
  color: var(--text);
  font-family: inherit;
}

.admin-users-table small,
.admin-audit-table small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: inherit;
}

.admin-audit-panel {
  grid-column: 1 / -1;
}

.admin-audit-shell {
  max-height: 360px;
  overflow: auto;
}

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

.admin-user-form {
  display: grid;
  gap: 0;
}

.admin-form-grid {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.admin-enabled-toggle {
  justify-content: start;
}

.admin-user-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px;
}

.admin-user-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-user-summary strong {
  color: var(--text);
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.admin-user-summary[hidden],
.admin-user-actions[hidden],
.admin-user-sessions[hidden] {
  display: none;
}

.admin-user-sessions {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.admin-user-sessions h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-user-session-list {
  display: grid;
  gap: 8px;
}

.admin-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafb;
}

.admin-session-item strong,
.admin-session-item small {
  display: block;
}

.admin-session-item strong {
  color: var(--text);
  font-size: 13px;
}

.admin-session-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.admin-session-empty {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-message {
  margin: 0 14px 14px;
  padding: 9px 10px;
  border: 1px solid rgba(8, 127, 91, 0.22);
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.form-message.error {
  border-color: rgba(201, 42, 42, 0.25);
  background: var(--red-soft);
  color: var(--red);
}

@media (max-width: 980px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .system-metrics-grid,
  .system-components-grid,
  .markets-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .system-metrics-grid,
  .markets-metrics-grid,
  .system-components-grid,
  .system-card dl {
    grid-template-columns: 1fr;
  }

  .logs-toolbar,
  .markets-toolbar {
    grid-template-columns: 1fr;
  }

  .logs-table-shell,
  .markets-table-shell {
    height: calc(100vh - 360px);
  }
}
