*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overscroll-behavior-y: contain;
}

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --bg-input: #1f1f1f;
  --border: #2a2a2a;
  --border-light: #333333;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --green: #16a34a;
  --green-light: #22c55e;
  --green-bg: rgba(22, 163, 74, 0.15);
  --red: #ef4444;
  --red-light: #f87171;
  --red-bg: rgba(239, 68, 68, 0.15);
  --yellow: #eab308;
  --purple: #a855f7;
  --blue: #3b82f6;
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 480px;
  --nav-height: 70px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  padding-bottom: var(--nav-height);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  width: 100%;
}

a {
  color: var(--green);
  text-decoration: none;
}

img {
  max-width: 100%;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  overflow-x: clip;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-header-dashboard {
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.header-row-top,
.header-row-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-spacer {
  flex: 1;
}

.page-header .back-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.page-header h1 {
  font-size: 18px;
  font-weight: 600;
}

.page-header .header-icon {
  width: 28px;
  height: 28px;
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  max-width: var(--max-width);
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: var(--font);
  white-space: nowrap;
}

.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 600;
}

.tab-content {
  display: none;
  padding: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.tab-content.active {
  display: block;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

.card-sm {
  padding: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.card-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.card .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.card .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.card .value-sm {
  font-size: 16px;
  font-weight: 600;
}

.positive {
  color: var(--green-light) !important;
}

.negative {
  color: var(--red-light) !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.badge-green {
  background: var(--green-bg);
  color: var(--green-light);
}

.badge-red {
  background: var(--red-bg);
  color: var(--red-light);
}

.badge-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-running {
  background: var(--green-bg);
  color: var(--green-light);
}

.badge-paused {
  background: var(--red-bg);
  color: var(--red-light);
}

.equity-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 12px;
}

.equity-card .label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.equity-card .value {
  font-size: 32px;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-primary {
  background: var(--green);
  color: white;
}

.btn-primary:hover {
  background: #15803d;
}

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-outline:hover {
  background: var(--bg-card);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-group {
  display: flex;
  gap: 8px;
}

.btn-group .btn {
  flex: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a0a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.form-row:last-child {
  border-bottom: none;
}

.form-row .row-label {
  font-size: 14px;
  color: var(--text-primary);
}

.order-min-hint {
  font-size: 11px;
  color: var(--text-muted, #888);
  font-weight: 400;
}
.order-min-hint.hint-error {
  color: #e54b4b;
  font-weight: 600;
}
input.input-notional-error {
  border-color: #e54b4b !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(229,75,75,0.22);
}

.form-row .row-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-row .row-value input,
.form-row .row-value select {
  width: auto;
  min-width: 80px;
  text-align: right;
  padding: 6px 10px;
  font-size: 14px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border-light);
  border-radius: 26px;
  transition: 0.3s;
}

.switch .slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background: var(--green);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--nav-height);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  transition: color 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
}

.nav-item.active {
  color: var(--green);
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item.center-btn {
  position: relative;
  margin-top: -20px;
}

.nav-item.center-btn .bot-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--green), #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4);
}

.nav-item.center-btn svg {
  width: 26px;
  height: 26px;
  color: white;
}

.position-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.position-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.position-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pair-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.coin-logo {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.coin-logo-fallback {
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.position-pair .pair-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.position-pair .pair-name .pair-stable {
  font-weight: 400;
  font-size: 13px;
  color: var(--text-muted);
}

.position-pair .pair-price {
  color: var(--purple);
  font-size: 14px;
  font-weight: 600;
}

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

.pos-info-btn, .pos-arrow-btn {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.pos-info-btn:hover, .pos-arrow-btn:hover {
  color: var(--text-primary);
}

.position-card.sim-border {
  border: 1px dashed rgba(234, 179, 8, 0.3);
}

.position-side {
  padding: 8px 0;
}

.position-side.clickable {
  cursor: pointer;
  transition: background 0.2s;
}

.position-side.clickable:hover {
  background: rgba(255, 255, 255, 0.03);
}

.sim-dca-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--yellow);
  margin-left: 4px;
}

.position-side + .position-side {
  border-top: 1px solid var(--border);
}

.position-side .side-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.side-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.side-icon.long {
  background: var(--green-bg);
  color: var(--green-light);
}

.side-icon.short {
  background: var(--red-bg);
  color: var(--red-light);
}

.side-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
}

.position-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  padding-left: 30px;
}

.position-stats .stat {
  text-align: left;
}

.position-stats .stat .stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 1px;
}

.position-stats .stat .stat-value {
  font-size: 12px;
  font-weight: 600;
}

.position-stats .stat .stat-value .pnl-pct {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
}

.position-stats .stat .stat-value .stat-max-orders {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.position-stats .stat .stat-value .stat-sub-qty {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
}

.stat-sub-qty {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
}

.position-next-dca {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0 2px 30px;
  font-size: 11px;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 4px;
}

.next-dca-label {
  color: var(--text-muted);
  font-weight: 400;
}

.next-dca-price {
  color: var(--accent);
  font-weight: 600;
}

.next-dca-pct {
  font-weight: 400;
  opacity: 0.7;
}

.positions-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.positions-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  opacity: 0.5;
}

.positions-search-wrap .positions-search {
  padding: 12px 40px 12px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font);
  box-sizing: border-box;
  outline: none;
}
.positions-search-wrap .positions-search:focus {
  border-color: var(--green);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-clear-btn:active {
  color: var(--text-primary);
}

.positions-search::placeholder {
  color: var(--text-muted);
}

.market-header {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.market-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.market-row:last-child {
  border-bottom: none;
}

.market-coin {
  display: flex;
  flex-direction: column;
}

.market-coin-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.market-coin .coin-name {
  font-weight: 700;
  font-size: 15px;
}

.market-coin .coin-name span {
  font-weight: 400;
  color: var(--text-muted);
}

.market-coin .coin-volume {
  font-size: 12px;
  color: var(--text-muted);
}

.market-price {
  font-weight: 600;
  font-size: 14px;
  text-align: right;
}

.add-coin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  margin-top: 16px;
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--green);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.add-coin-btn:active {
  background: rgba(22, 163, 74, 0.1);
  border-color: var(--green);
}

.market-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.market-modal {
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  height: 80%;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.market-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.market-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}
.market-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.market-modal-list {
  overflow-y: auto;
  flex: 1;
  min-height: 100px;
}

.pnl-bar {
  margin-bottom: 16px;
}

.pnl-bar .pnl-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pnl-bar .pnl-coin-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.pnl-bar .pnl-name {
  font-size: 14px;
}

.pnl-bar .pnl-name .pair-stable {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
}

.pnl-bar .bar-container {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.pnl-bar .bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.pnl-bar .bar-fill.positive {
  background: var(--green-light);
}

.pnl-bar .bar-fill.negative {
  background: var(--red-light);
}

.pnl-bar .pnl-value {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

.pnl-bar .pnl-unrealized {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.72;
  margin-left: 2px;
  letter-spacing: 0.01em;
}
.pnl-bar .pnl-unrealized.positive {
  color: var(--green-light);
}
.pnl-bar .pnl-unrealized.negative {
  color: var(--red-light);
}

.period-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.period-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.period-btn.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-bg);
}

.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  min-height: 200px;
  position: relative;
}

.chart-container canvas {
  width: 100% !important;
  height: 180px !important;
}

.calendar {
  margin-bottom: 16px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.calendar-nav {
  display: flex;
  gap: 12px;
}

.calendar-nav button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day-header {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px;
}

.calendar-day {
  text-align: center;
  padding: 8px 4px;
  font-size: 13px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.calendar-day.today {
  border-color: var(--green);
}

.calendar-day .day-profit {
  font-size: 10px;
  font-weight: 600;
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
}

.calendar-day.cal-positive {
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.08);
}

.calendar-day.cal-negative {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.08);
}

.calendar-day.selected {
  border-color: var(--purple);
  background: rgba(168, 85, 247, 0.15);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 380px;
}

.login-logo {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-register-link {
  text-align: center;
  margin-top: 16px;
}

.login-no-account {
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.login-no-account:hover {
  color: var(--green-light);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
}

.otp-inputs input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  font-family: monospace;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-top: 8px;
}

.disclaimer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 16px;
}

.log-entry {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.log-type {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.log-type.bot-event {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}

.log-type.dca {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
}

.log-type.kill-switch {
  background: var(--red-bg);
  color: var(--red-light);
}

.log-type.order {
  background: var(--green-bg);
  color: var(--green-light);
}

.log-type.error {
  background: var(--red-bg);
  color: var(--red-light);
}

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

.log-message {
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-word;
  overflow-wrap: break-word;
}

.api-key-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: opacity 0.15s, border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.api-key-card.dragging {
  opacity: 0.35;
  cursor: grabbing;
}
.api-key-card.drag-over {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(22,163,74,0.25);
}
.drag-handle {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  cursor: grab;
  padding: 4px 10px 4px 0;
  flex-shrink: 0;
  touch-action: none;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.drag-handle:hover { opacity: 1; }
.drag-handle:active { cursor: grabbing; }

.api-key-info .key-label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.api-key-info .key-exchange {
  font-size: 12px;
  color: var(--text-muted);
}

.api-key-info .key-masked {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
  margin-top: 2px;
  overflow-wrap: break-word;
  word-break: break-all;
}

.api-key-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.input-with-copy {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-copy input {
  flex: 1;
  min-width: 0;
}

.copy-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.copy-btn:active {
  background: var(--green);
  color: #fff;
}

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

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

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

.key-status {
  margin-top: 6px;
}

.key-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1.2;
}

.key-status-badge.checking {
  background: var(--bg-input);
  color: var(--text-secondary);
}

.key-status-badge.ok {
  background: rgba(22, 163, 74, 0.15);
  color: var(--green);
}

.key-status-badge.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  word-break: break-word;
}

.btn-detect-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  justify-content: center;
}

.btn-detect-mode:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-detect-mode:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.detect-mode-result {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.detect-mode-result.result-ok {
  background: rgba(22, 163, 74, 0.12);
  color: var(--green);
}

.detect-mode-result.result-warn {
  background: rgba(234, 179, 8, 0.12);
  color: #ca8a04;
}

.detect-mode-result.result-error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

.position-mode-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.position-mode-badge.badge-oneway {
  background: rgba(22, 163, 74, 0.15);
  color: var(--green);
}

.position-mode-badge.badge-hedge {
  background: rgba(234, 179, 8, 0.18);
  color: #ca8a04;
}

.btn-switch-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 4px;
  margin-left: 2px;
  vertical-align: middle;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}

.btn-switch-mode:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.btn-switch-mode:disabled {
  cursor: default;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}

.loading::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.dash-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.45;
  transition: opacity 0.3s;
}
.dash-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: transparent;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 14px;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 9999;
  animation: slideDown 0.3s ease;
  max-width: 90%;
}

