* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f7fa;
    color: #1f2937;
}

a {
    color: inherit;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 20px 48px;
}

.topbar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.back-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.hero-copy {
    background: white;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.1;
}

.meta {
    color: #64748b;
    margin-bottom: 16px;
    font-size: 15px;
}

.signal-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.pill {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.strong-buy { background: #dcfce7; color: #166534; }
.buy { background: #dbeafe; color: #1d4ed8; }
.fair-price { background: #fef3c7; color: #92400e; }
.wait { background: #fee2e2; color: #b91c1c; }
.history { background: #e5e7eb; color: #374151; }
.unknown { background: #ede9fe; color: #5b21b6; }

.price-block {
    margin: 0 0 18px;
}

.price-label {
    color: #64748b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.price-value {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.stat-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
}

.gallery-card {
    background: white;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.main-image-wrap {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px;
    text-align: center;
    margin-bottom: 12px;
    border: 1px solid #eef2f7;
}

.main-product-image {
    max-width: 420px;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
}

.gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-thumb {
    width: 78px;
    height: 78px;
    object-fit: contain;
    border-radius: 10px;
    background: white;
    padding: 6px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
}

.cta-card {
    margin-top: 18px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.cta-meta {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 12px;
}

.primary-cta {
    display: inline-block;
    padding: 13px 18px;
    border-radius: 12px;
    background: #111827;
    color: white;
    text-decoration: none;
    font-weight: 700;
}

.disabled-cta {
    background: #cbd5e1;
    color: #334155;
    cursor: default;
}

.section-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 22px;
    align-items: start;
}

.section-stack {
    display: grid;
    gap: 22px;
}

.section-card {
    background: white;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.section-card h2 {
    margin: 0 0 12px;
    font-size: 22px;
}

.section-subtext {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 12px;
}

.trend-row {
    margin-bottom: 14px;
}

.trend-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}

.trend-pct {
    font-weight: 700;
}

.trend-falling {
    color: #15803d;
    background: #dcfce7;
}

.trend-rising {
    color: #b91c1c;
    background: #fee2e2;
}

.trend-flat {
    color: #475569;
    background: #e2e8f0;
}

.sparkline-wrap {
    height: 96px;
    border-radius: 12px;
    background: #f8fafc;
    padding: 8px;
    display: flex;
    align-items: stretch;
}

.sparkline-wrap.trend-falling {
    color: #15803d;
}

.sparkline-wrap.trend-rising {
    color: #b91c1c;
}

.sparkline-wrap.trend-flat {
    color: #64748b;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.empty-sparkline {
    color: #64748b;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.trend-note {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 14px;
}

.explanation-card h3 {
    margin: 0 0 10px;
    font-size: 17px;
}

.signal-summary-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.signal-summary-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    font-weight: 700;
}

.signal-summary-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #1f2937;
}

.explanation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.explanation-column {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
}

.explanation-list {
    margin: 0;
    padding-left: 18px;
    color: #334155;
}

.explanation-list li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.confidence-note {
    margin: 16px 0 0;
    color: #64748b;
    font-size: 14px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

th {
    background: #f8fafc;
}

.specs-table td:first-child {
    width: 220px;
    font-weight: 700;
    color: #475569;
}

@media (max-width: 900px) {
    .hero,
    .section-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 30px;
    }

    .price-value {
        font-size: 34px;
    }

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