:root {
    --ink: #18211f;
    --muted: #63716d;
    --line: #d9e2df;
    --surface: #f7faf8;
    --paper: #ffffff;
    --green: #0b6b57;
    --blue: #285f9f;
    --amber: #a96714;
    --red: #a23b34;
    --shadow: 0 16px 42px rgba(14, 31, 27, 0.10);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--surface);
    line-height: 1.5;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 24px;
    background: rgba(255,255,255,0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}
.brand, .nav-actions { display: flex; align-items: center; gap: 12px; }
.brand { text-decoration: none; font-weight: 800; font-size: 1.25rem; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--green);
    color: white;
}
.icon-link, .text-link {
    min-width: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    background: white;
}
.text-link { padding: 0 14px; font-weight: 700; }
main { min-height: calc(100vh - 128px); }
.search-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
    gap: 36px;
    align-items: end;
    max-width: 1180px;
    margin: 0 auto;
    padding: 56px 24px 28px;
}
.eyebrow {
    margin: 0 0 10px;
    color: var(--green);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0;
}
h1 { margin: 0; font-size: clamp(2rem, 4vw, 4.2rem); line-height: 1.02; letter-spacing: 0; }
h2 { margin: 0 0 14px; font-size: 1.35rem; letter-spacing: 0; }
.search-hero p { max-width: 680px; color: var(--muted); font-size: 1.08rem; }
.search-box {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
input, select, textarea, button {
    width: 100%;
    font: inherit;
    border-radius: 8px;
    border: 1px solid var(--line);
    padding: 12px 14px;
    background: white;
    color: var(--ink);
}
button {
    cursor: pointer;
    border-color: var(--green);
    background: var(--green);
    color: white;
    font-weight: 800;
}
.status-strip {
    max-width: 1180px;
    margin: 0 auto 22px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
}
.status-strip div {
    background: #e9f0ed;
    padding: 16px;
    min-height: 74px;
}
.status-strip strong { display: block; font-size: 1.4rem; }
.status-strip span { color: var(--muted); }
.product-grid {
    max-width: 1180px;
    margin: 0 auto;
    padding: 8px 24px 56px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
.product-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
}
.product-image {
    display: grid;
    place-items: center;
    height: 190px;
    background: #eef3f1;
    text-decoration: none;
}
.product-image img { max-height: 178px; object-fit: contain; }
.product-info { padding: 14px; position: relative; }
.product-info h2 { font-size: 1rem; line-height: 1.25; margin-right: 44px; }
.product-info h2 a { text-decoration: none; }
.product-info p { color: var(--muted); margin: 0 0 14px; min-height: 24px; }
.score-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    font-weight: 900;
}
.score-good { background: var(--green); }
.score-mid { background: var(--amber); }
.score-low { background: var(--red); }
.meta-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 0.86rem; }
.product-detail {
    max-width: 1180px;
    margin: 0 auto;
    padding: 42px 24px;
    display: grid;
    grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}
.product-media {
    min-height: 420px;
    display: grid;
    place-items: center;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.product-media img { max-height: 390px; object-fit: contain; }
.image-empty { color: var(--muted); font-weight: 800; }
.back-link, .source-link { color: var(--green); font-weight: 800; text-decoration: none; }
.brand-line, .rating-basis, .long-text { color: var(--muted); }
.detail-score {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 12px;
    padding: 12px 16px;
    color: white;
    border-radius: 8px;
}
.detail-score strong { font-size: 2rem; line-height: 1; }
.facts, .nutrition-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px 0 0;
}
.facts div, .nutrition-grid span {
    background: #e9f0ed;
    padding: 12px;
    border-radius: 8px;
    min-height: 70px;
}
dt { color: var(--muted); font-size: 0.78rem; }
dd { margin: 0; font-weight: 800; }
.content-band {
    border-top: 1px solid var(--line);
    background: white;
    padding: 36px 24px 56px;
}
.two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    gap: 36px;
}
.two-columns > div { max-width: 760px; }
.review-list { display: grid; gap: 12px; }
.review-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: var(--surface);
}
.review-head { display: flex; justify-content: space-between; gap: 12px; }
.review-item p { color: var(--muted); margin-bottom: 8px; }
.review-form { margin-top: 16px; display: grid; gap: 10px; }
.review-form label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
.form-note { margin: 0; color: var(--amber); font-size: 0.9rem; }
.scanner-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 54px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 460px);
    gap: 32px;
    align-items: start;
}
.scanner-copy p { color: var(--muted); max-width: 560px; }
.manual-scan { display: flex; gap: 10px; margin-top: 20px; }
.manual-scan input { flex: 1; }
.manual-scan button { width: 140px; }
.camera-panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    display: grid;
    gap: 12px;
}
video { width: 100%; aspect-ratio: 4 / 3; background: #111; border-radius: 8px; object-fit: cover; }
.camera-note, .scan-result { color: var(--muted); }
.scan-result a { color: var(--green); font-weight: 800; }
.footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    background: white;
}
@media (max-width: 900px) {
    .search-hero, .product-detail, .two-columns, .scanner-shell { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .topbar { padding: 0 14px; }
    .search-hero { padding-top: 34px; }
    .product-grid, .status-strip { grid-template-columns: 1fr; }
    .product-image { height: 170px; }
    .product-detail { padding-top: 24px; }
    .product-media { min-height: 280px; }
    .facts, .nutrition-grid { grid-template-columns: 1fr; }
    .manual-scan { display: grid; }
    .manual-scan button { width: 100%; }
    .footer { display: grid; }
}
