:root {
  --bg: #030406;
  --panel: rgba(14, 19, 22, 0.65);
  --panel-strong: rgba(18, 24, 27, 0.75);
  --border: rgba(110, 130, 140, 0.18);
  --border-active: rgba(69, 239, 119, 0.5);
  --text: #e6edf1;
  --muted: #8ba2b0;
  --green: #45ef77;
  --green-soft: rgba(69, 239, 119, 0.15);
  --red-soft: rgba(255, 107, 107, 0.15);
  --space-1: 10px;
  --space-2: 16px;
  --space-3: 20px;
}

* {
  box-sizing: border-box;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", "Space Grotesk", -apple-system, sans-serif;
  font-size: 16px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  padding-left: max(var(--space-3), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-3), env(safe-area-inset-right, 0px));
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 0%, rgba(69, 239, 119, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(41, 123, 255, 0.05) 0%, transparent 40%);
  color: var(--text);
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

body.auth-only {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-glow {
  position: fixed;
  filter: blur(42px);
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
  contain: strict;
}

.bg-glow-a {
  width: 420px;
  height: 420px;
  top: -180px;
  right: -120px;
  background: #46c85f;
}

.bg-glow-b {
  width: 320px;
  height: 320px;
  left: -120px;
  bottom: -130px;
  background: #26a73f;
}

/* Vollbild-Video nur im Login-Zustand (body.auth-only); dahinter, unter Glow + Shell */
.auth-login-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  display: none;
}

body.auth-only .auth-login-video-wrap {
  display: block;
}

.auth-login-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.02);
  opacity: 0.55;
}

.auth-login-video-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(3, 4, 6, 0.75) 0%, rgba(3, 4, 6, 0.45) 40%, rgba(3, 4, 6, 0.82) 100%),
    radial-gradient(circle at 50% 30%, rgba(69, 239, 119, 0.08), transparent 55%);
  pointer-events: none;
}

body:not(.auth-only) .auth-login-video-wrap {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  body.auth-only .auth-login-video-wrap {
    display: none;
  }
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1500px;
  min-width: 0;
  margin: 0;
  padding: var(--space-2) var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: 24px;
  isolation: isolate;
  background:
    radial-gradient(circle at top right, rgba(69, 239, 119, 0.07), transparent 42%),
    linear-gradient(180deg, rgba(20, 27, 30, 0.88), rgba(10, 14, 16, 0.94));
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
}

.window-head {
  width: 100%;
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(98, 255, 129, 0.2);
}

.window-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  width: 100%;
}

.window-head-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.window-head-mid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  min-width: 0;
  flex: 1 1 280px;
}

.window-head-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .window-head-mid {
    flex: 1 1 100%;
    justify-content: center;
  }

  .window-head-right {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}

.window-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  flex: 0 1 auto;
  max-width: min(400px, 100%);
  border: 1px solid rgba(98, 255, 129, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 33, 28, 0.6), rgba(10, 18, 19, 0.7));
  padding: 6px 10px;
  box-shadow: inset 0 0 0 1px rgba(103, 255, 145, 0.1), 0 0 20px rgba(67, 220, 113, 0.08);
}

.window-brand-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.window-brand-copy h1 {
  margin: 0;
  font-size: 1.04rem;
  letter-spacing: 0.03em;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #57f27a;
  box-shadow: 0 0 10px rgba(87, 242, 122, 0.45);
  animation: livePulse 1.8s ease-in-out infinite;
  flex: 0 0 auto;
  transform: translateZ(0);
  will-change: opacity;
}

