:root {
  color-scheme: dark;
  --radius-control: 10px;
  --radius-tag: 5px;
  --font-body: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.positions-shell {
  padding-bottom: 28px;
}

.positions-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 154px;
  border-bottom: 1px solid var(--line);
  padding: 26px 4px 25px;
}

.positions-heading h1 {
  margin: 8px 0 7px;
  color: var(--text);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -.03em;
}

.positions-heading p {
  max-width: 72ch;
  margin: 0;
  color: #a6a7aa;
  font-size: 13px;
  line-height: 1.55;
}

.positions-refresh {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 176px;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--panel);
  color: var(--text);
  padding: 8px 12px;
  text-align: left;
}

.positions-refresh:hover {
  border-color: #5a5b5e;
  background: var(--panel-hover);
}

.positions-refresh:disabled {
  cursor: wait;
  opacity: .62;
}

.positions-refresh > span:first-child {
  color: var(--signal);
  font-size: 20px;
}

.positions-refresh b,
.positions-refresh small {
  display: block;
}

.positions-refresh b {
  font-size: 11px;
}

.positions-refresh small {
  margin-top: 3px;
  color: var(--muted);
  font: 650 8px/1.2 var(--font-mono);
}

.positions-notice {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 66px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #101011;
  padding: 12px 18px;
}

.positions-notice.is-live {
  border-color: rgba(24, 211, 145, .32);
  background: rgba(24, 211, 145, .07);
}

.positions-notice.is-warning {
  border-color: rgba(239, 192, 74, .35);
  background: rgba(239, 192, 74, .07);
}

.positions-notice.is-error {
  border-color: rgba(255, 79, 89, .4);
  background: rgba(255, 79, 89, .07);
}

.notice-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid currentColor;
  color: var(--signal);
  font: 800 12px/1 var(--font-mono);
}

.positions-notice strong {
  color: var(--text);
  font-size: 12px;
}

.positions-notice p {
  margin: 3px 0 0;
  color: #a1a2a5;
  font-size: 10px;
}

.positions-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-top: 0;
  background: #111112;
}

.positions-summary > div {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 17px 18px 16px;
}

.positions-summary > div:last-child {
  border-right: 0;
}

.positions-summary span,
.positions-summary small {
  display: block;
}

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

.positions-summary strong {
  display: block;
  min-height: 25px;
  margin-top: 7px;
  color: var(--text);
  font: 760 19px/1.2 var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.positions-summary strong.is-positive,
.pair-metric strong.is-positive {
  color: var(--signal);
}

.positions-summary strong.is-negative,
.pair-metric strong.is-negative {
  color: var(--sell);
}

.positions-summary small {
  margin-top: 5px;
  overflow: hidden;
  color: #747579;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-ledger {
  margin-top: 18px;
  border: 1px solid var(--line);
  background: #0e0e0f;
}

.performance-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.performance-header h2,
.performance-chart-header h3 {
  margin: 0;
  color: var(--text);
}

.performance-header h2 {
  margin-top: 5px;
  font-size: 20px;
  letter-spacing: -.02em;
}

.performance-header p,
.performance-chart-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.performance-ranges {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  overflow: hidden;
  background: #111112;
}

.performance-ranges button {
  min-width: 47px;
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: transparent;
  color: #87888c;
  font: 750 9px/1 var(--font-mono);
}

.performance-ranges button:last-child {
  border-right: 0;
}

.performance-ranges button:hover,
.performance-ranges button:focus-visible {
  background: #1b1b1d;
  color: var(--text);
}

.performance-ranges button.is-active {
  background: rgba(24, 211, 145, .12);
  color: var(--signal);
}

.performance-metrics {
  display: grid;
  grid-template-columns: 1.12fr repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.performance-metric {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 17px 18px 16px;
}

.performance-metric:last-child {
  border-right: 0;
}

.performance-metric span,
.performance-metric small {
  display: block;
}

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

.performance-metric strong {
  display: block;
  min-height: 28px;
  margin-top: 8px;
  color: var(--text);
  font: 760 21px/1.2 var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.performance-metric.is-primary strong {
  font-size: 24px;
}

.performance-metric strong.is-positive {
  color: var(--signal);
}

.performance-metric strong.is-negative,
#performanceFee.is-negative {
  color: var(--sell);
}

.performance-metric small {
  margin-top: 5px;
  overflow: hidden;
  color: #747579;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.performance-chart-shell {
  min-width: 0;
}

.performance-chart-shell.is-loading {
  opacity: .68;
}

.performance-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 63px;
  border-bottom: 1px solid var(--line);
  padding: 13px 18px;
}

.performance-chart-header h3 {
  font-size: 13px;
}

.performance-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  color: #8a8b8f;
  font: 700 9px/1 var(--font-mono);
}

