.fishstat-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 0;
}
.chart-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    padding: 2rem;
    margin-bottom: 1.5rem;
}
.chart-header {
    margin-bottom: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e8e8e8;
}
.chart-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 0.25rem 0;
}
.chart-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}
.chart-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 1rem;
}
.chart-wrap canvas {
    display: block;
}
.chart-source {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Controls */
.fishstat-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 2rem;
}
.control-group {
    flex: 1;
    min-width: 220px;
}
.control-group-narrow {
    flex: 0 1 280px;
    min-width: 180px;
}
.control-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}

/* Country autocomplete */
.country-search-wrap {
    position: relative;
}
.country-search-wrap input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}
.country-search-wrap input:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.12);
}
.country-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
}
.country-dropdown.open {
    display: block;
}
.country-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.1s;
}
.country-option:hover,
.country-option.highlighted {
    background: #e8f0fe;
}
.country-option mark {
    background: #ffd54f;
    border-radius: 2px;
    padding: 0;
}

/* Fisheries toggle */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.15rem;
}
.toggle-wrap input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #143278;
}
.toggle-wrap span {
    font-size: 0.9rem;
    color: #444;
}

/* Actions row */
.fishstat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
}

/* Clear button */
.btn-clear {
    padding: 0.35rem 1rem;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #f9fafb;
    color: #555;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-clear:hover {
    background: #f0f1f3;
    border-color: #b0b5bd;
}

/* Member flags */
.member-flags {
    margin-bottom: 1.25rem;
}
.member-flags-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}
.flag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.flag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 30px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    background: #f5f6f8;
    padding: 0;
    position: relative;
}
.flag-btn:hover {
    border-color: #4a90d9;
    background: #e8f0fe;
}
.flag-btn.active {
    border-color: #143278;
    background: #dce6f7;
    box-shadow: 0 0 0 2px rgba(20,50,120,0.2);
}
.flag-btn svg {
    width: 32px;
    height: 22px;
    border-radius: 2px;
}
.flag-btn .flag-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 200;
    pointer-events: none;
}
.flag-btn:hover .flag-tooltip {
    display: block;
}

/* Loading spinner */
.chart-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}
.chart-loading.active {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #143278;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Species autocomplete */
.species-search-wrap {
    position: relative;
}
.species-search-wrap input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}
.species-search-wrap input:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.12);
}
.species-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
}
.species-dropdown.open {
    display: block;
}
.species-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.1s;
}
.species-option:hover,
.species-option.highlighted {
    background: #e8f0fe;
}
.species-option mark {
    background: #ffd54f;
    border-radius: 2px;
    padding: 0;
}
.species-option .sci-name {
    font-style: italic;
    color: #888;
    font-size: 0.82rem;
}

/* Active species badge */
.active-species-badge {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: #e8f7e8;
    border: 1px solid #a8d8a8;
    border-radius: 16px;
    font-size: 0.85rem;
    color: #1a6b1a;
}
.active-species-badge.visible {
    display: inline-flex;
}
.active-species-badge .badge-x {
    cursor: pointer;
    font-weight: bold;
    margin-left: 0.2rem;
    opacity: 0.6;
    transition: opacity 0.1s;
}
.active-species-badge .badge-x:hover {
    opacity: 1;
}

/* Active country badge */
.active-country-badge {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: #e8f0fe;
    border: 1px solid #b0c4e8;
    border-radius: 16px;
    font-size: 0.85rem;
    color: #143278;
}
.active-country-badge.visible {
    display: inline-flex;
}
.active-country-badge .badge-x {
    cursor: pointer;
    font-weight: bold;
    margin-left: 0.2rem;
    opacity: 0.6;
    transition: opacity 0.1s;
}
.active-country-badge .badge-x:hover {
    opacity: 1;
}