.toast.success {
  background: var(--green);
  color: white;
}

.toast.error {
  background: var(--red);
  color: white;
}

@keyframes slideDown {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

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

.pair-chip {
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pair-chip.selected {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green-light);
}

.quick-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.quick-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.quick-action-btn:hover {
  background: var(--bg-card-hover);
}

.quick-action-btn svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.radial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.radial-overlay.open {
  opacity: 1;
  visibility: visible;
}

.radial-menu {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 4px;
  width: 100%;
  max-width: 360px;
  padding: 24px 12px;
  margin-bottom: 16px;
}

.radial-center {
  grid-column: 1 / -1;
  justify-self: center;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--green), #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(22, 163, 74, 0.5);
  transition: transform 0.2s;
  order: 99;
  margin-top: 8px;
}

.radial-center:hover {
  opacity: 0.9;
}

.radial-center svg {
  width: 24px;
  height: 24px;
  color: white;
}

.radial-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.5) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: none;
  border: none;
  font-family: var(--font);
  padding: 8px 4px;
}

.radial-overlay.open .radial-item {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.radial-item:nth-child(2) { transition-delay: 0.03s; }
.radial-item:nth-child(3) { transition-delay: 0.06s; }
.radial-item:nth-child(4) { transition-delay: 0.09s; }
.radial-item:nth-child(5) { transition-delay: 0.12s; }
.radial-item:nth-child(6) { transition-delay: 0.15s; }
.radial-item:nth-child(7) { transition-delay: 0.18s; }
.radial-item:nth-child(8) { transition-delay: 0.21s; }
.radial-item:nth-child(9) { transition-delay: 0.24s; }

.radial-item .radial-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.radial-item:hover .radial-icon {
  background: var(--green-bg);
  box-shadow: 0 0 15px rgba(22, 163, 74, 0.4);
}

.radial-item .radial-icon svg {
  width: 20px;
  height: 20px;
  color: var(--green-light);
}

.radial-item .radial-icon.danger {
  border-color: var(--red);
}

.radial-item .radial-icon.danger svg {
  color: var(--red-light);
}

.radial-item:hover .radial-icon.danger {
  background: var(--red-bg);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.radial-item .radial-label {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  text-align: center;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 16px;
  margin: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-bg);
  border: 2px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-avatar svg {
  color: var(--green-light);
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  transition: color 0.2s;
  flex-shrink: 0;
}

.profile-edit-btn:hover {
  color: var(--green-light);
}

.profile-name-edit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-name-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font);
  padding: 6px 10px;
  outline: none;
  min-width: 0;
}

