*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #2563eb; --brand-dark: #1d4ed8; --dark: #1e293b; --light: #f8fafc;
  --gray: #64748b; --green: #16a34a; --orange: #f59e0b; --radius: 8px;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--dark); line-height: 1.6; background: #fff; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* Navbar */
.navbar { background: var(--dark); padding: 0.75rem 0; position: sticky; top: 0; z-index: 100; }
.navbar .container { display: flex; justify-content: space-between; align-items: center; min-width: 0; }
.logo { color: #fff; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; }
.logo:hover { text-decoration: none; }
.logo span { color: var(--brand); }
.navbar nav a { color: #cbd5e1; margin-left: 1.5rem; font-size: 0.9rem; }
.navbar nav a:hover { color: #fff; text-decoration: none; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--brand), #1e40af); color: #fff; padding: 3.5rem 0; text-align: center; }
.hero-home { padding: 4.5rem 0; }
.hero h1 { font-size: 2.2rem; margin-bottom: 0.5rem; font-weight: 800; letter-spacing: -0.5px; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto; }
.hero-search { margin-top: 1.5rem; }
.stats-bar { margin-top: 2rem; display: flex; justify-content: center; gap: 2.5rem; }
.stats-bar span { font-size: 0.85rem; opacity: 0.8; }
.stats-bar strong { display: block; font-size: 1.8rem; opacity: 1; }

/* Buttons */
.btn { display: inline-block; background: var(--brand); color: #fff; padding: 0.5rem 1.25rem; border-radius: var(--radius); border: none; cursor: pointer; font-size: 0.9rem; font-weight: 600; transition: background 0.2s; }
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn-hero { background: #fff; color: var(--brand); font-size: 1rem; padding: 0.75rem 2rem; }
.btn-hero:hover { background: #f1f5f9; color: var(--brand-dark); }
.btn-large { font-size: 1.1rem; padding: 0.85rem 2.5rem; }
.btn-outline { background: transparent; border: 2px solid var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }

/* Cards */
.trade-card, .city-card, .state-card, .contractor-card, .feature-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius); padding: 1.25rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.trade-card:hover, .city-card:hover, .state-card:hover, .feature-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); text-decoration: none;
}
.trade-card h3, .city-card h3, .state-card h3 { color: var(--dark); margin-bottom: 0.25rem; }
.trade-card p, .city-card p { color: var(--gray); font-size: 0.9rem; }
.pro-count { font-weight: 600; color: var(--brand); }

.contractor-card { position: relative; }
.contractor-card .card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.contractor-card h3 { margin-bottom: 0; }
.contractor-card .rating { color: var(--orange); font-size: 0.95rem; margin-bottom: 0.5rem; }
.contractor-card .review-count { color: var(--gray); font-size: 0.8rem; }
.contractor-card .badges { margin-bottom: 0.5rem; }
.contractor-card .license-num { font-size: 0.8rem; color: var(--gray); margin-bottom: 0.5rem; }
.contractor-card .card-desc { font-size: 0.85rem; color: var(--gray); margin-bottom: 0.75rem; }
.contractor-card .card-actions { display: flex; gap: 0.5rem; }

/* Badges */
.badge { display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 600; margin-right: 0.25rem; }
.badge.verified { background: #dcfce7; color: var(--green); }
.badge.license { background: #dbeafe; color: var(--brand); }
.badge.bbb { background: #fef3c7; color: #b45309; }
.badge.best { background: var(--brand); color: #fff; }

/* Steps */
.how-it-works { padding: 3rem 0; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; margin-top: 1.5rem; }
.step { text-align: center; padding: 1rem; }
.step-num { width: 48px; height: 48px; background: var(--brand); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; margin: 0 auto 1rem; }
.step h3 { margin-bottom: 0.5rem; }
.step p { color: var(--gray); font-size: 0.9rem; }

/* Why section */
.why-section { padding: 2rem 0; }
.feature-card h3 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--brand); }
.feature-card p { font-size: 0.9rem; color: var(--gray); }

/* Cities */
.cities-section { padding: 2rem 0; text-align: center; }
.city-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 1rem; }
.pill { display: inline-block; padding: 0.5rem 1.25rem; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 24px; font-size: 0.9rem; color: var(--dark); transition: all 0.2s; }
.pill:hover { background: var(--brand); color: #fff; border-color: var(--brand); text-decoration: none; }

/* City list (compact) */
.city-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.city-pill { display: inline-block; padding: 0.4rem 0.9rem; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 20px; font-size: 0.85rem; color: var(--dark); transition: all 0.2s; }
.city-pill:hover { background: var(--brand); color: #fff; border-color: var(--brand); text-decoration: none; }
.city-pill span { color: var(--gray); font-size: 0.75rem; }
.city-pill:hover span { color: #fff; }
.city-pill-sm { font-size: 0.8rem; padding: 0.3rem 0.7rem; }
.towns-expand { margin-top: 1.5rem; border: 1px solid #e2e8f0; border-radius: var(--radius); }
.towns-expand summary { cursor: pointer; padding: 0.75rem 1rem; font-weight: 600; }
.towns-expand .city-list { padding: 0 1rem 1rem; }

/* CTA */
.cta-section { background: #f8fafc; padding: 3rem 0; margin-top: 2rem; }
.cta-section h2 { margin-bottom: 0.5rem; }
.cta-section p { color: var(--gray); margin-bottom: 1.5rem; }

/* Content sections */
.content-section { padding: 2rem 0; }
.content-section h2 { margin-top: 1.5rem; }
.content-section h3 { margin-top: 1.25rem; margin-bottom: 0.5rem; color: var(--dark); }
.content-section p { margin-bottom: 0.75rem; color: #374151; }
.content-section ul, .content-section ol { margin: 0.75rem 0; padding-left: 1.5rem; }
.content-section li { margin-bottom: 0.35rem; }

/* Cost display */
.cost-range { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; padding: 1rem; background: #f1f5f9; border-radius: var(--radius); }
.cost-low, .cost-high { font-size: 1.5rem; font-weight: 700; color: var(--brand); }
.cost-bar { flex: 1; height: 8px; background: linear-gradient(90deg, #93c5fd, var(--brand)); border-radius: 4px; }
.cost-note { font-size: 0.9rem; color: var(--gray); }

/* Compare table */
.compare-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
.compare-table th, .compare-table td { padding: 0.5rem 0.75rem; border: 1px solid #e2e8f0; text-align: center; }
.compare-table th { background: #f8fafc; font-weight: 600; }
.compare-table tr:hover { background: #f8fafc; }

/* Local tip */
.local-tip { background: #fffbeb; border-left: 4px solid var(--orange); padding: 0.75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; }

/* Services list */
.services-list { columns: 2; column-gap: 2rem; }
.services-list li { break-inside: avoid; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; background: #f8fafc; border-radius: var(--radius); }
.empty-state h2 { margin-bottom: 0.5rem; }

/* Stats grid (admin) */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; margin: 1rem 0; }
.stat { background: #f1f5f9; padding: 1rem; border-radius: var(--radius); text-align: center; }
.stat strong { display: block; font-size: 1.5rem; color: var(--brand); }
.stat span { font-size: 0.8rem; color: var(--gray); }

/* Table */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid #e2e8f0; font-size: 0.9rem; }
th { background: #f8fafc; font-weight: 600; }

/* FAQ */
.faq { padding: 2rem 0; }
.faq h2 { margin-bottom: 1rem; }
details { border: 1px solid #e2e8f0; border-radius: var(--radius); margin-bottom: 0.5rem; padding: 0; }
summary { cursor: pointer; font-weight: 600; padding: 0.75rem 1rem; }
summary:hover { background: #f8fafc; }
details[open] summary { border-bottom: 1px solid #e2e8f0; }
details p { padding: 0.75rem 1rem; color: var(--gray); margin: 0; }

/* Reviews */
.review-card { border-bottom: 1px solid #e2e8f0; padding: 1rem 0; }
.review-card .reply { color: var(--gray); font-size: 0.85rem; margin-top: 0.5rem; }

/* Chat widget */
.chat-widget { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000; }
.chat-toggle { width: 56px; height: 56px; background: var(--brand); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px rgba(37,99,235,0.4); font-size: 1.5rem; transition: transform 0.2s; }
.chat-toggle:hover { transform: scale(1.1); }
.chat-window { display: none; width: 380px; height: 500px; background: #fff; border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); flex-direction: column; overflow: hidden; position: absolute; bottom: 70px; right: 0; }
.chat-window.open { display: flex; }
.chat-header { background: var(--brand); color: #fff; padding: 0.75rem 1rem; display: flex; justify-content: space-between; align-items: center; }
.chat-header button { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; }
.chat-messages .msg { margin-bottom: 0.75rem; padding: 0.6rem 0.85rem; border-radius: 12px; max-width: 85%; font-size: 0.9rem; line-height: 1.4; white-space: pre-line; }
.chat-messages .msg.bot { background: #f1f5f9; border-bottom-left-radius: 4px; }
.chat-messages .msg.user { background: var(--brand); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-input { display: flex; border-top: 1px solid #e2e8f0; }
.chat-input input { flex: 1; border: none; padding: 0.75rem 1rem; outline: none; font-size: 0.9rem; }
.chat-input button { background: var(--brand); color: #fff; border: none; padding: 0.75rem 1.25rem; cursor: pointer; font-weight: 600; }

/* Contractor Profile */
.pro-hero { background: linear-gradient(135deg, var(--dark), #0f172a); color: #fff; padding: 2.5rem 0; }
.pro-hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.pro-hero-info h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.pro-badges { margin-bottom: 0.5rem; }
.pro-rating-line { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.pro-stars { color: var(--orange); font-size: 1.1rem; letter-spacing: 1px; }
.pro-rating-num { font-weight: 700; font-size: 1.1rem; }
.pro-review-count { color: #94a3b8; font-size: 0.9rem; }
.pro-location { color: #94a3b8; margin-bottom: 1rem; }
.pro-cta-row { display: flex; gap: 0.75rem; }
.pro-hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.stat-card { background: rgba(255,255,255,0.1); border-radius: var(--radius); padding: 0.75rem 1rem; text-align: center; min-width: 90px; }
.stat-card strong { display: block; font-size: 1.3rem; }
.stat-card span { font-size: 0.75rem; color: #94a3b8; }

.pro-body { padding: 2rem 0; }
.pro-grid { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; }
.pro-main { min-width: 0; }
.pro-section { margin-bottom: 2rem; }
.pro-section h2 { font-size: 1.2rem; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid #e2e8f0; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.75rem; }
.contact-item { background: #f8fafc; border-radius: var(--radius); padding: 0.75rem 1rem; }
.contact-label { display: block; font-size: 0.75rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.25rem; }
.contact-value { font-weight: 600; word-break: break-all; }

/* Services tags */
.services-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.service-tag { background: #dbeafe; color: var(--brand); padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.9rem; font-weight: 600; }

/* Credentials */
.credentials-list { display: flex; flex-direction: column; gap: 0.75rem; }
.credential { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: #f8fafc; border-radius: var(--radius); }
.cred-icon { font-size: 1.3rem; }
.cred-detail { display: block; font-size: 0.8rem; color: var(--gray); }

/* Reviews */
.review-card { border-bottom: 1px solid #e2e8f0; padding: 1rem 0; }
.review-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.review-stars { color: var(--orange); }
.review-date { color: var(--gray); font-size: 0.8rem; margin-left: auto; }
.review-text { color: #374151; font-size: 0.95rem; }
.review-reply { margin-top: 0.5rem; padding: 0.75rem; background: #f8fafc; border-radius: var(--radius); font-size: 0.9rem; }
.empty-reviews { color: var(--gray); font-style: italic; }

/* Sidebar */
.pro-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar-card { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius); padding: 1.25rem; }
.sidebar-card h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.sidebar-cta { background: #f0f9ff; border-color: #bfdbfe; }
.sidebar-cta p { font-size: 0.9rem; color: var(--gray); margin-bottom: 1rem; }

/* Map */
.pro-map { height: 250px; border-radius: var(--radius); margin-bottom: 0.5rem; }
.map-caption { font-size: 0.8rem; color: var(--gray); text-align: center; }

/* Detail list */
.detail-list { margin: 0; }
.detail-list dt { font-size: 0.8rem; color: var(--gray); margin-top: 0.5rem; }
.detail-list dd { margin: 0; font-weight: 600; }

@media (max-width: 768px) {
  .pro-hero-grid { grid-template-columns: 1fr; }
  .pro-hero-stats { grid-template-columns: repeat(4, 1fr); }
  .pro-grid { grid-template-columns: 1fr; }
  .pro-cta-row { flex-direction: column; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* Remove link */
.remove-link { color: #94a3b8; font-size: 0.8rem; }
.remove-link:hover { color: #dc2626; }

/* Auth pages */
.auth-page { display: flex; justify-content: center; padding-top: 3rem; }
.auth-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 2rem; max-width: 420px; width: 100%; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.auth-subtitle { color: var(--gray); font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-error { color: #dc2626; background: #fef2f2; padding: 0.5rem 0.75rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.auth-switch { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--gray); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.form-group input { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #d1d5db; border-radius: var(--radius); font-size: 0.95rem; }
.form-group input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* Dashboard */
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.dash-cards { display: flex; flex-direction: column; gap: 1rem; }
.dash-job-card, .lead-card { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius); padding: 1.25rem; }
.job-card-header, .lead-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.job-desc { color: var(--gray); font-size: 0.9rem; margin-bottom: 0.5rem; }
.job-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--gray); margin-bottom: 0.75rem; }
.job-card-actions, .lead-actions { margin-top: 0.5rem; }

/* Portal layout */
.portal-grid { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; margin-top: 1.5rem; }
.portal-main { min-width: 0; }
.portal-sidebar { display: flex; flex-direction: column; gap: 1rem; }
@media (max-width: 768px) { .portal-grid { grid-template-columns: 1fr; } }

/* Matches */
.match-job-summary { background: #f8fafc; padding: 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.match-card { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius); padding: 1.25rem; position: relative; }
.match-rank { position: absolute; top: 0.75rem; right: 0.75rem; background: var(--brand); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; }
.match-status { font-size: 0.85rem; color: var(--gray); margin: 0.5rem 0; }
.match-actions { display: flex; gap: 0.5rem; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem 0; }
.page-info { color: var(--gray); font-size: 0.9rem; }

/* States section */
.states-section { padding: 2rem 0; text-align: center; }
.states-section h2 { margin-bottom: 1rem; }

/* Geo detection banner */
.geo-banner { background: #1e40af; color: #fff; padding: 0.5rem 0; font-size: 0.9rem; }
.geo-banner-inner { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.geo-banner .btn-sm { background: #fff; color: var(--brand); padding: 0.3rem 0.75rem; font-size: 0.8rem; border-radius: 4px; white-space: nowrap; }
.geo-banner .btn-sm:hover { background: #f1f5f9; text-decoration: none; }
.geo-dismiss { background: none; border: none; color: #93c5fd; font-size: 1.2rem; cursor: pointer; margin-left: auto; padding: 0 0.25rem; }
@media (max-width: 320px) { .geo-banner { font-size: 0.8rem; } .geo-banner-inner { gap: 0.5rem; } }

/* Breadcrumb */
.breadcrumb { background: #f8fafc; border-bottom: 1px solid #e2e8f0; padding: 0.5rem 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem; font-size: 0.8rem; }
.breadcrumb li::after { content: '/'; margin: 0 0.4rem; color: #cbd5e1; }
.breadcrumb li:last-child::after { display: none; }
.breadcrumb a { color: var(--brand); }
.breadcrumb span { color: var(--gray); }

/* Footer */
.footer { background: var(--dark); color: #94a3b8; padding: 2.5rem 0 1.5rem; font-size: 0.85rem; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { color: #e2e8f0; font-size: 0.9rem; margin-bottom: 0.75rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.35rem; }
.footer-col a { color: #94a3b8; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-copy { text-align: center; border-top: 1px solid #334155; padding-top: 1rem; }
@media (max-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; } }
@media (max-width: 320px) { .footer-grid { grid-template-columns: 1fr; gap: 1rem; } .footer-col h4 { font-size: 0.85rem; } }

/* Responsive — tablets */
@media (max-width: 640px) {
  .container { padding: 0 1rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 0.95rem; }
  .hero-home { padding: 2.5rem 0; }
  .stats-bar { flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
  .stats-bar span { min-width: 70px; }
  .stats-bar strong { font-size: 1.3rem; }
  .grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .steps-grid { grid-template-columns: 1fr; gap: 1rem; }
  .chat-window { width: calc(100vw - 1.5rem); right: -0.25rem; bottom: 65px; }
  .services-list { columns: 1; }
  .compare-table { font-size: 0.75rem; overflow-x: auto; display: block; }
  .cost-range { flex-direction: column; gap: 0.5rem; text-align: center; }
  .btn-large { padding: 0.65rem 1.5rem; font-size: 0.95rem; }
  .pro-grid { grid-template-columns: 1fr; }
  .pro-hero-grid { grid-template-columns: 1fr; }
  .pro-hero-stats { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
  .stat-card { padding: 0.5rem; min-width: auto; }
  .stat-card strong { font-size: 1rem; }
  .stat-card span { font-size: 0.65rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .pro-cta-row { flex-direction: column; }
  .pro-cta-row .btn { text-align: center; }
  .portal-grid { grid-template-columns: 1fr; }
  .match-grid { grid-template-columns: 1fr; }
}

/* Responsive — ultra-narrow (Fold3 folded: 280px) */
@media (max-width: 320px) {
  .container { padding: 0 0.625rem; }
  body { font-size: 14px; }
  .hero { padding: 1.5rem 0; }
  .hero-home { padding: 2rem 0; }
  .hero h1 { font-size: 1.2rem; line-height: 1.3; }
  .hero p { font-size: 0.85rem; line-height: 1.4; }
  .hero p br { display: none; }

  /* Stats: 2x2 grid instead of row */
  .stats-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; text-align: center; }
  .stats-bar span { font-size: 0.75rem; }
  .stats-bar strong { font-size: 1.1rem; }

  /* Navbar */
  .logo { font-size: 1.15rem; }
  .navbar nav a { margin-left: 0.75rem; font-size: 0.8rem; }

  /* Buttons */
  .btn { padding: 0.45rem 1rem; font-size: 0.85rem; }
  .btn-large { padding: 0.55rem 1.25rem; font-size: 0.9rem; }
  .btn-hero { padding: 0.6rem 1.5rem; font-size: 0.9rem; }

  /* Cards */
  .trade-card, .city-card, .state-card, .contractor-card, .feature-card {
    padding: 0.875rem;
  }
  .trade-card h3 { font-size: 0.95rem; }
  .trade-card p { font-size: 0.8rem; }

  /* Steps */
  .step-num { width: 36px; height: 36px; font-size: 1rem; }
  .step h3 { font-size: 0.95rem; }
  .step p { font-size: 0.8rem; }

  /* Contractor cards on trade page */
  .contractor-card .card-actions { flex-direction: column; gap: 0.4rem; }
  .contractor-card .card-actions .btn { width: 100%; text-align: center; font-size: 0.8rem; }
  .contractor-card h3 { font-size: 0.95rem; }
  .badges .badge { font-size: 0.65rem; padding: 0.1rem 0.35rem; margin-bottom: 0.2rem; }

  /* Profile page */
  .pro-hero { padding: 1.25rem 0; }
  .pro-hero-info h1 { font-size: 1.15rem; word-break: break-word; }
  .pro-hero-stats { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .stat-card { padding: 0.4rem 0.25rem; }
  .stat-card strong { font-size: 0.95rem; }
  .stat-card span { font-size: 0.6rem; }
  .pro-rating-line { flex-wrap: wrap; gap: 0.3rem; }
  .pro-stars { font-size: 0.95rem; }
  .sidebar-card { padding: 0.875rem; }
  .pro-map { height: 200px; }
  .contact-value { font-size: 0.85rem; }
  .service-tag { font-size: 0.8rem; padding: 0.3rem 0.7rem; }

  /* City pills / state list */
  .city-list { gap: 0.35rem; }
  .pill, .city-pill { font-size: 0.75rem; padding: 0.3rem 0.6rem; }
  .city-pill span { font-size: 0.65rem; }

  /* Chat widget */
  .chat-toggle { width: 46px; height: 46px; font-size: 1.2rem; }
  .chat-window { width: calc(100vw - 1rem); right: -0.125rem; height: 420px; bottom: 58px; border-radius: 12px; }
  .chat-header { padding: 0.5rem 0.75rem; font-size: 0.9rem; }
  .chat-messages .msg { font-size: 0.8rem; padding: 0.45rem 0.65rem; }
  .chat-input input { font-size: 0.85rem; padding: 0.6rem 0.75rem; }
  .chat-input button { padding: 0.6rem 0.75rem; font-size: 0.85rem; }

  /* Sections */
  section { padding: 1.25rem 0; }
  h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
  .content-section h2 { font-size: 1.05rem; }
  .content-section h3 { font-size: 0.95rem; }
  .content-section p { font-size: 0.85rem; }

  /* FAQ */
  summary { font-size: 0.85rem; padding: 0.6rem 0.75rem; }
  details p { font-size: 0.8rem; padding: 0.6rem 0.75rem; }

  /* Compare table */
  .compare-table { font-size: 0.7rem; }
  .compare-table th, .compare-table td { padding: 0.3rem 0.4rem; }

  /* Cost range */
  .cost-low, .cost-high { font-size: 1.1rem; }

  /* Footer */
  .footer { font-size: 0.75rem; padding: 1rem 0; }

  /* SEO content */
  .content-section ul, .content-section ol { padding-left: 1.25rem; }
  .content-section li { font-size: 0.85rem; }

  /* Auth */
  .auth-card { padding: 1.25rem; }
  .auth-card h1 { font-size: 1.2rem; }

  /* Dashboard */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .stat strong { font-size: 1.1rem; }

  /* Pagination */
  .pagination { gap: 0.5rem; }
  .pagination .btn { font-size: 0.8rem; padding: 0.4rem 0.75rem; }
}

/* Prevent horizontal overflow everywhere */
html { overflow-x: hidden; }
img, video, iframe { max-width: 100%; height: auto; }
table { max-width: 100%; }
pre, code { overflow-x: auto; word-break: break-word; }

section { padding: 2rem 0; }
h2 { margin-bottom: 1rem; }