.env-pill {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(180, 197, 206, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 0 12px;
}

.env-pill.test {
  color: #6af58b;
  border-color: rgba(97, 245, 126, 0.4);
  background: rgba(24, 48, 31, 0.55);
}

.env-pill.prod {
  color: #ffd082;
  border-color: rgba(255, 188, 82, 0.45);
  background: rgba(64, 47, 20, 0.55);
}

.env-pill.production {
  color: #ffd082;
  border-color: rgba(255, 188, 82, 0.45);
  background: rgba(64, 47, 20, 0.55);
}

.env-pill.staging {
  color: #8ec5ff;
  border-color: rgba(124, 175, 255, 0.5);
  background: rgba(18, 33, 58, 0.55);
}

.live-pulse {
  min-height: 38px;
  border: 1px solid rgba(181, 196, 205, 0.25);
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #c8d7de;
  background: rgba(9, 16, 19, 0.6);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #9aaab3;
  box-shadow: 0 0 8px rgba(154, 170, 179, 0.45);
  animation: livePulse 1.8s ease-in-out infinite;
  transform: translateZ(0);
  will-change: opacity;
}

.live-pulse.state-ok .live-dot {
  background: #4ef06a;
  box-shadow: 0 0 10px rgba(78, 240, 106, 0.5);
}

.live-pulse.state-stop .live-dot {
  background: #ffb76b;
  box-shadow: 0 0 10px rgba(255, 183, 107, 0.45);
}

@keyframes livePulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.head-badge {
  min-height: 38px;
  font-size: 0.88rem;
  padding: 0 12px;
  justify-self: end;
  border-radius: 999px;
  max-width: min(100%, 240px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.head-logout {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.86rem;
}

.head-help {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.86rem;
}

.lang-switch-dash {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid rgba(180, 197, 206, 0.22);
  background: rgba(9, 16, 19, 0.55);
}

.lang-switch-dash.lang-dropdown {
  position: relative;
  z-index: 50;
  display: inline-flex;
  align-items: stretch;
  padding: 0;
  border: none;
  background: transparent;
  gap: 0;
}

.lang-dd-flag {
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.lang-switch-dash.lang-dropdown[data-current-lang="de"] .lang-dd-flag--de {
  display: inline-flex;
}

.lang-switch-dash.lang-dropdown[data-current-lang="en"] .lang-dd-flag--en {
  display: inline-flex;
}

.lang-switch-dash.lang-dropdown[data-current-lang="es"] .lang-dd-flag--es {
  display: inline-flex;
}

.lang-switch-dash.lang-dropdown .lang-dropdown-toggle {
  appearance: none;
  border: 1px solid rgba(181, 196, 205, 0.22);
  background: rgba(9, 16, 19, 0.55);
  color: #b8c9d2;
  /* Gleiche Höhe / Ecken wie .head-social-link (36×36) */
  border-radius: 10px;
  box-sizing: border-box;
  min-height: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0 10px 0 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 0;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.lang-switch-dash.lang-dropdown .lang-dropdown-toggle:hover {
  color: #fff;
  border-color: rgba(180, 197, 206, 0.35);
  background: rgba(14, 22, 26, 0.75);
}

.lang-dropdown-chevron {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.75;
  transition: transform 0.22s ease;
}

.lang-switch-dash.lang-dropdown .lang-dropdown-toggle[aria-expanded="true"] .lang-dropdown-chevron {
  transform: rotate(180deg);
}

.lang-switch-dash.lang-dropdown .lang-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 128px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(180, 197, 206, 0.18);
  background: rgba(10, 16, 20, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.52);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lang-switch-dash.lang-dropdown .lang-dropdown-panel[hidden] {
  display: none !important;
}

.lang-switch-dash.lang-dropdown .lang-dropdown-panel .lang-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.lang-flag-svg {
  display: block;
  width: 22px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.lang-switch-dash.lang-dropdown .lang-dropdown-toggle .lang-flag-svg {
  width: 24px;
  height: 16px;
}
.lang-switch-dash .lang-btn.is-active .lang-flag-svg {
  box-shadow: 0 0 0 1px rgba(4, 17, 8, 0.25);
}
.lang-switch-dash .lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #b8c9d2;
  font-size: 0;
  font-weight: 700;
  letter-spacing: 0;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.lang-switch-dash .lang-btn:hover {
  color: #fff;
}
.lang-switch-dash .lang-btn.is-active {
  color: #041108;
  background: linear-gradient(180deg, #27ff87 0%, #12d861 100%);
  box-shadow: 0 4px 14px rgba(22, 242, 109, 0.22);
}

.head-social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.head-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(181, 196, 205, 0.22);
  background: rgba(9, 16, 19, 0.55);
  color: #b8c9d2;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.head-social-link:hover {
  border-color: rgba(98, 255, 129, 0.35);
  color: #fff;
  background: rgba(18, 32, 28, 0.65);
}

.head-social-link svg {
  display: block;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: var(--space-2);
  min-width: 0;
}

.bots-column {
  display: grid;
  gap: var(--space-1);
  padding-right: var(--space-1);
  border-right: 1px solid rgba(88, 118, 130, 0.24);
  position: relative;
  min-width: 0;
}

.bots-column::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(78, 240, 106, 0.34), rgba(119, 205, 255, 0.16), transparent);
  box-shadow: 0 0 14px rgba(78, 240, 106, 0.12);
  pointer-events: none;
}

.bot-card {
  --bot-accent: rgba(69, 239, 119, 0.45);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(69, 239, 119, 0.08), transparent 45%),
    var(--panel);
  border-radius: 18px;
  min-height: 90px;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
  transform: translate3d(0, 0, 0);
  transition: border-color 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.bot-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.bot-title-wrap {
  display: grid;
  gap: 2px;
}

.bot-title-wrap span {
  opacity: 0.92;
  font-size: 1.04rem;
}

.bot-icon {
  width: 54px;
  min-width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid color-mix(in srgb, var(--bot-accent) 75%, rgba(255, 255, 255, 0.18));
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--bot-accent) 62%, #ffffff 10%), transparent 70%),
    color-mix(in srgb, var(--bot-accent) 20%, rgba(6, 16, 22, 0.92));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bot-accent) 40%, transparent);
}

.bot-icon.pulse {
  animation: botIconPulseEpic 1.65s cubic-bezier(0.45, 0, 0.25, 1) infinite;
  will-change: transform, box-shadow;
}

.bot-icon-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Monochrome SVG-Fallback (Font-Awesome-Stil) auf farbiger Karte */
.bot-icon-img:not(.bot-icon-img--photo) {
  filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(255, 255, 255, 0.16));
}

