/* =========================================================
   ENGINE RESULT – SHARED SYSTEM (All 7 Layers)
   ========================================================= */

.engine-result {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 10px;
}

/* =========================================================
   BASE CARD (USED BY ALL LAYERS)
   ========================================================= */

.engine-result-card {
    position: relative;
    border: 1px solid rgba(255,255,255,.10);
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
    border-radius: 16px;
    padding: 14px 16px 14px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    overflow: hidden;
}

    /* Left accent rail (layer color) */
    .engine-result-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 6px;
        background: var(--layer-accent, rgba(255, 160, 70, .9));
        opacity: .65;
    }

/* =========================================================
   HEADER
   ========================================================= */

.engine-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.engine-result-kicker {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .75;
}

.engine-result-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */

.engine-result-body {
    padding-top: 10px;
}

.engine-result-headline {
    font-size: 20px;
    font-weight: 900;
    line-height: 1.15;
}

.engine-result-subtext {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    opacity: .82;
}

/* =========================================================
   BADGE / PILL (base + neon)
   ========================================================= */

.engine-result-pill {
    font-size: 12px;
    font-weight: 800;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    letter-spacing: .03em;
}

    /* Neon pill colors */
    .engine-result-pill.bullish {
        background: rgba(0, 255, 160, 0.18);
        color: #00ffa0;
        border-color: rgba(0, 255, 160, 0.45);
        box-shadow: 0 0 10px rgba(0, 255, 160, 0.35);
    }

    .engine-result-pill.strong-bullish {
        background: rgba(0, 255, 160, 0.25);
        color: #00ffae;
        border-color: rgba(0, 255, 160, 0.75);
        box-shadow: 0 0 18px rgba(0, 255, 160, 0.65);
    }

    .engine-result-pill.bearish {
        background: rgba(255, 60, 60, 0.18);
        color: #ff3c3c;
        border-color: rgba(255, 60, 60, 0.45);
        box-shadow: 0 0 10px rgba(255, 60, 60, 0.35);
    }

    .engine-result-pill.strong-bearish {
        background: rgba(255, 60, 60, 0.25);
        color: #ff4d4d;
        border-color: rgba(255, 60, 60, 0.75);
        box-shadow: 0 0 18px rgba(255, 60, 60, 0.65);
    }

    .engine-result-pill.neutral {
        background: rgba(180, 180, 180, 0.12);
        color: #d0d0d0;
        border-color: rgba(180, 180, 180, 0.35);
    }

/* =========================================================
   METER (OPTIONAL)
   ========================================================= */

.engine-result-meter {
    margin: 10px 0 12px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(0,0,0,.15);
}

.engine-result-meter-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    overflow: hidden;
}

.engine-result-meter-fill {
    height: 100%;
    width: 50%;
    border-radius: 999px;
    background: rgba(255,255,255,.55);
}

/* Meter positions */
.engine-result-meter.m-2 .engine-result-meter-fill {
    width: 18%;
}

.engine-result-meter.m-1 .engine-result-meter-fill {
    width: 33%;
}

.engine-result-meter.m0 .engine-result-meter-fill {
    width: 50%;
}

.engine-result-meter.m1 .engine-result-meter-fill {
    width: 67%;
}

.engine-result-meter.m2 .engine-result-meter-fill {
    width: 82%;
}

.engine-result-meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    opacity: .75;
    margin-top: 6px;
    gap: 10px;
}

