.mt4bt-wrap {
  --mt4bt-line: #dbe4f0;
  --mt4bt-line-soft: rgba(148, 163, 184, 0.18);
  --mt4bt-text: #0f172a;
  --mt4bt-muted: #64748b;
  --mt4bt-primary: #1d4ed8;
  --mt4bt-primary-deep: #163d99;
  --mt4bt-bg-soft: linear-gradient(180deg, #fbfdff 0%, #f8fbff 100%);
  max-width: 1000px;
  margin: 0 auto;
  color: var(--mt4bt-text);
  font-family: inherit;
}

.mt4bt-wrap,
.mt4bt-wrap input,
.mt4bt-wrap button,
.mt4bt-wrap select,
.mt4bt-wrap textarea,
.mt4bt-wrap table {
  font-family: inherit;
}

.mt4bt-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.mt4bt-chart {
  width: 100%;
  height: 440px;
  padding: 0.3rem;
  border: 1px solid var(--mt4bt-line-soft);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.mt4bt-summary {
  margin-top: 1.15rem;
}

.mt4bt-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mt4bt-card {
  border: 1px solid var(--mt4bt-line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.mt4bt-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  border-color: rgba(59, 130, 246, 0.22);
}

.mt4bt-card.is-accent {
  border-color: rgba(59, 130, 246, 0.18);
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.mt4bt-card.is-warn {
  border-color: rgba(245, 158, 11, 0.18);
  background: linear-gradient(180deg, #fffaf2 0%, #fff6ea 100%);
}

.mt4bt-card-label {
  font-size: 0.77rem;
  color: var(--mt4bt-muted);
  margin-bottom: 0.42rem;
  letter-spacing: 0.02em;
}

.mt4bt-card-value {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--mt4bt-text);
  line-height: 1.45;
  word-break: break-word;
}

.mt4bt-card-value a {
  color: var(--mt4bt-primary);
  text-decoration: none;
}

.mt4bt-card-value a:hover {
  text-decoration: underline;
}

.mt4bt-summary-note,
.mt4bt-sim-note {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: var(--mt4bt-muted);
  line-height: 1.75;
}

.mt4bt-summary-note p,
.mt4bt-sim-note p {
  margin: 0.18rem 0;
}

.mt4bt-sim {
  margin-top: 1.4rem;
  padding: 1.2rem 1.2rem 1.1rem;
  border: 1px solid var(--mt4bt-line-soft);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05);
}

.mt4bt-sim-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mt4bt-sim-title {
  margin: 0;
  font-size: 1.14rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mt4bt-sim-desc {
  margin: 0.3rem 0 0;
  color: var(--mt4bt-muted);
  font-size: 0.89rem;
  line-height: 1.72;
}

.mt4bt-btn-primary,
.mt4bt-btn-sub {
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.mt4bt-btn-primary:hover,
.mt4bt-btn-sub:hover,
.mt4bt-toggle:hover,
.mt4bt-pager button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.mt4bt-sim-controls {
  display: grid;
  grid-template-columns: 1.2fr auto;
  gap: 12px;
  margin-top: 1rem;
  align-items: end;
}

.mt4bt-sim-controls-simple {
  max-width: 560px;
}

.mt4bt-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mt4bt-field label {
  font-size: 0.84rem;
  color: #334155;
  font-weight: 700;
}

.mt4bt-field input,
.mt4bt-field select {
  height: 44px;
  border: 1px solid #d4dbe7;
  border-radius: 12px;
  padding: 0 0.9rem;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.mt4bt-field input:focus,
.mt4bt-field select:focus {
  outline: none;
  border-color: rgba(29, 78, 216, 0.42);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.08);
}

.mt4bt-actions {
  display: flex;
  gap: 0.7rem;
}

.mt4bt-btn-primary {
  height: 44px;
  padding: 0 1.1rem;
  border: 1px solid var(--mt4bt-primary-deep);
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.2);
}

.mt4bt-btn-primary:hover {
  box-shadow: 0 14px 24px rgba(29, 78, 216, 0.24);
}

.mt4bt-btn-sub {
  height: 44px;
  padding: 0 1.05rem;
  border: 1px solid #d4dbe7;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--mt4bt-primary);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.mt4bt-btn-sub:hover {
  background: #f8fafc;
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.06);
}

.mt4bt-subtitle {
  margin: 1rem 0 0.7rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mt4bt-text);
}

.mt4bt-toggle {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  margin: 1.05rem 0 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #d6dee8;
  border-radius: 14px;
  color: var(--mt4bt-text);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.mt4bt-toggle:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
}

.mt4bt-table-area {
  margin-top: 0.75rem;
}

.mt4bt-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--mt4bt-line-soft);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.mt4bt-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
  font-size: 0.86rem;
}

.mt4bt-table th,
.mt4bt-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid #edf2f7;
  text-align: right;
  white-space: nowrap;
}

.mt4bt-table th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  text-align: center;
  font-weight: 700;
  color: #334155;
}

.mt4bt-table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.7);
}

.mt4bt-table tbody tr:hover {
  background: rgba(239, 246, 255, 0.9);
}

.mt4bt-table td:first-child,
.mt4bt-table td:nth-child(2) {
  text-align: left;
}

.mt4bt-table td:nth-child(3) {
  text-align: center;
}

.mt4bt-buy {
  color: #1565c0;
  font-weight: 700;
}

.mt4bt-sell {
  color: #e53935;
  font-weight: 700;
}

.mt4bt-plus {
  color: var(--mt4bt-text);
}

.mt4bt-minus {
  color: #e53935;
}

.mt4bt-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.mt4bt-pager button {
  padding: 0.5rem 1rem;
  border: 1px solid #d6dee8;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 10px;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mt4bt-pager button:disabled {
  opacity: 0.42;
  cursor: default;
  box-shadow: none;
}

.mt4bt-toggle:disabled,
.mt4bt-pager button:disabled {
  pointer-events: none;
}

.mt4bt-loading-cell {
  text-align: center !important;
  padding: 1rem 0.75rem !important;
}

.mt4bt-loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--mt4bt-muted);
  font-weight: 600;
}

.mt4bt-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(29, 78, 216, 0.18);
  border-top-color: var(--mt4bt-primary);
  border-radius: 999px;
  animation: mt4bt-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.mt4bt-toggle.is-loading {
  opacity: 0.85;
}

@keyframes mt4bt-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.mt4bt-pageinfo {
  font-size: 0.86rem;
  color: var(--mt4bt-muted);
}

.mt4bt-disclaimer {
  margin-top: 1.25rem;
  font-size: 0.74rem;
  color: #7c8798;
  line-height: 1.75;
}

.mt4bt-error {
  color: #c62828;
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .mt4bt-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mt4bt-sim-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mt4bt-chart {
    height: 400px;
    border-radius: 14px;
  }

  .mt4bt-summary-grid,
  .mt4bt-sim-controls {
    grid-template-columns: 1fr;
  }

  .mt4bt-card,
  .mt4bt-sim {
    border-radius: 14px;
  }

  .mt4bt-actions {
    flex-direction: column;
  }

  .mt4bt-btn-primary,
  .mt4bt-btn-sub {
    width: 100%;
  }
}
