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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
}

.logo-subtitle {
    font-weight: 400;
    color: #64748b;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-section {
    width: 100%;
    background-color: #ffffff;
    padding: 4rem 2rem;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.search-title {
    font-size: 2rem;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 0.5rem;
}

.search-description {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #94a3b8;
}

.search-input {
    width: 100%;
    height: 3.5rem;
    padding: 0 1rem 0 3rem;
    font-size: 1.125rem;
    font-family: inherit;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    background-color: #ffffff;
    color: #1e293b;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.search-input::placeholder {
    color: #94a3b8;
}

.submit-button {
    height: 3.5rem;
    padding: 0 3rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background-color: #1e3a8a;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-button:hover {
    background-color: #1e40af;
    transform: translateY(-1px);
}

.submit-button:active {
    transform: translateY(0);
}

.sample-zips {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #94a3b8;
}

.compare-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.zip-inputs-container {
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 500px;
}

.zip-inputs-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.zip-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 120px;
    max-width: 140px;
}

.zip-input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #1e3a8a;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.zip-input {
    width: 100%;
    height: 3rem;
    padding: 0 1rem;
    font-size: 1.125rem;
    font-family: inherit;
    border: 2px solid #cbd5e1;
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: #1e293b;
    text-align: center;
    transition: all 0.2s ease;
}

.zip-input:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.zip-input::placeholder {
    color: #94a3b8;
    font-size: 0.875rem;
}

.input-hint {
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 1rem;
    font-style: italic;
}

.primary-input-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.primary-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    text-align: center;
}