.profile-name-input:focus {
  border-color: var(--green);
}

.profile-save-btn,
.profile-cancel-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.2s;
}

.profile-save-btn {
  color: var(--green-light);
}

.profile-save-btn:hover {
  background: var(--green-bg);
}

.profile-cancel-btn {
  color: var(--text-muted);
}

.profile-cancel-btn:hover {
  background: rgba(255,255,255,0.08);
}

.profile-email {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-whatsapp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.profile-whatsapp {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-whatsapp--empty {
  color: var(--text-secondary);
  opacity: 0.5;
  font-style: italic;
}

.profile-menu {
  margin: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.2s;
  border-bottom: 1px solid var(--border);
}

.profile-menu-item:last-child {
  border-bottom: none;
}

.profile-menu-item:hover,
.profile-menu-item:active {
  background: var(--bg-card-hover);
}

.profile-menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-menu-icon svg {
  color: var(--green-light);
}

.profile-menu-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-menu-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.profile-menu-value {
  font-size: 12px;
  color: var(--text-secondary);
}

.profile-menu-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

.btn-danger-outline {
  border-color: var(--red) !important;
  color: var(--red-light) !important;
}

.btn-danger-outline:hover,
.btn-danger-outline:active {
  background: var(--red-bg) !important;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.quick-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  text-decoration: none;
  color: inherit;
}

.quick-grid-item .grid-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.quick-grid-item:hover .grid-icon {
  border-color: var(--green);
  background: var(--green-bg);
}

.quick-grid-item .grid-icon svg {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
}

.quick-grid-item:hover .grid-icon svg {
  color: var(--green-light);
}

.quick-grid-item .grid-icon.danger svg {
  color: var(--red-light);
}

.quick-grid-item .grid-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.3;
}

.exchange-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 10px;
  max-width: var(--max-width);
  margin: 0 auto;
  overflow-x: hidden;
}

