:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    color: #15231c;
    background: #f1f4ef;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.app-shell {
    min-height: 100vh;
}

.top-bar {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 64px;
    padding: 0 1.5rem;
    color: #fff;
    background: #14261c;
    box-shadow: 0 8px 28px rgb(16 38 27 / 18%);
}

.brand {
    margin-right: auto;
    color: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-decoration: none;
}

.user-name {
    max-width: 24rem;
    overflow: hidden;
    color: #cfdbd2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-button {
    padding: .45rem .7rem;
    border: 1px solid rgb(255 255 255 / 28%);
    border-radius: 999px;
    color: #fff;
    background: transparent;
    cursor: pointer;
}

.map-page {
    position: relative;
    height: calc(100vh - 64px);
    min-height: 32rem;
    overflow: hidden;
}

.map-canvas {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 20%, #dbe8dd 0, transparent 32%),
        #ccd9d0;
}

.map-toolbar {
    position: absolute;
    z-index: 10;
    top: 1rem;
    left: 1rem;
    width: min(28rem, calc(100% - 2rem));
    padding: 1rem 1.1rem;
    border: 1px solid rgb(255 255 255 / 72%);
    border-radius: 1.25rem;
    background: rgb(255 255 255 / 92%);
    box-shadow: 0 16px 44px rgb(29 52 39 / 18%);
    backdrop-filter: blur(18px);
}

.map-toolbar h1 {
    margin: .15rem 0 .7rem;
    font-size: clamp(1.2rem, 3vw, 1.65rem);
    line-height: 1.1;
}

.eyebrow {
    color: #31704a;
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .18em;
}

.map-toolbar fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .8rem;
    margin: 0;
    padding: .7rem 0 0;
    border: 0;
    border-top: 1px solid #dce5df;
}

.map-toolbar legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.map-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: #3e5146;
    font-size: .82rem;
    font-weight: 650;
}

.map-toolbar input {
    accent-color: #31704a;
}

.map-status {
    min-height: 1.25rem;
    margin-top: .7rem;
    color: #5e6c64;
    font-size: .78rem;
}

.map-status.loading {
    color: #805f00;
}

.map-status.error,
.alert.error {
    color: #9e2929;
}

.map-status.success {
    color: #31704a;
}

.map-marker {
    position: relative;
    display: grid;
    width: 48px;
    height: 48px;
    padding: 3px;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 12%;
    background: #285f3f;
    box-shadow: 0 7px 16px rgb(14 38 24 / 36%);
    cursor: pointer;
    transform: rotate(-45deg);
    transform-origin: 50% 90%;
}

.map-marker > img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    transform: rotate(45deg);
}

.map-marker > img.failed {
    visibility: hidden;
}

.map-marker.cluster {
    width: 56px;
    height: 56px;
    border-color: #f9fff9;
}

.cluster-count {
    position: absolute;
    top: -9px;
    right: -9px;
    display: grid;
    min-width: 27px;
    height: 27px;
    padding: 0 6px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: #e25634;
    box-shadow: 0 3px 8px rgb(71 24 15 / 30%);
    font-size: .69rem;
    font-weight: 850;
    transform: rotate(45deg);
}

.content-panel {
    position: absolute;
    z-index: 12;
    right: 1rem;
    bottom: 1rem;
    width: min(25rem, calc(100% - 2rem));
    max-height: min(70vh, 42rem);
    padding: 1.1rem;
    overflow: auto;
    border: 1px solid rgb(255 255 255 / 74%);
    border-radius: 1.25rem;
    background: rgb(255 255 255 / 95%);
    box-shadow: 0 20px 55px rgb(29 52 39 / 25%);
    backdrop-filter: blur(18px);
}

.content-panel[hidden] {
    display: none;
}

.panel-close {
    position: absolute;
    top: .65rem;
    right: .75rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    color: #405148;
    background: #edf2ee;
    cursor: pointer;
    font-size: 1.25rem;
}

.panel-heading h2 {
    margin: 0 2.2rem .85rem 0;
    font-size: 1.15rem;
}

.content-list {
    display: grid;
    gap: .55rem;
}

.content-card {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: .75rem;
    align-items: center;
    padding: .55rem;
    border: 1px solid #e0e8e2;
    border-radius: .85rem;
    background: #fbfdfb;
    cursor: pointer;
}

.content-card:hover {
    border-color: #89ac95;
    background: #f4f9f5;
}

.content-card img {
    width: 50px;
    height: 50px;
    border-radius: .7rem;
    object-fit: cover;
    background: #dfe8e1;
}

.content-card div {
    display: grid;
    min-width: 0;
    gap: .12rem;
}

.content-card strong,
.content-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-card span {
    color: #31704a;
    font-size: .75rem;
    font-weight: 750;
    text-transform: uppercase;
}

.content-card small {
    color: #718077;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    justify-content: center;
    padding: .78rem 1rem;
    border: 0;
    border-radius: .8rem;
    color: #fff;
    background: #286440;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
}

.secondary-button {
    width: 100%;
    margin-top: .75rem;
    color: #285a3c;
    background: #e4efe7;
}

.public-shell {
    display: grid;
    min-height: 100vh;
    padding: 1.5rem;
    place-items: center;
    background:
        radial-gradient(circle at 18% 20%, rgb(117 166 130 / 35%), transparent 35%),
        radial-gradient(circle at 82% 78%, rgb(226 147 76 / 22%), transparent 32%),
        #eaf0e9;
}

.login-card,
.message-card {
    width: min(28rem, 100%);
    padding: clamp(1.5rem, 5vw, 2.4rem);
    border: 1px solid rgb(255 255 255 / 70%);
    border-radius: 1.5rem;
    background: rgb(255 255 255 / 92%);
    box-shadow: 0 26px 70px rgb(27 55 38 / 18%);
}

.login-heading h1,
.message-card h1 {
    margin: .35rem 0 .5rem;
    font-size: 2rem;
    line-height: 1.05;
}

.login-heading p,
.message-card p {
    margin: 0 0 1.4rem;
    color: #607068;
    line-height: 1.55;
}

.login-card form {
    display: grid;
    gap: .55rem;
}

.login-card label {
    margin-top: .45rem;
    font-size: .82rem;
    font-weight: 750;
}

.login-card input {
    width: 100%;
    padding: .78rem .85rem;
    border: 1px solid #cbd8cf;
    border-radius: .75rem;
    color: #14261c;
    background: #fbfdfb;
    outline: 0;
}

.login-card input:focus {
    border-color: #31704a;
    box-shadow: 0 0 0 3px rgb(49 112 74 / 14%);
}

.login-card .primary-button {
    margin-top: .8rem;
}

.alert {
    margin: 0 0 .8rem;
    padding: .7rem .8rem;
    border-radius: .7rem;
    background: #fff0ed;
    font-size: .84rem;
}

@media (max-width: 700px) {
    .top-bar {
        min-height: 56px;
        padding: 0 .8rem;
    }

    .user-name {
        display: none;
    }

    .map-page {
        height: calc(100vh - 56px);
    }

    .map-toolbar {
        top: .65rem;
        left: .65rem;
        width: calc(100% - 1.3rem);
        padding: .8rem .9rem;
    }

    .content-panel {
        right: .65rem;
        bottom: .65rem;
        width: calc(100% - 1.3rem);
        max-height: 52vh;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .map-marker {
        transition: filter 120ms ease, scale 120ms ease;
    }

    .map-marker:hover {
        filter: saturate(1.12);
        scale: 1.08;
    }
}