.bot-icon-img--photo {
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.22));
}

@keyframes botIconPulseEpic {
  0%, 100% {
    transform: translateZ(0) scale(1);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--bot-accent) 42%, transparent),
      0 0 10px color-mix(in srgb, var(--bot-accent) 22%, transparent);
  }
  40% {
    transform: translateZ(0) scale(1.12);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--bot-accent) 88%, rgba(255, 255, 255, 0.35)),
      0 0 22px color-mix(in srgb, var(--bot-accent) 72%, transparent),
      0 0 46px color-mix(in srgb, var(--bot-accent) 48%, transparent),
      0 0 72px color-mix(in srgb, var(--bot-accent) 22%, transparent);
  }
  55% {
    transform: translateZ(0) scale(1.08);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--bot-accent) 65%, transparent),
      0 0 28px color-mix(in srgb, var(--bot-accent) 55%, transparent);
  }
}

.bot-card:hover {
  transform: translate3d(0, -2px, 0);
}

.bot-card.active {
  border-color: var(--bot-accent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--bot-accent) 62%, transparent),
    0 0 20px color-mix(in srgb, var(--bot-accent) 38%, transparent);
}

.bot-card.theme-btc {
  /* Typisches Bitcoin-Orange / Gold */
  --bot-accent: rgba(255, 196, 0, 0.95);
  background:
    radial-gradient(circle at top right, rgba(255, 196, 0, 0.22), transparent 50%),
    var(--panel);
}

.bot-card.theme-gold {
  --bot-accent: rgba(255, 219, 95, 0.64);
  background:
    radial-gradient(circle at top right, rgba(255, 223, 102, 0.18), transparent 48%),
    var(--panel);
}

.bot-card.theme-sp500 {
  --bot-accent: rgba(233, 84, 84, 0.64);
  background:
    radial-gradient(circle at top right, rgba(229, 75, 75, 0.16), transparent 48%),
    var(--panel);
}

.bot-card.theme-dax {
  --bot-accent: rgba(61, 165, 255, 0.66);
  background:
    radial-gradient(circle at top right, rgba(75, 172, 255, 0.18), transparent 48%),
    var(--panel);
}

.bot-card.theme-oil {
  --bot-accent: rgba(176, 118, 58, 0.78);
  border-color: rgba(140, 95, 48, 0.42);
  background:
    radial-gradient(circle at top right, rgba(200, 130, 60, 0.22), transparent 52%),
    linear-gradient(180deg, rgba(38, 26, 14, 0.94), rgba(16, 10, 6, 0.97));
}

.bot-sub {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.bot-card--locked {
  cursor: pointer;
  display: grid;
  gap: 0;
  min-height: auto;
  padding-bottom: 14px;
}

.bot-card--locked:hover {
  transform: translate3d(0, -2px, 0);
}

.bot-card--locked.active {
  border-color: var(--bot-accent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--bot-accent) 62%, transparent),
    0 0 20px color-mix(in srgb, var(--bot-accent) 38%, transparent);
}

.locked-preview-perf {
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: min(58vh, 560px);
}

.locked-preview-title {
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  color: var(--text);
  flex-shrink: 0;
}

.locked-preview-canvas-wrap {
  width: 100%;
  max-width: min(960px, 100%);
  margin-left: auto;
  margin-right: auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.06) 0%, transparent 55%),
    rgba(0, 0, 0, 0.42);
  min-height: 220px;
  flex: 1 1 auto;
}

#lockedPreviewPerfCanvas {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.locked-preview-extras {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
}

.locked-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.locked-preview-chip {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.04);
}

.locked-preview-sub {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}

.locked-preview-hint {
  margin: 12px 0 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .locked-preview-perf {
    min-height: 0;
  }
}