.exchange-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  text-decoration: none;
  flex: 0 0 calc((100% - 16px) / 3);
  min-width: 0;
  justify-content: center;
}

.exchange-chip.active {
  border-color: var(--green);
  background: var(--green-bg);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(22, 163, 74, 0.15);
}

.exchange-chip .exchange-logo {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.exchange-chip .exchange-logo svg {
  width: 16px;
  height: 16px;
}

.exchange-chip .exchange-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.exchange-chip .exchange-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.exchange-chip .exchange-label {
  font-size: 10px;
  color: var(--text-muted);
}

.exchange-chip.active .exchange-label {
  color: var(--green-light);
}

.exchange-chip .exchange-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-left: 2px;
  flex-shrink: 0;
}

.exchange-chip.active .exchange-status {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.exchange-chip-skeleton {
  min-height: 40px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--border) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer-chip 1.4s infinite;
  border-color: transparent;
}

@keyframes shimmer-chip {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.default-banner {
  background: var(--green-bg);
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--green-light);
  margin: 0 16px 12px;
  max-width: calc(var(--max-width) - 32px);
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.default-banner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.badge-custom {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--green-bg);
  color: var(--green-light);
  margin-left: 6px;
}

.badge-default {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(160, 160, 160, 0.15);
  color: var(--text-muted);
  margin-left: 6px;
}

.position-side.disabled > :not(.side-header) {
  opacity: 0.35;
  pointer-events: none;
}

.position-side.disabled .side-label {
  opacity: 0.5;
}