/* Neon meter fills */
.engine-result-meter.m1 .engine-result-meter-fill,
.engine-result-meter.m2 .engine-result-meter-fill {
    background: linear-gradient(90deg, #00ff9d, #00ffea);
    box-shadow: 0 0 12px rgba(0, 255, 160, 0.6);
}

.engine-result-meter.m-1 .engine-result-meter-fill,
.engine-result-meter.m-2 .engine-result-meter-fill {
    background: linear-gradient(90deg, #ff4d4d, #ff8a8a);
    box-shadow: 0 0 12px rgba(255, 60, 60, 0.6);
}

.engine-result-meter.m0 .engine-result-meter-fill {
    background: linear-gradient(90deg, #b0b0b0, #e0e0e0);
}

/* =========================================================
   SECTIONS / LISTS
   ========================================================= */

.engine-result-section-title {
    font-size: 13px;
    font-weight: 800;
    margin: 8px 0 6px;
    opacity: .92;
}

.engine-result-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.45;
    opacity: .88;
}

/* =========================================================
   GRID / MINI TAGS
   ========================================================= */

.engine-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 720px) {
    .engine-result-grid {
        grid-template-columns: 1fr;
    }
}

.engine-result-mini {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.engine-result-mini-item {
    font-size: 12px;
    opacity: .85;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
}

/* =========================================================
   LAYER ACCENTS — NEON CYAN (#00D1FF)
   ========================================================= */
/* Layer 1 — strongest */
.engine-result.l1 {
    --layer-accent: rgba(200, 200, 200, 0.95); /* light silver */
}

/* Layer 2 */
.engine-result.l2 {
    --layer-accent: rgba(190, 190, 190, 0.92);
}

/* Layer 3 */
.engine-result.l3 {
    --layer-accent: rgba(180, 180, 180, 0.90);
}

/* Layer 4 */
.engine-result.l4 {
    --layer-accent: rgba(170, 170, 170, 0.88);
}

/* Layer 5 */
.engine-result.l5 {
    --layer-accent: rgba(160, 160, 160, 0.86);
}

/* Layer 6 */
.engine-result.l6 {
    --layer-accent: rgba(150, 150, 150, 0.84);
}

/* Layer 7 — softest */
.engine-result.l7 {
    --layer-accent: rgba(140, 140, 140, 0.82); /* deep gray */
}

/* Meta */

/* =========================================================
   MODEL CONTRIBUTIONS – CHIP TONES
   ========================================================= */

.engine-result-chip {
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
    border-radius: 14px;
    padding: 10px 12px;
}

.engine-result-chip-name {
    font-size: 12px;
    opacity: .78;
}

.engine-result-chip-val {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 800;
}

.engine-result-chip.bullish,
.engine-result-chip.strong-bullish {
    border-color: rgba(0, 255, 160, 0.45);
    background: rgba(0, 255, 160, 0.10);
    box-shadow: 0 0 10px rgba(0, 255, 160, 0.25);
}

    .engine-result-chip.bullish .engine-result-chip-val,
    .engine-result-chip.strong-bullish .engine-result-chip-val {
        color: #00ffa0;
    }

.engine-result-chip.strong-bullish {
    border-color: rgba(0, 255, 160, 0.75);
    background: rgba(0, 255, 160, 0.16);
    box-shadow: 0 0 16px rgba(0, 255, 160, 0.55);
}

.engine-result-chip.bearish,
.engine-result-chip.strong-bearish {
    border-color: rgba(255, 60, 60, 0.45);
    background: rgba(255, 60, 60, 0.10);
    box-shadow: 0 0 10px rgba(255, 60, 60, 0.25);
}

    .engine-result-chip.bearish .engine-result-chip-val,
    .engine-result-chip.strong-bearish .engine-result-chip-val {
        color: #ff3c3c;
    }

.engine-result-chip.strong-bearish {
    border-color: rgba(255, 60, 60, 0.75);
    background: rgba(255, 60, 60, 0.16);
    box-shadow: 0 0 16px rgba(255, 60, 60, 0.55);
}

.engine-result-chip.neutral {
    border-color: rgba(180, 180, 180, 0.30);
    background: rgba(180, 180, 180, 0.08);
}

    .engine-result-chip.neutral .engine-result-chip-val {
        color: #d0d0d0;
    }

/* =========================================================
   BIAS WORD COLORS (TEXT ONLY)
   Used by BiasHeadlineHtml() — does NOT color the whole line
   ========================================================= */

.bias-word.bullish          {color: #00ffa0; text-shadow: 0 0 6px rgba(0,255,160,.35);}
.bias-word.strong-bullish   {color: #00ffae;text-shadow: 0 0 10px rgba(0,255,160,.6);}
.bias-word.bearish          {color: #ff5a5a;text-shadow: 0 0 6px rgba(255,60,60,.35);}
.bias-word.strong-bearish   {color: #ff3c3c; text-shadow: 0 0 10px rgba(255,60,60,.6); }
.bias-word.neutral          { color: #d0d0d0; text-shadow: none;}


/* Live engine status line */
.engine-chat,.engine-wait,.engine-header {max-width: 720px;margin: 12px auto 0;padding: 10px 14px;border-radius: 14px;background: rgba(255, 255, 255, 0.05);border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.95rem; line-height: 2.4; color: rgba(255, 255, 255, 0.92); box-shadow: 0 8px 26px rgba(0,0,0,.15); }


/* RESULT SUMMARY and DETAIL */
/* Base */
.sx-details { margin-bottom: 0.5rem; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; overflow: hidden; }
.sx-summary {list-style: none;cursor: pointer; padding: 0.55rem 1rem; background-color: #262626; color: #ffffff; font-weight: 600; border-left: 4px solid transparent; }
.sx-summary { display: flex; align-items: center; }
.sx-title { flex: 1; }
.sx-score { font-size: 12px; font-weight: 700; opacity: 0.85; letter-spacing: 0.4px; white-space: nowrap;}
/* Open state */
.sx-details[open] > .sx-summary { background-color: #2c2c2c; color: #d8d8d8; }
.sx-body { background-color: #121212; color: #e0e0e0; line-height: 1.6; padding: 1rem 1.25rem; border-top: 1px solid #555; }
.sx-summary::-webkit-details-marker { display: none; }
.sx-summary::marker { content: ""; }
.sx-summary:focus { outline: none; box-shadow: none;}
.sx-details.l1 > .sx-summary { border-left-color: #c792ea; } /* purple */
.sx-details.l2 > .sx-summary { border-left-color: #ff8c94; } /* coral */
.sx-details.l3 > .sx-summary { border-left-color: #ffd479; } /* yellow */
.sx-details.l4 > .sx-summary { border-left-color: #66d9c2; } /* teal */
.sx-details.l5 > .sx-summary { border-left-color: #5ac8fa; } /* blue */
.sx-details.l6 > .sx-summary { border-left-color: #9aa5ff; } /* steel blue */
.sx-details.l7 > .sx-summary { border-left-color: #7e57c2; } /* slate gray */
/* RESULT SUMMARY and DETAIL */

/* =========================================================
   LAYER 7 – TABLE STYLES (AUTHORITATIVE)
   ========================================================= */

.sx-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; background: rgba(255,255,255,0.02); border-radius: 10px; overflow: hidden; }
.sx-table-compact { font-size: 13px;}
.sx-table-admin { font-size: 13.5px;}
.sx-table-debug { font-size: 13px; background: rgba(255,255,255,0.015);}
.sx-table th { text-align: left; font-weight: 600; color: rgba(255,255,255,0.75);padding: 8px 10px;  white-space: nowrap;vertical-align: top;border-bottom: 1px solid rgba(255,255,255,0.08);width: 180px;}
.sx-table td { padding: 8px 10px; color: rgba(255,255,255,0.95); border-bottom: 1px solid rgba(255,255,255,0.05); line-height: 1.45;}
.sx-table tr:last-child th,.sx-table tr:last-child td { border-bottom: none;}
.sx-table tr:nth-child(even) td { background: rgba(255,255,255,0.015);}
.engine-result-pill {  display: inline-block; padding: 4px 10px;  border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em;}

/* Gate words */
.sx-gate-ok {color: #3ddc97;font-weight: 600;}
.sx-gate-bad {color: #ff6b6b;font-weight: 600;}
.sx-debug-pre {margin-top: 10px;padding: 10px 12px;background: rgba(0,0,0,0.35);border-radius: 8px;font-size: 12.5px;line-height: 1.5;color: #e5e5e5;white-space: pre-wrap;}


/******* Result 4-5 *******/
.engine-qual {
    border: 1px solid rgba(150, 120, 255, 0.35);
    border-radius: 14px;
    padding: 12px 14px;
    margin: 12px 0;
    background: rgba(150, 120, 255, 0.22) !important;
    box-shadow: 0 0 0 1px rgba(150, 120, 255, 0.25), 0 12px 30px rgba(0,0,0,.35);
}



/* Header */
.engine-qual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Title */
.engine-qual-title {
  font-weight: 700;
  letter-spacing: .2px;
}

/* Pill (QUALIFIED / DISQUALIFIED) */
.engine-qual-pill {
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.18);
}

/* Subtext */
.engine-qual-sub {
  margin-top: 6px;
  font-size: 13px;
  opacity: .85;
}

/* Explanation */
.engine-qual-why {
  margin-top: 8px;
  line-height: 1.35;
}

/* Footer breakdown */
.engine-qual-foot {
  margin-top: 6px;
  font-size: 12px;
  opacity: .80;
}

/******* Result 4-5 *******/
