/* ECHO_MULTI_FIELD_SCREENER_V6 */
.echo-mf-original-body-hidden {
  display: none !important;
}

/* Permanently suppress the original one-field result body inside the upgraded panel.
   This remains scoped to the Screener panel and does not affect portal navigation. */
[data-echo-multi-field-screener="v6"] > .panel-body:not(.echo-mf-shell) {
  display: none !important;
}

[data-echo-multi-field-screener="v6"] > .echo-mf-shell {
  display: block !important;
}

.echo-mf-legacy-hidden {
  display: none !important;
}

[data-echo-multi-field-screener="v6"] > .metric-table-wrap:has(#screener-results),
[data-echo-multi-field-screener="v6"] #screener-results,
[data-echo-multi-field-screener="v6"] #screen-summary,
[data-echo-multi-field-screener="v6"] #screen-result-summary {
  display: none !important;
}

.echo-mf-shell,
.echo-mf-shell-inner {
  min-width: 0;
}

.echo-mf-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.echo-mf-intro .eyebrow {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--accent, #d4a72c);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.echo-mf-intro h3 {
  margin: 0 0 0.3rem;
}

.echo-mf-intro p {
  max-width: 760px;
  margin: 0;
  color: var(--text-muted, #6d7785);
}

.echo-mf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.echo-mf-filter-list {
  display: grid;
  gap: 0.75rem;
}

.echo-mf-filter-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(300px, 2.2fr) minmax(190px, 0.9fr) auto;
  align-items: end;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--border, rgba(22, 50, 79, 0.16));
  border-radius: 10px;
  background: var(--surface-raised, rgba(255, 255, 255, 0.72));
}

.echo-mf-filter-row:has(.echo-mf-value-control) {
  grid-template-columns: auto minmax(280px, 2fr) minmax(190px, 0.9fr) minmax(125px, 0.7fr) auto;
}

.echo-mf-filter-row.is-empty {
  border-style: dashed;
}

.echo-mf-condition-number {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  align-self: center;
  border-radius: 999px;
  background: var(--navy, #16324f);
  color: #fff;
  font-weight: 800;
}

.echo-mf-metric-control {
  position: relative;
}

.echo-mf-metric-control small,
.echo-mf-cutoff-control small {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted, #6d7785);
  font-size: 0.72rem;
}

.echo-mf-cutoff-control label span {
  color: var(--text-muted, #6d7785);
  font-weight: 500;
}

.echo-mf-segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border-strong, rgba(22, 50, 79, 0.28));
  border-radius: 8px;
  background: var(--surface, #fff);
}

.echo-mf-segmented button {
  min-width: 3.15rem;
  padding: 0.54rem 0.7rem;
  border: 0;
  border-right: 1px solid var(--border, rgba(22, 50, 79, 0.16));
  background: transparent;
  color: var(--text-primary, #17212b);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.echo-mf-segmented button:last-child {
  border-right: 0;
}

.echo-mf-segmented button:hover {
  background: rgba(212, 167, 44, 0.09);
}

.echo-mf-segmented button.is-active {
  background: var(--navy, #16324f);
  color: #fff;
}

.echo-mf-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% - 0.1rem);
  left: 0;
  right: 0;
  max-height: 310px;
  overflow-y: auto;
  border: 1px solid var(--border-strong, rgba(22, 50, 79, 0.28));
  border-radius: 8px;
  background: var(--surface, #fff);
  box-shadow: 0 16px 35px rgba(15, 28, 45, 0.18);
}

.echo-mf-suggestion {
  display: grid;
  width: 100%;
  gap: 0.12rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--border, rgba(22, 50, 79, 0.12));
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.echo-mf-suggestion:last-child {
  border-bottom: 0;
}

.echo-mf-suggestion:hover,
.echo-mf-suggestion:focus {
  background: rgba(212, 167, 44, 0.1);
  outline: none;
}

.echo-mf-suggestion strong {
  color: var(--text-primary, #17212b);
  font-size: 0.86rem;
}

.echo-mf-suggestion span {
  color: var(--navy, #16324f);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
}

.echo-mf-suggestion small,
.echo-mf-suggestion-empty {
  color: var(--text-muted, #6d7785);
  font-size: 0.7rem;
}

.echo-mf-suggestion-empty {
  padding: 0.8rem;
}

.echo-mf-remove {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  align-self: center;
  border: 1px solid rgba(182, 70, 95, 0.35);
  border-radius: 999px;
  background: rgba(182, 70, 95, 0.07);
  color: #9e334b;
  font-weight: 900;
  cursor: pointer;
}

.echo-mf-remove:hover {
  background: rgba(182, 70, 95, 0.14);
}

.echo-mf-global-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.echo-mf-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.1rem;
  margin: 1rem 0 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border, rgba(22, 50, 79, 0.16));
  border-radius: 9px;
}

.echo-mf-columns legend {
  padding: 0 0.35rem;
  color: var(--text-muted, #6d7785);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.echo-mf-columns label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.echo-mf-message {
  min-height: 1.2rem;
  margin: 0.9rem 0;
  color: var(--text-muted, #6d7785);
  font-size: 0.84rem;
}

.echo-mf-message.error {
  color: #a93650;
  font-weight: 700;
}

.echo-mf-result-summary {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
  color: var(--text-muted, #6d7785);
  font-size: 0.82rem;
}

.echo-mf-result-summary strong {
  color: var(--navy, #16324f);
  font-size: 1.05rem;
}

.echo-mf-result-summary span {
  margin-left: auto;
}

.echo-mf-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.echo-mf-table {
  min-width: 900px;
}

.echo-mf-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}

.echo-mf-sort-button.is-active {
  color: var(--accent-strong, #ae7f00);
}

.echo-mf-number,
.echo-mf-rank {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.echo-mf-ticker {
  color: var(--navy, #16324f);
  font-weight: 800;
  text-decoration: none;
}

.echo-mf-ticker:hover {
  text-decoration: underline;
}

.echo-mf-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.echo-mf-pagination span {
  color: var(--text-muted, #6d7785);
  font-size: 0.84rem;
}

@media (max-width: 980px) {
  .echo-mf-filter-row,
  .echo-mf-filter-row:has(.echo-mf-value-control) {
    grid-template-columns: auto 1fr;
  }

  .echo-mf-metric-control,
  .echo-mf-cutoff-control,
  .echo-mf-value-control {
    grid-column: 2;
  }

  .echo-mf-remove {
    grid-column: 1;
    grid-row: 2;
  }
}

@media (max-width: 640px) {
  .echo-mf-intro,
  .echo-mf-result-summary {
    display: block;
  }

  .echo-mf-result-summary span {
    display: block;
    margin-top: 0.25rem;
  }

  .echo-mf-global-grid {
    grid-template-columns: 1fr;
  }

  .echo-mf-pagination {
    gap: 0.5rem;
  }
}