.additional-inputs {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.additional-inputs .zip-input-group {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
}

.add-compare-btn {
    background: none;
    border: 2px dashed #10b981;
    color: #10b981;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.2s ease;
}

.add-compare-btn:hover {
    background: #10b981;
    color: white;
    border-style: solid;
}

.single-town-report {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.town-header-card {
    margin-bottom: 2rem;
}

.town-name-large {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.5rem 0;
}

.zip-code-label {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #94a3b8;
}

.composite-grade-display {
    margin-bottom: 2.5rem;
}

.grade-badge.xlarge {
    width: 120px;
    height: 120px;
    font-size: 3.5rem;
    font-weight: 800;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.composite-label {
    margin-top: 1rem;
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 500;
}

.grades-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.grade-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    flex: 1;
    min-width: 180px;
    max-width: 220px;
}

.grade-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.grade-icon {
    font-size: 1.25rem;
}

.grade-card-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
}

.grade-badge.medium {
    width: 60px;
    height: 60px;
    font-size: 1.75rem;
    font-weight: 700;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.grade-detail {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.grade-detail.utility-name {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-style: italic;
}

.utility-name-small {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.utility-cell {
    max-width: 180px;
}

.state-avg-label {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
    font-style: italic;
}

.data-caveats {
    margin-top: 2rem;
    padding: 1.25rem;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    text-align: left;
}

.caveats-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.caveats-list {
    margin: 0 0 1rem 0;
    padding-left: 1.25rem;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.6;
}

.caveats-list li {
    margin-bottom: 0.5rem;
}

.caveats-list strong {
    color: #cbd5e1;
}

.liability-disclaimer {
    margin: 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.8rem;
    color: #f59e0b;
    line-height: 1.5;
}

.liability-disclaimer strong {
    color: #fbbf24;
}

.results-section {
    width: 100%;
    max-width: 900px;
    padding: 0 2rem 4rem;
    margin-top: -2rem;
}

.comparison-card {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    animation: slideUp 0.3s ease;
}

.comparison-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e3a8a;
    text-align: center;
    margin-bottom: 1.5rem;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.metric-header {
    text-align: left !important;
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #f8fafc;
}

.town-header {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
    background-color: #f8fafc;
    min-width: 150px;
}

.town-header .zip-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: #64748b;
    margin-top: 0.25rem;
}

.metric-name {
    text-align: left !important;
    font-weight: 500;
    color: #475569;
    font-size: 0.875rem;
}

.grade-row.final-grade td {
    padding: 1.5rem 1rem;
    background-color: #f8fafc;
}

.grade-cell {
    vertical-align: middle;
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    border-radius: 0.5rem;
}

.grade-badge.large {
    width: 60px;
    height: 60px;
    font-size: 1.75rem;
}

.grade-badge.small {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.grade-badge.error {
    background-color: #94a3b8;
}

.grade-badge.large.error {
    background-color: #e2e8f0;
    color: #64748b;
}

.grade-note {
    display: block;
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 0.5rem;
    font-weight: 500;
}

.town-header.has-error {
    background-color: #fef2f2;
    color: #991b1b;
}

.error-indicator {
    display: inline-flex;
    color: #ef4444;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.detail-cell {
    font-size: 0.875rem;
    color: #475569;
}

.data-na {
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}

.clickable-metric {
    cursor: pointer;
    transition: color 0.2s ease;
}

.clickable-metric:hover {
    color: #3b82f6;
}

.info-icon {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.25rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.clickable-metric:hover .info-icon {
    opacity: 1;
}

.clickable,
.clickable-value {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clickable:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.clickable-value {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.clickable-value:hover {
    color: #3b82f6;
}

.info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.info-modal.active {
    display: flex;
}

.info-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem 0;
    padding-right: 2rem;
}

.modal-body {
    color: #475569;
    line-height: 1.6;
}

.modal-body p {
    margin: 0 0 0.75rem 0;
}

.modal-body ul {
    margin: 0.5rem 0 1rem 0;
    padding-left: 1.25rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-body h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 1rem 0 0.5rem 0;
}

.modal-grade-detail,
.modal-value-detail {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 4px solid #3b82f6;
}

.modal-grade-detail h4,
.modal-value-detail h4 {
    margin-top: 0;
    color: #3b82f6;
}

.modal-grade-detail p,
.modal-value-detail p {
    margin-bottom: 0;
}

.contaminant-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.contaminant-status.clean {
    background-color: #ecfdf5;
    color: #059669;
}

.contaminant-status.detected {
    background-color: #fef2f2;
    color: #dc2626;
}

.grade-legend-inline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    font-size: 0.75rem;
}

.grade-legend-inline .legend-title {
    font-weight: 600;
    color: #64748b;
}

.grade-legend-inline .legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #475569;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .zip-inputs {
        flex-direction: column;
        width: 100%;
    }
    
    .zip-input-group {
        width: 100%;
    }
    
    .zip-input {
        width: 100%;
    }
    
    .comparison-table {
        font-size: 0.875rem;
    }
    
    .town-header {
        min-width: 100px;
    }
    
    .grade-badge.large {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}

.error-card {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.error-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #ef4444;
    flex-shrink: 0;
}

.error-message {
    font-size: 1rem;
    color: #991b1b;
}

.grade-card {
    background-color: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 3rem;
    text-align: center;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.town-info {
    margin-bottom: 2rem;
}

.location-icon {
    width: 2rem;
    height: 2rem;
    color: #1e3a8a;
    margin-bottom: 0.5rem;
}

.town-name {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1e293b;
}

.zip-display {
    font-size: 1rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.grade-display {
    margin-bottom: 2rem;
}

.grade-badge {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.grade-letter {
    font-size: 4.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.grade-description {
    font-size: 1.25rem;
    font-weight: 500;
    color: #64748b;
}

.violation-info {
    background-color: #f8fafc;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.violation-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.violation-count {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.grade-legend {
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
}

.legend-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.legend-items {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-badge {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
}

.legend-text {
    font-size: 0.75rem;
    color: #64748b;
}

.footer {
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
    text-align: center;
}

.footer-text {
    font-size: 0.875rem;
    color: #94a3b8;
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: #cbd5e1;
    margin-top: 0.5rem;
}

.validation-message {
    position: absolute;
    bottom: -1.5rem;
    left: 0;
    font-size: 0.75rem;
    color: #64748b;
    transition: all 0.2s ease;
}

.validation-message.valid {
    color: #10b981;
}

.validation-message.pending {
    color: #94a3b8;
}

.validation-message.invalid {
    color: #ef4444;
}

.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.data-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background-color: #ecfdf5;
    color: #059669;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 1.5rem;
}

.fallback-disclaimer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #fef3c7;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #fcd34d;
}

.fallback-disclaimer svg {
    flex-shrink: 0;
}

.comparison-section {
    background-color: #f8fafc;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.comparison-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bar-label {
    width: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    flex-shrink: 0;
}

.bar-container {
    flex: 1;
    height: 28px;
    background-color: #e2e8f0;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 0.5rem;
    transition: width 0.5s ease;
}

.bar-fill.national {
    background-color: #64748b;
}

.bar-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e293b;
}

.comparison-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    text-align: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.comparison-note.below {
    background-color: #fef2f2;
    color: #dc2626;
}

.comparison-note.above {
    background-color: #f0fdf4;
    color: #16a34a;
}

.metrics-section {
    background-color: #f8fafc;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.metric-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.metric-value.exceeds {
    color: #dc2626;
}

.metric-value.safe {
    color: #10b981;
}

.grade-caveat {
    background-color: #fef3c7;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    color: #92400e;
    font-size: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.grade-caveat strong {
    color: #78350f;
}

.samples-section {
    background-color: #f8fafc;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.samples-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sample-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.sample-value {
    font-weight: 600;
    color: #1e293b;
}

.sample-date {
    color: #64748b;
    font-size: 0.875rem;
}

.sample-location {
    color: #94a3b8;
    font-size: 0.75rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.comparison-section {
    background-color: #f8fafc;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.comparison-item {
    text-align: center;
}

.comparison-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.comparison-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.comparison-result.better .comparison-value {
    color: #10b981;
}

.comparison-result.worse .comparison-value {
    color: #f97316;
}

.chart-section {
    margin-bottom: 1.5rem;
}

.chart-container {
    height: 200px;
    background-color: #f8fafc;
    border-radius: 1rem;
    padding: 1rem;
}

.violations-detail-section {
    margin-bottom: 1.5rem;
    text-align: left;
}

.violations-list {
    background-color: #f8fafc;
    border-radius: 1rem;
    overflow: hidden;
}

.violation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

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

.violation-contaminant {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.health-badge {
    background-color: #fef2f2;
    color: #dc2626;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.violation-date {
    font-size: 0.75rem;
    color: #64748b;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.air-quality-card {
    margin-top: 1.5rem;
}

.air-badge {
    background-color: #eff6ff;
    color: #2563eb;
}

.metric-header {
    margin-bottom: 1.5rem;
}

.metric-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 0.25rem;
}

.metric-location {
    font-size: 0.875rem;
    color: #64748b;
}

.aqi-display {
    background-color: #f8fafc;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.aqi-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.aqi-value {
    font-size: 3rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.pollutants-section {
    margin-bottom: 1.5rem;
    text-align: left;
}

.pollutants-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.pollutant-item {
    background-color: #f8fafc;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pollutant-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

.pollutant-aqi {
    font-size: 0.75rem;
    color: #64748b;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

@media (max-width: 640px) {
    .header-content {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .search-section {
        padding: 3rem 1rem;
    }
    
    .search-title {
        font-size: 1.5rem;
    }
    
    .results-section {
        padding: 0 1rem 3rem;
    }
    
    .grade-card {
        padding: 2rem 1.5rem;
    }
    
    .grade-badge {
        width: 120px;
        height: 120px;
    }
    
    .grade-letter {
        font-size: 3.5rem;
    }
    
    .town-name {
        font-size: 1.5rem;
    }
    
    .legend-items {
        gap: 0.75rem;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .comparison-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .comparison-item:last-child {
        border-bottom: none;
    }
    
    .chart-container {
        height: 180px;
    }
}
