:root {
    --ink: #18202f;
    --muted: #6b7280;
    --line: #e5e7eb;
    --soft: #f6f8fb;
    --blue: #2563eb;
    --green: #0f766e;
    --amber: #b45309;
}

body {
    background: #f7f8fb;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { text-decoration: none; }

.brand-mark {
    align-items: center;
    background: var(--ink);
    border-radius: 7px;
    color: #fff;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.search-box .input-group-text,
.search-box .form-control {
    background: #f3f5f8;
    border-color: #f3f5f8;
}

.hero-band {
    background:
        linear-gradient(120deg, rgba(24, 32, 47, .94), rgba(15, 118, 110, .80)),
        url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1800&q=80") center/cover;
    color: #fff;
    padding: 76px 0 64px;
}

.hero-band h1 {
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.03;
    max-width: 850px;
}

.hero-band p {
    color: rgba(255, 255, 255, .82);
    font-size: 1.16rem;
    max-width: 680px;
}

.eyebrow {
    color: var(--green);
    display: inline-block;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: .75rem;
    text-transform: uppercase;
}

.hero-band .eyebrow { color: #8ce5d6; }

.hero-search {
    display: grid;
    gap: .75rem;
    grid-template-columns: 1fr auto;
    margin-top: 2rem;
    max-width: 680px;
}

.hero-panel,
.content-panel,
.filter-panel,
.auth-card,
.product-card,
.review-card,
.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(17, 24, 39, .06);
}

.hero-panel {
    background: rgba(255, 255, 255, .94);
    color: var(--ink);
    padding: 1.5rem;
}

.hero-panel p {
    color: #374151;
}

.score-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: 1fr 1fr;
}

.score-grid span {
    background: var(--soft);
    border-radius: 7px;
    display: flex;
    justify-content: space-between;
    padding: .75rem;
}

.section-title,
.page-heading {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-title h2,
.page-heading h1,
.content-panel h2,
.filter-panel h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
}

.page-heading h1 { font-size: 2rem; }

.product-card {
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

.product-card:hover {
    box-shadow: 0 20px 45px rgba(17, 24, 39, .10);
    transform: translateY(-2px);
}

.product-image {
    aspect-ratio: 4 / 3;
    background: var(--soft);
    display: block;
    overflow: hidden;
}

.product-image img,
.detail-image img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.product-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.35;
    min-height: 2.8rem;
}

.product-card h3 a { color: var(--ink); }

.soft-badge {
    background: #e8f5f3;
    color: var(--green);
}

.card-metrics {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    font-size: .92rem;
}

.category-strip {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.category-strip a,
.filter-panel a,
.list-link {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    display: flex;
    justify-content: space-between;
    padding: .9rem 1rem;
}

.filter-panel,
.content-panel {
    padding: 1.25rem;
}

.filter-panel {
    display: grid;
    gap: .6rem;
    position: sticky;
    top: 92px;
}

.filter-panel a.active {
    background: var(--ink);
    color: #fff;
}

.empty-state {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: var(--muted);
    padding: 1.5rem;
    text-align: center;
}

.product-detail {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(260px, 440px) 1fr;
    padding: 1.25rem;
}

.detail-image {
    aspect-ratio: 4 / 3;
    background: var(--soft);
    border-radius: 8px;
    overflow: hidden;
}

.detail-main h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 850;
    letter-spacing: 0;
}

.detail-metrics,
.dashboard-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.detail-metrics div,
.stat-card {
    background: var(--soft);
    border-radius: 8px;
    padding: .9rem;
}

.detail-metrics span,
.stat-card span {
    color: var(--muted);
    display: block;
    font-size: .82rem;
}

.detail-metrics strong,
.stat-card strong {
    font-size: 1.35rem;
}

.specs {
    background: var(--soft);
    border-radius: 8px;
    margin: 0;
    padding: 1rem;
    white-space: pre-wrap;
}

.price-row,
.admin-row {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: .85rem 0;
}

.price-row:last-child,
.admin-row:last-child { border-bottom: 0; }

.price-row span {
    color: var(--muted);
    display: block;
    font-size: .8rem;
}

.review-card {
    margin-bottom: 1rem;
    padding: 1.1rem;
}

.rating-pill {
    background: #fff7ed;
    border-radius: 999px;
    color: var(--amber);
    font-weight: 800;
    padding: .35rem .7rem;
    white-space: nowrap;
}

.review-image {
    border-radius: 8px;
    max-height: 260px;
    object-fit: cover;
    width: 100%;
}

.auth-shell {
    display: grid;
    min-height: 72vh;
    place-items: center;
    padding: 2rem 1rem;
}

.auth-card {
    display: grid;
    gap: 1rem;
    max-width: 430px;
    padding: 1.5rem;
    width: 100%;
}

.auth-card h1 {
    font-size: 1.7rem;
    font-weight: 850;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.stack-form label {
    display: grid;
    gap: .35rem;
    font-weight: 650;
}

.dev-link {
    background: var(--soft);
    border-radius: 8px;
    font-size: .82rem;
    overflow-wrap: anywhere;
    padding: .75rem;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

.admin-tabs a {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    padding: .55rem .9rem;
}

.mapping-grid {
    display: grid;
    gap: .65rem;
}

.mapping-grid span {
    background: var(--soft);
    border-radius: 8px;
    display: block;
    padding: .75rem;
}

.preview-row {
    background: var(--soft);
    border-radius: 8px;
    font-size: .82rem;
    margin: 0;
    max-height: 220px;
    overflow: auto;
    padding: .75rem;
    white-space: pre-wrap;
}

.level-badge {
    background: #e8f5f3;
    border-radius: 999px;
    color: var(--green);
    display: inline-flex;
    font-size: .78rem;
    font-weight: 800;
    padding: .2rem .55rem;
    vertical-align: middle;
}

.level-active {
    background: #e0f2fe;
    color: #0369a1;
}

.level-trusted {
    background: #fef3c7;
    color: #92400e;
}

.level-expert {
    background: #ede9fe;
    color: #6d28d9;
}

.profile-points {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(17, 24, 39, .06);
    display: grid;
    gap: 1rem;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 1.25rem;
}

.profile-points h2 {
    font-size: 2.4rem;
    font-weight: 850;
    margin: 0 0 .35rem;
}

.profile-points span,
.profile-points small {
    color: var(--muted);
    display: block;
}

.profile-points strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
}

.market-result {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 1rem;
    grid-template-columns: 82px 1fr;
    padding: 1rem 0;
}

.market-result:first-of-type {
    padding-top: 0;
}

.market-result:last-child {
    border-bottom: 0;
}

.market-result img {
    aspect-ratio: 1;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: contain;
    width: 82px;
}

.market-result p {
    color: var(--muted);
    margin: .35rem 0 0;
}

@media (max-width: 768px) {
    .hero-search,
    .product-detail {
        grid-template-columns: 1fr;
    }

    .hero-search .btn {
        width: 100%;
    }

    .section-title,
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: .5rem;
    }

    .filter-panel {
        position: static;
    }

    .profile-points {
        grid-template-columns: 1fr;
    }
}