.performance-legend span::before {
  display: inline-block;
  width: 13px;
  height: 2px;
  margin: 0 6px 2px 0;
  background: currentColor;
  content: "";
}

.performance-legend .is-net {
  color: #f0f0f1;
}

.performance-legend .is-spread {
  color: #64a6ff;
}

.performance-legend .is-funding {
  color: var(--signal);
}

.performance-legend .is-volume {
  color: #555f5b;
}

.performance-legend .is-volume::before {
  height: 7px;
  margin-bottom: -1px;
  opacity: .75;
}

.performance-canvas-wrap {
  position: relative;
  min-width: 0;
  height: 340px;
  overflow: hidden;
}

#performanceChart {
  display: block;
  width: 100%;
  height: 100%;
}

.performance-chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  background: #0e0e0f;
  color: var(--muted);
  text-align: center;
}

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

.performance-chart-empty strong {
  color: #c9c9cb;
  font-size: 13px;
}

.performance-chart-empty span {
  max-width: 50ch;
  font-size: 10px;
  line-height: 1.5;
}

.performance-tooltip {
  position: absolute;
  z-index: 2;
  width: 216px;
  pointer-events: none;
  border: 1px solid #414246;
  background: rgba(14, 14, 15, .96);
  color: #a8a9ac;
  padding: 9px 10px;
  font: 650 9px/1.55 var(--font-mono);
}

.performance-tooltip b,
.performance-tooltip span {
  display: block;
}

.performance-tooltip b {
  margin-bottom: 3px;
  color: var(--text);
}

.performance-source {
  min-height: 36px;
  border-top: 1px solid var(--line);
  color: #6f7074;
  padding: 11px 18px;
  font: 650 9px/1.45 var(--font-mono);
}

.position-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.position-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
}

.position-empty strong {
  color: var(--text);
  font-size: 15px;
}

.position-empty p {
  max-width: 54ch;
  margin: 8px 18px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.position-empty a {
  margin-top: 18px;
  border: 1px solid rgba(24, 211, 145, .42);
  border-radius: var(--radius-control);
  color: var(--signal);
  padding: 10px 14px;
  font-size: 11px;
}

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

.position-pair:target {
  border-color: rgba(24, 211, 145, .58);
}

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

.pair-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.pair-symbol {
  min-width: 88px;
  color: var(--text);
  font: 800 24px/1 var(--font-mono);
  letter-spacing: -.03em;
}

.pair-route {
  color: #a6a7aa;
  font: 700 10px/1.45 var(--font-mono);
  text-transform: uppercase;
}

.pair-route b {
  color: var(--buy);
}

.pair-route i {
  color: var(--sell);
  font-style: normal;
}

.pair-time {
  margin-top: 4px;
  color: #717276;
  font: 600 9px/1.3 var(--font-mono);
}

.pair-status {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-tag);
  color: #bbbcbf;
  padding: 6px 8px;
  font: 750 9px/1 var(--font-mono);
}

.pair-status.is-live {
  border-color: rgba(24, 211, 145, .44);
  color: var(--signal);
}

.pair-status.is-warning {
  border-color: rgba(239, 192, 74, .44);
  color: #efc04a;
}

.pair-status.is-closed {
  color: #85868a;
}

.pair-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #111112;
}

.pair-metric {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 15px 18px;
}

.pair-metric:last-child {
  border-right: 0;
}

.pair-metric span,
.pair-metric small {
  display: block;
}

.pair-metric span {
  color: var(--muted);
  font-size: 9px;
}

.pair-metric strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font: 740 15px/1.25 var(--font-mono);
}

.pair-metric small {
  margin-top: 4px;
  color: #737478;
  font-size: 8px;
}