.bot-subscribe-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.action-btn.bot-subscribe-btn {
  flex: 0 1 auto;
  min-height: 32px;
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 9px;
  color: rgba(186, 228, 200, 0.92);
  background: rgba(32, 58, 44, 0.35);
  border: 1px solid rgba(98, 255, 129, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.action-btn.bot-subscribe-btn:hover {
  color: #f0fff4;
  background: rgba(40, 72, 54, 0.5);
  border-color: rgba(120, 210, 150, 0.38);
  transform: translateY(-1px);
}

.action-btn.bot-subscribe-btn:active {
  transform: translateY(0);
}

.action-btn.bot-subscribe-btn:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 2px rgba(10, 20, 16, 0.95),
    0 0 0 4px rgba(98, 255, 129, 0.35);
}

.bot-perf-link {
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bot-perf-link:hover {
  color: var(--text);
}

.control-column {
  display: grid;
  gap: var(--space-1);
  padding-bottom: 0;
  padding-left: var(--space-1);
  min-width: 0;
}

.pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.leverage-card .leverage-select.field-input,
#leverageSelect.leverage-select {
  width: 100%;
  max-width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 14px;
  cursor: pointer;
}

.card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: var(--space-2);
  background: var(--panel-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.card h2 {
  margin: 0 0 var(--space-1) 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
}

.accordion-card {
  padding: 0;
  overflow: hidden;
}

.accordion-toggle {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(181, 196, 205, 0.16);
  background: linear-gradient(180deg, rgba(18, 27, 32, 0.72), rgba(11, 18, 21, 0.86));
  color: #dce6ec;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: var(--space-1) var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.accordion-toggle:hover {
  background: linear-gradient(180deg, rgba(24, 34, 40, 0.82), rgba(12, 19, 23, 0.92));
}

.accordion-toggle:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(98, 255, 129, 0.4);
}

.accordion-chevron {
  font-size: 0.9rem;
  color: #8fa4b0;
  transition: transform 180ms ease;
}

.accordion-card.is-open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-panel {
  padding: var(--space-2);
  display: grid;
  gap: var(--space-1);
}

.monitor-panel {
  gap: 10px;
}

.monitor-block {
  display: grid;
  gap: 8px;
}

.monitor-heading {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
  color: #a8bbc5;
}

.full {
  min-height: 78px;
}

.value-pill {
  border: 1px solid rgba(181, 196, 205, 0.26);
  border-radius: 12px;
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 1rem;
  font-weight: 700;
  background: rgba(20, 30, 34, 0.5);
}

.state-ok {
  color: var(--green);
  border-color: rgba(97, 245, 126, 0.45);
  box-shadow: inset 0 0 0 1px rgba(87, 245, 120, 0.2);
}

.state-stop {
  color: #ffcb6f;
  border-color: rgba(255, 205, 122, 0.45);
  background: rgba(58, 47, 20, 0.25);
}

.state-neutral {
  color: #d7e0e6;
}

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

.status-mini-icon {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: #9aa9b1;
  box-shadow: 0 0 0 0 rgba(154, 169, 177, 0.42);
}

.status-mini-icon--live {
  background: #4ef06a;
  box-shadow: 0 0 0 5px rgba(78, 240, 106, 0.16), 0 0 14px rgba(78, 240, 106, 0.5);
}

.status-mini-icon--standby {
  background: #ffbc67;
  box-shadow: 0 0 0 5px rgba(255, 188, 103, 0.14), 0 0 12px rgba(255, 188, 103, 0.45);
}

.status-mini-icon--pause {
  background: #9aa9b1;
  box-shadow: 0 0 0 5px rgba(154, 169, 177, 0.1);
}

.perf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.perf-cell {
  border: 1px solid rgba(181, 196, 205, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(26, 38, 42, 0.62), rgba(14, 22, 26, 0.62));
  padding: 8px 9px;
  display: grid;
  gap: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.perf-label {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.perf-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: #d7e0e6;
}

.perf-positive {
  color: var(--green);
}

.perf-negative {
  color: #ff8a8a;
}

.perf-neutral {
  color: #d7e0e6;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(181, 196, 205, 0.2);
  border-radius: 14px;
  background: rgba(10, 17, 21, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.actions-panel {
  display: grid;
  gap: 8px;
}

.actions.quick-actions {
  border-color: rgba(97, 245, 126, 0.3);
  background: rgba(7, 14, 18, 0.9);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.action-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), opacity 160ms ease, border-color 160ms ease;
}

.action-btn:active {
  transform: translateY(1px);
}

.action-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.start {
  color: #021a08;
  background: linear-gradient(180deg, #51f27e, #2bd658);
  box-shadow: 0 8px 24px rgba(45, 219, 89, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

.start:hover {
  background: linear-gradient(180deg, #64f78e, #33e560);
  transform: translateY(-2px);
}

.start:active {
  transform: translateY(1px);
}

.stop {
  color: #e6edf1;
  background: rgba(18, 24, 26, 0.9);
}

.ghost {
  color: #cce0d8;
  background: rgba(18, 24, 26, 0.72);
}

.hidden {
  display: none !important;
}

.history-card {
  min-height: auto;
}

.history-card.is-compact .history-section {
  display: none;
}

.history-summary {
  border: 1px solid rgba(181, 196, 205, 0.2);
  border-radius: 12px;
  background: rgba(17, 26, 30, 0.62);
  color: #bfd0d9;
  padding: 8px 10px;
  font-size: 0.86rem;
  line-height: 1.35;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.history-count {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.history-section {
  margin-bottom: 12px;
}

.history-section h3 {
  margin: 0 0 8px;
  color: #c9d8df;
  font-size: 0.96rem;
  letter-spacing: 0.03em;
}

.history-list {
  border: 1px solid rgba(181, 196, 205, 0.22);
  border-radius: 16px;
  background: rgba(20, 30, 34, 0.5);
  padding: 8px 12px;
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.history-list.empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.trade-row {
  display: grid;
  grid-template-columns: 72px 1fr 92px 96px;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
  line-height: 1.35;
}

.trade-row + .trade-row {
  border-top: 1px solid rgba(181, 196, 205, 0.12);
  padding-top: 8px;
}

.trade-side {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.trade-side.buy {
  color: #62f281;
}

.trade-side.sell {
  color: #ffb37d;
}

.trade-meta {
  color: #d7e0e6;
}

.trade-price,
.trade-reason {
  color: #adc0ca;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px 16px;
  font-size: 0.74rem;
  color: var(--muted);
}

.meta-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 0;
}

.meta-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
}

.meta-link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.meta-link:hover {
  color: var(--text);
  border-bottom-color: rgba(98, 255, 129, 0.35);
}

.meta-dot {
  opacity: 0.45;
  user-select: none;
}

.meta-imprint-note {
  font-size: 0.7rem;
  opacity: 0.85;
}

.leverage-disclaimer {
  border: 1px solid rgba(255, 159, 79, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(39, 27, 16, 0.68), rgba(21, 15, 10, 0.9));
  margin-top: 2px;
}

.leverage-disclaimer summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 14px;
  color: #ffd7b4;
  font-weight: 700;
  font-size: 0.83rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.leverage-disclaimer summary::-webkit-details-marker {
  display: none;
}

.leverage-disclaimer summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 215, 180, 0.8);
  border-bottom: 2px solid rgba(255, 215, 180, 0.8);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.leverage-disclaimer[open] summary::after {
  transform: rotate(225deg);
}

.leverage-disclaimer-body {
  border-top: 1px solid rgba(255, 159, 79, 0.24);
  padding: 10px 14px 14px;
  max-height: 280px;
  overflow: auto;
  color: #f6e7d8;
  font-size: 0.77rem;
  line-height: 1.58;
}

.leverage-disclaimer-body h3,
.leverage-disclaimer-body h4,
.leverage-disclaimer-body h5 {
  margin: 12px 0 8px;
  color: #ffe7cf;
}

.leverage-disclaimer-body h3 {
  margin-top: 2px;
  font-size: 0.9rem;
}

.leverage-disclaimer-body h4 {
  font-size: 0.82rem;
}

.leverage-disclaimer-body h5 {
  font-size: 0.79rem;
}

.leverage-disclaimer-body p {
  margin: 0 0 8px;
}

.leverage-disclaimer-body ul,
.leverage-disclaimer-body ol {
  margin: 0 0 8px 18px;
  padding: 0;
}

.leverage-disclaimer-body li {
  margin: 0 0 4px;
}

.auth-card {
  margin-bottom: 10px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 12px;
  align-items: stretch;
}

.auth-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-info {
  display: flex;
  justify-content: flex-end;
}

.auth-trust {
  border: 1px solid rgba(181, 196, 205, 0.2);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(16, 30, 25, 0.55), rgba(8, 16, 20, 0.72));
  display: block;
}

.auth-trust-body {
  display: grid;
  gap: 10px;
  align-content: start;
  margin-top: 10px;
}

.auth-trust-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.auth-trust-summary::-webkit-details-marker {
  display: none;
}

.auth-trust-summary::marker {
  content: "";
}

.auth-trust-summary h2 {
  margin: 0;
  flex: 1;
}

.auth-trust-summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.45);
  border-bottom: 2px solid rgba(255, 255, 255, 0.45);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.auth-trust[open] .auth-trust-summary::after {
  transform: rotate(225deg);
}

@media (min-width: 901px) {
  .auth-trust-summary {
    cursor: default;
    pointer-events: none;
  }

  .auth-trust-summary::after {
    display: none;
  }
}

.trust-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #d9e6ec;
  font-size: 0.84rem;
}

.trust-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
  margin-top: 0.32em;
  align-self: flex-start;
}

.trust-dot.ok {
  background: #52e082;
  box-shadow: 0 0 0 2px rgba(82, 224, 130, 0.2), 0 0 10px rgba(82, 224, 130, 0.35);
  animation: trustPulse 1.6s ease-in-out infinite;
  transform: translateZ(0);
  will-change: opacity;
}

@keyframes trustPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.auth-uptime {
  border: 1px solid rgba(95, 239, 128, 0.35);
  border-radius: 10px;
  background: rgba(18, 40, 25, 0.45);
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #a9c6b2;
}

.auth-uptime strong {
  color: #66f88a;
  font-size: 0.9rem;
}

.auth-note {
  margin: 0;
  color: #b7c8d0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.auth-login-card {
  border: 1px solid rgba(181, 196, 205, 0.2);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(14, 24, 30, 0.62), rgba(10, 17, 21, 0.72));
  display: grid;
  gap: 9px;
  align-content: start;
}

.password-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
  flex: 1;
}

.password-wrap .field-input {
  width: 100%;
  padding-right: 60px;
}

.eye-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 1px solid rgba(181, 196, 205, 0.28);
  border-radius: 999px;
  background: rgba(17, 26, 30, 0.92);
  color: #d8e4ea;
  min-width: 46px;
  height: 30px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.eye-icon {
  width: 15px;
  height: 15px;
  fill: #d8e4ea;
}

.pm-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -10000px;
  top: auto;
}

.caps-hint {
  margin: 0;
  color: #ffc773;
  font-size: 0.76rem;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-login-btn {
  background: linear-gradient(180deg, #7bff95, #2de55a);
  box-shadow: 0 10px 26px rgba(65, 252, 113, 0.34);
}

.text-link-btn {
  border: none;
  background: transparent;
  color: #92b0bf;
  font-size: 0.84rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.forgot-info {
  margin: 0;
  color: #a8bcc7;
  font-size: 0.76rem;
}

.field-input {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 22, 25, 0.92);
  color: var(--text);
  font: inherit;
  padding: 7px 9px;
  min-width: 0;
  font-size: 0.84rem;
}

.field-input:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 2px rgba(98, 255, 129, 0.18);
}

.field-input:-webkit-autofill,
.field-input:-webkit-autofill:hover,
.field-input:-webkit-autofill:focus,
.field-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(15, 22, 25, 0.92) inset !important;
  box-shadow: 0 0 0 1000px rgba(15, 22, 25, 0.92) inset !important;
  transition: background-color 9999s ease-in-out 0s;
}

.field-input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.field-input[type="number"]::-webkit-outer-spin-button,
.field-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.exchange-picker {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}

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

.exchange-card-subtitle {
  margin: 0;
  color: #95aab5;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  flex: 1 1 auto;
  min-width: min(220px, 52%);
}

.exchange-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.step-chip {
  border-radius: 999px;
  border: 1px solid rgba(181, 196, 205, 0.24);
  background: rgba(18, 27, 31, 0.6);
  color: #b9c8cf;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 4px 10px;
}

.step-chip.is-active {
  border-color: rgba(98, 255, 129, 0.42);
  color: #6cf48a;
  box-shadow: inset 0 0 0 1px rgba(98, 255, 129, 0.14);
}

#exchangePickerBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: flex-start;
}

