* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    line-height: 1.6;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 1.8rem;
    color: #1a1a2e;
}

.subtitle {
    color: #666;
    margin-top: 4px;
}

.controls {
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
}

select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    min-width: 180px;
}

.btn-primary {
    padding: 8px 24px;
    background: #0073bb;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    height: 36px;
}

.btn-primary:hover {
    background: #005a94;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 6px 16px;
    background: white;
    color: #0073bb;
    border: 1px solid #0073bb;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #f0f8ff;
}

.status {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #eee;
    border-top: 3px solid #0073bb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

#results {
    margin-top: 20px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.results-header h2 {
    font-size: 1.2rem;
}

.results-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

#result-summary {
    font-size: 0.85rem;
    color: #666;
}

.required-pools-section {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.required-pools-section h3 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #444;
}

.add-pool-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.add-pool-row input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    flex: 1;
    max-width: 300px;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 16px;
    font-size: 0.8rem;
    color: #2e7d32;
}

.chip.removable {
    cursor: pointer;
}

.chip .remove-btn {
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0.6;
}

.chip .remove-btn:hover {
    opacity: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

thead {
    background: #1a1a2e;
    color: white;
}

th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
}

td {
    padding: 8px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

tr:hover {
    background: #f8f9fa;
}

tr.flagged {
    background: #fff3e0;
}

tr.required-row {
    background: #e8f5e9;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-yes {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-no {
    background: #fce4ec;
    color: #c62828;
}

footer {
    margin-top: 40px;
    text-align: center;
    color: #999;
    font-size: 0.8rem;
}

footer a {
    color: #0073bb;
}
