:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #142033;
    --muted: #697386;
    --primary: #1d63ed;
    --primary-dark: #164fbf;
    --border: #dfe5ee;
    --success: #0f8a55;
    --warning: #9a5d00;
    --danger: #b63232;
    --shadow: 0 14px 34px rgba(30, 49, 82, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

.topbar, .admin-topbar {
    background: #0e1b2b;
    color: #fff;
    padding: 18px 0;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
}

.logo-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #0e1b2b;
    font-weight: 900;
}

.brand-block h1, .brand-block p { margin: 0; }
.brand-block h1 { font-size: 22px; }
.brand-block p { margin-top: 2px; color: #b7c3d4; font-size: 14px; }

.version { color: #95a6bb; font-weight: 700; font-size: 13px; }

.hero {
    margin: 34px 0 20px;
    background: linear-gradient(135deg, #0e1b2b, #1d3e6f);
    color: #fff;
    border-radius: 24px;
    padding: 42px;
    box-shadow: var(--shadow);
}

.hero h2 {
    margin: 8px 0 10px;
    max-width: 820px;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.08;
}

.hero p { max-width: 780px; color: #d6e0ed; line-height: 1.6; }

.eyebrow {
    color: #94b8ff;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.stats { display: flex; gap: 12px; margin-top: 26px; }
.stats div {
    min-width: 120px;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    background: rgba(255,255,255,.07);
}
.stats strong, .stats span { display: block; }
.stats strong { font-size: 22px; }
.stats span { margin-top: 2px; color: #c7d4e5; font-size: 12px; }

.search-card, .notice, .empty {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.notice.error { border-left: 6px solid var(--danger); }

.filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

label span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input, select, button {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 13px;
    font: inherit;
}

button {
    width: auto;
    border: 0;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    padding: 0 22px;
    cursor: pointer;
}

.results-head { display: flex; justify-content: space-between; align-items: end; margin: 30px 0 14px; }
.results-head h3, .results-head p { margin: 0; }
.results-head p { margin-top: 4px; color: var(--muted); }

.offer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.offer-card {
    position: relative;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.offer-badge {
    position: absolute;
    z-index: 2;
    top: 14px;
    left: 14px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}
.offer-badge.cash { background: #e4f8ef; color: var(--success); }
.offer-badge.subscription { background: #fff0d5; color: var(--warning); }

.phone-image {
    height: 180px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #f3f6fa;
}
.phone-image img { width: 100%; height: 100%; object-fit: contain; padding: 24px; }
.phone-placeholder { font-size: 64px; }

.offer-body { padding: 20px; }
.retailer { margin: 0 0 5px; color: var(--primary); font-weight: 800; }
.offer-body h3 { margin: 0; font-size: 21px; }
.meta { margin: 5px 0 18px; color: var(--muted); }

.price-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eef2f7;
}
.price-row.small { color: var(--muted); font-size: 14px; }

.total-box {
    margin: 16px 0;
    padding: 14px;
    border-radius: 14px;
    background: #eef4ff;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.total-box span { color: var(--muted); font-size: 13px; }
.total-box strong { font-size: 25px; }

.offer-link {
    display: block;
    padding: 13px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
}
.checked { margin: 13px 0 0; color: var(--muted); text-align: center; font-size: 12px; }

footer {
    margin-top: 46px;
    padding: 26px 0;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 900px) {
    .filters { grid-template-columns: 1fr 1fr; }
    .filters label:first-child { grid-column: 1 / -1; }
    .filters button { width: 100%; }
    .offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .shell { width: min(100% - 20px, 1180px); }
    .hero { padding: 28px 22px; border-radius: 18px; }
    .stats { flex-direction: column; }
    .filters { grid-template-columns: 1fr; }
    .filters label:first-child { grid-column: auto; }
    .offer-grid { grid-template-columns: 1fr; }
}
