:root {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    color: #18363e;
    background: #f2f6f7;

    --teal: #006b69;
    --border: #d7e3e5;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
}

a {
    color: var(--teal);
}

button,
input {
    font: inherit;
}

button {
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: #18363e;
    cursor: pointer;
}

button:hover {
    background: #e6f1f0;
}

button:disabled {
    opacity: .5;
    cursor: wait;
}

button:focus-visible,
a:focus-visible,
.drop-zone:focus-visible {
    outline: 3px solid #dba428;
    outline-offset: 3px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px 5%;
    background: white;
    border-bottom: 1px solid var(--border);
}

.brand {
    color: #18363e;
    font-size: 23px;
    font-weight: 800;
    text-decoration: none;
}

.brand small {
    display: block;
    font-size: 12px;
    letter-spacing: 2px;
    margin-top: 5px;
}

nav {
    display: flex;
    gap: 5px;
}

nav button {
    border: 0;
    font-size: 14px;
}

nav .active {
    background: #dcefed;
    color: var(--teal);
    font-weight: bold;
}

main {
    max-width: 1450px;
    margin: auto;
    padding: 36px 5%;
}

h1 {
    font-size: clamp(32px, 4.2vw, 56px);
    line-height: 1.12;
    margin: 0 0 22px;
    letter-spacing: -1.3px;
}

h2 {
    font-size: 23px;
    line-height: 1.3;
    margin: 0 0 16px;
}

h3 {
    font-size: 18px;
    line-height: 1.5;
}

p {
    line-height: 1.65;
}

.lead {
    font-size: 19px;
    color: #536e75;
}

.secondary {
    font-size: 14px;
    color: #60777e;
}

.start-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 34px;
    align-items: start;
}

.panel {
    padding: 25px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 24px;
}

.creator {
    padding: 24px;
    background: #153d43;
    color: white;
    border-radius: 12px;
    margin: 26px 0;
}

.creator p {
    font-size: 12px;
    letter-spacing: 1.8px;
    margin: 0 0 10px;
    color: #c5dedf;
    font-weight: bold;
}

.creator strong {
    display: block;
    font-size: 32px;
    line-height: 1.25;
}

.creator span {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #d8e8e8;
}

.drop-zone {
    min-height: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    border: 2px dashed #9bbbbb;
    border-radius: 12px;
    background: #f2f9f8;
    cursor: pointer;
    text-align: center;
}

.drop-zone.dragging {
    background: #dcefed;
    border-color: var(--teal);
}

.drop-zone span:last-child {
    font-size: 14px;
    color: #60777e;
}

.upload-icon {
    font-size: 40px;
    color: var(--teal);
}

.preview {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    background: #edf3f4;
    border-radius: 9px;
    margin-top: 22px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.primary {
    background: var(--teal);
    color: white;
    border-color: var(--teal);
    font-weight: bold;
}

.primary:hover {
    background: #005754;
    color: white;
}

.notice {
    padding: 13px;
    border-radius: 7px;
    background: #e5f1ef;
    font-size: 14px;
}

.notice:empty {
    display: none;
}

.error {
    padding: 13px;
    border-radius: 7px;
    background: #fff0eb;
    color: #9e2c1a;
    font-size: 14px;
}

.browse-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin: 10px 0 34px;
    font-size: 14px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 1.5px;
    color: var(--teal);
    font-weight: bold;
    text-transform: uppercase;
}

#project-fields {
    padding-left: 20px;
}

#project-fields li {
    margin-bottom: 12px;
    line-height: 1.5;
}

.planned-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    list-style: none;
    padding: 0;
}

.planned-list li {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.planned-list strong {
    display: block;
}

.planned-list em {
    display: block;
    font-size: 13px;
    font-style: italic;
    color: #60777e;
    margin-top: 6px;
}

.back {
    display: inline-block;
    margin-bottom: 24px;
}

.map-grid {
    display: grid;
    grid-template-columns: 285px minmax(0, 1fr);
    gap: 24px;
}

.species-photo {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.location {
    width: 100%;
    text-align: left;
    margin-bottom: 7px;
}

.location.active {
    background: #e0f0ed;
    border-color: #82b5ae;
}

.location strong,
.location small {
    display: block;
}

.location small {
    color: #60777e;
    font-size: 12px;
    margin-top: 7px;
    line-height: 1.5;
}

.map-panel {
    padding: 0;
    overflow: hidden;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px;
}

.toolbar h2 {
    font-size: 18px;
    margin: 0;
}

.toolbar button {
    font-size: 14px;
}

#map {
    height: 450px;
    background: #e4edf0;
    z-index: 0;
}

.legend {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.legend>span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 12px 7px 0;
}

.legend p {
    margin: 0 0 8px;
}

.legend i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.low {
    background: #efcd42;
}

.medium {
    background: #e98c32;
}

.high {
    background: #9d342d;
}

.unknown {
    background: #758b94;
}

#detail {
    padding: 22px;
}

#detail dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px 16px;
}

#detail dt {
    color: #60777e;
}

#detail dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.detail-grid span {
    display: block;
    font-size: 12px;
    color: #60777e;
    margin-bottom: 7px;
}

.detail-grid strong {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.population-number {
    display: block;
    font-size: 34px;
    color: var(--teal);
}

.evidence-grid p {
    font-size: 14px;
    color: #60777e;
}

.biology-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 30px;
}

.biology-grid article {
    border-top: 1px solid var(--border);
}

.biology-grid p {
    font-size: 15px;
    color: #526d75;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.6;
}

.leaflet-container {
    font: 14px Arial, sans-serif;
}

@media (max-width: 850px) {

    .start-grid,
    .about-grid {
        grid-template-columns: 1fr;
    }

    .planned-list {
        grid-template-columns: 1fr 1fr;
    }

    .map-grid {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    header {
        flex-wrap: wrap;
    }

    main {
        padding: 26px 5%;
    }

    .map-grid,
    .evidence-grid,
    .biology-grid,
    .planned-list {
        grid-template-columns: 1fr;
    }

    .browse-row,
    footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .creator strong {
        font-size: 28px;
    }

    #map {
        height: 370px;
    }

    .panel {
        padding: 20px;
    }

    .map-panel {
        padding: 0;
    }

    .actions button {
        width: 100%;
    }
}