:root {
  --control-height: 46px;
  --control-radius: 10px;
  --control-border: rgba(123, 174, 255, .28);
  --focus-ring: 0 0 0 3px rgba(57, 198, 255, .24), 0 0 28px rgba(57, 198, 255, .16);
}

#signalMethod { scroll-margin-top: 120px; }
button, .actions a { -webkit-tap-highlight-color: transparent; }

.actions button,
.actions a {
  position: relative;
  isolation: isolate;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, filter .16s ease;
}

.actions .primary {
  min-width: 220px;
  padding-inline: 24px 20px;
  border-color: rgba(255, 255, 255, .18);
  background: linear-gradient(105deg, #ff2fb3 0%, #bd3dff 49%, #596cff 100%);
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, .26), 0 12px 32px rgba(255, 47, 179, .22);
}

.actions .primary::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #bffcff;
  box-shadow: 0 0 12px #39c6ff;
}

.actions .primary::after {
  content: "↘";
  margin-left: 3px;
  color: rgba(255, 255, 255, .9);
  font-size: 15px;
}

.actions .secondary {
  min-width: 210px;
  padding-inline: 21px;
  color: #e9f7ff;
  background: linear-gradient(180deg, rgba(11, 17, 42, .84), rgba(5, 7, 25, .84));
  border-color: rgba(57, 198, 255, .34) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .055);
}

.actions .secondary::after {
  content: "?";
  width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(57, 198, 255, .38);
  border-radius: 50%;
  color: var(--blue);
  font-size: 10px;
}

.symbol-control { min-width: 0; }
.symbol-control input {
  min-height: var(--control-height);
  border-color: var(--control-border);
  background: rgba(3, 7, 24, .9);
}

.symbol-control #loadMarket {
  flex: 0 0 auto;
  min-height: var(--control-height);
  white-space: nowrap;
}

.timeframe-control {
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(123, 174, 255, .18);
  border-radius: 12px;
  background: rgba(3, 6, 21, .72);
}

.timeframe-control button,
.timeframe-control button:first-child,
.timeframe-control button:last-child {
  min-width: 49px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #858ca8;
  background: transparent;
  box-shadow: none;
  transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.timeframe-control button.active,
.timeframe-control button[aria-pressed="true"] {
  color: #fff;
  border-color: rgba(255, 47, 179, .58);
  background: linear-gradient(180deg, rgba(255, 47, 179, .24), rgba(104, 64, 224, .18));
  box-shadow: inset 0 1px rgba(255, 255, 255, .1), 0 0 18px rgba(255, 47, 179, .14);
}

.chart-nav {
  gap: 3px;
  padding: 3px;
  border-color: rgba(123, 174, 255, .22);
  border-radius: 10px;
  background: rgba(3, 7, 22, .9);
}

.chart-nav button,
.chart-nav button:last-child {
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #adb8d0;
  background: transparent;
  font-size: 13px;
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}

.chart-nav #resetChart {
  min-width: 58px;
  color: #65dbff;
  font-size: 8px;
  letter-spacing: .12em;
  border-left: 1px solid rgba(57, 198, 255, .12);
}

.chart-nav #resetChart.is-live {
  color: #fff;
  border-color: rgba(57, 198, 255, .28);
  background: rgba(57, 198, 255, .14);
  box-shadow: inset 0 -2px var(--blue);
}

button:focus-visible,
.actions a:focus-visible,
input:focus-visible {
  outline: 2px solid #91e7ff;
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}

:is(.actions a, #loadMarket, .timeframe-control button, .chart-nav button):active {
  transform: translateY(1px) scale(.985);
}

button:disabled {
  opacity: .38;
  cursor: not-allowed;
  filter: saturate(.45);
}

@media (hover: hover) {
  .actions .primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.07);
    box-shadow: inset 0 1px rgba(255, 255, 255, .3), 0 16px 38px rgba(255, 47, 179, .32);
  }
  .actions .secondary:hover {
    transform: translateY(-2px);
    border-color: rgba(57, 198, 255, .66) !important;
    box-shadow: 0 12px 28px rgba(57, 198, 255, .12);
  }
  .timeframe-control button:hover:not(.active) { color: #dce7ff; background: rgba(57, 198, 255, .08); }
  .chart-nav button:hover { color: #fff; background: rgba(57, 198, 255, .12); border-color: rgba(57, 198, 255, .22); }
}

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

@media (max-width: 800px) {
  #signalMethod { scroll-margin-top: 150px; }
  .actions a { min-height: 50px; flex: 1 1 100%; }
  .timeframe-control button,
  .timeframe-control button:first-child,
  .timeframe-control button:last-child { min-width: 44px; min-height: 44px; flex: 1; }
  .chart-nav button,
  .chart-nav button:last-child { min-width: 44px; height: 42px; }
  .chart-nav #resetChart { min-width: 62px; }
}

@media (max-width: 420px) {
  .actions { width: 100%; }
  .actions a {
    width: 100%;
    min-width: 0;
  }
  .symbol-control { flex-direction: column; gap: 8px; }
  .symbol-control input { min-height: 46px; border: 1px solid var(--control-border); border-radius: 8px; }
  .symbol-control #loadMarket { min-height: 46px; border-radius: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .actions a,
  .symbol-control button,
  .timeframe-control button,
  .chart-nav button { transition: none !important; }
}

@media (forced-colors: active) {
  .actions a,
  .symbol-control button,
  .timeframe-control button,
  .chart-nav button { border: 1px solid ButtonText; }
  .timeframe-control button[aria-pressed="true"] { outline: 2px solid Highlight; }
}
