/* ============================================
   Panels Market Analysis — unified design system
   Aligns with dashboard (dv2) tokens
   ============================================ */

/* ============================================
   Section titles (used outside cards)
   ============================================ */
.market-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex; align-items: center; gap: .65rem;
}
.market-section-subtitle {
    font-size: .9rem;
    color: var(--bs-secondary-color, #64748b);
    margin: 0;
}

/* ============================================
   Day-range bar (inline, NOT sticky)
   ============================================ */
.day-range-bar {
    padding: .65rem .9rem;
    background: #fff;
    border: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,.06));
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.day-range-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--bs-secondary-color, #64748b);
}
.day-range-bar .btn-group .btn { font-weight: 600; }
.day-range-bar .btn-outline-primary.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border-color: transparent;
    color: #fff;
}

/* ============================================
   Slim disclaimer strip
   ============================================ */
.market-disclaimer-strip {
    font-size: .825rem;
    color: var(--bs-secondary-color, #64748b);
    padding: .55rem .9rem;
    background: rgba(13, 110, 253, 0.04);
    border-left: 3px solid rgba(13, 110, 253, 0.5);
    border-radius: 4px;
}

/* ============================================
   In-page nav-pills
   ============================================ */
.market-nav {
    margin-bottom: 1.25rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: .25rem;
    padding-bottom: 2px;
}
.market-nav .nav-link {
    white-space: nowrap;
    font-size: .82rem;
    padding: .35rem .85rem;
    color: var(--bs-secondary-color, #64748b);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 500;
    transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.market-nav .nav-link:hover {
    background: rgba(13, 110, 253, 0.06);
    color: #1e40af;
}
.market-nav .nav-link i {
    margin-right: 4px;
    font-size: .9rem;
    color: #94a3b8;
    transition: color .12s ease;
}
.market-nav .nav-link:hover i { color: #3b82f6; }

/* ============================================
   Hero polish
   ============================================ */
.hero-inline-stats { font-size: 1.05rem; opacity: 0.92; }
.hero-glass-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.hero-glass-card-sm {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}
.hero-trend-pill {
    display: inline-flex; align-items: center;
    font-size: .82rem; font-weight: 600;
    padding: 4px 12px; border-radius: 999px;
}
.hero-trend-up   { background: rgba(245, 158, 11, 0.20); color: #fde68a; }
.hero-trend-down { background: rgba(16, 185, 129, 0.20); color: #bbf7d0; }

.py-md-6 { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }
@media (max-width: 767.98px) {
    .py-md-6 { padding-top: 2.25rem !important; padding-bottom: 2.25rem !important; }
}

/* ============================================
   KPI cards (icon-side layout)
   ============================================ */
.market-kpi {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.025);
    transition: transform .18s ease, box-shadow .18s ease;
    position: relative;
    overflow: hidden;
}
.market-kpi::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
}
.market-kpi-blue::before    { background: linear-gradient(180deg, #3b82f6, #1e40af); }
.market-kpi-green::before   { background: linear-gradient(180deg, #16a085, #0e6b5a); }
.market-kpi-amber::before   { background: linear-gradient(180deg, #f59e0b, #d97706); }
.market-kpi-purple::before  { background: linear-gradient(180deg, #8b5cf6, #6d28d9); }
.market-kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); }

.market-kpi-icon {
    flex: 0 0 44px;
    width: 44px; height: 44px;
    border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.market-kpi-blue   .market-kpi-icon { background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%); }
.market-kpi-green  .market-kpi-icon { background: linear-gradient(135deg, #16a085 0%, #0e6b5a 100%); }
.market-kpi-amber  .market-kpi-icon { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.market-kpi-purple .market-kpi-icon { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }

.market-kpi-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    color: var(--bs-secondary-color, #64748b);
    margin-bottom: .1rem;
    line-height: 1.2;
}
.market-kpi-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.15;
    word-break: break-word;
}
.market-kpi-unit {
    font-size: .75rem;
    font-weight: 500;
    color: var(--bs-secondary-color, #64748b);
    margin-left: 2px;
    white-space: nowrap;
}
.market-kpi-note {
    font-size: .73rem;
    color: var(--bs-secondary-color, #64748b);
    line-height: 1.3;
}
.min-width-0 { min-width: 0; }

/* Trend badges */
.trend-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .7rem; font-weight: 600;
    padding: 3px 9px; border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.trend-up   { background: rgba(239, 68, 68, 0.10);  color: #b91c1c; border-color: rgba(239, 68, 68, 0.20); }
.trend-down { background: rgba(22, 160, 133, 0.10); color: #0e6b5a; border-color: rgba(22, 160, 133, 0.22); }
.trend-flat { background: rgba(107, 114, 128, 0.10); color: #4b5563; border-color: rgba(107, 114, 128, 0.20); }

/* ============================================
   Section cards
   ============================================ */
.dv2 .market-card,
.market-card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.025);
    background: #fff;
    overflow: hidden;
}
.market-card-header {
    padding: 1rem 1.25rem .75rem;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,.06));
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.market-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex; align-items: center; gap: .55rem;
}
.market-card-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 9px;
    color: #fff; font-size: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    flex: 0 0 32px;
}
.market-card-subtitle {
    font-size: .8rem;
    color: var(--bs-secondary-color, #64748b);
    margin: .2rem 0 0 2.85rem;
    line-height: 1.35;
}

/* ============================================
   Top-models — card grid
   ============================================ */
.market-model-card {
    border: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,.06));
    border-radius: 14px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    color: inherit;
    position: relative;
    background: #fff;
}
.market-model-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: inherit;
}
.market-model-rank {
    position: absolute;
    top: -10px; left: 12px;
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: #fff; font-size: .72rem; font-weight: 700;
    padding: 3px 10px; border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    z-index: 1;
}
.market-model-rank-1 { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); box-shadow: 0 2px 8px rgba(245, 158, 11, .4); }
.market-model-rank-2 { background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%); color: #1e293b; }
.market-model-rank-3 { background: linear-gradient(135deg, #d97706 0%, #92400e 100%); }

.market-model-logo {
    display: inline-flex; align-items: center; justify-content: center;
    height: 28px;
    font-size: .78rem; font-weight: 700; color: #475569;
}
.market-model-logo img { max-height: 28px; max-width: 100px; object-fit: contain; }
.market-model-logo.market-model-logo-fallback {
    padding: 2px 10px;
    background: rgba(13, 110, 253, 0.08);
    color: #1e40af;
    border-radius: 999px;
    font-size: .8rem;
    letter-spacing: .02em;
}

.market-model-name {
    font-weight: 700;
    font-size: .95rem;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: .25rem;
    word-break: break-word;
}
.market-model-meta {
    display: flex; flex-wrap: wrap; gap: .35rem;
}
.market-model-meta-item {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .72rem; font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}
.market-model-meta-item i { font-size: .8rem; color: #64748b; }
.market-eff-top  { background: rgba(16, 185, 129, 0.12); color: #047857; }
.market-eff-top  i { color: #10b981; }
.market-eff-good { background: rgba(59, 130, 246, 0.10); color: #1e40af; }
.market-eff-good i { color: #3b82f6; }
.market-eff-mid  { background: rgba(245, 158, 11, 0.10); color: #92400e; }
.market-eff-mid  i { color: #f59e0b; }

.market-model-price {
    border-top: 1px dashed rgba(0,0,0,.08);
}
.market-model-price-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}
.market-model-price-value small {
    font-size: .7rem; font-weight: 500; color: #64748b;
}
.market-model-price-meta {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: .35rem;
}

/* ============================================
   Cell technology pill (used in cards + tables)
   ============================================ */
.cell-tech-pill {
    display: inline-flex; align-items: center;
    font-size: .68rem; font-weight: 700; letter-spacing: .03em;
    padding: 2px 8px; border-radius: 6px;
    text-transform: uppercase;
    background: rgba(107, 114, 128, .1); color: #4b5563;
    border: 1px solid transparent;
    align-self: flex-start;
    margin-bottom: .35rem;
}
/* Per-technology colors — sync with technologyColors in panels.js */
.cell-tech-TOPCon       { background: rgba(59, 130, 246, .12);  color: #1e40af; }
.cell-tech-PERC         { background: rgba(245, 158, 11, .14);  color: #92400e; }
.cell-tech-HJT          { background: rgba(16, 185, 129, .12);  color: #047857; }
.cell-tech-IBC          { background: rgba(139, 92, 246, .12);  color: #5b21b6; }
.cell-tech-N-type       { background: rgba(6, 182, 212, .14);   color: #155e75; }
.cell-tech-P-type       { background: rgba(239, 68, 68, .12);   color: #b91c1c; }
.cell-tech-Back\ Contact{ background: rgba(168, 85, 247, .12);  color: #6b21a8; }
.cell-tech-CdTe         { background: rgba(20, 184, 166, .12);  color: #115e59; }
.cell-tech-Flexible     { background: rgba(249, 115, 22, .12);  color: #9a3412; }
.cell-tech-BIPV         { background: rgba(99, 102, 241, .12);  color: #3730a3; }
.cell-tech-Nieznana     { background: rgba(148, 163, 184, .14); color: #475569; }

/* ============================================
   Manufacturer logo (inline + fallback to text pill)
   ============================================ */
.manufacturer-logo-wrap {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 28px;
    flex-shrink: 0;
}
.manufacturer-logo-wrap.logo-fallback::before {
    content: attr(data-mfg);
    display: inline-block;
    padding: 2px 9px;
    background: linear-gradient(135deg, rgba(59, 130, 246, .10) 0%, rgba(99, 102, 241, .10) 100%);
    color: #1e40af;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}
.manufacturer-logo-sm {
    height: 24px;
    width: auto;
    max-width: 90px;
    object-fit: contain;
    vertical-align: middle;
}

.tier1-badge {
    font-size: .62rem;
    letter-spacing: .04em;
    background: linear-gradient(135deg, #16a085 0%, #0e6b5a 100%) !important;
    color: #fff;
    padding: 2px 7px;
}

/* ============================================
   Tables
   ============================================ */
.market-table { margin-bottom: 0; }
.market-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: .73rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid #e2e8f0;
    padding: .65rem .75rem;
}
.market-table tbody td {
    padding: .7rem .75rem;
    vertical-align: middle;
    font-size: .9rem;
    border-color: rgba(0,0,0,.04);
}
.market-table tbody tr { transition: background-color .12s ease; }
.market-table tbody tr:hover { background: rgba(13, 110, 253, 0.04); }
.market-table tbody tr td a.mfg-name {
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
}
.market-table tbody tr td a.mfg-name:hover { color: #1e40af; }

/* Rank cell + medals */
.market-table .rank-cell {
    width: 3rem;
    text-align: center;
    color: #94a3b8;
    font-weight: 700;
}
.market-table .rank-num { font-size: .9rem; }
.rank-medal {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 999px;
    font-size: .85rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.rank-medal-gold   { background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); color: #fff; box-shadow: 0 2px 8px rgba(245, 158, 11, .4); }
.rank-medal-silver { background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%); color: #1e293b; }
.rank-medal-bronze { background: linear-gradient(135deg, #f59e0b 0%, #92400e 100%); color: #fff; }

/* Rank row tinted accents */
.rank-row.rank-cheap  { background: linear-gradient(90deg, rgba(22, 160, 133, .055) 0%, transparent 35%); }
.rank-row.rank-cheap:hover  { background: linear-gradient(90deg, rgba(22, 160, 133, .10) 0%, rgba(13, 110, 253, 0.04) 60%); }
.rank-row.rank-mid    { background: linear-gradient(90deg, rgba(245, 158, 11, .045) 0%, transparent 35%); }
.rank-row.rank-mid:hover { background: linear-gradient(90deg, rgba(245, 158, 11, .09) 0%, rgba(13, 110, 253, 0.04) 60%); }
.rank-row.rank-pricey { background: linear-gradient(90deg, rgba(239, 68, 68, .045) 0%, transparent 35%); }
.rank-row.rank-pricey:hover { background: linear-gradient(90deg, rgba(239, 68, 68, .09) 0%, rgba(13, 110, 253, 0.04) 60%); }

.market-table .price-cell { color: #0f172a; }
.market-table .rank-cheap  .price-cell { color: #047857; }
.market-table .rank-pricey .price-cell { color: #b91c1c; }

/* Offer link pill (unified) */
.offer-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.10);
    color: #92400e !important;
    border: 1px solid rgba(245, 158, 11, 0.22);
    font-size: .76rem;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
}
.offer-link:hover {
    background: rgba(245, 158, 11, 0.20);
    color: #78350f !important;
}

/* ============================================
   Manufacturer ranking — card grid
   ============================================ */
.market-mfg-card {
    border: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,.06));
    border-radius: 14px;
    position: relative;
    background: #fff;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.market-mfg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.market-mfg-cheap  { border-top: 3px solid #16a085; }
.market-mfg-mid    { border-top: 3px solid #f59e0b; }
.market-mfg-pricey { border-top: 3px solid #ef4444; }
.market-mfg-cheap:hover  { box-shadow: 0 8px 24px rgba(22, 160, 133, 0.15); border-color: rgba(22, 160, 133, 0.4); }
.market-mfg-mid:hover    { box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.4); }
.market-mfg-pricey:hover { box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.4); }

.market-mfg-rank {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 1;
}
.market-mfg-rank .rank-num {
    display: inline-block;
    font-size: .75rem; font-weight: 700;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 9px;
    border-radius: 999px;
}
.market-mfg-head .manufacturer-logo-wrap { min-height: 32px; }
.market-mfg-head .manufacturer-logo-sm { height: 32px; max-width: 110px; }

.market-mfg-name {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}
.market-mfg-name a {
    color: #0f172a;
    text-decoration: none;
}
.market-mfg-name a:hover { color: #1e40af; }

.market-mfg-price-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
}
.market-mfg-cheap  .market-mfg-price-value { color: #047857; }
.market-mfg-pricey .market-mfg-price-value { color: #b91c1c; }
.market-mfg-price-unit {
    font-size: .75rem; font-weight: 500; color: #64748b;
}
.market-mfg-stat {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .75rem; font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.market-mfg-stat i { color: #64748b; font-size: .85rem; }

/* ============================================
   Tech browse cards
   ============================================ */
.tech-card-grid {}
.tech-card {
    display: block;
    padding: .85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(107, 114, 128, .15);
    background: rgba(107, 114, 128, .04);
    color: #475569 !important;
    text-decoration: none !important;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    height: 100%;
}
.tech-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.tech-card-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: .35rem;
}
.tech-card-name {
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.tech-card-count {
    background: rgba(255, 255, 255, 0.75);
    padding: 1px 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    color: #1e293b;
}
.tech-card-stats {
    display: flex; gap: .65rem; flex-wrap: wrap;
    font-size: .72rem;
}
.tech-card-stats span {
    display: inline-flex; align-items: center; gap: 3px;
    opacity: .85;
}
.tech-card-stats i { font-size: .8rem; opacity: .8; }

/* Per-technology tinted cards (override the generic base) */
.tech-card.cell-tech-TOPCon       { background: rgba(59, 130, 246, .08);  border-color: rgba(59, 130, 246, .25);  color: #1e40af !important; }
.tech-card.cell-tech-PERC         { background: rgba(245, 158, 11, .08);  border-color: rgba(245, 158, 11, .25);  color: #92400e !important; }
.tech-card.cell-tech-HJT          { background: rgba(16, 185, 129, .08);  border-color: rgba(16, 185, 129, .25);  color: #047857 !important; }
.tech-card.cell-tech-IBC          { background: rgba(139, 92, 246, .08);  border-color: rgba(139, 92, 246, .25);  color: #5b21b6 !important; }
.tech-card.cell-tech-N-type       { background: rgba(6, 182, 212, .08);   border-color: rgba(6, 182, 212, .28);   color: #155e75 !important; }
.tech-card.cell-tech-Back\ Contact{ background: rgba(168, 85, 247, .08);  border-color: rgba(168, 85, 247, .25);  color: #6b21a8 !important; }
.tech-card.cell-tech-CdTe         { background: rgba(20, 184, 166, .08);  border-color: rgba(20, 184, 166, .25);  color: #115e59 !important; }
.tech-card.cell-tech-Flexible     { background: rgba(249, 115, 22, .08);  border-color: rgba(249, 115, 22, .25);  color: #9a3412 !important; }
.tech-card.cell-tech-BIPV         { background: rgba(99, 102, 241, .08);  border-color: rgba(99, 102, 241, .25);  color: #3730a3 !important; }
.tech-card.cell-tech-Nieznana     { background: rgba(148, 163, 184, .08); border-color: rgba(148, 163, 184, .25); color: #475569 !important; }

/* ============================================
   Chart bodies
   ============================================ */
.market-chart-body { padding: 1rem 1.25rem 1.25rem; }
#efficiencyPriceScatterChart,
#offerCountsChart,
#manufacturerRankingChart { cursor: pointer; }

/* ============================================
   Technology pills (legend / browse)
   ============================================ */
.tech-link {
    display: inline-flex; align-items: center; gap: .4rem;
    margin: .15rem .25rem .15rem 0;
    padding: .4rem .85rem;
    border: 1px solid rgba(13, 110, 253, 0.18);
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.06);
    color: #1e40af !important;
    text-decoration: none !important;
    font-size: .82rem;
    font-weight: 600;
    transition: background-color .15s ease, transform .12s ease, border-color .12s ease;
}
.tech-link:hover {
    background: rgba(13, 110, 253, 0.14);
    border-color: rgba(13, 110, 253, 0.35);
    transform: translateY(-1px);
    color: #1e3a8a !important;
}
.tech-link .tech-count {
    background: rgba(255, 255, 255, 0.75);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: .72rem;
    color: #475569;
    font-weight: 700;
}

/* ============================================
   Collapsed price-range details
   ============================================ */
.market-details > summary {
    cursor: pointer;
    font-weight: 600;
    padding: .65rem 1rem;
    color: var(--bs-secondary-color, #64748b);
    background: #f8fafc;
    border: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,.06));
    border-radius: 10px;
    list-style: none;
}
.market-details > summary::-webkit-details-marker { display: none; }
.market-details > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: .5rem;
    transition: transform .15s ease;
}
.market-details[open] > summary::before { transform: rotate(90deg); }
.market-details[open] > summary { color: #0f172a; }

/* ============================================
   Methodology card
   ============================================ */
.market-methodology {
    background: #fefce8;
    border: 0;
    border-left: 4px solid #f59e0b !important;
    border-radius: 10px;
}
.market-methodology .card-header { background: transparent; border-bottom: none; }

/* ============================================
   Back-to-top floating button
   ============================================ */
.market-back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1040;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.32);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transform: translateY(8px) scale(.9);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}
.market-back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.market-back-to-top:hover {
    transform: translateY(-2px) scale(1);
    box-shadow: 0 10px 22px rgba(30, 64, 175, 0.4);
}

/* Smooth anchor jumps from nav-pills */
html { scroll-behavior: smooth; scroll-padding-top: 70px; }

/* ============================================
   Alternating section backgrounds
   ============================================ */
.market-section-bg {
    background: #f8fafc;
    margin-left: calc(-1 * var(--bs-gutter-x, 1.5rem) * .5);
    margin-right: calc(-1 * var(--bs-gutter-x, 1.5rem) * .5);
    padding-left: var(--bs-gutter-x, 1.5rem);
    padding-right: var(--bs-gutter-x, 1.5rem);
    padding-top: 2rem;
    padding-bottom: 1.25rem;
    margin-top: -1.5rem;  /* close any gap from previous mb-4 */
}

/* ============================================
   Manufacturer card — mini price-position bar
   ============================================ */
.market-mfg-bar {
    margin: .35rem 0 .9rem;
}
.market-mfg-bar-track {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        rgba(22, 160, 133, 0.18) 0%,
        rgba(245, 158, 11, 0.20) 50%,
        rgba(239, 68, 68, 0.20) 100%);
    overflow: visible;
}
.market-mfg-bar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(22, 160, 133, 0.55) 0%, rgba(245, 158, 11, 0.55) 50%, rgba(239, 68, 68, 0.55) 100%);
    background-size: 200% 100%;
    background-position: left center;
}
.market-mfg-bar-marker {
    position: absolute;
    top: 50%;
    width: 12px; height: 12px;
    margin-left: -6px;
    margin-top: -6px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #0f172a;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    z-index: 1;
}
.market-mfg-cheap  .market-mfg-bar-marker { border-color: #047857; }
.market-mfg-mid    .market-mfg-bar-marker { border-color: #b45309; }
.market-mfg-pricey .market-mfg-bar-marker { border-color: #b91c1c; }

.market-mfg-bar-labels {
    display: flex; justify-content: space-between;
    font-size: .65rem;
    color: #94a3b8;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 767.98px) {
    .market-kpi-value { font-size: 1.3rem; }
    .market-card-subtitle { margin-left: 0; }
    .market-section-title { font-size: 1.15rem; }
    .market-card-header { padding: .75rem 1rem .5rem; flex-direction: column; align-items: flex-start; gap: .5rem; }
    .day-range-bar { padding: .5rem .65rem; }
    .day-range-label { display: none; }
}
