/* =========================================================
   QCMS PRO v2.0 — PREMIUM RESPONSIVE DESIGN SYSTEM
   Card Analysis
   ========================================================= */

:root {
    --q-bg: #050608;
    --q-surface: rgba(17, 19, 24, 0.88);
    --q-surface-strong: #111318;
    --q-surface-soft: rgba(255, 255, 255, 0.045);
    --q-border: rgba(255, 255, 255, 0.095);
    --q-border-bright: rgba(255, 255, 255, 0.16);
    --q-text: #f7f9fc;
    --q-muted: #929ba8;
    --q-green: #00e08a;
    --q-blue: #29b6f6;
    --q-purple: #a78bfa;
    --q-gold: #d4af37;
    --q-danger: #ff5b6e;
    --q-warning: #f5b041;
    --q-radius-xl: 28px;
    --q-radius-lg: 22px;
    --q-radius-md: 16px;
    --q-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    --q-safe-top: env(safe-area-inset-top, 0px);
    --q-safe-right: env(safe-area-inset-right, 0px);
    --q-safe-bottom: env(safe-area-inset-bottom, 0px);
    --q-safe-left: env(safe-area-inset-left, 0px);
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    background: var(--q-bg);
    scroll-behavior: smooth;
}

body.qcms-v2 {
    min-width: 0;
    margin: 0;
    overflow-x: hidden;
    color: var(--q-text);
    background:
        radial-gradient(circle at 10% -5%, rgba(41, 182, 246, 0.10), transparent 30%),
        radial-gradient(circle at 95% 8%, rgba(0, 224, 138, 0.10), transparent 31%),
        radial-gradient(circle at 50% 105%, rgba(167, 139, 250, 0.08), transparent 30%),
        var(--q-bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.qcms-v2::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.022;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
    z-index: 9999;
}

.qcms-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    min-height: 74px;
    padding:
        calc(13px + var(--q-safe-top))
        max(22px, var(--q-safe-right))
        13px
        max(22px, var(--q-safe-left));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--q-border);
    background: rgba(5, 6, 8, 0.76);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.qcms-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--q-text);
    text-decoration: none;
}

.qcms-brand-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #06130d;
    background: linear-gradient(145deg, #72ffc2, var(--q-green));
    font-weight: 950;
    box-shadow: 0 10px 30px rgba(0, 224, 138, 0.20);
}

.qcms-brand strong,
.qcms-brand small {
    display: block;
}

.qcms-brand strong {
    font-size: 15px;
    letter-spacing: 0.08em;
}

.qcms-brand small {
    margin-top: 3px;
    color: var(--q-muted);
    font-size: 9px;
    letter-spacing: 0.14em;
}

.qcms-nav {
    display: flex;
    align-items: center;
    gap: 7px;
}

.qcms-nav a {
    padding: 10px 14px;
    border-radius: 12px;
    color: #c5cbd4;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.qcms-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,.07);
    transform: translateY(-1px);
}

.card-analysis {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
    padding: 38px 0 calc(70px + var(--q-safe-bottom));
    display: grid;
    gap: 22px;
}

.qcms-panel {
    min-width: 0;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius-xl);
    background:
        linear-gradient(145deg, rgba(255,255,255,.058), rgba(255,255,255,.018)),
        var(--q-surface);
    box-shadow: var(--q-shadow);
    backdrop-filter: blur(24px) saturate(120%);
    -webkit-backdrop-filter: blur(24px) saturate(120%);
    overflow: hidden;
}

.analysis-hero {
    min-height: 480px;
    padding: 44px;
    display: grid;
    grid-template-columns: minmax(280px, .82fr) minmax(0, 1.5fr);
    align-items: center;
    gap: clamp(30px, 6vw, 86px);
    position: relative;
}

.analysis-hero::after {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    left: -200px;
    bottom: -240px;
    border-radius: 50%;
    background: rgba(0, 224, 138, 0.09);
    filter: blur(70px);
    pointer-events: none;
}

.card-image {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.image-placeholder {
    position: relative;
    width: min(100%, 320px);
    padding: 12px;
    border: 1px solid rgba(255,255,255,.19);
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.035));
    box-shadow:
        0 35px 80px rgba(0,0,0,.55),
        0 0 50px rgba(0,224,138,.10);
}