.position-side.suspended > :not(.side-header) {
  opacity: 0.7;
}

.position-side.suspended .side-label {
  color: var(--yellow);
}

.pair-suspended-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--yellow);
  margin-left: 4px;
  margin-right: 2px;
}

.side-suspended-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--yellow);
  background: rgba(243, 186, 47, 0.12);
  border: 1px solid rgba(243, 186, 47, 0.3);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}

.side-arrow.suspended {
  color: var(--yellow);
  font-size: 13px;
  letter-spacing: 0;
}

.side-dropdown-menu .menu-icon.suspend {
  color: var(--yellow);
}

.coin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.hedge-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.hedge-warning-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.hedge-warning-body strong {
  font-size: 13px;
  font-weight: 700;
  color: #f59e0b;
}

.hedge-warning-body span {
  color: var(--text-muted);
}

.hedge-warning-link {
  color: #f59e0b;
  text-decoration: underline;
  font-weight: 600;
}

.coin-tab {
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: var(--font);
  flex: 1;
  text-align: center;
}

.coin-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 600;
}

.coin-tab-content {
  display: none;
}

.coin-tab-content.active {
  display: block;
}


.sim-panel {
  max-width: var(--max-width);
  margin: 0 auto 16px;
  padding: 0 16px;
}

.sim-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.sim-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: #eab308;
}

.sim-reset-coin-btn {
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  color: var(--text-muted);
  padding: 4px 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.sim-reset-coin-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
  color: var(--red-light);
}

.sim-reset-coin-btn:not(.delete-coin-btn) {
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}
.sim-reset-coin-btn:not(.delete-coin-btn):hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.sim-heartbeat {
  font-size: 12px;
  color: var(--text-muted);
}

.sim-heartbeat.active {
  color: var(--green);
}

.prod-log-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card-bg);
  margin-bottom: 6px;
  border: 1px solid var(--border-color);
}
.prod-log-error {
  border-color: rgba(239, 68, 68, 0.3);
}
.prod-log-error .prod-log-icon {
  color: var(--red-light);
}
.prod-log-ok .prod-log-icon {
  color: var(--green);
}
.prod-log-icon {
  flex-shrink: 0;
  margin-top: 2px;
}
.prod-log-content {
  flex: 1;
  min-width: 0;
}
.prod-log-msg {
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-word;
}
.prod-log-detail {
  font-size: 11px;
  color: var(--red-light);
  margin-top: 3px;
  word-break: break-word;
  opacity: 0.85;
}
.prod-log-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.sim-heartbeat.inactive {
  color: var(--red);
}

.sim-card {
  border: 1px dashed rgba(234, 179, 8, 0.3) !important;
}

.sim-position-card {
  background: var(--bg-card);
  border: 1px dashed rgba(234, 179, 8, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.sim-position-card .sim-pos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sim-position-card .sim-pos-pair {
  font-weight: 600;
  font-size: 14px;
}

.sim-position-card .sim-pos-side {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.sim-position-card .sim-pos-side.long {
  background: var(--green-bg);
  color: var(--green);
}

.sim-position-card .sim-pos-side.short {
  background: var(--red-bg);
  color: var(--red);
}

.sim-position-card .sim-pos-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
  font-size: 12px;
}

.sim-position-card .sim-pos-stats .label {
  font-size: 10px;
}

.sim-position-card.clickable {
  cursor: pointer;
  transition: border-color 0.2s;
}
.sim-position-card.clickable:hover {
  border-color: var(--accent);
}

.sim-orders-count {
  font-size: 9px;
  opacity: 0.7;
  margin-left: 4px;
  font-weight: 400;
}

.sim-pos-orders {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.sim-orders-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sim-orders-header {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr 0.8fr 1fr;
  gap: 4px;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.sim-orders-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr 0.8fr 1fr;
  gap: 4px;
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: center;
}
.sim-orders-row:last-child {
  border-bottom: none;
}

.sim-order-type {
  font-weight: 600;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  display: inline-block;
}
.sim-order-type.type-open {
  color: var(--green);
  background: var(--green-bg);
}
.sim-order-type.type-reopen {
  color: var(--green);
  background: var(--green-bg);
}
.sim-order-type.type-dca {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
}
.sim-order-type.type-close-tp {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}
.sim-order-type.type-close-sl {
  color: var(--red);
  background: var(--red-bg);
}
.sim-order-type.type-close-manual {
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
}

.sim-order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.sim-order-row:last-child {
  border-bottom: none;
}

.sim-order-type {
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
}

.sim-order-type.open { background: var(--green-bg); color: var(--green); }
.sim-order-type.dca { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.sim-order-type.close_tp { background: var(--green-bg); color: var(--green-light); }
.sim-order-type.close_sl { background: var(--red-bg); color: var(--red); }
.sim-order-type.close_manual { background: rgba(234, 179, 8, 0.15); color: var(--yellow); }
.sim-order-type.reopen { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.sim-coin-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}

.sim-coin-info {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.sim-coin-logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.sim-coin-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.sim-coin-name .pair-stable {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
}

.sim-coin-status {
  font-size: 11px;
  color: var(--text-muted);
}

.sim-coin-status.active {
  color: var(--yellow);
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-border);
  border-radius: 24px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--yellow);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.side-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  position: relative;
}

.side-arrow {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: -2px;
}

.side-arrow.active.long {
  color: var(--green-light);
}

.side-arrow.active.short {
  color: var(--red-light);
}

.side-dropdown-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.2s;
}

.side-dropdown-btn:hover {
  color: var(--text-primary);
}

.side-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  min-width: 160px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: none;
}

.side-dropdown-menu.open {
  display: block;
}

.side-dropdown-menu.open-above {
  top: auto;
  bottom: calc(100% + 4px);
}

.side-dropdown-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font);
  text-align: left;
}

