:root {
  color-scheme: dark;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-number: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  --bg: #020814;
  --bg-2: #061a33;
  --panel: rgba(11, 32, 58, .94);
  --panel-2: rgba(12, 39, 73, .92);
  --line: rgba(83, 168, 255, .22);
  --line-strong: rgba(92, 204, 255, .48);
  --text: #edf8ff;
  --muted: #89a9c8;
  --cyan: #42d9ff;
  --blue: #1d7cff;
  --gold: #f7bd45;
  --green: #19d981;
  --red: #ff4960;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(18, 92, 176, .34), transparent 42%),
    linear-gradient(180deg, #020814 0%, #061324 55%, #020814 100%);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input {
  font: inherit;
}

button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

button:active {
  transform: translateY(2px) scale(.985);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, .34);
}

input {
  width: 100%;
  height: 28px;
  min-width: 0;
  border: 1px solid rgba(83, 168, 255, .18);
  border-radius: 7px;
  padding: 0 8px;
  outline: none;
  color: var(--text);
  font-size: 13px;
  background: rgba(2, 10, 22, .72);
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(66, 217, 255, .12);
}

input:disabled {
  color: #667f98;
  border-color: rgba(83, 168, 255, .08);
}

h1, h2, p {
  margin: 0;
}

.shell {
  width: 100%;
  max-width: 430px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 9px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(66, 217, 255, .04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(66, 217, 255, .035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(4, 18, 36, .82), rgba(2, 8, 20, .96));
  background-size: 22px 22px, 22px 22px, auto;
}

@supports (padding: max(0px)) {
  .shell {
    padding-top: max(9px, env(safe-area-inset-top));
    padding-right: max(9px, env(safe-area-inset-right));
    padding-bottom: max(9px, env(safe-area-inset-bottom));
    padding-left: max(9px, env(safe-area-inset-left));
  }
}

@media (max-width: 380px) {
  .shell {
    padding: 7px;
  }

  .home-view {
    grid-template-rows: 142px 204px 40px minmax(0, 1fr) 28px;
    gap: 6px;
  }

  .hero-copy h1 {
    font-size: 25px;
  }

  .position-tools {
    grid-template-columns: 62px 38px 38px;
    gap: 5px;
  }

  .settings-button {
    padding: 0 6px;
    font-size: 10px;
  }
}

.view {
  height: 100%;
  min-height: 0;
}

.home-view {
  display: grid;
  grid-template-rows: 150px 212px 42px minmax(0, 1fr) 30px;
  gap: 6px;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 1fr minmax(36px, auto);
  gap: 8px;
  overflow: hidden;
  padding: 15px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: inset 0 0 18px rgba(66, 217, 255, .055), 0 8px 18px rgba(0, 0, 0, .16);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .1;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(66, 217, 255, .12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(66, 217, 255, .075) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 44%, rgba(66, 217, 255, .018));
  background-size: 24px 24px, 24px 24px, auto;
  mask-image: linear-gradient(180deg, #000, transparent 88%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: -22px -38px -8px;
  z-index: 0;
  pointer-events: none;
  opacity: .14;
  background:
    linear-gradient(92deg, transparent 8%, rgba(66, 217, 255, .065) 26%, rgba(25, 217, 129, .025) 50%, rgba(92, 204, 255, .052) 72%, transparent 94%),
    linear-gradient(180deg, transparent 10%, rgba(66, 217, 255, .032) 50%, transparent 72%);
  filter: blur(12px);
}

.hero-copy, .hero-session-pnl {
  position: relative;
  z-index: 2;
}

.hero-copy {
  display: grid;
  align-content: center;
  text-align: center;
}

.hero-copy h1 {
  position: relative;
  justify-self: center;
  display: inline-block;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #d7fbff 34%, #55e8ff 52%, #f6ffff 66%, #85b8ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 14px rgba(66, 217, 255, .22);
}

.hero-copy h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 126px;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(66, 217, 255, .78), rgba(25, 217, 129, .48), transparent);
  box-shadow: 0 0 10px rgba(66, 217, 255, .42);
}

.hero-copy p {
  margin-top: 7px;
  color: #b8d9ff;
  font-size: 12px;
  line-height: 1.35;
}