.image-placeholder::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(140deg, rgba(255,255,255,.22), transparent 35%, rgba(0,224,138,.30));
    filter: blur(10px);
    opacity: .6;
}

.image-placeholder img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 430px;
    object-fit: contain;
    border-radius: 20px;
    background: rgba(255,255,255,.03);
    transition: transform .35s ease;
}

.image-placeholder:hover img {
    transform: translateY(-5px) scale(1.015);
}

.verified-pill {
    margin-top: 18px;
    padding: 8px 13px;
    border: 1px solid rgba(0,224,138,.22);
    border-radius: 999px;
    color: var(--q-green);
    background: rgba(0,224,138,.07);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .13em;
    white-space: nowrap;
}

.card-info {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.section-kicker {
    margin-bottom: 10px;
    color: var(--q-green);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .18em;
}

.card-info h1 {
    max-width: 760px;
    margin: 0;
    color: var(--q-text);
    font-size: clamp(34px, 5vw, 64px);
    line-height: .98;
    letter-spacing: -.045em;
    overflow-wrap: anywhere;
}

.card-info h2 {
    margin: 14px 0 30px;
    color: var(--q-muted);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.card-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.card-detail-grid p {
    min-width: 0;
    min-height: 74px;
    margin: 0;
    padding: 15px 17px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius-md);
    background: rgba(0,0,0,.20);
}

.card-detail-grid span,
.metric-list span,
.grade-grid span,
.ai-facts span {
    color: var(--q-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .05em;
}

.card-detail-grid strong {
    min-width: 0;
    color: #fff;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.qcms-top-dashboard {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.qcms-stat-card {
    min-width: 0;
    min-height: 174px;
    padding: 22px;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius-lg);
    background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.018));
    box-shadow: 0 16px 45px rgba(0,0,0,.22);
    transition: transform .24s ease, border-color .24s ease;
}

.qcms-stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--q-border-bright);
}

.stat-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 900;
}