.side-dropdown-menu .menu-item:hover {
  background: var(--bg-card-hover);
}

.side-dropdown-menu .menu-item .menu-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.side-dropdown-menu .menu-item .menu-icon.start {
  color: var(--green-light);
}

.side-dropdown-menu .menu-item .menu-icon.stop {
  color: var(--red-light);
}

.side-dropdown-menu .menu-item + .menu-item {
  border-top: 1px solid var(--border);
}

.sim-coin-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.side-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  user-select: none;
}

.side-checkbox input {
  display: none;
}

.side-check-box {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.side-check-box svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transition: opacity 0.15s;
}

.side-checkbox.long .side-check-box {
  border-color: rgba(34, 197, 94, 0.4);
}

.side-checkbox.short .side-check-box {
  border-color: rgba(239, 68, 68, 0.4);
}

.side-checkbox.long input:checked ~ .side-check-box {
  background: var(--green-light);
  border-color: var(--green-light);
}

.side-checkbox.short input:checked ~ .side-check-box {
  background: var(--red-light);
  border-color: var(--red-light);
}

.side-checkbox input:checked ~ .side-check-box svg {
  opacity: 1;
  stroke: #000;
}

.side-check-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.15s;
}

.side-checkbox.long input:checked ~ .side-check-label {
  color: var(--green-light);
}

.side-checkbox.short input:checked ~ .side-check-label {
  color: var(--red-light);
}


.precision-value {
  display: inline-block;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  min-width: 24px;
  text-align: center;
}

.pnl-pct {
  font-size: 11px;
  opacity: 0.75;
}

.confirm-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-overlay.active {
  display: flex;
}

.confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.confirm-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.confirm-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s;
}

.confirm-btn.cancel {
  background: var(--bg-hover);
  color: var(--text-muted);
}

.confirm-btn.cancel:hover {
  background: var(--border);
}

.confirm-btn.ok {
  background: #dc2626;
  color: #fff;
}

.confirm-btn.ok:hover {
  background: #b91c1c;
}

.btn-set {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-set:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.strategy-preset-hint {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 8px;
  color: #16a34a;
  font-size: 12px;
  line-height: 1.4;
}

[data-field-group="advanced"].preset-locked {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-primary);
  z-index: 10000;
  overflow-y: auto;
}

.ratio-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.ratio-modal {
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  max-height: 70dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px;
  animation: slideUp 0.25s ease-out;
}

.ratio-modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  margin: 10px auto 8px;
}

.ratio-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 12px;
}

.ratio-modal-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.ratio-side-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ratio-table-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 4px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: lowercase;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ratio-table-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.ratio-table-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0 4px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  min-height: 48px;
}