.hero-session-pnl {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.heartbeat {
  min-width: 0;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.heartbeat-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px rgba(255, 73, 96, .48);
}

.ecg {
  width: 100%;
  height: 18px;
}

.ecg polyline {
  fill: none;
  stroke: #506d88;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 150 150;
  stroke-dashoffset: 150;
}

.heartbeat.live {
  border-color: transparent;
}

.heartbeat.live .heartbeat-dot {
  background: var(--green);
  box-shadow: 0 0 12px rgba(25, 217, 129, .8);
  animation: dotPulse 1.1s infinite;
}

.heartbeat.live .ecg polyline {
  stroke: var(--green);
  animation: ecgRun 1.35s linear infinite;
}

.settings-button {
  position: relative;
  z-index: 3;
  height: 22px;
  padding: 0 8px;
  border-color: rgba(66, 217, 255, .28);
  background: linear-gradient(180deg, rgba(23, 75, 132, .92), rgba(10, 36, 72, .92));
  color: #d9f5ff;
  font-size: 11px;
  line-height: 20px;
}

.settings-button::before {
  content: "";
  position: absolute;
  inset: -9px -10px;
}

.back-button {
  height: 28px;
  border-color: rgba(66, 217, 255, .28);
  background: linear-gradient(180deg, rgba(23, 75, 132, .92), rgba(10, 36, 72, .92));
  color: #d9f5ff;
  font-size: 12px;
}

.chart-stack {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.chart-card, .data-card, .settings-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: inset 0 0 18px rgba(66, 217, 255, .055), 0 8px 18px rgba(0, 0, 0, .16);
}

.chart-card {
  min-height: 0;
  overflow: hidden;
  padding: 7px;
}

.chart-head {
  height: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 5px;
}

.chart-head strong {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

.chart-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.chart-meta {
  min-width: 60px;
  text-align: right;
}

.chart-meta b {
  display: block;
  font-family: var(--font-number);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

.chart-meta em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-family: var(--font-number);
  font-size: 11px;
  line-height: 1.2;
}

.chart-meta i {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-family: var(--font-number);
  font-size: 11px;
  font-style: normal;
  line-height: 1.2;
}

.kline-chart {
  width: 100%;
  height: calc(100% - 32px);
  overflow: visible;
}

.grid-line {
  stroke: rgba(95, 171, 255, .12);
  stroke-width: 1;
}

.rsi-grid-line {
  stroke: rgba(247, 189, 69, .48);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.chart-separator {
  stroke: rgba(83, 168, 255, .18);
  stroke-width: 1;
}

.bb-fill {
  fill: rgba(66, 217, 255, .08);
}

.bb-line {
  fill: none;
  stroke: rgba(66, 217, 255, .64);
  stroke-width: 1.2;
}

.bb-mid {
  fill: none;
  stroke: rgba(247, 189, 69, .58);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.wick {
  stroke-width: 1.35;
}

.candle {
  rx: 1.2;
}

.chart-up {
  fill: #19d981;
  stroke: #19d981;
}

.chart-down {
  fill: #ff4960;
  stroke: #ff4960;
}

.chart-empty {
  fill: var(--muted);
  font-size: 12px;
}

.rsi-line {
  fill: none;
  stroke: #f7bd45;
  stroke-width: .5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.trade-button {
  height: 42px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}

.trade-button.start {
  border-color: rgba(25, 217, 129, .35);
  background: #082f25;
  color: #86eab7;
}

.trade-button.start.is-active {
  border-color: #34ff95;
  background: #16bd64;
  color: #f4fff8;
  box-shadow: 0 0 18px rgba(25, 217, 129, .42);
}

.trade-button.pause {
  border-color: rgba(255, 73, 96, .36);
  background: #3d121d;
  color: #ffacb8;
}

.trade-button.pause.is-active {
  border-color: #ff6b7c;
  background: #e6374b;
  color: #fff7f8;
  box-shadow: 0 0 18px rgba(255, 73, 96, .42);
}

.table-zone {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 7px;
}

.data-card {
  min-height: 0;
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr);
  overflow: hidden;
  padding: 7px;
}

.data-title, .settings-title {
  color: #b9ddff;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
}

.position-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.position-tools {
  min-width: 0;
  display: grid;
  grid-template-columns: 74px 42px 42px;
  align-items: center;
  justify-content: end;
  gap: 7px;
}

.position-tools .settings-button::before {
  inset: -3px -6px;
}

.session-pnl {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  font-family: var(--font-number);
  font-size: 10px;
  line-height: 1.3;
  font-weight: 600;
}

.session-pnl > span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
}

.session-pnl b {
  display: inline-block;
  font-weight: 700;
  line-height: 1;
}

.session-pnl b.profit-scale-1 {
  font-size: 22px;
}

.session-pnl b.profit-scale-2 {
  font-size: 44px;
}

.session-pnl b.profit-scale-4 {
  font-size: 66px;
}

.hero-session-pnl.session-pnl {
  justify-content: center;
  gap: 12px;
  font-family: var(--font-ui);
  font-size: 11px;
}

.hero-session-pnl.session-pnl b {
  font-family: var(--font-ui);
  font-variant-numeric: proportional-nums;
  font-feature-settings: "pnum" 1, "tnum" 0;
  letter-spacing: 0;
}

.table-wrap, .positions {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(83, 168, 255, .15);
  border-radius: 8px;
  background: rgba(8, 24, 43, .52);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th, td {
  height: 28px;
  overflow: hidden;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(83, 168, 255, .13);
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
  line-height: 1.2;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #91bfe7;
  background: #061a32;
  font-weight: 600;
}

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

.position-table th,
.position-table td {
  border-right: 1px solid rgba(83, 168, 255, .18);
}

.position-table th {
  border-bottom-color: rgba(83, 168, 255, .24);
}

.position-table tr:last-child td {
  border-bottom: 1px solid rgba(83, 168, 255, .14);
}

.position-table th:last-child,
.position-table td:last-child {
  border-right: 0;
}

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

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

.warn {
  color: var(--gold);
}

footer {
  min-height: 0;
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 1px;
  padding-top: 0;
  padding-bottom: 0;
  color: #7292b5;
  text-align: center;
  font-size: 9px;
  line-height: 1.05;
}

.footer-logo {
  width: min(77px, 23vw);
  height: auto;
  display: block;
  object-fit: contain;
  opacity: .84;
  filter: drop-shadow(0 0 8px rgba(66, 217, 255, .14));
}

.home-view footer .footer-logo {
  width: min(77px, 23vw);
  opacity: .84;
}

.settings-view {
  overflow-y: auto;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  align-content: start;
  padding-bottom: 0;
  background: linear-gradient(180deg, rgba(10, 31, 58, .2), rgba(8, 24, 46, .14));
}

.settings-top {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: start;
  min-height: 92px;
  padding: 34px 0 12px;
  background: linear-gradient(180deg, rgba(2, 8, 20, .98) 82%, rgba(2, 8, 20, 0));
}

.settings-heading {
  grid-column: 2;
  min-width: 0;
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
}

.settings-top h2 {
  font-size: 27px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
}

.settings-top p {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-top .back-button {
  grid-column: 3;
  justify-self: end;
  width: 34px;
  height: 34px;
  border-color: transparent;
  background: transparent;
  color: #f4fbff;
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}

.settings-top .back-button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.settings-block {
  margin-bottom: 9px;
  padding: 10px;
  border-color: rgba(83, 168, 255, .14);
  background: rgba(255, 255, 255, .042);
  box-shadow: none;
}

.settings-view .settings-block {
  border-color: transparent;
  background: transparent;
}

.settings-view input:not([type="checkbox"]) {
  border-color: rgba(83, 168, 255, .18);
  background: rgba(2, 11, 24, .58);
  color: var(--text);
  box-shadow: none;
}

.settings-view input:not([type="checkbox"]):focus {
  border-color: rgba(66, 217, 255, .72);
  box-shadow: 0 0 0 2px rgba(66, 217, 255, .1);
}

.settings-view input:not([type="checkbox"]):disabled {
  border-color: rgba(83, 168, 255, .1);
  background: rgba(2, 11, 24, .34);
  color: #7796b3;
  opacity: 1;
}

.settings-entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  justify-items: center;
  align-items: center;
  padding-bottom: 8px;
}

.coin-picker {
  width: min(312px, 100%);
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 auto;
  padding: 8px 10px;
  border: 1px solid rgba(83, 168, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.coin-title {
  color: #cfe9ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

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

.coin-options label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  border: 1px solid rgba(83, 168, 255, .14);
  border-radius: 7px;
  background: rgba(2, 11, 24, .42);
  color: var(--text);
  font-size: 12px;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.coin-options label.active {
  border-color: rgba(83, 168, 255, .14) !important;
  background: rgba(2, 11, 24, .42) !important;
  color: var(--text) !important;
}

.coin-options input {
  width: 13px;
  height: 13px;
  padding: 0;
  accent-color: #28f78a;
}

.api-connector {
  position: relative;
  z-index: 5;
  width: min(180px, 100%);
  min-width: 0;
  justify-self: center;
}

.api-access-button {
  width: 100%;
  height: 34px;
  border-color: rgba(247, 205, 98, .46);
  background: rgba(247, 205, 98, .18);
  color: #fff1b9;
  box-shadow: none;
}

.api-popover {
  position: absolute;
  top: 40px;
  left: 50%;
  width: min(352px, calc(100vw - 24px));
  max-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(5, 18, 36, .98);
  box-shadow: 0 18px 30px rgba(0, 0, 0, .36);
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: max-height .2s ease, padding .2s ease, opacity .16s ease, border-color .16s ease, transform .16s ease;
}

.api-connector:hover .api-popover,
.api-connector:focus-within .api-popover,
.api-connector.open .api-popover {
  max-height: 236px;
  padding: 8px;
  border-color: rgba(83, 168, 255, .18);
  opacity: 1;
  transform: translate(-50%, 0);
}

.api-qr {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: start;
  text-align: center;
}

.qr-box {
  width: 100%;
  max-width: 78px;
  aspect-ratio: 1;
  justify-self: center;
  padding: 5px;
  border: 1px solid rgba(83, 168, 255, .12);
  border-radius: 8px;
  background: #fff;
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.api-qr p {
  color: var(--gold);
  font-size: 10px;
  line-height: 1.25;
}

.api-form {
  display: grid;
  gap: 6px;
}

.api-form label {
  display: grid;
  gap: 4px;
}

.api-form span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

button.primary {
  height: 30px;
  border-color: rgba(25, 217, 129, .34);
  background: rgba(25, 217, 129, .18);
  color: #bff8d8;
}

.api-message {
  min-height: 0;
  margin-top: 3px;
  color: var(--gold);
  font-size: 12px;
  line-height: 1.35;
}

.strategy-section {
  padding-top: 12px;
}

.strategy-mode-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
  align-items: start;
  justify-items: center;
}

.strategy-mode-card {
  position: relative;
  width: min(286px, 100%);
  min-width: 0;
  transition: padding-bottom .2s ease;
}

[data-mode-card="default"]:hover,
[data-mode-card="default"]:focus-within,
[data-mode-card="default"].open {
  padding-bottom: 58px;
}

[data-mode-card="steady"]:hover,
[data-mode-card="steady"]:focus-within,
[data-mode-card="steady"].open {
  padding-bottom: 58px;
}

[data-mode-card="aggressive"]:hover,
[data-mode-card="aggressive"]:focus-within,
[data-mode-card="aggressive"].open {
  padding-bottom: 272px;
}

.strategy-mode-button {
  width: 100%;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0 14px;
  border-color: rgba(83, 168, 255, .2);
  background: rgba(54, 84, 116, .34);
  color: #d5eaff;
  box-shadow: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.strategy-mode-button strong {
  font-size: 15px;
  line-height: 1.15;
}

.strategy-mode-button.active {
  border-color: rgba(56, 255, 159, .72);
  background: rgba(25, 217, 129, .36);
  color: #f1fff7;
}

.strategy-mode-row:has(.strategy-mode-card:hover) .strategy-mode-button.active {
  border-color: rgba(83, 168, 255, .2);
  background: rgba(54, 84, 116, .34);
  color: #d5eaff;
}

.strategy-mode-card:hover .strategy-mode-button,
.strategy-mode-row:has(.strategy-mode-card:hover) .strategy-mode-card:hover .strategy-mode-button.active {
  border-color: rgba(56, 255, 159, .72);
  background: rgba(25, 217, 129, .36);
  color: #f1fff7;
}

.strategy-drawer {
  position: absolute;
  top: 52px;
  left: 50%;
  z-index: 4;
  width: 252px;
  max-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 58px;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(4, 17, 35, .98);
  box-shadow: 0 16px 28px rgba(0, 0, 0, .34);
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: max-height .2s ease, padding .2s ease, opacity .16s ease, transform .16s ease, border-color .16s ease;
}

.strategy-mode-card:hover .strategy-drawer,
.strategy-mode-card:focus-within .strategy-drawer,
.strategy-mode-card.open .strategy-drawer {
  max-height: 280px;
  padding: 8px;
  border-color: rgba(83, 168, 255, .18);
  opacity: 1;
  transform: translate(-50%, 0);
}

[data-mode-card="default"] .strategy-drawer {
  left: 50%;
  transform: translate(-50%, -4px);
}

[data-mode-card="default"]:hover .strategy-drawer,
[data-mode-card="default"]:focus-within .strategy-drawer,
[data-mode-card="default"].open .strategy-drawer {
  transform: translate(-50%, 0);
}

.steady-drawer {
  width: 322px;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 58px;
}

.aggressive-card .strategy-drawer {
  left: 50%;
  right: auto;
  width: min(398px, calc(100vw - 24px));
  grid-template-columns: 1fr;
  transform: translate(-50%, -4px);
}

.aggressive-card:hover .strategy-drawer,
.aggressive-card:focus-within .strategy-drawer,
.aggressive-card.open .strategy-drawer {
  max-height: 520px;
  transform: translate(-50%, 0);
}

.strategy-drawer label {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.strategy-drawer span,
.symbol-param-group b {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.strategy-drawer input {
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
}

.mode-save {
  align-self: end;
  height: 26px;
  border-color: rgba(25, 217, 129, .34);
  background: rgba(25, 217, 129, .18);
  color: #c9ffe0;
  font-size: 12px;
}

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

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

.symbol-param-group {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(83, 168, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.symbol-param-group b {
  grid-column: 1 / -1;
  color: var(--gold);
  font-weight: 700;
}

.aggressive-drawer .mode-save {
  justify-self: end;
  width: 76px;
}

.settings-footer {
  align-self: end;
  margin-top: 0;
  padding-bottom: 0;
}

.settings-footer .footer-logo {
  width: min(77px, 23vw);
  opacity: .84;
  mix-blend-mode: normal;
}

.settings-footer .settings-footer-logo {
  order: -1;
  width: min(92px, 28vw);
  opacity: .78;
  filter: drop-shadow(0 0 10px rgba(66, 217, 255, .2));
}

.admin-view .settings-top {
  grid-template-columns: minmax(0, 1fr) 56px;
  min-height: 58px;
  padding: 2px 0 10px;
}

.admin-view .settings-heading {
  grid-column: 1;
  justify-items: start;
  text-align: left;
}

.admin-view .settings-top h2 {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
}

.admin-view .settings-top .back-button {
  grid-column: 2;
  width: 52px;
  height: 28px;
  font-size: 13px;
}

.admin-view {
  overflow-y: auto;
  padding-bottom: 8px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.admin-health {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
  margin-top: 8px;
}

.admin-health span {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid rgba(83, 168, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.admin-health b {
  color: var(--text);
  font-family: var(--font-number);
}

.admin-metrics div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 8px 6px;
  border: 1px solid rgba(83, 168, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
  text-align: center;
}

.admin-metrics span,
.admin-user-grid span,
.admin-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.admin-metrics b {
  color: var(--text);
  font-family: var(--font-number);
  font-size: 16px;
  line-height: 1;
}

.admin-users-table {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.admin-user-row {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(83, 168, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
}

.admin-user-row header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.admin-user-row header span {
  color: var(--muted);
}

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

.admin-user-grid span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.admin-user-grid b {
  color: var(--text);
  font-family: var(--font-number);
  font-weight: 700;
}

.admin-user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 8px;
}

.admin-mini-button {
  min-width: 56px;
  height: 26px;
  border: 1px solid rgba(83, 168, 255, .18);
  border-radius: 7px;
  background: rgba(255, 255, 255, .07);
  color: var(--text);
  font-size: 12px;
}

.admin-mini-button.danger {
  border-color: rgba(255, 104, 104, .22);
  color: #ffb6b6;
}

.admin-mini-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.admin-empty {
  padding: 10px;
  border: 1px solid rgba(83, 168, 255, .12);
  border-radius: 8px;
  text-align: center;
}

@keyframes ecgRun {
  from { stroke-dashoffset: 150; }
  to { stroke-dashoffset: -150; }
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: .72; }
  45% { transform: scale(1.45); opacity: 1; }
}
