.fda-app {
    --fda-ink: #17211b;
    --fda-muted: #617064;
    --fda-line: #d9e1d8;
    --fda-panel: #ffffff;
    --fda-soft: #f4f7f2;
    --fda-accent: #2f7d52;
    --fda-accent-2: #246b8f;
    color: var(--fda-ink);
    font-family: inherit;
}

.fda-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.fda-tabs button,
.fda-btn,
.fda-filter-group button {
    border: 1px solid var(--fda-line);
    background: var(--fda-panel);
    color: var(--fda-ink);
    border-radius: 6px;
    padding: 9px 12px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}

.fda-tabs button.is-active,
.fda-filter-group button.is-active,
.fda-primary {
    background: var(--fda-accent);
    border-color: var(--fda-accent);
    color: #fff;
}

.fda-section {
    display: none;
}

.fda-section.is-active {
    display: block;
}

.fda-section-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.fda-section-head h2,
.fda-charts h3 {
    margin: 0 0 6px;
    line-height: 1.2;
}

.fda-section-head p {
    margin: 0;
    color: var(--fda-muted);
}

.fda-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.fda-form {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--fda-line);
    border-radius: 8px;
    background: var(--fda-soft);
    margin-bottom: 18px;
}

.fda-form fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.fda-form legend {
    grid-column: 1 / -1;
    font-weight: 700;
    margin-bottom: 2px;
}

.fda-form label {
    display: grid;
    gap: 5px;
    font-size: 14px;
}

.fda-form input,
.fda-form select,
.fda-form textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--fda-line);
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    color: var(--fda-ink);
}

.fda-primary {
    justify-self: start;
    border: 0;
    border-radius: 6px;
    padding: 11px 15px;
    cursor: pointer;
}

.fda-calculated,
.fda-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.fda-calculated span,
.fda-summary > div {
    background: #fff;
    border: 1px solid var(--fda-line);
    border-radius: 8px;
    padding: 11px;
    color: var(--fda-muted);
}

.fda-calculated strong,
.fda-summary strong {
    display: block;
    margin-top: 4px;
    color: var(--fda-ink);
    font-size: 18px;
}

.fda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.fda-charts > div {
    border: 1px solid var(--fda-line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    min-height: 260px;
}

.fda-charts canvas {
    width: 100%;
    max-height: 260px;
}

.fda-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--fda-line);
    border-radius: 8px;
    background: #fff;
}

.fda-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.fda-table-wrap th,
.fda-table-wrap td {
    border-bottom: 1px solid var(--fda-line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.fda-table-wrap th {
    background: var(--fda-soft);
    font-weight: 700;
}

.fda-link {
    border: 0;
    background: transparent;
    color: #a33b35;
    cursor: pointer;
    padding: 0;
}

.fda-map-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 16px;
    margin: 18px 0;
}

.fda-map-layout aside {
    display: grid;
    gap: 14px;
    align-content: start;
}

.fda-map {
    min-height: 620px;
    border: 1px solid var(--fda-line);
    border-radius: 8px;
    overflow: hidden;
    background: #eef3eb;
}

.fda-filter-group,
.fda-legend {
    display: grid;
    gap: 8px;
}

.fda-legend {
    border: 1px solid var(--fda-line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.fda-legend span {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fda-legend i,
.fda-marker-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
}

.fda-legend .grazing,
.fda-marker-grazing { background: #2f7d52; }
.fda-legend .water,
.fda-marker-water { background: #2477b3; }
.fda-legend .feeding,
.fda-marker-feeding { background: #c18b1f; }
.fda-legend .shelter,
.fda-marker-shelter { background: #7e5aa7; }
.fda-legend .infrastructure,
.fda-marker-infrastructure { background: #677078; }

.fda-map-hint {
    margin: 0;
    color: var(--fda-muted);
    font-size: 13px;
}

.fda-login-required {
    border: 1px solid #e5d4a8;
    border-radius: 8px;
    background: #fff7df;
    padding: 14px;
}

@media (max-width: 800px) {
    .fda-section-head,
    .fda-map-layout {
        grid-template-columns: 1fr;
        display: grid;
    }

    .fda-actions {
        justify-content: flex-start;
    }

    .fda-map {
        min-height: 440px;
    }
}
