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

.qb-wrap {
    max-width: 1340px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.qb-hero { text-align: center; margin-bottom: 36px; }
.qb-hero-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 20px;
    background: #eff6ff; border: 1px solid #bfdbfe;
    font-size: 11px; font-weight: 700; color: #1d4ed8;
    text-transform: uppercase; letter-spacing: .8px;
    margin-bottom: 14px;
}
.qb-hero-tag-dot { width:7px;height:7px;border-radius:50%;background:#22c55e;animation:qbpulse 2s infinite; }
@keyframes qbpulse { 0%,100%{box-shadow:0 0 0 0 rgba(34,197,94,.4)} 50%{box-shadow:0 0 0 5px rgba(34,197,94,0)} }
.qb-hero h1 {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 800; color: #0f172a;
    letter-spacing: -.5px; margin: 0 0 10px;
}
.qb-hero h1 em { font-style:normal; color: #ea580c; }
.qb-hero p { font-size: 15px; color: #64748b; margin: 0; }

/* ── Main grid ────────────────────────────────────────────── */
.qb-grid {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    gap: 20px;
    align-items: start;
}

/* ── Strategy search input ────────────────────────────────── */
.qb-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.qb-card-head {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    font-size: 12px; font-weight: 700; color: #334155;
    text-transform: uppercase; letter-spacing: .6px;
}
.qb-card-body { padding: 18px; }

.qb-field { margin-bottom: 14px; }
.qb-label {
    display: block; font-size: 11px; font-weight: 700;
    color: #64748b; text-transform: uppercase;
    letter-spacing: .6px; margin-bottom: 6px;
}

/* Strategy search */
.qb-strat-wrap { position: relative; }
.qb-strat-input {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; color: #0f172a; font-family: inherit;
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.qb-strat-input:focus { border-color: #ea580c; box-shadow: 0 0 0 3px rgba(234,88,12,.1); }
.qb-strat-dropdown {
    position: absolute; top: calc(100% + 4px);
    left: 0; right: 0; z-index: 100;
    background: #fff; border: 1.5px solid #e2e8f0;
    border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.1);
    max-height: 240px; overflow-y: auto;
    display: none;
}
.qb-strat-dropdown.open { display: block; }
.qb-strat-item {
    padding: 10px 14px; cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex; align-items: center; justify-content: space-between;
    transition: background .1s;
}
.qb-strat-item:last-child { border-bottom: none; }
.qb-strat-item:hover, .qb-strat-item.highlighted { background: #f8fafc; }
.qb-strat-name { font-size: 13px; font-weight: 600; color: #0f172a; }
.qb-strat-meta { font-size: 11px; color: #94a3b8; }
.qb-strat-badge {
    font-size: 10px; font-weight: 700; padding: 2px 7px;
    border-radius: 20px; background: #fff3ed; color: #ea580c;
    flex-shrink: 0;
}

/* Stock select */
.qb-select {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-size: 13px; color: #0f172a; font-family: inherit;
    background: #fff; outline: none; cursor: pointer;
    transition: border-color .15s;
}
.qb-select:focus { border-color: #ea580c; }

/* Period chips */
.qb-period-chips { display: flex; gap: 5px; flex-wrap: nowrap; }
.qb-period-chip {
    padding: 6px 10px; border: 1.5px solid #e2e8f0;
    border-radius: 20px; font-size: 12px; font-weight: 600;
    color: #64748b; cursor: pointer; background: #fff;
    transition: all .15s; font-family: inherit;
}
.qb-period-chip.active {
    border-color: #ea580c; background: #fff3ed; color: #ea580c;
}

/* Run button */
.qb-run-btn {
    width: 100%; padding: 13px;
    background: #ea580c; color: #fff;
    border: none; border-radius: 10px;
    font-size: 14px; font-weight: 700; font-family: inherit;
    cursor: pointer; transition: background .15s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 4px;
}
.qb-run-btn:hover { background: #c2410c; }
.qb-run-btn:disabled { background: #94a3b8; cursor: not-allowed; }

/* ── Results panel ────────────────────────────────────────── */
.qb-results { display: none; }
.qb-results.show { display: block; }

.qb-results-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #f1f5f9;
    background: #f8fafc; flex-wrap: wrap; gap: 8px;
}
.qb-results-title { font-size: 13px; font-weight: 700; color: #334155; }
.qb-results-meta  { font-size: 11px; color: #94a3b8; }
.qb-quality-badge {
    font-size: 10px; font-weight: 700; padding: 3px 9px;
    border-radius: 20px;
}
.qb-quality-badge.high   { background:#f0fdf4; color:#15803d; }
.qb-quality-badge.medium { background:#fffbeb; color:#92400e; }
.qb-quality-badge.low    { background:#fef2f2; color:#dc2626; }

/* Metrics grid */
.qb-metrics {
    display: grid; grid-template-columns: repeat(4,1fr);
    gap: 10px; margin-bottom: 16px;
}
.qb-metric {
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 12px; text-align: center;
}
.qb-metric-val {
    font-size: 22px; font-weight: 800; line-height: 1; margin-bottom: 4px;
}
.qb-metric-label { font-size: 10px; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* Equity curve */
.qb-equity-wrap {
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 14px; margin-bottom: 14px;
}
.qb-equity-label { font-size: 10px; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
#qbEquityCanvas { width: 100%; height: 120px; display: block; }

/* Trade log */
.qb-trade-table {
    width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 14px;
}
.qb-trade-table th {
    padding: 7px 10px; text-align: left;
    font-size: 10px; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .5px;
    border-bottom: 1px solid #e2e8f0; background: #f8fafc;
}
.qb-trade-table td {
    padding: 8px 10px; border-bottom: 1px solid #f1f5f9; color: #475569;
}
.qb-trade-table tr:last-child td { border-bottom: none; }
.qb-pnl-pos { color: #16a34a; font-weight: 700; }
.qb-pnl-neg { color: #dc2626; font-weight: 700; }

/* Blur overlay for locked trades */
.qb-blur-wrap { position: relative; }
.qb-blur-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 80%);
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 10px;
}

/* CTA block */
.qb-cta-block {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    border-radius: 12px; padding: 20px;
    text-align: center; margin-top: 8px;
}
.qb-cta-block h3 { font-size: 15px; font-weight: 700; color: #fff; margin: 0 0 6px; }
.qb-cta-block p  { font-size: 12px; color: rgba(255,255,255,.75); margin: 0 0 14px; }
.qb-cta-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; background: #fff; color: #1e3a8a;
    border-radius: 8px; font-size: 13px; font-weight: 700;
    text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.qb-cta-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.15); }

/* Loading state */
.qb-loading {
    display: none; padding: 40px 20px; text-align: center; color: #64748b;
}
.qb-loading.show { display: block; }
.qb-spinner {
    width: 32px; height: 32px; border: 3px solid #e2e8f0;
    border-top-color: #ea580c; border-radius: 50%;
    animation: qbspin .7s linear infinite;
    margin: 0 auto 12px;
}
@keyframes qbspin { to { transform: rotate(360deg); } }

/* Empty / error state */
.qb-empty {
    display: none; padding: 40px 20px; text-align: center;
}
.qb-empty.show { display: block; }

/* ── Right panel ───────────────────────────────────────────── */
.qb-right-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.qb-snap-card, .qb-links-card, .qb-trust-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.qb-snap-head {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    font-size: 11px; font-weight: 700;
    color: #334155;
    text-transform: uppercase; letter-spacing: .6px;
}

/* Links card */
.qb-link-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; text-decoration: none;
    border-bottom: 1px solid #f8fafc;
    transition: background .1s;
    color: inherit;
}
.qb-link-item:last-child { border-bottom: none; }
.qb-link-item:hover { background: #f8fafc; }
.qb-link-item:hover .qb-link-arrow { transform: translateX(3px); color: #ea580c; }
.qb-link-highlight {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    margin: 6px 10px;
    border-radius: 10px;
    border-bottom: none !important;
}
.qb-link-highlight .qb-link-label,
.qb-link-highlight .qb-link-sub,
.qb-link-highlight .qb-link-arrow { color: #fff !important; }
.qb-link-highlight:hover { opacity: .92; }
.qb-link-icon { font-size: 15px; flex-shrink: 0; width: 22px; text-align: center; }
.qb-link-label { font-size: 12px; font-weight: 700; color: #0f172a; margin-bottom: 1px; }
.qb-link-sub   { font-size: 10px; color: #94a3b8; }
.qb-link-arrow { margin-left: auto; flex-shrink: 0; color: #cbd5e1; transition: transform .15s, color .15s; }



/* Snapshot embed override */
.miq-snapshot-inline { border: none !important; box-shadow: none !important; border-radius: 0 !important; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
    .qb-grid { grid-template-columns: 320px 1fr; }
    .qb-right-panel { display: none; }
}
@media (max-width: 768px) {
    .qb-grid { grid-template-columns: 1fr; }
    .qb-metrics { grid-template-columns: repeat(2,1fr); }
    .qb-wrap { padding: 24px 16px 60px; }
}
/* ── SEO Content Section ──────────────────────────────────── */
.qb-seo-wrap {
    max-width: 100%;
    margin: 20px 0 0;
    padding: 0;
}
.qb-seo-intro {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 28px 32px;
    margin-bottom: 20px;
}
.qb-seo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.qb-seo-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px 28px;
}
.qb-seo-h2 {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px;
    letter-spacing: -.3px;
}
.qb-seo-p {
    font-size: 14px;
    line-height: 1.75;
    color: #475569;
    margin: 0 0 12px;
}
.qb-seo-p:last-child { margin-bottom: 0; }
.qb-seo-list {
    list-style: none;
    padding: 0; margin: 0;
}
.qb-seo-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}
.qb-seo-list li:last-child { border-bottom: none; }
.qb-seo-check { color: #16a34a; font-weight: 700; flex-shrink: 0; }
.qb-seo-steps {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.qb-seo-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}
.qb-seo-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff3ed;
    color: #ea580c;
    font-size: 11px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.qb-seo-markets {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
}
.qb-seo-market-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-right: 4px;
}
.qb-seo-market-pill {
    padding: 4px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}
.qb-seo-faq {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 32px;
}
.qb-seo-faq-item { border-bottom: 1px solid #f1f5f9; }
.qb-seo-faq-item:last-child { border-bottom: none; }
.qb-seo-faq-q {
    width: 100%; text-align: left;
    background: none; border: none;
    padding: 13px 0; cursor: pointer;
    display: flex; justify-content: space-between;
    align-items: center; gap: 12px;
    font-family: inherit;
}
.qb-seo-faq-q span { font-size: 14px; font-weight: 600; color: #0f172a; }
.qb-seo-faq-q svg { flex-shrink: 0; transition: transform .2s; }
.qb-seo-faq-a {
    display: none;
    font-size: 13px;
    color: #64748b;
    line-height: 1.7;
    padding-bottom: 13px;
}

@media (max-width: 768px) {
    .qb-seo-grid   { grid-template-columns: 1fr; }
    .qb-seo-wrap   { padding: 0 16px; }
    .qb-seo-intro,
    .qb-seo-card,
    .qb-seo-faq    { padding: 18px 20px; }
}