.hero a,
.installation-detail a,
.installation-list a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.hero a:hover,
.hero a:focus-visible,
.installation-detail a:hover,
.installation-detail a:focus-visible,
.installation-list a:hover,
.installation-list a:focus-visible {
    color: var(--warn);
}

.installation-land-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.85rem;
}

.installation-land-tab {
    appearance: none;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 0.35rem;
    cursor: pointer;
}

.installation-land-tab:hover,
.installation-land-tab:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    outline: none;
}

.installation-land-tab.is-selected {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.anlaggningar-layout {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 900px) {
    .anlaggningar-layout {
        grid-template-columns: minmax(16rem, 22rem) 1fr;
        align-items: start;
    }
}

/* Accordion: Förband → Bataljon → Anläggning (collapsed by default).
   Avoid display:grid on closed <details> — breaks native hide (see info-tree). */
.installation-tree {
    margin: 0;
}

.installation-tree__roots,
.installation-battalion-tree,
.installation-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.installation-battalion-tree {
    margin: 0.35rem 0 0.15rem 0.55rem;
    gap: 0.25rem;
}

.installation-forband-details,
.installation-battalion-details {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.installation-forband-details[open],
.installation-battalion-details[open] {
    display: block;
}

.installation-forband-title,
.installation-battalion-title {
    list-style: none;
    cursor: pointer;
    user-select: none;
    font: inherit;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
}

.installation-forband-title::-webkit-details-marker,
.installation-battalion-title::-webkit-details-marker {
    display: none;
}

.installation-forband-title::after,
.installation-battalion-title::after {
    content: "▸";
    margin-left: 0.4rem;
    color: var(--accent);
    font-size: 0.75rem;
}

.installation-forband-details[open] > .installation-forband-title::after,
.installation-battalion-details[open] > .installation-battalion-title::after {
    content: "▾";
}

.installation-battalion-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.installation-forband-details:not([open]) > .installation-battalion-tree,
.installation-battalion-details:not([open]) > .installation-list {
    display: none;
}

.installation-list {
    margin: 0.35rem 0 0.35rem 0.55rem;
}

.installation-site,
.installation-part {
    width: 100%;
    text-align: left;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    cursor: pointer;
}

.installation-site {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: baseline;
}

.installation-site.is-selected,
.installation-part.is-selected {
    border-color: var(--accent);
    color: var(--accent);
}

.installation-parts {
    list-style: none;
    margin: 0.35rem 0 0.5rem 0.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.installation-waiting-tag {
    flex: 0 0 auto;
    font-size: 0.68rem;
    color: var(--muted);
}

.installation-detail {
    margin-bottom: 0.85rem;
}

.installation-detail h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}

.installation-detail p {
    margin: 0.35rem 0 0;
}

.installation-map {
    height: min(70vh, 640px);
    min-height: 360px;
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0c1929;
    z-index: 0;
}

.installation-map .leaflet-container {
    font-family: var(--font);
    background: #0c1929;
    height: 100%;
    width: 100%;
    border-radius: 10px;
}

/* Baskarteväxlare (Karta / Satellit) — mörk yta, amber accent */
.installation-map .leaflet-control-layers {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    box-shadow: none;
}

.installation-map .leaflet-control-layers-toggle {
    background-color: var(--surface);
    border-radius: 8px;
}

.installation-map .leaflet-control-layers-expanded {
    padding: 0.55rem 0.7rem;
    min-width: 8.5rem;
}

.installation-map .leaflet-control-layers label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.2rem 0;
    font-size: 0.85rem;
    color: var(--text);
}

.installation-map .leaflet-control-layers input {
    accent-color: var(--accent);
}

.installation-map .leaflet-control-layers-separator {
    border-top-color: var(--border);
}

.anlaggningar-marker {
    width: auto;
    min-width: 1.6rem;
    height: 1.55rem;
    padding: 0 0.32rem;
    border-radius: 4px;
    font-size: 0.68rem;
    /* Inherit solid fallback from .hemso-marker; kind modifiers override when present. */
    background: #64748b;
    color: #fff;
}

.hemso-marker--battery {
    background: var(--accent);
    color: #1a1200;
}

.hemso-marker--kaj {
    background: var(--ok);
    color: #052e16;
}

.hemso-marker--entrance {
    background: #06b6d4;
    color: #042f2e;
}

.hemso-marker--cm12 {
    background: #f59e0b;
    color: #1a1200;
}

.hemso-marker--mm57 {
    background: #0ea5e9;
    color: #fff;
}

.hemso-marker--depot,
.installation-legend-sample--depot {
    background: #e2e8f0;
    color: #0f172a;
}

.hemso-marker--lv,
.installation-legend-sample--lv {
    background: #d946ef;
    color: #fff;
}

.hemso-marker--torn,
.installation-legend-sample--torn {
    background: #fbbf24;
    color: #1a1200;
}

.hemso-marker--radar,
.installation-legend-sample--radar {
    background: #38bdf8;
    color: #082f49;
}

.hemso-marker--inslag,
.installation-legend-sample--inslag {
    background: #06b6d4;
    color: #042f2e;
}

.hemso-marker--matstation,
.installation-legend-sample--matstation {
    background: #a3e635;
    color: #1a2e05;
}

.hemso-marker--minstation,
.installation-legend-sample--minstation {
    background: #e11d48;
    color: #fff;
}

.hemso-marker--robotbatteri,
.installation-legend-sample--robot {
    background: #6366f1;
    color: #fff;
}

.hemso-marker--kc,
.installation-legend-sample--kc {
    background: #0f766e;
    color: #fff;
}

.hemso-marker--fyr,
.installation-legend-sample--fyr {
    background: #f97316;
    color: #1a1200;
}

.hemso-marker--regemente,
.installation-legend-sample--regemente {
    background: #9a3412;
    color: #fff;
}

.hemso-marker--stuga,
.installation-legend-sample--stuga {
    background: #166534;
    color: #fff;
}

.hemso-marker--barack,
.installation-legend-sample--barack {
    background: #57534e;
    color: #fff;
}

.hemso-marker--stralkastare,
.installation-legend-sample--stralkastare {
    background: #fef08a;
    color: #422006;
}

.hemso-marker--lfc,
.installation-legend-sample--lfc {
    background: #1e3a8a;
    color: #fff;
}

.hemso-marker--radarstation,
.installation-legend-sample--radarstation {
    background: #6d28d9;
    color: #fff;
}

.hemso-marker--docka,
.installation-legend-sample--docka {
    background: #1d4ed8;
    color: #fff;
}

.hemso-marker--bergrum,
.installation-legend-sample--bergrum {
    background: #78716c;
    color: #fff;
}

.hemso-marker--kalvarson,
.installation-legend-sample--kalvarson {
    background: #059669;
    color: #fff;
}

.hemso-marker--hamn,
.installation-legend-sample--hamn {
    background: #075985;
    color: #fff;
}

.anlaggningar-marker.is-estimated {
    border-style: dashed;
    opacity: 0.78;
}

.anlaggningar-marker.is-selected {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.85);
}

.installation-tip {
    background: rgba(15, 20, 25, 0.92);
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 4px;
    box-shadow: none;
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 6px;
}

.installation-tip::before {
    border-right-color: rgba(15, 20, 25, 0.92);
}

.installation-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    margin-top: 0.75rem;
}

.installation-legend .map-legend-sample {
    width: auto;
    min-width: 1.15rem;
    height: auto;
    min-height: 1.15rem;
    padding: 0.1rem 0.28rem;
    border-radius: 3px;
    font-size: 0.62rem;
}

.installation-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
