@import url('backtest_indicators.css');

.dvs-tool .dvs-layout {
  align-items: start;
  grid-template-columns: minmax(0, 1.28fr) minmax(302px, 0.864fr);
}

.dvs-side-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.dvs-side-column .dvs-detail-panel {
  position: sticky;
  top: 12px;
}

.dvs-action-panel {
  padding: 0;
}

.dvs-action-panel .dvs-action-guide {
  margin-bottom: 0;
}

/* Stats — 4 metriche sulla stessa riga */
.dvs-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.dvs-stats .bti-stat {
  flex: none;
  min-width: 0;
  padding: 10px 12px;
}

.dvs-stats .bti-stat span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dvs-stats .bti-stat strong {
  font-size: 18px;
}

.dvs-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dvs-detail-panel > .tf-panel-head {
  padding: 10px 16px;
}

.dvs-detail-meta {
  font-size: 13px;
  opacity: 0.85;
  line-height: 1.5;
  padding: 12px 16px 8px;
}

.dvs-detail-meta strong {
  font-size: 15px;
}

.dvs-detail-title {
  margin-bottom: 4px;
}

.dvs-detail-sub {
  margin-bottom: 10px;
  font-size: 12px;
  opacity: 0.8;
}

.dvs-action-guide {
  margin-top: 0;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.1));
  background: var(--bg-subtle, rgba(255, 255, 255, 0.03));
}

.dvs-action-guide.is-bearish {
  border-left: 3px solid #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

.dvs-action-guide.is-bullish {
  border-left: 3px solid #22c55e;
  background: rgba(34, 197, 94, 0.06);
}

.dvs-action-guide.is-neutral {
  border-left: 3px solid #94a3b8;
  background: rgba(148, 163, 184, 0.06);
}

.dvs-action-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted, #8b949e);
}

.dvs-action-list {
  margin: 0;
  padding: 0 0 0 16px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg-default, #e6edf3);
}

.dvs-action-list li + li {
  margin-top: 6px;
}

.dvs-action-note {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.4;
  color: var(--fg-muted, #8b949e);
  opacity: 0.9;
}

.dvs-confirmation-panel {
  padding: 0;
}

.dvs-confirmation {
  border: 1px solid var(--border-muted, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  background: var(--bg-subtle, rgba(255, 255, 255, 0.03));
  padding: 12px 14px;
}

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

.dvs-confirmation-title {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dvs-confirmation-score {
  font-size: 11px;
  font-family: var(--mono, monospace);
  color: var(--fg-muted, #8b949e);
}

.dvs-confirmation-overall {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
}

.dvs-confirmation-overall.is-confirmed {
  color: var(--success, #3fb950);
}

.dvs-confirmation-overall.is-partial {
  color: #d4a72c;
}

.dvs-confirmation-overall.is-weak {
  color: var(--danger, #f85149);
}

.dvs-confirmation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dvs-confirmation-list-secondary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-muted, rgba(255, 255, 255, 0.08));
}

.dvs-confirmation-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
}

.dvs-confirmation-item.is-yes {
  border-color: rgba(63, 185, 80, 0.25);
}

.dvs-confirmation-item.is-no {
  border-color: rgba(248, 81, 73, 0.2);
}

.dvs-confirmation-item.is-na {
  opacity: 0.85;
}

.dvs-confirmation-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

.dvs-confirmation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.dvs-confirmation-item.is-yes .dvs-confirmation-badge {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.12);
}

.dvs-confirmation-item.is-no .dvs-confirmation-badge {
  color: #f85149;
  background: rgba(248, 81, 73, 0.12);
}

.dvs-confirmation-item.is-na .dvs-confirmation-badge {
  color: var(--fg-muted, #8b949e);
  background: rgba(255, 255, 255, 0.06);
}

.dvs-confirmation-item strong {
  font-size: 12px;
}

.dvs-confirmation-detail {
  flex-basis: 100%;
  font-size: 11px;
  line-height: 1.4;
  color: var(--fg-muted, #8b949e);
}

.dvs-confirmation-link {
  flex-shrink: 0;
  font-size: 10px;
  white-space: nowrap;
  color: var(--accent, #58a6ff);
  text-decoration: none;
}

.dvs-confirmation-link:hover {
  text-decoration: underline;
}

.dvs-confirmation-item.is-compact {
  padding: 6px 8px;
}

.dvs-chart-tf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 8px;
  font-size: 12px;
}

.dvs-chart-tf-label {
  color: var(--fg-muted, #8b949e);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
}

.dvs-chart-tf-value {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono, monospace);
  color: var(--fg-default, #e6edf3);
  background: var(--bg-subtle, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.12));
}

.dvs-chart {
  min-height: 320px;
  width: auto;
  margin: 0 12px 0 16px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--peps-surface-2, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--peps-border, rgba(255, 255, 255, 0.08));
}

.dvs-detail-panel .tf-detail-body {
  padding: 12px 16px 16px;
}

.dvs-detail-panel .tf-detail-body .peps-kv {
  margin: 0;
}

.dvs-pattern-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dvs-pattern-filter-label {
  font-size: 11px;
  color: var(--fg-muted, #8b949e);
  white-space: nowrap;
}

.dvs-pattern-select {
  min-width: 160px;
  max-width: 200px;
  width: auto;
  padding: 5px 28px 5px 10px;
  border-radius: var(--radius, 6px);
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.12));
  background-color: var(--bg-subtle, #161b22);
  color: var(--fg-default, #e6edf3);
  font: inherit;
  font-size: 11px;
  line-height: 1.3;
  cursor: pointer;
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  box-sizing: border-box;
  height: 28px;
}

.dvs-pattern-select:hover {
  border-color: var(--fg-subtle, #6e7681);
}

.dvs-pattern-select:focus {
  outline: none;
  border-color: var(--accent-emphasis, #1f6feb);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #58a6ff) 25%, transparent);
}

.dvs-pattern-select option {
  background-color: var(--bg-subtle, #161b22);
  color: var(--fg-default, #e6edf3);
}

.dvs-tool .tf-toolbar {
  align-items: center;
  gap: 8px 10px;
}

.dvs-search {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 220px;
  padding: 5px 10px;
  height: 28px;
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius, 6px);
  background: var(--bg-subtle, #161b22);
  color: var(--fg-default, #e6edf3);
  font: inherit;
  font-size: 11px;
  box-sizing: border-box;
}

.dvs-search::placeholder {
  color: var(--fg-muted, #8b949e);
  opacity: 0.85;
}

.dvs-search:focus {
  outline: none;
  border-color: var(--accent-emphasis, #1f6feb);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #58a6ff) 25%, transparent);
}

.dvs-tool .tf-bias-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dvs-tool .tf-meta {
  flex-basis: 100%;
  margin-left: 0;
  padding-top: 2px;
}

@media (min-width: 1100px) {
  .dvs-tool .tf-meta {
    flex-basis: auto;
    margin-left: auto;
    padding-top: 0;
  }
}

.dvs-bias {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dvs-bias.is-bullish {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.dvs-bias.is-bearish {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.dvs-bias.is-neutral {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.dvs-strength {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dvs-strength-bar {
  display: inline-block;
  width: 48px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.dvs-strength-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #22c55e);
}

.dvs-hero .bti-hero-main h2 {
  font-size: 1.15rem;
}

@media (max-width: 960px) {
  .dvs-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dvs-search {
    flex-basis: 100%;
    max-width: none;
    width: 100%;
  }

  .dvs-pattern-filter {
    flex-basis: 100%;
    width: 100%;
  }

  .dvs-pattern-select {
    flex: 1;
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .dvs-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