.pair-rebalance {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  border: 1px solid rgba(239, 192, 74, .48);
  border-radius: var(--radius-control);
  background: rgba(239, 192, 74, .08);
  color: #f2d979;
  padding: 0 11px;
  font: 740 9px/1 var(--font-body);
}

.pair-rebalance:hover:not(:disabled) {
  border-color: #efc04a;
  background: rgba(239, 192, 74, .14);
  color: #fff0ad;
}

.pair-rebalance:disabled {
  border-color: var(--line-strong);
  background: #171718;
  color: #85868a;
}

.pair-legs-scroll {
  overflow-x: auto;
}

.pair-legs {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  table-layout: fixed;
}

.pair-legs th,
.pair-legs td {
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
  text-align: right;
}

.pair-legs th:first-child,
.pair-legs td:first-child {
  text-align: left;
}

.pair-legs thead th {
  color: #77787c;
  background: #101011;
  font: 700 8px/1.2 var(--font-mono);
  letter-spacing: .04em;
}

.pair-legs tbody tr:last-child td {
  border-bottom: 0;
}

.pair-legs td {
  color: #c7c8ca;
  font: 680 11px/1.35 var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.venue-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.venue-cell img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.venue-cell b,
.venue-cell small {
  display: block;
}

.venue-cell b {
  color: var(--text);
  font: 740 11px/1.2 var(--font-body);
}

.venue-cell small {
  margin-top: 3px;
  color: #76777a;
  font-size: 8px;
}

.side-tag {
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: var(--radius-tag);
  padding: 4px 6px;
  font: 780 8px/1 var(--font-mono);
}

.side-tag.long {
  color: var(--buy);
}

.side-tag.short {
  color: var(--sell);
}

.side-tag.missing {
  color: #77787b;
}

.value-positive {
  color: var(--signal);
}

.value-negative {
  color: var(--sell);
}

.pair-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
}

.pair-source {
  min-width: 0;
  color: #85868a;
  font-size: 9px;
  line-height: 1.5;
}

.pair-source b {
  color: #b8b9bb;
  font-weight: 700;
}

.pair-actions {
  display: flex;
  gap: 8px;
}

.pair-log-toggle,
.pair-add,
.pair-exit {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  padding: 0 13px;
  font: 720 10px/1 var(--font-body);
  text-decoration: none;
}

.pair-log-toggle {
  background: #171718;
  color: #b9babc;
}

.pair-log-toggle:hover {
  border-color: #5a5b5e;
  color: var(--text);
}

.pair-add {
  border-color: rgba(24, 211, 145, .48);
  background: rgba(24, 211, 145, .08);
  color: #9ff4d3;
}

.pair-add:hover:not(:disabled) {
  border-color: var(--signal);
  background: rgba(24, 211, 145, .14);
  color: #d7fff0;
}

.pair-add.is-active {
  border-color: rgba(239, 192, 74, .48);
  background: rgba(239, 192, 74, .08);
  color: #f2d979;
}

.pair-add:disabled {
  border-color: var(--line-strong);
  background: #171718;
  color: #747579;
}

.pair-log-toggle:focus-visible,
.pair-add:focus-visible,
.pair-rebalance:focus-visible,
.pair-exit:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.pair-exit {
  border-color: rgba(255, 79, 89, .45);
  background: rgba(255, 79, 89, .07);
  color: #ff747c;
}

.pair-exit:hover {
  border-color: var(--sell);
  background: rgba(255, 79, 89, .12);
}

.pair-exit.is-cancel-wait {
  border-color: rgba(239, 192, 74, .5);
  background: rgba(239, 192, 74, .08);
  color: #f2d979;
}

.pair-exit.is-cancel-wait:hover {
  border-color: #efc04a;
  background: rgba(239, 192, 74, .14);
}

.pair-exit:disabled {
  border-color: var(--line-strong);
  background: #171718;
  color: #747579;
}

.pair-logs {
  display: none;
  max-height: 210px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #0d0d0e;
  padding: 12px 18px;
}

.position-pair.show-logs .pair-logs {
  display: block;
}

.pair-log {
  display: grid;
  grid-template-columns: 118px 70px minmax(0, 1fr);
  gap: 10px;
  color: #9a9b9f;
  font: 620 9px/1.55 var(--font-mono);
}

.pair-log + .pair-log {
  margin-top: 5px;
}

.pair-log .success {
  color: var(--signal);
}