.exchange-menu {
  display: grid;
  gap: 8px;
  width: 100%;
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(181, 196, 205, 0.22);
  background: rgba(7, 12, 14, 0.98);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.44);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: translateZ(0);
}

#exchangeCard {
  position: relative;
}

#exchangeCard.menu-open {
  border-color: var(--border-active);
  box-shadow: inset 0 0 0 1px rgba(87, 245, 120, 0.12);
}

.exchange-option {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 22, 25, 0.92);
  color: var(--text);
  padding: 6px 8px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.exchange-option.active {
  border-color: var(--border-active);
  box-shadow: inset 0 0 0 1px rgba(87, 245, 120, 0.18);
}

.exchange-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(20, 30, 34, 0.6);
  border: 1px solid rgba(181, 196, 205, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.exchange-icon-img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: block;
}

.exchange-icon-fallback {
  font-size: 0.78rem;
  font-weight: 700;
  color: #d7e0e6;
}

.exchange-option-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.exchange-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.exchange-tag {
  border-radius: 999px;
  border: 1px solid rgba(87, 245, 120, 0.25);
  background: rgba(47, 74, 53, 0.32);
  color: #95f5aa;
  font-size: 0.67rem;
  padding: 2px 8px;
  letter-spacing: 0.02em;
}

.exchange-tag.muted {
  border-color: rgba(181, 196, 205, 0.26);
  background: rgba(35, 44, 48, 0.45);
  color: #b8c8d0;
}

