* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    background: #f7f7f5;
    color: #222;
}

.site-header {
    background: #1f3d2b;
    color: #fff;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
}

.site-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.75rem;
}

.logo-link {
    color: #fff;
    text-decoration: none;
}

.tagline {
    margin: 0;
    opacity: 0.85;
    font-size: 0.95rem;
}

.search-page,
.results-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.mission {
    max-width: 560px;
    margin: 2rem auto 0;
    text-align: center;
    color: #444;
    line-height: 1.5;
}

.mission p {
    margin: 0 0 0.75rem;
}

.cta-add-business {
    background: #fff;
    border: 1px solid #e6c874;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    max-width: 480px;
    margin: 2rem auto 0;
    text-align: center;
}

.cta-add-business h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: #1f3d2b;
}

.cta-add-business p {
    margin: 0;
    color: #555;
    font-size: 0.9rem;
}

.cta-add-business a {
    color: #1f3d2b;
    font-weight: 600;
}

.cta-donate {
    background: #fff;
    border: 1px solid #e6c874;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    max-width: 480px;
    margin: 1.5rem auto 0;
    text-align: center;
}

.cta-donate h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: #1f3d2b;
}

.cta-donate p {
    margin: 0 0 0.9rem;
    color: #555;
    font-size: 0.9rem;
}

.cta-donate .donate-button {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: #1f3d2b;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 6px;
}

.cta-donate .donate-button:hover {
    background: #16291d;
}

.recent-additions {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    max-width: 480px;
    margin: 1.5rem auto 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.recent-additions h2 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: #1f3d2b;
    border-bottom: 2px solid #1f3d2b;
    padding-bottom: 0.4rem;
}

.recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.recent-list li:last-child {
    border-bottom: none;
}

.recent-list a {
    color: #1f3d2b;
    font-weight: 600;
    text-decoration: none;
}

.recent-list a:hover {
    text-decoration: underline;
}

.recent-location {
    color: #888;
    font-size: 0.8rem;
    white-space: nowrap;
}

.zip-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    max-width: 360px;
    margin: 2rem auto 0;
}

.zip-form label {
    font-weight: 600;
    font-size: 0.9rem;
}

.zip-form input {
    padding: 0.6rem 0.75rem;
    font-size: 1.1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.zip-form button {
    padding: 0.65rem;
    font-size: 1rem;
    background: #1f3d2b;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.zip-form button:hover {
    background: #16291d;
}

.naics-group {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.naics-header {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    border-bottom: 2px solid #1f3d2b;
    padding-bottom: 0.4rem;
    color: #1f3d2b;
}

.naics-header .count {
    font-weight: normal;
    color: #777;
    font-size: 0.9rem;
}

.business-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.business-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #eee;
}

.business-item:last-child {
    border-bottom: none;
}

.business-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.business-name {
    font-weight: 600;
}

.business-address {
    color: #555;
    font-size: 0.9rem;
}

.business-since {
    color: #888;
    font-size: 0.8rem;
    font-style: italic;
}

.comment-preview {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: #444;
    font-style: italic;
    max-width: 480px;
}

.comment-preview-author {
    font-style: normal;
    color: #888;
}

.business-links {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    align-self: center;
}

.business-links a {
    font-size: 0.85rem;
    color: #1f3d2b;
    text-decoration: none;
    border: 1px solid #1f3d2b;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    white-space: nowrap;
}

.business-links a:hover {
    background: #1f3d2b;
    color: #fff;
}

.no-results {
    text-align: center;
    padding: 2rem 0;
    color: #666;
}

.back-link {
    text-align: center;
    margin-top: 2rem;
}

.back-link a {
    color: #1f3d2b;
}

.comments-toggle {
    font-size: 0.85rem;
    color: #1f3d2b;
    background: none;
    border: 1px solid #1f3d2b;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    cursor: pointer;
}

.comments-toggle:hover {
    background: #1f3d2b;
    color: #fff;
}

.comments-panel {
    list-style: none;
    background: #fafaf8;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 1rem;
    margin: 0 0 0.65rem;
    width: 100%;
}

.comments-list {
    margin-bottom: 1rem;
}

.comment-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e5e0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    margin-right: 0.5rem;
}

.comment-date {
    color: #999;
    font-size: 0.8rem;
}

.comment-body {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
}

.no-comments,
.comments-loading {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.9rem;
}

.comment-form button {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    background: #1f3d2b;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.comment-status {
    font-size: 0.85rem;
    color: #555;
    margin: 0;
}

/* Honeypot field — invisible to real users, catches bots that
   auto-fill every form field. Never remove this. */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.community-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #8a6d1e;
    background: #fdf3d8;
    border: 1px solid #e6c874;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.4rem;
}

.category-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.85rem 0 0.15rem;
    margin-top: 0.35rem;
    scrollbar-width: thin;
}

.chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.55rem 0.9rem;
    min-height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chip.is-active {
    background: #fff;
    color: #1f3d2b;
    border-color: #fff;
}

.chip-count {
    opacity: 0.75;
    font-weight: 500;
    font-size: 0.85em;
}

.map-note {
    color: #888;
    font-size: 0.85rem;
    text-align: center;
    margin: 0 0 1.5rem;
}

.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: #888;
    font-size: 0.8rem;
}

.cross-promo {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: #aaa;
}

.cross-promo a {
    color: #999;
}

.cross-promo a:hover {
    color: #1f3d2b;
}

/* ------------------------------------------------------------------ */
/* Mobile                                                              */
/* ------------------------------------------------------------------ */
@media (max-width: 640px) {
    .site-header {
        padding: 1.1rem 1rem 0.6rem;
    }

    .site-header h1 {
        font-size: 1.35rem;
    }

    .tagline {
        font-size: 0.85rem;
    }

    .search-page,
    .results-page {
        padding: 1.25rem 1rem 3rem;
    }

    .zip-form {
        max-width: 100%;
        padding: 1.25rem 1rem;
    }

    .zip-form input {
        font-size: 16px; /* keep >=16px so iOS Safari doesn't auto-zoom on focus */
    }

    #results-map {
        height: 200px !important;
    }

    .naics-group {
        padding: 0.85rem 1rem;
    }

    .business-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .business-links {
        align-self: stretch;
        flex-wrap: wrap;
    }

    .business-links a,
    .comments-toggle {
        flex: 1 1 auto;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
    }

    .comment-preview {
        max-width: none;
    }

    .recent-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .recent-location {
        white-space: normal;
    }

    .comment-form button {
        min-height: 44px;
        align-self: stretch;
    }
}