.pair-log .warning {
  color: #efc04a;
}

.pair-log .error {
  color: var(--sell);
}

.positions-legal {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding: 14px 4px 0;
  color: #707175;
  font-size: 9px;
  line-height: 1.5;
}

.positions-legal span {
  max-width: 74ch;
}

.exit-dialog {
  width: min(960px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  border: 1px solid #3b3c3f;
  border-radius: 12px;
  background: #111112;
  color: var(--text);
  padding: 0;
}

.exit-dialog::backdrop {
  background: rgba(0, 0, 0, .78);
}

.exit-dialog[open] {
  animation: exit-dialog-in .18s cubic-bezier(.16, 1, .3, 1);
}

@keyframes exit-dialog-in {
  from { opacity: .55; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.exit-dialog-shell {
  max-height: calc(100dvh - 28px);
  overflow: auto;
}

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

.exit-dialog h2 {
  margin: 7px 0 0;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -.025em;
}

.exit-dialog header p {
  max-width: 66ch;
  margin: 8px 0 0;
  color: #96979a;
  font-size: 11px;
  line-height: 1.5;
}

.exit-dialog-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #171718;
  color: #b6b7b9;
  font-size: 22px;
}

.exit-route {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.exit-route > div {
  padding: 17px 24px;
}

.exit-route > div + div {
  border-left: 1px solid var(--line);
}

.exit-route span,
.exit-route small {
  display: block;
}

.exit-route span {
  color: var(--muted);
  font-size: 9px;
}

.exit-route b {
  display: block;
  margin-top: 6px;
  font: 760 15px/1.2 var(--font-mono);
}

.exit-route .long b {
  color: var(--buy);
}

.exit-route .short b {
  color: var(--sell);
}

.exit-route small {
  margin-top: 4px;
  color: #78797d;
  font: 620 9px/1.35 var(--font-mono);
}

.exit-order-books .trade-book-message td {
  height: 116px;
}

.exit-warning {
  margin: 20px 24px 0;
  border: 1px solid rgba(255, 79, 89, .38);
  background: rgba(255, 79, 89, .07);
  padding: 13px 15px;
}

.exit-warning strong {
  color: #ff747c;
  font-size: 11px;
}

.exit-warning p {
  margin: 5px 0 0;
  color: #c4a4a7;
  font-size: 10px;
  line-height: 1.5;
}

.rebalance-warning {
  border-color: rgba(239, 192, 74, .38);
  background: rgba(239, 192, 74, .07);
}

.rebalance-warning strong {
  color: #f2d979;
}

.rebalance-warning p {
  color: #cbbd91;
}

.exit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px 24px 22px;
}

.exit-fields label > span,
.exit-fields label > small {
  display: block;
}

.exit-fields .exit-gap-hint.is-ready {
  color: #75e7bb;
}

.exit-fields .exit-gap-hint.is-waiting {
  color: #e1ca72;
}

.exit-fields .exit-gap-hint.is-error {
  color: #ff858d;
}

.exit-fields label > span {
  margin-bottom: 7px;
  color: #c9cacc;
  font-size: 10px;
  font-weight: 700;
}

.exit-fields label > small {
  margin-top: 6px;
  color: #77787c;
  font-size: 8px;
}

.exit-fields input {
  width: 100%;
  height: 44px;
  border: 1px solid #3a3b3e;
  border-radius: var(--radius-control);
  background: #0d0d0e;
  color: var(--text);
  padding: 0 12px;
  font: 700 12px/1 var(--font-mono);
}

.exit-fields input:focus {
  border-color: rgba(24, 211, 145, .68);
  outline: 2px solid rgba(24, 211, 145, .18);
  outline-offset: 1px;
}

.exit-input-wrap {
  position: relative;
}

.exit-input-wrap i {
  position: absolute;
  top: 50%;
  right: 12px;
  color: #7d7e82;
  font: 700 10px/1 var(--font-mono);
  transform: translateY(-50%);
}

.exit-confirmation {
  margin: 0 24px 20px;
  border: 1px solid #343538;
  background: #111112;
  padding: 14px 15px;
}

.exit-confirmation:focus-within {
  border-color: rgba(24, 211, 145, .62);
  outline: 2px solid rgba(24, 211, 145, .14);
  outline-offset: 1px;
}

.exit-confirmation span {
  color: #b8b9b6;
}

.exit-error {
  min-height: 0;
  margin: 0 24px;
  color: #ff747c;
  font-size: 10px;
}

.exit-error:not(:empty) {
  min-height: 36px;
  border: 1px solid rgba(255, 79, 89, .35);
  background: rgba(255, 79, 89, .06);
  padding: 10px 12px;
}

.exit-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  background: #0f0f10;
  padding: 15px 24px;
}

.exit-cancel,
.exit-submit,
.rebalance-submit {
  min-height: 42px;
  border-radius: var(--radius-control);
  padding: 0 15px;
  font-weight: 740;
}

.exit-cancel {
  border: 1px solid var(--line-strong);
  background: #19191a;
  color: #b9babc;
}

.exit-submit {
  border: 1px solid var(--sell);
  background: var(--sell);
  color: #100b0c;
}

.exit-submit:disabled {
  border-color: #36373a;
  background: #222224;
  color: #6f7074;
}

.rebalance-submit {
  border: 1px solid #efc04a;
  background: #efc04a;
  color: #151109;
}

.rebalance-submit:disabled {
  border-color: #36373a;
  background: #222224;
  color: #6f7074;
}

@media (max-width: 860px) {
  .positions-heading {
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
    padding: 22px 0;
  }

  .positions-refresh {
    width: 100%;
  }

  .positions-summary,
  .pair-metrics,
  .performance-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .performance-ranges {
    align-self: flex-start;
    max-width: 100%;
    overflow-x: auto;
  }

  .performance-metric:nth-child(2n) {
    border-right: 0;
  }

  .performance-metric {
    border-bottom: 1px solid var(--line);
  }

  .performance-metric:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .positions-summary > div:nth-child(2n),
  .pair-metric:nth-child(2n) {
    border-right: 0;
  }

  .positions-summary > div,
  .pair-metric {
    border-bottom: 1px solid var(--line);
  }

  .positions-summary > div:last-child,
  .pair-metric:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .pair-footer {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .pair-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .positions-legal {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .positions-shell {
    padding: 0 12px 18px;
  }

  .workspace-nav {
    gap: 12px;
  }

  .workspace-nav a {
    font-size: 8px;
  }

  .positions-heading h1 {
    font-size: 32px;
  }

  .positions-notice {
    align-items: flex-start;
    padding: 12px;
  }

  .positions-summary > div,
  .pair-metric,
  .performance-metric {
    padding: 14px 12px;
  }

  .positions-summary strong {
    font-size: 16px;
  }

  .performance-ledger {
    margin-top: 12px;
  }

  .performance-header {
    gap: 14px;
    padding: 16px 12px;
  }

  .performance-ranges {
    width: 100%;
  }

  .performance-ranges button {
    min-width: 44px;
    flex: 1 0 44px;
  }

  .performance-metric strong,
  .performance-metric.is-primary strong {
    font-size: 17px;
  }

  .performance-chart-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 13px 12px;
  }

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

  .performance-canvas-wrap {
    height: 300px;
  }

  .performance-source {
    padding: 10px 12px;
  }

  .pair-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 16px 14px;
  }

  .pair-status {
    align-self: flex-start;
  }

  .pair-symbol {
    min-width: 74px;
    font-size: 21px;
  }

  .pair-footer {
    padding: 13px 12px;
  }

  .pair-actions {
    grid-template-columns: 1fr;
  }

  .pair-log {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .exit-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .exit-dialog-shell {
    max-height: calc(100dvh - 16px);
  }

  .exit-dialog header {
    padding: 18px 16px 16px;
  }

  .exit-dialog h2 {
    font-size: 22px;
  }

  .exit-route,
  .exit-fields {
    grid-template-columns: 1fr;
  }

  .exit-dialog:not(.rebalance-dialog) .exit-fields {
    grid-template-columns: 1fr;
  }

  .exit-route > div {
    padding: 14px 16px;
  }

  .exit-route > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .exit-warning {
    margin: 16px 16px 0;
  }

  .exit-fields {
    padding: 16px;
  }

  .exit-error {
    margin: 0 16px;
  }

  .exit-dialog footer {
    display: grid;
    grid-template-columns: 1fr;
    padding: 14px 16px;
  }
}
