:root {
    --bg: #f6f7f4;
    --surface: #ffffff;
    --surface-soft: #eef2ed;
    --ink: #151719;
    --muted: #626a70;
    --line: #d9ded6;
    --line-strong: #c6cec3;
    --accent: #09745b;
    --accent-dark: #075844;
    --deal: #df5b2f;
    --success: #147a3f;
    --warning: #a35d00;
    --neutral: #64727d;
    --shadow: 0 14px 34px rgba(21, 23, 25, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

.wrap {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.header-wrap {
    display: grid;
    grid-template-columns: auto minmax(260px, 560px) auto;
    align-items: center;
    gap: 18px;
    padding: 12px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--ink);
    color: white;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.78rem;
}

.header-search,
.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search {
    min-width: 0;
}

.header-search input,
.search-form input,
select {
    min-width: 0;
    width: 100%;
    border: 1px solid var(--line-strong);
    background: white;
    color: var(--ink);
    border-radius: 8px;
    padding: 12px 14px;
    font: inherit;
}

.header-search input:focus,
.search-form input:focus,
select:focus {
    outline: 3px solid rgba(9, 116, 91, 0.14);
    border-color: var(--accent);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
}

.site-nav a:hover {
    color: var(--ink);
}

main.wrap {
    padding: 26px 0 80px;
}

main.wrap > section {
    display: grid;
    gap: 0;
    min-width: 0;
}

main.wrap > section > * {
    min-width: 0;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    margin-bottom: 0;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    letter-spacing: 0;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

p {
    line-height: 1.55;
}

.label,
.muted {
    color: var(--muted);
}

.label {
    font-size: 0.82rem;
    font-weight: 700;
}

.eyebrow,
.meta-pill,
.query-chip,
.status-chip,
.result-flag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
}

.eyebrow {
    padding: 6px 10px;
    background: #e6f3ee;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.button-primary,
button,
.search-form button,
.header-search button {
    background: var(--accent);
    color: white;
}

.button-primary:hover,
button:hover,
.search-form button:hover,
.header-search button:hover {
    background: var(--accent-dark);
}

.button-secondary {
    background: white;
    color: var(--ink);
    border-color: var(--line-strong);
}

.button-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.button-block {
    width: 100%;
}

.home-hero {
    display: grid;
    gap: 18px;
    padding: 18px 0 12px;
}

.hero-copy {
    display: grid;
    gap: 12px;
    max-width: 860px;
}

.hero-copy h1 {
    max-width: 760px;
    font-size: 3.75rem;
}

.hero-copy p {
    max-width: 720px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.1rem;
}

.search-form--hero {
    width: 100%;
    max-width: 840px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.search-form--hero input {
    min-height: 50px;
    border-color: transparent;
    background: #f8faf7;
    font-size: 1.05rem;
}

.search-form--compact {
    width: 100%;
    max-width: 760px;
}

.query-chip-row,
.meta-pill-row,
.status-row,
.offer-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.query-chip-row {
    margin-top: 0;
}

.query-chip-row--compact {
    margin-top: -6px;
}

.query-chip,
.meta-pill {
    padding: 7px 10px;
    border: 1px solid var(--line);
    background: white;
    color: var(--muted);
    font-size: 0.83rem;
    text-decoration: none;
}

.query-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

.shortcut-card {
    display: grid;
    gap: 6px;
    min-height: 88px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    text-decoration: none;
}

.shortcut-card:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 26px rgba(21, 23, 25, 0.06);
}

.shortcut-card span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.shortcut-card strong {
    align-self: end;
    font-size: 1.15rem;
}

.market-strip,
.merchant-strip {
    display: grid;
    gap: 14px;
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.market-strip {
    grid-template-columns: 82px minmax(0, 1fr) auto;
    align-items: center;
    padding: 18px;
}

.market-strip__media {
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 8px;
    background: #f4f6f2;
}

.market-strip__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.market-strip__media--empty {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.market-strip__product {
    display: grid;
    gap: 8px;
    text-decoration: none;
}

.market-strip__product h2 {
    font-size: 1.35rem;
}

.market-strip__product:hover h2 {
    color: var(--accent);
}

.market-strip__price {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.merchant-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 14px 18px;
}

.merchant-strip div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.merchant-strip strong {
    overflow-wrap: anywhere;
}

.section-shell {
    margin-top: 34px;
}

.section-shell--hero {
    margin-top: 0;
}

.section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 16px;
    margin-bottom: 18px;
}

.section-head--stack {
    grid-template-columns: 1fr;
    align-items: start;
}

.section-head h1,
.section-head h2 {
    font-size: 2.15rem;
}

.section-head p {
    margin: 8px 0 0;
    color: var(--muted);
}

.product-card-grid,
.flow-grid,
.summary-grid,
.product-detail-grid,
.page-main,
.page-side,
.product-layout,
.history-bars {
    display: grid;
    gap: 16px;
}

.product-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-card-grid--dense {
    gap: 14px;
}

.catalog-card,
.flow-card,
.side-card,
.metric-card,
.offer-card,
.summary-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.catalog-card,
.flow-card,
.side-card,
.metric-card,
.summary-card {
    padding: 16px;
}

.catalog-card {
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    gap: 10px;
}

.catalog-card:hover,
.offer-card:hover,
.shortcut-card:hover {
    box-shadow: var(--shadow);
}

.catalog-card__media {
    display: grid;
    place-items: center;
    min-height: 150px;
    border-radius: 8px;
    background: #f4f6f2;
    text-decoration: none;
    overflow: hidden;
}

.catalog-card__media img {
    width: 100%;
    height: 145px;
    object-fit: contain;
    padding: 12px;
}

.catalog-card__media--empty span,
.product-media--empty strong {
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 700;
}

.catalog-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.catalog-card h2,
.catalog-card h3 {
    font-size: 1.05rem;
    line-height: 1.22;
}

.catalog-card h2 a,
.catalog-card h3 a {
    text-decoration: none;
}

.catalog-card h2 a:hover,
.catalog-card h3 a:hover {
    color: var(--accent);
}

.catalog-card p {
    margin: 0 0 6px;
    font-size: 0.9rem;
}

.catalog-card__footer {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 12px;
    margin-top: 4px;
}

.hero-price,
.price-tag,
.summary-card strong,
.metric-card strong,
.history-bar strong,
.history-bar span {
    font-family: "IBM Plex Mono", monospace;
    letter-spacing: 0;
}

.hero-price {
    font-size: 2.15rem;
    font-weight: 700;
}

.price-tag {
    color: var(--deal);
    font-size: 1.3rem;
    font-weight: 700;
}

.status-chip {
    padding: 6px 9px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-chip--success {
    background: #e2f3e8;
    color: var(--success);
}

.status-chip--warn {
    background: #fff0dc;
    color: var(--warning);
}

.status-chip--neutral {
    background: #eef1f3;
    color: var(--neutral);
}

.result-flag {
    padding: 6px 9px;
    background: #e6f3ee;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 700;
}

.result-flag--secondary {
    background: #eef1f3;
    color: var(--neutral);
}

.result-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.flow-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 28px;
}

.flow-card {
    background: transparent;
}

.flow-card h3 {
    font-size: 1.12rem;
}

.flow-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

.product-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    align-items: start;
    gap: 28px;
}

.page-main,
.page-side {
    gap: 28px;
}

.page-hero {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
    align-items: start;
    gap: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.page-hero h1 {
    margin-top: 12px;
    font-size: 2.6rem;
}

.product-hero-details {
    display: grid;
    gap: 22px;
}

.hero-price-block {
    display: grid;
    gap: 10px;
    max-width: 340px;
}

.product-media {
    display: grid;
    gap: 10px;
    justify-items: center;
    align-self: stretch;
}

.product-media > img {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.product-media--empty {
    min-height: 220px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.product-media__thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
}

.product-media__thumbs span {
    display: grid;
    place-items: center;
    height: 52px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.product-media__thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.summary-card strong {
    display: block;
    margin-top: 7px;
    font-size: 1.12rem;
}

.product-detail-grid {
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
    gap: 24px;
}

.detail-column h3 {
    margin-bottom: 12px;
    font-size: 1.12rem;
}

.attribute-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.attribute-list div {
    display: grid;
    grid-template-columns: minmax(120px, 0.55fr) minmax(0, 1fr);
    gap: 14px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}

.attribute-list dt {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.attribute-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.attribute-list--dense div {
    grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr);
}

.offer-list {
    display: grid;
    gap: 10px;
}

.offer-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
}

.offer-card__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
}

.offer-card__head h3 {
    font-size: 1.08rem;
}

.offer-card__head p,
.offer-card__body p {
    margin: 6px 0 0;
}

.offer-meta-row {
    grid-column: 1 / 3;
}

.offer-card__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    grid-column: 1 / 3;
}

.offer-card__action {
    grid-column: 3;
    grid-row: 1 / 4;
}

.side-card {
    display: grid;
    gap: 12px;
}

.side-card--accent {
    border-color: rgba(9, 116, 91, 0.35);
    background: #edf7f3;
}

.side-card h2 {
    font-size: 1.35rem;
}

.history-bars {
    grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
    align-items: end;
    margin-top: 6px;
}

.history-bar {
    display: grid;
    justify-items: center;
    gap: 7px;
}

.history-bar__column {
    width: 100%;
    height: 118px;
    display: flex;
    align-items: end;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f3f6f1;
}

.history-bar__fill {
    width: 100%;
    min-height: 20%;
    border-radius: 6px;
    background: var(--accent);
}

.history-bar strong,
.history-bar span {
    font-size: 0.72rem;
}

.empty-note {
    padding: 16px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: white;
    color: var(--muted);
}

.admin-links {
    display: grid;
    gap: 12px;
}

.admin-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    text-decoration: none;
}

.admin-links a:hover {
    border-color: var(--accent);
}

.admin-trigger-panel,
.admin-log-panel {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.admin-log-panel {
    margin-top: 24px;
    margin-bottom: 0;
}

.admin-trigger-form {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(180px, 220px) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.admin-trigger-form label {
    display: grid;
    gap: 8px;
}

.admin-trigger-form input,
.admin-trigger-form select {
    width: 100%;
}

.admin-trigger-result {
    margin: 0;
    padding: 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: #f8faf7;
    overflow: auto;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-log-output {
    max-height: 420px;
    overflow: auto;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    font-size: 1.3rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

form {
    margin: 0;
}

.stack {
    display: grid;
    gap: 12px;
}

.mobile-cta {
    display: none;
}

@media (max-width: 1024px) {
    .hero-copy h1 {
        font-size: 3rem;
    }

    .shortcut-grid,
    .merchant-strip,
    .product-card-grid,
    .flow-grid,
    .summary-grid,
    .product-detail-grid,
    .product-layout,
    .offer-card__body {
        grid-template-columns: 1fr;
    }

    .page-hero,
    .catalog-card__footer,
    .section-head,
    .market-strip,
    .offer-card,
    .offer-card__head {
        grid-template-columns: 1fr;
    }

    .market-strip__price {
        justify-items: start;
    }

    .offer-meta-row,
    .offer-card__body,
    .offer-card__action {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 720px) {
    .wrap {
        width: min(1180px, calc(100% - 24px));
    }

    .header-wrap {
        grid-template-columns: 1fr auto;
        gap: 10px;
    }

    .header-search {
        grid-column: 1 / -1;
        flex-direction: column;
    }

    .site-header {
        position: static;
    }

    .site-nav {
        display: none;
    }

    main.wrap {
        padding-top: 18px;
    }

    .hero-copy h1 {
        font-size: 2.35rem;
    }

    .hero-copy p {
        font-size: 1rem;
    }

    .search-form--hero,
    .search-form--compact {
        flex-direction: column;
    }

    .search-form--hero .button-primary,
    .search-form--compact .button-primary,
    .header-search button {
        width: 100%;
    }

    .header-search {
        align-items: stretch;
    }

    .shortcut-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section-head h1,
    .section-head h2 {
        font-size: 1.75rem;
    }

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

    .hero-price {
        font-size: 1.75rem;
    }

    .offer-card__action .button {
        width: 100%;
    }

    .history-bars {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .admin-trigger-form {
        grid-template-columns: 1fr;
    }

    .mobile-cta {
        display: block;
        position: sticky;
        bottom: 12px;
        z-index: 12;
    }

    .page-side .side-card:first-child {
        display: none;
    }
}
