/* The public Hazard & Evacuation Map (Views/Map/Index.cshtml). Mobile first: on a phone the map comes right after the
   "Find my nearest evacuation centre" button and the answer right after the map; from 960px the panel sits on the left
   and the map stays in view on the right. */

.pm-head { margin: 0 0 1.25rem; }
.pm-kicker { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem; border-radius: 9999px;
    background: #dcfce7; color: #166534; font-size: .72rem; font-weight: 700; letter-spacing: .02em; margin-bottom: .75rem; }
.pm-fil { font-size: .82rem; font-style: italic; color: var(--c-fg-soft); margin: -.25rem 0 .5rem; }
.pm-lead { margin: 0; color: #334155; font-size: .95rem; max-width: 760px; }
.pm-small { font-size: .78rem; color: var(--c-fg-soft); }
.pm-center { text-align: center; margin: .5rem 0 0; }
.pm-unavailable p { margin: 0 0 .6rem; color: #334155; }

.pm-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "actions" "map" "result" "layers" "legend" "notes"; }
.pm-actions { grid-area: actions; padding: 1rem; }
.pm-mapwrap { grid-area: map; position: relative; }
.pm-result { grid-area: result; padding: 1rem; }
.pm-layers { grid-area: layers; padding: 1rem 1.1rem; }
.pm-legend { grid-area: legend; padding: 1rem 1.1rem; }
.pm-notes { grid-area: notes; padding: 1rem 1.1rem; font-size: .82rem; }
.pm-notes p:last-child { margin-bottom: 0; }

.pm-map { height: 62vh; min-height: 340px; width: 100%; border-radius: 1rem; overflow: hidden; border: 1px solid var(--c-border); background: #e5e7eb; }
.pm-loading { position: absolute; left: 50%; top: 1rem; transform: translateX(-50%); z-index: 3; padding: .4rem .85rem; border-radius: 9999px;
    background: rgba(255, 255, 255, .95); box-shadow: 0 4px 14px rgba(0, 0, 0, .15); font-size: .8rem; font-weight: 600; color: #334155; }
.pm-loading[hidden] { display: none; }

.pm-locate { width: 100%; padding: .85rem 1rem; font-size: .95rem; background: #15803d; }
.pm-locate:hover { background: #166534; }
.pm-locate[disabled] { opacity: .7; cursor: progress; }
.pm-hint { margin: .65rem 0 0; font-size: .8rem; color: var(--c-fg-soft); text-align: center; }
.pm-fil-inline { display: block; font-style: italic; }

.pm-check { display: flex; align-items: flex-start; gap: .6rem; padding: .45rem 0; font-size: .875rem; cursor: pointer; }
.pm-check input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: var(--c-primary); flex: none; }
.pm-check em { display: block; font-size: .75rem; color: var(--c-fg-soft); }

/* Legend */
.pm-leg-group { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--c-fg-soft); margin: .9rem 0 .35rem; }
.pm-leg-group:first-child { margin-top: 0; }
.pm-leg { display: flex; gap: .65rem; align-items: flex-start; padding: .4rem 0; border-bottom: 1px dashed var(--c-border); }
.pm-leg:last-child { border-bottom: 0; }
.pm-sw { flex: none; width: 1.1rem; height: 1.1rem; margin-top: .15rem; border-radius: .25rem; border: 2px solid; }
.pm-sw.dot { border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, .25); }
.pm-leg-name { font-weight: 700; font-size: .85rem; }
.pm-leg-name em { font-weight: 500; color: var(--c-fg-soft); }
.pm-leg-text { font-size: .78rem; color: #475569; line-height: 1.45; }

/* The answer for a point */
.pm-res-head { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .95rem; margin-bottom: .2rem; }
.pm-res-sub { font-size: .78rem; color: var(--c-fg-soft); margin-bottom: .75rem; }
.pm-alert { padding: .7rem .85rem; border-radius: .6rem; margin: 0 0 .75rem; font-size: .85rem; line-height: 1.5; border: 1px solid; }
.pm-alert-warn { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.pm-alert-ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.pm-alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.pm-alert strong { display: block; }
.pm-alert ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.pm-alert li { margin: .25rem 0; }
.pm-sev { display: inline-block; padding: 0 .4rem; border-radius: 9999px; font-size: .7rem; font-weight: 700; background: #fee2e2; color: #991b1b; margin-left: .25rem; }
.pm-zoning { font-size: .82rem; margin: 0 0 .75rem; color: #334155; }
.pm-near-title { font-weight: 700; font-size: .9rem; margin: .25rem 0 .4rem; }
.pm-near { list-style: none; margin: 0; padding: 0; }
.pm-near li { padding: .6rem 0; border-top: 1px solid var(--c-border); }
.pm-near-row { display: flex; align-items: baseline; gap: .5rem; }
.pm-near-name { font-weight: 700; font-size: .875rem; flex: 1; min-width: 0; }
.pm-near-dist { font-weight: 800; font-size: .875rem; color: #15803d; white-space: nowrap; }
.pm-near-meta { font-size: .76rem; color: var(--c-fg-soft); margin-top: .15rem; }
.pm-badge { display: inline-block; padding: .05rem .45rem; border-radius: 9999px; font-size: .68rem; font-weight: 700; color: #fff; vertical-align: 1px; }
.pm-near-links { display: flex; gap: 1rem; margin-top: .35rem; font-size: .8rem; font-weight: 600; }
.pm-near-links button { background: none; border: 0; padding: 0; font: inherit; color: var(--c-primary); cursor: pointer; }
.pm-near-links button:hover { text-decoration: underline; }

@media (min-width: 960px) {
    /* The map spans every row of the panel; the last row takes what is left, so the cards stay together at the top. */
    .pm-layout { grid-template-columns: 360px minmax(0, 1fr); align-items: start;
        grid-template-rows: auto auto auto auto 1fr;
        grid-template-areas: "actions map" "result map" "layers map" "legend map" "notes map"; }
    .pm-mapwrap { position: sticky; top: 84px; }
    .pm-map { height: calc(100vh - 110px); min-height: 520px; }
}
