*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #F2F4F8;
    --navy: #0F1526;
    --blue: #0078D8;
    --violet: #5000C8;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    background: var(--bg);
    color: var(--navy);
    line-height: 1.45;
}

a { color: var(--blue); text-decoration: none; }

.deals-header {
    background: linear-gradient(90deg, var(--blue), var(--violet));
    color: white;
    padding: 0 1rem;
}
.deals-header-inner {
    max-width: 960px;
    margin: 0 auto;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}
.deals-brand img { height: 32px; display: block; }
.deals-nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.deals-nav a { color: white; font-weight: 600; font-size: 0.95rem; }
.deals-nav a:hover { text-decoration: underline; }

.deals-main { max-width: 960px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

.deals-hero { text-align: center; margin-bottom: 1.5rem; }
.deals-hero h1 { font-size: 1.6rem; color: var(--navy); margin-bottom: 0.4rem; }
.deals-hero p { color: #555; }

.deals-form {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    max-width: 640px;
    margin: 0 auto 2rem;
}
.deals-question { border: none; margin-bottom: 1.25rem; }
.deals-question legend { font-weight: 700; margin-bottom: 0.6rem; font-size: 1rem; }
.radio-tile {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.4rem 0.9rem;
    margin: 0 0.5rem 0.5rem 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}
.radio-tile:has(input:checked) { border-color: var(--blue); background: #e8f2fc; }
.deals-question select, .deals-question input[type="number"] {
    min-height: 44px;
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
}
.deals-submit { width: 100%; min-height: 48px; font-size: 1.05rem; }

.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    min-height: 44px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: #0063b0; }
.btn-secondary { background: #e7eaf0; color: var(--navy); }

.deals-results h2 { margin-bottom: 0.5rem; }
.deals-meta { color: #555; margin-bottom: 1rem; font-size: 0.9rem; }
.deals-no-match { background: white; border-radius: 10px; padding: 1.25rem; text-align: center; }

.result-cards { display: flex; flex-direction: column; gap: 1rem; }
.result-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 1rem;
    display: flex;
    gap: 1rem;
}
.result-photo { width: 84px; flex-shrink: 0; }
.result-photo img { width: 100%; border-radius: 8px; }
.result-photo-placeholder { width: 84px; height: 84px; border-radius: 8px; background: #e7eaf0; }
.result-body { flex: 1; min-width: 0; }
.result-body h3 { font-size: 1.1rem; }
.result-sub { color: #666; font-size: 0.85rem; margin: 0.15rem 0 0.4rem; }
.result-plan { font-weight: 600; margin-bottom: 0.5rem; }

.chip { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; margin-bottom: 0.4rem; }
.chip-tie { background: #fff2cc; color: #946200; }

.result-prices { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.price-label { display: block; font-size: 0.75rem; color: #888; text-transform: uppercase; }
.price-value { display: block; font-size: 1.1rem; font-weight: 700; }
.price-first-year .price-value { font-size: 1.4rem; color: var(--violet); }

.result-fine-print { font-size: 0.8rem; color: #666; margin-bottom: 0.4rem; }
.result-flag { font-size: 0.8rem; color: #9a6700; font-weight: 600; margin-bottom: 0.3rem; }
.result-why { margin: 0.4rem 0 0.75rem 1.1rem; font-size: 0.88rem; color: #333; }
.result-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.profile-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.profile-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 1.5rem 1rem;
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
}
.profile-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); }

.plans-group { margin-bottom: 1.5rem; }
.plans-group h2 { margin-bottom: 0.5rem; }
.plans-table-wrap { overflow-x: auto; background: white; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.plans-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; white-space: nowrap; }
.plans-table th { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid #eee; color: #888; text-transform: uppercase; font-size: 0.72rem; }
.plans-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid #f0f0f0; }

.deals-footer { text-align: center; color: #666; font-size: 0.85rem; padding: 1.5rem 1rem; }
.deals-footer a { color: var(--blue); }

.ios-install-hint {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    background: var(--navy);
    color: white;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
}
.ios-install-hint button { background: none; border: none; color: white; font-size: 1.2rem; cursor: pointer; }

.offline-main { text-align: center; padding-top: 3rem; }
.offline-logo { height: 40px; margin-bottom: 1.5rem; }

.profile-sheet { background: white; border-radius: 10px; padding: 1.5rem; }
.print-footer { margin-top: 1.5rem; text-align: center; color: #999; font-size: 0.8rem; }

.phones-group { margin-bottom: 1.5rem; }
.phones-group h2 { margin-bottom: 0.75rem; }
.phone-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.phone-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    color: var(--navy);
}
.phone-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.phone-card-photo { width: 64px; flex-shrink: 0; }
.phone-card-photo img { width: 100%; border-radius: 8px; }
.phone-card-body h3 { font-size: 1rem; }
.phone-card-price { font-weight: 700; margin-top: 0.3rem; }

.phone-header { background: white; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 1.25rem; display: flex; gap: 1.25rem; margin-bottom: 1.5rem; }
.phone-header-body h1 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.phone-shelf-price { font-size: 1.3rem; font-weight: 700; color: var(--violet); margin: 0.4rem 0; }

.deal-rows { display: flex; flex-direction: column; gap: 0.6rem; }
.deal-row {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 0.75rem 1rem;
    display: flex;
    gap: 1rem;
    align-items: baseline;
    flex-wrap: wrap;
}
.deal-row-txn { font-weight: 600; flex: 1; min-width: 160px; }
.deal-row-price { font-size: 1.1rem; font-weight: 700; color: var(--violet); }
.deal-row-plan { color: #555; font-size: 0.9rem; }
.deal-row-ends { color: #888; font-size: 0.8rem; }

@media (max-width: 480px) {
    .phone-header { flex-direction: column; }
}

@media (max-width: 480px) {
    .result-card { flex-direction: column; }
    .result-photo { width: 100%; }
    .result-photo img, .result-photo-placeholder { width: 84px; }
}

@media print {
    .no-print { display: none !important; }
    body { background: white; }
    .profile-sheet { box-shadow: none; padding: 0; }
    .result-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
    .deals-main { max-width: 100%; padding: 0; }
    @page { margin: 0.5in; size: letter; }
}