.stat-purple { color: #e6ddff; background: rgba(167,139,250,.15); }
.stat-green  { color: #b8ffe1; background: rgba(0,224,138,.14); }
.stat-gold   { color: #ffe9a8; background: rgba(212,175,55,.15); }
.stat-blue   { color: #c8efff; background: rgba(41,182,246,.15); }

.qcms-stat-card h3 {
    margin: 21px 0 9px;
    color: var(--q-muted);
    font-size: 10px;
    letter-spacing: .12em;
}

.qcms-stat-card strong {
    display: block;
    color: var(--q-text);
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.market-box,
.grade-box,
.chart-box,
.sales-box,
.ai-box,
.investment-box {
    padding: 30px;
}

.section-heading,
.chart-header {
    min-width: 0;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 22px;
}

.section-heading h2,
.chart-header h2,
.ai-score-column h2 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -.035em;
}

.intelligence-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.intelligence-grid p,
.market-dashboard-card,
.metric-list p,
.grade-grid p,
.ai-facts p {
    min-width: 0;
    margin: 0;
    border: 1px solid var(--q-border);
    background: rgba(0,0,0,.19);
}

.intelligence-grid p {
    min-height: 120px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    border-radius: var(--q-radius-md);
}

.intelligence-grid span {
    color: var(--q-muted);
    font-size: 12px;
}

.intelligence-grid strong {
    color: var(--q-green);
    font-size: clamp(21px, 3vw, 31px);
    overflow-wrap: anywhere;
}

.market-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
}

.market-dashboard-card {
    min-height: 104px;
    padding: 17px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    border-radius: var(--q-radius-md);
}

.market-dashboard-card span {
    color: var(--q-muted);
    font-size: 11px;
}

.market-dashboard-card strong {
    color: #fff;
    font-size: 20px;
    overflow-wrap: anywhere;
}

.analysis-columns {
    min-width: 0;
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 22px;
}

.metric-list,
.grade-grid,
.ai-facts {
    display: grid;
    gap: 9px;
}

.metric-list p,
.grade-grid p,
.ai-facts p {
    min-height: 58px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-radius: 14px;
}

.metric-list strong,
.grade-grid strong,
.ai-facts strong {
    color: var(--q-green);
    text-align: right;
    overflow-wrap: anywhere;
}

.grade-grid p:first-child strong { color: var(--q-gold); }

.market-risk-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.market-risk-list p {
    margin: 0;
    padding: 13px 15px;
    border: 1px solid rgba(245,176,65,.18);
    border-radius: 14px;
    color: #e9d8a4;
    background: rgba(245,176,65,.055);
    font-size: 13px;
}

.chart-box {
    min-width: 0;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden;
}

.chart-header {
    align-items: flex-start;
}

.price-history-filter {
    min-width: 0;
    margin: 0;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group {
    min-width: 150px;
    display: grid;
    gap: 7px;
}

.filter-group label {
    color: var(--q-muted);
    font-size: 10px;
    font-weight: 700;
}

.grade-select {
    width: 100%;
    min-width: 150px;
    height: 42px;
    padding: 0 35px 0 13px;
    border: 1px solid var(--q-border-bright);
    border-radius: 12px;
    outline: 0;
    color: #fff;
    background: #15181e;
    font: inherit;
    font-size: 12px;
}

.grade-select:focus {
    border-color: rgba(0,224,138,.52);
    box-shadow: 0 0 0 4px rgba(0,224,138,.08);
}

.chart-stage {
    position: relative;
    width: 100%;
    min-width: 0;
    height: clamp(300px, 41vw, 470px);
    max-height: 470px;
    padding: 12px 5px 0;
    overflow: hidden;
}

#priceChart {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
}

.price-chart-statistics {
    width: 100%;
    margin: 0 0 16px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.price-stat {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--q-border);
    border-radius: 14px;
    background: rgba(0,0,0,.18);
}

.price-stat span,
.price-stat strong {
    display: block;
}

.price-stat span {
    color: var(--q-muted);
    font-size: 10px;
}

.price-stat strong {
    margin-top: 7px;
    color: #fff;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.price-stat strong.positive { color: var(--q-green); }
.price-stat strong.negative { color: var(--q-danger); }
.price-stat strong.neutral { color: var(--q-muted); }

.price-chart-empty {
    min-height: 260px;
    display: grid !important;
    place-items: center;
    color: var(--q-muted);
    text-align: center;
}

#salesHistory {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.sale-item {
    min-width: 0;
    position: relative;
    padding: 20px;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius-md);
    background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(0,0,0,.20));
    overflow: hidden;
}

.sale-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(var(--q-green), var(--q-blue));
}

.sale-item p {
    margin: 8px 0;
    color: var(--q-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.sale-item p:nth-child(3) {
    margin: 14px 0;
    color: #fff;
    font-size: 28px;
    font-weight: 850;
}

.sale-item p:nth-child(2) {
    color: var(--q-green);
    font-weight: 750;
}

.ai-box {
    background:
        radial-gradient(circle at 4% 20%, rgba(167,139,250,.11), transparent 25%),
        linear-gradient(145deg, rgba(255,255,255,.058), rgba(255,255,255,.018)),
        var(--q-surface);
}

.ai-report-layout {
    display: grid;
    grid-template-columns: .42fr 1fr;
    gap: 30px;
    align-items: stretch;
}

.ai-score-column {
    display: flex;
    flex-direction: column;
}

.ai-score {
    width: min(100%, 220px);
    aspect-ratio: 1;
    margin: auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(167,139,250,.38);
    border-radius: 50%;
    color: #e5dcff;
    background:
        radial-gradient(circle, rgba(167,139,250,.20), rgba(167,139,250,.035) 60%, transparent 61%);
    font-size: clamp(30px, 5vw, 47px);
    font-weight: 900;
    box-shadow: 0 0 55px rgba(167,139,250,.13);
}

.ai-report-content {
    min-width: 0;
}

.ai-analysis-text {
    margin: 14px 0 0;
    padding: 18px;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius-md);
    color: #c7cdd6;
    background: rgba(0,0,0,.20);
    font-size: 14px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.investment-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 11px;
}

.investment-card {
    min-width: 0;
    min-height: 135px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--q-border);
    border-radius: var(--q-radius-md);
    background: rgba(0,0,0,.19);
}