.ratio-table-row .layer-num {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.ratio-table-row .ratio-input-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.ratio-table-row .ratio-input-wrap input {
  width: 60px;
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-align: right;
  font-family: var(--font);
}

.ratio-table-row .ratio-input-wrap input:focus {
  outline: none;
  border-color: var(--green);
}

.ratio-table-row .ratio-input-wrap span {
  color: var(--text-muted);
  font-size: 14px;
}

.ratio-modal-footer {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  flex-shrink: 0;
}

.ratio-modal-footer .btn {
  flex: 1;
}

.lang-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-left: auto;
}

.lang-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-btn.active {
  background: var(--green);
  color: white;
}

.lang-btn + .lang-btn {
  border-left: 1px solid var(--border);
}

.wallet-balance-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px;
  margin: 0 16px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.wallet-balance-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wallet-balance-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-bg);
  color: var(--green);
  border-radius: 12px;
  flex-shrink: 0;
}

.wallet-balance-info {
  flex: 1;
  min-width: 0;
}

.wallet-balance-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.wallet-balance-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
  line-height: 1.1;
}

.wallet-balance-stats {
  display: flex;
  gap: 12px;
}

.wallet-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--bg-main);
  border-radius: 8px;
}

.wallet-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.wallet-stat-value {
  font-size: 16px;
  font-weight: 600;
}

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

.wallet-stat-negative {
  color: var(--red);
}

.btn-buy-gas {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
}

.gas-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--green-bg);
  color: var(--green);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.gas-header-badge svg {
  width: 14px;
  height: 14px;
}

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.tx-item:last-child {
  border-bottom: none;
}

.tx-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.tx-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.tx-icon.tx-positive {
  background: var(--green-bg);
  color: var(--green);
}

.tx-icon.tx-negative {
  background: var(--red-bg);
  color: var(--red);
}

.tx-info {
  min-width: 0;
}

.tx-type {
  font-size: 14px;
  font-weight: 500;
}

.tx-desc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.tx-right {
  text-align: right;
  flex-shrink: 0;
}

.tx-amount {
  font-size: 14px;
  font-weight: 600;
}

.tx-amount.tx-positive { color: var(--green); }
.tx-amount.tx-negative { color: var(--red); }

.tx-date {
  font-size: 11px;
  color: var(--text-muted);
}

.referral-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 16px;
}

.referral-code-section {
  margin-bottom: 12px;
}

.referral-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.referral-code {
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 2px;
  font-family: monospace;
}

.btn-icon {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.referral-link-row {
  margin-top: 12px;
}

.referral-link-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.referral-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.referral-link-box:hover {
  border-color: var(--green);
}

.referral-link-box svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s;
}

.referral-link-box:hover svg {
  color: var(--green-light);
}

.referral-link-url {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referral-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.referral-item:last-child {
  border-bottom: none;
}

.referral-item-name {
  font-size: 14px;
  font-weight: 500;
}

.referral-item-date {
  font-size: 11px;
  color: var(--text-muted);
}

.referral-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.referral-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.status-activated {
  background: var(--green-bg);
  color: var(--green);
}

.status-registered {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}

.status-pending {
  background: rgba(234, 179, 8, 0.15);
  color: var(--yellow);
}

.referral-gas {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}

.pix-modal-box {
  max-width: 400px;
}

.pix-rate {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
}

.pix-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.pix-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pix-amount-btn {
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.2s, background 0.2s;
}

.pix-amount-btn:hover {
  border-color: var(--green);
}

.pix-amount-btn.active {
  border-color: var(--green);
  background: var(--green-bg);
  color: var(--green);
}

.pix-equivalent {
  text-align: center;
  font-size: 14px;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 16px;
  min-height: 20px;
}

.pix-qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: #ffffff;
  border-radius: var(--radius);
  margin-bottom: 16px;
  color: #333;
}

.pix-qr-label {
  font-size: 12px;
  margin-top: 8px;
  color: #666;
}

.pix-copy-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.pix-copy-row input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: monospace;
}

.pix-amount-display {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 16px;
}

.referral-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--green-bg);
  color: var(--green);
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