.exchange-hint {
  border: 1px solid rgba(181, 196, 205, 0.22);
  border-radius: 12px;
  background: rgba(20, 30, 34, 0.45);
  color: #c6d4dc;
  padding: 8px 10px;
  font-size: 0.84rem;
  margin-bottom: 10px;
  line-height: 1.35;
}

.exchange-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  gap: 8px;
  margin-bottom: 8px;
}

.icon-btn {
  min-width: 42px;
  width: 42px;
  padding: 8px 0;
  text-align: center;
}

.inline-config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}

.inline-error {
  color: #ff9b9b;
  border: 1px solid rgba(255, 120, 120, 0.4);
  background: rgba(60, 14, 14, 0.38);
  border-radius: 10px;
  padding: 8px 9px;
  font-size: 0.86rem;
}

@keyframes pulseOnLoad {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.control-column .card,
.actions,
.meta {
  animation: pulseOnLoad 220ms ease both;
}

.bots-column .bot-card:nth-child(2),
.control-column .card:nth-child(2) { animation-delay: 50ms; }
.bots-column .bot-card:nth-child(3),
.control-column .card:nth-child(3) { animation-delay: 90ms; }
.bots-column .bot-card:nth-child(4) { animation-delay: 120ms; }

body.auth-only .layout-grid {
  display: none;
}

body.auth-only .head-badge,
body.auth-only .head-logout,
body.auth-only .live-pulse {
  display: none !important;
}

body.auth-only .shell {
  width: 100%;
  max-width: 1020px;
  min-width: 0;
  margin-top: 0;
  padding: 36px 36px;
  border-radius: 28px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.auth-only .window-head {
  margin-bottom: 22px;
}

body.auth-only .auth-card {
  margin-bottom: 0;
  min-height: 360px;
  border-radius: 20px;
  padding: 16px;
}

body.auth-only .auth-grid {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 18px;
  min-width: 0;
}

body.auth-only .auth-row {
  gap: 14px;
  display: grid;
  grid-template-columns: 1fr;
}

body.auth-only .auth-card h2 {
  font-size: 1.7rem;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}

body.auth-only .field-input {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  font-size: 1.22rem;
  padding: 16px 18px;
  border-radius: 14px;
  box-sizing: border-box;
}

body.auth-only .action-btn {
  font-size: 1.25rem;
  padding: 15px 24px;
}

body.auth-only .auth-login-btn.action-btn.start {
  color: #0d1a12;
  font-weight: 600;
  background: linear-gradient(180deg, #45c06f, #2f8f4e);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  text-shadow: none;
}

body.auth-only .auth-login-btn.action-btn.start:hover {
  background: linear-gradient(180deg, #52cf7c, #369456);
  transform: translateY(-1px);
}

body.auth-only .auth-login-btn.action-btn.start:active {
  transform: translateY(0);
}

body.auth-only .auth-trust,
body.auth-only .auth-login-card {
  border-radius: 18px;
  padding: 20px;
}

body.auth-only .trust-list li {
  font-size: 1.05rem;
}

body.auth-only .auth-note {
  font-size: 0.98rem;
}

body.auth-only .auth-uptime {
  min-height: 58px;
  font-size: 1rem;
}

body.auth-only .auth-uptime strong {
  font-size: 1.15rem;
}

body.auth-only .eye-btn {
  min-width: 54px;
  height: 38px;
}

body.auth-only .eye-icon {
  width: 18px;
  height: 18px;
}

body.auth-only .text-link-btn {
  font-size: 1rem;
}

body.auth-only .window-brand-copy h1 {
  font-size: 1.22rem;
  letter-spacing: 0.02em;
}

body:not(.auth-only) .auth-card {
  display: none;
}

@media (max-width: 900px) {
  body {
    align-items: flex-start;
    padding: 8px;
  }

  .window-head {
    flex-wrap: wrap;
    gap: 10px;
  }

  .window-brand {
    flex: 1 1 100%;
    max-width: none;
    order: 1;
    width: 100%;
    gap: 10px;
    padding: 5px 8px;
    justify-content: center;
  }

  .window-brand-copy h1 {
    font-size: 0.9rem;
  }

  .live-pulse,
  .head-badge,
  .head-logout {
    order: 2;
  }

  body.auth-only {
    align-items: flex-start;
  }

  body.auth-only .shell {
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    padding: 10px;
  }

  body.auth-only .auth-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.auth-only .auth-login-card {
    order: -1;
    scroll-margin-top: min(120px, 28vh);
  }

  body.auth-only #loginEmail {
    scroll-margin-top: min(120px, 28vh);
  }

  body.auth-only .auth-trust {
    order: 1;
  }

  body.auth-only .auth-card {
    min-height: 0;
  }

  body.auth-only .window-head {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  body.auth-only .field-input {
    min-width: 0;
    width: 100%;
    font-size: 1.02rem;
    padding: 11px 13px;
  }

  .window-brand-copy h1 {
    white-space: normal;
  }

  body.auth-only .action-btn {
    font-size: 1rem;
    padding: 11px 15px;
  }

  body.auth-only .auth-login-btn.action-btn.start {
    padding: 12px 18px;
    font-size: 1.02rem;
  }

  .shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 10px;
  }

  .bot-card {
    min-height: 100px;
  }

  .bot-card span,
  .action-btn,
  .value-pill {
    font-size: 0.96rem;
  }

  .trade-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

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

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

  .meta {
    flex-direction: column;
  }

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

  .auth-info {
    justify-content: flex-start;
  }

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

  .exchange-form .field-input {
    width: 100%;
  }

  .exchange-form #saveExchangeBtn {
    grid-column: 1 / -1;
  }

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

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

@media (max-width: 768px) {
  .layout-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .bots-column {
    border-right: none;
    padding-right: 0;
    gap: 8px;
  }

  .bots-column::after {
    display: none;
  }

  .control-column {
    padding-left: 0;
    padding-bottom: 0;
    gap: 8px;
  }

  .locked-preview-perf {
    min-height: 0;
    padding: 10px 12px;
  }

  .locked-preview-canvas-wrap {
    min-height: 180px;
  }

  .shell {
    padding: 10px 10px 12px;
  }

  /* Eingeloggt: Kopfzeile klebend, Navigation beim Scrollen sichtbar */
  body:not(.auth-only) .window-head {
    position: sticky;
    top: 0;
    z-index: 60;
    margin: 0 -10px 10px;
    padding: 10px 10px 12px;
    background: linear-gradient(180deg, rgba(12, 16, 18, 0.98) 0%, rgba(12, 16, 18, 0.93) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(88, 118, 130, 0.3);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  }
}

@media (max-width: 640px) {
  body {
    padding: 6px;
    padding-left: max(6px, env(safe-area-inset-left, 0px));
    padding-right: max(6px, env(safe-area-inset-right, 0px));
  }

  body.auth-only .shell {
    padding: 12px 10px;
    border-radius: 18px;
  }

  body.auth-only .window-head {
    margin-bottom: 8px;
    padding-bottom: 8px;
    gap: 8px;
  }

  body.auth-only .auth-card {
    padding: 10px;
  }

  body.auth-only .auth-card h2 {
    font-size: 1.05rem;
    margin-bottom: 8px;
  }

  body.auth-only .auth-trust,
  body.auth-only .auth-login-card {
    padding: 12px;
    border-radius: 14px;
  }

  body.auth-only .auth-grid {
    gap: 8px;
  }

  body.auth-only .trust-list {
    gap: 6px;
  }

  body.auth-only .head-help {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 0.76rem;
  }

  body.auth-only .lang-switch-dash:not(.lang-dropdown) {
    padding: 2px 4px;
    gap: 4px;
  }

  body.auth-only .lang-flag-svg {
    width: 20px;
    height: 12px;
  }

  body.auth-only .lang-switch-dash .lang-btn {
    padding: 3px 6px;
  }

  body.auth-only .lang-switch-dash.lang-dropdown .lang-dropdown-toggle {
    min-height: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0 7px 0 8px;
    gap: 4px;
  }

  body.auth-only .lang-switch-dash.lang-dropdown .lang-dropdown-toggle .lang-flag-svg {
    width: 20px;
    height: 12px;
  }

  body.auth-only .lang-switch-dash.lang-dropdown .lang-dropdown-panel {
    min-width: 116px;
    padding: 5px;
  }

  body.auth-only .head-social-link {
    width: 30px;
    height: 30px;
  }

  body.auth-only .trust-list li {
    font-size: 0.92rem;
    gap: 10px;
  }

  body.auth-only .auth-uptime {
    min-height: 0;
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  body.auth-only .auth-uptime strong {
    font-size: 0.95rem;
  }

  body.auth-only .auth-note {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .shell {
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
    padding: 8px;
  }

  body:not(.auth-only) .window-head {
    margin-left: -8px;
    margin-right: -8px;
  }

  .window-head {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .head-help {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .head-social-link {
    width: 32px;
    height: 32px;
  }

  .window-brand {
    flex: 1 1 100%;
    gap: 8px;
    padding: 4px 7px;
    order: 1;
    justify-content: center;
  }

  .live-pulse,
  .head-badge,
  .head-logout {
    order: 2;
  }

  .window-brand-copy h1 {
    font-size: 0.84rem;
  }

  .window-brand-dot {
    width: 7px;
    height: 7px;
  }

  .bot-card {
    min-height: 76px;
    padding: 8px 10px;
  }

  .bot-title-wrap span {
    font-size: 0.95rem;
  }

  .bot-sub {
    font-size: 0.72rem;
    margin-top: 3px;
  }

  .bot-icon {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .card {
    padding: 8px;
    border-radius: 12px;
  }

  .card h2 {
    font-size: 0.82rem;
    margin-bottom: 6px;
  }

  .value-pill {
    min-height: 34px;
    font-size: 0.9rem;
    padding: 0 8px;
  }

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

  .exchange-form #clearExchangeBtn,
  .exchange-form #saveExchangeBtn {
    width: 100%;
  }

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

  .action-btn {
    font-size: 0.88rem;
    padding: 8px 10px;
  }

  .action-btn.bot-subscribe-btn {
    font-size: 0.68rem;
    padding: 5px 11px;
    min-height: 30px;
  }

  .perf-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .history-list {
    max-height: 180px;
  }

  .meta {
    font-size: 0.7rem;
  }
}

@media (max-width: 640px) {
  .exchange-form {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bot-card,
  .action-btn,
  .accordion-chevron {
    transition-duration: 0.01ms !important;
  }

  .window-brand-dot,
  .live-dot,
  .trust-dot.ok,
  .bot-icon.pulse {
    animation: none !important;
  }
}