.investment-card h3 {
    margin: 0;
    color: var(--q-muted);
    font-size: 11px;
    font-weight: 700;
}

.investment-card strong {
    color: var(--q-green);
    font-size: 25px;
    overflow-wrap: anywhere;
}

.investment-bottom {
    display: grid;
    grid-template-columns: 1fr .65fr;
    gap: 12px;
    margin-top: 12px;
}

.risk-box,
.final-verdict {
    min-width: 0;
    padding: 21px;
    border-radius: var(--q-radius-md);
}

.risk-box {
    border: 1px solid rgba(245,176,65,.20);
    background: rgba(245,176,65,.055);
}

.risk-box h3 {
    margin: 0 0 14px;
    color: #f4cf76;
    font-size: 15px;
}

.risk-box ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.risk-box li {
    color: #d7d1c3;
    font-size: 12px;
    line-height: 1.55;
}

.final-verdict {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border: 1px solid rgba(0,224,138,.25);
    background: rgba(0,224,138,.065);
}

.final-verdict > span {
    color: var(--q-muted);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .16em;
}

.final-verdict strong {
    margin: 11px 0;
    color: var(--q-green);
    font-size: clamp(27px, 4vw, 42px);
    overflow-wrap: anywhere;
}

.final-verdict p {
    margin: 0;
    color: var(--q-muted);
    font-size: 12px;
}

.final-verdict b {
    margin-left: 5px;
    color: #fff;
}