.gainer-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.gainer-card:hover { background: var(--bg-card-hover); }
.gainer-info { flex: 1; min-width: 0; }
.gainer-symbol { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.gainer-symbol .pair-stable { color: var(--text-muted); font-weight: 400; }
.gainer-price { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.gainer-stats { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gainer-change {
  font-weight: 600;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}
.rsi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}
.rsi-high { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.rsi-low { background: rgba(22, 163, 74, 0.12); color: #16a34a; }
.rsi-neutral { background: rgba(234, 179, 8, 0.12); color: #eab308; }
.gainers-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

@media (min-width: 768px) {
  :root {
    --max-width: 600px;
  }
}

/* ===== COIN CHART MODAL ===== */
.chart-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 600px) {
  .chart-modal-overlay { align-items: center; }
}
.chart-modal {
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 600px;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}
@media (min-width: 600px) {
  .chart-modal { border-radius: 16px; max-height: 80vh; }
}
.chart-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--border-color);
}
.chart-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.chart-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
}
.chart-modal-close:hover { color: var(--text-primary); }
.chart-timeframes {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  flex-wrap: wrap;
}
.tf-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.tf-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.tf-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.chart-modal-canvas-wrap {
  flex: 1;
  position: relative;
  padding: 8px 12px 16px;
  min-height: 240px;
}
#coin-chart-canvas {
  width: 100%;
  height: 380px;
  display: block;
}
.chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-card);
  border-radius: 8px;
}
.chart-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pos-chart-btn {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.pos-chart-btn:hover { color: var(--accent); }

/* ── Market Indicators Strip ─────────────────────────── */
.mkt-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}
.mkt-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  min-width: 0;
  overflow: hidden;
}
.mkt-section-lbl {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.mkt-fear-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px 6px;
}
.mkt-gauge-svg {
  width: 100%;
  max-width: 88px;
  height: auto;
}
.mkt-fear-num {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  margin-top: 1px;
  color: var(--text-primary);
}
.mkt-fear-lbl {
  font-size: 9px;
  font-weight: 700;
  margin-top: 2px;
  text-align: center;
}
/* Sub-label: fonte e frequência do índice */
.mkt-fg-source-lbl {
  font-size: 8px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1px;
  letter-spacing: 0.3px;
  opacity: 0.75;
}
/* Próxima atualização do F&G */
.mkt-fg-next {
  font-size: 7.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2px;
  opacity: 0.6;
}
/* Separador entre F&G e BTC Hoje */
.mkt-fear-divider {
  width: 85%;
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: 6px 0;
}
/* Bloco do F&G (gauge + número + label) */
.mkt-fg-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
/* Bloco do BTC momentum */
.mkt-btc-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 2px;
}
.mkt-btc-source-lbl {
  font-size: 8px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.3px;
  opacity: 0.75;
}
.mkt-btc-chg {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}
.mkt-btc-sentiment {
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}
.mkt-coins-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 8px 10px;
  min-width: 0;
}
.mkt-coin-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 3px;
  flex: 1;
}
.mkt-coin-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.mkt-coin-sym {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 32px;
  flex-shrink: 0;
}
.mkt-coin-price {
  flex: 1;
  font-size: 10px;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.mkt-coin-chg {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  min-width: 46px;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}
.mkt-coin-chg.positive { background: rgba(34,197,94,0.15); color: #22c55e; }
.mkt-coin-chg.negative { background: rgba(239,68,68,0.15);  color: #ef4444; }
.mkt-skeleton-row {
  height: 13px; border-radius: 4px;
  background: var(--border); opacity: 0.4; margin: 3px 0;
}

/* ── Desktop responsiveness for market strip ─────── */
@media (min-width: 600px) {
  .mkt-gauge-svg      { max-width: 80px; }
  .mkt-fear-num       { font-size: 20px; }
  .mkt-fear-lbl       { font-size: 10px; }
  .mkt-fg-source-lbl  { font-size: 9px; }
  .mkt-fg-next        { font-size: 8px; }
  .mkt-btc-source-lbl { font-size: 9px; }
  .mkt-btc-chg        { font-size: 17px; }
  .mkt-btc-sentiment  { font-size: 10px; }
  .mkt-coin-sym       { font-size: 12px; min-width: 36px; }
  .mkt-coin-price     { font-size: 11px; }
  .mkt-coin-chg       { font-size: 11px; min-width: 52px; }
  .mkt-section-lbl    { font-size: 10px; }
}