@media (prefers-reduced-motion: no-preference) {
    .card-analysis > section {
        animation: qcms-enter .55s both;
    }

    .card-analysis > section:nth-child(2) { animation-delay: .04s; }
    .card-analysis > section:nth-child(3) { animation-delay: .08s; }
    .card-analysis > section:nth-child(4) { animation-delay: .12s; }

    @keyframes qcms-enter {
        from { opacity: 0; transform: translateY(16px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

@media (max-width: 1000px) {
    .analysis-hero {
        padding: 34px;
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 34px;
    }

    .qcms-top-dashboard,
    .intelligence-grid,
    .market-dashboard-grid,
    .investment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analysis-columns {
        grid-template-columns: 1fr;
    }

    .ai-report-layout {
        grid-template-columns: .55fr 1fr;
    }
}

@media (max-width: 720px) {
    .qcms-header {
        min-height: 66px;
        padding:
            calc(10px + var(--q-safe-top))
            max(13px, var(--q-safe-right))
            10px
            max(13px, var(--q-safe-left));
        gap: 10px;
    }

    .qcms-brand {
        gap: 8px;
    }

    .qcms-brand-mark {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 11px;
    }

    .qcms-brand strong {
        font-size: 12px;
    }

    .qcms-brand small {
        display: none;
    }

    .qcms-nav {
        min-width: 0;
        gap: 2px;
    }

    .qcms-nav a {
        padding: 9px 8px;
        font-size: 11px;
    }

    .card-analysis {
        width: min(100% - 22px, 1280px);
        padding-top: 16px;
        gap: 12px;
    }

    .qcms-panel {
        border-radius: 20px;
    }

    .analysis-hero {
        min-height: 0;
        padding: 22px 17px;
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .card-image {
        padding: 3px;
    }

    .image-placeholder {
        width: min(70vw, 245px);
        padding: 8px;
        border-radius: 23px;
    }

    .image-placeholder img {
        max-height: 335px;
        border-radius: 16px;
    }

    .verified-pill {
        margin-top: 13px;
        padding: 7px 11px;
        font-size: 8px;
    }

    .card-info h1 {
        font-size: clamp(31px, 11vw, 46px);
        text-align: left;
    }

    .card-info h2 {
        margin-bottom: 20px;
        font-size: 12px;
    }

    .card-detail-grid {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .card-detail-grid p {
        min-height: 57px;
        padding: 11px 13px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .card-detail-grid strong {
        text-align: right;
    }

    .qcms-top-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .qcms-stat-card {
        min-height: 134px;
        padding: 15px;
        border-radius: 17px;
    }

    .stat-icon {
        width: 31px;
        height: 31px;
        border-radius: 10px;
    }

    .qcms-stat-card h3 {
        margin: 14px 0 8px;
        font-size: 8px;
    }

    .qcms-stat-card strong {
        font-size: clamp(20px, 6vw, 28px);
    }

    .market-box,
    .grade-box,
    .chart-box,
    .sales-box,
    .ai-box,
    .investment-box {
        padding: 18px 14px;
    }

    .section-heading,
    .chart-header {
        margin-bottom: 15px;
        align-items: stretch;
    }

    .section-heading h2,
    .chart-header h2,
    .ai-score-column h2 {
        font-size: 24px;
    }

    .intelligence-grid,
    .market-dashboard-grid,
    .investment-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 7px;
    }

    .intelligence-grid p {
        min-height: 96px;
        padding: 13px;
    }

    .intelligence-grid strong {
        font-size: 20px;
    }

    .market-dashboard-card {
        min-height: 88px;
        padding: 12px;
    }

    .market-dashboard-card strong {
        font-size: 17px;
    }

    .metric-list p,
    .grade-grid p,
    .ai-facts p {
        min-height: 52px;
        padding: 11px 12px;
        gap: 10px;
    }

    .chart-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .price-history-filter {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .filter-group,
    .grade-select {
        min-width: 0;
        width: 100%;
    }

    .grade-select {
        height: 46px;
        font-size: 14px;
    }

    .price-chart-statistics {
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 7px;
        margin-bottom: 9px;
    }

    .price-stat {
        padding: 10px;
    }

    .price-stat strong {
        font-size: 15px;
    }

    .chart-stage {
        width: 100%;
        height: 300px;
        max-height: 300px;
        padding: 8px 0 0;
        overflow: hidden;
    }

    #salesHistory {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .sale-item {
        padding: 16px;
    }

    .sale-item p:nth-child(3) {
        font-size: 25px;
    }

    .ai-report-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .ai-score-column {
        align-items: flex-start;
    }

    .ai-score {
        width: 138px;
        margin: 15px auto 0;
        font-size: 29px;
    }

    .investment-card {
        min-height: 105px;
        padding: 13px;
    }

    .investment-card strong {
        font-size: 20px;
    }

    .investment-bottom {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 380px) {
    .qcms-nav a {
        padding-inline: 6px;
        font-size: 10px;
    }

    .qcms-top-dashboard,
    .intelligence-grid,
    .market-dashboard-grid,
    .investment-grid {
        grid-template-columns: 1fr;
    }

    .qcms-stat-card {
        min-height: 112px;
    }
}


/* =========================================================
   QCMS PRO v2.1 — CHART COMPANY + PERIOD CONTROLS
   ========================================================= */

.chart-controls {
    min-width: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.period-selector {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--q-border);
    border-radius: 13px;
    background: rgba(0,0,0,.22);
}

.period-button {
    min-width: 42px;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    color: var(--q-muted);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: color .2s ease, background .2s ease, transform .2s ease;
}

.period-button:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
}

.period-button.active {
    color: #06130d;
    background: var(--q-green);
    box-shadow: 0 7px 22px rgba(0,224,138,.18);
}

.company-data-status {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: -4px 0 13px;
}

.company-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid var(--q-border);
    border-radius: 999px;
    color: #cbd2dc;
    background: rgba(255,255,255,.035);
    font-size: 10px;
    font-weight: 750;
}

.company-status-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--company-color, #929ba8);
    box-shadow: 0 0 12px color-mix(in srgb, var(--company-color, #929ba8) 45%, transparent);
}

.company-status-pill.no-data {
    color: #717985;
    opacity: .72;
}

.company-status-pill.no-data::after {
    content: "No Data";
    margin-left: 3px;
    color: #626a75;
    font-size: 9px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .chart-controls {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .period-selector {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(5, minmax(0,1fr));
    }

    .period-button {
        min-width: 0;
        width: 100%;
        padding: 0 4px;
    }

    .company-data-status {
        gap: 5px;
        margin-top: 0;
    }

    .company-status-pill {
        padding: 6px 8px;
        font-size: 9px;
    }
}
